text:
using namespace std;

class system_executor {
private:
    shared_ptr<internal::functional_pool> pool;

    // Private default constructor: users must access system_executor by calling get_executor
    system_executor() : pool(new internal::functional_pool()) {}

public:
    static system_executor& get_executor() {
        static system_executor instance;
        return instance;
    }

    template<class Func>
    void spawn(Func&& closure) {
        pool->submit(std::move(closure));
    }
};

namespace internal {
    extern system_executor g_system_executor;
}

#endif


text:
namespace Packets
{

    class GCSystemMsg : public Packet
    {
    public:
        GCSystemMsg( )
        {
                m_ContexSize=MAX_SYSTEM_MSG_SIZE-1;
        };
        virtual ~GCSystemMsg( ){} ;

        //公用继承接口
        virtual BOOL            Read( SocketInputStream& iStream ) ;
        virtual BOOL            Write( SocketOutputStream& oStream ) const ;
        virtual UINT            Execute( Player* pPlayer) ;

        virtual PacketID_t        GetPacketID() const { return PACKET_GC_SYSTEMMSG ; }
        virtual UINT            GetPacketSize() const {  return    sizeof(GUID_t)+sizeof(BYTE)*2+sizeof(CHAR)*m_ContexSize ; }

    public:
        VOID                    SetGUID( GUID_t guid ){    m_GUID = guid ; }
        GUID_t                    GetGUID( ){ return m_GUID ; }

        VOID                    SetContex( CHAR* pContex ){memset(m_Contex, 0,m_ContexSize); memcpy(m_Contex,pContex,m_ContexSize); };
        CHAR*                    GetContex(){ m_Contex[m_ContexSize] = 0; return m_Contex ; } ;

        VOID                    SetContexSize( BYTE bSize ){ m_ContexSize = bSize ; } ;
        BYTE                    GetContexSize( ){ return m_ContexSize ; } ;

        VOID                    SetMessageType( BYTE bSize ){ m_MessageType = bSize ; } ;
        BYTE                    GetMessageType( ){ return m_MessageType ; } ;
    private:

        CHAR    m_Contex[MAX_SYSTEM_MSG_SIZE];
        BYTE    m_ContexSize;
        BYTE    m_MessageType;
        GUID_t    m_GUID;

    };

    class GCSystemMsgFactory : public PacketFactory
    {
    public:
        Packet*        CreatePacket() { return new GCSystemMsg() ; }
        PacketID_t    GetPacketID() const { return PACKET_GC_SYSTEMMSG ; }
        UINT        GetPacketMaxSize() const { return sizeof(GUID_t)+sizeof(CHAR)*MAX_SYSTEM_MSG_SIZE+sizeof(BYTE)*2;}
    };

    class GCSystemMsgHandler
    {
    public:
        static UINT Execute( GCSystemMsg* pPacket,Player* pPlayer) ;
    };

};

using namespace Packets ;

#endif

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\CoreBundle\Validator\Constraints;

use Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface;
use Sylius\Component\Order\Model\OrderInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Webmozart\Assert\Assert;

final class CartItemAvailabilityValidator extends ConstraintValidator
{
    /** @var AvailabilityCheckerInterface */
    private $availabilityChecker;

    public function __construct(AvailabilityCheckerInterface $availabilityChecker)
    {
        $this->availabilityChecker = $availabilityChecker;
    }

    public function validate($addCartItemCommand, Constraint $constraint): void
    {
        /** @var AddToCartCommandInterface $addCartItemCommand */
        Assert::isInstanceOf($addCartItemCommand, AddToCartCommandInterface::class);

        /** @var CartItemAvailability $constraint */
        Assert::isInstanceOf($constraint, CartItemAvailability::class);

        /** @var OrderItemInterface $cartItem */
        $cartItem = $addCartItemCommand->getCartItem();

        $isStockSufficient = $this->availabilityChecker->isStockSufficient(
            $cartItem->getVariant(),
            $cartItem->getQuantity() + $this->getExistingCartItemQuantityFromCart($addCartItemCommand->getCart(), $cartItem)
        );

        if (!$isStockSufficient) {
            $this->context->addViolation(
                $constraint->message,
                ['%itemName%' => $cartItem->getVariant()->getInventoryName()]
            );
        }
    }

    private function getExistingCartItemQuantityFromCart(OrderInterface $cart, OrderItemInterface $cartItem): int
    {
        foreach ($cart->getItems() as $existingCartItem) {
            if ($existingCartItem->equals($cartItem)) {
                return $existingCartItem->getQuantity();
            }
        }

        return 0;
    }
}


text:
import { Observable } from 'rxjs';

// HACK: this is here for backward compatability
// TODO(benlesh): remove this in v6.
export const toPromise: typeof Observable.prototype.toPromise = Observable.prototype.toPromise;


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

@Component({
  selector: 'date',
  templateUrl: './date.component.html'
})
export class DateComponent {
  date: number = Date.now();

  checkLength(e: any) {
    if (e.currentTarget.value.length > 15) {
      e.preventDefault();
    }
  }
}


text:
<?php

$filename = isset($_SERVER['PATH_INFO']) ? trim($_SERVER['PATH_INFO'], '/') : 'unknown.txt';

$fileLocation = realpath("files/$filename");
$fileinfo = pathinfo($fileLocation);

if (!is_dir($fileinfo['dirname'])) {
    mkdir($fileinfo['dirname']);
}

switch($_SERVER['REQUEST_METHOD']) {

    case "GET":
        header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
        header("Cache-Control: public");
        //header("Content-Type: application/zip");
        header("Content-Transfer-Encoding: Binary");
        header("Content-Length:".filesize($fileLocation));
        header("Content-Disposition: attachment; filename=" . $fileinfo['filename']);
        readfile($fileLocation);
        break;

    case "POST":
        file_put_contents($fileLocation, file_get_contents("php://input"));
        echo 'done!';
        break;
}


text:
<!DOCTYPE html >

          <title></title>
          <meta name="description" content="" />
          <meta name="keywords" content="" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="lib/ref-index.css" media="screen" type="text/css" rel="stylesheet" />

AutoEncoder

neuralnets

FeedForwardNetwork

neuralnets

featuresGaussianStandardization

DynaMLPipe

KernelOps

kernels

NeuralNetwork

neuralnets

processTargets

GPRegression

scoresToEnergy

GPRegression

trainTestGaussianStandardization

DynaMLPipe

trainTestGaussianStandardizationMO

DynaMLPipe

tuneRBFKernel

KernelLSSVMModel


text:
package io.virtdata.apps.docsapp;

import io.virtdata.annotations.Category;
import io.virtdata.api.config.MutableConfigModel;
import io.virtdata.processors.DocCtorData;

import java.util.*;

public class FunctionDoc {

    private String funcName;
    private String classDocs;
    private Set<Category> categories= new HashSet<>();
    private List<DocCtorData> ctors = new ArrayList<>();

    public FunctionDoc(String funcName) {
        this.funcName = funcName;
    }

    public void setClassDocs(String distinctClassDocs) {
        this.classDocs = distinctClassDocs;
    }

    public void addCategories(Category[] categories) {
        this.categories.addAll(Arrays.asList(categories));
    }

    public void addCtor(DocCtorData ctor) {
        this.ctors.add(ctor);
    }
}


text:
<?php
namespace Brainwave\Http\Exception;

use \Brainwave\Http\Exception\HttpException;

/**
 * MethodNotAllowedHttpException
 *
 * @package Narrowspark/framework
 * @author  Daniel Bannert
 * @since   0.9.1-dev
 *
 */
class MethodNotAllowedHttpException extends HttpException
{
    /**
     * Constructor.
     *
     * @param array      $allow    An array of allowed methods
     * @param string     $message  The internal exception message
     * @param \Exception $previous The previous exception
     * @param int        $code     The internal exception code
     */
    public function __construct(array $allow, $message = null, \Exception $previous = null, $code = 0)
    {
        $headers = ['Allow' => strtoupper(implode(', ', $allow))];

        parent::__construct(405, $message, $previous, $headers, $code);
    }
}


text:
using System.Linq;
using System.Reflection;
using NSubstitute;
using NUnit.Framework;
using ObjectsComparer.Tests.TestClasses;

