text:
"""
    This code was generated by Codezu.

    Changes to this file may cause incorrect behavior and will be lost if
    the code is regenerated.
"""

from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozurestsdk.apicontext import ApiContext;

class DocumentDraftSummary(object):
	def __init__(self, apiContext: ApiContext = None, mozuClient = None):
		self.client = mozuClient or default_client();
		if (apiContext is not None):
			self.client.withApiContext(apiContext);
		else:
			self.client.withApiContext(ApiContext());

	def listDocumentDraftSummaries(self,pageSize = None, startIndex = None, documentLists = None, responseFields = None):
		""" Retrieves a list of the documents currently in draft state, according to any defined filter and sort criteria.

		Args:
			| pageSize (int) - The number of results to display on each page when creating paged results from a query. The maximum value is 200.
			| startIndex (int) - When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a PageSize of 25, to get the 51st through the 75th items, use startIndex=3.
			| documentLists (string) - List of document lists that contain documents to delete.
			| responseFields (string) - Use this field to include those fields which are not included by default.

		Returns:
			| DocumentDraftSummaryPagedCollection

		Raises:
			| ApiException

		"""

		url = MozuUrl("/api/content/documentpublishing/draft?pageSize={pageSize}&startIndex={startIndex}&documentLists={documentLists}&responseFields={responseFields}", "GET", UrlLocation.TenantPod, False);
		url.formatUrl("documentLists", documentLists);
		url.formatUrl("pageSize", pageSize);
		url.formatUrl("responseFields", responseFields);
		url.formatUrl("startIndex", startIndex);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	def deleteDocumentDrafts(self,documentIds, documentLists = None):
		""" Deletes the drafts of the specified documents. Published documents cannot be deleted.

		Args:
			| documentIds(array|documentIds) - Unique identifiers of the documents to delete.
			| documentLists (string) - List of document lists that contain documents to delete.

		Raises:
			| ApiException

		"""

		url = MozuUrl("/api/content/documentpublishing/draft?documentLists={documentLists}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("documentLists", documentLists);
		self.client.withResourceUrl(url).withBody(documentIds).execute();

	def publishDocuments(self,documentIds, documentLists = None):
		""" Publish one or more document drafts to live content on the site.

		Args:
			| documentIds(array|documentIds) - Unique identifiers of the documents to delete.
			| documentLists (string) - List of document lists that contain documents to delete.

		Raises:
			| ApiException

		"""

		url = MozuUrl("/api/content/documentpublishing/active?documentLists={documentLists}", "PUT", UrlLocation.TenantPod, False);
		url.formatUrl("documentLists", documentLists);
		self.client.withResourceUrl(url).withBody(documentIds).execute();


text:
import lan
import lan.ast_buildingblock as ast_bb
from processing import collect_array as ca
from processing import collect_device as cd

class BoilerplateBase(object):
    def __init__(self, ast, file_ast):
        self.ast = ast
        self.file_ast = file_ast

        # Properties
        # Used in globals_vars
        self._cl_mem_name = 'cl_mem'
        self._first_time_name = 'isFirstTime'
        self._kernel_defines_name = 'KernelDefines'

        # Used in BufferAllocation
        self._allocate_buffers_name = 'AllocateBuffers'
        self._err_name = 'oclErrNum'

        # Used in KernelArgs
        self._set_arguments_name = 'SetArguments'
        self._cl_set_kernel_arg_name = 'clSetKernelArg'

        # Used in ExecKernel
        self._exec_event_name = 'GPUExecution'
        self._command_queue_name = 'command_queue'
        self._cl_exec_kernel_func_name = 'clEnqueueNDRangeKernel'
        self._cl_finish_name = 'clFinish'

    def _get_kernel_id(self):
        kernel_name = cd.get_kernel_name(self.ast)
        kernel_id = lan.Id(kernel_name)
        return kernel_id

    def _err_check_function(self, cl_function_name, var_name=''):
        if not var_name == '':
            var_name = ' ' + var_name
        arglist = [lan.Id(self._err_name), lan.Constant(cl_function_name + var_name)]
        return ast_bb.FuncCall('oclCheckErr', arglist)

    def _cl_success(self):
        lval = lan.TypeId(['cl_int'], lan.Id(self._err_name))
        rval = lan.Id('CL_SUCCESS')
        return lan.Assignment(lval, rval)

def func_call_sizeof(ctype):
    return ast_bb.FuncCall('sizeof', [lan.Type(ctype)])

def is_type_pointer(ctype):
    return len(ctype) == 2

def count_id():
    return lan.Id('counter')

def void_pointer_ref(ptr_name):
    return lan.Id('(void *) &' + ptr_name)

class BPNameSwap(object):
    def __init__(self, ast):
        self.name_swap = ca.get_host_array_name_swap(ast)

    def try_swap(self, key):
        try:
            key = self.name_swap[key]
        except KeyError:
            pass
        return key

redpajama_set_name: RedPajamaGithub


text:
using System.Collections;

using Xunit;

namespace System.Net.Primitives.Unit.Tests
{
    public class CookieCollectionTest
    {
        //These cookies are designed to have some similar and different properties so that each is unique in the eyes of a CookieComparer object
        private static Cookie c1 = new Cookie("name1", "value");
        private static Cookie c2 = new Cookie("name2", "value", "path"); //Same name, has a path
        private static Cookie c3 = new Cookie("name2", "value", "different-path"); //Same name, different path
        private static Cookie c4 = new Cookie("name3", "value", "path", "domain"); //Different name, has a domain
        private static Cookie c5 = new Cookie("name3", "value", "path", "different-domain"); //Same name, different domain

        private static CookieCollection CreateCookieCollection1()
        {
            CookieCollection cc = new CookieCollection();

            cc.Add(c1);
            cc.Add(c2);
            cc.Add(c3);
            cc.Add(c4);
            cc.Add(c5);

            return cc;
        }

        private static CookieCollection CreateCookieCollection2()
        {
            CookieCollection cc = new CookieCollection();

            cc.Add(CreateCookieCollection1());

            return cc;
        }

        [Fact]
        public void IndexSubscript_Get_Success()
        {
            CookieCollection cc = CreateCookieCollection1();

            Assert.Equal(cc[0], c1);
            Assert.Equal(cc[1], c2);
            Assert.Equal(cc[2], c3);
            Assert.Equal(cc[3], c4);
            Assert.Equal(cc[4], c5);

            Assert.Equal(cc["name1"], c1);
            Assert.Equal(cc["name2"], c2);
            Assert.Equal(cc["name3"], c4);
        }

        [Fact]
        public void IndexSubscript_Get_Invalid()
        {
            CookieCollection cc = CreateCookieCollection1();

            Assert.Throws<ArgumentOutOfRangeException>(() => cc[-1]); // Index < 0
            Assert.Throws<ArgumentOutOfRangeException>(() => cc[cc.Count]); // Index >= Count

            Assert.Null(cc["no such name"]);
        }
    }
}


text:
/**
 * \file preconditioner.h
 * \brief Definition of the class \c preconditioner.
 */

#pragma once

#include <cusp/linear_operator.h>
#include <cusp/csr_matrix.h>
#include <cusp/precond/diagonal.h>
#include <cusp/precond/aggregation/smoothed_aggregation.h>
#include <cusp/precond/ainv.h>
#include <cusp/detail/format.h>

#include "types.h"

/**
 * \class preconditioner
 * \brief Stores the preconditioner for a given system.
 */
template <typename Matrix>
class preconditioner
{
	preconditionerType type;  ///< type of preconditioner

	cusp::linear_operator<typename Matrix::value_type,
	                      typename Matrix::memory_space,
	                      typename Matrix::index_type>* LO;  ///< linear operator

public:
	typedef typename Matrix::index_type   index_type;
	typedef typename Matrix::value_type   value_type;
	typedef typename Matrix::memory_space memory_space;
	typedef typename cusp::unknown_format format;

	// constructor
	preconditioner(){};

	// constructor overloading
	preconditioner(const Matrix &A, preconditionerType _type);

	// destructor
	~preconditioner();

	// update the preconditioner of the system
	void update(const Matrix &A);

	// overload the operator ()
	template <typename VectorType1, typename VectorType2>
	void operator()(const VectorType1 &x, VectorType2 &y) const;
}; // preconditioner

/**
 * \brief Constructor overloading. Computes the preconditioner
 *        given a matrix and a type of preconditioner.
 *
 * \param A matrix of the system (instance of the class \c Matrix)
 * \param _type the type of preconditioner
 */
template <class Matrix>
preconditioner<Matrix>::preconditioner(const Matrix &A, preconditionerType _type)
{
	typedef typename Matrix::value_type   ValueType;
	typedef typename Matrix::index_type   IndexType;
	typedef typename Matrix::memory_space MemorySpace;

	type = _type;

	// generate an instance of linear_operator with the required derived class
	// depending on the second parameter
	/*if (type == NONE)
		LO = new cusp::identity_operator<ValueType, MemorySpace>(A.num_rows, A.num_cols);
	else*/
	if (type == DIAGONAL)
		LO = new cusp::precond::diagonal<ValueType, MemorySpace>(A);
	else
	if (type == SMOOTHED_AGGREGATION)
		LO = new cusp::precond::aggregation::smoothed_aggregation<IndexType, ValueType, MemorySpace>(A);
	else
	if (type == AINV)
		LO = new cusp::precond::nonsym_bridson_ainv<ValueType, MemorySpace>(A);
	else
	{
		printf("Error: Unknown preconditionerType!\n");
		exit(-1);
	}
} // preconditioner

/**
 * \brief Destructor. Deletes the preconditioner.
 */
template <typename Matrix>
preconditioner<Matrix>::~preconditioner()
{
	delete LO;
}

/**
 * \brief Updates the preconditioner of the system.
 *
 * \param A matrix of the system (instance of the class \c Matrix)
 */
template <class Matrix>
void preconditioner<Matrix>::update(const Matrix &A)
{
	typedef typename Matrix::value_type   ValueType;
	typedef typename Matrix::index_type   IndexType;
	typedef typename Matrix::memory_space MemorySpace;

	/*if (type == NONE)
		LO = cusp::identity_operator<ValueType, MemorySpace>(A.num_rows, A.num_cols);
	else*/
	if (type == DIAGONAL)
		*LO = cusp::precond::diagonal<ValueType, MemorySpace>(A);
	else
	if (type == SMOOTHED_AGGREGATION)
		*LO = cusp::precond::aggregation::smoothed_aggregation<IndexType, ValueType, MemorySpace>(A);
	else
	if (type == AINV)
		*LO = cusp::precond::nonsym_bridson_ainv<ValueType, MemorySpace>(A);
	else
	{
		printf("Error: Unknown preconditionerType!\n");
		exit(-1);
	}
} // update

/**
 * \brief Overloads the operator (). This is required due to the way preconditioners are
					implemented in Cusp - as linear operators on a vector.
 */
template <typename Matrix>
template <typename VectorType1, typename VectorType2>
void preconditioner<Matrix>::operator()(const VectorType1 &x, VectorType2 &y) const
{
	/*if (type == NONE)
	{
		cusp::identity_operator<value_type, memory_space> *identity =
			static_cast<cusp::identity_operator<value_type, memory_space> *>(LO);
		printf("dispatching identity->operator()\n");
		identity->operator()(x,b);
	}
	else*/
	if (type == DIAGONAL)
	{
		cusp::precond::diagonal<value_type, memory_space> *diag =
		  static_cast<cusp::precond::diagonal<value_type, memory_space> *>(LO);
		diag->operator()(x,y);
	}
	else if (type == SMOOTHED_AGGREGATION)
	{
		cusp::precond::aggregation::smoothed_aggregation<index_type, value_type, memory_space> *SA =
		  static_cast<cusp::precond::aggregation::smoothed_aggregation<index_type, value_type, memory_space> *>(LO);
		SA->operator()(x,y);
	}
	else if (type == AINV)
	{
		cusp::precond::nonsym_bridson_ainv<value_type, memory_space> *AI =
		  static_cast<cusp::precond::nonsym_bridson_ainv<value_type, memory_space> *>(LO);
		AI->operator()(x,y);
	}
	else
	{
		printf("Error: Unknown preconditionerType!\n");
		exit(-1);
	}
} // operator()


text:
package com.sloshydog.eventuate.api;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.commons.lang3.builder.EqualsBuilder.reflectionEquals;
import static org.apache.commons.lang3.builder.HashCodeBuilder.reflectionHashCode;

public class EventSpecification {

    private final String aggregateIdentifier;
    private final String aggregateType;

    public EventSpecification(String aggregateType, String aggregateIdentifier) {
        checkArgument(aggregateType != null, "aggregateIdentifier is null");
        checkArgument(aggregateIdentifier != null, "aggregateIdentifier is null");
        this.aggregateIdentifier = aggregateIdentifier;
        this.aggregateType = aggregateType;
    }

    public String getAggregateIdentifier() {
        return aggregateIdentifier;
    }

    public String getAggregateType() {
        return aggregateType;
    }

    public boolean matches(Event event) {
        checkNotNull(event, "event is null");
        return aggregateIdentifier.matches(event.getAggregateIdentifier()) && getAggregateType().matches(event.getAggregateType());
    }

    @Override
    public boolean equals(Object other) {
        return reflectionEquals(this, other);
    }

    @Override
    public int hashCode() {
        return reflectionHashCode(this);
    }
}


text:
module WebifyRuby
  # Internal: A connection with rails
  class Railtie < Rails::Railtie
    rake_tasks { WebifyRuby::load_tasks }
  end
end


text:
<?php
class Kwc_Composite_ImagesEnlarge_PageTestModel extends Kwf_Model_FnF
{
    protected $_data = array(
            array('id'=>2200, 'pos'=>1, 'visible'=>true, 'name'=>'Foo', 'filename' => 'foo', 'custom_filename' => false,
                  'parent_id'=>'root', 'component'=>'images', 'is_home'=>false, 'category' =>'main', 'hide'=>false, 'parent_subroot_id' => 'root'),
        );
}


text:
package me.haosdent.cgroup.util;

public class Processes {
  //TODO
}


text:
#pragma once
#include <aws/glue/Glue_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace Glue
{
namespace Model
{
  enum class LogicalOperator
  {
    NOT_SET,
    EQUALS
  };

namespace LogicalOperatorMapper
{
AWS_GLUE_API LogicalOperator GetLogicalOperatorForName(const Aws::String& name);

AWS_GLUE_API Aws::String GetNameForLogicalOperator(LogicalOperator value);
} // namespace LogicalOperatorMapper
} // namespace Model
} // namespace Glue
} // namespace Aws


