text:
/*	$NetBSD: pfkey.c,v 1.1 2012/01/06 14:21:16 drochner Exp $	*/
/*	$KAME: ipsec.c,v 1.33 2003/07/25 09:54:32 itojun Exp $	*/

/*
 * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the project nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/*
 * Copyright (c) 1983, 1988, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "from: @(#)inet.c	8.4 (Berkeley) 4/20/94";
#else
#ifdef __NetBSD__
__RCSID("$NetBSD: pfkey.c,v 1.1 2012/01/06 14:21:16 drochner Exp $");
#endif
#endif
#endif /* not lint */

#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>

#ifdef IPSEC
#include <netipsec/keysock.h>
#endif

#include <err.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "netstat.h"

#ifdef IPSEC

static const char *pfkey_msgtypenames[] = {
	"reserved", "getspi", "update", "add", "delete",
	"get", "acquire", "register", "expire", "flush",
	"dump", "x_promisc", "x_pchange", "x_spdupdate", "x_spdadd",
	"x_spddelete", "x_spdget", "x_spdacquire", "x_spddump", "x_spdflush",
	"x_spdsetidx", "x_spdexpire", "x_spddelete2"
};

static const char *pfkey_msgtype_names(int);

static const char *
pfkey_msgtype_names(int x)
{
	const int max =
	    sizeof(pfkey_msgtypenames)/sizeof(pfkey_msgtypenames[0]);
	static char buf[20];

	if (x < max && pfkey_msgtypenames[x])
		return pfkey_msgtypenames[x];
	snprintf(buf, sizeof(buf), "#%d", x);
	return buf;
}

void
pfkey_stats(u_long off, const char *name)
{
	uint64_t pfkeystat[PFKEY_NSTATS];
	int first, type;

	if (use_sysctl) {
		size_t size = sizeof(pfkeystat);

		if (sysctlbyname("net.key.stats", pfkeystat, &size,
				 NULL, 0) == -1)
			return;
	} else {
		warnx("%s stats not available via KVM.", name);
		return;
	}

	printf ("%s:\n", name);

#define	p(f, m) if (pfkeystat[f] || sflag <= 1) \
    printf(m, (unsigned long long)pfkeystat[f], plural(pfkeystat[f]))

	/* userland -> kernel */
	p(PFKEY_STAT_OUT_TOTAL, "\t%llu request%s sent from userland\n");
	p(PFKEY_STAT_OUT_BYTES, "\t%llu byte%s sent from userland\n");
	for (first = 1, type = 0; type < 256; type++) {
		if (pfkeystat[PFKEY_STAT_OUT_MSGTYPE + type] == 0)
			continue;
		if (first) {
			printf("\thistogram by message type:\n");
			first = 0;
		}
		printf("\t\t%s: %llu\n", pfkey_msgtype_names(type),
		    (unsigned long long)pfkeystat[PFKEY_STAT_OUT_MSGTYPE + type]);
	}
	p(PFKEY_STAT_OUT_INVLEN, "\t%llu message%s with invalid length field\n");
	p(PFKEY_STAT_OUT_INVVER, "\t%llu message%s with invalid version field\n");
	p(PFKEY_STAT_OUT_INVMSGTYPE, "\t%llu message%s with invalid message type field\n");
	p(PFKEY_STAT_OUT_TOOSHORT, "\t%llu message%s too short\n");
	p(PFKEY_STAT_OUT_NOMEM, "\t%llu message%s with memory allocation failure\n");
	p(PFKEY_STAT_OUT_DUPEXT, "\t%llu message%s with duplicate extension\n");
	p(PFKEY_STAT_OUT_INVEXTTYPE, "\t%llu message%s with invalid extension type\n");
	p(PFKEY_STAT_OUT_INVSATYPE, "\t%llu message%s with invalid sa type\n");
	p(PFKEY_STAT_OUT_INVADDR, "\t%llu message%s with invalid address extension\n");

	/* kernel -> userland */
	p(PFKEY_STAT_IN_TOTAL, "\t%llu request%s sent to userland\n");
	p(PFKEY_STAT_IN_BYTES, "\t%llu byte%s sent to userland\n");
	for (first = 1, type = 0; type < 256; type++) {
		if (pfkeystat[PFKEY_STAT_IN_MSGTYPE + type] == 0)
			continue;
		if (first) {
			printf("\thistogram by message type:\n");
			first = 0;
		}
		printf("\t\t%s: %llu\n", pfkey_msgtype_names(type),
		    (unsigned long long)pfkeystat[PFKEY_STAT_IN_MSGTYPE + type]);
	}
	p(PFKEY_STAT_IN_MSGTARGET + KEY_SENDUP_ONE,
	    "\t%llu message%s toward single socket\n");
	p(PFKEY_STAT_IN_MSGTARGET + KEY_SENDUP_ALL,
	    "\t%llu message%s toward all sockets\n");
	p(PFKEY_STAT_IN_MSGTARGET + KEY_SENDUP_REGISTERED,
	    "\t%llu message%s toward registered sockets\n");
	p(PFKEY_STAT_IN_NOMEM, "\t%llu message%s with memory allocation failure\n");
#undef p
}
#endif /*IPSEC*/


text:
require 'em-synchrony/em-http'

module Rhinestone
  class HttpClient
    takes :hostname, :header_filter

    def get(path)
      response = EM::HttpRequest.new("http://#{hostname}#{path}").get(:redirects => 5)
      headers = response.response_header
      return Rhinestone::Response.new(headers.status,
                                      header_filter.filter(headers),
                                      response.response)
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
VERSION = (0, 4, 1)
__version__ = '.'.join(map(str, VERSION))

_none_type = 0xc0ffee
_available_languages = None

class KeyDoesNotExist(Exception):
    pass

def get_url(key, language=None, fail_silently=False):
    global _available_languages

    from django.conf import settings
    from django.core.cache import cache
    from django.utils.translation import get_language, override
    from keyed_urls.models import KeyedURL

    if _available_languages is None:
        _available_languages = [row[0] for row in settings.LANGUAGES]

    language = language if language is not None else get_language()

    # Django 1.6 comes with trans_real.get_supported_language_variant;
    # earlier versions do not. We are being fast and cheap here.
    if language not in _available_languages:
        language = language.split('-')[0]

    cache_key = 'keyed_urls:%s:%s' % (key, language)

    url = cache.get(cache_key)

    if url is None:
        try:
            instance = KeyedURL.objects.get(key=key)
        except KeyedURL.DoesNotExist:
            # We can be smart here and initialize the cache for all
            # languages.
            cache.set_many(dict((
                'keyed_urls:%s:%s' % (key, language),
                _none_type,
                ) for language, _ in settings.LANGUAGES
            ))
            url = None

        else:
            with override(language=language):
                url = instance.url

            cache.set(cache_key, _none_type if url is None else url, 120)

    if url == _none_type:
        url = None

    if url is None and not fail_silently:
        raise KeyDoesNotExist('No match found for key "%s".' % key)

    return None if url == _none_type else url

def get_forwarding_url(key, language=None):
    from django.core.urlresolvers import reverse
    from django.utils.translation import override

    if language is None:
        return reverse('keyed_url_forward', kwargs={'key': key})
    with override(language):
        return reverse('keyed_url_forward', kwargs={'key': key})


text:
package internal

import (
	"fmt"

	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/kube-openapi/pkg/schemaconv"
	"k8s.io/kube-openapi/pkg/util/proto"
	"sigs.k8s.io/structured-merge-diff/v4/typed"
)

// groupVersionKindExtensionKey is the key used to lookup the
// GroupVersionKind value for an object definition from the
// definition's "extensions" map.
const groupVersionKindExtensionKey = "x-kubernetes-group-version-kind"

type gvkParser struct {
	gvks   map[schema.GroupVersionKind]string
	parser typed.Parser
}

func (p *gvkParser) Type(gvk schema.GroupVersionKind) *typed.ParseableType {
	typeName, ok := p.gvks[gvk]
	if !ok {
		return nil
	}
	t := p.parser.Type(typeName)
	return &t
}

func newGVKParser(models proto.Models, preserveUnknownFields bool) (*gvkParser, error) {
	typeSchema, err := schemaconv.ToSchemaWithPreserveUnknownFields(models, preserveUnknownFields)
	if err != nil {
		return nil, fmt.Errorf("failed to convert models to schema: %v", err)
	}
	parser := gvkParser{
		gvks: map[schema.GroupVersionKind]string{},
	}
	parser.parser = typed.Parser{Schema: *typeSchema}
	for _, modelName := range models.ListModels() {
		model := models.LookupModel(modelName)
		if model == nil {
			panic(fmt.Sprintf("ListModels returns a model that can't be looked-up for: %v", modelName))
		}
		gvkList := parseGroupVersionKind(model)
		for _, gvk := range gvkList {
			if len(gvk.Kind) > 0 {
				_, ok := parser.gvks[gvk]
				if ok {
					return nil, fmt.Errorf("duplicate entry for %v", gvk)
				}
				parser.gvks[gvk] = modelName
			}
		}
	}
	return &parser, nil
}

// Get and parse GroupVersionKind from the extension. Returns empty if it doesn't have one.
func parseGroupVersionKind(s proto.Schema) []schema.GroupVersionKind {
	extensions := s.GetExtensions()

	gvkListResult := []schema.GroupVersionKind{}

	// Get the extensions
	gvkExtension, ok := extensions[groupVersionKindExtensionKey]
	if !ok {
		return []schema.GroupVersionKind{}
	}

	// gvk extension must be a list of at least 1 element.
	gvkList, ok := gvkExtension.([]interface{})
	if !ok {
		return []schema.GroupVersionKind{}
	}

	for _, gvk := range gvkList {
		// gvk extension list must be a map with group, version, and
		// kind fields
		gvkMap, ok := gvk.(map[interface{}]interface{})
		if !ok {
			continue
		}
		group, ok := gvkMap["group"].(string)
		if !ok {
			continue
		}
		version, ok := gvkMap["version"].(string)
		if !ok {
			continue
		}
		kind, ok := gvkMap["kind"].(string)
		if !ok {
			continue
		}

		gvkListResult = append(gvkListResult, schema.GroupVersionKind{
			Group:   group,
			Version: version,
			Kind:    kind,
		})
	}

	return gvkListResult
}