namespace ObjectsComparer.Tests
{
    [TestFixture]
    public class ComparerOverridesTests
    {
        [Test]
        public void OverrideStringComparisonWhenEqual()
        {
            var a1 = new A { TestProperty1 = "ABC", TestProperty2 = "ABC", ClassB = new B { Property1 = "Str1" } };
            var a2 = new A { TestProperty1 = "BCD", TestProperty2 = "ABC", ClassB = new B { Property1 = "Str2" } };
            var comparer = new Comparer<A>();
            var stringComparer = Substitute.For<IValueComparer>();
            stringComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(true);
            comparer.AddComparerOverride<string>(stringComparer);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
            stringComparer.Received().Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverrideStringComparisonWhenNotEqual()
        {
            var a1 = new A { TestProperty1 = "ABC", TestProperty2 = "ABC", ClassB = new B { Property1 = "Str1" } };
            var a2 = new A { TestProperty1 = "BCD", TestProperty2 = "ABC", ClassB = new B { Property1 = "Str1" } };
            var comparer = new Comparer<A>();
            var stringComparer = Substitute.For<IValueComparer>();
            stringComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(false);
            stringComparer.ToString(Arg.Any<object>()).Returns(info => (info.Arg<object>() ?? string.Empty).ToString());
            comparer.AddComparerOverride(typeof(string), stringComparer);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsNotEmpty(differences);
            Assert.IsTrue(differences.Any(d => d.MemberPath == "TestProperty1" && d.Value1 == "ABC" && d.Value2 == "BCD"));
            Assert.IsTrue(differences.Any(d => d.MemberPath == "TestProperty2" && d.Value1 == "ABC" && d.Value2 == "ABC"));
            Assert.IsTrue(differences.Any(d => d.MemberPath == "ClassB.Property1" && d.Value1 == "Str1" && d.Value2 == "Str1"));
            stringComparer.Received().Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>());
            stringComparer.Received().ToString(Arg.Any<object>());
        }

        [Test]
        public void OverrideIntComparisonWhenNotEqual()
        {
            var a1 = new A { IntArray = new[] { 1, 2 } };
            var a2 = new A { IntArray = new[] { 1, 3 } };
            var comparer = new Comparer<A>();
            var stringComparer = Substitute.For<IValueComparer>();
            stringComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(false);
            stringComparer.ToString(Arg.Any<object>()).Returns(info => (info.Arg<object>() ?? string.Empty).ToString());
            comparer.AddComparerOverride<int>(stringComparer);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsNotEmpty(differences);
            Assert.IsTrue(differences.Any(d => d.MemberPath == "IntArray[0]" && d.Value1 == "1" && d.Value2 == "1"));
            Assert.IsTrue(differences.Any(d => d.MemberPath == "IntArray[1]" && d.Value1 == "2" && d.Value2 == "3"));
            stringComparer.Received().Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>());
            stringComparer.Received().ToString(Arg.Any<object>());
        }