text:
class CefWebPluginInfoVisitorCppToC
    : public CefCppToCRefCounted<CefWebPluginInfoVisitorCppToC,
                                 CefWebPluginInfoVisitor,
                                 cef_web_plugin_info_visitor_t> {
 public:
  CefWebPluginInfoVisitorCppToC();
  virtual ~CefWebPluginInfoVisitorCppToC();
};

#endif  // CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_


text:
body{
	background-color: #6c232a !important;
	background-image: url("images/red/ap_bg_red.png");
}
#main{
	background-color: #ad4b4c;
	border: 5px solid #eeeeee;
}
#mf_form_list li .middle_form_bar{
	background-color: #9b5657;
}
#mf_form_list li.form_selected div.middle_form_bar,
#mf_form_list li .middle_form_bar:hover,
#mf_search_box,#mf_search_title, #mf_search_tag {
	background: none;
    background-color: #ad4b4c;
}
#mf_search_title a, #mf_search_tag a{
	color: #ad4b4c;
}
#filter_form_input{
	border-color: #ad4b4c;
}
#footer .copyright,#footer a:link, #footer a:visited {
	color: #ad4b4c;
}
.ui-dialog{
	border: 15px solid #ad4b4c !important;
	background-color: #ad4b4c !important;
}
#mf_form_list .form_option{
 background-color: #9B5657;
}
#mf_form_list .form_option:hover{
	background-color: #edb817;
}
.dropui-pink .dropui-tab{
	background-color: #AD4B4C !important;
	border-color: #AD4B4C !important;
}
.dropui-pink:hover .dropui-content { border-color: #AD4B4C !important; }
.dropui-pink.dropui-menu .dropui-content { background-color: #AD4B4C !important; }
#mf_form_list .form_option.mf_link_entries,#mf_form_list .form_option.mf_link_edit{
    background-color: #b87e5a;
}
#bottom_bar{
	background-color: #c77e7e;
	border-color: #c77e7e;
}
#social,#btn_add_field{
	background-color: #c77e7e !important;
}
#btn_add_field a{
	color: #fff !important;
}
#social li a:link {
    background-color: #a3534f;
}


text:
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
require 'ostruct'

require 'rack/mock'
require 'stringio'
Merb.start :environment => 'test',
           :merb_root => File.dirname(__FILE__) / 'fixture'

class SimpleRequest < OpenStruct

  def method
    @table[:method]
  end

  def params
    @table
  end
end

def prepare_route(from, to)
  Merb::Router.prepare {|r| r.match(from).to(to)}
end

def route_to(path, args = {}, protocol = "http://")
  Merb::Router.match(SimpleRequest.new({:protocol => protocol, :path => path}.merge(args)))[1]
end

def match_for(path, args = {}, protocol = "http://")
  Merb::Router.match(SimpleRequest.new({:protocol => protocol, :path => path}.merge(args)))
end

def matched_route_for(*args)
  # get route index
  idx = match_for(*args)[0]

  Merb::Router.routes[idx]
end

def generate(*args)
  Merb::Router.generate *args
end

module Merb

  module Test

    module RspecMatchers

      class HaveRoute

        def self.build(expected)
          this = new
          this.instance_variable_set("@expected", expected)
          this
        end

        def matches?(target)
          @target = target
          @errors = []
          @expected.all? { |param, value| @target[param] == value }
        end

        def failure_message
          @target.each do |param, value|
            @errors << "Expected :#{param} to be #{@expected[param].inspect}, but was #{value.inspect}" unless
              @expected[param] == value
          end
          @errors << "Got #{@target.inspect}"
          @errors.join("\n")
        end

        def negative_failure_message
          "Expected #{@expected.inspect} not to be #{@target.inspect}, but it was."
        end

        def description() "have_route #{@target.inspect}" end
      end

      def have_route(expected)
        HaveRoute.build(expected)
      end

      def have_nil_route
        have_route({})
      end

    end
  end
end


text:
#include "config.h"
#include "V8History.h"

#include "BindingState.h"
#include "ExceptionCode.h"
#include "History.h"
#include "SerializedScriptValue.h"
#include "V8Binding.h"
#include "V8DOMWindow.h"
#include "V8HiddenPropertyName.h"

namespace WebCore {

v8::Handle<v8::Value> V8History::stateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.History.state");
    History* history = V8History::toNative(info.Holder());

    v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(V8HiddenPropertyName::state());

    if (!value.IsEmpty() && !history->stateChanged())
        return value;

    SerializedScriptValue* serialized = history->state();
    value = serialized ? serialized->deserialize(0, info.GetIsolate()) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    info.Holder()->SetHiddenValue(V8HiddenPropertyName::state(), value);

    return value;
}

v8::Handle<v8::Value> V8History::pushStateCallback(const v8::Arguments& args)
{
    bool didThrow = false;
    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, 0, didThrow, args.GetIsolate());
    if (didThrow)
        return v8::Undefined();

    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, title, args[1]);
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, url, MAYBE_MISSING_PARAMETER(args, 2, DefaultIsNullString));

    ExceptionCode ec = 0;
    History* history = V8History::toNative(args.Holder());
    history->stateObjectAdded(historyState.release(), title, url, History::StateObjectPush, ec);
    args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
    return setDOMException(ec, args.GetIsolate());
}

v8::Handle<v8::Value> V8History::replaceStateCallback(const v8::Arguments& args)
{
    bool didThrow = false;
    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, 0, didThrow, args.GetIsolate());
    if (didThrow)
        return v8::Undefined();

    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, title, args[1]);
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, url, MAYBE_MISSING_PARAMETER(args, 2, DefaultIsNullString));

    ExceptionCode ec = 0;
    History* history = V8History::toNative(args.Holder());
    history->stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
    args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
    return setDOMException(ec, args.GetIsolate());
}

bool V8History::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
{
    History* history = V8History::toNative(host);
    return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), history->frame(), DoNotReportSecurityError);
}

bool V8History::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
{
    History* history = V8History::toNative(host);
    return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), history->frame(), DoNotReportSecurityError);
}

} // namespace WebCore


text:
<?php

namespace Zephir\DependencyInjection;

use const DIRECTORY_SEPARATOR;
use Oneup\FlysystemBundle\OneupFlysystemBundle;
use Symfony\Bundle\MonologBundle\MonologBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel;
use Zephir\DependencyInjection\CompilerPass\CollectCommandsToApplicationCompilerPass;
use function Zephir\is_macos;
use function Zephir\is_windows;
use Zephir\Zephir;

final class ZephirKernel extends Kernel
{
    private $extraConfigFiles;
    private $startedDir;

    /**
     * AppKernel constructor.
     *
     * @param string   $environment The environment
     * @param bool     $debug       Whether to enable debugging or not
     * @param string[] $configFiles Optional Zephir configuration files
     */
    public function __construct($environment, $debug, array $configFiles = [])
    {
        $this->extraConfigFiles = $configFiles;
        $this->startedDir = getcwd();

        parent::__construct($environment, $debug);
    }

    /**
     * {@inheritdoc}
     *
     * @return BundleInterface[]|iterable
     */
    public function registerBundles()
    {
        return [
            new MonologBundle(),
            new OneupFlysystemBundle(),
        ];
    }

    /**
     * {@inheritdoc}
     *
     * @param LoaderInterface $loader
     *
     * @throws \Exception|\Throwable
     */
    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/../config/config.yml');

        foreach ($this->extraConfigFiles as $configFile) {
            $loader->load($configFile);
        }
    }

    /**
     * {@inheritdoc}
     *
     * @return string
     */
    public function getCacheDir()
    {
        // allows container rebuild when config or version changes
        $hash = Zephir::VERSION.$this->environment.serialize($this->extraConfigFiles);
        $home = getenv('HOME') ?: (getenv('HOMEDRIVE').DIRECTORY_SEPARATOR.getenv('HOMEPATH'));

        if (is_macos()) {
            $cacheDir = getenv('XDG_CACHE_HOME') ?: $home.'/Library/Caches';
            $cacheDir .= '/Zephir';
        } elseif (is_windows()) {
            $cacheDir = getenv('LOCALAPPDATA') ?: $home;
            $cacheDir .= '\\Zephir\\Cache';
        } else {
            $cacheDir = getenv('XDG_CACHE_HOME') ?: $home.'/.cache';
            $cacheDir .= '/zephir';
        }

        $path = $cacheDir.DIRECTORY_SEPARATOR.substr(md5($hash), 0, 16);
        if (!is_dir($path) && !mkdir($path, 0777, true) && !is_dir($path)) {
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
        }

        return $path;
    }

    /**
     * {@inheritdoc}
     *
     * @return string
     */
    public function getLogDir()
    {
        $home = getenv('HOME') ?: (getenv('HOMEDRIVE').DIRECTORY_SEPARATOR.getenv('HOMEPATH'));

        if (is_macos()) {
            $stateDir = getenv('XDG_STATE_HOME') ?: $home.'/Library';
            $stateDir .= '/Zephir/State';
        } elseif (is_windows()) {
            $stateDir = getenv('LOCALAPPDATA') ?: $home;
            $stateDir .= '\\Zephir\\State';
        } else {
            // See: https://stackoverflow.com/a/27965014/1661465
            $stateDir = getenv('XDG_STATE_HOME') ?: $home.'/.local/state';
            $stateDir .= '/zephir';
        }

        $path = $stateDir.DIRECTORY_SEPARATOR.Zephir::VERSION;
        if (!is_dir($path) && !mkdir($path, 0777, true) && !is_dir($path)) {
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
        }

        return $path;
    }

    /**
     * {@inheritdoc}
     *
     * @return string The project root dir
     */
    public function getProjectDir()
    {
        return \dirname(\dirname(__DIR__));
    }

    /**
     * {@inheritdoc}
     */
    public function getRootDir()
    {
        return \dirname(__DIR__);
    }

    /**
     * Gets the local cache directory used internally by zephir.
     *
     * @return string The local cache dir
     */
    public function getStartedDir()
    {
        return $this->startedDir.'/.zephir';
    }

    /**
     * {@inheritdoc}
     *
     * @param ContainerBuilder $containerBuilder
     */
    protected function build(ContainerBuilder $containerBuilder)
    {
        $containerBuilder->addCompilerPass(new CollectCommandsToApplicationCompilerPass());
    }

    /**
     * {@inheritdoc}
     *
     * @return array An array of kernel parameters
     */
    protected function getKernelParameters()
    {
        $parameters = parent::getKernelParameters();
        $parameters['kernel.local_cache_dir'] = $this->getStartedDir();

        return $parameters;
    }
}