text:
/*
 * This controller displays a table with rows. This controller demonstrates how to insert rows after the intial set of rows has been added and displayed.
*/

using System;

using WatchKit;
using Foundation;

namespace WatchkitExtension
{
	public partial class TableDetailController : WKInterfaceController
	{
		string[] cityNames;

		public TableDetailController ()
		{
		}

		public override void Awake (NSObject context)
		{
			LoadTableData ();
		}

		public override void WillActivate ()
		{
			// This method is called when the controller is about to be visible to the wearer.
			Console.WriteLine ("{0} will activate", this);
		}

		public override void DidDeactivate ()
		{
			// This method is called when the controller is no longer visible.
			Console.WriteLine ("{0} did deactivate", this);
		}

		void LoadTableData ()
		{
			cityNames = new [] { "Cupertino", "Sunnyvale", "Campbell", "Morgan Hill", "Mountain View" };

			interfaceTable.SetNumberOfRows (cityNames.Length, "default");

			for (var i = 0; i < cityNames.Length; i++) {
				var row = (TableRowController)interfaceTable.GetRowController (i);
				row.RowLabel.SetText (cityNames [i]);
			}
		}

		public override void DidSelectRow (WKInterfaceTable table, nint rowIndex)
		{
			var newCityNames = new [] { "Saratoga", "San Jose" };

			var newCityIndexes = NSIndexSet.FromNSRange (new NSRange (rowIndex + 1, newCityNames.Length));

			// Insert new rows into the table.
			interfaceTable.InsertRows (newCityIndexes, "default");

			// Update the rows that were just inserted with the appropriate data.
			var newCityNumber = 0;
			newCityIndexes.EnumerateIndexes ((nuint idx, ref bool stop) => {
				var newCityName = newCityNames [newCityNumber];
				var row = (TableRowController)interfaceTable.GetRowController ((nint) idx);
				row.RowLabel.SetText (newCityName);
				newCityNumber++;
			});
		}
	}
}


text:
#ifndef _invite_guild_hpp_
#define _invite_guild_hpp_

#include <disccord/models/entity.hpp>

namespace disccord
{
    namespace models
    {
        class invite_guild : public entity
        {
            public:
                invite_guild();
                virtual ~invite_guild();

                virtual void decode(web::json::value json) override;

                std::string get_name();
                util::optional<std::string> get_splash();
                util::optional<std::string> get_icon();

            protected:
                virtual void encode_to(
                    std::unordered_map<std::string, web::json::value> &info
                ) override;

            private:
                std::string name;
                util::optional<std::string> splash, icon;
        };
    }
}

#endif /* _invite_guild_hpp_ */


text:
package org.apache.jmeter.visualizers;

import java.io.Serializable;
import java.text.Format;
import java.util.Date;

/**
 * Class to hold data for the TableVisualiser.
 */
public class TableSample implements Serializable, Comparable<TableSample> {
    private static final long serialVersionUID = 240L;

    private final long totalSamples;

    private final int sampleCount; // number of samples in this entry

    private final long startTime;

    private final String threadName;

    private final String label;

    private final long elapsed;

    private final boolean success;

    private final long bytes;

    private final long latency;

    /**
     * @deprecated for unit test code only
     */
    @Deprecated
    public TableSample() {
        this(0, 1, 0, "", "", 0, true, 0, 0);
    }

    public TableSample(long totalSamples, int sampleCount, long startTime, String threadName,
            String label,
            long elapsed, boolean success, long bytes, long latency) {
        this.totalSamples = totalSamples;
        this.sampleCount = sampleCount;
        this.startTime = startTime;
        this.threadName = threadName;
        this.label = label;
        this.elapsed = elapsed/sampleCount;
        this.success = success;
        this.bytes = bytes/sampleCount;
        this.latency = latency;
    }

    // The following getters may appear not to be used - however they are invoked via the Functor class

    public long getBytes() {
        return bytes;
    }

    public String getSampleNumberString(){
        StringBuilder sb = new StringBuilder();
        if (sampleCount > 1) {
        sb.append(totalSamples-sampleCount+1);
        sb.append('-');
        }
        sb.append(totalSamples);
        return sb.toString();
    }

    public long getElapsed() {
        return elapsed;
    }

    public boolean isSuccess() {
        return success;
    }

    public long getStartTime() {
        return startTime;
    }

    /**
     * @return the start time using the specified format
     * Intended for use from Functors
     */
    public String getStartTimeFormatted(Format format) {
        return format.format(new Date(getStartTime()));
    }

    public String getThreadName() {
        return threadName;
    }

    public String getLabel() {
        return label;
    }

    @Override
    public int compareTo(TableSample o) {
        TableSample oo = o;
        return ((totalSamples - oo.totalSamples) < 0 ? -1 : (totalSamples == oo.totalSamples ? 0 : 1));
    }

    // TODO should equals and hashCode depend on field other than count?

    @Override
    public boolean equals(Object o){
        return (
                (o instanceof TableSample) &&
                (this.compareTo((TableSample) o) == 0)
                );
    }

    @Override
    public int hashCode(){
        return (int)(totalSamples ^ (totalSamples >>> 32));
    }

    /**
     * @return the latency
     */
    public long getLatency() {
        return latency;
    }

}


text:
package com.jkoolcloud.tnt4j.stream.jmx.impl;

import java.util.Map;

import javax.management.MBeanServerConnection;

import com.jkoolcloud.tnt4j.source.Source;
import com.jkoolcloud.tnt4j.stream.jmx.conditions.SampleHandler;
import com.jkoolcloud.tnt4j.stream.jmx.core.DefaultSampleListener;
import com.jkoolcloud.tnt4j.stream.jmx.core.SampleListener;
import com.jkoolcloud.tnt4j.stream.jmx.core.Sampler;
import com.jkoolcloud.tnt4j.stream.jmx.factory.SamplerFactory;
import com.jkoolcloud.tnt4j.stream.jmx.scheduler.PrivilegedSampleHandlerImpl;
import com.jkoolcloud.tnt4j.stream.jmx.scheduler.SampleHandlerImpl;

/**
 * <p>
 * This class provides a {@link SamplerFactory} implementation with {@link PlatformJmxSampler} as underlying sampler
 * implementation.
 * </p>
 *
 * @version $Revision: 1 $
 *
 * @see Sampler
 * @see PlatformJmxSampler
 */
public class PlatformSamplerFactory implements SamplerFactory {

	@Override
	public Sampler newInstance() {
		return new PlatformJmxSampler(this);
	}

	@Override
	public void initialize() {
	}

	@Override
	public Sampler newInstance(MBeanServerConnection mServerConn) {
		return mServerConn == null ? newInstance() : new PlatformJmxSampler(mServerConn, this);
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see com.jkoolcloud.tnt4j.stream.jmx.core.DefaultSampleListener.ListenerProperties
	 */
	@Override
	public SampleListener newListener(Map<String, ?> properties) {
		return new DefaultSampleListener(properties);
	}

	@Override
	public String defaultEventFormatterClassName() {
		return "com.jkoolcloud.tnt4j.stream.jmx.format.FactPathValueFormatter";
	}

	@Override
	public SampleHandler newSampleHandler(MBeanServerConnection mServerConn, String incFilterList,
			String excFilterList) {
		return newSampleHandler(mServerConn, incFilterList, excFilterList, null);
	}

	@Override
	public SampleHandler newSampleHandler(MBeanServerConnection mServerConn, String incFilterList, String excFilterList,
			Source source) {
		return System.getSecurityManager() == null
				? new SampleHandlerImpl(mServerConn, incFilterList, excFilterList, source)
				: new PrivilegedSampleHandlerImpl(mServerConn, incFilterList, excFilterList, source);
	}
}


text:
package com.beaumatherne.mainpackage;

public class TemperatureModel {
	private double mCelsius;
	private double mFahrenheit;
	private double mKelvin;

	public TemperatureModel() {
		// set initial values for member fields
		setCelsius(0);
		setFahrenheit(0);
		setKelvin(0);
	} // end constructor TemperatureModel()

	public void setCelsius(double celsius) {
		mCelsius = celsius;
	} // end method setCelsius

	public double getCelsius() {
		return mCelsius;
	} // end method getCelsius

	public void setFahrenheit(double fahrenheit) {
		mFahrenheit = fahrenheit;
	} // end method setFahrenheit

	public double getFahrenheit() {
		return mFahrenheit;
	} // end method getFahrenheit

	public void setKelvin(double kelvin) {
		mKelvin = kelvin;
	} // end method setKelvin

	public double getKelvin() {
		return mKelvin;
	} // end method getKelvin

	public void calculateFromCelsius(double celsius) {
		// convert celsius to fahrenheit and kelvin,
		// and store the values in the member variables
		setCelsius(celsius);
		setFahrenheit(celsius * 1.8 + 32.00);
		setKelvin(celsius + 273.15);
	} // end method calculateFromCelsius

	public void calculateFromFahrenheit(double fahrenheit) {
		// convert fahrenheit to celsius and kelvin,
		// and store the values in the member variables
		setCelsius((fahrenheit - 32.0) / 1.8);
		setFahrenheit(fahrenheit);
		setKelvin((fahrenheit - 32.0) / 1.8 + 273.15);
	} // end method calculateFromFahrenheit

	public void calculateFromKelvin(double kelvin) {
		// convert kelvin to celsius and fahrenheit,
		// and store the values in the member variables
		setCelsius(kelvin - 273.15);
		setFahrenheit((kelvin - 273.15) * 1.8 + 32.0);
		setKelvin(kelvin);
	} // end method calculateFromKelvin
} // end class TemperatureModel


text:
<?php

namespace AppBundle\Service\Vote;

use Doctrine\ORM\EntityManagerInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

class VoteListenerBuilder
{
    /**
     * @var Request
     */
    private $request;

    /**
     * @var ContainerInterface
     */
    private $container;

    /**
     * @var EntityManagerInterface
     */
    private $manager;

    public function __construct(RequestStack $requestStack, ContainerInterface $container, EntityManagerInterface $manager)
    {
        $this->request = $requestStack->getCurrentRequest();
        $this->container = $container;
        $this->manager = $manager;
    }