        [Test]
        public void OverrideIntComparisonWhenEqual()
        {
            var a1 = new A { IntArray = new[] { 1, 2 } };
            var a2 = new A { IntArray = new[] { 1, 3 } };
            var comparer = new Comparer<A>();
            var intComparer = Substitute.For<IValueComparer>();
            intComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(true);
            intComparer.ToString(Arg.Any<object>()).Returns(info => (info.Arg<object>() ?? string.Empty).ToString());
            comparer.AddComparerOverride(typeof(int), intComparer);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
            intComparer.Received().Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverridePropertyComparisonWhenEqual()
        {
            var a1 = new A { TestProperty1 = "ABC" };
            var a2 = new A { TestProperty1 = "BCD" };
            var comparer = new Comparer<A>();
            var valueComparer = Substitute.For<IValueComparer>();
            valueComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(true);
            comparer.AddComparerOverride(() => a1.TestProperty1, valueComparer);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
            valueComparer.Received(1).Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverrideBClassComparerWhenEqual()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7898" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7898" } };
            var valueComparer = CreateClassBComparerAsPhone();
            var comparer = new Comparer<A>();
            comparer.AddComparerOverride<B>(valueComparer);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        [Test]
        public void OverrideBClassComparerWhenNotEqual()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7898" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7899" } };
            var valueComparer = CreateClassBComparerAsPhone();
            var comparer = new Comparer<A>();
            comparer.AddComparerOverride<B>(valueComparer);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsNotEmpty(differences);
            Assert.AreEqual("ClassB", differences[0].MemberPath);
            Assert.AreEqual("123-456-7898", differences[0].Value1);
            Assert.AreEqual("(123)-456-7899", differences[0].Value2);
        }

        [Test]
        public void OverrideBClassProperty1ComparerWhenEqual()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7898" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7898" } };
            var valueComparer = CreatePhoneComparer();
            var comparer = new Comparer<A>();
            comparer.AddComparerOverride(() => new B().Property1, valueComparer);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        [Test]
        public void OverrideBClassProperty1ComparerWhenNotEqual()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7898" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7899" } };
            var valueComparer = CreatePhoneComparer();
            var comparer = new Comparer<A>();
            comparer.AddComparerOverride(() => new B().Property1, valueComparer);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsNotEmpty(differences);
            Assert.AreEqual("ClassB.Property1", differences[0].MemberPath);
            Assert.AreEqual("123-456-7898", differences[0].Value1);
            Assert.AreEqual("(123)-456-7899", differences[0].Value2);
        }

        [Test]
        public void OverrideBClassProperty1ComparerWithFunction()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7898" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7898" } };
            var comparer = new Comparer<A>();
            comparer.AddComparerOverride(
                () => new B().Property1,
                (phone1, phone2, parentSettings) => ExtractDigits(phone1) == ExtractDigits(phone2),
                s => s);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        [Test]
        public void OverrideBClassProperty1ComparerWithFunctionAndDefaultToString()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7898" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7899" } };
            var comparer = new Comparer<A>();
            comparer.AddComparerOverride(
                () => new B().Property1,
                (phone1, phone2, parentSettings) => ExtractDigits(phone1) == ExtractDigits(phone2));

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsNotEmpty(differences);
            Assert.AreEqual("ClassB.Property1", differences[0].MemberPath);
            Assert.AreEqual("123-456-7898", differences[0].Value1);
            Assert.AreEqual("(123)-456-7899", differences[0].Value2);
        }

        [Test]
        public void OverrideBClassProperty1ByMemberInfo()
        {
            var a1 = new A { ClassB = new B { Property1 = "S1" } };
            var a2 = new A { ClassB = new B { Property1 = "S2" } };
            var comparer = new Comparer<A>();
            var valueComparer = Substitute.For<IValueComparer>();
            valueComparer.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);
            comparer.AddComparerOverride(
                typeof(B).GetTypeInfo().GetMember("Property1").First(),
                valueComparer);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsEmpty(differences);
            valueComparer.Received().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverrideByName()
        {
            var a1 = new A { ClassB = new B { Property1 = "123-456-7899" } };
            var a2 = new A { ClassB = new B { Property1 = "(123)-456-7899" } };
            var comparer = new Comparer<A>();
            var phoneComparer = Substitute.For<IValueComparer>();
            phoneComparer.Compare("123-456-7899", "(123)-456-7899", Arg.Any<ComparisonSettings>()).Returns(true);

            comparer.AddComparerOverride("Property1", phoneComparer);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsEmpty(differences);
            phoneComparer.Received().Compare("123-456-7899", "(123)-456-7899", Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverrideMemberHighestPriority()
        {
            var a1 = new A { ClassB = new B { Property1 = "S1" } };
            var a2 = new A { ClassB = new B { Property1 = "S2" } };
            var comparer = new Comparer<A>();
            var valueComparer1 = Substitute.For<IValueComparer>();
            valueComparer1.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);
            var valueComparer2 = Substitute.For<IValueComparer>();
            valueComparer2.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);
            var valueComparer3 = Substitute.For<IValueComparer>();
            valueComparer3.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);

            comparer.AddComparerOverride<string>(valueComparer1);
            comparer.AddComparerOverride(() => a1.ClassB.Property1, valueComparer2);
            comparer.AddComparerOverride("Property1", valueComparer3);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsEmpty(differences);
            valueComparer2.Received().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
            valueComparer1.DidNotReceive().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
            valueComparer3.DidNotReceive().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverrideMemberHigherPriorityThanByName()
        {
            var a1 = new A { ClassB = new B { Property1 = "S1" } };
            var a2 = new A { ClassB = new B { Property1 = "S2" } };
            var comparer = new Comparer<A>();
            var valueComparer1 = Substitute.For<IValueComparer>();
            valueComparer1.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);
            var valueComparer2 = Substitute.For<IValueComparer>();
            valueComparer2.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);

            comparer.AddComparerOverride<string>(valueComparer1);
            comparer.AddComparerOverride(() => a1.ClassB.Property1, valueComparer1);
            comparer.AddComparerOverride("Property1", valueComparer2);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsEmpty(differences);
            valueComparer1.Received().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
            valueComparer2.DidNotReceive().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void OverrideTypeWithFilterAndByName()
        {
            var a1 = new A { ClassB = new B { Property1 = "S1" } };
            var a2 = new A { ClassB = new B { Property1 = "S2" } };
            var comparer = new Comparer<A>();
            var valueComparer1 = Substitute.For<IValueComparer>();
            valueComparer1.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);
            var valueComparer2 = Substitute.For<IValueComparer>();
            valueComparer2.Compare(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<ComparisonSettings>()).Returns(true);

            comparer.AddComparerOverride<string>(valueComparer1, memberInfo => memberInfo.Name != "Property1");
            comparer.AddComparerOverride("Property1", valueComparer2);

            var differences = comparer.CalculateDifferences(a1, a2).ToList();

            CollectionAssert.IsEmpty(differences);
            valueComparer1.DidNotReceive().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
            valueComparer2.Received().Compare("S1", "S2", Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void IgnoreByName()
        {
            var a1 = new A { TestProperty1 = "Str1", IntProperty = 5};
            var a2 = new A { TestProperty1 = "Str2", IntProperty = 5 };
            var comparer = new Comparer<A>();

            comparer.IgnoreMember("TestProperty1");

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        [Test]
        public void IgnoreByType()
        {
            var a1 = new A { TestProperty1 = "Str1", IntProperty = 5 };
            var a2 = new A { TestProperty1 = "Str2", IntProperty = 5 };
            var comparer = new Comparer<A>();

            comparer.IgnoreMember<string>();

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        [Test]
        public void IgnoreByMember()
        {
            var a1 = new A { TestProperty1 = "Str1", IntProperty = 5 };
            var a2 = new A { TestProperty1 = "Str2", IntProperty = 5 };
            var comparer = new Comparer<A>();

            comparer.IgnoreMember(() => new A().TestProperty1);

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        [Test]
        public void OverrideByMemberFilter()
        {
            var a1 = new A { TestProperty1 = "ABC" };
            var a2 = new A { TestProperty1 = "ABC" };
            var comparer = new Comparer<A>();
            var valueComparer = Substitute.For<IValueComparer>();
            valueComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(true);
            comparer.AddComparerOverride(valueComparer, member => member.Name == "TestProperty1");

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
            valueComparer.Received(1).Compare(Arg.Is("ABC"), Arg.Is("ABC"), Arg.Any<ComparisonSettings>());
        }

        [Test]
        public void IgnoreByMemberFilter()
        {
            var a1 = new A { TestProperty1 = "ABC" };
            var a2 = new A { TestProperty1 = "BCD" };
            var comparer = new Comparer<A>();
            comparer.IgnoreMember(member => member.Name == "TestProperty1");

            var isEqual = comparer.Compare(a1, a2);

            Assert.IsTrue(isEqual);
        }

        private IValueComparer CreateClassBComparerAsPhone()
        {
            var valueComparer = Substitute.For<IValueComparer>();
            valueComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(callInfo =>
            {
                var b1 = (B)callInfo.ArgAt<object>(0);
                var b2 = (B)callInfo.ArgAt<object>(1);

                return ExtractDigits(b1.Property1) == ExtractDigits(b2.Property1);
            });
            valueComparer.ToString(Arg.Any<object>()).Returns(callInfo => ((B)callInfo.Arg<object>()).Property1);

            return valueComparer;
        }

        private IValueComparer CreatePhoneComparer()
        {
            var valueComparer = Substitute.For<IValueComparer>();
            valueComparer.Compare(Arg.Any<object>(), Arg.Any<object>(), Arg.Any<ComparisonSettings>()).Returns(callInfo =>
            {
                var s1 = (string)callInfo.ArgAt<object>(0);
                var s2 = (string)callInfo.ArgAt<object>(1);

                return ExtractDigits(s1) == ExtractDigits(s2);
            });
            valueComparer.ToString(Arg.Any<object>()).Returns(callInfo => (string)callInfo.Arg<object>());

            return valueComparer;
        }

        private string ExtractDigits(string str)
        {
            return string.Join(string.Empty, (str ?? string.Empty).ToCharArray().Where(char.IsDigit));
        }
    }
}


text:
package test.saaj;

import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import test.AxisTestBase;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import java.io.ByteArrayInputStream;

public class TestImport extends AxisTestBase {
    private static final String SAMPLE_1 =
            "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
            "\n" +
            "<SOAP-ENV:Body> " + "\n" +
            "<m:GetLastTradePrice xmlns:m=\"http://wombat.ztrade.com\">" +
            "\n" +
            "<symbol>SUNW</symbol> " + "\n" +
            "</m:GetLastTradePrice> " + "\n" +
            "</SOAP-ENV:Body> " + "\n" +
            "</SOAP-ENV:Envelope>";

    private SOAPMessage getSOAPMessageFromString(String str) throws Exception {
        MimeHeaders mimeHeaders = new MimeHeaders();
        mimeHeaders.addHeader("content-type", "text/xml");
        SOAPMessage message = MessageFactory.newInstance().createMessage(
                mimeHeaders,
                new ByteArrayInputStream(str.getBytes()));
        return message;
    }

    public void testImports() throws Exception {
        //DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        //DocumentBuilder db = dbf.newDocumentBuilder();
        //Document doc1 = db.parse(new ByteArrayInputStream(SAMPLE_1.getBytes()));

        Document doc2 = testImportFromSaajToDom();
        Document body = testImportFromDomToSaaj(doc2);
        XMLUtils.PrettyDocumentToStream(body, System.out);
        //assertXMLEqual(doc1, body);
        //assertXMLEqual(doc2, body);
        //assertXMLEqual(doc1, doc2);
    }

    private Document testImportFromSaajToDom() throws Exception {
        SOAPMessage message = getSOAPMessageFromString(SAMPLE_1);
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.newDocument();
        org.w3c.dom.Node fromNode = message.getSOAPBody().getFirstChild();
        Node n = doc.importNode(fromNode, true);
        doc.appendChild(n);
        return doc;
    }

    private Document testImportFromDomToSaaj(Document doc) throws Exception {
        SOAPMessage sm = MessageFactory.newInstance().createMessage();
        SOAPPart sp = sm.getSOAPPart();
        SOAPBody body = sm.getSOAPBody();
        org.w3c.dom.Node node = sp.importNode(doc.getDocumentElement(), true);
        body.appendChild(node);
        return sp;
    }
}


text:
package testPullUpGen.test27.test;

/**
 * Test : pull up m
 */
public class A extends S<Integer> {
    @Override
    int m(Integer i){
        return 1;
    }
}


text:
layout: docs
title: Responsive utilities
description: Use responsive display utility classes for showing and hiding content by device, via media query.
group: layout
---

For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.

Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.

##  Available classes

* The `.hidden-*-up` classes hide the element when the viewport is at the given breakpoint or wider. For example, `.hidden-md-up` hides an element on medium, large, and extra-large viewports.
* The `.hidden-*-down` classes hide the element when the viewport is at the given breakpoint or smaller. For example, `.hidden-md-down` hides an element on extra-small, small, and medium viewports.
* There are no explicit "visible"/"show" responsive utility classes; you make an element visible by simply not hiding it at that breakpoint size.
* You can combine one `.hidden-*-up` class with one `.hidden-*-down` class to show an element only on a given interval of screen sizes. For example, `.hidden-sm-down.hidden-xl-up` shows the element only on medium and large viewports. Using multiple `.hidden-*-up` classes or multiple `.hidden-*-down` classes is redundant and pointless.
* These classes don't attempt to accommodate less common cases where an element's visibility can't be expressed as a single contiguous range of viewport breakpoint sizes; you will instead need to use custom CSS in such cases.

          Extra small devices
          Portrait phones (<544px)

          Small devices
          Landscape phones (≥544px - <768px)

          Medium devices
          Tablets (≥768px - <992px)

          Large devices
          Desktops (≥992px - <1200px)

          Extra large devices
          Desktops (≥1200px)

        .hidden-xs-down
        Hidden
        Visible
        Visible
        Visible
        Visible

        .hidden-sm-down
        Hidden
        Hidden
        Visible
        Visible
        Visible

        .hidden-md-down
        Hidden
        Hidden
        Hidden
        Visible
        Visible

        .hidden-lg-down
        Hidden
        Hidden
        Hidden
        Hidden
        Visible

        .hidden-xl-down
        Hidden
        Hidden
        Hidden
        Hidden
        Hidden

        .hidden-xs-up
        Hidden
        Hidden
        Hidden
        Hidden
        Hidden

        .hidden-sm-up
        Visible
        Hidden
        Hidden
        Hidden
        Hidden

        .hidden-md-up
        Visible
        Visible
        Hidden
        Hidden
        Hidden

        .hidden-lg-up
        Visible
        Visible
        Visible
        Hidden
        Hidden

        .hidden-xl-up
        Visible
        Visible
        Visible
        Visible
        Hidden

Print classes

Similar to the regular responsive classes, use these for toggling content for print.

        Class
        Browser
        Print

        .visible-print-block
        Hidden
        Visible
(as display: block)

        .visible-print-inline
        Hidden
        Visible
(as display: inline)

        .visible-print-inline-block
        Hidden
        Visible
(as display: inline-block)

        .hidden-print
        Visible
        Hidden

## Test cases

Resize your browser or load on different devices to test the responsive utility classes.

Green checkmarks indicate the element **is visible** in your current viewport.

    ✔ Visible on extra small
    Extra small

    ✔ Visible on small or narrower
    Small or narrower

    ✔ Visible on medium or narrower
    Medium or narrower

    ✔ Visible on large or narrower
    Large or narrower

    ✔ Visible on small or wider
    Small or wider

    ✔ Visible on medium or wider
    Medium or wider

    ✔ Visible on large or wider
    Large or wider

    ✔ Visible on extra large
    Extra large

    ✔ Your viewport is exactly extra small
    Your viewport is NOT exactly extra small

    ✔ Your viewport is exactly small
    Your viewport is NOT exactly small

    ✔ Your viewport is exactly medium
    Your viewport is NOT exactly medium

    ✔ Your viewport is exactly large
    Your viewport is NOT exactly large

    ✔ Your viewport is exactly extra large
    Your viewport is NOT exactly extra large


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

package com.sdstrowes.util

import scala.io.Source
import scala.collection.mutable.{Set, Map}
import scala.actors.Actor

case class DoneDijkstra(origin: Int, dists: Map[Int, Byte])
case class Dijkstra(origin: Int)
case object Continue
case object Terminate

/* ------------------------------------------------------------------------ */
class Spinner(g: Graph[Int]) extends Actor
{
    def act() {
        var alive = true
        while(alive) {
            receive {
                case Dijkstra(n) => {
                    try {
                        val result = g.dijkstra(n)
                         val distances = result._1
                        sender ! DoneDijkstra(n, distances)
                    } catch {
                        case e:java.lang.AssertionError => {
                            System.err.println("Source "+n+" not in graph!")
                            sender ! Continue
                        }
                    }
                }

                case Terminate =>
                    alive = false

                case _ =>
                    System.err.println("Error in Spinner.")
            }
        }
    }
}

/* ------------------------------------------------------------------------ */
class Master(args: Array[String], graph: Graph[Int]) extends Actor
{
    var spinners = List[Spinner]()

    def act() {
        /* Kick start the spinners. */
        for (i <- 1 to java.lang.Runtime.getRuntime().availableProcessors()) {
            spinners = (new Spinner(graph)) :: spinners
        }
        spinners.foreach(s => s.start())

        /* Determine the set of origins to run Dijkstra's algorithm from. If
            * there is no input file describing a subset of the graph, then assume
        * all-pairs. */
        var nodes = if (args.size == 1) {
            var temp = Set[Int]()
            for (line <- Source.fromFile(new java.io.File(args(0))).getLines()) {
                val pair = line.trim.split(" ")
                val source = pair(0).toInt
                val dest = pair(1).toInt
                //temp = temp + scala.math.min(source, dest)
                temp = temp + source
                temp = temp + dest
            }
            temp.toList
        }
                    else {
                        graph.vertices.toList
                    }

        /* Retain a copy; I'm going to walk through the full list. */
        val allNodes = nodes

        val distances = new DistanceTable(graph.vertices.toList)
        var total = nodes.size
        var completed = 0

        val dStartTime = System.currentTimeMillis()

        /* Generate the distances table by calculating Dijkstra from all points */
        for (i <- 0 until scala.math.min(total, spinners.size)) {
            spinners(i) ! Dijkstra(nodes.head)
            nodes = nodes.tail
        }

        /* -- Split ------------------------------------------------------------ */
        while(completed < total) {
            receive {
                case DoneDijkstra(origin, d) => {
                    d.keys.foreach(destination => {
                        val distance = d(destination)
                        distances.set(origin, destination, distance)
                    })

                    if (!nodes.isEmpty) {
                        sender ! Dijkstra(nodes.head)
                        nodes = nodes.tail
                    }

                    completed += 1
                }

                case Continue => {
                    if (!nodes.isEmpty) {
                        sender ! Dijkstra(nodes.head)
                        nodes = nodes.tail
                    }

                    completed += 1
                }

                case _ => {
                    System.err.println("2. Error in Master")
                }
            }
        }
        /* -- Join ------------------------------------------------------------- */

        val dEndTime = System.currentTimeMillis()

        /* Output the distances */
        if (args.size == 1) {
            for (line <- Source.fromFile(new java.io.File(args(0))).getLines()) {
                val pair = line.trim.split(" ")
                val source = pair(0).toInt
                val dest = pair(1).toInt
                println(source+" "+dest+" "+distances.dist(source, dest))
            }
        }
        else {
            for (nodeA <- allNodes)
                for (nodeB <- allNodes)
                    println(nodeA +" "+ nodeB +" "+distances.dist(nodeA, nodeB))
        }

        spinners.foreach(s => s ! Terminate)

        println("Took "+(dEndTime - dStartTime)+"ms to run Dijkstra from all locations.")
        exit
    }
}

/* ========== Bootstrap =================================================== */
object ParallelDijkstraTest {
    def main(args: Array[String]) : Unit = {

        val dijkstraGraph = new Graph[Int]()

        val gStartTime = System.currentTimeMillis()
        val lines = Source.fromInputStream(System.in).getLines()
        while (lines.hasNext) {
            val line = lines.next

            val temp = line.trim.split(' ')
            val asnums = temp.slice(0,2).map(str => str.toInt)

            dijkstraGraph.addEdge(asnums(0), asnums(1))
        }
        val gEndTime = System.currentTimeMillis()

        /* Run algorithm. */
        val master = new Master(args, dijkstraGraph)
        master.start()

        /* Output stats. */
        println("Processed graph of "+dijkstraGraph.size+" nodes.")
        println("Took "+(gEndTime - gStartTime)+"ms to read the graph.")
    }
}


text:
module Test(main) where

import System.Environment
import TestGen
import Control.Monad
import Data.Maybe
import Test.QuickCheck

main :: IO ()
main = do
    args <- getArgs
    let count = case args of i:_ -> read i; _ -> 10000
    putStrLn $ "Testing with " ++ show count ++ " repetitions"
    let total = length tests
    let showOutput x = show x{output=""} ++ "\n" ++ output x
    bad <- fmap catMaybes $ forM (zip [1..] tests) $ \(i,(msg,prop)) -> do
        putStrLn $ "Test " ++ show i ++ " of " ++ show total ++ ": " ++ msg
        res <- quickCheckWithResult stdArgs{chatty=False, maxSuccess=count} prop
        case res of
            Success{} -> pure Nothing
            bad -> do putStrLn $ showOutput bad; putStrLn "TEST FAILURE!"; pure $ Just (msg,bad)
    if null bad then
        putStrLn $ "Success, " ++ show total ++ " tests passed"
     else do
        putStrLn $ show (length bad) ++ " FAILURES\n"
        forM_ (zip [1..] bad) $ \(i,(a,b)) ->
            putStrLn $ "FAILURE " ++ show i ++ ": " ++ a ++ "\n" ++ showOutput b ++ "\n"
        fail $ "FAILURE, failed " ++ show (length bad) ++ " of " ++ show total ++ " tests"


text:
//
//  EmailDoCoMoParsedResult.m
//  ZXing
//
//  Created by Christian Brunschen on 28/05/2008.

#import "EmailParsedResult.h"
#import "EmailAction.h"

@implementation EmailParsedResult

@synthesize to;
@synthesize subject;
@synthesize body;

+ (bool) looksLikeAnEmailAddress:(NSString *)s {
  if ([s rangeOfString:@"@"].location == NSNotFound) {
    return false;
  }
  if ([s rangeOfString:@"."].location == NSNotFound) {
    return false;
  }
  if ([s rangeOfCharacterFromSet:[NSCharacterSet whitespaceCharacterSet]].location != NSNotFound) {
    return false;
  }
  return true;
}

- (NSString *)stringForDisplay {
  NSMutableArray *parts = [[NSMutableArray alloc] initWithCapacity:10];
  [parts addObject:[NSString stringWithFormat:NSLocalizedString(@"EmailParsedResult Display: Recipient", @"To: %@"), self.to]];
  if (self.subject) {
    [parts addObject:[NSString stringWithFormat:NSLocalizedString(@"EmailParsedResult Display: Subject", @"Subject: %@"), self.subject]];
  }
  if (self.body) {
    [parts addObject:@""];
    [parts addObject:[NSString stringWithFormat:NSLocalizedString(@"EmailParsedResult Display: Body", @"%@"), self.body]];
  }
  NSString* string = [NSString stringWithString:[parts componentsJoinedByString:@"\n"]];
  [parts release];
  return string;
}

+ (NSString *)typeName {
    return NSLocalizedString(@"EmailParsedResult type name", @"Email");
}

- (NSArray *)actions {
  return [NSArray arrayWithObject:[EmailAction actionWithRecipient:self.to
                                                           subject:self.subject
                                                              body:self.body]];
}

- (UIImage *)icon {
  return [UIImage imageNamed:@"email.png"];
}

@end


text:
   <title>IIMMM</title>
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link href="/css/normalize.css" type="text/css" rel="stylesheet"/>
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/semantic.min.css">
   <link href="/css/style.css" type="text/css" rel="stylesheet"/>

International Institute of Multiscale Materials Modeling

Home

Methods

Downloads

Contact

News

             IIMMM

             Menu

         Back

      Home
      Methods
      Downloads
      Contact


text:
<?php
/**
 * anthonybestdesign functions and definitions
 *
 * @package anthonybestdesign
 */

/**
 * Set the content width based on the theme's design and stylesheet.
 */
if ( ! isset( $content_width ) ) {
	$content_width = 1050; /* pixels */
}

if ( ! function_exists( 'anthonybestdesign_setup' ) ) :
/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which
 * runs before the init hook. The init hook is too late for some features, such
 * as indicating support for post thumbnails.
 */
function anthonybestdesign_setup() {

	/*
	 * Make theme available for translation.
	 * Translations can be filed in the /languages/ directory.
	 * If you're building a theme based on anthonybestdesign, use a find and replace
	 * to change 'anthonybestdesign' to the name of your theme in all the template files
	 */
	load_theme_textdomain( 'anthonybestdesign', get_template_directory() . '/languages' );

	// Add default posts and comments RSS feed links to head.
	add_theme_support( 'automatic-feed-links' );

	/*
	 * Let WordPress manage the document title.
	 * By adding theme support, we declare that this theme does not use a
	 * hard-coded <title> tag in the document head, and expect WordPress to
	 * provide it for us.
	 */
	add_theme_support( 'title-tag' );

	/*
	 * Enable support for Post Thumbnails on posts and pages.
	 *
	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
	 */
	add_theme_support( 'post-thumbnails' );

	// This theme uses wp_nav_menu() in one location.
	register_nav_menus( array(
		'primary' => __( 'Primary Menu', 'anthonybestdesign' ),
                'social'  => __( 'Social Menu', 'anthonynbestdesign'),
	) );

	/*
	 * Switch default core markup for search form, comment form, and comments
	 * to output valid HTML5.
	 */
	add_theme_support( 'html5', array(
		'search-form',
                'comment-form',
                'comment-list',
                'gallery',
                'caption',

	) );

	/*
	 * Enable support for Post Formats.
	 * See http://codex.wordpress.org/Post_Formats
	 */
	add_theme_support( 'post-formats', array( 'aside' ) );

	// Set up the WordPress core custom background feature.
//	add_theme_support( 'custom-background', apply_filters( 'anthonybestdesign_custom_background_args', array(
//		'default-color' => 'ffffff',
//		'default-image' => '',
//	) ) );
}
endif; // anthonybestdesign_setup
add_action( 'after_setup_theme', 'anthonybestdesign_setup' );

/**
 * Register widget area.
 *
 * @link http://codex.wordpress.org/Function_Reference/register_sidebar
 */
function anthonybestdesign_widgets_init() {
	register_sidebar( array(
		'name'          => __( 'Sidebar', 'anthonybestdesign' ),
		'id'            => 'sidebar-1',
		'description'   => '',
		'before_widget' => '',
		'after_widget'  => '',
		'before_title'  => '
',
		'after_title'   => '
',
	) );
}
add_action( 'widgets_init', 'anthonybestdesign_widgets_init' );

/**
 * Enqueue scripts and styles.
 */
function anthonybestdesign_scripts() {
	wp_enqueue_style( 'anthonybestdesign-style', get_stylesheet_uri() );

        wp_enqueue_style( 'anthonybestdesign-fonts', 'anthonybestdesign/fonts/stylesheet.css' );

        wp_enqueue_style( 'anthonybestdesign-fontawesome', 'http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' );

	wp_enqueue_script( 'anthonybestdesign-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );

	wp_enqueue_script( 'anthonybestdesign-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );

        wp_enqueue_script( 'anthonybestdesign-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );

        wp_enqueue_script( 'anthonybestdesign-href', get_template_directory_uri() . '/js/link.js', array(), '20150508', true );

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'anthonybestdesign_scripts' );

/**
 * Implement the Custom Header feature.
 */
require get_template_directory() . '/inc/custom-header.php';

/**
 * Custom template tags for this theme.
 */
require get_template_directory() . '/inc/template-tags.php';

/**
 * Custom functions that act independently of the theme templates.
 */
require get_template_directory() . '/inc/extras.php';

/**
 * Customizer additions.
 */
require get_template_directory() . '/inc/customizer.php';

/**
 * Load Jetpack compatibility file.
 */
require get_template_directory() . '/inc/jetpack.php';


text:
package org.apache.spark.sql.execution.stat

import org.apache.spark.Logging
import org.apache.spark.sql.{Row, Column, DataFrame}
import org.apache.spark.sql.catalyst.expressions.{GenericMutableRow, Cast}
import org.apache.spark.sql.catalyst.plans.logical.LocalRelation
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String

private[sql] object StatFunctions extends Logging {

  /** Calculate the Pearson Correlation Coefficient for the given columns */
  private[sql] def pearsonCorrelation(df: DataFrame, cols: Seq[String]): Double = {
    val counts = collectStatisticalData(df, cols)
    counts.Ck / math.sqrt(counts.MkX * counts.MkY)
  }

  /** Helper class to simplify tracking and merging counts. */
  private class CovarianceCounter extends Serializable {
    var xAvg = 0.0 // the mean of all examples seen so far in col1
    var yAvg = 0.0 // the mean of all examples seen so far in col2
    var Ck = 0.0 // the co-moment after k examples
    var MkX = 0.0 // sum of squares of differences from the (current) mean for col1
    var MkY = 0.0 // sum of squares of differences from the (current) mean for col2
    var count = 0L // count of observed examples
    // add an example to the calculation
    def add(x: Double, y: Double): this.type = {
      val deltaX = x - xAvg
      val deltaY = y - yAvg
      count += 1
      xAvg += deltaX / count
      yAvg += deltaY / count
      Ck += deltaX * (y - yAvg)
      MkX += deltaX * (x - xAvg)
      MkY += deltaY * (y - yAvg)
      this
    }
    // merge counters from other partitions. Formula can be found at:
    // http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
    def merge(other: CovarianceCounter): this.type = {
      if (other.count > 0) {
        val totalCount = count + other.count
        val deltaX = xAvg - other.xAvg
        val deltaY = yAvg - other.yAvg
        Ck += other.Ck + deltaX * deltaY * count / totalCount * other.count
        xAvg = (xAvg * count + other.xAvg * other.count) / totalCount
        yAvg = (yAvg * count + other.yAvg * other.count) / totalCount
        MkX += other.MkX + deltaX * deltaX * count / totalCount * other.count
        MkY += other.MkY + deltaY * deltaY * count / totalCount * other.count
        count = totalCount
      }
      this
    }
    // return the sample covariance for the observed examples
    def cov: Double = Ck / (count - 1)
  }

  private def collectStatisticalData(df: DataFrame, cols: Seq[String]): CovarianceCounter = {
    require(cols.length == 2, "Currently cov supports calculating the covariance " +
      "between two columns.")
    cols.map(name => (name, df.schema.fields.find(_.name == name))).foreach { case (name, data) =>
      require(data.nonEmpty, s"Couldn't find column with name $name")
      require(data.get.dataType.isInstanceOf[NumericType], "Covariance calculation for columns " +
        s"with dataType ${data.get.dataType} not supported.")
    }
    val columns = cols.map(n => Column(Cast(Column(n).expr, DoubleType)))
    df.select(columns: _*).queryExecution.toRdd.aggregate(new CovarianceCounter)(
      seqOp = (counter, row) => {
        counter.add(row.getDouble(0), row.getDouble(1))
      },
      combOp = (baseCounter, other) => {
        baseCounter.merge(other)
    })
  }

  /**
   * Calculate the covariance of two numerical columns of a DataFrame.
   * @param df The DataFrame
   * @param cols the column names
   * @return the covariance of the two columns.
   */
  private[sql] def calculateCov(df: DataFrame, cols: Seq[String]): Double = {
    val counts = collectStatisticalData(df, cols)
    counts.cov
  }

  /** Generate a table of frequencies for the elements of two columns. */
  private[sql] def crossTabulate(df: DataFrame, col1: String, col2: String): DataFrame = {
    val tableName = s"${col1}_$col2"
    val counts = df.groupBy(col1, col2).agg(count("*")).take(1e6.toInt)
    if (counts.length == 1e6.toInt) {
      logWarning("The maximum limit of 1e6 pairs have been collected, which may not be all of " +
        "the pairs. Please try reducing the amount of distinct items in your columns.")
    }
    def cleanElement(element: Any): String = {
      if (element == null) "null" else element.toString
    }
    // get the distinct values of column 2, so that we can make them the column names
    val distinctCol2: Map[Any, Int] =
      counts.map(e => cleanElement(e.get(1))).distinct.zipWithIndex.toMap
    val columnSize = distinctCol2.size
    require(columnSize < 1e4, s"The number of distinct values for $col2, can't " +
      s"exceed 1e4. Currently $columnSize")
    val table = counts.groupBy(_.get(0)).map { case (col1Item, rows) =>
      val countsRow = new GenericMutableRow(columnSize + 1)
      rows.foreach { (row: Row) =>
        // row.get(0) is column 1
        // row.get(1) is column 2
        // row.get(2) is the frequency
        val columnIndex = distinctCol2.get(cleanElement(row.get(1))).get
        countsRow.setLong(columnIndex + 1, row.getLong(2))
      }
      // the value of col1 is the first value, the rest are the counts
      countsRow.update(0, UTF8String.fromString(cleanElement(col1Item)))
      countsRow
    }.toSeq
    // Back ticks can't exist in DataFrame column names, therefore drop them. To be able to accept
    // special keywords and `.`, wrap the column names in ``.
    def cleanColumnName(name: String): String = {
      name.replace("`", "")
    }
    // In the map, the column names (._1) are not ordered by the index (._2). This was the bug in
    // SPARK-8681. We need to explicitly sort by the column index and assign the column names.
    val headerNames = distinctCol2.toSeq.sortBy(_._2).map { r =>
      StructField(cleanColumnName(r._1.toString), LongType)
    }
    val schema = StructType(StructField(tableName, StringType) +: headerNames)

    new DataFrame(df.sqlContext, LocalRelation(schema.toAttributes, table)).na.fill(0.0)
  }
}


text:
package org.bouncycastle.pqc.crypto.lms;

import org.bouncycastle.crypto.Digest;

class SeedDerive
{
    private final byte[] I;
    private final byte[] masterSeed;
    private final Digest digest;
    private int q;
    private int j;

    public SeedDerive(byte[] I, byte[] masterSeed, Digest digest)
    {
        this.I = I;
        this.masterSeed = masterSeed;
        this.digest = digest;
    }

    public int getQ()
    {
        return q;
    }

    public void setQ(int q)
    {
        this.q = q;
    }

    public int getJ()
    {
        return j;
    }

    public void setJ(int j)
    {
        this.j = j;
    }

    public byte[] getI()
    {
        return I;
    }

    public byte[] getMasterSeed()
    {
        return masterSeed;
    }

    public byte[] deriveSeed(byte[] target, int offset)
    {
        if (target.length - offset < digest.getDigestSize())
        {
            throw new IllegalArgumentException("target length is less than digest size.");
        }

        digest.update(I, 0, I.length);
        digest.update((byte)(q >>> 24));
        digest.update((byte)(q >>> 16));
        digest.update((byte)(q >>> 8));
        digest.update((byte)(q));

        digest.update((byte)(j >>> 8));
        digest.update((byte)(j));
        digest.update((byte)0xFF);
        digest.update(masterSeed, 0, masterSeed.length);

        digest.doFinal(target, offset); // Digest resets here.

        return target;
    }

    public void deriveSeed(byte[] target, boolean incJ)
    {
        deriveSeed(target, incJ, 0);
    }

    public void deriveSeed(byte[] target, boolean incJ, int offset)
    {

        deriveSeed(target, offset);

        if (incJ)
        {
            j++;
        }

    }
}


text:
//-----------------------------------------------------------------------
// <copyright file="IDataPortalProxyFactory.cs" company="Marimer LLC">
//     Copyright (c) Marimer LLC. All rights reserved.
//     Website: https://cslanet.com
// </copyright>
// <summary>Creates the DataPortalProxy to use for DataPortal call on the objectType.</summary>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Csla.DataPortalClient
{
  /// <summary>
  ///
  /// </summary>
  public interface IDataPortalProxyFactory
  {
    /// <summary>
    /// Creates the DataPortalProxy to use for DataPortal call on the objectType.
    /// </summary>
    DataPortalClient.IDataPortalProxy Create(Type objectType);

    /// <summary>
    /// Resets the data portal proxy type, so the
    /// next data portal call will reload the proxy
    /// type based on current configuration values.
    /// </summary>
    void ResetProxyType();
  }
}


text:
package fimEntityResolution.statistics;

import il.ac.technion.ie.utils.Utilities;

import java.util.Collection;

public class BlockingResultsSummary {
	double[] pairsCompletenessSummary; //0
	double[] reductionRatioSummary; //1
	double[] modifiedRRSummary;		//2
	double[] f_measureSummary; //3
	double[] modifiedFMeasureSummary; //4
	double blockingThresh;
	long[] timeToRunInSecSummary;
	double[] dedupPrecisionSummary; //5
	double[] dedupRecallSummary; //6
	double[] dedupFSummary; //7

	double[][] resultsSummary;
	double[] runTimeSummary;

	private double getAverage(double[] arr){
		double retval = 0;
		for (double d : arr) {
			retval += d;
		}
		return (retval/arr.length);
	}
	private double getMin(double[] arr){
		double retval = Double.MAX_VALUE;
		for (double d : arr) {
			retval = Math.min(retval,d);
		}
		return retval;
	}

	private double getMax(double[] arr){
		double retval = Double.MIN_VALUE;
		for (double d : arr) {
			retval = Math.max(retval,d);
		}
		return retval;
	}

	private long getAverage(long[] arr){
		long retval = 0;
		for (long d : arr) {
			retval += d;
		}
		return (retval/arr.length);

	}
	private long getMin(long[] arr){
		long retval = Long.MAX_VALUE;
		for (long d : arr) {
			retval = Math.min(retval,d);
		}
		return retval;
	}

	private long getMax(long[] arr){
		long retval = Long.MIN_VALUE;
		for (long d : arr) {
			retval = Math.max(retval,d);
		}
		return retval;
	}

	public String getSummary(){
		StringBuilder sb = new StringBuilder();

		sb.append("Recall - PC summary:").append(Utilities.NEW_LINE);
		sb.append(getMin(resultsSummary[0])).append(" ").append(getAverage(resultsSummary[0])).append(" ")
		.append(getMax(resultsSummary[0])).append(Utilities.NEW_LINE);

		sb.append("Precision - PQ summary:").append(Utilities.NEW_LINE);
		sb.append(getMin(resultsSummary[1])).append(" ").append(getAverage(resultsSummary[1])).append(" ")
		.append(getMax(resultsSummary[1])).append(Utilities.NEW_LINE);

		sb.append("F-measure summary:").append(Utilities.NEW_LINE);
		sb.append(getMin(resultsSummary[2])).append(" ").append(getAverage(resultsSummary[2])).append(" ")
		.append(getMax(resultsSummary[2])).append(Utilities.NEW_LINE);

		sb.append("RR summary:").append(Utilities.NEW_LINE);
		sb.append(getMin(resultsSummary[3])).append(" ").append(getAverage(resultsSummary[3])).append(" ")
		.append(getMax(resultsSummary[3])).append(Utilities.NEW_LINE);

		sb.append("Runtime/secs - summary:").append(Utilities.NEW_LINE);
		sb.append(getMin(runTimeSummary)).append(" ").append(getAverage(runTimeSummary)).append(" ")
		.append(getMax(runTimeSummary));

		return sb.toString();
	}

	public BlockingResultsSummary(Collection<BlockingRunResult> blockingRunResults){
		resultsSummary = new double[4][blockingRunResults.size()];
		runTimeSummary = new double[blockingRunResults.size()];
		int resIndex=0;
		for (BlockingRunResult result : blockingRunResults) {
			double[] asArr = result.asArray();
			for (int i = 3; i < 7; i++) {
				resultsSummary[i-3][resIndex] = asArr[i];
			}
			runTimeSummary[resIndex] = result.getTimeToRunInSec();
			resIndex++;
		}
	}
}


text:
<?php

namespace JoeBengalen\Logger\Test;

use JoeBengalen\Logger\Message;
use Psr\Log\LogLevel;

class MessageTest extends \PHPUnit_Framework_TestCase
{
    public function testEmergencyLevel()
    {
        $level   = LogLevel::EMERGENCY;
        $mess    = 'Emergency level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testAlertLevel()
    {
        $level   = LogLevel::ALERT;
        $mess    = 'Alert level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testCriticalLevel()
    {
        $level   = LogLevel::CRITICAL;
        $mess    = 'Critical level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testErrorLevel()
    {
        $level   = LogLevel::ERROR;
        $mess    = 'Error level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testWarningLevel()
    {
        $level   = LogLevel::WARNING;
        $mess    = 'Warning level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testNoticeLevel()
    {
        $level   = LogLevel::NOTICE;
        $mess    = 'Notice level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testInfoLevel()
    {
        $level   = LogLevel::INFO;
        $mess    = 'Info level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testDebugLevel()
    {
        $level   = LogLevel::DEBUG;
        $mess    = 'Debug level message.';
        $message = new Message($level, $mess);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals([], $message->getContext());
    }

    public function testInvalidLevel()
    {
        $this->setExpectedException('\Psr\Log\InvalidArgumentException');

        $level = 'invalid_level';
        $mess  = 'Invalid level message.';
        new Message($level, $mess);
    }

    public function testContext()
    {
        $level   = LogLevel::DEBUG;
        $mess    = 'Debug level message.';
        $context = [false, true, null, 'string', ['array'], 'key' => 'value'];
        $message = new Message($level, $mess, $context);

        $this->assertEquals($level, $message->getLevel());
        $this->assertEquals($mess, $message->getMessage());
        $this->assertEquals($context, $message->getContext());
    }
}


text:
package org.apache.curator.framework.api;

import java.util.List;

public interface Leaveable<T>
{
    /**
     * Sets one or more servers to leaving the ensemble.
     *
     * @param server The server ids
     * @return this
     */
    T leaving(String... server);

    /**
     * Sets one or more servers to leaving the ensemble.
     *
     * @param servers The server ids
     * @return this
     */
    T leaving(List<String> servers);
}


text:
package org.apache.logging.log4j.core.net;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;

public class UDPSocketServerTest extends AbstractSocketServerTest {
    private static final String PORT = "8199";
    private static final int PORT_NUM = Integer.parseInt(PORT);
    private static UDPSocketServer udpSocketServer;

    private static Thread thread;

    @BeforeClass
    public static void setupClass() throws Exception {
        ((LoggerContext) LogManager.getContext(false)).reconfigure();
        udpSocketServer = new UDPSocketServer(PORT_NUM);
        thread = new Thread(udpSocketServer);
        thread.start();
    }

    @AfterClass
    public static void tearDownClass() {
        udpSocketServer.shutdown();
        try {
            thread.join();
        } catch (final InterruptedException e) {
            // ignore
        }
    }

    public UDPSocketServerTest() {
        super("udp", PORT, true);
    }

}


text:
package com.omnicrola.hermes.db;

/**
 * Created by Eric on 9/3/2015.
 */
public interface IDatabaseConnection {

}


text:
package de.passau.uni.sec.compose.id.core.persistence.entities;

import javax.persistence.*;

import java.util.Collection;
import java.util.LinkedList;

@Entity
public class ServiceSourceCode extends AbstractEntity implements CoreEntity{

    @Column
    private String name;

    @Column
    private String version;

    @ManyToOne
    @JoinColumn(name = "developer_fk")
    private User developer;

    @OneToMany(mappedBy = "serviceSourceCode", cascade = CascadeType.ALL)
    Collection<EntityGroupMembership> groups = new LinkedList<>();

    @OneToMany(mappedBy = "serviceSourceCode", cascade = CascadeType.ALL)
    Collection<AttributeValue> attributes = new LinkedList<>();

    @Column
    private int reputation;

    @Column
    private boolean payment;

    @Column
    private boolean visible;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public User getDeveloper() {
        return developer;
    }

    public void setDeveloper(User developer) {
        this.developer = developer;
    }

    public Collection<EntityGroupMembership> getGroups() {
		return groups;
	}

	public void setGroups(Collection<EntityGroupMembership> groups) {
		this.groups = groups;
	}

	public int getReputation() {
        return reputation;
    }

    public void setReputation(int reputation) {
        this.reputation = reputation;
    }

    public boolean isPayment() {
        return payment;
    }

    public void setPayment(boolean payment) {
        this.payment = payment;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public Collection<AttributeValue> getAttributes() {
		return attributes;
	}

	public void setAttributes(Collection<AttributeValue> attributes) {
		this.attributes = attributes;
	}

	@Override
	public User getOwner() {
		return developer;
	}
}


text:
package gov.hhs.onc.dcdt.config.instance;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import gov.hhs.onc.dcdt.beans.ToolConnectionBean;
import gov.hhs.onc.dcdt.config.instance.impl.InstanceLdapConfigImpl;
import gov.hhs.onc.dcdt.ldap.LdapTransportProtocol;
import org.apache.directory.api.ldap.model.entry.Entry;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.ldap.client.api.LdapConnectionConfig;

@JsonSubTypes({ @Type(InstanceLdapConfigImpl.class) })
public interface InstanceLdapConfig extends ToolConnectionBean<LdapTransportProtocol> {
    public LdapConnectionConfig toConnectionConfigAdmin();

    public LdapConnectionConfig toConnectionConfigAnonymous();

    public InstanceLdapCredentialConfig getCredentialConfigAdmin();

    public void setCredentialConfigAdmin(InstanceLdapCredentialConfig credConfigAdmin);

    public InstanceLdapCredentialConfig getCredentialConfigAnonymous();

    public void setCredentialConfigAnonymous(InstanceLdapCredentialConfig credConfigAnon);

    public Entry getDataPartitionContextEntry();

    public void setDataPartitionContextEntry(Entry dataPartitionContextEntry);

    public String getDataPartitionId();

    public void setDataPartitionId(String dataPartitionId);

    public Dn getDataPartitionSuffix();

    public void setDataPartitionSuffix(Dn dataPartitionSuffix);

    public String getServerId();

    public void setServerId(String serverId);

    @JsonProperty("transportProtocol")
    @Override
    public LdapTransportProtocol getTransportProtocol();
}


text:
require 'phdb/aws_utils'

class MemberMapRunner
  include AWSUtils

  # SERIALS report for Miami
  def make_miami_report(infilen, outfilen)
    memberlist = ['miami', 'ufl']
    total_count = 0
    export_count = 0
    total_miami = total_ufl = total_ht = 0
    f = File.open(infilen, "r")
    outf = File.open(outfilen, "w")
    outf.puts("OCN\tUMiami\tUFlorida\tHathiTrust\n")
    f.each_line { |line|
      record = parse_record(line)
      next if record == nil
      raise "[pull_memberlist] 'memberlist' must be an Array" unless memberlist.kind_of? Array
      next unless record.types.include?('serial')
      intersection = memberlist & record.member_ids
      if intersection.length > 0
        miami_toggle = ufl_toggle = hathi_toggle = '0'
        if record.member_ids.include?('miami')
          miami_toggle = '1'
        elsif record.member_ids.include?('ufl')
          ufl_toggle = '1'
        elsif record.member_ids.include?('HATHI')
          hathi_toggle = '1'
        end
        outstr = "#{record.oclc}\t#{miami_toggle}\t#{ufl_toggle}\t#{hathi_toggle}"
      outf.puts(outstr)
      export_count += 1
      end
      total_count += 1
      puts total_count if total_count % 100000 == 0
    }
    puts "\n#{total_count} lines parsed."
    puts "#{export_count} records exported."
    outf.close
    f.close
  end
end

infile = ARGV[0]
outfile = ARGV[1]

mmr = MemberMapRunner.new

mmr.make_miami_report(infile, outfile)
puts "done."


text:
namespace Valve.VR
{
    using System;
    using UnityEngine;

    public partial class SteamVR_Actions
    {

        private static SteamVR_Input_ActionSet_default p__default;

        private static SteamVR_Input_ActionSet_platformer p_platformer;

        private static SteamVR_Input_ActionSet_buggy p_buggy;

        private static SteamVR_Input_ActionSet_mixedreality p_mixedreality;

        private static SteamVR_Input_ActionSet_starcatchercontroller p_starcatchercontroller;

        public static SteamVR_Input_ActionSet_default _default
        {
            get
            {
                return SteamVR_Actions.p__default.GetCopy<SteamVR_Input_ActionSet_default>();
            }
        }

        public static SteamVR_Input_ActionSet_platformer platformer
        {
            get
            {
                return SteamVR_Actions.p_platformer.GetCopy<SteamVR_Input_ActionSet_platformer>();
            }
        }

        public static SteamVR_Input_ActionSet_buggy buggy
        {
            get
            {
                return SteamVR_Actions.p_buggy.GetCopy<SteamVR_Input_ActionSet_buggy>();
            }
        }

        public static SteamVR_Input_ActionSet_mixedreality mixedreality
        {
            get
            {
                return SteamVR_Actions.p_mixedreality.GetCopy<SteamVR_Input_ActionSet_mixedreality>();
            }
        }

        public static SteamVR_Input_ActionSet_starcatchercontroller starcatchercontroller
        {
            get
            {
                return SteamVR_Actions.p_starcatchercontroller.GetCopy<SteamVR_Input_ActionSet_starcatchercontroller>();
            }
        }

        private static void StartPreInitActionSets()
        {
            SteamVR_Actions.p__default = ((SteamVR_Input_ActionSet_default)(SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_default>("/actions/default")));
            SteamVR_Actions.p_platformer = ((SteamVR_Input_ActionSet_platformer)(SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_platformer>("/actions/platformer")));
            SteamVR_Actions.p_buggy = ((SteamVR_Input_ActionSet_buggy)(SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_buggy>("/actions/buggy")));
            SteamVR_Actions.p_mixedreality = ((SteamVR_Input_ActionSet_mixedreality)(SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_mixedreality>("/actions/mixedreality")));
            SteamVR_Actions.p_starcatchercontroller = ((SteamVR_Input_ActionSet_starcatchercontroller)(SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_starcatchercontroller>("/actions/starcatchercontroller")));
            Valve.VR.SteamVR_Input.actionSets = new Valve.VR.SteamVR_ActionSet[] {
                    SteamVR_Actions._default,
                    SteamVR_Actions.platformer,
                    SteamVR_Actions.buggy,
                    SteamVR_Actions.mixedreality,
                    SteamVR_Actions.starcatchercontroller};
        }
    }
}


text:
package java.util.logging;

public class SocketHandler
  extends StreamHandler{
  // Constructors

  public SocketHandler() throws java.io.IOException{
    super();
  }
  public SocketHandler(java.lang.String arg1, int arg2) throws java.io.IOException{
    super();
  }
  // Methods

  public void close(){
  }
  public void publish(LogRecord arg1){
  }
}


text:
import { createElement } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import { actions } from 'components/anchor-nav';
import { actions as modalActions } from 'components/modal-metadata';

import { handleInfoMetadataClick } from 'components/country/country-utils';

import {
  getCountryName,
  getDescriptionText,
  getLegacyDescriptionText,
  getEmissionProviderFilters,
  getCardData,
  getLoading,
  getCountryIndicators
} from './country-header-selectors';

import Component from './country-header-component';

const FEATURE_COUNTRY_CHANGES = process.env.FEATURE_COUNTRY_CHANGES === 'true';

const mapStateToProps = (state, { match }) => {
  const iso = match.params.iso;
  const { data } = state.socioeconomics;
  const stateWithIso = {
    iso,
    countries: state.countries,
    socioeconomics: data ? data[iso] : {},
    ...state
  };

  return {
    country: {
      iso,
      name: getCountryName(stateWithIso)
    },
    loading: getLoading(stateWithIso),
    description: FEATURE_COUNTRY_CHANGES
      ? getDescriptionText(stateWithIso)
      : getLegacyDescriptionText(stateWithIso),
    emissionProviderFilters: getEmissionProviderFilters(stateWithIso),
    cardData: getCardData(stateWithIso),
    indicators: getCountryIndicators(stateWithIso)
  };
};

const CountryHeader = props => {
  const { setModalMetadata, indicators } = props;
  const handleInfoClick = slug =>
    handleInfoMetadataClick(
      slug,
      'Country Header',
      indicators,
      setModalMetadata
    );
  return createElement(Component, { ...props, handleInfoClick });
};

export default withRouter(
  connect(mapStateToProps, { ...actions, ...modalActions })(CountryHeader)
);


text:
Hybrid
======

A hybrid application that contains social-network Apps(HTML5) like Facebook, Twitter, Sina-Weibo, QQ-Weibeo in a WebView.  Users do not have to afford the risk that some nativ Apps will read private data or invade privacy. App provides basic functions to share text and attachments(media, image etc). It is a light way to share in social instead of installing a complex nativ App.

Last Update
======
22.08.2014:

 - Update new Bootstrap (inc. EventBus, new Error-handling system etc.)
 - Renamed BaseActivity to BasicActivity.
 - Removed old event-handlers for Otto-bus instead that moved all event-handlers onto base activity.

20.07.2014:

 - Removed code for net-communication, configuration's loading. Instead these it use now [Chopping-Bootstrap](https://github.com/XinyueZ/Chopping) to do these.

Oldest

1. Built in App's configuration.
2. Url to the Web-App and App-List are read from configuration.
3. Basic UI etc.


text:
package org.morozko.java.mod.db;

import org.morozko.java.core.cfg.BaseModuleVersion;

public class DbModuleVersion extends BaseModuleVersion {

	public static final String NAME = "Module Db";
	public static final String VERSION = "1.0.5";
	public static final String DATE = "2016-07-06";
	public static final String DEPENDANCIES = "/org/morozko/java/mod/db/dependancies.properties";

	public DbModuleVersion() {
		super( NAME, VERSION, DATE, DEPENDANCIES );
	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Can. J. Bot. 36: 780 (1958)

#### Original name
Podosporium grande Cooke

### Remarks
null