text:
package com.streamsets.pipeline.lib.salesforce;

import com.streamsets.pipeline.api.Config;
import com.streamsets.pipeline.api.StageException;
import com.streamsets.pipeline.api.StageUpgrader;
import com.streamsets.pipeline.stage.origin.salesforce.ForceSourceUpgrader;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;

import java.util.ArrayList;
import java.util.List;

public abstract class TestForceInputUpgrader {
  public abstract StageUpgrader getStageUpgrader();

  // Tests common behavior of origin and lookup processor upgrade - returns the configs that
  // differ between the two
  public List<Config> testUpgradeV2toV3Common() throws StageException {
    StageUpgrader.Context context = Mockito.mock(StageUpgrader.Context.class);
    Mockito.doReturn(2).when(context).getFromVersion();
    Mockito.doReturn(3).when(context).getToVersion();

    List<Config> configs = new ArrayList<>();

    configs.add(new Config("forceConfig.usePKChunking", false));
    configs.add(new Config("forceConfig.chunkSize", 1000));
    configs.add(new Config("forceConfig.startId", "000000000000000"));

    StageUpgrader upgrader = getStageUpgrader();

    upgrader.upgrade(configs, context);

    List<Config> configsToRemove = new ArrayList<>();
    int count = 0;
    for (Config config : configs) {
      if (config.getName().startsWith("forceConfig.bulkConfig.")) {
        configsToRemove.add(config);
        count++;
      }
    }
    Assert.assertEquals("Bulk config was not properly upgraded", 3, count);
    configs.removeAll(configsToRemove);

    return configs;
  }
}


text:
#include <ucontext.h>

namespace factor
{

inline static unsigned int uap_fpu_status(void *uap)
{
	ucontext_t *ucontext = (ucontext_t *)uap;
	return ucontext->uc_mcontext.fpregs->swd
		| ucontext->uc_mcontext.fpregs->mxcsr;
}

inline static void uap_clear_fpu_status(void *uap)
{
	ucontext_t *ucontext = (ucontext_t *)uap;
	ucontext->uc_mcontext.fpregs->swd = 0;
	ucontext->uc_mcontext.fpregs->mxcsr &= 0xffffffc0;
}

#define UAP_STACK_POINTER(ucontext) (((ucontext_t *)ucontext)->uc_mcontext.gregs[15])
#define UAP_PROGRAM_COUNTER(ucontext) (((ucontext_t *)ucontext)->uc_mcontext.gregs[16])
#define UAP_SET_TOC_POINTER(uap, ptr) (void)0

#define CODE_TO_FUNCTION_POINTER(code) (void)0
#define CODE_TO_FUNCTION_POINTER_CALLBACK(vm, code) (void)0
#define FUNCTION_CODE_POINTER(ptr) ptr
#define FUNCTION_TOC_POINTER(ptr) ptr

#define UAP_STACK_POINTER_TYPE greg_t

/* Must match the leaf-stack-frame-size, signal-handler-stack-frame-size,
and stack-frame-size constants in basis/cpu/x86/64/unix/bootstrap.factor */
static const unsigned LEAF_FRAME_SIZE = 16;
static const unsigned SIGNAL_HANDLER_STACK_FRAME_SIZE = 160;
static const unsigned JIT_FRAME_SIZE = 32;

}


text: export const USER_INPUT = 'USER_INPUT';


text:
package com.navercorp.pinpoint.profiler.plugin.xml.transformer;

import com.navercorp.pinpoint.bootstrap.instrument.MethodFilter;

/**
 * @author Jongho Moon
 *
 */
public interface BaseClassFileTransformerBuilder {

    public void injectGetter(String getterTypeName, String fieldName);

    public void injectField(String accessorTypeName);

    public void injectField(String accessorTypeName, String initialValueType);

    public InterceptorBuilder injectInterceptor(String className, Object... constructorArgs);

    public void weave(String aspectClassName);

    public MethodTransformerBuilder editMethods(MethodFilter... filter);

    public MethodTransformerBuilder editMethod(String name, String... parameterTypeNames);

    public ConstructorTransformerBuilder editConstructor(String... parameterTypeNames);

    public void overrideMethodToDelegate(String name, String... paramTypes);

}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

/*=============================================================================
	Linker.cpp: Unreal object linker.
=============================================================================*/

#include "CoreUObjectPrivate.h"
#include "SecureHash.h"
#include "MessageLog.h"
#include "UObjectToken.h"
#include "LinkerManager.h"
#include "UObject/UObjectThreadContext.h"

DEFINE_LOG_CATEGORY(LogLinker);

#define LOCTEXT_NAMESPACE "Linker"

/*-----------------------------------------------------------------------------
	Helper functions.
-----------------------------------------------------------------------------*/
namespace Linker
{
	FORCEINLINE bool IsCorePackage(const FName& PackageName)
	{
		return PackageName == NAME_Core || PackageName == GLongCorePackageName;
	}
}

/**
 * Type hash implementation.
 *
 * @param	Ref		Reference to hash
 * @return	hash value
 */
uint32 GetTypeHash( const FDependencyRef& Ref  )
{
	return PointerHash(Ref.Linker) ^ Ref.ExportIndex;
}

/*----------------------------------------------------------------------------
	FCompressedChunk.
----------------------------------------------------------------------------*/

FCompressedChunk::FCompressedChunk()
:	UncompressedOffset(0)
,	UncompressedSize(0)
,	CompressedOffset(0)
,	CompressedSize(0)
{}

/** I/O function */
FArchive& operator<<(FArchive& Ar,FCompressedChunk& Chunk)
{
	Ar << Chunk.UncompressedOffset;
	Ar << Chunk.UncompressedSize;
	Ar << Chunk.CompressedOffset;
	Ar << Chunk.CompressedSize;
	return Ar;
}

/*----------------------------------------------------------------------------
	Items stored in Unreal files.
----------------------------------------------------------------------------*/

FGenerationInfo::FGenerationInfo(int32 InExportCount, int32 InNameCount)
: ExportCount(InExportCount), NameCount(InNameCount)
{}

/** I/O function
 * we use a function instead of operator<< so we can pass in the package file summary for version tests, since archive version hasn't been set yet
 */
void FGenerationInfo::Serialize(FArchive& Ar, const struct FPackageFileSummary& Summary)
{
	Ar << ExportCount << NameCount;
}

FName FLinkerTables::GetExportClassName( int32 i )
{
	if (ExportMap.IsValidIndex(i))
	{
		FObjectExport& Export = ExportMap[i];
		if( !Export.ClassIndex.IsNull() )
		{
			return ImpExp(Export.ClassIndex).ObjectName;
		}
	}
	return NAME_Class;
}

/*----------------------------------------------------------------------------
	FLinker.
----------------------------------------------------------------------------*/
FLinker::FLinker(ELinkerType::Type InType, UPackage* InRoot, const TCHAR* InFilename)
: LinkerType(InType)
, LinkerRoot( InRoot )
, Filename( InFilename )
, FilterClientButNotServer(false)
, FilterServerButNotClient(false)
, ScriptSHA(nullptr)
{
	check(LinkerRoot);
	check(InFilename);

	if( !GIsClient && GIsServer)
	{
		FilterClientButNotServer = true;
	}
	if( GIsClient && !GIsServer)
	{
		FilterServerButNotClient = true;
	}
}

void FLinker::Serialize( FArchive& Ar )
{
	if( Ar.IsCountingMemory() )
	{
		// Can't use CountBytes as ExportMap is array of structs of arrays.
		Ar << ImportMap;
		Ar << ExportMap;
		Ar << DependsMap;

		if (Ar.IsSaving() || Ar.UE4Ver() >= VER_UE4_ADD_STRING_ASSET_REFERENCES_MAP)
		{
			Ar << StringAssetReferencesMap;
		}
	}

	if (Ar.IsSaving() || Ar.UE4Ver() >= VER_UE4_SERIALIZE_TEXT_IN_PACKAGES)
	{
		Ar << GatherableTextDataMap;
	}

	// Prevent garbage collecting of linker's names and package.
	Ar << NameMap << LinkerRoot;
	{
		for (auto& E : ExportMap)
		{
			Ar << E.ObjectName;
		}
	}
	{
		for (auto& I : ImportMap)
		{
			UObject* LegacyLinkerObject = nullptr;
			Ar << LegacyLinkerObject;
			Ar << I.ClassPackage << I.ClassName;
		}
	}

}

void FLinker::AddReferencedObjects(FReferenceCollector& Collector)
{
#if WITH_EDITOR
	if (GIsEditor)
	{
		Collector.AddReferencedObject(*(UObject**)&LinkerRoot);
	}
#endif
}

// FLinker interface.
/**
 * Return the path name of the UObject represented by the specified import.
 * (can be used with StaticFindObject)
 *
 * @param	ImportIndex	index into the ImportMap for the resource to get the name for
 *
 * @return	the path name of the UObject represented by the resource at ImportIndex
 */
FString FLinker::GetImportPathName(int32 ImportIndex)
{
	FString Result;
	for (FPackageIndex LinkerIndex = FPackageIndex::FromImport(ImportIndex); !LinkerIndex.IsNull();)
	{
		FObjectResource Resource = ImpExp(LinkerIndex);
		bool bSubobjectDelimiter=false;

		if (Result.Len() > 0 && GetClassName(LinkerIndex) != NAME_Package
			&& (Resource.OuterIndex.IsNull() || GetClassName(Resource.OuterIndex) == NAME_Package) )
		{
			bSubobjectDelimiter = true;
		}

		// don't append a dot in the first iteration
		if ( Result.Len() > 0 )
		{
			if ( bSubobjectDelimiter )
			{
				Result = FString(SUBOBJECT_DELIMITER) + Result;
			}
			else
			{
				Result = FString(TEXT(".")) + Result;
			}
		}

		Result = Resource.ObjectName.ToString() + Result;
		LinkerIndex = Resource.OuterIndex;
	}
	return Result;
}

/**
 * Return the path name of the UObject represented by the specified export.
 * (can be used with StaticFindObject)
 *
 * @param	ExportIndex				index into the ExportMap for the resource to get the name for
 * @param	FakeRoot				Optional name to replace use as the root package of this object instead of the linker
 * @param	bResolveForcedExports	if true, the package name part of the return value will be the export's original package,
 *									not the name of the package it's currently contained within.
 *
 * @return	the path name of the UObject represented by the resource at ExportIndex
 */