    /**
     * @param string $vote
     * @return VoteListener
     */
    public function getVoteListener($vote)
    {
        switch ($vote)
        {
            case 'MCRate': return new MCRate_VoteListener($this->request, $this->container, $this->manager);
            case 'TopCraft': return new TopCraft_VoteListener($this->request, $this->container, $this->manager);
            case 'FairTop': return new FairTop_VoteListener($this->request, $this->container, $this->manager);
        }
        return null;
    }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="robots" content="noindex">

	<title>File LeadCommerce/Shopware/SDK/Query/ArticleQuery.php | shopware-sdk</title>

	<link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e">

		Overview

Namespaces

						LeadCommerce

						Shopware

						SDK

						Entity

						Exception

						Query

						Util

Classes

LeadCommerce\Shopware\SDK\Entity\Address

LeadCommerce\Shopware\SDK\Entity\Area

LeadCommerce\Shopware\SDK\Entity\Article

LeadCommerce\Shopware\SDK\Entity\ArticleAttribute

LeadCommerce\Shopware\SDK\Entity\ArticleDetail

LeadCommerce\Shopware\SDK\Entity\Base

LeadCommerce\Shopware\SDK\Entity\Billing

LeadCommerce\Shopware\SDK\Entity\BillingAttribute

LeadCommerce\Shopware\SDK\Entity\Cache

LeadCommerce\Shopware\SDK\Entity\Category

LeadCommerce\Shopware\SDK\Entity\ConfiguratorGroup

LeadCommerce\Shopware\SDK\Entity\ConfiguratorOption

LeadCommerce\Shopware\SDK\Entity\ConfiguratorSet

LeadCommerce\Shopware\SDK\Entity\Country

LeadCommerce\Shopware\SDK\Entity\Currency

LeadCommerce\Shopware\SDK\Entity\CustomerAttribute

LeadCommerce\Shopware\SDK\Entity\CustomerGroup

LeadCommerce\Shopware\SDK\Entity\CustomerGroupSurcharge

LeadCommerce\Shopware\SDK\Entity\Debit

LeadCommerce\Shopware\SDK\Entity\Dispatch

LeadCommerce\Shopware\SDK\Entity\Document

LeadCommerce\Shopware\SDK\Entity\DocumentAttribute

LeadCommerce\Shopware\SDK\Entity\DocumentType

LeadCommerce\Shopware\SDK\Entity\Download

LeadCommerce\Shopware\SDK\Entity\Image

LeadCommerce\Shopware\SDK\Entity\Link

LeadCommerce\Shopware\SDK\Entity\Locale

LeadCommerce\Shopware\SDK\Entity\OrderAttribute

LeadCommerce\Shopware\SDK\Entity\OrderDetail

LeadCommerce\Shopware\SDK\Entity\OrderDetailAttribute

LeadCommerce\Shopware\SDK\Entity\OrderStatus

LeadCommerce\Shopware\SDK\Entity\PaymentData

LeadCommerce\Shopware\SDK\Entity\PaymentInstance

LeadCommerce\Shopware\SDK\Entity\Price

LeadCommerce\Shopware\SDK\Entity\PriceGroup

LeadCommerce\Shopware\SDK\Entity\PropertyGroup

LeadCommerce\Shopware\SDK\Entity\PropertyGroupAttribute

LeadCommerce\Shopware\SDK\Entity\PropertyGroupOption

LeadCommerce\Shopware\SDK\Entity\PropertyValue

LeadCommerce\Shopware\SDK\Entity\Related

LeadCommerce\Shopware\SDK\Entity\Shipping

LeadCommerce\Shopware\SDK\Entity\ShippingAttribute

LeadCommerce\Shopware\SDK\Entity\Shop

LeadCommerce\Shopware\SDK\Entity\Similar

LeadCommerce\Shopware\SDK\Entity\State

LeadCommerce\Shopware\SDK\Entity\Supplier

LeadCommerce\Shopware\SDK\Entity\Tax

LeadCommerce\Shopware\SDK\Entity\Translation

LeadCommerce\Shopware\SDK\Entity\Version

LeadCommerce\Shopware\SDK\Query\AddressQuery

LeadCommerce\Shopware\SDK\Query\ArticleQuery

LeadCommerce\Shopware\SDK\Query\Base

LeadCommerce\Shopware\SDK\Query\CacheQuery

LeadCommerce\Shopware\SDK\Query\CategoriesQuery

LeadCommerce\Shopware\SDK\Query\CountriesQuery

LeadCommerce\Shopware\SDK\Query\CustomerGroupsQuery

LeadCommerce\Shopware\SDK\Query\CustomerQuery

LeadCommerce\Shopware\SDK\Query\GenerateArticleImagesQuery

LeadCommerce\Shopware\SDK\Query\ManufacturersQuery

LeadCommerce\Shopware\SDK\Query\MediaQuery

LeadCommerce\Shopware\SDK\Query\OrdersQuery

LeadCommerce\Shopware\SDK\Query\PropertyGroupsQuery

LeadCommerce\Shopware\SDK\Query\ShopsQuery

LeadCommerce\Shopware\SDK\Query\TranslationsQuery

LeadCommerce\Shopware\SDK\Query\VariantsQuery

LeadCommerce\Shopware\SDK\Query\VersionQuery

LeadCommerce\Shopware\SDK\ShopwareClient

LeadCommerce\Shopware\SDK\Util\Constants

Exceptions

LeadCommerce\Shopware\SDK\Exception\MethodNotAllowedException

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

Namespace

Class

 1: <?php
 2:
 3: namespace LeadCommerce\Shopware\SDK\Query;
 4:
 5:
11: class ArticleQuery extends Base
12: {
13:     /**
14:      * @return mixed
15:      */
16:     protected function getClass()
17:     {
18:         return 'LeadCommerce\\Shopware\\SDK\\Entity\\Article';
19:     }
20:
21:     /**
22:      * @return string
23:      */
24:     protected function getQueryPath()
25:     {
26:         return 'articles';
27:     }
28: }
29:

		shopware-sdk API documentation generated by ApiGen


text:
package com.example.kenjxli.cachelib.utils;

import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Environment;

import com.example.kenjxli.cachelib.disk.DiskCache;
import com.example.kenjxli.cachelib.disk.impl.limited.LruDiskCache;

import java.io.File;
import java.io.InputStream;

/**
 * Created by kenjxli on 2015/7/28.
 */
public class DiskCacheUtil {
    private static final long CACHE_SIZE = 300 * 1024;

    private DiskCache diskCache;
    private static DiskCacheUtil util;

    private DiskCacheUtil(DiskCache diskCache) {
        this.diskCache = diskCache;
    }

    public static DiskCacheUtil getInstance(Context context, String subdir) {
        if (util == null) {
            synchronized (DiskCacheUtil.class) {
                if (util == null) {
                    DiskCache diskCache = DiskCacheFactory.createLruDiskCache(CACHE_SIZE, getDiskCacheDir(context, subdir));
                    util = new DiskCacheUtil(diskCache);
                }
            }
        }
        return util;
    }

    public void setDiskCache(DiskCache diskCache) {
        this.diskCache = diskCache;
    }

    public boolean addBitmapToDiskCache(String url, InputStream inputStream) {
        if (getBitmapFromDiskCache(url) == null) {
            return diskCache.put(url, inputStream);
        }
        return false;
    }

    public Bitmap getBitmapFromDiskCache(String url) {
        return diskCache.get(url);
    }

    public void removeBitmapFromDiskCache(String key) {
        diskCache.remove(key);
    }

    public void clearBitmapsInDiskCache() {
        diskCache.clear();
    }

    private static String getDiskCacheDir(Context context, String subdir) {
        String cacheDir;
        // 判断是否有SDK选择缓存路径
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) || !Environment.isExternalStorageRemovable()) {
            cacheDir = context.getExternalCacheDir().getPath();
        } else {
            cacheDir = context.getCacheDir().getPath();
        }
        return cacheDir + File.separator + subdir;
    }

    public void closeUtil() {
        util = null;
    }
}


text:
@interface FLWeChatCollViewModel : NSObject

- (void)getHomeDataWithCompletionHandler:(void(^)(NSError *error))completionHandler;
- (NSUInteger)getHomeDataNum;
- (NSString *)getCTimeForHomeWithIndex:(NSUInteger)index;
- (NSString *)getTitleForHomeWithIndex:(NSUInteger)index;
- (NSString *)getDescForHomeWithIndex:(NSUInteger)index;
- (NSURL *)getPicUrlForHomeWithIndex:(NSUInteger)index;
- (NSURL *)getWebUrlForHomeWithIndex:(NSUInteger)index;

- (void)getWeChatCollViewDataWithWithRequestMode:(RequestMode)requestMode completionHandler:(void(^)(NSError *error))completionHandler;

- (NSUInteger)getWeChatDataNum;
- (NSString *)getCTimeForWeChatWithIndex:(NSUInteger)index;
- (NSString *)getTitleForWeChatWithIndex:(NSUInteger)index;
- (NSString *)getDescForWeChatWithIndex:(NSUInteger)index;
- (NSURL *)getPicUrlForWeChatWithIndex:(NSUInteger)index;
- (NSURL *)getWebUrlForWeChatWithIndex:(NSUInteger)index;
@end


text:
package org.mifos.reports.struts.action;

import java.io.IOException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mifos.framework.MifosMockStrutsTestCase;
import org.mifos.framework.TestUtils;
import org.mifos.framework.util.helpers.Constants;
import org.mifos.security.util.ActivityContext;
import org.mifos.security.util.UserContext;

public class ReportsUserParamsActionStrutsTest extends MifosMockStrutsTestCase {

    private UserContext userContext;

    @Override
    protected void setStrutsConfig() throws IOException {
        super.setStrutsConfig();
        setConfigFile("/WEB-INF/struts-config.xml,/WEB-INF/reports-struts-config.xml");
    }

