text:
import math
import csv
from .eigen import *

try:
    # Python 2
    from StringIO import StringIO
except ImportError:
    # Python 3
    from io import StringIO

def median(lst):
    lst = sorted(lst)
    if len(lst) < 1:
            return None
    if len(lst) % 2 == 1:
            return lst[((len(lst)+1) // 2)-1]
    if len(lst) % 2 == 0:
            return float(sum(lst[(len(lst) // 2)-1:(len(lst) // 2)+1]))/2.0

class ResultSet(object):
    """A class to hold the results of a tournament."""

    def __init__(self, players, turns, repetitions, outcome,
                 with_morality=True):
        """
        Args:
            players (list): a list of player objects.
            turns (int): the number of turns per interaction.
            repetitions (int): the number of time the round robin was repeated.
            outcome (dict): returned from the RoundRobin class and containing
                various sets of results for processing by this class.
            with_morality (bool): a flag to determine whether morality metrics
                should be calculated.
        """
        self.players = players
        self.nplayers = len(players)
        self.turns = turns
        self.repetitions = repetitions
        self.outcome = outcome
        self.results = self._results(outcome)
        self.scores = None
        self.normalised_scores = None
        self.ranking = None
        self.ranked_names = None
        self.payoff_matrix = None
        self.cooperation = None
        self.normalised_cooperation = None
        self.vengeful_cooperation = None
        self.cooperating_rating = None
        self.good_partner_matrix = None
        self.good_partner_rating = None
        self.eigenjesus_rating = None
        self.eigenmoses_rating = None
        if 'payoff' in self.results:
            self.scores = self._scores(self.results['payoff'])
            self.normalised_scores = self._normalised_scores(self.scores)
            self.ranking = self._ranking(self.scores)
            self.ranked_names = self._ranked_names(self.ranking)
            self.payoff_matrix, self.payoff_stddevs = (
                self._payoff_matrix(self.results['payoff']))
        if 'cooperation' in self.results and with_morality:
            self.cooperation = self._cooperation(self.results['cooperation'])
            self.normalised_cooperation = (
                self._normalised_cooperation(self.cooperation))
            self.vengeful_cooperation = (
                self._vengeful_cooperation(self.normalised_cooperation))
            self.cooperating_rating = self._cooperating_rating(self.cooperation)
            self.good_partner_matrix = (
                self._good_partner_matrix(self.results['cooperation']))
            self.good_partner_rating = (
                self._good_partner_rating(self.good_partner_matrix))
            self.eigenjesus_rating = (
                self._eigenvector(self.normalised_cooperation))
            self.eigenmoses_rating = (
                self._eigenvector(self.vengeful_cooperation))

    @property
    def _null_results_matrix(self):
        """
        Returns:
            A null matrix (i.e. fully populated with zero values) using
            lists of the form required for the results dictionary.

            i.e. one row per player, containing one element per opponent (in order
            of player index) which lists values for each repetition.
        """
        plist = list(range(self.nplayers))
        replist = list(range(self.repetitions))
        return [[[0 for r in replist] for j in plist] for i in plist]

    @property
    def _null_matrix(self):
        """
        Returns:
            A null n by n matrix where n is the number of players.
        """
        plist = list(range(self.nplayers))
        return [[0 for j in plist] for i in plist]

    def _results(self, outcome):
        """
        Args:
            outcome(dict): the outcome dictionary, in which the values are
                lists of the form:

                    [
                        [[a, b, c], [d, e, f], [g, h, i]],
                        [[j, k, l], [m, n, o], [p, q, r]],
                    ]

                i.e. one row per repetition, containing one element per player,
                which lists values for each opponent in order of player index.

        Returns:
            A results dictionary, in which the values are lists of
            the form:

                [
                    [[a, j], [b, k], [c, l]],
                    [[d, m], [e, n], [f, o]],
                    [[g, p], [h, q], [i, r]],
                ]

            i.e. one row per player, containing one element per opponent (in order
            of player index) which lists values for each repetition.
        """
        results = {}
        for result_type, result_list in outcome.items():
            matrix = self._null_results_matrix
            for index, result_matrix in enumerate(result_list):
                for i in range(len(self.players)):
                    for j in range(len(self.players)):
                        matrix[i][j][index] = result_matrix[i][j]
                results[result_type] = matrix
        return results

    def _scores(self, payoff):
        """
        Args:
            payoff (list): a matrix of the form:

                [
                    [[a, j], [b, k], [c, l]],
                    [[d, m], [e, n], [f, o]],
                    [[g, p], [h, q], [i, r]],
                ]

            i.e. one row per player, containing one element per opponent (in
            order of player index) which lists payoffs for each repetition.

        Returns:
            A scores matrix of the form:

                [
                    [a + b + c, j + k + l],
                    [d + e + f, m + n+ o],
                    [h + h + i, p + q + r],
                ]

            i.e. one row per player which lists the total score for each
            repetition.

        In Axelrod's original tournament, there were no self-interactions
        (e.g. player 1 versus player 1) and so these are also excluded from the
        scores here by the condition on ip and ires.
        """
        scores = []
        for ires, res in enumerate(payoff):
            scores.append([])
            for irep in range(self.repetitions):
                scores[-1].append(0)
                for ip in range(self.nplayers):
                    if ip != ires:
                        scores[-1][-1] += res[ip][irep]
        return scores

    def _normalised_scores(self, scores):
        """
        Args:
            scores (list): the scores matrix (S)

        Returns:
            A normalised scores matrix (N) such that:

                N = S / t

            where t is the total number of turns played per repetition for a given
            player excluding self-interactions.
        """
        normalisation = self.turns * (self.nplayers - 1)
        return [
            [1.0 * s / normalisation for s in r] for r in scores]

    def _ranking(self, scores):
        """
        Args:
            scores (list): the scores matrix (S)

        Returns:
            A list of players (their index within the players list rather than
            a player instance) ordered by median score
        """
        ranking = sorted(
            range(self.nplayers),
            key=lambda i: -median(scores[i]))
        return ranking

    def _ranked_names(self, ranking):
        """
        Args:
            ranking (list): A list of player index numbers

        Returns:
             A list of players names sorted by their ranked order.
        """
        ranked_names = [str(self.players[i]) for i in ranking]
        return ranked_names

    def _payoff_matrix(self, payoff):
        """
        Args:
            payoff (list): a matrix of the form:

                [
                    [[a, j], [b, k], [c, l]],
                    [[d, m], [e, n], [f, o]],
                    [[g, p], [h, q], [i, r]],
                ]

            i.e. one row per player, containing one element per opponent (in
            order of player index) which lists payoffs for each repetition.

        Returns:
            A per-turn averaged payoff matrix and its stddevs.
        """
        averages = []
        stddevs = []
        for res in payoff:
            averages.append([])
            stddevs.append([])
            for s in res:
                perturn = [1.0 * rep / self.turns for rep in s]
                avg = sum(perturn) / self.repetitions
                dev = math.sqrt(
                    sum([(avg - pt)**2 for pt in perturn]) / self.repetitions)
                averages[-1].append(avg)
                stddevs[-1].append(dev)
        return averages, stddevs

    def _cooperation(self, results):
        """
        Args:
            results (list): a matrix of the form:

                [
                    [[a, j], [b, k], [c, l]],
                    [[d, m], [e, n], [f, o]],
                    [[g, p], [h, q], [i, r]],
                ]

            i.e. one row per player, containing one element per opponent (in
            order of player index) which lists cooperation values for each
            repetition.

        Returns:
            The cooperation matrix (C) of the form:

                [
                    [[a + j], [b + k], [c + l]],
                    [[d + m], [e + n], [f + o]],
                    [[g + p], [h + q], [i + r]],
                ]

            i.e. an n by n matrix where n is the number of players. Each row (i)
            andcolumn (j) represents an individual player and the the value Cij
            is the number of times player i cooperated against opponent j.
        """
        return[[sum(element) for element in row] for row in results]

    def _normalised_cooperation(self, cooperation):
        """
        Args:
            cooperation (list): the cooperation matrix (C)

        Returns:
            A matrix (N) such that:

                N = C / t

            where t is the total number of turns played in the tournament.
        """
        turns = self.turns * self.repetitions
        return[
            [1.0 * element / turns for element in row]
            for row in cooperation]

    def _vengeful_cooperation(self, cooperation):
        """
        Args:
            cooperation(list): A cooperation matrix (C)

        Returns:
            A matrix (D) such that:

                Dij = 2(Cij -0.5)
        """
        return [[2 * (element - 0.5) for element in row] for row in cooperation]

    def _cooperating_rating(self, cooperation):
        """
        Args:
            cooperation (list): the cooperation matrix

        Returns:
            a list of cooperation rates ordered by player index"""
        total_turns = self.turns * self.repetitions * self.nplayers
        return [1.0 * sum(row) / total_turns for row in cooperation]

    def _good_partner_matrix(self, results):
        """
        Args:
            results (list): cooperation results matrix of the form:

                [
                    [[a, j], [b, k], [c, l]],
                    [[d, m], [e, n], [f, o]],
                    [[g, p], [h, q], [i, r]],
                ]

            i.e. one row per player, containing one element per opponent (in
            order of player index) which lists cooperation values for each
            repetition.

        Returns:
            The good partner matrix (P) of the form:

                [
                    [0, 0 + (1 if b >= d) + (1 if k >= m), 0 + (1 if c >= g) + (1 if l >= p) ],
                    [0 + (1 if e >= g) + (1 if n >= p), 0, 0 + (1 if f >= h) + (1 if o >= q)],
                    [0 + (1 if g >= c) + (1 if p >= l), 0 + (1 if h >= f) + (1 if q >= o), 0]
                ]

            i.e. an n by n matrix where n is the number of players. Each row (i)
            and column (j) represents an individual player and the the value Pij
            is the sum of the number of repetitions where player i cooperated as
            often or more than opponent j.
        """
        matrix = self._null_matrix
        for r in range(self.repetitions):
            for i in range(self.nplayers):
                for j in range(self.nplayers):
                    if i != j and results[i][j][r] >= results[j][i][r]:
                        matrix[i][j] += 1
        return matrix

    @property
    def _interactions(self):
        """
        Returns:
            the number of interactions between players excluding
            self-interactions.
        """
        return self.repetitions * (self.nplayers - 1)

    def _good_partner_rating(self, good_partner):
        """
        Args:
            good_partner (list): the good partner matrix

        Returns:
            a list of good partner ratings ordered by player index.
        """
        return [1.0 * sum(row) / self._interactions for row in good_partner]

    def _eigenvector(self, cooperation):
        """
        Args:
            cooperation (list): a cooperation matrix

        Returns:
            the principal eigenvector of the cooperation matrix as a list.
        """
        eigenvector, eigenvalue = principal_eigenvector(cooperation, 1000, 1e-3)
        return eigenvector.tolist()

    def csv(self):
        csv_string = StringIO()
        header = ",".join(self.ranked_names) + "\n"
        csv_string.write(header)
        writer = csv.writer(csv_string, lineterminator="\n")
        for irep in range(self.repetitions):
            data = [self.normalised_scores[rank][irep]
                    for rank in self.ranking]
            writer.writerow(list(map(str, data)))
        return csv_string.getvalue()


text:
#ifndef RESOURCELOADEDEVENT_H
#define	RESOURCELOADEDEVENT_H

#include <string>
#include <functional>

#include <Engine/Event/IEvent.hpp>
#include <Engine/Model.hpp>

namespace Engine
{
	namespace Event
	{
		template <typename ResourceType>
		class ResourceLoadedEvent : public IEvent
		{
		public:
			/**
			 * Constructor.
			 *
			 * @param name Name of the resource loaded.
			 * @param loadedSuccessfully Was the resource loaded successfully?
			 * @param resource Shared pointer to the loaded resource.
			 * @param callback Callback function.
			 */
			ResourceLoadedEvent(std::string name, bool loadedSuccessfully,
				std::shared_ptr<ResourceType> resource,
				std::function<void(const ResourceLoadedEvent&)> callback)
			: m_name(name)
			, m_loadedSuccessfully(loadedSuccessfully)
			, m_resource(resource)
			, m_callback(callback)
			{
				// Nothing to do.
			}

			/**
			 * Destructor.
			 */
			virtual ~ResourceLoadedEvent()
			{
				// Nothing to do.
			}

			/**
			 * Returns the name of the resource that was loaded.
			 *
			 * @return Name of the resource.
			 */
			std::string GetName() const
			{
				return m_name;
			}

			/**
			 * Returns true if the resource was loaded successfully.
			 *
			 * @return True if the resource was successfully loaded.
			 */
			bool WasSuccessful() const
			{
				return m_loadedSuccessfully;
			}

			/**
			 * Returns a pointer to the loaded resource.
			 *
			 * @return Pointer to the loaded resource.
			 */
			std::shared_ptr<ResourceType> GetResource() const
			{
				return m_resource;
			}

			/**
			 * Returns the callback function that should be executed
			 * once the resource has been completely loaded.
			 */
			std::function<void(const ResourceLoadedEvent&)> GetCallback() const
			{
				return m_callback;
			}

		private:
			/**
			 * Name to identify the resource.
			 */
			std::string m_name;

			/**
			 * Flag that indicates whether the resource was loaded
			 * successfully.
			 */
			bool m_loadedSuccessfully;

			/**
			 * Shared pointer to the loaded resource.
			 */
			std::shared_ptr<ResourceType> m_resource;

			/**
			 * Callback function.
			 */
			std::function<void(const ResourceLoadedEvent&)> m_callback;
		};
	}
}

#endif

redpajama_set_name: RedPajamaGithub


text:
My Messages

                    Connecting to Chat Server ...

                       Chat Offline

Sometimes the Chat Server goes down, we apologies for the inconvenience, please try reconnecting.

                         Re-connect

                    Inbox

 0">{{conversation.unread_message_count}}

{{pFull}}

                                         ...

{{conversation.last_message.received_at| date:'EEE HH:mm'}}

                          6">Load more

                            No Messages

                        {{p}}

                        Select a message to start chatting

                                        Report abuse / spam

                            This user is blocked.

                                            Loading messages...

                                                {{message.sent_at| date:'EEE HH:mm'}}

                                                {{meFull}}

                                                    {{p}}

  Read

                            <textarea ng-model="emojiMessage.messagetext" id="sendMessageTextArea"  ng-disabled="!selectedConversation" placeholder="Write your message here..." ng-class="{disabled: !selectedConversation}" ></textarea>

                            <button id="sendMessageButton" class="button primary" ng-disabled="!selectedConversation || !emojiMessage.messagetext"
                                    ng-click="sendMessage(selectedConversation, emojiMessage.messagetext,'text/plain')" >{{sendText}}</button>


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta name="viewport" content="height=device-height">
  <title>Basic SimplePanorama Demo</title>
  <link rel="stylesheet" href="public/simple-panorama.css" />


text:
<?php include_once("header.php");?>

Ajuda / Suporte

Mussum ipsum cacilds, vidis litro abertis. Consetis adipiscings elitis. Pra lá , depois divoltis porris, paradis.

Home

Ajuda/Suporte

Video Tutorial de Instalação

Veja o passo a passo da instalação do Repertório Digital. Paisis, filhis, espiriti Paisis, filhis, espiritis santis. Consetis adipiscings elitis.

Manual do Usuário

Baixe aqui o arquivo em PDF do Manual de Utilização do sistema. Mussum ipsum cacilds, vidis litro abertis. Consetis adipiscings elitis. Pra lá , depois divoltis porris, paradis. Paisis, filhis, espiriti Paisis, filhis, espiritis santis.

Video Tutorial de Utilização

Exemplo de Repertorização utilizando o software. Paisis, filhis, espiriti Paisis, filhis, espiritis santis.

Suporte Online

Clique aqui para baixar o Team Viewer para suporte online. Mussum ipsum cacilds, vidis litro abertis. Consetis adipiscings elitis. Pra lá , depois divoltis porris, paradis. Paisis, filhis, espiriti Paisis, filhis, espiritis santis.

<?php include_once("footer.php");?>


text:
using System;
using System.Xml.Linq;
using JetBrains.Annotations;

namespace AD.OpenXml.Markdown
{
    /// <inheritdoc cref="MNode"/>
    /// <summary>
    /// Represents a Markdown node.
    /// </summary>
    /// <remarks>
    /// See: http://spec.commonmark.org
    /// </remarks>
    [PublicAPI]
    public class MParagraph : MNode, IEquatable<MParagraph>
    {
        /// <summary>
        /// The raw text of the node.
        /// </summary>
        public MText Text { get; }

        /// <summary>
        /// Constructs an <see cref="MParagraph"/>.
        /// </summary>
        /// <param name="text">The raw text of the node.</param>
        public MParagraph(in ReadOnlySpan<char> text) => Text = Normalize(text);

        /// <summary>
        /// Normalizes the segment by trimming outer whitespace and reducing inner whitespace.
        /// </summary>
        /// <param name="span">The span to normalize.</param>
        /// <returns>
        /// The normalized segment.
        /// </returns>
        static ReadOnlySpan<char> Normalize(in ReadOnlySpan<char> span) => span.Trim();

        /// <inheritdoc />
        [Pure]
        public override string ToString() => Text.ToString();

        /// <inheritdoc />
        [Pure]
        public override XNode ToHtml()
            => new XElement("p",
                Text.ToHtml());

        /// <inheritdoc />
        [Pure]
        public override XNode ToOpenXml()
            => new XElement(W + "p",
                new XElement(W + "r",
                    Text.ToOpenXml()));

        /// <inheritdoc />
        [Pure]
        public bool Equals([CanBeNull] MParagraph other) => other != null && Text.Equals(other.Text);

        /// <inheritdoc />
        [Pure]
        public override bool Equals(object obj) => obj is MParagraph node && Equals(node);

        /// <inheritdoc />
        [Pure]
        public override int GetHashCode() => Text.GetHashCode();

        /// <summary>
        /// Returns a value that indicates whether the values of two <see cref="T:AD.OpenXml.Markdown.MParagraph" /> objects are equal.
        /// </summary>
        /// <param name="left">The first value to compare.</param>
        /// <param name="right">The second value to compare.</param>
        /// <returns>
        /// True if the <paramref name="left" /> and <paramref name="right" /> parameters have the same value; otherwise, false.
        /// </returns>
        [Pure]
        public static bool operator ==([CanBeNull] MParagraph left, [CanBeNull] MParagraph right)
            => !(left is null) && !(right is null) && left.Equals(right);

        /// <summary>
        /// Returns a value that indicates whether two <see cref="T:AD.OpenXml.Markdown.MParagraph" /> objects have different values.
        /// </summary>
        /// <param name="left">The first value to compare.</param>
        /// <param name="right">The second value to compare.</param>
        /// <returns>
        /// True if <paramref name="left" /> and <paramref name="right" /> are not equal; otherwise, false.
        /// </returns>
        [Pure]
        public static bool operator !=([CanBeNull] MParagraph left, [CanBeNull] MParagraph right)
            => left is null || right is null || !left.Equals(right);
    }
}


text:
package org.apache.gora.mongodb.store;

import static org.junit.Assert.assertEquals;

import java.io.IOException;

import org.apache.gora.examples.generated.WebPage;
import org.apache.gora.mongodb.store.MongoMapping.DocumentFieldType;
import org.junit.Test;

public class TestMongoMappingBuilder {

  @Test
  public void testMultiMapping_Webpage() throws IOException {
    MongoStore<String, WebPage> store = new MongoStore<>();
    store.setKeyClass(String.class);
    store.setPersistentClass(WebPage.class);
    MongoMappingBuilder<String, WebPage> builder = new MongoMappingBuilder<>(
        store);
    builder.fromFile("/multimapping.xml");
    MongoMapping mapping = builder.build();

    // Check collection name
    assertEquals("frontier", mapping.getCollectionName());
    mapping.renameCollection("frontier", "newNameForFrontier");
    assertEquals("newNameForFrontier", mapping.getCollectionName());

    // Check field names
    assertEquals("baseUrl", mapping.getDocumentField("baseUrl"));
    assertEquals("status", mapping.getDocumentField("status"));
    assertEquals("fetchTime", mapping.getDocumentField("fetchTime"));
    assertEquals("prevFetchTime", mapping.getDocumentField("prevFetchTime"));
    assertEquals("fetchInterval", mapping.getDocumentField("fetchInterval"));
    assertEquals("retriesSinceFetch",
        mapping.getDocumentField("retriesSinceFetch"));
    assertEquals("modifiedTime", mapping.getDocumentField("modifiedTime"));
    assertEquals("protocolStatus", mapping.getDocumentField("protocolStatus"));
    assertEquals("content", mapping.getDocumentField("content"));
    assertEquals("contentType", mapping.getDocumentField("contentType"));
    assertEquals("prevSignature", mapping.getDocumentField("prevSignature"));
    assertEquals("title", mapping.getDocumentField("title"));
    assertEquals("text", mapping.getDocumentField("text"));
    assertEquals("parseStatus", mapping.getDocumentField("parseStatus"));
    assertEquals("score", mapping.getDocumentField("score"));
    assertEquals("reprUrl", mapping.getDocumentField("reprUrl"));
    assertEquals("headers", mapping.getDocumentField("headers"));
    assertEquals("outlinks", mapping.getDocumentField("outlinks"));
    assertEquals("inlinks", mapping.getDocumentField("inlinks"));
    assertEquals("markers", mapping.getDocumentField("markers"));
    assertEquals("metadata", mapping.getDocumentField("metadata"));

    // Check field types
    assertEquals(DocumentFieldType.STRING,
        mapping.getDocumentFieldType("baseUrl"));
    assertEquals(DocumentFieldType.INT32,
        mapping.getDocumentFieldType("status"));
    assertEquals(DocumentFieldType.INT64,
        mapping.getDocumentFieldType("fetchTime"));
    assertEquals(DocumentFieldType.INT64,
        mapping.getDocumentFieldType("prevFetchTime"));
    assertEquals(DocumentFieldType.INT32,
        mapping.getDocumentFieldType("fetchInterval"));
    assertEquals(DocumentFieldType.INT32,
        mapping.getDocumentFieldType("retriesSinceFetch"));
    assertEquals(DocumentFieldType.INT64,
        mapping.getDocumentFieldType("modifiedTime"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("protocolStatus"));
    assertEquals(DocumentFieldType.BINARY,
        mapping.getDocumentFieldType("content"));
    assertEquals(DocumentFieldType.STRING,
        mapping.getDocumentFieldType("contentType"));
    assertEquals(DocumentFieldType.BINARY,
        mapping.getDocumentFieldType("prevSignature"));
    assertEquals(DocumentFieldType.STRING,
        mapping.getDocumentFieldType("title"));
    assertEquals(DocumentFieldType.STRING, mapping.getDocumentFieldType("text"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("parseStatus"));
    assertEquals(DocumentFieldType.DOUBLE,
        mapping.getDocumentFieldType("score"));
    assertEquals(DocumentFieldType.STRING,
        mapping.getDocumentFieldType("reprUrl"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("headers"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("outlinks"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("inlinks"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("markers"));
    assertEquals(DocumentFieldType.DOCUMENT,
        mapping.getDocumentFieldType("metadata"));
  }
}


text:
module NavbarHelper
  def nav_link_class_for(nav_link)
    classes = []
    classes << 'nav-link'
    classes << 'active' if nav_link == content_for(:active_tab)
    classes.join ' '
  end
end


text:
package com.logginghub.logging.transaction;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(value = RetentionPolicy.RUNTIME) public @interface DestinationType {
    Class<?> type();
}


text:
<?php
/**
 *
 */
namespace Home\Controller;

class UploadifyController extends BaseController {

	public function upload(){
		$func = I('func');
		$path = I('path','temp');
		$info = array(
				'num'=> I('num'),
				'title' => '',
				'upload' =>U('Admin/Ueditor/imageUp',array('savepath'=>$path,'pictitle'=>'banner','dir'=>'logo')),
				'size' => '4M',
				'type' =>'jpg,png,gif,jpeg',
				'input' => I('input'),
				'func' => empty($func) ? 'undefined' : $func,
		);
		$this->assign('info',$info);
		$this->display();
	}

	/*
	 删除上传的图片
	*/
	public function delupload(){
		$action=isset($_GET['action']) ? $_GET['action'] : null;
		$filename= isset($_GET['filename']) ? $_GET['filename'] : null;
		$filename= str_replace('../','',$filename);
		$filename= trim($filename,'.');
		$filename= trim($filename,'/');
		if($action=='del' && !empty($filename)){
			$size = getimagesize($filename);
			$filetype = explode('/',$size['mime']);
			if($filetype[0]!='image'){
				return false;
				exit;
			}
			unlink($filename);
			exit;
		}
	}
}


text:
import freedomMocker = require('../lib/freedom/mocks/mock-freedom-in-module-env');
import mockFreedomRtcPeerConnection = require('../lib/freedom/mocks/mock-rtcpeerconnection');

import freedom_mocks = require('../mocks/freedom-mocks');
declare var freedom: freedom.FreedomInModuleEnv;
freedom = freedomMocker.makeMockFreedomInModuleEnv({
    'core.storage': () => { return new freedom_mocks.MockFreedomStorage(); },
    'loggingcontroller': () => { return new freedom_mocks.MockLoggingController(); },
    'metrics': () => { return new freedom_mocks.MockMetrics(); },
    'core.tcpsocket': () => { return new freedom_mocks.MockTcpSocket(); },
    'core.rtcpeerconnection': () => { return new mockFreedomRtcPeerConnection(); },
    'pgp': () => { return new freedom_mocks.PgpProvider() },
    'portControl': () => { return new Object }
});

import local_instance = require('./local-instance');
import social = require('../interfaces/social');

describe('local_instance.LocalInstance', () => {

  var instance :local_instance.LocalInstance;
  var network = <social.Network><any>jasmine.createSpy('network');

  beforeEach(() => {
    spyOn(console, 'log');
  });

  it('initializes with valid id and keyhash', () => {
    instance = new local_instance.LocalInstance(network, 'fakeId');
    expect(instance.instanceId).toBeDefined();
  });

  // TODO: more specs.

});


text:
module Puzzle
  module Exception
    class ParamError < StandardError; end
    class LoginFail < StandardError; end
    class TokenFail < StandardError; end
    class PurchaseLowPoints < StandardError; end
    class ContactNotExist < StandardError; end
    class ContactNotOwned < StandardError; end
    class SearchError < StandardError; end
    class SysError < StandardError; end
    class NotImplemented < StandardError; end
    class NotAvailable < StandardError; end
  end
end


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

namespace Microsoft.WindowsAzure.Management.Store.Test.UnitTests.Cmdlet
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Management.Automation;
    using System.Management.Automation.Host;
    using Microsoft.WindowsAzure.Management.Store.Cmdlet;
    using Microsoft.WindowsAzure.Management.Store.Model;
    using Microsoft.WindowsAzure.Management.Store.Model.ResourceModel;
    using Microsoft.WindowsAzure.Management.Store.Properties;
    using Microsoft.WindowsAzure.Management.Test.Stubs;
    using Microsoft.WindowsAzure.Management.Test.Tests.Utilities;
    using Moq;
    using VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class SetAzureStoreAddOnTests : TestBase
    {
        Mock<ICommandRuntime> mockCommandRuntime;

        Mock<StoreClient> mockStoreClient;

        Mock<PowerShellCustomConfirmation> mockConfirmation;

        SetAzureStoreAddOnCommand cmdlet;

        [TestInitialize]
        public void SetupTest()
        {
            Management.Extensions.CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
            new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings();
            mockCommandRuntime = new Mock<ICommandRuntime>();
            mockStoreClient = new Mock<StoreClient>();
            mockConfirmation = new Mock<PowerShellCustomConfirmation>();
            cmdlet = new SetAzureStoreAddOnCommand()
            {
                StoreClient = mockStoreClient.Object,
                CommandRuntime = mockCommandRuntime.Object,
                CustomConfirmation = mockConfirmation.Object
            };
        }

        [TestMethod]
        public void SetAzureStoreAddOnWithSuccessful()
        {
            // Setup
            bool expected = true;
            string name = "TestAddOn";
            string addonId = "Search";
            string plan = "free";
            string message = "Expected message for set";
            cmdlet.Name = name;
            cmdlet.Plan = plan;
            WindowsAzureAddOn addon = new WindowsAzureAddOn(new Resource() { Type = addonId }, "West US", null);
            mockConfirmation.Setup(f => f.ShouldProcess(Resources.SetAddOnConformation, message)).Returns(true);
            mockStoreClient.Setup(f => f.TryGetAddOn(name, out addon)).Returns(true);
            mockStoreClient.Setup(f => f.UpdateAddOn(name, plan, null));
            mockStoreClient.Setup(f => f.GetConfirmationMessage(OperationType.Set, addonId, plan)).Returns(message);

            // Test
            cmdlet.ExecuteCmdlet();

            // Assert
            mockStoreClient.Verify(f => f.UpdateAddOn(name, plan, null), Times.Once());
            mockConfirmation.Verify(f => f.ShouldProcess(Resources.SetAddOnConformation, message), Times.Once());
            mockCommandRuntime.Verify(f => f.WriteObject(expected), Times.Never());
        }

        [TestMethod]
        public void SetAzureStoreAddOnWithPassThru()
        {
            // Setup
            bool expected = true;
            string name = "TestAddOn";
            string addonId = "Search";
            string plan = "free";
            string message = "Expected message for set";
            cmdlet.Name = name;
            cmdlet.Plan = plan;
            cmdlet.PassThru = true;
            WindowsAzureAddOn addon = new WindowsAzureAddOn(new Resource() { Type = addonId }, "West US", null);
            mockConfirmation.Setup(f => f.ShouldProcess(Resources.SetAddOnConformation, message)).Returns(true);
            mockStoreClient.Setup(f => f.TryGetAddOn(name, out addon)).Returns(true);
            mockStoreClient.Setup(f => f.UpdateAddOn(name, plan, null));
            mockStoreClient.Setup(f => f.GetConfirmationMessage(OperationType.Set, addonId, plan)).Returns(message);

            // Test
            cmdlet.ExecuteCmdlet();

            // Assert
            mockStoreClient.Verify(f => f.UpdateAddOn(name, plan, null), Times.Once());
            mockConfirmation.Verify(f => f.ShouldProcess(Resources.SetAddOnConformation, message), Times.Once());
            mockCommandRuntime.Verify(f => f.WriteObject(expected), Times.Once());
        }

        [TestMethod]
        public void SetAzureStoreAddOnWithNo()
        {
            // Setup
            bool expected = true;
            string name = "TestAddOn";
            string addonId = "Search";
            string plan = "free";
            string message = "Expected message for set";
            cmdlet.Name = name;
            cmdlet.Plan = plan;
            WindowsAzureAddOn addon = new WindowsAzureAddOn(new Resource() { Type = addonId }, "West US", null);
            mockConfirmation.Setup(f => f.ShouldProcess(Resources.SetAddOnConformation, message)).Returns(false);
            mockStoreClient.Setup(f => f.TryGetAddOn(name, out addon)).Returns(true);
            mockStoreClient.Setup(f => f.UpdateAddOn(name, plan, null));
            mockStoreClient.Setup(f => f.GetConfirmationMessage(OperationType.Set, addonId, plan)).Returns(message);

            // Test
            cmdlet.ExecuteCmdlet();

            // Assert
            mockStoreClient.Verify(f => f.UpdateAddOn(name, plan, null), Times.Never());
            mockConfirmation.Verify(f => f.ShouldProcess(Resources.SetAddOnConformation, message), Times.Once());
            mockCommandRuntime.Verify(f => f.WriteObject(expected), Times.Never());
        }
    }
}


text:
using UnityEngine;
using System.Collections;
using AssemblyCSharp;

public class Direction {
	public static IntVector2 RIGHT = new IntVector2(1, 0);
	public static IntVector2 DOWN = new IntVector2(0, -1);
	public static IntVector2 LEFT = new IntVector2(-1, 0);
	public static IntVector2 UP = new IntVector2(0, 1);

	public static IntVector2 opposite(IntVector2 dir) {
		if (dir == RIGHT) {
			return LEFT;
		} else if (dir == DOWN) {
			return UP;
		} else if (dir == LEFT) {
			return RIGHT;
		} else if (dir == UP) {
			return DOWN;
		}

		return null;
	}

	public static IntVector2 getDirection(int dir) {
		switch(dir) {
		case 0: return UP;
		case 1: return RIGHT;
		case 2: return DOWN;
		case 3: return LEFT;
		default: return null;
		}
	}

	public static IntVector2 getDirection(string dir) {
		switch(dir.ToUpper()) {
		case "U": return UP;
		case "R": return RIGHT;
		case "D": return DOWN;
		case "L": return LEFT;
		default: return null;
		}
	}

	public static string getDirectionChar(IntVector2 dir) {
		if (dir == UP) {
			return "U";
		} else if (dir == RIGHT) {
			return "R";
		} else if (dir == DOWN) {
			return "D";
		} else if (dir == LEFT) {
			return "L";
		}
		return null;
	}
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [("apostello", "0013_keyword_linked_groups"), ("site_config", "0006_auto_20160531_1955")]

    operations = [
        migrations.AddField(
            model_name="siteconfiguration",
            name="auto_add_new_groups",
            field=models.ManyToManyField(
                blank=True,
                help_text="Any brand new people will be added to the groups selected here",
                to="apostello.RecipientGroup",
            ),
        )
    ]


text:
def deprecation_warning():
    print("""

=============================================================================
*** DEPRECATION WARNING ***

Cookiecutter data science is moving to v2 soon, which will entail using
the command `ccds ...` rather than `cookiecutter ...`. The cookiecutter command
will continue to work, and this version of the template will still be available.
To use the legacy template, you will need to explicitly use `-c v1` to select it.

Please update any scripts/automation you have to append the `-c v1` option,
which is available now.

For example:
    cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
=============================================================================

    """)

deprecation_warning()


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>parent.ten.1054</artifactId>
    <groupId>org.jetbrains.idea</groupId>
    <version>10.5.4</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <groupId>org.jetbrains.idea</groupId>
  <artifactId>eclipse</artifactId>

  <name>Maven module for eclipse</name>
  <description>Maven integration for module eclipse</description>
  <build>
    <sourceDirectory>${idea.home}/plugins/eclipse/src</sourceDirectory>
    <resources>
      <resource>
        <directory>${idea.home}/plugins/eclipse/resources</directory>
        <excludes>
          <exclude>**/*.java</exclude>
          <exclude>**/*.groovy</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>${idea.home}/plugins/eclipse/src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
          <exclude>**/*.groovy</exclude>
        </excludes>
      </resource>
    </resources>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>openapi</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>bootstrap</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>compiler-openapi</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>idea-ui</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>java-impl</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>


text:
bool RainDrop::init() {
	m_hurt_purity = 0;
	return true;
}

Sprite* RainDrop::GetSprite() {
	return m_sprite;
}

void RainDrop::BindSprite(Sprite *sprite) {
	m_sprite = sprite;
	this->addChild(m_sprite);
}

bool RainDrop::IsCollideWithUmbrella(Umbrella *umbrella) {
	Rect umbrella_rect = umbrella->getBoundingBox();
	Point pos_umbrella = umbrella->getPosition ();
	Size visible_size = Director::getInstance()->getVisibleSize();

    Point rain_drop_pos = m_sprite->getPosition();
	//¼ÆËãÓêµÎʵ¼ÊλÖÃ
	if(pos_umbrella.x >  visible_size.width) {
		rain_drop_pos.x = rain_drop_pos.x + pos_umbrella.x - visible_size.width;
	}

	//ÅжÏÓêµÎÓëUmbrellaÊÇ·ñÏཻ
    return umbrella_rect.containsPoint(rain_drop_pos);
}

void RainDrop::SetHurtPurity(int hurt_purity) {
	m_hurt_purity = hurt_purity;
}

int RainDrop::GetHurtPurity() {
	return m_hurt_purity;
}


text:
module Utils.Array (sampleAtInterval) where

import Data.Array

sampleAtInterval :: Int -> Array Int a -> Array Int a
sampleAtInterval interval array = listArray (min, max) $ sample min []
    where min = (fst . bounds) array
          sourceMax = (snd . bounds) array
          max = sourceMax `div` interval
          sample i xs
            | i <= sourceMax  = sample (i + interval) $ (array ! i) : xs
            | otherwise = reverse xs


text:
<?php

namespace App;

use App\Harvest\Progress;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class SpiceHarvesterRecord extends Model
{
    use SoftDeletes;

    protected $softDelete = true;
    protected $dates = ['deleted_at'];
    protected $fillable = [
        'identifier',
        'type',
    ];

    public function harvest()
    {
        return $this->belongsTo('App\SpiceHarvesterHarvest', 'harvest_id');
    }

    public function item()
    {
        return $this->belongsTo('App\Item', 'item_id');
    }

    public function scopeFailed($query)
    {
        return $query->whereNotNull('failed_at');
    }

    public function process(callable $onProcess, Progress $progress)
    {
        try {
            $onProcess();

            $this->failed_at = null;
            $this->error_message = null;
        } catch (\Exception $e) {
            $this->failed_at = Carbon::now();
            $this->error_message = $e->getMessage();
            $progress->incrementFailed();
        } finally {
            if (!$this->deleted_at) {
                $this->save();
            }
        }
    }
}


text:
module StudentsHelper

  def name(num)
    Date::DAYNAMES[(Date.today + num).wday]
  end

  def day(num)
    Date.today + num
  end

  def time_greeting(time)
    if time < 12
      "Good morning, #{current_student.name}!"
    elsif 12 <= time && time <= 17
      "Good afternoon, #{current_student.name}!"
    else
      "Good night, #{current_student.name}!"
    end
  end

end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>vue-block</title>
    <meta name="description" content="Helping you build css grid like layout system."></meta>


text:
<?php

namespace jubianchi\PhpSwitch\PHP\Option\Enable;

class CalendarOption extends EnableOption
{
    const ARG = 'calendar';
}


text:
package android.support.v7.widget;

import android.view.View;

// Referenced classes of package android.support.v7.widget:
//            SearchView

class this._cls0
    implements android.view.ChangeListener
{

    final SearchView this$0;

    public void onLayoutChange(View view, int i, int j, int k, int l, int i1, int j1,
            int k1, int l1)
    {
        SearchView.access$300(SearchView.this);
    }

    r()
    {
        this$0 = SearchView.this;
        super();
    }
}


text:
import {makeBasketUri} from '../lib/util'
const models = [
 {
  text: "Aileen Lee",
   id: 1,
   profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/5640f90ce4b0cdd4e931af27/569024280ab377f58005c9ac/1452287073541/Aileen+Lee.jpg?format=300w",
   description: "Aileen Lee is an American seed investor who was a venture capital investor. She joined Kleiner Perkins Caufield & Byers in 1999 and was founding CEO of RMG Networks, a company backed by KPCB. She later founded Cowboy Ventures.",
   short_description: "Founder and partner at Cowboy Ventures",
   company: "Cowboy Ventures"
 },
 {
  text: "Jed Katz",
   id: 2,
   profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/5640f90ce4b0cdd4e931af27/56536d49e4b0a9af8dd8a7aa/1448308365810/Jed+Katz.jpg?format=300w",
   description: "One of the pioneers of Internet commerce, Jed has spent his career developing, advising and investing in early stage technology ventures. Prior to joining Javelin Venture Partners, Jed was a Managing Director of DFJ Gotham Ventures in New York. Prior to DFJ Gotham, Jed was the COO of Yamcon, the developer of the highly acclaimed "SkyScout", one of the best selling astronomy products of all time. ",
   short_description: "Managing Director of Javelin Venture Partners.",
   company: "Javelin Venture Partners"
 },
 {
  text: "Hunter Walk",
   id: 3,
   profile_url: "http://vni.s3.amazonaws.com/151006144918627.png",
   description: "Before Homebrew, Hunter led consumer product management at YouTube, starting when it was acquired by Google. He originally joined Google in 2003, managing product and sales efforts for AdSense, Google's contextual advertising business. His first job in Silicon Valley was as the founding product and marketing guy at Linden Lab. ",
   short_description: "Partner at Homebrew VC and former YouTube, Google, Second Life product lead",
   company: "Homebrew"
 },
  {
    text: "Dave McClure",
    id: 4,
    profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/5640f90ce4b0cdd4e931af27/5699347ea12f447c7c8df253/1452881046851/Dave+McClure.jpeg?format=300w",
    description: "Dave McClure is an entrepreneur and angel investor based in the San Francisco Bay Area, who founded and runs the business accelerator 500 Startups. He is often described as one of the super angel investors.",
    short_description: "Founder of 500 Startups",
    company: '500 Startups'
  },
  {
    text: "Cameron Teitelman",
    id: 5,
    profile_url: "http://www.youwebinc.com/data_prod/media/orginal/cameron-teitelman-headshot-6754.jpg",
    description: "Cameron created the first ever business accelerator affiliated with Stanford University. Providing student and alumni entrepreneurs with the highest chance of succeeding in their venture by removing the roadblocks to success through removing information, network, and resource barriers. Connecting them with free office space, legal, web services and most importantly mentorship with VCs, Angels, and seasoned entrepreneurs. ",
    short_description: "Founder and CEO of StartX",
    company: 'StartX'
  },
  {
    text: "Emily Kirsch",
    id: 6,
    profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/5640f90ce4b0cdd4e931af27/56c3cd89f699bb8d36e5f263/1455672738587/Emily+Kirsch.jpg?format=300w",
    description: "Startup founder, investor in BrightCurrent, UtilityAPI, PVComplete and Ra Power Management. Worked with former advisor to President Obama, Van Jones, at the Ella Baker Center. Launched and led the Green Jobs Corps, the Climate Action Coalition, and the Oakland Solar Mosaic Pilot. Author of Making Green Work and Creating Climate Action in Your Community. New Leaders Council Alumni and Young Climate Leaders Fellow.",
    short_description: "Co-Founder and CEO of Powerhouse, Solar Incubator and Accelerator.",
    company: 'Powerhouse'
  },
  {
    text: "Gil Penchina",
    id: 7,
    profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/5640f90ce4b0cdd4e931af27/56980c5a5dc6def158490435/1452805311882/Gil+Penchina.jpg?format=300w",
    description: "Gil Penchina is an American business manager. He was formerly the CEO of Wikia Inc., and the vice president and general manager, international at eBay",
    short_description: "Angel Investor in Linkedin, Wealthfront, AngelList, Indiegogo, Fastly, Vouch, Blockstream, UXPin",
    company: 'SuperAngel'
  },
  {
    text: "Paige Craig",
    id: 8,
    profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/56a661345827c3eac64f78ba/5640f91be4b0e6862edb2f1b/1456196504926/Robert+Scoble.jpg?format=300w",
    description: "Paige Craig is a Founder and General Partner of Arena Ventures. He is an experienced angel investor who has invested in over 110 startups in the last seven years, including companies like Lyft, AngelList, Wish, Postmates, Twitter, Styleseat, Zenpayroll, Quizup and more.",
    short_description: "Managing Partner at Arena Ventures",
    company: 'Arena Ventures'
  },
  {
    text: "Jenny Fielding",
    id: 9,
    profile_url: "http://static1.squarespace.com/static/56311fdae4b0b8356ef61530/5640f90ce4b0cdd4e931af27/56cbc338ab48def1a6f68aca/1456194931406/JennyFielding21.jpg?format=300w",
    description: "Jenny Fielding is a Managing Director at Techstars where she focuses on IoT/Hardware and FinTech. Previously, Jenny ran Ventures for BBC Worldwide where she invested in early stage digital media companies. She also founded BBC Labs, a corporate startup accelerator. Jenny has a long history in the tech industry, co-founding start-ups such as Switch-Mobile, a disruptive VoIP mobile software company, that was acquired in 2008.",
    short_description: "Managing Director at Techstars",
    company: 'Techstars'
  },
  {
    text: "Josh Elman",
    id: 10,
    profile_url: "https://gh-prod-ruby-images.s3.amazonaws.com/uploads/ama_post/logo/50/josh_elman.jpg",
    description: "Josh invests in entrepreneurs building social networks and platforms, mobile apps, new media, and connected devices. Josh currently serves on the boards of Medium, Meerkat, Operator, Discord, and Jelly. Josh also works closely with our investments in Nextdoor and Whosay. Josh led Greylock's investment in SmartThings, which was acquired by Samsung in 2014.",
    short_description: "Partner at Greylock, longtime product manager",
    company: 'Greylock'
  },
  {
    text: "Abigail Keifer",
    id: 11,
    profile_url: "http://blog.housewares.org/wp-content/uploads/2015/02/AKiefer_RedClay_Photo-resize-300x300.png",
    description: "Abigail co-founded Red Clay in 2011. Red Clay is a platform built to design exceptional products. It gives any company, from a startup to global enterprise, access to hundreds of vetted freelance designers and provides software to manage an entire design process to go from concept to prototyping within weeks.",
    short_description: "Co-Founder and CEO of Red Clay",
    company: 'Red Clay'
  },
  ///---- @TODO----//
  {
    text: "Anneke Jong",
    company: 'Reserve',
    id: 12,
    profile_url: "https://pbs.twimg.com/profile_images/621569881591287808/iNTQgOlD.jpg",
    description: "As VP of Operations & Marketing, Anneke leads the business side of Reserve. She joined the company from the Google Creative Lab where she led teams building the future of tech. A startup veteran, she is an experienced entrepreneur and storyteller who speaks and writes on topics related to technology and mentorship.",
    short_description: "VP of Operations and Marketing at Reserve"
  },
  {
    text: "Jeffrey Pfeffer",
    company: 'Stanford School',
    id: 13,
    profile_url: "https://www.gsb.stanford.edu/sites/gsb/files/styles/270x270/public/person_photos/SGSB-0349-Jeffrey_PfefferRT.jpg?itok=L8694Hyb",
    description: "Jeffrey Pfeffer, is an American business theorist and the Thomas D. Dee II Professor of Organizational Behavior at the Graduate School of Business, Stanford University, and is considered one of today's most influential management thinkers.",
    short_description: "Professor of Organizational Behavior at the Graduate School of Business, Stanford University"
  },
  {
    text: "Prayag Narula",
    company: 'LeadGenius',
    id: 14,
    profile_url: "http://inacademy.eu/executive-training/assets/img/Speaker/Prayag.jpg",
    description: "Prayag Narula is the co-founder and CEO at LeadGenius. LeadGenius is a demand generation automation company that use a combination of data mining, technology and crowdsourcing to automate and accelerate outbound sales and marketing for hundreds of mid-market and enterprise companies from around the world.",
    short_description: "Co-founder and CEO at LeadGenius"
  },
  {
    id: 15,
    text: "Rob May",
    company: 'Talla',
    profile_url: "https://pbs.twimg.com/profile_images/3778534559/26cd30c321797ee3d8a3cd7410fc57d0_400x400.png",
    description: "Rob May is the co-founder and CEO of Talla, a Massachusetts-based developer of an intelligent virtual assistant for recruiting teams.",
    short_description: "Co-founder and CEO at Talla"
  }
]
models.forEach((model) => {
  model.type = "Profile"
  model.uri = makeBasketUri(model)
})

export default models;


text:
package com.github.chaabaj.openid.apis.github

import akka.actor.ActorSystem
import com.github.chaabaj.openid.HttpClient
import com.github.chaabaj.openid.oauth._

import scala.concurrent.duration.FiniteDuration

trait GithubOAuthClient
  extends OAuthClient
    with SupportsIssuingAccessToken {
  override final type Provider = Github
}

private class GithubOAuthClientImpl(implicit actorSystem: ActorSystem, timeout: FiniteDuration)
  extends GithubOAuthClient {
  override val httpClient: HttpClient = HttpClient()

  override protected def accessTokenUrl: String = "https://api.github.com/users/whatever"
}

object GithubOAuthClient {
  def apply(implicit actorSystem: ActorSystem, timeout: FiniteDuration): GithubOAuthClient =
    new GithubOAuthClientImpl()
}


text:
@extends('layouts.error')
@section('content')

{{ trans('errors.503') }}

@endsection


text:
<?php

/**
 *   @file index.php
 *   @brief Splash page for subject guide creation
 *
 *   @author adarby
 *   @date mar 2011
 */

use SubjectsPlus\Control\Querier;

$subcat = "guides";
$page_title = "Modify Guides in SubjectsPlus";

include("../includes/config.php");
include("../includes/header.php");

$db = new Querier;

$gear_alt = _("Edit Guide Metadata");
$eye_alt = _("View Guide on Public Site");
$linkie_alt = _("Check Guide Links");
$view_alt = _("View Guide on Public Site");

try {
  } catch (Exception $e) {
  echo $e;
}

$subs_option_boxes = getSubBoxes("guide.php?subject_id=", "", 1);

$dropdown_intro_text = _("Please check with the guide's owner before modifying");

$all_guides = "
<form method=\"post\" action=\"index.php\" name=\"form\">
<select name=\"item\" id=\"guides\" size=\"1\" onChange=\"window.location=this.options[selectedIndex].value\">
<option value=\"\">" . _("-- Choose Guide --") . "</option>
$subs_option_boxes
</select>
</form>";

// Get all subjects associated with the person

$my_subs_query = "SELECT subject.subject_id, subject, subject.active, shortform, type
FROM `subject`, staff_subject, staff
WHERE staff.staff_id = staff_subject.staff_id
AND staff_subject.subject_id = subject.subject_id
AND staff.staff_id = '$_SESSION[staff_id]'
ORDER BY subject";

$my_subs_result = $db->query($my_subs_query);
$num_rows = count($my_subs_result);

if ($num_rows > 0) {

  $myguides = "";
  $row_count = 0;
  $colour1 = "#fff";
  $colour2 = "#F6E3E7";
  $colour3 = "highlight";

  foreach ($my_subs_result as $myrow1) {
    $mysubs_id = $myrow1[0];
    $mysubs_name = stripslashes($myrow1[1]);
    $active = $myrow1[2];

    $row_colour = ($row_count % 2) ? $colour1 : $colour2;

    $myguides .= "

            $mysubs_name";
    if ($active != "1") {
      $myguides .= " " . _("unpublished") . "";
    }
    $myguides .= " $myrow1[4]
";
    $row_count++;
  }
} else {
  $myguides = "
" . _("You don't have any guides yet.  Why not create one?") . "
";
}
?>

<link rel="stylesheet" href="<?php echo $AssetPath; ?>js/select2/select2.css" type="text/css" media="all" />

<?php print _("Edit Your Guides"); ?>

<?php print $myguides; ?>

<?php print _("All Guides"); ?>

<?php print $dropdown_intro_text; ?>

<?php print $all_guides; ?>

<?php print _("Create"); ?>

<?php print _("Make sure the guide doesn't already exist!"); ?>

<?php print _("Create new guide"); ?>

<?php print _("Import LibGuides"); ?>

You can use this feature to import LibGuides

       <?php print _("Import LibGuides"); ?>

<?php print _("Tips"); ?>

<i class="fa fa-gear fa-lg"  alt="<?php echo $gear_alt; ?>" title="<?php echo $gear_alt; ?>"> <?php print _("Edit Guide Metadata"); ?>

<i class="fa fa-eye fa-lg"  alt="<?php echo $eye_alt; ?>" title="<?php echo $eye_alt; ?>"> <?php print _("View Guide on Public Site"); ?>

<i class="fa fa-link fa-lg"  alt="<?php echo $linkie_alt; ?>" title="<?php echo $linkie_alt; ?>"> <?php print _("Check Guide Links"); ?>

<?php echo _("Need to delete a guide?  Use the gear icon, and use the Delete button."); ?>

<?php
include("../includes/footer.php");
?>


text:
package com.krishagni.catissueplus.rest.controller;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.krishagni.catissueplus.core.common.events.ConfigSettingDetail;
import com.krishagni.catissueplus.core.common.events.RequestEvent;
import com.krishagni.catissueplus.core.common.events.ResponseEvent;
import com.krishagni.catissueplus.core.common.service.ConfigurationService;

@Controller
@RequestMapping("/config-settings")
public class ConfigurationController {

	@Autowired
	private ConfigurationService cfgSvc;

	@RequestMapping(method = RequestMethod.GET)
	@ResponseStatus(HttpStatus.OK)
	@ResponseBody
	public List<ConfigSettingDetail> getConfigSettings(
			@RequestParam(value = "module", required = true)
			String moduleName) {

		RequestEvent<String> req = new RequestEvent<String>(moduleName);
		ResponseEvent<List<ConfigSettingDetail>> resp = cfgSvc.getSettings(req);
		resp.throwErrorIfUnsuccessful();
		return resp.getPayload();
	}

	@RequestMapping(method = RequestMethod.PUT)
	@ResponseStatus(HttpStatus.OK)
	@ResponseBody
	public ConfigSettingDetail saveConfigSetting(@RequestBody ConfigSettingDetail detail) {
		RequestEvent<ConfigSettingDetail> req = new RequestEvent<ConfigSettingDetail>(detail);
		ResponseEvent<ConfigSettingDetail> resp = cfgSvc.saveSetting(req);
		resp.throwErrorIfUnsuccessful();
		return resp.getPayload();
	}

	@RequestMapping(method = RequestMethod.GET, value="/locale")
	@ResponseStatus(HttpStatus.OK)
	@ResponseBody
	public Map<String, Object> getLocaleSettings() {
		return cfgSvc.getLocaleSettings();
	}
}


text:
//
// impl/use_future.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef BOOST_ASIO_IMPL_USE_FUTURE_HPP
#define BOOST_ASIO_IMPL_USE_FUTURE_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <boost/asio/detail/config.hpp>
#include <tuple>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/memory.hpp>
#include <boost/asio/dispatch.hpp>
#include <boost/system/error_code.hpp>
#include <boost/asio/execution.hpp>
#include <boost/asio/packaged_task.hpp>
#include <boost/system/system_error.hpp>
#include <boost/asio/system_executor.hpp>

#include <boost/asio/detail/push_options.hpp>

namespace boost {
namespace asio {
namespace detail {

#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

template <typename T, typename F, typename... Args>
inline void promise_invoke_and_set(std::promise<T>& p,
    F& f, BOOST_ASIO_MOVE_ARG(Args)... args)
{
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  try
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  {
    p.set_value(f(BOOST_ASIO_MOVE_CAST(Args)(args)...));
  }
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  catch (...)
  {
    p.set_exception(std::current_exception());
  }
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
}

template <typename F, typename... Args>
inline void promise_invoke_and_set(std::promise<void>& p,
    F& f, BOOST_ASIO_MOVE_ARG(Args)... args)
{
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  try
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  {
    f(BOOST_ASIO_MOVE_CAST(Args)(args)...);
    p.set_value();
  }
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  catch (...)
  {
    p.set_exception(std::current_exception());
  }
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
}

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

template <typename T, typename F>
inline void promise_invoke_and_set(std::promise<T>& p, F& f)
{
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  try
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  {
    p.set_value(f());
  }
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  catch (...)
  {
    p.set_exception(std::current_exception());
  }
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
}

template <typename F, typename Args>
inline void promise_invoke_and_set(std::promise<void>& p, F& f)
{
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  try
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  {
    f();
    p.set_value();
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  }
  catch (...)
  {
    p.set_exception(std::current_exception());
  }
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
}

#if defined(BOOST_ASIO_NO_EXCEPTIONS)

#define BOOST_ASIO_PRIVATE_PROMISE_INVOKE_DEF(n) \
  template <typename T, typename F, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  inline void promise_invoke_and_set(std::promise<T>& p, \
      F& f, BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  { \
    p.set_value(f(BOOST_ASIO_VARIADIC_MOVE_ARGS(n))); \
  } \
  \
  template <typename F, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  inline void promise_invoke_and_set(std::promise<void>& p, \
      F& f, BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  { \
    f(BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \
    p.set_value(); \
  } \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_PROMISE_INVOKE_DEF)
#undef BOOST_ASIO_PRIVATE_PROMISE_INVOKE_DEF

#else // defined(BOOST_ASIO_NO_EXCEPTIONS)

#define BOOST_ASIO_PRIVATE_PROMISE_INVOKE_DEF(n) \
  template <typename T, typename F, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  inline void promise_invoke_and_set(std::promise<T>& p, \
      F& f, BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  { \
    try \
    { \
      p.set_value(f(BOOST_ASIO_VARIADIC_MOVE_ARGS(n))); \
    } \
    catch (...) \
    { \
      p.set_exception(std::current_exception()); \
    } \
  } \
  \
  template <typename F, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  inline void promise_invoke_and_set(std::promise<void>& p, \
      F& f, BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  { \
    try \
    { \
      f(BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \
      p.set_value(); \
    } \
    catch (...) \
    { \
      p.set_exception(std::current_exception()); \
    } \
  } \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_PROMISE_INVOKE_DEF)
#undef BOOST_ASIO_PRIVATE_PROMISE_INVOKE_DEF

#endif // defined(BOOST_ASIO_NO_EXCEPTIONS)

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

// A function object adapter to invoke a nullary function object and capture
// any exception thrown into a promise.
template <typename T, typename F>
class promise_invoker
{
public:
  promise_invoker(const shared_ptr<std::promise<T> >& p,
      BOOST_ASIO_MOVE_ARG(F) f)
    : p_(p), f_(BOOST_ASIO_MOVE_CAST(F)(f))
  {
  }

  void operator()()
  {
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
    try
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
    {
      f_();
    }
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
    catch (...)
    {
      p_->set_exception(std::current_exception());
    }
#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  }

private:
  shared_ptr<std::promise<T> > p_;
  typename decay<F>::type f_;
};

// An executor that adapts the system_executor to capture any exeption thrown
// by a submitted function object and save it into a promise.
template <typename T, typename Blocking = execution::blocking_t::possibly_t>
class promise_executor
{
public:
  explicit promise_executor(const shared_ptr<std::promise<T> >& p)
    : p_(p)
  {
  }

  static BOOST_ASIO_CONSTEXPR Blocking query(execution::blocking_t)
  {
    return Blocking();
  }

  promise_executor<T, execution::blocking_t::possibly_t>
  require(execution::blocking_t::possibly_t) const
  {
    return promise_executor<T, execution::blocking_t::possibly_t>(p_);
  }

  promise_executor<T, execution::blocking_t::never_t>
  require(execution::blocking_t::never_t) const
  {
    return promise_executor<T, execution::blocking_t::never_t>(p_);
  }

  template <typename F>
  void execute(BOOST_ASIO_MOVE_ARG(F) f) const
  {
    execution::execute(
        boost::asio::require(system_executor(), Blocking()),
        promise_invoker<T, F>(p_, BOOST_ASIO_MOVE_CAST(F)(f)));
  }

#if !defined(BOOST_ASIO_NO_TS_EXECUTORS)
  execution_context& context() const BOOST_ASIO_NOEXCEPT
  {
    return system_executor().context();
  }

  void on_work_started() const BOOST_ASIO_NOEXCEPT {}
  void on_work_finished() const BOOST_ASIO_NOEXCEPT {}

  template <typename F, typename A>
  void dispatch(BOOST_ASIO_MOVE_ARG(F) f, const A&) const
  {
    promise_invoker<T, F>(p_, BOOST_ASIO_MOVE_CAST(F)(f))();
  }

  template <typename F, typename A>
  void post(BOOST_ASIO_MOVE_ARG(F) f, const A& a) const
  {
    system_executor().post(
        promise_invoker<T, F>(p_, BOOST_ASIO_MOVE_CAST(F)(f)), a);
  }

  template <typename F, typename A>
  void defer(BOOST_ASIO_MOVE_ARG(F) f, const A& a) const
  {
    system_executor().defer(
        promise_invoker<T, F>(p_, BOOST_ASIO_MOVE_CAST(F)(f)), a);
  }
#endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS)

  friend bool operator==(const promise_executor& a,
      const promise_executor& b) BOOST_ASIO_NOEXCEPT
  {
    return a.p_ == b.p_;
  }

  friend bool operator!=(const promise_executor& a,
      const promise_executor& b) BOOST_ASIO_NOEXCEPT
  {
    return a.p_ != b.p_;
  }

private:
  shared_ptr<std::promise<T> > p_;
};

// The base class for all completion handlers that create promises.
template <typename T>
class promise_creator
{
public:
  typedef promise_executor<T> executor_type;

  executor_type get_executor() const BOOST_ASIO_NOEXCEPT
  {
    return executor_type(p_);
  }

  typedef std::future<T> future_type;

  future_type get_future()
  {
    return p_->get_future();
  }

protected:
  template <typename Allocator>
  void create_promise(const Allocator& a)
  {
    BOOST_ASIO_REBIND_ALLOC(Allocator, char) b(a);
    p_ = std::allocate_shared<std::promise<T>>(b, std::allocator_arg, b);
  }

  shared_ptr<std::promise<T> > p_;
};

// For completion signature void().
class promise_handler_0
  : public promise_creator<void>
{
public:
  void operator()()
  {
    this->p_->set_value();
  }
};

// For completion signature void(error_code).
class promise_handler_ec_0
  : public promise_creator<void>
{
public:
  void operator()(const boost::system::error_code& ec)
  {
    if (ec)
    {
      this->p_->set_exception(
          std::make_exception_ptr(
            boost::system::system_error(ec)));
    }
    else
    {
      this->p_->set_value();
    }
  }
};

// For completion signature void(exception_ptr).
class promise_handler_ex_0
  : public promise_creator<void>
{
public:
  void operator()(const std::exception_ptr& ex)
  {
    if (ex)
    {
      this->p_->set_exception(ex);
    }
    else
    {
      this->p_->set_value();
    }
  }
};

// For completion signature void(T).
template <typename T>
class promise_handler_1
  : public promise_creator<T>
{
public:
  template <typename Arg>
  void operator()(BOOST_ASIO_MOVE_ARG(Arg) arg)
  {
    this->p_->set_value(BOOST_ASIO_MOVE_CAST(Arg)(arg));
  }
};

// For completion signature void(error_code, T).
template <typename T>
class promise_handler_ec_1
  : public promise_creator<T>
{
public:
  template <typename Arg>
  void operator()(const boost::system::error_code& ec,
      BOOST_ASIO_MOVE_ARG(Arg) arg)
  {
    if (ec)
    {
      this->p_->set_exception(
          std::make_exception_ptr(
            boost::system::system_error(ec)));
    }
    else
      this->p_->set_value(BOOST_ASIO_MOVE_CAST(Arg)(arg));
  }
};

// For completion signature void(exception_ptr, T).
template <typename T>
class promise_handler_ex_1
  : public promise_creator<T>
{
public:
  template <typename Arg>
  void operator()(const std::exception_ptr& ex,
      BOOST_ASIO_MOVE_ARG(Arg) arg)
  {
    if (ex)
      this->p_->set_exception(ex);
    else
      this->p_->set_value(BOOST_ASIO_MOVE_CAST(Arg)(arg));
  }
};

// For completion signature void(T1, ..., Tn);
template <typename T>
class promise_handler_n
  : public promise_creator<T>
{
public:
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

  template <typename... Args>
  void operator()(BOOST_ASIO_MOVE_ARG(Args)... args)
  {
    this->p_->set_value(
        std::forward_as_tuple(
          BOOST_ASIO_MOVE_CAST(Args)(args)...));
  }

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

#define BOOST_ASIO_PRIVATE_CALL_OP_DEF(n) \
  template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  void operator()(BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  {\
    this->p_->set_value( \
        std::forward_as_tuple( \
          BOOST_ASIO_VARIADIC_MOVE_ARGS(n))); \
  } \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_CALL_OP_DEF)
#undef BOOST_ASIO_PRIVATE_CALL_OP_DEF

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
};

// For completion signature void(error_code, T1, ..., Tn);
template <typename T>
class promise_handler_ec_n
  : public promise_creator<T>
{
public:
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

  template <typename... Args>
  void operator()(const boost::system::error_code& ec,
      BOOST_ASIO_MOVE_ARG(Args)... args)
  {
    if (ec)
    {
      this->p_->set_exception(
          std::make_exception_ptr(
            boost::system::system_error(ec)));
    }
    else
    {
      this->p_->set_value(
          std::forward_as_tuple(
            BOOST_ASIO_MOVE_CAST(Args)(args)...));
    }
  }

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

#define BOOST_ASIO_PRIVATE_CALL_OP_DEF(n) \
  template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  void operator()(const boost::system::error_code& ec, \
      BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  {\
    if (ec) \
    { \
      this->p_->set_exception( \
          std::make_exception_ptr( \
            boost::system::system_error(ec))); \
    } \
    else \
    { \
      this->p_->set_value( \
          std::forward_as_tuple( \
            BOOST_ASIO_VARIADIC_MOVE_ARGS(n))); \
    } \
  } \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_CALL_OP_DEF)
#undef BOOST_ASIO_PRIVATE_CALL_OP_DEF

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
};

// For completion signature void(exception_ptr, T1, ..., Tn);
template <typename T>
class promise_handler_ex_n
  : public promise_creator<T>
{
public:
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

  template <typename... Args>
  void operator()(const std::exception_ptr& ex,
      BOOST_ASIO_MOVE_ARG(Args)... args)
  {
    if (ex)
      this->p_->set_exception(ex);
    else
    {
      this->p_->set_value(
          std::forward_as_tuple(
            BOOST_ASIO_MOVE_CAST(Args)(args)...));
    }
  }

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

#define BOOST_ASIO_PRIVATE_CALL_OP_DEF(n) \
  template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  void operator()(const std::exception_ptr& ex, \
      BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  {\
    if (ex) \
      this->p_->set_exception(ex); \
    else \
    { \
      this->p_->set_value( \
          std::forward_as_tuple( \
            BOOST_ASIO_VARIADIC_MOVE_ARGS(n))); \
    } \
  } \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_CALL_OP_DEF)
#undef BOOST_ASIO_PRIVATE_CALL_OP_DEF

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
};

// Helper template to choose the appropriate concrete promise handler
// implementation based on the supplied completion signature.
template <typename> class promise_handler_selector;

template <>
class promise_handler_selector<void()>
  : public promise_handler_0 {};

template <>
class promise_handler_selector<void(boost::system::error_code)>
  : public promise_handler_ec_0 {};

template <>
class promise_handler_selector<void(std::exception_ptr)>
  : public promise_handler_ex_0 {};

template <typename Arg>
class promise_handler_selector<void(Arg)>
  : public promise_handler_1<Arg> {};

template <typename Arg>
class promise_handler_selector<void(boost::system::error_code, Arg)>
  : public promise_handler_ec_1<Arg> {};

template <typename Arg>
class promise_handler_selector<void(std::exception_ptr, Arg)>
  : public promise_handler_ex_1<Arg> {};

#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

template <typename... Arg>
class promise_handler_selector<void(Arg...)>
  : public promise_handler_n<std::tuple<Arg...> > {};

template <typename... Arg>
class promise_handler_selector<void(boost::system::error_code, Arg...)>
  : public promise_handler_ec_n<std::tuple<Arg...> > {};

template <typename... Arg>
class promise_handler_selector<void(std::exception_ptr, Arg...)>
  : public promise_handler_ex_n<std::tuple<Arg...> > {};

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

#define BOOST_ASIO_PRIVATE_PROMISE_SELECTOR_DEF(n) \
  template <typename Arg, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  class promise_handler_selector< \
    void(Arg, BOOST_ASIO_VARIADIC_TARGS(n))> \
      : public promise_handler_n< \
        std::tuple<Arg, BOOST_ASIO_VARIADIC_TARGS(n)> > {}; \
  \
  template <typename Arg, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  class promise_handler_selector< \
    void(boost::system::error_code, Arg, BOOST_ASIO_VARIADIC_TARGS(n))> \
      : public promise_handler_ec_n< \
        std::tuple<Arg, BOOST_ASIO_VARIADIC_TARGS(n)> > {}; \
  \
  template <typename Arg, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  class promise_handler_selector< \
    void(std::exception_ptr, Arg, BOOST_ASIO_VARIADIC_TARGS(n))> \
      : public promise_handler_ex_n< \
        std::tuple<Arg, BOOST_ASIO_VARIADIC_TARGS(n)> > {}; \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE_5(BOOST_ASIO_PRIVATE_PROMISE_SELECTOR_DEF)
#undef BOOST_ASIO_PRIVATE_PROMISE_SELECTOR_DEF

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

// Completion handlers produced from the use_future completion token, when not
// using use_future::operator().
template <typename Signature, typename Allocator>
class promise_handler
  : public promise_handler_selector<Signature>
{
public:
  typedef Allocator allocator_type;
  typedef void result_type;

  promise_handler(use_future_t<Allocator> u)
    : allocator_(u.get_allocator())
  {
    this->create_promise(allocator_);
  }

  allocator_type get_allocator() const BOOST_ASIO_NOEXCEPT
  {
    return allocator_;
  }

private:
  Allocator allocator_;
};

template <typename Function>
struct promise_function_wrapper
{
  explicit promise_function_wrapper(Function& f)
    : function_(BOOST_ASIO_MOVE_CAST(Function)(f))
  {
  }

  explicit promise_function_wrapper(const Function& f)
    : function_(f)
  {
  }

  void operator()()
  {
    function_();
  }

  Function function_;
};

#if !defined(BOOST_ASIO_NO_DEPRECATED)

template <typename Function, typename Signature, typename Allocator>
inline void asio_handler_invoke(Function& f,
    promise_handler<Signature, Allocator>* h)
{
  typename promise_handler<Signature, Allocator>::executor_type
    ex(h->get_executor());
  boost::asio::dispatch(ex, promise_function_wrapper<Function>(f));
}

template <typename Function, typename Signature, typename Allocator>
inline void asio_handler_invoke(const Function& f,
    promise_handler<Signature, Allocator>* h)
{
  typename promise_handler<Signature, Allocator>::executor_type
    ex(h->get_executor());
  boost::asio::dispatch(ex, promise_function_wrapper<Function>(f));
}

#endif // !defined(BOOST_ASIO_NO_DEPRECATED)

// Helper base class for async_result specialisation.
template <typename Signature, typename Allocator>
class promise_async_result
{
public:
  typedef promise_handler<Signature, Allocator> completion_handler_type;
  typedef typename completion_handler_type::future_type return_type;

  explicit promise_async_result(completion_handler_type& h)
    : future_(h.get_future())
  {
  }

  return_type get()
  {
    return BOOST_ASIO_MOVE_CAST(return_type)(future_);
  }

private:
  return_type future_;
};

// Return value from use_future::operator().
template <typename Function, typename Allocator>
class packaged_token
{
public:
  packaged_token(Function f, const Allocator& a)
    : function_(BOOST_ASIO_MOVE_CAST(Function)(f)),
      allocator_(a)
  {
  }

//private:
  Function function_;
  Allocator allocator_;
};

// Completion handlers produced from the use_future completion token, when
// using use_future::operator().
template <typename Function, typename Allocator, typename Result>
class packaged_handler
  : public promise_creator<Result>
{
public:
  typedef Allocator allocator_type;
  typedef void result_type;

  packaged_handler(packaged_token<Function, Allocator> t)
    : function_(BOOST_ASIO_MOVE_CAST(Function)(t.function_)),
      allocator_(t.allocator_)
  {
    this->create_promise(allocator_);
  }

  allocator_type get_allocator() const BOOST_ASIO_NOEXCEPT
  {
    return allocator_;
  }

#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

  template <typename... Args>
  void operator()(BOOST_ASIO_MOVE_ARG(Args)... args)
  {
    (promise_invoke_and_set)(*this->p_,
        function_, BOOST_ASIO_MOVE_CAST(Args)(args)...);
  }

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

  void operator()()
  {
    (promise_invoke_and_set)(*this->p_, function_);
  }

#define BOOST_ASIO_PRIVATE_CALL_OP_DEF(n) \
  template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  void operator()(BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
  {\
    (promise_invoke_and_set)(*this->p_, \
        function_, BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \
  } \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_CALL_OP_DEF)
#undef BOOST_ASIO_PRIVATE_CALL_OP_DEF

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

private:
  Function function_;
  Allocator allocator_;
};

#if !defined(BOOST_ASIO_NO_DEPRECATED)

template <typename Function,
    typename Function1, typename Allocator, typename Result>
inline void asio_handler_invoke(Function& f,
    packaged_handler<Function1, Allocator, Result>* h)
{
  typename packaged_handler<Function1, Allocator, Result>::executor_type
    ex(h->get_executor());
  boost::asio::dispatch(ex, promise_function_wrapper<Function>(f));
}

template <typename Function,
    typename Function1, typename Allocator, typename Result>
inline void asio_handler_invoke(const Function& f,
    packaged_handler<Function1, Allocator, Result>* h)
{
  typename packaged_handler<Function1, Allocator, Result>::executor_type
    ex(h->get_executor());
  boost::asio::dispatch(ex, promise_function_wrapper<Function>(f));
}

#endif // !defined(BOOST_ASIO_NO_DEPRECATED)

// Helper base class for async_result specialisation.
template <typename Function, typename Allocator, typename Result>
class packaged_async_result
{
public:
  typedef packaged_handler<Function, Allocator, Result> completion_handler_type;
  typedef typename completion_handler_type::future_type return_type;

  explicit packaged_async_result(completion_handler_type& h)
    : future_(h.get_future())
  {
  }

  return_type get()
  {
    return BOOST_ASIO_MOVE_CAST(return_type)(future_);
  }

private:
  return_type future_;
};

} // namespace detail

template <typename Allocator> template <typename Function>
inline detail::packaged_token<typename decay<Function>::type, Allocator>
use_future_t<Allocator>::operator()(BOOST_ASIO_MOVE_ARG(Function) f) const
{
  return detail::packaged_token<typename decay<Function>::type, Allocator>(
      BOOST_ASIO_MOVE_CAST(Function)(f), allocator_);
}

#if !defined(GENERATING_DOCUMENTATION)

#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

template <typename Allocator, typename Result, typename... Args>
class async_result<use_future_t<Allocator>, Result(Args...)>
  : public detail::promise_async_result<
      void(typename decay<Args>::type...), Allocator>
{
public:
  explicit async_result(
    typename detail::promise_async_result<void(typename decay<Args>::type...),
      Allocator>::completion_handler_type& h)
    : detail::promise_async_result<
        void(typename decay<Args>::type...), Allocator>(h)
  {
  }
};

template <typename Function, typename Allocator,
    typename Result, typename... Args>
class async_result<detail::packaged_token<Function, Allocator>, Result(Args...)>
  : public detail::packaged_async_result<Function, Allocator,
      typename result_of<Function(Args...)>::type>
{
public:
  explicit async_result(
    typename detail::packaged_async_result<Function, Allocator,
      typename result_of<Function(Args...)>::type>::completion_handler_type& h)
    : detail::packaged_async_result<Function, Allocator,
        typename result_of<Function(Args...)>::type>(h)
  {
  }
};

#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

template <typename Allocator, typename Result>
class async_result<use_future_t<Allocator>, Result()>
  : public detail::promise_async_result<void(), Allocator>
{
public:
  explicit async_result(
    typename detail::promise_async_result<
      void(), Allocator>::completion_handler_type& h)
    : detail::promise_async_result<void(), Allocator>(h)
  {
  }
};

template <typename Function, typename Allocator, typename Result>
class async_result<detail::packaged_token<Function, Allocator>, Result()>
  : public detail::packaged_async_result<Function, Allocator,
      typename result_of<Function()>::type>
{
public:
  explicit async_result(
    typename detail::packaged_async_result<Function, Allocator,
      typename result_of<Function()>::type>::completion_handler_type& h)
    : detail::packaged_async_result<Function, Allocator,
        typename result_of<Function()>::type>(h)
  {
  }
};

#define BOOST_ASIO_PRIVATE_ASYNC_RESULT_DEF(n) \
  template <typename Allocator, \
      typename Result, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  class async_result<use_future_t<Allocator>, \
      Result(BOOST_ASIO_VARIADIC_TARGS(n))> \
    : public detail::promise_async_result< \
        void(BOOST_ASIO_VARIADIC_DECAY(n)), Allocator> \
  { \
  public: \
    explicit async_result( \
      typename detail::promise_async_result< \
        void(BOOST_ASIO_VARIADIC_DECAY(n)), \
        Allocator>::completion_handler_type& h) \
      : detail::promise_async_result< \
          void(BOOST_ASIO_VARIADIC_DECAY(n)), Allocator>(h) \
    { \
    } \
  }; \
  \
  template <typename Function, typename Allocator, \
      typename Result, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
  class async_result<detail::packaged_token<Function, Allocator>, \
      Result(BOOST_ASIO_VARIADIC_TARGS(n))> \
    : public detail::packaged_async_result<Function, Allocator, \
        typename result_of<Function(BOOST_ASIO_VARIADIC_TARGS(n))>::type> \
  { \
  public: \
    explicit async_result( \
      typename detail::packaged_async_result<Function, Allocator, \
        typename result_of<Function(BOOST_ASIO_VARIADIC_TARGS(n))>::type \
        >::completion_handler_type& h) \
      : detail::packaged_async_result<Function, Allocator, \
          typename result_of<Function(BOOST_ASIO_VARIADIC_TARGS(n))>::type>(h) \
    { \
    } \
  }; \
  /**/
  BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_ASYNC_RESULT_DEF)
#undef BOOST_ASIO_PRIVATE_ASYNC_RESULT_DEF

#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)

namespace traits {

#if !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)

template <typename T, typename Blocking>
struct equality_comparable<
    boost::asio::detail::promise_executor<T, Blocking> >
{
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
};

#endif // !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)

#if !defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)

template <typename T, typename Blocking, typename Function>
struct execute_member<
    boost::asio::detail::promise_executor<T, Blocking>, Function>
{
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
  typedef void result_type;
};

#endif // !defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)

#if !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_TRAIT)

template <typename T, typename Blocking, typename Property>
struct query_static_constexpr_member<
    boost::asio::detail::promise_executor<T, Blocking>,
    Property,
    typename boost::asio::enable_if<
      boost::asio::is_convertible<
        Property,
        boost::asio::execution::blocking_t
      >::value
    >::type
  >
{
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  typedef Blocking result_type;

  static BOOST_ASIO_CONSTEXPR result_type value() BOOST_ASIO_NOEXCEPT
  {
    return Blocking();
  }
};

#endif // !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_TRAIT)

#if !defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)

template <typename T, typename Blocking>
struct require_member<
    boost::asio::detail::promise_executor<T, Blocking>,
    execution::blocking_t::possibly_t
  >
{
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  typedef boost::asio::detail::promise_executor<T,
      execution::blocking_t::possibly_t> result_type;
};

template <typename T, typename Blocking>
struct require_member<
    boost::asio::detail::promise_executor<T, Blocking>,
    execution::blocking_t::never_t
  >
{
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  typedef boost::asio::detail::promise_executor<T,
      execution::blocking_t::never_t> result_type;
};

#endif // !defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)

} // namespace traits

#endif // !defined(GENERATING_DOCUMENTATION)

} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_IMPL_USE_FUTURE_HPP


text:
import * as React from 'react';
import TooltipOptions from '../tooltip/TooltipOptions';

declare namespace AutoComplete {

    type OptionGroupTemplateType = React.ReactNode | ((suggestion: any, index: number) => React.ReactNode);

    type ItemTemplateType = React.ReactNode | ((suggestion: any, index: number) => React.ReactNode);

    type SelectedItemTemplateType = React.ReactNode | ((value: any) => React.ReactNode);

    interface ChangeTargetOptions {
        name: string;
        id: string;
        value: any;
    }

    interface ChangeParams {
        originalEvent: React.SyntheticEvent;
        value: any;
        stopPropagation(): void;
        preventDefault(): void;
        target: ChangeTargetOptions;
    }

    interface SelectParams {
        originalEvent: React.SyntheticEvent;
        value: any;
    }

    interface UnselectParams extends SelectParams { }

    interface DropdownClickParams {
        originalEvent: React.SyntheticEvent;
        query: string;
    }

    interface CompleteMethodParams {
        originalEvent: React.SyntheticEvent;
        query: string;
    }

    interface AutoCompleteProps {
        id?: string;
        inputRef?: React.Ref<HTMLInputElement>;
        value?: any;
        name?: string;
        type?: string;
        suggestions?: any[];
        field?: string;
        optionGroupLabel?: string;
        optionGroupChildren?: string;
        optionGroupTemplate?: OptionGroupTemplateType;
        forceSelection?: boolean;
        autoHighlight?: boolean;
        scrollHeight?: string;
        dropdown?: boolean;
        dropdownMode?: string;
        multiple?: boolean;
        minLength?: number;
        delay?: number;
        style?: object;
        className?: string;
        inputId?: string;
        inputStyle?: object;
        inputClassName?: string;
        panelClassName?: string;
        panelStyle?: object;
        placeholder?: string;
        readOnly?: boolean;
        disabled?: boolean;
        maxlength?: number;
        size?: number;
        appendTo?: HTMLElement | string;
        tabIndex?: number;
        autoFocus?: boolean;
        tooltip?: string;
        tooltipOptions?: TooltipOptions;
        ariaLabelledBy?: string;
        completeMethod?(e: CompleteMethodParams): void;
        itemTemplate?: ItemTemplateType;
        selectedItemTemplate?: SelectedItemTemplateType;
        transitionOptions?: object;
        onChange?(e: ChangeParams): void;
        onFocus?(event: React.FormEvent<HTMLInputElement>): void;
        onBlur?(event: React.FormEvent<HTMLInputElement>): void;
        onSelect?(e: SelectParams): void;
        onUnselect?(e: UnselectParams): void;
        onDropdownClick?(e: DropdownClickParams): void;
        onClick?(event: React.MouseEvent<HTMLElement>): void;
        onDblClick?(event: React.MouseEvent<HTMLElement>): void;
        onMouseDown?(event: React.MouseEvent<HTMLElement>): void;
        onKeyUp?(event: React.KeyboardEvent<HTMLInputElement>): void;
        onKeyPress?(event: React.KeyboardEvent<HTMLInputElement>): void;
        onContextMenu?(event: React.MouseEvent<HTMLElement>): void;
        onClear?(event: React.SyntheticEvent): void;
        onShow?(): void;
        onHide?(): void;
    }
}

export declare class AutoComplete extends React.Component<AutoComplete.AutoCompleteProps, any> { }


text:
package cm

import (
	"github.com/golang/glog"
	"k8s.io/api/core/v1"

	internalapi "k8s.io/kubernetes/pkg/kubelet/apis/cri"
	"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
	kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
	"k8s.io/kubernetes/pkg/kubelet/lifecycle"
	"k8s.io/kubernetes/pkg/kubelet/status"
	"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
)

type containerManagerStub struct{}

var _ ContainerManager = &containerManagerStub{}

func (cm *containerManagerStub) Start(_ *v1.Node, _ ActivePodsFunc, _ status.PodStatusProvider, _ internalapi.RuntimeService) error {
	glog.V(2).Infof("Starting stub container manager")
	return nil
}

func (cm *containerManagerStub) SystemCgroupsLimit() v1.ResourceList {
	return v1.ResourceList{}
}

func (cm *containerManagerStub) GetNodeConfig() NodeConfig {
	return NodeConfig{}
}

func (cm *containerManagerStub) GetMountedSubsystems() *CgroupSubsystems {
	return &CgroupSubsystems{}
}

func (cm *containerManagerStub) GetQOSContainersInfo() QOSContainersInfo {
	return QOSContainersInfo{}
}

func (cm *containerManagerStub) UpdateQOSCgroups() error {
	return nil
}

func (cm *containerManagerStub) Status() Status {
	return Status{}
}

func (cm *containerManagerStub) GetNodeAllocatableReservation() v1.ResourceList {
	return nil
}

func (cm *containerManagerStub) GetCapacity() v1.ResourceList {
	return nil
}

func (cm *containerManagerStub) NewPodContainerManager() PodContainerManager {
	return &podContainerManagerStub{}
}

func (cm *containerManagerStub) GetResources(pod *v1.Pod, container *v1.Container) (*kubecontainer.RunContainerOptions, error) {
	return &kubecontainer.RunContainerOptions{}, nil
}

func (cm *containerManagerStub) UpdatePluginResources(*schedulercache.NodeInfo, *lifecycle.PodAdmitAttributes) error {
	return nil
}

func (cm *containerManagerStub) InternalContainerLifecycle() InternalContainerLifecycle {
	return &internalContainerLifecycleImpl{cpumanager.NewFakeManager()}
}

func NewStubContainerManager() ContainerManager {
	return &containerManagerStub{}
}


text:
angular
    .module("elevatorApp")
    .controller("SourceEditorController", SourceEditorController);

function SourceEditorController($scope) {

    ///////////////////////////
    // SCOPE DATA
    ///////////////////////////

    // Initialize the HTML editor
    $scope.aceOptions = {
      useWrapMode : true,
      showGutter : true,
      showPrintMargin: true,
      highlightActiveLine: true,
      theme: 'chrome',
      mode: 'vhdl',
      firstLineNumber: 1,
      onLoad: aceLoaded,
      onChange: aceChanged
    };

    ////////////////////////////
    // SCOPE METHODS
    ////////////////////////////

    $scope.msg = alertimpl;

    ////////////////////////////
    // IMPLEMENTATIONS
    ////////////////////////////

    function aceLoaded (editor) {
        $scope._editor = editor;
        editor.setOptions({fontSize: '12pt'});
    }

    function aceChanged (editor) {
    }

    function alertimpl( msg ) {
        alert(msg);
    }

} // !SourceEditorController


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.amiApi = exports.agi = exports.Ami = void 0;
var Ami_1 = require("./Ami");
Object.defineProperty(exports, "Ami", { enumerable: true, get: function () { return Ami_1.Ami; } });
var agi = require("./agi");
exports.agi = agi;
var amiApi = require("./amiApi");
exports.amiApi = amiApi;


text:
import {async, ComponentFixture, TestBed} from '@angular/core/testing';

import {TweetsListComponent} from './tweets-list.component';

describe('TweetsListComponent', () => {
  let component: TweetsListComponent;
  let fixture: ComponentFixture<TweetsListComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [TweetsListComponent]
    })
      .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(TweetsListComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component).toBeTruthy();
  });
});


text:
/*jshint node:true*/
var sass = require('node-sass');
var Jimp = require('jimp');
var deasync = require('deasync');
var fs = require('fs');

const imagesDirectory = "public/assets/images"

module.exports = {
  name: 'banner-based-brand-color',

  isDevelopingAddon: function() {
    return true;
  },

  included: function(app, parentAddon) {
    var _this = this;
    var red = undefined;
    var green = undefined;
    var blue = undefined;

    app.options.sassOptions = {
      functions: {
        "brand_color_from_banner": function() {
          var files = fs.readdirSync(imagesDirectory);
          var fileName = undefined;

          files.forEach(function (file_name){
            if( file_name.indexOf("banner") > -1 ) {
              fileName = file_name;
            }
          });

          Jimp.read(imagesDirectory+"/"+fileName, function(err, banner) {
            _this.ui.writeLine("Calculating Brand Color");
            if(err){
              _this.ui.writeLine(err);
              red = 0;
              green = 0;
              blue = 0;
            } else {
              // Calculate the average of the RGB values
              var red_total = 0;
              var green_total = 0;
              var blue_total = 0;

              banner.scan(0, 0, banner.bitmap.width, banner.bitmap.height, function (x, y, idx) {
                red_total   = red_total + this.bitmap.data[ idx + 0 ];
                green_total = green_total + this.bitmap.data[ idx + 1 ];
                blue_total  = blue_total + this.bitmap.data[ idx + 2 ];
              });
              var pixel_count = banner.bitmap.width * banner.bitmap.height;
              red = red_total/pixel_count;
              green = green_total/pixel_count;
              blue = blue_total/pixel_count;
              _this.ui.writeLine("Brand Color: rgb("+red+","+green+","+blue+")");
            }
          });
          // Wait for the async fileRead methods to complete before returning a value
          deasync.loopWhile( function() {
            return (red === undefined || green === undefined || blue === undefined);
          });

          return new sass.types.Color(red, green, blue);
        }
      }
    };

  }
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--><!-- The contents of this file will be loaded for each web application --><Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

    <Resource acquireIncrement="1" driverClass="com.mysql.jdbc.Driver" factory="org.apache.naming.factory.BeanFactory" initialPoolSize="1" jdbcUrl="jdbc:mysql://113.90.31.17:3306/dosport" maxIdleTime="120" maxPoolSize="2" minPoolSize="1" name="jdbc/dosport" password="880115" type="com.mchange.v2.c3p0.ComboPooledDataSource" user="root"/>
</Context>


text:
'use strict';

angular.
  module('xClient').
  config(['$locationProvider' ,'$routeProvider',
    function config($locationProvider, $routeProvider) {
      $locationProvider.hashPrefix('!');

      $routeProvider.
		when('/xlocate', {
	      template:'<xlocate-list></xlocate-list>'
		}).
        otherwise('');
    }
  ]);


text:
#import "Versioning.h"

NSString *SCNetworkReachabilityKitVersionString()
{
	// The implementation assumes that the raw C-language version string
	// terminates with null. It also trims assuming that the very last character
	// is a terminating line feed. Also assumes UTF-8 encoding.
	static NSString *__strong versionString;
	if (versionString == nil)
	{
		versionString = [[NSString stringWithCString:(const char *)kSCNetworkReachabilityKitVersionString encoding:NSUTF8StringEncoding] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
	}
	return versionString;
}