FString FLinker::GetExportPathName(int32 ExportIndex, const TCHAR* FakeRoot,bool bResolveForcedExports/*=false*/)
{
	FString Result;

	bool bForcedExport = false;
	for ( FPackageIndex LinkerIndex = FPackageIndex::FromExport(ExportIndex); !LinkerIndex.IsNull(); LinkerIndex = Exp(LinkerIndex).OuterIndex )
	{
		const FObjectExport Export = Exp(LinkerIndex);

		// don't append a dot in the first iteration
		if ( Result.Len() > 0 )
		{
			// if this export is not a UPackage but this export's Outer is a UPackage, we need to use subobject notation
			if ((Export.OuterIndex.IsNull() || GetExportClassName(Export.OuterIndex) == NAME_Package)
			  && GetExportClassName(LinkerIndex) != NAME_Package)
			{
				Result = FString(SUBOBJECT_DELIMITER) + Result;
			}
			else
			{
				Result = FString(TEXT(".")) + Result;
			}
		}
		Result = Export.ObjectName.ToString() + Result;
		bForcedExport = bForcedExport || Export.bForcedExport;
	}

	if ( bForcedExport && FakeRoot == NULL && bResolveForcedExports )
	{
		// Result already contains the correct path name for this export
		return Result;
	}

	return (FakeRoot ? FakeRoot : LinkerRoot->GetPathName()) + TEXT(".") + Result;
}

FString FLinker::GetImportFullName(int32 ImportIndex)
{
	return ImportMap[ImportIndex].ClassName.ToString() + TEXT(" ") + GetImportPathName(ImportIndex);
}

FString FLinker::GetExportFullName(int32 ExportIndex, const TCHAR* FakeRoot,bool bResolveForcedExports/*=false*/)
{
	FPackageIndex ClassIndex = ExportMap[ExportIndex].ClassIndex;
	FName ClassName = ClassIndex.IsNull() ? FName(NAME_Class) : ImpExp(ClassIndex).ObjectName;

	return ClassName.ToString() + TEXT(" ") + GetExportPathName(ExportIndex, FakeRoot, bResolveForcedExports);
}

/**
 * Tell this linker to start SHA calculations
 */
void FLinker::StartScriptSHAGeneration()
{
	// create it if needed
	if (ScriptSHA == NULL)
	{
		ScriptSHA = new FSHA1;
	}

	// make sure it's reset
	ScriptSHA->Reset();
}

/**
 * If generating a script SHA key, update the key with this script code
 *
 * @param ScriptCode Code to SHAify
 */
void FLinker::UpdateScriptSHAKey(const TArray<uint8>& ScriptCode)
{
	// if we are doing SHA, update it
	if (ScriptSHA && ScriptCode.Num())
	{
		ScriptSHA->Update((uint8*)ScriptCode.GetData(), ScriptCode.Num());
	}
}

/**
 * After generating the SHA key for all of the
 *
 * @param OutKey Storage for the key bytes (20 bytes)
 */
void FLinker::GetScriptSHAKey(uint8* OutKey)
{
	check(ScriptSHA);

	// finish up the calculation, and return it
	ScriptSHA->Final();
	ScriptSHA->GetHash(OutKey);
}

FLinker::~FLinker()
{
	// free any SHA memory
	delete ScriptSHA;
}

/*-----------------------------------------------------------------------------
	Global functions
-----------------------------------------------------------------------------*/

void ResetLoaders(UObject* InPkg)
{
	// Make sure we're not in the middle of loading something in the background.
	FlushAsyncLoading();
	FLinkerManager::Get().ResetLoaders(InPkg);
}

void DeleteLoaders()
{
	FLinkerManager::Get().DeleteLinkers();
}

void DeleteLoader(FLinkerLoad* Loader)
{
	FLinkerManager::Get().RemoveLinker(Loader);
}

/**
 * Dissociates all linker import and forced export object references. This currently needs to
 * happen as the referred objects might be destroyed at any time.
 */
void DissociateImportsAndForcedExports()
{
	FLinkerManager::Get().DissociateImportsAndForcedExports();
}

static void LogGetPackageLinkerError(FArchiveUObject* LinkerArchive, const TCHAR* InFilename, const FText& InFullErrorMessage, const FText& InSummaryErrorMessage, UObject* InOuter, uint32 LoadFlags)
{
	static FName NAME_LoadErrors("LoadErrors");
	struct Local
	{
		/** Helper function to output more detailed error info if available */
		static void OutputErrorDetail(FArchiveUObject* InLinkerArchive, const FName& LogName)
		{
			FUObjectThreadContext& ThreadContext = FUObjectThreadContext::Get();
			if (ThreadContext.SerializedObject && ThreadContext.SerializedImportLinker)
			{
				FMessageLog LoadErrors(LogName);

				TSharedRef<FTokenizedMessage> Message = LoadErrors.Info();
				Message->AddToken(FTextToken::Create(LOCTEXT("FailedLoad_Message", "Failed to load")));
				Message->AddToken(FAssetNameToken::Create(ThreadContext.SerializedImportLinker->GetImportPathName(ThreadContext.SerializedImportIndex)));
				Message->AddToken(FTextToken::Create(LOCTEXT("FailedLoad_Referenced", "Referenced by")));
				Message->AddToken(FUObjectToken::Create(ThreadContext.SerializedObject));
				auto SerializedProperty = InLinkerArchive ? InLinkerArchive->GetSerializedProperty() : nullptr;
				if (SerializedProperty != nullptr)
				{
					FString PropertyPathName = SerializedProperty->GetPathName();
					Message->AddToken(FTextToken::Create(LOCTEXT("FailedLoad_Property", "Property")));
					Message->AddToken(FAssetNameToken::Create(PropertyPathName, FText::FromString( PropertyPathName) ) );
				}
			}
		}
	};

	FMessageLog LoadErrors(NAME_LoadErrors);

	// Display log error regardless LoadFlag settings
	SET_WARN_COLOR(COLOR_RED);
	if (LoadFlags & LOAD_NoWarn)
	{
		UE_LOG(LogLinker, Log, TEXT("%s"), *InFullErrorMessage.ToString());
	}
	else
	{
		UE_LOG(LogLinker, Warning, TEXT("%s"), *InFullErrorMessage.ToString());
	}
	CLEAR_WARN_COLOR();
	if( GIsEditor && !IsRunningCommandlet() )
	{
		// if we don't want to be warned, skip the load warning
		if (!(LoadFlags & LOAD_NoWarn))
		{
			// we only want to output errors that content creators will be able to make sense of,
			// so any errors we cant get links out of we will just let be output to the output log (above)
			// rather than clog up the message log

			if(InFilename != NULL && InOuter != NULL)
			{
				// Output the summary error & the filename link. This might be something like "..\Content\Foo.upk Out of Memory"
				TSharedRef<FTokenizedMessage> Message = LoadErrors.Error();
				Message->AddToken(FAssetNameToken::Create(FPackageName::FilenameToLongPackageName(InFilename)));
				Message->AddToken(FTextToken::Create(FText::FromString(TEXT(":"))));
				Message->AddToken(FTextToken::Create(InSummaryErrorMessage));
				Message->AddToken(FAssetNameToken::Create(FPackageName::FilenameToLongPackageName(InOuter->GetPathName())));
			}

			Local::OutputErrorDetail(LinkerArchive, NAME_LoadErrors);
		}
	}
	else
	{
		if (!(LoadFlags & LOAD_NoWarn))
		{
			Local::OutputErrorDetail(LinkerArchive, NAME_LoadErrors);
		}

		FFormatNamedArguments Arguments;
		Arguments.Add(TEXT("FileName"), FText::FromString(InFilename ? InFilename : InOuter ? *InOuter->GetName() : TEXT("NULL")));
		Arguments.Add(TEXT("ErrorMessage"), InFullErrorMessage);
		const FText Error = FText::Format(LOCTEXT("FailedLoad", "Failed to load '{FileName}': {ErrorMessage}"), Arguments);

		// @see ResavePackagesCommandlet
		if( FParse::Param(FCommandLine::Get(),TEXT("SavePackagesThatHaveFailedLoads")) == true )
		{
			LoadErrors.Warning(Error);
		}
		else
		{
			// Gracefully handle missing packages
			SafeLoadError(InOuter, LoadFlags, *Error.ToString());
		}
	}
}

//
// Find or create the linker for a package.
//
FLinkerLoad* GetPackageLinker
(
	UPackage*		InOuter,
	const TCHAR*	InLongPackageName,
	uint32			LoadFlags,
	UPackageMap*	Sandbox,
	FGuid*			CompatibleGuid
)
{
	// See if there is already a linker for this package.
	auto Result = FLinkerLoad::FindExistingLinkerForPackage(InOuter);

	// Try to load the linker.
	// See if the linker is already loaded.
	if (Result)
	{
		return Result;
	}

	FString NewFilename;
	if( !InLongPackageName )
	{
		// Resolve filename from package name.
		if( !InOuter )
		{
			// try to recover from this instead of throwing, it seems recoverable just by doing this
			FText ErrorText(LOCTEXT("PackageResolveFailed", "Can't resolve asset name"));
			LogGetPackageLinkerError(Result, InLongPackageName, ErrorText, ErrorText, InOuter, LoadFlags);
			return nullptr;
		}

		if( !FPackageName::DoesPackageExist(InOuter->GetName(), CompatibleGuid, &NewFilename) )
		{
			// In memory-only packages have no linker and this is ok.
			if (!(LoadFlags & LOAD_AllowDll) && !(InOuter->PackageFlags & PKG_InMemoryOnly))
			{
				FUObjectThreadContext& ThreadContext = FUObjectThreadContext::Get();
				FFormatNamedArguments Arguments;
				Arguments.Add(TEXT("AssetName"), FText::FromString(InOuter->GetName()));
				Arguments.Add(TEXT("PackageName"), FText::FromString(ThreadContext.SerializedPackageLinker ? *(ThreadContext.SerializedPackageLinker->Filename) : TEXT("NULL")));
				LogGetPackageLinkerError(Result, ThreadContext.SerializedPackageLinker ? *ThreadContext.SerializedPackageLinker->Filename : nullptr,
											FText::Format(LOCTEXT("PackageNotFound", "Can't find file for asset '{AssetName}' while loading {PackageName}."), Arguments),
											LOCTEXT("PackageNotFoundShort", "Can't find file for asset."),
											InOuter,
											LoadFlags);
			}

			return nullptr;
		}
	}
	else
	{
		FString PackageName(InLongPackageName);
		if (!FPackageName::TryConvertFilenameToLongPackageName(InLongPackageName, PackageName))
		{
			// try to recover from this instead of throwing, it seems recoverable just by doing this
			FText ErrorText(LOCTEXT("PackageResolveFailed", "Can't resolve asset name"));
			LogGetPackageLinkerError(Result, InLongPackageName, ErrorText, ErrorText, InOuter, LoadFlags);
			return nullptr;
		}

		UPackage* ExistingPackage = FindObject<UPackage>(nullptr, *PackageName);
		if (ExistingPackage)
		{
			if (!ExistingPackage->GetOuter() && (ExistingPackage->PackageFlags & PKG_InMemoryOnly))
			{
				// This is a memory-only in package and so it has no linker and this is ok.
				return nullptr;
			}
		}

		// Verify that the file exists.
		if( !FPackageName::DoesPackageExist( PackageName, CompatibleGuid, &NewFilename ) )
		{
			FFormatNamedArguments Arguments;
			Arguments.Add(TEXT("Filename"), FText::FromString(InLongPackageName));

			// try to recover from this instead of throwing, it seems recoverable just by doing this
			LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("FileNotFound", "Can't find file '{Filename}'"), Arguments), LOCTEXT("FileNotFoundShort", "Can't find file"), InOuter, LoadFlags);
			return nullptr;
		}

		// Create the package with the provided long package name.
		UPackage* FilenamePkg = (ExistingPackage ? ExistingPackage : CreatePackage(nullptr, *PackageName));
		if (FilenamePkg != ExistingPackage && (LoadFlags & LOAD_PackageForPIE))
		{
			FilenamePkg->PackageFlags |= PKG_PlayInEditor;
		}

		// If no package specified, use package from file.
		if (!InOuter)
		{
			if( !FilenamePkg )
			{
				FFormatNamedArguments Arguments;
				Arguments.Add(TEXT("Filename"), FText::FromString(InLongPackageName));
				LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("FilenameToPackage", "Can't convert filename '{Filename}' to asset name"), Arguments), LOCTEXT("FilenameToPackageShort", "Can't convert filename to asset name"), InOuter, LoadFlags);
				return nullptr;
			}
			InOuter = FilenamePkg;
			Result = FLinkerLoad::FindExistingLinkerForPackage(InOuter);
		}
		else if (InOuter != FilenamePkg) //!!should be tested and validated in new UnrealEd
		{
			// Loading a new file into an existing package, so reset the loader.
			//UE_LOG(LogLinker, Log,  TEXT("New File, Existing Package (%s, %s)"), *InOuter->GetFullName(), *FilenamePkg->GetFullName() );
			ResetLoaders( InOuter );
		}
	}