    @Before
    public void setUp() throws Exception {
        userContext = TestUtils.makeUser();
        request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
        ActivityContext ac = new ActivityContext((short) 0, userContext.getBranchId().shortValue(), userContext.getId()
                .shortValue());
        request.getSession(false).setAttribute("ActivityContext", ac);
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testLoadAddListShouldGoToBirtReport() throws Exception {
        setRequestPathInfo("/reportsUserParamsAction.do");
        addRequestParameter("method", "loadAddList");
        addRequestParameter("reportId", "1");
        actionPerform();
        verifyForwardPath("/pages/application/reports/jsp/birtReport.jsp");
        // FIXME This test leave CUSTOMER table in dirty state

    }
}


text:
define([ 'require' ], function (require) {
	var nodeRequire = this.require && this.require.nodeRequire;

	if (!nodeRequire) {
		throw new Error('Cannot find the Node.js require');
	}

	var module = nodeRequire('module');

	/**
	 * This AMD plugin module allows native Node.js modules to be loaded by AMD modules from within a compliant AMD
	 * loader. This plugin will not work with AMD loaders that do not expose the Node.js require function at
	 * `require.nodeRequire` (RequireJS, Dojo).
	 *
	 * @example
	 * require([ 'dojo/node!fs' ], function (fs) {
	 *     var fileData = fs.readFileSync('foo.txt', 'utf-8');
	 * });
	 */
	return {
		load: function (/**string*/ id, /**Function*/ contextRequire, /**Function*/ load) {
			/*global define:true */

			// The `nodeRequire` function comes from the Node.js module of the AMD loader, so module ID resolution is
			// relative to the loader's path, not the calling AMD module's path. This means that loading Node.js
			// modules that exist in a higher level or sibling path to the loader will cause those modules to fail to
			// resolve.
			//
			// Node.js does not expose a public API for performing module filename resolution relative to an arbitrary
			// directory root, so we are forced to dig into the internal functions of the Node.js `module` module to
			// use Node.js's own path resolution code instead of having to duplicate its rules ourselves.
			//
			// Sooner or later, probably around the time that Node.js internal code is reworked to use ES6, these
			// methods will no longer be exposed and we will have to find another workaround if they have not exposed
			// an API for doing this by then.
			if (module._findPath && module._nodeModulePaths) {
				var localModulePath = module._findPath(id, module._nodeModulePaths(contextRequire.toUrl('.')));
				if (localModulePath !== false) {
					id = localModulePath;
				}
			}

			var oldDefine = define;
			var result;

			// Some modules attempt to detect an AMD loader by looking for global AMD `define`. This causes issues
			// when other CommonJS modules attempt to load them via the standard Node.js `require`, so hide it
			// during the load
			define = undefined;

			try {
				result = nodeRequire(id);
			}
			finally {
				define = oldDefine;
			}

			load(result);
		},

		/**
		 * Produces a normalized CommonJS module ID to be used by Node.js `require`. Relative IDs are resolved relative
		 * to the requesting module's location in the filesystem and will return an ID with path separators appropriate
		 * for the local filesystem.
		 */
		normalize: function (/**string*/ id, /*Function*/ normalize) {
			if (id.charAt(0) === '.') {
				// absolute module IDs need to be generated based on the AMD loader's knowledge of the parent module,
				// since Node.js will try to use the directory containing `dojo.js` as the relative root if a
				// relative module ID is provided
				id = require.toUrl(normalize('./' + id));
			}

			return id;
		}
	};
});


text:
import XMonad
import XMonad.Config

import XMonad.Hooks.EwmhDesktops

import qualified XMonad.Hooks.ManageDocks as ManageDocks
import qualified XMonad.Hooks.SetWMName as SetWMName
import qualified XMonad.Config.Gnome as Gnome
import qualified XMonad.StackSet as W
import qualified XMonad.Layout.WindowNavigation as WindowNavigation

import qualified Data.Map as Map
import Data.List

import XMonad.Hooks.FloatNext

main = xmonad $ Gnome.gnomeConfig
--main = xmonad $ defaultConfig
    { workspaces         = workspaces'
    , borderWidth        = 1
    , normalBorderColor  = "#cccccc"
    , focusedBorderColor = "#cd8b00"
    , manageHook         = myManageHook
    , layoutHook         = myLayoutHook
    , logHook            = myLogHook
    , terminal           = "gnome-terminal --hide-menubar"
    , modMask            = defaultModMask
    , startupHook        = SetWMName.setWMName "LG3D"
    , keys               = \c -> myKeys c `Map.union` keys defaultConfig c
    }
--    , defaultGaps        = [(24,0,0,0)]

-- The key to use as the base key for XMonad-specific
-- functions (change layout, etc.).
defaultModMask :: KeyMask
-- defaultModMask = mod3Mask -- Right Alt
defaultModMask = mod1Mask -- Left Alt
-- defaultModMask = mod4Mask -- Windows "Start Key"
-- defaultModMask = 115      -- Windows start button

-- Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
--
-- To find the property name associated with a program, use
-- > xprop | grep WM_CLASS
-- and click on the client you're interested in.
--
-- To match on the WM_NAME, you can use 'title' in the same way that
-- 'className' and 'resource' are used below.
--

-- myManageHook = floatNextHook <+> manageHook defaultConfig
myManageHook = composeAll . concat $
   [ [ManageDocks.manageDocks]
   , [floatNextHook <+> manageHook defaultConfig]
   , [manageHook Gnome.gnomeConfig]
   , [className =? "Firefox-bin"     --> doShift "2"]
   , [className =? "Firefox"         --> doShift "2"]
   , [className =? "Minefield"       --> doShift "2"]
   , [(className =? "Firefox" <&&> resource =? "Dialog") --> doFloat]
   , [className =? "Thunderbird"     --> doShift "3"]
   , [className =? "Thunderbird-bin" --> doShift "3"]
   , [title =? "Chandler"            --> doShift "3"]
   , [className =? "Xchat"           --> doShift "4"]
   , [className =? "keepassx"        --> doShift "4"]
--   , [className =? "Variations"      --> doFloat]
--   , [className =? "variations"      --> doFloat]
--   , [className =? "Toplevel"      --> doFloat]
--   , [title =? "Variations"      --> doFloat]
--   , [title =? "variations"      --> doFloat]
--   , [title =? "topLevel"      --> doFloat]
   , [title     =? "Azureus"         --> doShift "9"]
     -- using list comprehensions and partial matches
   , [ className =?  c --> doFloat | c <- myFloatsC ]
   , [ title     =?  c --> doFloat | c <- myFloatsT ]
   , [ fmap ( c `isInfixOf`) className --> doFloat | c <- myMatchAnywhereFloatsC ]
   , [ fmap ( c `isInfixOf`) title     --> doFloat | c <- myMatchAnywhereFloatsT ]
   ]
   -- in a composeAll hook, you'd use: fmap ("VLC" `isInfixOf`) title --> doFloat
  where myFloatsC = ["MPlayer", "jx-frames-J", "Hback", "Flicker", "Gimp", "gimp",
                      "Deskbar-applet", "processing-app-base", "sun-awt-X11-XFramePeer",
                      "org-eclipse-osgi-framework-eventmgr-EventManager$EventThread",
                      "search", "QuickNote", "Firefox"]
        -- Toolbox is gimp,
        myFloatsT = ["Toolbox", "glade-3", "Save a Bookmark", "Variations", "phalanx"]
        myMatchAnywhereFloatsC = ["Google", "Pidgin", "Best Tree Games"]
        myMatchAnywhereFloatsT = ["treeGraph", "treeBest", "Scid"]

-- unused now, after switching to above; keeping for a while just in case need to revert
myManageHook2 = composeAll
    [ ManageDocks.manageDocks
    , manageHook Gnome.gnomeConfig
    , resource  =? "desktop_window"  --> doIgnore
    , resource  =? "kdesktop"        --> doIgnore
    , className =? "MPlayer"         --> doFloat
    , className =? "jx-frames-J"     --> doFloat
    , className =? "Hback"           --> doFloat
    , className =? "Flicker"         --> doFloat
    , className =? "Gimp"            --> doFloat -- gimp
    , className =? "gimp"            --> doFloat -- gimp
    , title =? "Toolbox"            --> doFloat  -- gimp
    , title     =? "Saved Passwords" --> doFloat
    , className =? "Deskbar-applet"  --> doFloat
    , className =? "Firefox-bin"     --> doF (W.shift "2")
    , className =? "Firefox"         --> doF (W.shift "2")
    , className =? "Minefield"       --> doF (W.shift "2")
    , className =? "Thunderbird"     --> doF (W.shift "3")
    , className =? "Thunderbird-bin" --> doF (W.shift "3")
    , title     =? "Chandler"        --> doF (W.shift "3")
    , className =? "Xchat"           --> doF (W.shift "4")
    , className =? "keepassx"        --> doF (W.shift "4")
    , title     =? "Azureus "        --> doF (W.shift "6")
    , title     =? "glade-3"         --> doFloat
    , className =? "processing-app-Base" --> doFloat
    , className =? "sun-awt-X11-XFramePeer" --> doFloat
    , className =? "org-eclipse-osgi-framework-eventmgr-EventManager$EventThread" --> doFloat
    , className =? "search"          --> doFloat
    , className =? "QuickNote" --> doFloat
    , title     =? "Save a Bookmark" --> doFloat
    , title     =? "Scid: Replace move?" --> doFloat
    ]
--manageHook w "Top Expanded Edge Panel" "gnome-panel" _ = reveal w >> return (W.delete w)

workspaces' = map show $ [1 .. 9 :: Int] ++ [0]

-- Status bars and logging

-- Perform an arbitrary action on each internal state change or X event.
-- See the 'DynamicLog' extension for examples.
--
-- To emulate dwm's status bar
--
-- > logHook = dynamicLogDzen
--
-- Following is default:
--myLogHook = return ()
-- Following is for Gnome, but wasn't working for other reasons
myLogHook :: X ()
myLogHook = ewmhDesktopsLogHook

-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--
-- The available layouts.  Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayoutHook = ManageDocks.avoidStruts (tiled ||| Mirror tiled ||| Full)
  where
     -- default tiling algorithm partitions the screen into two panes
     tiled   = Tall nmaster delta ratio

     -- The default number of windows in the master pane
     nmaster = 1

     -- Default proportion of screen occupied by master pane
     ratio   = 1/2