#if 0
	// Make sure the package is accessible in the sandbox.
	if( Sandbox && !Sandbox->SupportsPackage(InOuter) )
	{
		FFormatNamedArguments Arguments;
		Arguments.Add(TEXT("AssetName"), FText::FromString(InOuter->GetName()));

		LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("Sandbox", "Asset '{AssetName}' is not accessible in this sandbox"), Arguments), LOCTEXT("SandboxShort", "Asset is not accessible in this sandbox"), InOuter, LoadFlags);
		return nullptr;
	}
#endif

	// Create new linker.
	if( !Result )
	{
		check(IsLoading());

		// we will already have found the filename above
		check(NewFilename.Len() > 0);

		Result = FLinkerLoad::CreateLinker( InOuter, *NewFilename, LoadFlags );
	}

	// Verify compatibility.
	if (Result && CompatibleGuid && Result->Summary.Guid != *CompatibleGuid)
	{
		FFormatNamedArguments Arguments;
		Arguments.Add(TEXT("AssetName"), FText::FromString(InOuter->GetName()));

		// This should never fire, because FindPackageFile should never return an incompatible file
		LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("PackageVersion", "Asset '{AssetName}' version mismatch"), Arguments), LOCTEXT("PackageVersionShort", "Asset version mismatch"), InOuter, LoadFlags);
		return nullptr;
	}

	return Result;
}

/**
 *
 * Ensure thumbnails are loaded and then reset the loader in preparation for a package save
 *
 * @param	InOuter			The outer for the package we are saving
 * @param	Filename		The filename we are saving too
 */
void ResetLoadersForSave(UObject* InOuter, const TCHAR *Filename)
{
	UPackage* Package = dynamic_cast<UPackage*>(InOuter);
	// If we have a loader for the package, unload it to prevent conflicts if we are resaving to the same filename
	FLinkerLoad* Loader = FLinkerLoad::FindExistingLinkerForPackage(Package);
	// This is the loader corresponding to the package we're saving.
	if( Loader )
	{
		// Before we save the package, make sure that we load up any thumbnails that aren't already
		// in memory so that they won't be wiped out during this save
		Loader->SerializeThumbnails();

		// Compare absolute filenames to see whether we're trying to save over an existing file.
		if( FPaths::ConvertRelativePathToFull(Filename) == FPaths::ConvertRelativePathToFull( Loader->Filename ) )
		{
			// Detach all exports from the linker and dissociate the linker.
			ResetLoaders( InOuter );
		}
	}
}

#undef LOCTEXT_NAMESPACE


text:
	type = "panel",
	name = "Window Title",
	displayName = "My Longer Window Title",	--(optional) (can be useful for long addon names or if you want to colorize it)
	author = "Seerah",	--(optional)
	version = "2.0",	--(optional)
	slashCommand = "/myaddon",	--(optional) will register a keybind to open to this panel (don't forget to include the slash!)
	registerForRefresh = true,	--boolean (optional) (will refresh all options controls when a setting is changed and when the panel is shown)
	registerForDefaults = true,	--boolean (optional) (will set all options controls back to default values)
	resetFunc = function() print("defaults reset") end,	--(optional) custom function to run after settings are reset to defaults
}	]]

local widgetVersion = 8
local LAM = LibStub("LibAddonMenu-2.0")
if not LAM:RegisterWidget("panel", widgetVersion) then return end

local wm = WINDOW_MANAGER
local cm = CALLBACK_MANAGER

local function RefreshPanel(control)
	local panel = control.panel or control	--callback can be fired by a single control or by the panel showing
	local panelControls = panel.controlsToRefresh

	for i = 1, #panelControls do
		local updateControl = panelControls[i]
		if  updateControl ~= control then
			if updateControl.UpdateValue then
				updateControl:UpdateValue()
			end
			if updateControl.UpdateDisabled then
				updateControl:UpdateDisabled()
			end
		end
	end
end

local function ForceDefaults(panel)
	local panelControls = panel.controlsToRefresh

	for i = 1, #panelControls do
		local updateControl = panelControls[i]
		if updateControl.UpdateValue and updateControl.data.default ~= nil then
			updateControl:UpdateValue(true)
		end
	end

	if panel.data.resetFunc then
		panel.data.resetFunc()
	end

	cm:FireCallbacks("LAM-RefreshPanel", panel)
end
ESO_Dialogs["LAM_DEFAULTS"] = {
	title = {
		text = SI_OPTIONS_RESET_TITLE,
	},
	mainText = {
		text = SI_OPTIONS_RESET_PROMPT,
		align = TEXT_ALIGN_CENTER,
	},
	buttons = {
		[1] = {
			text = SI_OPTIONS_RESET,
			callback = function(dialog) ForceDefaults(dialog.data[1]) end,
		},
		[2] = {
			text = SI_DIALOG_CANCEL,
		},
	},
}

local callbackRegistered = false
LAMCreateControl.scrollCount = LAMCreateControl.scrollCount or 1
function LAMCreateControl.panel(parent, panelData, controlName)
	local control = wm:CreateTopLevelWindow(controlName)
	control:SetParent(parent)

	control.bg = wm:CreateControl(nil, control, CT_BACKDROP)
	local bg = control.bg
	bg:SetAnchorFill()
	bg:SetEdgeTexture("EsoUI\\Art\\miscellaneous\\borderedinsettransparent_edgefile.dds", 128, 16)
	bg:SetCenterColor(0, 0, 0, 0)

	control.label = wm:CreateControlFromVirtual(nil, control, "ZO_Options_SectionTitleLabel")
	local label = control.label
	label:SetAnchor(TOPLEFT, control, TOPLEFT, 10, 10)
	label:SetText(panelData.displayName and panelData.displayName or panelData.name)

	if panelData.author or panelData.version then
		control.info = wm:CreateControl(nil, control, CT_LABEL)
		local info = control.info
		info:SetFont("$(CHAT_FONT)|14|soft-shadow-thin")
		info:SetColor(ZO_HIGHLIGHT_TEXT:UnpackRGBA())
		info:SetHeight(13)
		info:SetAnchor(TOPRIGHT, control, BOTTOMRIGHT, -5, 2)
		if panelData.author and panelData.version then
			--info:SetText("Version: "..panelData.version.."  -  "..GetString(SI_ADDON_MANAGER_AUTHOR)..": "..panelData.author)
			info:SetText(string.format("Version: %s  -  %s: %s", panelData.version, GetString(SI_ADDON_MANAGER_AUTHOR), panelData.author))
		elseif panelData.author then
			info:SetText(string.format("%s: %s", GetString(SI_ADDON_MANAGER_AUTHOR), panelData.author))
		else
			info:SetText("Version: "..panelData.version)
		end
	end

	control.container = wm:CreateControlFromVirtual("LAMAddonPanelContainer"..LAMCreateControl.scrollCount, control, "ZO_ScrollContainer")
	LAMCreateControl.scrollCount = LAMCreateControl.scrollCount + 1
	local container = control.container
	container:SetAnchor(TOPLEFT, label, BOTTOMLEFT, 0, 20)
	container:SetAnchor(BOTTOMRIGHT, control, BOTTOMRIGHT, -3, -3)
	control.scroll = GetControl(control.container, "ScrollChild")
	control.scroll:SetResizeToFitPadding(0, 20)

	if panelData.registerForDefaults then
		control.defaultButton = wm:CreateControlFromVirtual(nil, control, "ZO_DefaultTextButton")
		local defaultButton = control.defaultButton
		defaultButton:SetFont("ZoFontDialogKeybindDescription")
		defaultButton:SetHorizontalAlignment(TEXT_ALIGN_LEFT)
		--defaultButton:SetText("Reset To Defaults")
		defaultButton:SetText(GetString(SI_OPTIONS_RESET_TITLE))
		defaultButton:SetDimensions(200, 30)
		defaultButton:SetAnchor(TOPLEFT, control, BOTTOMLEFT, 0, 2)
		defaultButton:SetHandler("OnClicked", function()
				ZO_Dialogs_ShowDialog("LAM_DEFAULTS", {control})
			end)
	end

	if panelData.registerForRefresh and not callbackRegistered then	--don't want to register our callback more than once
		cm:RegisterCallback("LAM-RefreshPanel", RefreshPanel)
		callbackRegistered = true
	end

	control.data = panelData
	control.controlsToRefresh = {}

	return control
end


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

namespace Nextras\Orm\Repository;

use Nextras\Orm\Entity\IEntity;
use Nextras\Orm\Entity\Reflection\PropertyMetadata;
use Nextras\Orm\Exception\InvalidStateException;
use Nextras\Orm\Model\IModel;
use Nextras\Orm\Relationships\IRelationshipCollection;
use Nextras\Orm\Relationships\IRelationshipContainer;
use function assert;

class PersistenceHelper
{
	/** @var array<int, IRelationshipCollection<IEntity>|IRelationshipContainer<IEntity>> */
	protected static $inputQueue = [];

	/** @var array<string, IEntity|IRelationshipCollection<IEntity>|IRelationshipContainer<IEntity>|true> */
	protected static $outputQueue = [];

	/**
	 * @see https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search
	 * @return array<string, IEntity|IRelationshipCollection<IEntity>|IRelationshipContainer<IEntity>|true>
	 */
	public static function getCascadeQueue(IEntity $entity, IModel $model, bool $withCascade): array
	{
		try {
			self::visitEntity($entity, $model, $withCascade);

			for ($i = 0; $i < count(self::$inputQueue); $i++) {
				$value = self::$inputQueue[$i];
				self::visitRelationship($value, $model);
			}

			return self::$outputQueue;
		} finally {
			self::$inputQueue = [];
			self::$outputQueue = [];
		}
	}

	protected static function visitEntity(IEntity $entity, IModel $model, bool $withCascade = true): void
	{
		$entityHash = spl_object_hash($entity);
		if (isset(self::$outputQueue[$entityHash])) {
			if (self::$outputQueue[$entityHash] === true) {
				$cycle = [];
				$bt = debug_backtrace();
				foreach ($bt as $item) {
					if ($item['function'] === 'getCascadeQueue') {
						break;
					} elseif ($item['function'] === 'addRelationshipToQueue' && isset($item['args'])) {
						$cycle[] = get_class($item['args'][0]) . '::$' . $item['args'][1]->name;
					}
				}
				$cycle = array_reverse($cycle);
				throw new InvalidStateException('Persist cycle detected in ' . implode(' - ', $cycle) . '. Use manual two-phase persist.');
			}
			return;
		}

		$repository = $model->getRepositoryForEntity($entity);
		$repository->attach($entity);
		$repository->onBeforePersist($entity);

		if ($withCascade) {
			self::$outputQueue[$entityHash] = true;
			foreach ($entity->getMetadata()->getProperties() as $propertyMeta) {
				if ($propertyMeta->relationship !== null && $propertyMeta->relationship->cascade['persist']) {
					self::addRelationshipToQueue($entity, $propertyMeta, $model);
				}
			}
			unset(self::$outputQueue[$entityHash]); // reenqueue
		}

		self::$outputQueue[$entityHash] = $entity;
	}

	/**
	 * @param IRelationshipCollection<IEntity>|IRelationshipContainer<IEntity> $rel
	 */
	protected static function visitRelationship($rel, IModel $model): void
	{
		foreach ($rel->getEntitiesForPersistence() as $entity) {
			self::visitEntity($entity, $model);
		}

		self::$outputQueue[spl_object_hash($rel)] = $rel;
	}

	protected static function addRelationshipToQueue(
		IEntity $entity,
		PropertyMetadata $propertyMeta,
		IModel $model
	): void
	{
		$isPersisted = $entity->isPersisted();
		$relationship = $entity->getRawProperty($propertyMeta->name);
		if ($relationship === null || (!($relationship instanceof IRelationshipCollection || $relationship instanceof IRelationshipContainer) && $isPersisted)) {
			// 1. relationship is not initialized at all
			// 2. relationship has a scalar value and the entity is persisted -> no change
			return;
		}

		assert($relationship instanceof IRelationshipCollection || $relationship instanceof IRelationshipContainer);
		if (!$relationship->isLoaded() && $isPersisted) {
			return;
		}

		if ($relationship instanceof IRelationshipContainer) {
			$immediateEntity = $relationship->getImmediateEntityForPersistence();
			if ($immediateEntity !== null) {
				self::visitEntity($immediateEntity, $model);
			}
		}

		self::$inputQueue[] = $relationship;
	}
}


text:
<!DOCTYPE html>

  <title>Join Us</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="Navjot Singh">
  <link href="<?php echo base_url(); ?>css/bootstrap-responsive.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>css/bootstrap.css" rel="stylesheet">

  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo base_url(); ?>ico/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url(); ?>ico/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo base_url(); ?>ico/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="<?php echo base_url(); ?>ico/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="<?php echo base_url(); ?>ico/favicon.png">

              <a class="brand" href="<?php echo base_url(); ?>/index.php/home_c" style="color:white; margin-left:0.1%;">IT CLUB

<a href="<?php echo base_url(); ?>/index.php/home_c">Home

<a href="<?php echo base_url(); ?>/index.php/aboutclub_c">About Club

<a href="<?php echo base_url(); ?>/index.php/activities_c">Activities

Join Us

             please fill out the form below to become a registered member

             <form align="center" name=registration method=POST onsubmit="return validateForm()" action="<?php echo base_url();?>/index.php/joinus_c/insert" >

                  *Name:	 <input type=text name=name value="" id="name">

                  *password:	  <input type=password name="password">

                  *D.O.B:

                  <select class="span3" name=s1 size="1" id="s1">
                   <option value=1>1 </option>
                   <option value=2>2 </option>
                   <option value=3>3 </option>
                   <option value=4>4 </option>
                   <option value=5>5 </option>
                   <option value=6>6 </option>
                   <option value=7>7</option>
                   <option value=8>8 </option>
                   <option value=9>9 </option>
                   <option value=10>10 </option>
                   <option value=11>11 </option>
                   <option value=12>12 </option>
                   <option value=13>13 </option>
                   <option value=14>14 </option>
                   <option value=15>15 </option>
                 </select>:Day

                 <select class="span3" name=s2 size=1 id="s2">
                  <option value=01>01</option>
                  <option value=02>02</option>
                  <option value=03>03</option>
                  <option value=04>04</option>
                  <option value=05>05</option>
                  <option value=06>06</option>
                  <option value=07>07</option>
                  <option value=08>08</option>
                  <option value=09>09</option>
                  <option value=10>10</option>
                  <option value=11>11</option>
                  <option value=12>12</option>
                </select>:Month

                <select class="span3" name=s3 size=1 id="s3">
                 <option value=1996>1996 </option>
                 <option value=1997>1997 </option>
                 <option value=1998>1998 </option>
                 <option value=1999>1999 </option>
                 <option value=2000>2000 </option>
               </select>:Year

               *Sex:

                 <input type="radio" name="optionsRadios" id="optionsRadios1" value="male">
                 Male

                <input type="radio" name="optionsRadios" id="optionsRadios2" value="female">
                Female

             skills:

             <input type="checkbox" name="skills[]" value="c">C

               <input type="checkbox" name="skills[]" value="c++">C++

                 <input type="checkbox" name="skills[]" value="java">Java

                   <input type="checkbox" name="skills[]" value="mysql">Mysql

                 *E-mail:	 <input type=email name=email ng-model="text">

               *Address:	 <textarea rows=3 cols=30 name=address id=adrs1></textarea>

            <button type="submit" class="btn btn-primary">Save changes</button>
            <button type="reset" class="btn">Reset</button>

      </form>


text:
title: Why I Upgraded to Mac OS X Instead of Windows 8 (Part 1)
category: tech
tags: [apple, macbook, os-x, macbook-pro, windows, microsoft]
mtime: 16:25
---

As if I needed another article on why I'm so excited to be on a Mac now, here are my thoughts on why Microsoft
screwed up so badly with Windows and how I moved on to buy a new Macbook running OS X.

##Windows 7

Up until very recently, I have been a strong Windows and PC user. I built my own gaming desktop back in high school
and of course that had to be a Windows system. My first laptop for college was a nice powerful Asus running Windows,
which I still upgrade and use every day, and the computers I've used at work have all been PCs running Windows. The
biggest thing that has kept me on board? The Windows 7 operating system.

Windows 7 (source)

Windows 7 was released in 2009 as the successor of the infamous Windows Vista. It was a great release with
improvements in performance and new features, such as the oh-so-useful ability to split your screen with multiple
application windows for multitasking. Most people agreed that Windows had done well to fix everything that made
Windows Vista a big sore in the OS world. So I enjoyed several years of peace and happiness on Windows 7 with a desktop
interface that was sensible and productive, until the Shangri-La of Windows 7 was disturbed by the news of Microsoft's
new OS...Windows 8.

##How Windows Screwed Up Desktop

My absorption of news of Windows 8 goes as such:

1. Microsoft announces Windows 8 with a whole new interface
2. Outrage. Microsoft and Windows are dead to me

Why the sudden and strong reaction to Windows 8? Microsoft decided, only 3 years after Windows 7 had been released,
that the rise of mobile meant that everything should be immediately changed to be mobile-oriented...including the
operating systems on desktops.

The image of Windows 8 shown in
A history of Windows