     -- Percent of screen to increment by when resizing panes
     delta   = 3/100

--myLayoutHook2 = ewmhDesktopsLayout $ ManageDocks.avoidStruts $ layoutHook Gnome.gnomeConfig

--noFollow CrossingEvent {} = return False
--noFollow _                = return True

-- Window rules:

-- Whether focus follows the mouse pointer.
--myFocusFollowsMouse :: Bool
--myFocusFollowsMouse = False

myKeys (XConfig {modMask = modm}) = Map.fromList $
                -- Apps and tools
                [
                ((modm .|. shiftMask, xK_s), spawn "gnome-search-tool")
                , ((modm, xK_End), spawn "gnome-session-save --kill")

                -- Special commands
                , ((modm, xK_F11 ),  spawn "xlock")
                -- shift-alt-e to float next spawned window
                , ((modm .|. shiftMask, xK_e), toggleFloatNext)
                -- shift-alt-r to float all spawned windows until disabled again
                , ((modm .|. shiftMask, xK_r), toggleFloatAllNew)

                ,((modm .|. shiftMask, xK_b), sendMessage ManageDocks.ToggleStruts)

                ]


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">

    <solid android:color="@color/category_charge" />

    <size
        android:width="@dimen/button_size"
        android:height="@dimen/button_size" />
</shape>


text:
<?php

namespace tests\Dudulina\CodeGeneration\ReadModelsMapCodeGeneratorData\Events;

use Dudulina\Event;

class Event2 implements Event
{

}


text:
package sink.event;

public interface TouchUpListener {
	void onTouchUp();
}


text:
<?php if (! defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class AntrianBerjalan extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->helper('form');
        $this->load->model('default_setting');
        $this->load->model('penggunaModel');
        $this->load->model('masterTabelModel');
        $this->load->model('antrianModel');
        $this->session->set_userdata('navbar_status', 'antrianberjalan');
        if (!$this->penggunaModel->is_loggedin()){
            redirect('login');
        }
    }

    public function index()
    {
        $this->page(1);
    }

    public function page($page=null)
    {
        $title['title']="Antrian Berjalan";
        $limit = $_COOKIE["pageLimit"];
        $sort = $_COOKIE["pageSort"];
        if(!isset($page)){ $page = 1; }
        if(!isset($limit)){
            $limit = $this->default_setting->pagination('LIMIT');
        }
        if(!isset($sort)){
            $sort = $this->default_setting->pagination('SORT');
        }
        $data['daftarUnit'] = $this->masterTabelModel->getData("unit");
        $this->load->view('header',$title);
        $this->load->view('navbar');
        $this->load->view('/loket/antrianberjalan', $data);
        $this->load->view('footer');
    }

    public function search($search=null)
    {
        $search = $_POST['search'];
        $title['title']="Antrian Berjalan";

        $data = $antrian->searchData($search);
        $data['daftarUnit'] = $this->masterTabelModel->getData("unit");
        $this->load->view('header',$title);
        $this->load->view('navbar');
        $this->load->view('/loket/antrianberjalan', $data);
        $this->load->view('footer');
    }

    public function insertData() {
        $affectedRow = $this->antrianModel->postData();
        $this->pesan("Tambah", $affectedRow);
        redirect('/loket/antrianberjalan', 'refresh');
    }

    public function editData($id) {
        $affectedRow = $this->antrianModel->editData($id);
        $this->pesan("Edit", $affectedRow);
        redirect('/loket/antrianberjalan', 'refresh');
    }

    public function editUnit() {
        $affectedRow = $this->antrianModel->editUnitTujuan();
        $this->pesan("Pindah unit ", $affectedRow);
        redirect('/loket/antrianberjalan', 'refresh');
    }

    public function deleteData($id) {
        $affectedRow = $this->antrianModel->deleteData($id);
        $this->pesan("Hapus", $affectedRow);
        redirect('/loket/antrianberjalan', 'refresh');
    }

    public function pesan($metode, $affectedRow) {
        $this->session->set_flashdata('metode', $metode);
        if ($affectedRow == 1) {

            $this->session->set_flashdata('pesan', 'berhasil');
        } elseif ($affectedRow == 0 and $metode == "ubah") {
            $this->session->set_flashdata('pesan', 'berhasil');
        } else {
            $this->session->set_flashdata('pesan', 'gagal');
        }
    }

    public function ajaxAntrianBerjalan(){
        echo $this->antrianModel->ajaxAntrianHariIni();
    }
}


text:
#ifndef __RAK_MEMORY_H
#define __RAK_MEMORY_H

#include "Export.h"
#include "RakNetDefines.h"
#include <new>

#if defined(_PS3) || defined(__PS3__) || defined(SN_TARGET_PS3)
// Causes linker errors
// #include <stdlib.h>
typedef unsigned int size_t;
#endif

#include "RakAlloca.h"

#if defined(_USE_RAK_MEMORY_OVERRIDE)
	#if defined(new)
		#pragma push_macro("new")
		#undef new
		#define RMO_NEW_UNDEF
	#endif
#endif