Microsoft calls the new layout "Metro", which makes the interface tile-based, with each
tile representing an individual application. Now this layout no doubt makes sense on mobile devices, but on a desktop
environment? I don't think so. The whole "Metro" conversion wouldn't have been such a terrible thing if Microsoft
made it optional on the desktop OS. But instead, Microsoft completely threw out the desktop Start menu that users have
depended on for years and booted up all devices to a screen of tiles. And as an ignorant compromise, they plopped the
 desktop environment on the home screen as another silly tile. So forget about desktop productivity with
  Windows 8, all Microsoft did was create an operating system for a market that they
  [struggle](http://money.cnn.com/2013/07/18/technology/microsoft-earnings/)
  [to achieve](http://www.huffingtonpost.com/2013/07/19/microsoft-surface-rt-900-million_n_3624014.html)
  [market share in](http://www.techradar.com/us/news/phone-and-communications/mobile-phones/windows-phone-users-are-jumping-ship-and-microsoft-needs-to-act-fast-1296086).

As a result of all this, I made a pact with myself to never allow Windows 8 into my computing sphere. Windows 8 had
nothing exclusive to it compared to Windows 7, and after 3 years, Windows 7 was still very much alive as a leading
operating system. So if I were to buy a new computer, I would either wait until Windows 8's successor came along or get
an entirely different operating system.

To be continued...


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: leon
 * Date: 11/20/12
 * Time: 7:15 PM
 * To change this template use File | Settings | File Templates.
 */

namespace BWL\webshopBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="ordering")
 * @ORM\Entity(repositoryClass="BWL\webshopBundle\Repository\OrderingRepository")
 */
class Ordering
{

  /**
   * @ORM\Id
   * @ORM\Column(type="integer")

   */
  protected $id;

  /**
   * @ORM\Id
   * @ORM\ManyToOne(targetEntity="User", inversedBy="orderings")
   * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
   */
  protected $user;

  /**
   * @ORM\Id
   * @ORM\ManyToOne(targetEntity="Item", inversedBy="orderings")
   * @ORM\JoinColumn(name="item_id", referencedColumnName="id", nullable=false)
   */
  protected $item;

  /**
   * @ORM\Column(type="integer")
   */
  protected $count;

  /**
   * @ORM\Column(type="decimal", scale=2)
   */
  protected $price;

  /**
   * @ORM\Column(type="datetime")
   */
  protected $orderDate;

  /**
   * @ORM\Column(type="datetime", nullable=true)
   */
  protected $shipmentDate;

  /**
   * @ORM\ManyToOne(targetEntity="OrderState", inversedBy="orderings")
   * @ORM\JoinColumn(name="state", referencedColumnName="name", nullable=false)
   */
  protected $state;

  function __construct(){
    $this->setOrderDate(new \DateTime("now"));
    $this->setShipmentDate((new \DateTime('now'))->modify('+1 day'));
  }

  public function setCount($count) {
    $this->count = $count;
  }

  public function getCount() {
    return $this->count;
  }

  public function setId($id) {
    $this->id = $id;
  }

  public function getId() {
    return $this->id;
  }

  public function setItem($item) {
    $this->item = $item;
  }

  public function getItem() {
    return $this->item;
  }

  function setOrderDate($orderDate) {
    $this->orderDate = $orderDate;
  }

  public function getOrderDate() {
    return $this->orderDate;
  }

  public function setPrice($price) {
    $this->price = $price;
  }

  public function getPrice() {
    return $this->price;
  }

  public function setShipmentDate($shipmentDate) {
    $this->shipmentDate = $shipmentDate;
  }

  public function getShipmentDate() {
    return $this->shipmentDate;
  }

  public function setState($state) {
    $this->state = $state;
  }

  public function getState() {
    return $this->state;
  }

  public function setUser($user) {
    $this->user = $user;
  }

  public function getUser() {
    return $this->user;
  }

}


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

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>amCharts examples</title>
        <link rel="stylesheet" href="style.css" type="text/css">


text:
package org.jetbrains.kotlin.idea.codeInsight.surroundWith.statement;

import com.intellij.codeInsight.CodeInsightBundle;
import org.jetbrains.annotations.NotNull;

public class KotlinIfElseSurrounder extends KotlinIfSurrounderBase {

    @SuppressWarnings("DialogTitleCapitalization")
    @Override
    public String getTemplateDescription() {
        return CodeInsightBundle.message("surround.with.ifelse.template");
    }

    @NotNull
    @Override
    protected String getCodeTemplate() {
        return "if (a) { \n} else { \n}";
    }

    @Override
    protected boolean isGenerateDefaultInitializers() {
        return false;
    }
}


text:
package com.thuytrinh.transactionviewer.conversion;

import com.thuytrinh.transactionviewer.api.Rate;

import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.Currency;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import rx.Observable;

/**
 * A graph that converts amounts in arbitrary currencies into `GBP` asynchronously.
 */
public class CurrencyGraph {
  public static final NumberFormat GBP_FORMATTER = NumberFormat.getCurrencyInstance(Locale.US);
  private final Map<String, Map<String, BigDecimal>> graph;
  private final ConversionFinder conversionFinder;
  private final RateCache rateCache;

  CurrencyGraph(
      List<Rate> rates,
      ConversionFinder conversionFinder,
      RateCache rateCache) {
    graph = createGraph(rates);
    this.conversionFinder = conversionFinder;
    this.rateCache = rateCache;
  }

  static Map<String, Map<String, BigDecimal>> createGraph(List<Rate> rates) {
    final Map<String, Map<String, BigDecimal>> g = new HashMap<>();
    for (int i = 0, size = rates.size(); i < size; i++) {
      final Rate rate = rates.get(i);
      final String from = rate.from();
      Map<String, BigDecimal> neighbors = g.get(from);
      if (neighbors == null) {
        neighbors = new HashMap<>();
        g.put(from, neighbors);
      }
      neighbors.put(rate.to(), rate.rate());
    }
    return g;
  }

  static ConversionResult asConversionResult(
      String currency,
      BigDecimal originalAmount,
      BigDecimal amountInGbp) {
    final NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.US);
    formatter.setCurrency(Currency.getInstance(currency));
    return ImmutableConversionResult.builder()
        .originalAmountText(formatter.format(originalAmount))
        .amountInGbpText(GBP_FORMATTER.format(amountInGbp))
        .amountInGbp(amountInGbp)
        .build();
  }

  public Observable<ConversionResult> asGbpAsync(String currency, BigDecimal amount) {
    if (ConversionFinder.GBP.equals(currency)) {
      return Observable.fromCallable(() -> asConversionResult(
          currency,
          amount,
          amount
      ));
    }
    return rateCache.getRateAsync(currency, conversionFinder, graph)
        .map(amount::multiply)
        .map(amountInGbp -> asConversionResult(currency, amount, amountInGbp));
  }

  static {
    GBP_FORMATTER.setCurrency(Currency.getInstance(Locale.UK));
  }
}


text:
package network

import (
	"math/rand"
	"net"
)

//simulate network conditions for testing by randomizing send
type ConnMonkey struct {
	BitXConnecter
	LossChance float32
}

func (m *ConnMonkey) Send(p *Packet, addr *net.UDPAddr) {
	if rand.Float32() < m.LossChance {
		log.Printf("Monkey losses a packet\n")
		return
	}
	m.BitXConnecter.Send(p, addr)
}


text:
""" Functions and Classes used to fit an estimate of an unabsorbed
continuum to a QSO spectrum.
"""

# p2.6+ compatibility
from __future__ import division, print_function, unicode_literals
try:
    unicode
except NameError:
    unicode = basestring = str
    raw_input = input

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as mtran

from .stats import Gaussian
from .utilities import between, stats, indexnear
from .convolve import convolve_psf
from .io import loadobj, saveobj
from .interp import AkimaSpline
from .sed import qso_template
from .interactive_plot import PlotWrapBase

import os

def spline_continuum(wa, fl, er, edges, minfrac=0.01, nsig=3.0,
                     resid_std=1.3, debug=False):
    """ Fit a continuum to a chunk of a spectrum.

    Very loosely based on the method in Aguirre et al. 2002.

    Parameters
    ----------
    wa               : Wavelengths.
    fl               : Fluxes.
    er               : One sigma errors.
    edges            : Wavelengths giving the chunk edges.
    minfrac = 0.01   : At least this fraction of pixels in a single chunk
                       contributes to the fit.
    nsig = 3.0       : No. of sigma for rejection for clipping.
    resid_std = 1.3  : Maximum residual st. dev. in a given chunk.
    debug = False    : If True, make helpful plots.

    Returns
    -------
    Continuum array and spline points

    """

    # Overview:

    # (1) Calculate the median flux value for each wavelength chunk.

    # (2) fit a 1st order spline (i.e. series of straight line
    # segments) through the set of points given by the central
    # wavelength for each chunk and the median flux value for each
    # chunk.

    # (3) Remove any flux values that fall more than nsig*er below
    # the spline.

    # Repeat 1-3 until the continuum converges on a solution (if it
    # doesn't throw hands up in despair! Essential to choose a
    # suitable first guess with small enough chunks).

    if len(edges) < 2:
        raise ValueError('must be at least two bin edges!')

    wa,fl,er = (np.asarray(a, np.float64) for a in (wa,fl,er))

    if debug:
        ax = plt.gca()
        ax.cla()
        ax.plot(wa,fl)
        ax.plot(wa,er)
        ax.axhline(0, color='0.7')
        good = ~np.isnan(fl) & ~np.isnan(er) & ~np.isinf(fl)
        ymax = 2*np.percentile(fl[good], 0.90)
        ax.set_ylim(-0.1*ymax, ymax)
        ax.set_xlim(min(edges), max(edges))
        ax.set_autoscale_on(0)
        plt.draw()

    npts = len(wa)
    mask = np.ones(npts, bool)
    oldco = np.zeros(npts, float)
    co = np.zeros(npts, float)

    # find indices of chunk edges and central wavelengths of chunks
    indices = wa.searchsorted(edges)
    indices = [(i0,i1) for i0,i1 in zip(indices[:-1],indices[1:])]
    if debug:  print(' indices', indices)
    wavc = [0.5*(w1 + w2) for w1,w2 in zip(edges[:-1],edges[1:])]

    # information per chunks
    npts = len(indices)
    mfl = np.zeros(npts, float)     # median fluxes at chunk centres
    goodfit = np.zeros(npts, bool)  # is fit acceptable?
    res_std = np.zeros(npts, float) # residuals standard dev
    res_med = np.zeros(npts, float) # residuals median
    if debug:
        print('chunk centres', wavc)
        cont, = ax.plot(wa,co,'k')
        midpoints, = ax.plot(wavc, mfl,'rx',mew=1.5,ms=8)

    # loop that iterative fits continuum
    while True:
        for i,(j1,j2) in enumerate(indices):
            if goodfit[i]:  continue
            # calculate median flux
            #print(i,j1,j2)
            w,f,e,m = (item[j1:j2] for item in (wa,fl,er,mask))
            ercond = (e > 0) & (~np.isnan(f))
            cond = m & ercond
            chfl = f[cond]
            chflgood = f[ercond]
            if len(chflgood) == 0: continue
            #print(len(chfl), len(chflgood))
            if float(len(chfl)) / len(chflgood) < minfrac:
                f_cutoff = np.percentile(chflgood, minfrac)
                cond = ercond & (f >= f_cutoff)
            if len(f[cond]) == 0:  continue
            mfl[i] = np.median(f[cond])

        # calculate the spline. add extra points on either end to give
        # a nice slope at the end points.
        extwavc = ([wavc[0] - (wavc[1] - wavc[0])] + list(wavc) +
                   [wavc[-1] + (wavc[-1] - wavc[-2])])
        extmfl = ([mfl[0] - (mfl[1] - mfl[0])] + list(mfl) +
                  [mfl[-1] + (mfl[-1] - mfl[-2])])
        co = np.interp(wa, extwavc, extmfl)
        if debug:
            cont.set_ydata(co)
            midpoints.set_xdata(wavc)
            midpoints.set_ydata(mfl)
            plt.draw()

        # calculate residuals for each chunk
        for i,(j1,j2) in enumerate(indices):
            if goodfit[i]:  continue
            ercond = er[j1:j2] > 0
            cond = ercond & mask[j1:j2]
            chfl = fl[j1:j2][cond]
            chflgood = fl[j1:j2][ercond]
            if len(chflgood) == 0:  continue
            if float(len(chfl)) / len(chflgood) < minfrac:
                f_cutoff = np.percentile(chflgood, minfrac)
                cond = ercond & (fl[j1:j2] > f_cutoff)
            #print(len(co), len(fl), i1, j1, j2)
            residuals = (fl[j1:j2][cond] - co[j1:j2][cond]
                         ) / er[j1:j2][cond]
            res_std[i] = residuals.std()
            if len(residuals) == 0:
                continue
            res_med[i] = np.median(residuals)
            # If residuals have std < 1.0 and mean ~1.0, we might have
            # a reasonable fit.
            if res_std[i] <= resid_std:
                goodfit[i] = True

        if debug:
            print('median and st. dev. of residuals by region - aiming for 0,1')
            for i,(f0,f1) in  enumerate(zip(res_med, res_std)):
                print('{0} {0:.2f} {0:.2f}'.format(i,f0,f1))
            raw_input('Enter...')

        # (3) Remove flux values that fall more than N*sigma below the
        # spline fit.
        cond = (co - fl) > nsig * er
        if debug:
            print(np.nanmax(np.abs(co - oldco)/co))
        # Finish when the biggest change between the new and old
        # medians is smaller than the number below.
        if np.nanmax(np.abs(co - oldco)/co) < 4e-3:
            break
        oldco = co.copy()
        mask[cond] = False

    # finally fit a cubic spline through the median values to
    # get a smooth continuum.
    final = AkimaSpline(wavc, mfl)

    return final(wa), list(zip(wavc,mfl))

def fitqsocont(wa, fl, er, redshift, oldco=None, knots=None,
               nbin=1, divmult=1, forest_divmult=1, atmos=True, debug=False):

    """ Find an estimate of a QSO continuum.

    divmult=3 works well for R~40000, S/N~10, z=3 QSO spectrum.

    nbin bins the data for plotting and continuum fitting (obsolete)
    """
    # choose initial reference continuum points.  Increase divmult for
    # fewer initial continuum points (generally needed for poorer S/N
    # spectra).

    zp1 = 1 + redshift
    #reflines = np.array([1025.72, 1215.6701, 1240.14, 1398.0,
    #                     1549.06, 1908,      2800            ])

    # generate the edges of wavelength chunks to send to fitting routine

    # these edges and divisions are generated by trial and error

    # for S/N = 15ish and resolution = 2000ish
    div = np.rec.fromrecords([(500. , 800. , 25),
                              (800. , 1190., 25),
                              (1190., 1213.,  4),
                              (1213., 1230.,  6),
                              (1230., 1263.,  6),
                              (1263., 1290.,  5),
                              (1290., 1340.,  5),
                              (1340., 1370.,  2),
                              (1370., 1410.,  5),
                              (1410., 1515.,  5),
                              (1515., 1600., 15),
                              (1600., 1800.,  8),
                              (1800., 1900.,  5),
                              (1900., 1940.,  5),
                              (1940., 2240., 15),
                              (2240., 3000., 25),
                              (3000., 6000., 80),
                              (6000., 20000., 100),
                              ], names=str('left,right,num'))

    div.num[2:] = np.ceil(div.num[2:] * divmult)
    div.num[:2] = np.ceil(div.num[:2] * forest_divmult)
    div.left *= zp1
    div.right *= zp1
    if debug: print(div.tolist())
    temp = [np.linspace(left, right, n+1)[:-1] for left,right,n in div]
    edges = np.concatenate(temp)
    if debug: stats(edges)

    i0,i1,i2 = edges.searchsorted([wa[0], 1210*zp1, wa[-1]])
    if debug: print(i0,i1,i2)

    contpoints = []
    if knots is not None:
        contpoints.extend(knots)
    else:
        co,cp = spline_continuum(wa, fl, er, edges[i0:i2], debug=debug)
        contpoints.extend(cp)
    fig = plt.figure(figsize=(11, 7))
    fig.subplots_adjust(left=0.05, right=0.95, bottom=0.1, top=0.95)
    wrapper = InteractiveCoFit(wa, fl, er, contpoints, co=oldco, nbin=nbin,
                               redshift=redshift, fig=fig, atmos=atmos)
    while True:
        if wrapper.finished: break
        plt.waitforbuttonpress()

    return wrapper.continuum, wrapper.contpoints

class InteractiveCoFit(PlotWrapBase):
    help_message = PlotWrapBase._help_string + """
a or 3   : add a new continuum point
d or 4   : delete the nearest point
m        : move the nearest point
k        : keep continuum
q        : quit without keeping continuum
"""
    def __init__(self, wa, fl, er, contpoints, co=None,
                 nbin=8, redshift=None, atmos=None, fig=None):
        """ Initialise figure, plots and variables.

        Parameters
        ----------
        wa :   Wavelengths
        fl :   Fluxes
        er :   One sigma errors
        nbin : int (8)
            Number of pixels to bin arrays in wavelength. Default 8.
        contpoints : list of x,y tuple pairs (None)
            The points through which a cubic spline is passed,
            defining the continuum.
        redshift : float (None)
            Redshift used to plot reference emission lines.
        atmos : list of wavelength pairs (None)
            Regions of atmospheric absorption to plot.

        Notes
        -----
        Updates the following attributes:

         self.wa, self.fl, self.er :  wa, fl, er
         self.contpoints :  Points used to define the continuum.
         self.nbin :  The input nbin value.
         self.artists :  Dictionary of matplotlib plotting artists.
         self.connections :  Callback connections.
         self.fig :  The plotting figure instance.
        """
        #setup
        self.WMIN_LYA = 1040
        self.WMAX_LYA = 1190

        self.nsmooth = 0
        self.wa = wa
        self.fl = fl
        self.er = er
        self.nbin = nbin
        self.contpoints = list(contpoints)
        if os.path.lexists('./_knots.sav'):
            c = raw_input('temporary knots file exists, use these knots? (y) ')
            if c.lower() != 'n':
                self.contpoints = loadobj('./_knots.sav')

        self.artists = {}
        if fig is None:
            self.fig = plt.figure()
        else:
            self.fig = fig
        # disable any existing key press callbacks
        cids = list(fig.canvas.callbacks.callbacks['key_press_event'])
        for cid in cids:
            fig.canvas.callbacks.disconnect(cid)

        self.template = None
        if redshift is not None:
            self.template = qso_template(wa, redshift)

        self.connections = []
        self.continuum = None
        self.finished = False
        self.redshift = redshift
        self.atmos = atmos
        self.plotinit()
        self.update()
        self.modifypoints()
        plt.draw()

    def plotinit(self):
        """ Set up the figure and do initial plots.

        Updates the following attributes:

          self.artists
        """
        wa,fl,er = self.wa, self.fl, self.er
        if self.continuum is not None:
            co = self.continuum

        # axis for spectrum & continuum
        a0 = self.fig.add_axes((0.05,0.1,0.9,0.6))
        self.ax = a0
        a0.set_autoscale_on(0)
        # axis for residuals
        a1 = self.fig.add_axes((0.05,0.75,0.9,0.2),sharex=a0)
        a1.set_autoscale_on(0)
        a1.axhline(0,color='k',alpha=0.7, zorder=99)
        a1.axhline(1,color='k',alpha=0.7, zorder=99)
        a1.axhline(-1,color='k',alpha=0.7, zorder=99)
        a1.axhline(2,color='k',linestyle='dashed',zorder=99)
        a1.axhline(-2,color='k',linestyle='dashed',zorder=99)
        m0, = a1.plot([0],[0],'.r',marker='.', mec='none', lw=0, mew=0, ms=6, alpha=0.5)
        a1.set_ylim(-4, 4)
        a0.axhline(0, color='0.7')
        if self.continuum is not None:
            a0.plot(wa, co, color='0.7', lw=1, ls='dashed')
        self.artists['fl'], = a0.plot(wa, fl, 'b', lw=0.5,
                                      linestyle='steps-mid')
        a0.plot(wa, er, lw=0.5, color='orange')
        m1, = a0.plot([0], [0], 'r', alpha=0.7)
        m2, = a0.plot([0], [0], 'o', mfc='None',mew=1, ms=8, mec='r', picker=5,
                      alpha=0.7)
        a0.set_xlim(min(wa), max(wa))
        good = (er > 0) & ~np.isnan(fl) & ~np.isinf(fl)
        ymax = 2 * np.abs(np.percentile(fl[good], 95))
        a0.set_ylim(-0.1*ymax, ymax)
        a0.text(0.9,0.9, 'z=%.2f' % self.redshift, transform=a0.transAxes)

        # for histogram
        trans = mtran.blended_transform_factory(a1.transAxes, a1.transData)
        hist, = a1.plot([], [], color='k', transform=trans)
        x = np.linspace(-3,3)
        a1.plot(Gaussian(x,0,1,0.05), x, color='k', transform=trans, lw=0.5)

        if self.template is not None:
            trans = mtran.blended_transform_factory(a0.transData, a0.transAxes)
            a0.plot(self.wa, self.template/self.template.max(), '-c', lw=2,
                    alpha=0.5, transform=trans)

        self.fig.canvas.draw()
        self.artists.update(contpoints=m2, cont=m1, resid=m0, hist_left=hist)

    def update(self):
        """ Calculates the new continuum, residuals and updates the plots.

        Updates the following attributes:

          self.artists
          self.continuum
        """
        wa,fl,er = self.wa, self.fl, self.er
        co = np.empty(len(wa))
        co.fill(np.nan)
        cpts = [(x,y) for x,y in self.contpoints]
        if len(cpts) >= 3:
            spline = AkimaSpline(*list(zip(*cpts)))
            co[:] = spline(wa)

        resid = (fl - co) / er
        # histogram
        bins = np.arange(0, 5+0.1, 0.2)
        w0,w1 = self.fig.axes[1].get_xlim()
        x,_ = np.histogram(resid[between(wa, w0, w1)],
                           bins=bins)
        b = np.repeat(bins, 2)
        X = np.concatenate([[0], np.repeat(x,2), [0]])
        Xmax = X.max()
        X = 0.05 * X / Xmax
        self.artists['hist_left'].set_data(X, b)

        self.artists['contpoints'].set_data(list(zip(*self.contpoints)))
        nbin = self.nbin
        self.artists['cont'].set_data(wa[::nbin], co[::nbin])
        self.artists['resid'].set_data(wa[::nbin], resid[::nbin])
        self.continuum = co
        saveobj('_knots.sav', self.contpoints, overwrite=True)
        self.fig.canvas.draw()

    def on_keypress(self, event):
        """ Interactive fiddling via the keyboard

        Updates:

         self.contpoints
        """
        if event.key == 'q':
            for item in self.connections:
                self.fig.canvas.mpl_disconnect(item)
            self.contpoints = None
            self.continuum = None
            self.finished = True
            return
        if event.key == 'k':
            for item in self.connections:
                self.fig.canvas.mpl_disconnect(item)
            self.finished = True
            return
        if event.inaxes != self.fig.axes[0]:
            return

        if event.key in ('a', '3'):
            # add a point to contpoints
            x,y = event.xdata,event.ydata
            if not self.contpoints or x not in list(zip(*self.contpoints))[0]:
                self.contpoints.append((x, y))
                self.update()
        elif event.key in ('d', '4'):
            # remove a point from contpoints
            contx,conty = zip(*self.ax.transData.transform(self.contpoints))
            sep = np.hypot(event.x - np.array(contx),
                           event.y - np.array(conty))
            self.contpoints.remove(self.contpoints[sep.argmin()])
            self.update()
        elif event.key == 'm':
            # Move a point
            contx,conty = zip(*self.ax.transData.transform(self.contpoints))
            sep = np.hypot(event.x - np.array(contx),
                           event.y - np.array(conty))
            self.contpoints[sep.argmin()] = (event.xdata,event.ydata)
            self.update()
        elif event.key == 'b':
            # Add a break to the continuum.
            self.breaks.append(event.xdata)
            self.breaks.sort()
            self.update()
        elif event.key == 'r':
            # remove a break
            i = indexnear(self.breaks, event.xdata)
            if i not in (0, len(self.breaks)-1):
                self.breaks.remove(self.breaks[i])
            self.update()
        elif event.key == 'S':
            # Save fit to a temporary file
            print('fitcont: Writing output to temporary file tmp.sav')
            saveobj('tmp.sav', (self.continuum, self.contpoints), overwrite=1)
        elif event.key == 's':
            c = raw_input('New FWHM in pixels of Gaussian to convolve with? '
                          '(blank for no smoothing) ')
            if c == '':
                # restore spectrum
                self.smoothby = None
                self.update()
            else:
                try:
                    fwhm = float(c)
                except TypeError:
                    print('FWHM must be a floating point number >= 1')
                if fwhm < 1:
                    self.smoothby = None
                else:
                    self.smoothby = fwhm
                self.update()
        elif event.key == '?':
            print(self.help_message)

    def on_button_release(self, event):
        self.update()

    def modifypoints(self):
        """ Add/remove continuum points."""
        print(self.help_message)
        id1 = self.fig.canvas.mpl_connect('key_press_event',self.on_keypress)
        id2 = self.fig.canvas.mpl_connect('key_press_event',self.on_keypress_smooth)
        id3 = self.fig.canvas.mpl_connect('key_press_event',self.on_keypress_navigate)
        id4 = self.fig.canvas.mpl_connect('button_release_event',self.on_button_release)
        self.connections.extend([id1, id2, id3, id4])


text:
module Basement.These
    ( These(..)
    ) where

import Basement.Compat.Base
import Basement.NormalForm
import Basement.Compat.Bifunctor

-- | Either a or b or both.
data These a b
    = This a
    | That b
    | These a b
  deriving (Eq, Ord, Show, Typeable)

instance (NormalForm a, NormalForm b) => NormalForm (These a b) where
    toNormalForm (This a) = toNormalForm a
    toNormalForm (That b) = toNormalForm b
    toNormalForm (These a b) = toNormalForm a `seq` toNormalForm b

instance Bifunctor These where
    bimap fa _  (This a)    = This  (fa a)
    bimap _  fb (That b)    = That  (fb b)
    bimap fa fb (These a b) = These (fa a) (fb b)

instance Functor (These a) where
    fmap = second


text:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
  ~ 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.
  -->

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          version="2.5">
     <display-name>Apache-Axis2</display-name>

    <context-param>
        <param-name>isLog4jAutoInitializationDisabled</param-name>
        <param-value>true</param-value>
    </context-param>

    <listener>
        <listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
    </listener>

    <filter>
        <filter-name>UrlRewriteFilter</filter-name>
        <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter>
        <filter-name>log4jServletFilter</filter-name>
        <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>log4jServletFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
        <dispatcher>ASYNC</dispatcher><!-- Servlet 3.0 w/ disabled auto-initialization only; not supported in 2.5 -->
    </filter-mapping>

    <servlet>
        <display-name>Apache-Axis Servlet</display-name>
        <servlet-name>AxisServlet</servlet-name>
        <servlet-class>org.apache.ode.axis2.hooks.ODEAxisServlet</servlet-class>
        <!--<init-param>-->
        <!--<param-name>axis2.xml.path</param-name>-->
        <!--<param-value>/WEB-INF/conf/axis2.xml</param-value>-->
        <!--<param-name>axis2.xml.url</param-name>-->
        <!--<param-value>http://localhot/myrepo/axis2.xml</param-value>-->
        <!--<param-name>axis2.repository.path</param-name>-->
        <!--<param-value>/WEB-INF</param-value>-->
        <!--<param-name>axis2.repository.url</param-name>-->
        <!--<param-value>http://localhot/myrepo</param-value>-->
        <!--</init-param>-->
        <load-on-startup>1</load-on-startup>
    </servlet>
    <!--<servlet>
        <servlet-name>AxisAdminServlet</servlet-name>
        <display-name>Apache-Axis AxisAdmin Servlet (REST)</display-name>
        <servlet-class>org.apache.axis2.webapp.AxisAdminServlet</servlet-class>
    </servlet>-->

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/servlet/AxisServlet</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>*.jws</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/processes/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/deployment/*</url-pattern>
    </servlet-mapping>

    <!--<servlet-mapping>
        <servlet-name>AxisAdminServlet</servlet-name>
        <url-pattern>/axis2-admin/*</url-pattern>
        </servlet-mapping>-->

   <welcome-file-list>
      <welcome-file>/index.html</welcome-file>
    </welcome-file-list>

    <error-page>
      <error-code>404</error-code>
      <location>/axis2-web/Error/error404.jsp</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/axis2-web/Error/error500.jsp</location>
    </error-page>

    <!-- UNCOMMENT TO USE APPSERVER DATASOURCE
    <resource-ref>
        <res-ref-name>jdbc/ode-ds</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
         UNCOMMENT TO USE APPSERVER DATASOURCE -->

</web-app>