// These pointers are statically and globally defined in RakMemoryOverride.cpp
// Change them to point to your own allocators if you want.
// Use the functions for a DLL, or just reassign the variable if using source
extern RAK_DLL_EXPORT void * (*rakMalloc) (size_t size);
extern RAK_DLL_EXPORT void * (*rakRealloc) (void *p, size_t size);
extern RAK_DLL_EXPORT void (*rakFree) (void *p);
extern RAK_DLL_EXPORT void * (*rakMalloc_Ex) (size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void * (*rakRealloc_Ex) (void *p, size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void (*rakFree_Ex) (void *p, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void (*notifyOutOfMemory) (const char *file, const long line);

// Change to a user defined allocation function
void RAK_DLL_EXPORT SetMalloc( void* (*userFunction)(size_t size) );
void RAK_DLL_EXPORT SetRealloc( void* (*userFunction)(void *p, size_t size) );
void RAK_DLL_EXPORT SetFree( void (*userFunction)(void *p) );
void RAK_DLL_EXPORT SetMalloc_Ex( void* (*userFunction)(size_t size, const char *file, unsigned int line) );
void RAK_DLL_EXPORT SetRealloc_Ex( void* (*userFunction)(void *p, size_t size, const char *file, unsigned int line) );
void RAK_DLL_EXPORT SetFree_Ex( void (*userFunction)(void *p, const char *file, unsigned int line) );
// Change to a user defined out of memory function
void RAK_DLL_EXPORT SetNotifyOutOfMemory( void (*userFunction)(const char *file, const long line) );

extern RAK_DLL_EXPORT void * (*GetMalloc()) (size_t size);
extern RAK_DLL_EXPORT void * (*GetRealloc()) (void *p, size_t size);
extern RAK_DLL_EXPORT void (*GetFree()) (void *p);
extern RAK_DLL_EXPORT void * (*GetMalloc_Ex()) (size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void * (*GetRealloc_Ex()) (void *p, size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void (*GetFree_Ex()) (void *p, const char *file, unsigned int line);

namespace RakNet
{

	template <class Type>
	RAK_DLL_EXPORT Type* OP_NEW(const char *file, unsigned int line)
	{
#if defined(_USE_RAK_MEMORY_OVERRIDE)
		char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
		Type *t = new (buffer) Type;
		return t;
#else
		(void) file;
		(void) line;
		return new Type;
#endif
	}

	template <class Type>
	RAK_DLL_EXPORT Type* OP_NEW_ARRAY(const int count, const char *file, unsigned int line)
	{
#if defined(_USE_RAK_MEMORY_OVERRIDE)
		Type *t;
		char *buffer = (char *) (GetMalloc_Ex())(sizeof(int)+sizeof(Type)*count, file, line);
		((int*)buffer)[0]=count;
		for (int i=0; i<count; i++)
		{
			t = new(buffer+sizeof(int)+i*sizeof(Type)) Type;
		}
		return (Type *) (buffer+sizeof(int));
#else
		(void) file;
		(void) line;
		return new Type[count];
#endif

	}

	template <class Type>
	RAK_DLL_EXPORT void OP_DELETE(Type *buff, const char *file, unsigned int line)
	{
#if defined(_USE_RAK_MEMORY_OVERRIDE)
		if (buff==0) return;
		buff->~Type();
		(GetFree_Ex())((char*)buff, file, line );
#else
		(void) file;
		(void) line;
		delete buff;
#endif

	}

	template <class Type>
	RAK_DLL_EXPORT void OP_DELETE_ARRAY(Type *buff, const char *file, unsigned int line)
	{
#if defined(_USE_RAK_MEMORY_OVERRIDE)
		if (buff==0) return;
		int count = ((int*)((char*)buff-sizeof(int)))[0];
		Type *t;
		for (int i=0; i<count; i++)
		{
			t = buff+i;
			t->~Type();
		}
		(GetFree_Ex())((char*)buff-sizeof(int), file, line );
#else
		(void) file;
		(void) line;
		delete [] buff;
#endif

	}

void RAK_DLL_EXPORT * _RakMalloc (size_t size);
void RAK_DLL_EXPORT * _RakRealloc (void *p, size_t size);
void RAK_DLL_EXPORT _RakFree (void *p);
void RAK_DLL_EXPORT * _RakMalloc_Ex (size_t size, const char *file, unsigned int line);
void RAK_DLL_EXPORT * _RakRealloc_Ex (void *p, size_t size, const char *file, unsigned int line);
void RAK_DLL_EXPORT _RakFree_Ex (void *p, const char *file, unsigned int line);

}

#if defined(_USE_RAK_MEMORY_OVERRIDE)
	#if defined(RMO_NEW_UNDEF)
	#pragma pop_macro("new")
	#undef RMO_NEW_UNDEF
	#endif
#endif

#endif


text:
/*  eslint amd:true */
/*  eslint-disable no-unused-vars */
/*  eslint strict:0 */

'use strict';

const should = require('should');
const io = require('socket.io-client');

const socketURL = 'http://localhost:3000';

const options = {
  transports: ['websocket'],
  'force new connection': true
};

const cfhPlayer1 = { name: 'Tom' };
const cfhPlayer2 = { name: 'Sally' };
const cfhPlayer3 = { name: 'Dana' };

describe('Game Server', () => {
  it('Should accept requests to joinGame', (done) => {
    const client1 = io.connect(socketURL, options);
    const disconnect = () => {
      client1.disconnect();
      done();
    };
    client1.on('connect', (data) => {
      client1.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
      setTimeout(disconnect, 200);
    });
  });

  it('Should send a game update upon receiving request to joinGame', (done) => {
    const client1 = io.connect(socketURL, options);
    const disconnect = () => {
      client1.disconnect();
      done();
    };
    client1.on('connect', (data) => {
      client1.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
      client1.on('gameUpdate', (data) => {
        data.gameID.should.match(/\d+/);
      });
      setTimeout(disconnect, 200);
    });
  });

  it('Should announce new user to all users', (done) => {
    const client1 = io.connect(socketURL, options);
    let client2;
    const disconnect = () => {
      client1.disconnect();
      client2.disconnect();
      done();
    };
    client1.on('connect', (data) => {
      client1.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
      client2 = io.connect(socketURL, options);
      client2.on('connect', (data) => {
        client2.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
        client1.on('notification', (data) => {
          data.notification.should.match(/ has joined the game!/);
        });
      });
      setTimeout(disconnect, 200);
    });
  });

  it('Should start game when startGame event is sent with 3 players', (done) => {
    let client2, client3;
    const client1 = io.connect(socketURL, options);
    const disconnect = () => {
      client1.disconnect();
      client2.disconnect();
      client3.disconnect();
      done();
    };
    const expectStartGame = () => {
      client1.emit('startGame');
      client1.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client2.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client3.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      setTimeout(disconnect, 200);
    };
    client1.on('connect', (data) => {
      client1.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
      client2 = io.connect(socketURL, options);
      client2.on('connect', (data) => {
        client2.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
        client3 = io.connect(socketURL, options);
        client3.on('connect', (data) => {
          client3.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: false });
          setTimeout(expectStartGame, 100);
        });
      });
    });
  });

  it('Should automatically start game when 6 players are in a game', (done) => {
    let client2, client3, client4, client5, client6;
    const client1 = io.connect(socketURL, options);
    const disconnect = () => {
      client1.disconnect();
      client2.disconnect();
      client3.disconnect();
      client4.disconnect();
      client5.disconnect();
      client6.disconnect();
      done();
    };
    const expectStartGame = () => {
      client1.emit('startGame');
      client1.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client2.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client3.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client4.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client5.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      client6.on('gameUpdate', (data) => {
        data.state.should.equal('waiting for players to pick');
      });
      setTimeout(disconnect, 200);
    };
    client1.on('connect', (data) => {
      client1.emit('joinGame', { userID: 'unauthenticated', room: '', createPrivate: true });
      let connectOthers = true;
      client1.on('gameUpdate', (data) => {
        const gameID = data.gameID;
        if (connectOthers) {
          client2 = io.connect(socketURL, options);
          connectOthers = false;
          client2.on('connect', (data) => {
            client2.emit('joinGame', { userID: 'unauthenticated', room: gameID, createPrivate: false });
            client3 = io.connect(socketURL, options);
            client3.on('connect', (data) => {
              client3.emit('joinGame', { userID: 'unauthenticated', room: gameID, createPrivate: false });
              client4 = io.connect(socketURL, options);
              client4.on('connect', (data) => {
                client4.emit('joinGame', { userID: 'unauthenticated', room: gameID, createPrivate: false });
                client5 = io.connect(socketURL, options);
                client5.on('connect', (data) => {
                  client5.emit('joinGame', { userID: 'unauthenticated', room: gameID, createPrivate: false });
                  client6 = io.connect(socketURL, options);
                  client6.on('connect', (data) => {
                    client6.emit('joinGame', { userID: 'unauthenticated', room: gameID, createPrivate: false });
                    setTimeout(expectStartGame, 100);
                  });
                });
              });
            });
          });
        }
      });
    });
  });
});


text:
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import Drawer from '@material-ui/core/Drawer';
import Button from '@material-ui/core/Button';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import SettingsIcon from '@material-ui/icons/Settings';

import * as action from '../../action';

class MenuDrawer extends React.Component {
  onURLSettingsClick = () => {
    this.props.closeDrawer();
    this.props.openURLSettings();
  };

  render () {
    const menuList = (
      <List style={{ width: 250 }}>
        <ListItem button>
          <ListItemIcon>
            <SettingsIcon />
          </ListItemIcon>
          <ListItemText primary="URLs" />
        </ListItem>
      </List>
    );
    return (
      <Drawer open={this.props.drawerOpen} onClose={this.props.closeDrawer}>
        <div
          tabIndex={0}
          role="button"
          onClick={this.onURLSettingsClick.bind(this)}
          onKeyDown={this.props.closeDrawer}
        >
          {menuList}
        </div>
      </Drawer>
    );
  }
}

MenuDrawer.propTypes = {
  closeDrawer: PropTypes.func,
  drawerOpen: PropTypes.bool,
  openURLSettings: PropTypes.func
};

const mapStateToProps = state => {
  return {
    drawerOpen: state.menuDrawer.open
  };
};
const mapDispatchToProps = dispatch => {
  return {
    closeDrawer: () => dispatch(action.closeMenuDrawer()),
    openURLSettings: () =>
      dispatch(action.showModal('URL_SETTINGS', { open: true }))
  };
};

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(MenuDrawer);


text:
package com.chrisfolger.needsmoredojo.core.util;

import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiUtilBase;

public class PsiFileUtil
{
    public static PsiFile getPsiFileInCurrentEditor(Project project)
    {
        Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();

        if(editor == null)
        {
            return null;
        }

        PsiFile psiFile = PsiUtilBase.getPsiFileInEditor(editor, editor.getProject());

        return psiFile;
    }
}


text:
<library path="libshotcrete_points_publisher">
  <class name="rviz_plugin_shotcrete_points_publisher/ShotcreteSelector"
         type="rviz_plugin_shotcrete_points_publisher::shotcretePointsPublisher"
         base_class_type="rviz::Tool">
    <description>
      Fork of the rviz::SelectionTool:
      Drag with the left button to select objects in the 3D scene.
      Hold the Alt key to change viewpoint as in the Move tool.
      Additionally publishes selected points on /selected_points topic.
    </description>
  </class>
</library>


text:
package io.leopard.im.huanxin;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class HuanxinClientImplTest {

	@Autowired
	private HuanxinClientImpl huanxinClient;

	@Test
	public void sendMessage() {

	}

}


text:
package com.groupon.jenkins.dynamic.buildconfiguration;

import hudson.EnvVars;

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

import org.yaml.snakeyaml.Yaml;

import com.groupon.jenkins.dynamic.buildconfiguration.configvalue.ListValue;
import com.groupon.jenkins.dynamic.buildconfiguration.configvalue.MapValue;
import com.groupon.jenkins.dynamic.buildconfiguration.plugins.DotCiPluginAdapter;
import com.groupon.jenkins.notifications.PostBuildNotifier;

public class BuildConfiguration extends CompositeConfigSection {

	private EnvironmentSection environmentSection;
	protected BuildSection buildSection;
	private NotificationsSection notificationsSection;
	private PluginsSection pluginsSection;

	public BuildConfiguration(String ymlDefintion, EnvVars envVars) {
		this(translateIfOne(new BuildConfigurationFilter(ymlDefintion, envVars).getConfig(), envVars));
	}

	public BuildConfiguration(MapValue<String, ?> config) {
		super(".ci.yml", config);
		setSections();
	}

	private void setSections() {
		this.environmentSection = new EnvironmentSection(getSectionConfig(EnvironmentSection.NAME, MapValue.class));
		this.buildSection = new BuildSection(this.getSectionConfig(BuildSection.NAME, MapValue.class));
		this.notificationsSection = new NotificationsSection(getSectionConfig(NotificationsSection.NAME, ListValue.class));
		this.pluginsSection = new PluginsSection(getSectionConfig(PluginsSection.NAME, ListValue.class));
		setSubSections(environmentSection, buildSection, notificationsSection, pluginsSection);
	}

	@SuppressWarnings({ "unchecked" })
	private Object readResolve() {
		OneToTwoTranslator translator = new OneToTwoTranslator(configValue.getValue(), new EnvVars("BRANCH", "unknown"));
		if (translator.needsTranslation()) {
			setConfigValue(new MapValue(translator.getConfig()));
			setSections();
		}
		return this;
	}

	private static MapValue<String, ?> translateIfOne(Map config, EnvVars envVars) {
		return new MapValue<String, Object>(new OneToTwoTranslator(config, envVars).getConfig());
	}

	public boolean isSkipped() {
		return buildSection.isSkipped();
	}

	public List<PostBuildNotifier> getNotifiers() {
		return notificationsSection.getNotifiers();
	}

	public boolean isMultiLanguageVersions() {
		return environmentSection.isMultiLanguageVersions();
	}

	public boolean isMultiScript() {
		return buildSection.isMultiScript();
	}

	public List<String> getLanguageVersions() {
		return environmentSection.getLanguageVersions();
	}

	public List<DotCiPluginAdapter> getPlugins() {
		return pluginsSection.getPlugins();
	}

	public List<String> getScriptKeys() {
		return buildSection.getScriptKeys();
	}

	public String getLanguage() {
		return environmentSection.getLanguage();
	}

	public boolean isParallized() {
		return isMultiScript() || isMultiLanguageVersions();
	}

	public String toYaml() {
		return new Yaml().dump(getFinalConfigValue());
	}

	public static BuildConfiguration restoreFromYaml(String yaml) {
		MapValue<String, Object> config = new MapValue<String, Object>(new Yaml().load(yaml));
		return new BuildConfiguration(config);
	}

	public String getCheckoutScript() {
		return buildSection.getCheckoutScript();
	}

	public String getBuildRunScriptForDockerImage(String buildId, Map<String, String> envVars) {
		ShellCommands dockerCommands = environmentSection.getDockerBuildRunScriptForImage(buildId, envVars);
		return dockerCommands.toShellScript();
	}

	public String getDockerBuildRunCleanupScript(String buildId) {
		return environmentSection.getCleanupScript(buildId);
	}

	public boolean isDocker() {
		return environmentSection.isDocker();
	}

	public String getBuildRunScriptForDockerLocal(String buildId, Map<String, String> dotCiEnvVars, String buildScript) {
		ShellCommands dockerCommands = environmentSection.getDockerBuildRunScriptForLocal(buildId, dotCiEnvVars, buildScript);
		return dockerCommands.toShellScript();
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
        android:drawable="@drawable/ic_comment_click" /> <!-- pressed -->
    <item android:state_focused="true"
        android:drawable="@drawable/ic_comment_click" /> <!-- focused -->
    <item android:state_pressed="false"
        android:drawable="@drawable/ic_comment" />
    <item android:drawable="@drawable/ic_comment" /> <!-- default -->
</selector>


text:
ActiveRecord::Schema.define(version: 20160429145643) do

  create_table "sakes", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.integer  "prefecture", limit: 4
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
  end

  create_table "shops", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.string   "address",    limit: 255
    t.float    "latitude",   limit: 24
    t.float    "longitude",  limit: 24
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
  end

end


text:
package net.codescale.util.imdb;

public class Movie extends Object {

    public static enum DataSource {
        HTTP_REQUEST,
        FILESYSTEM
    }

    protected String data;
    protected DataSource dataSource;

    protected int id;
    protected String title;
    protected String year;
    protected String plot;

    public Movie setData(String data) {
        this.data = data;
        return this;
    }

    public Movie setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
        return this;
    }

    public Movie setId(int id) {
        this.id = id;
        return this;
    }

    public Movie setTitle(String title) {
        this.title = title;
        return this;
    }

    public Movie setYear(String year) {
        this.year = year;
        return this;
    }

    public Movie setPlot(String plot) {
        this.plot = plot;
        return this;
    }

    public String toString() {
        if (this.title != null && this.year != null) {
            return String.format("%s (%s)", this.title, this.year);
        } else {
            return "";
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.12">
	<Title>
		<v8:item>
			<v8:lang>ru</v8:lang>
			<v8:content>Исполнители роли</v8:content>
		</v8:item>
	</Title>
	<AutoTitle>false</AutoTitle>
	<AutoCommandBar name="ФормаКоманднаяПанель" id="-1"/>
	<Events>
		<Event name="OnCreateAtServer">ПриСозданииНаСервере</Event>
	</Events>
	<ChildItems>

			<Representation>Tree</Representation>
			<CommandBarLocation>None</CommandBarLocation>
			false
			<UseAlternationRowColor>true</UseAlternationRowColor>
			<InitialTreeView>ExpandAllLevels</InitialTreeView>
			<EnableStartDrag>true</EnableStartDrag>
			<FileDragMode>AsFile</FileDragMode>
			<DataPath>Исполнители</DataPath>
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Исполнители</v8:content>
				</v8:item>
			</Title>
			<AutoRefresh>false</AutoRefresh>
			<AutoRefreshPeriod>60</AutoRefreshPeriod>
			<Period>
				<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
				<v8:startDate>0001-01-01T00:00:00</v8:startDate>
				<v8:endDate>0001-01-01T00:00:00</v8:endDate>
			</Period>
			<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
			<RestoreCurrentRow>false</RestoreCurrentRow>
			<TopLevelParent xsi:nil="true"/>
			<ShowRoot>true</ShowRoot>
			<AllowRootChoice>false</AllowRootChoice>
			<UpdateOnDataChange>Auto</UpdateOnDataChange>
			<ContextMenu name="ИсполнителиКонтекстноеМеню" id="2"/>
			<AutoCommandBar name="ИсполнителиКоманднаяПанель" id="3"/>
			<ExtendedTooltip name="ИсполнителиExtendedTooltip" id="12"/>
			<SearchStringAddition name="ИсполнителиСтрокаПоиска" id="16">
				<AdditionSource>
					<Item>Исполнители</Item>
					<Type>SearchStringRepresentation</Type>
				</AdditionSource>
				<ContextMenu name="ИсполнителиСтрокаПоискаКонтекстноеМеню" id="17"/>
				<ExtendedTooltip name="ИсполнителиСтрокаПоискаРасширеннаяПодсказка" id="18"/>
			</SearchStringAddition>
			<ViewStatusAddition name="ИсполнителиСостояниеПросмотра" id="19">
				<AdditionSource>
					<Item>Исполнители</Item>
					<Type>ViewStatusRepresentation</Type>
				</AdditionSource>
				<ContextMenu name="ИсполнителиСостояниеПросмотраКонтекстноеМеню" id="20"/>
				<ExtendedTooltip name="ИсполнителиСостояниеПросмотраРасширеннаяПодсказка" id="21"/>
			</ViewStatusAddition>
			<SearchControlAddition name="ИсполнителиУправлениеПоиском" id="22">
				<AdditionSource>
					<Item>Исполнители</Item>
					<Type>SearchControl</Type>
				</AdditionSource>
				<ContextMenu name="ИсполнителиУправлениеПоискомКонтекстноеМеню" id="23"/>
				<ExtendedTooltip name="ИсполнителиУправлениеПоискомРасширеннаяПодсказка" id="24"/>
			</SearchControlAddition>
			<Events>
				<Event name="AfterDeleteRow">ИсполнителиПослеУдаления</Event>
			</Events>
			<ChildItems>
				<LabelField name="Исполнитель" id="6">
					<DataPath>Исполнители.Исполнитель</DataPath>
					<ContextMenu name="ИсполнительКонтекстноеМеню" id="7"/>
					<ExtendedTooltip name="ИсполнительExtendedTooltip" id="13"/>
				</LabelField>
				<LabelField name="ОсновнойОбъектАдресации" id="8">
					<DataPath>Исполнители.ОсновнойОбъектАдресации</DataPath>
					<UserVisible>
						<xr:Common>false</xr:Common>
					</UserVisible>
					<Title>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Основной объект адресации</v8:content>
						</v8:item>
					</Title>
					<ContextMenu name="ОсновнойОбъектАдресацииКонтекстноеМеню" id="9"/>
					<ExtendedTooltip name="ОсновнойОбъектАдресацииExtendedTooltip" id="14"/>
				</LabelField>
				<LabelField name="ДополнительныйОбъектАдресации" id="10">
					<DataPath>Исполнители.ДополнительныйОбъектАдресации</DataPath>
					<UserVisible>
						<xr:Common>false</xr:Common>
					</UserVisible>
					<ContextMenu name="ДополнительныйОбъектАдресацииКонтекстноеМеню" id="11"/>
					<ExtendedTooltip name="ДополнительныйОбъектАдресацииExtendedTooltip" id="15"/>
				</LabelField>
			</ChildItems>

	</ChildItems>
	<Attributes>
		<Attribute name="Исполнители" id="1">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Исполнители</v8:content>
				</v8:item>
			</Title>
			<Type>
				<v8:Type>cfg:DynamicList</v8:Type>
			</Type>
			<MainAttribute>true</MainAttribute>
			<Settings xsi:type="DynamicList">
				<ManualQuery>true</ManualQuery>
				<DynamicDataRead>true</DynamicDataRead>
				<QueryText>ВЫБРАТЬ
	РегистрСведенийИсполнителиЗадач.РольИсполнителя КАК РольИсполнителя,
	РегистрСведенийИсполнителиЗадач.Исполнитель КАК Исполнитель,
	ВЫБОР
		КОГДА РегистрСведенийИсполнителиЗадач.ОсновнойОбъектАдресации = НЕОПРЕДЕЛЕНО
			ТОГДА &БезОбъектаАдресации
		ИНАЧЕ РегистрСведенийИсполнителиЗадач.ОсновнойОбъектАдресации
	КОНЕЦ КАК ОсновнойОбъектАдресации,
	РегистрСведенийИсполнителиЗадач.ДополнительныйОбъектАдресации КАК ДополнительныйОбъектАдресации
ИЗ
	РегистрСведений.ИсполнителиЗадач КАК РегистрСведенийИсполнителиЗадач</QueryText>
				<MainTable>InformationRegister.ИсполнителиЗадач</MainTable>
				<ListSettings>
					<dcsset:filter>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>dfcece9d-5077-440b-b6b3-45a5cb4538eb</dcsset:userSettingID>
					</dcsset:filter>
					<dcsset:order>
						<dcsset:item xsi:type="dcsset:OrderItemField">
							<dcsset:field>Исполнитель</dcsset:field>
							<dcsset:orderType>Asc</dcsset:orderType>
						</dcsset:item>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>88619765-ccb3-46c6-ac52-38e9c992ebd4</dcsset:userSettingID>
					</dcsset:order>
					<dcsset:conditionalAppearance>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>b75fecce-942b-4aed-abc9-e6a02e460fb3</dcsset:userSettingID>
					</dcsset:conditionalAppearance>
					<dcsset:itemsViewMode>Normal</dcsset:itemsViewMode>
					<dcsset:itemsUserSettingID>911b6018-f537-43e8-a417-da56b22f9aec</dcsset:itemsUserSettingID>
				</ListSettings>
			</Settings>
		</Attribute>
	</Attributes>
	<Parameters>
		<Parameter name="РольИсполнителя">
			<Type>
				<v8:Type>cfg:CatalogRef.РолиИсполнителей</v8:Type>
			</Type>
			<KeyParameter>true</KeyParameter>
		</Parameter>
	</Parameters>
</Form>


text:
namespace MassTransit.Saga.Configuration
{
	using System;
	using System.Collections.Generic;
	using System.Linq.Expressions;
	using Magnum.StateMachine;

	public interface ISagaPolicyFactory
	{
		ISagaPolicy<TSaga, TMessage> GetPolicy<TSaga, TMessage>(IEnumerable<State> states, Expression<Func<TSaga, bool>> removeExpression)
			where TSaga : SagaStateMachine<TSaga>, ISaga
			where TMessage : class;
	}
}


text:
import * as q from "q";
import {Config} from "../configParser";
import {DriverProvider} from "./driverProvider";
export declare class BrowserStack extends DriverProvider {
    constructor(config:Config);

    /**
     * Hook to update the BrowserStack job status.
     * @public
     * @param {Object} update
     * @return {q.promise} A promise that will resolve when the update is complete.
     */
    updateJob(update:any):q.Promise<any>;

    /**
     * Configure and launch (if applicable) the object's environment.
     * @public
     * @return {q.promise} A promise which will resolve when the environment is
     *     ready to test.
     */
    setupEnv():q.Promise<any>;
}


text:
## App Design

At the beginning, give the app ability to learn new knowledges

So that app can output by itself

## Code Standard

### Controller

Controller handles session, input validation, routing service, logs

Controller must not handle business logic

Controller must have bean, input, output

Controller must extends BaseController

BaseController @Autowired all services

Forbidden cross invoke between any two controllers

### Service

Service handles business logic only

Service must not involve session

Service must have bean, input, output

Service must extends BaseService

BaseService @Autowired all daos

Forbidden cross invoke between any two services

### Dao

Dao handles data request only

Dao must have bean, input, output

Dao must extends BaseDao

Forbidden cross invoke between any two daos


text:
<?php
class CI_configuracoes extends CI_controller {

	public function __construct()
	{
		parent::__construct();

		$this->load->model('M_geral');
		$this->load->model('M_configuracoes');
		$this->load->model('M_usuarios');
		$this->load->model('M_perfisusuarios');
		$this->load->library('upload');
		$this->load->library('image_lib');
		$this->M_geral->verificaSessao();
		if ($this->session->userdata('usuario_id') != 0 && $this->session->userdata('usuario_id') != ""){
				$this->dados['isLoged'] = true;
				$this->dados['usuario_logado'] = $this->session->userdata('nome');
			}else
				$this->dados['isLoged'] = false;

		if ($this->session->userdata('usuario_id') != null && $this->M_usuarios->selecionar($this->session->userdata('usuario_id'))->result_array()[0]["website_titulo"] != ""){
			$this->dados['title'] = $this->M_usuarios->selecionar($this->session->userdata('usuario_id'))->result_array()[0]["website_titulo"];
		}else{
			$this->dados['title'] = $this->M_configuracoes->selecionar('titulo')->result_array()[0]["value"];
		}

		$this->dados["caminho"] = $this->uri->segment(1)."/".$this->uri->segment(2);
	}

	function index()
	{
		$this->cadastro();
	}

	function pesquisa($nr_pagina=20 ){
		$this->dados["metodo"] = "pesquisa";
		$this->dados["linhas"] = $this->M_configuracoes->pesquisar();
		$this->dados["nr_pagina"] = $nr_pagina;
		$this->dados["total"] = $this->M_configuracoes->numeroLinhasTotais($select='', $where=array());
		$this->dados["tituloPesquisa"] = "Configurações do Perfil";
		$pag['base_url'] = base_url.$this->dados["caminho"]."/".$this->dados["metodo"]."/".$nr_pagina."/";
		$pag['total_rows'] = $this->dados["total"];
		$pag['uri_segment']	= 5;
		$pag['per_page'] = $this->dados["nr_pagina"];
		$this->pagination->initialize($pag);
		$this->load->view('inc/topo',$this->dados);
		$this->load->view('inc/menu');
		$this->load->view('inc/topoPesquisa');
		$this->load->view('cadastros/configuracoes/pesquisa');
		$this->load->view('inc/rodape');
	}

	function cadastro(){
		$this->dados["linhas"] = $this->M_configuracoes->pesquisar();
		$this->load->view('inc/topo',$this->dados);
		$this->load->view('inc/menu');
		$this->load->view('cadastros/configuracoes/cadastro');
		$this->load->view('inc/rodape');
	}

	function removeImage($nome_exc){
		if(isset($nome_exc))
			unlink("./uploads/".$nome_exc);
	}

	function removeImageByConfig($id="",$nome_exc){
		$excluir = $this->M_configuracoes->selecionar($id)->result_array();
		if(isset($excluir[0][$nome_exc]))
			unlink("./uploads/".$excluir[0][$nome_exc]);
	}

	function gravar(){
		$this->form_validation->set_rules('titulo_projeto', 'Titulo do Projeto', 'trim|required');
		$this->form_validation->set_rules('titulo', 'Titulo da Aplicacao', 'trim|required');
		$this->form_validation->set_rules('titulo', 'Titulo', 'trim|required');
		$this->form_validation->set_error_delimiters('
', '
');
		$this->form_validation->set_message('required', 'Você deve preencher o campo "%s".');
		if ($this->form_validation->run() == FALSE) {
				$this->cadastro();
		} else {
			$imgCabecalho = $this->M_geral->uploadFile("img_cabecalho",true);

			if (isset($imgCabecalho["upload_data"])){
				$_POST['img_cabecalho'] = $imgCabecalho["upload_data"]['file_name'];
			}

			$imgProjeto = $this->M_geral->uploadFile("img_projeto",true);
			if (isset($imgProjeto["upload_data"])){
				$_POST['img_projeto'] = $imgProjeto["upload_data"]['file_name'];
			}

			foreach ($_POST as $key => $value) {

				$this->M_configuracoes->setName($key);
				$this->M_configuracoes->setValue(isset($value) ? $value : null);

				if($this->M_configuracoes->salvar() == "alt")
					$this->dados["msg"] = "Dados registrados com sucesso!";
				else
					$this->dados["msg"] = "Dados não registrados com sucesso!";
			}

			$this->cadastro();
		}
	}

	function gravarGeral(){
		$this->form_validation->set_rules('titulo', 'Titulo', 'trim|required');
		$this->form_validation->set_error_delimiters('
', '
');
		$this->form_validation->set_message('required', 'Você deve preencher o campo "%s".');
		if ($this->form_validation->run() == FALSE) {
			if ($_POST['configuracao_id'] != "") {
				$this->editar($_POST['configuracao_id']);
			} else {
				$this->cadastro();
			}
		} else {

			$this->M_configuracoes->setConfiguracaoId(1);
			$this->M_configuracoes->setUsuarioId(null);
			$this->M_configuracoes->setTitulo($_POST["titulo"]);

			$imgCabecalho = $this->M_geral->uploadFile("img_cabecalho");
			$old = $this->M_configuracoes->selecionar(1)->result_array();
			if (isset($imgCabecalho["upload_data"])){
					if (isset($old[0]["img_cabecalho"]) && $old[0]["img_cabecalho"] != null){
						$this->removeImageByConfig($this->session->userdata('usuario_id'),"img_cabecalho");
					}
					$this->M_configuracoes->setImgCabecalho($imgCabecalho["upload_data"]['file_name']);
			}
			else
				$this->M_configuracoes->setImgCabecalho($old[0]["img_cabecalho"]);

			$imgProjeto = $this->M_geral->uploadFile("img_projeto");
			$old = $this->M_configuracoes->selecionar(1)->result_array();
			if (isset($imgProjeto["upload_data"])){
					if (isset($old[0]["img_projeto"]) && $old[0]["img_projeto"] != null){
						$this->removeImageByConfig($this->session->userdata('usuario_id'),"img_projeto");
					}
					$this->M_configuracoes->setImgProjeto($imgProjeto["upload_data"]['file_name']);
			}
			else
				$this->M_configuracoes->setImgProjeto($old[0]["img_projeto"]);

			$this->M_configuracoes->setCorPredominante(isset($_POST["cor_predominante"]) ? $_POST["cor_predominante"] : null);

			$this->M_configuracoes->salvar();
			$this->dados["msg"] = "Dados alterados com sucesso!";
			$this->geral();
		}
	}

	function excluir($id=""){
		if ($id==""){

			if(isset($_POST["item"])) {
				$this->removeImageByConfig($_POST["item"],"img_projeto");
				$this->removeImageByConfig($_POST["item"],"img_cabecalho");
				$this->M_configuracoes->setConfiguracaoId($_POST["item"]);
				$this->M_configuracoes->excluir();
			}
		}
		else{
			$this->removeImageByConfig($id,"img_projeto");
			$this->removeImageByConfig($id,"img_cabecalho");
			$this->M_configuracoes->setConfiguracaoId($id);
			$this->M_configuracoes->excluir();
		}
		$this->dados["msg"] = "Registro(s) excluído(s) com sucesso!";
		$this->pesquisa();
	}

   function editar($valor = "") {
		if(isset($_POST["item"])) {
			$this->dados["registro"] = $this->M_configuracoes->selecionar($_POST["item"]);
		} else if ($valor != "") {
			$this->dados["registro"] = $this->M_configuracoes->selecionar($valor);
		}
		$this->cadastro();
	}

}
?>


text:
package com.systematic.trading.backtest.output.elastic.model;

/**
 * The set of fields that Systematic Trading use with Elastic Search.
 *
 * @author CJ Hare
 */
public enum ElasticFieldName {

	AMOUNT(ElasticTypeName.AMOUNT),
	CASH_BALANCE(ElasticTypeName.CASH_BALANCE),
	DIRECTION_TYPE(ElasticTypeName.DIRECTION_TYPE),
	END_EQUITY_BALANCE(ElasticTypeName.END_EQUITY_BALANCE),
	EQUITY_BALANCE(ElasticTypeName.EQUITY_BALANCE),
	EQUITY_BALANCE_VALUE(ElasticTypeName.EQUITY_BALANCE_VALUE),
	EQUITY_AMOUNT(ElasticTypeName.EQUITY_AMOUNT),
	EQUITY_VALUE(ElasticTypeName.EQUITY_VALUE),
	EVENT(ElasticTypeName.EVENT),
	EVENT_DATE(ElasticTypeName.EVENT_DATE),
	FUNDS_AFTER(ElasticTypeName.FUNDS_AFTER),
	FUNDS_BEFORE(ElasticTypeName.FUNDS_BEFORE),
	FREQUENCY(ElasticTypeName.FREQUENCY),
	IDENTITY(ElasticTypeName.IDENTITY),
	INCLUSIVE_START_DATE(ElasticTypeName.START_DATE_INCLUSIVE),
	EXCLUSIVE_END_DATE(ElasticTypeName.END_DATE_EXCLUSIVE),
	NETWORTH(ElasticTypeName.NETWORTH),
	PERCENTAGE_CHANGE(ElasticTypeName.PERCENTAGE_CHANGE),
	SIGNAL_DATE(ElasticTypeName.SIGNAL_DATE),
	SIGNAL_TYPE(ElasticTypeName.SIGNAL_TYPE),
	STARTING_EQUITY_BALANCE(ElasticTypeName.STARTING_EQUITY_BALANCE),
	TRANSACTION_DATE(ElasticTypeName.TRANSACTION_DATE),
	TRANSACTION_FEE(ElasticTypeName.TRANSACTION_FEE),
	TOTAL_COST(ElasticTypeName.TOTAL_COST);

	private final String fieldName;

	ElasticFieldName( final String name ) {

		this.fieldName = name;
	}

	public String fieldName() {

		return fieldName;
	}
}