text:
package org.drools.compiler.integrationtests.operators;

import java.util.ArrayList;
import java.util.List;
import org.drools.compiler.CommonTestMethodBase;
import org.drools.compiler.PersonWithEquals;
import org.drools.compiler.Primitives;
import org.drools.compiler.integrationtests.SerializationHelper;
import org.junit.Test;
import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;

public class EqualsTest extends CommonTestMethodBase {

    @Test
    public void testEqualitySupport() throws Exception {
        final KieBase kbase = SerializationHelper.serializeObject(loadKnowledgeBase("test_equalitySupport.drl"));
        final KieSession ksession = createKnowledgeSession(kbase);

        final List results = new ArrayList();
        ksession.setGlobal("results", results);

        PersonWithEquals person = new PersonWithEquals("bob", 30);
        ksession.insert(person);
        ksession.fireAllRules();

        assertEquals(1, results.size());
        assertEquals("mark", results.get(0));

    }

    @Test
    public void testNotEqualsOperator() {
        // JBRULES-3003: restriction evaluation returns 'false' for "trueField != falseField"

        final String str = "package org.drools.compiler\n" +
                "rule NotEquals\n" +
                "when\n" +
                "    Primitives( booleanPrimitive != booleanWrapper )\n" +
                "then\n" +
                "end";

        final KieBase kbase = loadKnowledgeBaseFromString(str);
        final KieSession ksession = createKnowledgeSession(kbase);

        final Primitives p = new Primitives();
        p.setBooleanPrimitive(true);
        p.setBooleanWrapper(Boolean.FALSE);

        ksession.insert(p);

        final int rules = ksession.fireAllRules();
        ksession.dispose();

        assertEquals(1, rules);
    }

    @Test
    public void testCharComparisons() throws Exception {
        final KieBase kbase = SerializationHelper.serializeObject(loadKnowledgeBase("test_charComparisons.drl"));
        final KieSession ksession = createKnowledgeSession(kbase);

        final List results = new ArrayList();
        ksession.setGlobal("results", results);

        Primitives p1 = new Primitives();
        p1.setCharPrimitive('a');
        p1.setStringAttribute("b");
        Primitives p2 = new Primitives();
        p2.setCharPrimitive('b');
        p2.setStringAttribute("a");

        ksession.insert(p1);
        ksession.insert(p2);

        ksession.fireAllRules();

        assertEquals(3, results.size());
        assertEquals("1", results.get(0));
        assertEquals("2", results.get(1));
        assertEquals("3", results.get(2));

    }
}


text:
#import "ACEDrawingTools.h"

@protocol ACEDrawingTool;

@interface ACEDrawingToolState : NSObject

+ (instancetype)stateForTool:(id<ACEDrawingTool>)tool;
+ (instancetype)stateForTool:(id<ACEDrawingTool>)tool capturePosition:(BOOL)capture;

@property (nonatomic, readonly) id<ACEDrawingTool> tool;

@property (nonatomic, readonly) BOOL hasPositionObject;
@property (nonatomic, readonly) id positionObject;

@end

redpajama_set_name: RedPajamaGithub


text:
from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
from webkitpy.tool import steps

class PrettyDiff(AbstractSequencedCommand):
    name = "pretty-diff"
    help_text = "Shows the pretty diff in the default browser"
    show_in_main_help = True
    steps = [
        steps.ConfirmDiff,
    ]


text:
package org.opentosca.toscana.api.docs;

import java.util.Objects;

import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SuppressWarnings({"unchecked", "Guava"})
@Configuration
@EnableSwagger2
public class SwaggerConfig {

    private final ApiContents apiContents;

    @Autowired
    public SwaggerConfig(ApiContents apiContents) {
        this.apiContents = apiContents;
    }

    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(getPaths())
            .build();
    }

    @Bean
    public ApiInfo apiInfo() {
        return new ApiInfoBuilder()
            .title(apiContents.title)
            .license(apiContents.license)
            .licenseUrl(apiContents.licence_url)
            .version(apiContents.version)
            .description(apiContents.description)
            .contact(new Contact("", apiContents.source_url, ""))
            .build();
    }

    private Predicate<String> getPaths() {
        return Predicates.or(
            s -> Objects.equals(s, "/api/status"),
            PathSelectors.ant("/api/platforms/**"),
            PathSelectors.ant("/api/csars/**"),
            PathSelectors.ant("/api/*")
        );
    }
}


text: The plugin troubleshooting docs were moved to docs.fastlane.tools


text:
<?xml version="1.0" encoding="utf-8"?>
<CrawlItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Text>dostava je kasnila 15tak minuta, ali hrana je dosla vruca. Porcije su velike i jako je ukusna hrana. Preporucam :D</Text>
  <Rating>6</Rating>
  <Source>http://pauza.hr/menu/halo-maksimirski-zmaj</Source>
</CrawlItem>


text:
class Dog:
    def __init__(self, breed):
        self.breed = breed

    @staticmethod
    def bark():
        return 'Woof'


text:
<?php
/**
 * File Contiaing the USer Model Specs Class
 *
 * @category Mongologue
 * @package  Tests
 * @author   @kpnunni <krishnanunni@suyati.com>
 * @license  none http://suyati.com
 * @link     http://github.com/xait/docxwriter
 */
namespace Mongologue\Models;

use \Mongologue\Exception;

/**
 * Test Cases for the User Model
 *
 * @todo implement testcases for follow, group functions
 *
 * @category Mongologue
 * @package  Tests
 * @author   @kpnunni <krishnanunni@suyati.com>
 * @license  none http://suyati.com
 * @link     http://github.com/xait/docxwriter
 */
class UserModelSpec extends \PHPUnit_Framework_TestCase
{
    /**
     * Check Instantiation with BAD/Insufficient Data
     *
     * @param mixed $userData Bad User Data
     *
     * @test
     *
     * @dataProvider providerInvalidUserData
     * @expectedException Exception
     * @return void
     */
    public function shouldThrowExceptionIfAllUserDataIsNotProvided($userData)
    {
        $user = new User($userData);
    }

    /**
     * Check if Valid Data is Accepted and Document formation is as expected
     *
     * @param array $userData         UserData
     * @param array $expectedDocument Expected Document
     *
     * @test
     *
     * @dataProvider providerForValidData
     * @return void
     */
    public function shouldAcceptValidUserDataAndMustReturnProperDocumentArray($userData, $expectedDocument)
    {
        $user = new User($userData);
        $this->assertEquals($expectedDocument, $user->document());
        $this->assertEquals(array(), $user->followers);
    }

    /**
     * Provider for Valid USer Data
     *
     * @return array Valid USer Data
     */
    public function providerForValidData()
    {
        return array(
            array(
                array(
                    "id" => 21,
                    "handle" => "feynman",
                    "firstName" => "Richard",
                    "lastName" => "FeynMan",
                    "email" => "r@x.com",
                    "pic" => "htpp://kl.com/pic.jpeg"
                ),
                array(
                    "id" => 21,
                    "handle" => "feynman",
                    "firstName" => "Richard",
                    "lastName" => "FeynMan",
                    "email" => "r@x.com",
                    "pic" => "htpp://kl.com/pic.jpeg",
                    "following" => array(),
                    "followers" => array(),
                    "groups" => array(),
                    "blocking" => array(),
                    "blockers" => array(),
                    "postUnfollowing" => array(),
                    "followingGroups" => array(),
                    "likes" => array(),
                    "profilePics" => array(),
                    "data" => array()
                )
            ),
            array(
                array(
                    "id" => 22,
                    "handle" => "tim",
                    "firstName" => "Tim",
                    "lastName" => "Henford",
                    "following" => array(21),
                    "pic" => "someurl.com",
                    "email" => "a@b.com",
                    "groups" => array(33),
                    "data" => array("userPages"=>array("A", "B"))
                ),
                array(
                    "id" => 22,
                    "handle" => "tim",
                    "firstName" => "Tim",
                    "lastName" => "Henford",
                    "email" => "a@b.com",
                    "pic" => "someurl.com",
                    "following" => array(21),
                    "followers" => array(),
                    "groups" => array(33),
                    "blocking" => array(),
                    "blockers" => array(),
                    "postUnfollowing" => array(),
                    "followingGroups" => array(),
                    "likes" => array(),
                    "profilePics" => array(),
                    "data" => array("userPages"=>array("A", "B"))
                )
            ),
        );
    }

    /**
     * Providef for bad user data
     *
     * @return array Bad User Data
     */
    public function providerInvalidUserData()
    {
        return array(
            array("hello"),
            array(array("id"=>1,"handle"=>"bokkumo","firstName"=>'MEH')),
            array(array("id"=>1,"firstName"=>'MEH'))
        );
    }
}


text:
package org.junit.contrib.truth.extensiontest;

import static org.junit.contrib.truth.extensiontest.ExtendedVerb.ASSERT;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * A test that's more or less intended to show how one uses an extended verb.
 *
 * @author David Saff
 * @author Christian Gruber (cgruber@israfil.net)
 */
@RunWith(JUnit4.class)
public class ExtensionTest {
  @Test public void customTypeCompares() {
    ASSERT.that(new MyType(5)).matches(new MyType(2 + 3));
  }
}


text:
onmessage = function() {
  postMessage("loaded bad file");
}


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

namespace Northwind.Common.DataModel
{
	public static class NorthwindFactory
	{
		public static readonly List<Type> ModelTypes = new List<Type> {
			typeof(Employee),
			typeof(Category),
			typeof(Customer),
			typeof(Shipper),
			typeof(Supplier),
			typeof(Order),
			typeof(Product),
			typeof(OrderDetail),
			typeof(CustomerCustomerDemo),
			typeof(Category),
			typeof(CustomerDemographic),
			typeof(Region),
			typeof(Territory),
			typeof(EmployeeTerritory),
		};

		public static Category Category(int id, string categoryName, string description, byte[] picture)
		{
			return new Category {
				Id = id,
				CategoryName = categoryName,
				Description = description,
				Picture = picture
			};
		}

		public static Customer Customer(
			string customerId, string companyName, string contactName, string contactTitle,
			string address, string city, string region, string postalCode, string country,
			string phoneNo, string faxNo,
			byte[] picture)
		{
			return new Customer {
				Id = customerId,
				CompanyName = companyName,
				ContactName = contactName,
				ContactTitle = contactTitle,
				Address = address,
				City = city,
				Region = region,
				PostalCode = postalCode,
				Country = country,
				Phone = phoneNo,
				Fax = faxNo,
				Picture = picture
			};
		}

		public static Employee Employee(
			int employeeId, string lastName, string firstName, string title,
			string titleOfCourtesy, DateTime? birthDate, DateTime? hireDate,
			string address, string city, string region, string postalCode, string country,
			string homePhone, string extension,
			byte[] photo,
			string notes, int? reportsTo, string photoPath)
		{
			return new Employee {
				Id = employeeId,
				LastName = lastName,
				FirstName = firstName,
				Title = title,
				TitleOfCourtesy = titleOfCourtesy,
				BirthDate = birthDate,
				HireDate = hireDate,
				Address = address,
				City = city,
				Region = region,
				PostalCode = postalCode,
				Country = country,
				HomePhone = homePhone,
				Extension = extension,
				Photo = photo,
				Notes = notes,
				ReportsTo = reportsTo,
				PhotoPath = photoPath,
			};
		}

		public static Shipper Shipper(int id, string companyName, string phoneNo)
		{
			return new Shipper {
				Id = id,
				CompanyName = companyName,
				Phone = phoneNo,
			};
		}

		public static Supplier Supplier(
			int supplierId, string companyName, string contactName, string contactTitle,
			string address, string city, string region, string postalCode, string country,
			string phoneNo, string faxNo,
			string homePage)
		{
			return new Supplier {
				Id = supplierId,
				CompanyName = companyName,
				ContactName = contactName,
				ContactTitle = contactTitle,
				Address = address,
				City = city,
				Region = region,
				PostalCode = postalCode,
				Country = country,
				Phone = phoneNo,
				Fax = faxNo,
				HomePage = homePage
			};
		}

		public static Order Order(
			int orderId, string customerId, int employeeId, DateTime? orderDate, DateTime? requiredDate,
			DateTime? shippedDate, int shipVia, decimal freight, string shipName,
			string address, string city, string region, string postalCode, string country)
		{
			return new Order {
				Id = orderId,
				CustomerId = customerId,
				EmployeeId = employeeId,
				OrderDate = orderDate,
				RequiredDate = requiredDate,
				ShippedDate = shippedDate,
				ShipVia = shipVia,
				Freight = freight,
				ShipName = shipName,
				ShipAddress = address,
				ShipCity = city,
				ShipRegion = region,
				ShipPostalCode = postalCode,
				ShipCountry = country,
			};
		}

		public static Product Product(
			int productId, string productName, int supplierId, int categoryId,
			string qtyPerUnit, decimal unitPrice, short unitsInStock,
			short unitsOnOrder, short reorderLevel, bool discontinued)
		{
			return new Product {
				Id = productId,
				ProductName = productName,
				SupplierId = supplierId,
				CategoryId = categoryId,
				QuantityPerUnit = qtyPerUnit,
				UnitPrice = unitPrice,
				UnitsInStock = unitsInStock,
				UnitsOnOrder = unitsOnOrder,
				ReorderLevel = reorderLevel,
				Discontinued = discontinued,
			};
		}

		public static OrderDetail OrderDetail(
			int orderId, int productId, decimal unitPrice, short quantity, double discount)
		{
			return new OrderDetail {
				OrderId = orderId,
				ProductId = productId,
				UnitPrice = unitPrice,
				Quantity = quantity,
				Discount = discount,
			};
		}

		public static CustomerCustomerDemo CustomerCustomerDemo(
			string customerId, string customerTypeId)
		{
			return new CustomerCustomerDemo {
				Id = customerId,
				CustomerTypeId = customerTypeId,
			};
		}

		public static Region Region(
			int regionId, string regionDescription)
		{
			return new Region {
				Id = regionId,
				RegionDescription = regionDescription,
			};
		}

		public static Territory Territory(
			string territoryId, string territoryDescription, int regionId)
		{
			return new Territory {
				Id = territoryId,
				TerritoryDescription = territoryDescription,
				RegionId = regionId,
			};
		}

		public static EmployeeTerritory EmployeeTerritory(
			int employeeId, string territoryId)
		{
			return new EmployeeTerritory {
				EmployeeId = employeeId,
				TerritoryId = territoryId,
			};
		}

	}
}


text:
require 'rails_helper'

RSpec.describe Api::V1::ContributorPresenter do
  describe '#role_as_uri' do
    it 'returns nil if the plans_contributor role is nil' do
      uri = described_class.role_as_uri(role: nil)
      expect(uri).to be_nil
    end

    it 'returns the correct URI' do
      uri = described_class.role_as_uri(role: 'data_curation')
      expect(uri.start_with?('http')).to be(true)
      expect(uri.end_with?('data-curation')).to be(true)
    end
  end

  describe '#contributor_id' do
    before do
      @contributor = create(:contributor, investigation: true, plan: create(:plan))
      create(:identifier, identifiable: @contributor)
      @contributor.reload
    end

    it 'returns nil if no ORCID exists' do
      rslt = described_class.contributor_id(identifiers: @contributor.identifiers)
      expect(rslt).to be_nil
    end

    it 'returns the ORCID' do
      scheme = create(:identifier_scheme, name: 'orcid')
      orcid = create(:identifier, identifier_scheme: scheme, identifiable: @contributor)
      @contributor.reload
      rslt = described_class.contributor_id(identifiers: @contributor.identifiers)
      expect(rslt).to eql(orcid)
    end
  end
end


text:
import time
from mysql_interface import MySQLStats
from aws_interface import AWSStats
import daemon, os, lockfile,signal
import logging
from config import *

logger = logging.getLogger("PowerCollector")

logger.setLevel(dict_setup["loglevel"])

try:
    dict_setup["logfile"]
    handler = logging.FileHandler(dict_setup["logfile"])
except:
    handler = logging.StreamHandler()

formatter = logging.Formatter('%(levelname)s:%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)

def aws():
    logger.debug("Running AWSStats...")
    aws_interface = AWSStats()
    aws_interface.sentStats()

def mysql():
    logger.debug("Running MySQLStats...")
    my_interface = MySQLStats(login=dict_setup["dblogin"], password=dict_setup["dbpassword"],
                              host=dict_setup["dbendpoint"])
    my_interface.sentStats()

def collector():
    logger.info("Starting Power Collector...")
    while True:
        aws()
        mysql()
        time.sleep(dict_setup["metric_sent_cicle_time_seconds"])

def run():
    context = daemon.DaemonContext(
                    working_directory=os.getcwd(),
                    pidfile=lockfile.FileLock(dict_setup['pidfile']),
                    umask=0o002)

    with context:
        collector()

if __name__ == "__main__":
    logger.debug("Starting...")
    collector()


text:
{% extends 'templates/nhs_transaction_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}

{% block content %}

Back

You get full help with health costs

Because you are named on a NHS Tax Credit Exemption Certificate you, your partner and any young people under 20 included on your Tax Credit claim get free:

        NHS Prescriptions,

        NHS Dental treatment,

        Sight tests,

        NHS wigs and fabric supports.

          You'll also:

        Get help towards the cost of glasses or contact lenses,

        May get help towards the cost of repair or replacement of glasses or contact lenses,

        May get help with travel costs for NHS treatment.

You may have to show your health care professional your NHS Tax Credit Exemption Certificate.

  What does a NHS Tax Credit Exemption Certificate look like?

{% endblock %}


text:
@interface PhotoDetailsViewController () <UITableViewDataSource, UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation PhotoDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.tableView.dataSource = self;
    self.tableView.delegate = self;

    self.tableView.rowHeight = 200;

    UINib *photoCellNib = [UINib nibWithNibName:@"PhotoTableViewCell" bundle:nil];
    [self.tableView registerNib:photoCellNib forCellReuseIdentifier:@"PhotoTableViewCell"];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    PhotoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PhotoTableViewCell" forIndexPath:indexPath];

    NSString *url = [self.instagram valueForKeyPath:@"images.standard_resolution.url"];

    [cell.photoView setImageWithURL:[NSURL URLWithString:url]];

    return cell;

}

@end


text:
<?php
namespace Kdde\EdbStoreBundle\Entity;

use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\Column;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="icvr")
 */
class Icvr {

	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer",name="id_edizione")
	 * @ORM\GeneratedValue(strategy="AUTO")
	 * @var unknown_type
	 */
	protected $id;

	/**
	 * @ORM\Column(type="string", length=4, name="corpus")
	 * @var unknown_type
	 */
	protected $corpus = 'ICVR';

	/**
	 * @ORM\Column(type="string", length=5, name="volume")
	 * @var unknown_type
	 */
	protected $volume = 'ICVR';

	public function __construct(){

	}

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set corpus
     *
     * @param string $corpus
     */
    public function setCorpus($corpus)
    {
        $this->corpus = $corpus;
    }

    /**
     * Get corpus
     *
     * @return string
     */
    public function getCorpus()
    {
        return $this->corpus;
    }

    /**
     * Set volume
     *
     * @param string $volume
     */
    public function setVolume($volume)
    {
        $this->volume = $volume;
    }

    /**
     * Get volume
     *
     * @return string
     */
    public function getVolume()
    {
        return $this->volume;
    }

    public function __toString(){
    	return $this->volume;
    }
}


text:
package XML::Handler::Sample;

use vars qw{ $AUTOLOAD };

sub new {
    my $type = shift;
    my $self = ( $#_ == 0 ) ? shift : { @_ };

    return bless $self, $type;
}

# Basic PerlSAX
sub start_document            { print "start_document\n"; }
sub end_document              { print "end_document\n"; }
sub start_element             { print "start_element\n"; }
sub end_element               { print "end_element\n"; }
sub characters                { print "characters\n"; }
sub processing_instruction    { print "processing_instruction\n"; }
sub ignorable_whitespace      { print "ignorable_whitespace\n"; }

# Additional expat callbacks in XML::Parser::PerlSAX
sub comment                   { print "comment\n"; }
sub notation_decl             { print "notation_decl\n"; }
sub unparsed_entity_decl      { print "unparsed_entity_decl\n"; }
sub entity_decl               { print "entity_decl\n"; }
sub element_decl              { print "element_decl\n"; }
sub doctype_decl              { print "doctype_decl\n"; }
sub xml_decl                  { print "xml_decl\n"; }

# Additional SP/nsgmls callbacks in XML::ESISParser
sub start_subdoc              { print "start_subdoc\n"; }
sub end_subdoc                { print "start_subdoc\n"; }
sub appinfo                   { print "appinfo\n"; }
sub internal_entity_ref       { print "sdata\n"; }
sub external_entity_ref       { print "sdata\n"; }
sub record_end                { print "record_end\n"; }
sub internal_entity_decl      { print "internal_entity_decl\n"; }
sub external_entity_decl      { print "external_entity_decl\n"; }
sub external_sgml_entity_decl { print "external_sgml_entity_decl\n"; }
sub subdoc_entity_decl        { print "subdoc_entity_decl\n"; }
sub notation                  { print "notation\n"; }
sub error                     { print "error\n"; }
sub conforming                { print "conforming\n"; }

# Others
sub AUTOLOAD {
    my $self = shift;

    my $method = $AUTOLOAD;
    $method =~ s/.*:://;
    return if $method eq 'DESTROY';

    print "UNRECOGNIZED $method\n";
}

1;

__END__

=head1 NAME

XML::Handler::Sample - a trivial PerlSAX handler

=head1 SYNOPSIS

 use XML::Parser::PerlSAX;
 use XML::Handler::Sample;

 $my_handler = XML::Handler::Sample->new;

 XML::Parser::PerlSAX->new->parse(Source => { SystemId => 'REC-xml-19980210.xml' },
                                  Handler => $my_handler);

=head1 DESCRIPTION

C<XML::Handler::Sample> is a trivial PerlSAX handler that prints out
the name of each event it receives.  The source for
C<XML::Handler::Sample> lists all the currently known PerlSAX
handler methods.

C<XML::Handler::Sample> is intended for Perl module authors who wish
to look at example PerlSAX handler modules.  C<XML::Handler::Sample>
can be used as a template for writing your own PerlSAX handler
modules.  C<XML::Handler::Sample> is in the Public Domain and can be
used for any purpose without restriction.

=head1 AUTHOR

Ken MacLeod, ken@bitsko.slc.ut.us

=head1 SEE ALSO

perl(1), PerlSAX.pod(3)

=cut


text:
<?php

namespace PHPExiftool\Driver\Tag\NikonCustom;

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

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

    protected $Id = '2.2';

    protected $Name = 'CenterFocusPoint';

    protected $FullName = 'NikonCustom::SettingsD90';

    protected $GroupName = 'NikonCustom';

    protected $g0 = 'MakerNotes';

    protected $g1 = 'NikonCustom';

    protected $g2 = 'Camera';

    protected $Type = 'int8u';

    protected $Writable = true;

    protected $Description = 'Center Focus Point';

    protected $flag_Permanent = true;

    protected $Values = array(
        0 => array(
            'Id' => 0,
            'Label' => 'Normal Zone',
        ),
        16 => array(
            'Id' => 16,
            'Label' => 'Wide Zone',
        ),
    );

}


text:
<?php

namespace Tests\Flow\Directives;

use Tests\Unit;

class IncludeTest extends Unit
{

    public function testInclude()
    {

        $message = 'Hello World';

        $include = <<<code
                {{ message }}
code;

        $this->eval($include, [
            'message' => 'None'
        ]);

        $code = <<<code
    {% include '{$this->folder}:{$this->lastView}' %}
code;

        $this->assertSame(
            $this->eval($code, [
                'message' => $message
            ]),

            $message
        );

    }

}


text:
{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module     : Numeric.LinearAlgebra.Matrix.Tri
-- Copyright  : Copyright (c) 2010, Patrick Perry <patperry@gmail.com>
-- License    : BSD3
-- Maintainer : Patrick Perry <patperry@gmail.com>
-- Stability  : experimental
--
-- Triangular views of matrices.
--

module Numeric.LinearAlgebra.Matrix.Tri (
    -- * Immutable interface

    -- ** Vector multiplication
    triMulVector,

    -- ** Matrix multiplication
    triMulMatrix,
    triMulMatrixWithScale,

    -- ** Vector solving
    triSolvVector,

    -- ** Matrix solving
    triSolvMatrix,
    triSolvMatrixWithScale,

    -- * Mutable interface
    triCreate,

    -- ** Vector multiplication
    triMulVectorM_,

    -- ** Matrix multiplication
    triMulMatrixM_,
    triMulMatrixWithScaleM_,

    -- ** Vector solving
    triSolvVectorM_,

    -- ** Matrix solving
    triSolvMatrixM_,
    triSolvMatrixWithScaleM_,

    ) where

import Control.Monad( when )
import Control.Monad.ST( ST, runST, unsafeIOToST )
import Text.Printf( printf )

import Numeric.LinearAlgebra.Vector( Vector, STVector )
import qualified Numeric.LinearAlgebra.Vector as V
import Numeric.LinearAlgebra.Matrix.Base( Matrix )
import Numeric.LinearAlgebra.Matrix.STBase( STMatrix, RMatrix )
import qualified Numeric.LinearAlgebra.Matrix.STBase as M
import Numeric.LinearAlgebra.Types
import qualified Foreign.BLAS as BLAS

-- | A safe way to create and work with a mutable Tri Matrix before returning
-- an immutable one for later perusal.
triCreate :: (Storable e)
           => (forall s. ST s (Tri (STMatrix s) e))
           -> Tri Matrix e
triCreate mt = runST $ do
    (Tri u d ma) <- mt
    a <- M.unsafeFreeze ma
    return $ Tri u d a

-- | @triMulVector trans a x@ returns @op(a) * x@, where @op(a)@ is
-- determined by @trans@.
triMulVector :: (BLAS2 e)
             => Trans
             -> Tri Matrix e
             -> Vector e
             -> Vector e
triMulVector trans a x =
    V.create $ do
        x' <- V.newCopy x
        triMulVectorM_ trans a x'
        return x'

-- | @triMulMatrix side a b@
-- returns @alpha * op(a) * b@ when @side@ is @LeftSide@ and
-- @alpha * b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triMulMatrix :: (BLAS3 e)
              => Side
              -> Trans -> Tri Matrix e
              -> Matrix e
              -> Matrix e
triMulMatrix side trans a b =
    M.create $ do
        b' <- M.newCopy b
        triMulMatrixM_ side trans a b'
        return b'

-- | @triMulMatrixWithScale alpha side trans a b@
-- returns @alpha * op(a) * b@ when @side@ is @LeftSide@ and
-- @alpha * b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triMulMatrixWithScale :: (BLAS3 e)
                       => e
                       -> Side
                       -> Trans -> Tri Matrix e
                       -> Matrix e
                       -> Matrix e
triMulMatrixWithScale alpha side trans a b =
    M.create $ do
        b' <- M.newCopy b
        triMulMatrixWithScaleM_ alpha side trans a b'
        return b'

-- | @triMulVectorM_ a x@ sets @x := op(a) * x@, where @op(a)@ is determined
-- by @trans@.
triMulVectorM_ :: (RMatrix m, BLAS2 e)
               => Trans -> Tri m e
               -> STVector s e
               -> ST s ()
triMulVectorM_ trans (Tri uplo diag a) x = do
    (ma,na) <- M.getDim a
    nx <- V.getDim x
    let n = nx

    when (ma /= na) $ error $
        printf ("triMulVectorM_"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " _"
                ++ ": matrix is not square")
               ma na

    when ((not . and) [ (ma,na) == (n,n)
                      , nx == n
                      ]) $ error $
        printf ("triMulVectorM_"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " <vector with dim %d>"
                ++ ": dimension mismatch")
               ma na
               nx

    unsafeIOToST $
        M.unsafeWith a $ \pa lda ->
        V.unsafeWith x $ \px ->
            BLAS.trmv uplo trans diag n pa lda px 1

-- | @triMulMatrixM_ side trans a b@
-- sets @b := op(a) * b@ when @side@ is @LeftSide@ and
-- @b := b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triMulMatrixM_ :: (RMatrix m, BLAS3 e)
               => Side
               -> Trans -> Tri m e
               -> STMatrix s e
               -> ST s ()
triMulMatrixM_ = triMulMatrixWithScaleM_ 1

-- | @triMulMatrixWithScaleM_ alpha side trans a b@
-- sets @b := alpha * op(a) * b@ when @side@ is @LeftSide@ and
-- @b := alpha * b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triMulMatrixWithScaleM_ :: (RMatrix m, BLAS3 e)
                         => e
                         -> Side
                         -> Trans -> Tri m e
                         -> STMatrix s e
                         -> ST s ()
triMulMatrixWithScaleM_ alpha side trans (Tri uplo diag a) b = do
    (ma,na) <- M.getDim a
    (mb,nb) <- M.getDim b
    let (m,n) = (mb,nb)

    when (ma /= na) $ error $
        printf ("triMulMatrixWithScaleM_"
                ++ " _"
                ++ " _"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " _"
                ++ ": matrix is not square")
               ma na

    when ((not . and) [ case side of LeftSide  -> (ma,na) == (m,m)
                                     RightSide -> (ma,na) == (n,n)
                      , (mb, nb ) == (m,n)
                      ]) $ error $
        printf ("triMulMatrixWithScaleM_"
                ++ " _"
                ++ " %s"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " <matrix with dim (%d,%d)>"
                ++ ": dimension mismatch")
               (show side)
               ma na
               mb nb

    unsafeIOToST $
        M.unsafeWith a $ \pa lda ->
        M.unsafeWith b $ \pb ldb ->
            BLAS.trmm side uplo trans diag m n alpha pa lda pb ldb

-- | @triSolvVector trans a x@ returns @op(a) \\ x@, where @op(a)@ is
-- determined by @trans@.
triSolvVector :: (BLAS2 e)
             => Trans
             -> Tri Matrix e
             -> Vector e
             -> Vector e
triSolvVector trans a x =
    V.create $ do
        x' <- V.newCopy x
        triSolvVectorM_ trans a x'
        return x'

-- | @triSolvMatrix side a b@
-- returns @alpha * op(a) \\ b@ when @side@ is @LeftSide@ and
-- @alpha * b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triSolvMatrix :: (BLAS3 e)
              => Side
              -> Trans -> Tri Matrix e
              -> Matrix e
              -> Matrix e
triSolvMatrix side trans a b =
    M.create $ do
        b' <- M.newCopy b
        triSolvMatrixM_ side trans a b'
        return b'

-- | @triSolvMatrixWithScale alpha side trans a b@
-- returns @alpha * op(a) \\ b@ when @side@ is @LeftSide@ and
-- @alpha * b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triSolvMatrixWithScale :: (BLAS3 e)
                       => e
                       -> Side
                       -> Trans -> Tri Matrix e
                       -> Matrix e
                       -> Matrix e
triSolvMatrixWithScale alpha side trans a b =
    M.create $ do
        b' <- M.newCopy b
        triSolvMatrixWithScaleM_ alpha side trans a b'
        return b'

-- | @triSolvVectorM_ a x@ sets @x := op(a) \\ x@, where @op(a)@ is determined
-- by @trans@.
triSolvVectorM_ :: (RMatrix m, BLAS2 e)
               => Trans -> Tri m e
               -> STVector s e
               -> ST s ()
triSolvVectorM_ trans (Tri uplo diag a) x = do
    (ma,na) <- M.getDim a
    nx <- V.getDim x
    let n = nx

    when (ma /= na) $ error $
        printf ("triSolvVectorM_"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " _"
                ++ ": matrix is not square")
               ma na

    when ((not . and) [ (ma,na) == (n,n)
                      , nx == n
                      ]) $ error $
        printf ("triSolvVectorM_"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " <vector with dim %d>"
                ++ ": dimension mismatch")
               ma na
               nx

    unsafeIOToST $
        M.unsafeWith a $ \pa lda ->
        V.unsafeWith x $ \px ->
            BLAS.trsv uplo trans diag n pa lda px 1

-- | @triSolvMatrixM_ side trans a b@
-- sets @b := op(a) \\ b@ when @side@ is @LeftSide@ and
-- @b := b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triSolvMatrixM_ :: (RMatrix m, BLAS3 e)
               => Side
               -> Trans -> Tri m e
               -> STMatrix s e
               -> ST s ()
triSolvMatrixM_ = triSolvMatrixWithScaleM_ 1

-- | @triSolvMatrixWithScaleM_ alpha side trans a b@
-- sets @b := alpha * op(a) \\ b@ when @side@ is @LeftSide@ and
-- @b := alpha * b * op(a)@ when @side@ is @RightSide@.  Operation
-- @op(a)@ is determined by @trans@.
triSolvMatrixWithScaleM_ :: (RMatrix m, BLAS3 e)
                         => e
                         -> Side
                         -> Trans -> Tri m e
                         -> STMatrix s e
                         -> ST s ()
triSolvMatrixWithScaleM_ alpha side trans (Tri uplo diag a) b = do
    (ma,na) <- M.getDim a
    (mb,nb) <- M.getDim b
    let (m,n) = (mb,nb)

    when (ma /= na) $ error $
        printf ("triSolvMatrixWithScaleM_"
                ++ " _"
                ++ " _"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " _"
                ++ ": matrix is not square")
               ma na

    when ((not . and) [ case side of LeftSide  -> (ma,na) == (m,m)
                                     RightSide -> (ma,na) == (n,n)
                      , (mb, nb ) == (m,n)
                      ]) $ error $
        printf ("triSolvMatrixWithScaleM_"
                ++ " _"
                ++ " %s"
                ++ " _"
                ++ " (Tri _ _ <matrix with dim (%d,%d)>)"
                ++ " <matrix with dim (%d,%d)>"
                ++ ": dimension mismatch")
               (show side)
               ma na
               mb nb

    unsafeIOToST $
        M.unsafeWith a $ \pa lda ->
        M.unsafeWith b $ \pb ldb ->
            BLAS.trsm side uplo trans diag m n alpha pa lda pb ldb


text:
//
//  PresentTestViewController.m
//  ELUnion
//
//  Created by 金秋成 on 2016/11/10.
//  Copyright © 2016年 NicolasKim. All rights reserved.
//

#import "PresentTestViewController.h"
#import "DismissTestViewController.h"
#import <ELUnion/UIViewController+ELTransition.h>

@interface PresentTestViewController ()

@end

@implementation PresentTestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton * presentBtn = [[UIButton alloc]initWithFrame:CGRectMake(20, 80, 100, 50)];
    [presentBtn setTitle:@"present" forState:UIControlStateNormal];
    [presentBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [presentBtn addTarget:self action:@selector(presntBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:presentBtn];

}
- (void)presntBtnClick{
    DismissTestViewController * dismissVC = [[DismissTestViewController alloc] init];
    [self el_presentViewController:dismissVC
                      withAnimationType:ELViewControllerTransitionAnimationTypeFromLeftToRight
                 animationComplete:nil];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
package org.doublelong.jastroblast.managers;

import org.doublelong.jastroblast.JastroBlast;
import org.doublelong.jastroblast.entity.Screens;

import com.badlogic.gdx.Screen;
import com.badlogic.gdx.utils.IntMap;

public final class ScreenManager
{
	private static ScreenManager instance;

	private JastroBlast game;

	private IntMap<Screen> screens;

	private ScreenManager() {
		screens = new IntMap<Screen>();
	}

	public static ScreenManager getInstance()
	{
		if (null == instance)
		{
			instance = new ScreenManager();
		}
		return instance;
	}

	/**
	 * Initializes the game property
	 *
	 * @param game
	 */
	public void initialize(JastroBlast game)
	{
		this.game = game;
	}

	/**
	 * Tells the game to switch screens
	 *
	 * @param screen
	 */
	public void show(Screens screen)
	{
		if (null == game)
		{
			return;
		}
		if (!screens.containsKey(screen.ordinal()))
		{
			screens.put(screen.ordinal(), screen.getScreenInstance());
		}
		this.game.setScreen(screens.get(screen.ordinal()));
	}

	public Screen get(Screens screen)
	{
		if (!screens.containsKey(screen.ordinal()))
		{
			screens.put(screen.ordinal(), screen.getScreenInstance());
		}
		return screens.get(screen.ordinal());
	}

	public void dispose(Screens screen)
	{
		if(!screens.containsKey(screen.ordinal()))
		{
			return;
		}
		screens.remove(screen.ordinal()).dispose();
	}

	public void dispose()
	{
		for (Screen screen : screens.values())
		{
			screen.dispose();
		}
		screens.clear();
		instance = null;
	}
}


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

namespace MF\Collection\Immutable;

use MF\Collection\AbstractTestCase;
use MF\Collection\Exception\InvalidArgumentException;
use MF\Collection\Exception\TupleBadMethodCallException;
use MF\Collection\Exception\TupleExceptionInterface;
use MF\Collection\Exception\TupleMatchException;
use MF\Collection\Exception\TupleParseException;

class TupleTest extends AbstractTestCase
{
    public function testShouldParse(): void
    {
        $tuple = Tuple::parse('""", 1');
        $this->assertSame(['"', 1], $tuple->toArray());
    }

    /** @dataProvider provideArrayTuple */
    public function testShouldCreateTupleFromArray(array $array, array $expectedArray, string $expectedString): void
    {
        $tuple = Tuple::from($array);
        $asString = (string) $tuple;
        $tuple2 = Tuple::parse($asString);

        $this->assertSame($expectedString, $asString);
        $this->assertSame($expectedArray, $tuple->toArray());
        $this->assertSame($tuple->toString(), $tuple2->toString());
        $this->assertSame($tuple->toArray(), $tuple2->toArray());
    }

    public function provideArrayTuple(): array
    {
        return [
            // array, extected
            'ints' => [[1, 2, 3], [1, 2, 3], '(1, 2, 3)'],
            'empty strings' => [['', ''], ['', ''], '("", "")'],
            '"", 0' => [['', 0], ['', 0], '("", 0)'],
            '"", """' => [['', '"'], ['', '"'], '("", """)'],
            'array' => [[[1, 2], 'three', ['four']], [[1, 2], 'three', ['four']], '([1; 2], "three", ["four"])'],
        ];
    }

    public function testShouldDeconstructTuple(): void
    {
        $tuple = Tuple::of('foo', 'bar');

        [$foo, $bar] = $tuple;
        $this->assertSame('foo', $foo);
        $this->assertSame('bar', $bar);

        foreach ([$tuple] as [$foo, $bar]) {
            $this->assertSame('foo', $foo);
            $this->assertSame('bar', $bar);
        }
    }

    /** @dataProvider provideTuplesInString */
    public function testShouldParseTupleFromString(string $tuple, array $expectedArray, string $expectedString): void
    {
        $result = Tuple::parse($tuple);

        $this->assertSame($expectedArray, $result->toArray());
        $this->assertSame($expectedString, $result->toString());
    }

    public function provideTuplesInString(): array
    {
        return [
            // tuple, expectedArray, expectedString
            'nulls' => ['(null, null)', [null, null], '(null, null)'],
            'bools' => ['(true, false)', [true, false], '(true, false)'],
            'integers' => ['(1, 2, 3)', [1, 2, 3], '(1, 2, 3)'],
            'floats' => ['(1.1, 2.3)', [1.1, 2.3], '(1.1, 2.3)'],
            'strings' => [
                '(one, two, three, four)',
                ['one', 'two', 'three', 'four'],
                '("one", "two", "three", "four")',
            ],
            'without parentheses integers' => ['1, 2, 3', [1, 2, 3], '(1, 2, 3)'],
            'without parentheses floats' => ['1.1, 2.3', [1.1, 2.3], '(1.1, 2.3)'],
            'without parentheses strings' => [
                'one, two, three, four',
                ['one', 'two', 'three', 'four'],
                '("one", "two", "three", "four")',
            ],
            'complex strings' => [
                '("some complex string", two, three)',
                ['some complex string', 'two', 'three'],
                '("some complex string", "two", "three")',
            ],
            'complex strings 2' => ["('Horse Soldiers',USA)", ['Horse Soldiers', 'USA'], '("Horse Soldiers", "USA")'],
            'complex strings 3' => ["('one, two', three)", ['one, two', 'three'], '("one, two", "three")'],
            'complex strings 4' => ['("one, two", three)', ['one, two', 'three'], '("one, two", "three")'],
            'mixed' => ['(one, 2, 4.2)', ['one', 2, 4.2], '("one", 2, 4.2)'],
            'array' => ['(18,30,[DD;D])', [18, 30, ['DD', 'D']], '(18, 30, ["DD"; "D"])'],
            'two arrays' => [
                '(["Hello"; "world"],[from; array])',
                [['Hello', 'world'], ['from', 'array']],
                '(["Hello"; "world"], ["from"; "array"])',
            ],

            // potentially buggy behaviour with more commas without values
            'empty strings' => ['("",,1)', ['', 1], '("", 1)'],
        ];
    }

    /** @dataProvider provideTuplesInString */
    public function testShouldParseTupleFromStringAndExpectCorrectNumberOfItems(
        string $tuple,
        array $expectedArray,
        string $expectedString,
    ): void {
        $result = Tuple::parse($tuple, count($expectedArray));

        $this->assertSame($expectedArray, $result->toArray());
        $this->assertSame($expectedString, $result->toString());
    }

    public function testShouldThrowInvalidArgumentExceptionOnTryToParseTupleWithInvalidExpectation(): void
    {
        $this->expectException(TupleParseException::class);
        $this->expectExceptionMessage('Expected items count is 1 but must not be lower than 2 because in that case it would not be a valid Tuple.');

        Tuple::parse('(1,2,3)', 1);
    }

    /** @dataProvider provideInvalidParseItems */
    public function testShouldNotParseTupleFromStringWithIncorrectNumberOfItems(
        string $tuple,
        int $expectedCount,
        string $expectedMessage,
    ): void {
        $this->expectException(TupleParseException::class);
        $this->expectExceptionMessage($expectedMessage);

        Tuple::parse($tuple, $expectedCount);
    }

    public function provideInvalidParseItems(): array
    {
        return [
            // tuple, expectedItemsCount, expectedMessage
            'nulls' => [
                '(null, null)',
                3,
                'Invalid tuple given - expected 3 items but parsed 2 items from "(null, null)".',
            ],
            'bools' => [
                '(true, false)',
                3,
                'Invalid tuple given - expected 3 items but parsed 2 items from "(true, false)".',
            ],
            'integers' => [
                '(1, 2, 3)',
                4,
                'Invalid tuple given - expected 4 items but parsed 3 items from "(1, 2, 3)".',
            ],
            'floats' => [
                '(1.1, 2.3, 5.2)',
                5,
                'Invalid tuple given - expected 5 items but parsed 3 items from "(1.1, 2.3, 5.2)".',
            ],
            'strings' => [
                '(one, two, three, four)',
                3,
                'Invalid tuple given - expected 3 items but parsed 4 items from "(one, two, three, four)".',
            ],
            'without parentheses integers' => [
                '1, 2, 3',
                4,
                'Invalid tuple given - expected 4 items but parsed 3 items from "1, 2, 3".',
            ],
            'without parentheses strings' => [
                'one, two, three, four',
                5,
                'Invalid tuple given - expected 5 items but parsed 4 items from "one, two, three, four".',
            ],
            'complex strings' => [
                '("some complex string", two, three)',
                2,
                'Invalid tuple given - expected 2 items but parsed 3 items from "("some complex string", two, three)".',
            ],
            'mixed' => [
                '(one, 2, 4.2)',
                4,
                'Invalid tuple given - expected 4 items but parsed 3 items from "(one, 2, 4.2)".',
            ],
            'array' => [
                '(one, [2;3;4])',
                4,
                'Invalid tuple given - expected 4 items but parsed 2 items from "(one, [2;3;4])".',
            ],

            // potentially buggy behaviour with more commas without values
            'empty strings' => [
                '("",,1)',
                3,
                'Invalid tuple given - expected 3 items but parsed 2 items from "("",,1)".',
            ],
        ];
    }

    /** @dataProvider provideParseTypes */
    public function testShouldParseTupleFromStringWithCorrectTypes(
        string $tuple,
        array $expectedTypes,
        array $expected,
    ): void {
        $tuple = Tuple::parseMatchTypes($tuple, $expectedTypes);

        $this->assertSame($expected, $tuple->toArray());
    }

    public function provideParseTypes(): array
    {
        return [
            // tuple, expectedTypes, expected
            'nulls' => [
                '(null, null)',
                ['?string', '?string'],
                [null, null],
            ],
            'bools' => [
                '(true, false, null)',
                ['bool', 'boolean', '?boolean'],
                [true, false, null],
            ],
            'integers' => [
                '(1, 2, 3)',
                ['int', 'int', 'int'],
                [1, 2, 3],
            ],
            'floats' => [
                '(1.1, 2.3, 5.2)',
                ['float', 'float', 'float'],
                [1.1, 2.3, 5.2],
            ],
            'strings' => [
                '(one, two, three, four)',
                ['string', 'string', 'string', 'string'],
                ['one', 'two', 'three', 'four'],
            ],
            'without parentheses integers' => [
                '1, 2, 3',
                ['int', 'int', 'int'],
                [1, 2, 3],
            ],
            'without parentheses strings' => [
                'one, two, three, four',
                ['string', 'string', 'string', 'string'],
                ['one', 'two', 'three', 'four'],
            ],
            'complex strings' => [
                '("some complex string", two, three)',
                ['string', 'string', 'string'],
                ['some complex string', 'two', 'three'],
            ],
            'mixed' => [
                '(one, 2, 4.2)',
                ['?string', 'int', 'float'],
                ['one', 2, 4.2],
            ],
            'any' => [
                '(one, 2)',
                ['string', 'any'],
                ['one', 2],
            ],
            'array' => [
                '(one, [2; 3])',
                ['string', 'array'],
                ['one', [2, 3]],
            ],

            // potentially buggy behaviour with more commas without values
            'empty strings' => [
                '("",,1)',
                ['string', 'int'],
                ['', 1],
            ],
        ];
    }

    public function testShouldNotParseTupleFromStringWithIncorrectType(): void
    {
        $this->expectException(TupleMatchException::class);
        $this->expectExceptionMessage('Given tuple does NOT match expected types (string, int) - got (string, string).');

        Tuple::parseMatch('(foo, bar)', 'string', 'int');
    }

    /** @dataProvider provideInvalidParseTypes */
    public function testShouldNotParseTupleFromStringWithIncorrectTypes(
        string $tuple,
        array $expectedTypes,
        string $expectedException,
        string $expectedMessage,
    ): void {
        $this->expectException($expectedException);
        $this->expectExceptionMessage($expectedMessage);

        Tuple::parseMatchTypes($tuple, $expectedTypes);
    }

    public function provideInvalidParseTypes(): array
    {
        return [
            // tuple, expectedTypes, expectedMessage
            'nulls' => [
                '(null, null)',
                ['string', 'string'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (string, string) - got (NULL, NULL).',
            ],
            'bools' => [
                '(true, false)',
                ['string', 'string'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (string, string) - got (bool, bool).',
            ],
            'integers' => [
                '(1, 2, 3)',
                ['int', 'int'],
                TupleParseException::class,
                'Invalid tuple given - expected 2 items but parsed 3 items from "(1, 2, 3)".',
            ],
            'floats' => [
                '(1.1, 2.3, 5.2)',
                ['int', 'int', 'int'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (int, int, int) - got (float, float, float).',
            ],
            'strings' => [
                '(one, two, three, four)',
                ['string', 'string', 'int'],
                TupleParseException::class,
                'Invalid tuple given - expected 3 items but parsed 4 items from "(one, two, three, four)".',
            ],
            'without parentheses integers' => [
                '1, 2, 3',
                ['int', 'int', 'float'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (int, int, float) - got (int, int, int).',
            ],
            'without parentheses strings' => [
                'one, two, three, four',
                ['string', 'string', 'int', 'string'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (string, string, int, string) - got (string, string, string, string).',
            ],
            'complex strings' => [
                '("some complex string", two, three)',
                ['string', 'string', 'int'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (string, string, int) - got (string, string, string).',
            ],
            'mixed' => [
                '(one, 2, 4.2)',
                ['string', 'int', 'int'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (string, int, int) - got (string, int, float).',
            ],
            'array' => [
                '(one, [2; 3], 4.2)',
                ['string', 'array', 'int'],
                TupleMatchException::class,
                'Given tuple does NOT match expected types (string, array, int) - got (string, array, float).',
            ],

            // potentially buggy behaviour with more commas without values
            'empty strings' => [
                '("",,1)',
                ['string', 'string', 'int'],
                TupleParseException::class,
                'Invalid tuple given - expected 3 items but parsed 2 items from "("",,1)".',
            ],
        ];
    }

    /** @dataProvider provideInvalidParse */
    public function testShouldNotParseTuples(string $invalidTupleString, string $expectedMessage): void
    {
        $this->expectException(TupleParseException::class);
        $this->expectExceptionMessage($expectedMessage);

        Tuple::parse($invalidTupleString);
    }

    public function provideInvalidParse(): array
    {
        $singleItemException = 'Tuple must have at least two values.';

        return [
            // invalid parse, expectedMessage
            'empty string' => ['', $singleItemException],
            'empty' => ['()', $singleItemException],
            'one int' => ['(1)', $singleItemException],
            'one string' => ['(foo)', $singleItemException],
            'one complex string' => ['("foo, bar")', $singleItemException],
            'one bool' => ['("false")', $singleItemException],

            'more dimensional arrays' => [
                '(foo, [bar; [boo; [baf; baf]]])',
                'Tuple must NOT contain multi-dimensional arrays. Invalid item: "[bar; [boo; [baf; baf]]]"',
            ],

            // potentially buggy behaviour with more commas without values
            'empty values' => ['(,)', $singleItemException],
        ];
    }

    /** @dataProvider provideInvalidTuple */
    public function testShouldNotCreateTuples(array $invalidTuple): void
    {
        $this->expectException(TupleExceptionInterface::class);
        $this->expectExceptionMessage('Tuple must have at least two values.');

        Tuple::from($invalidTuple);
    }

    public function provideInvalidTuple(): array
    {
        return [
            // invalid from
            'empty - array' => [[]],
            'one item' => [['string']],
            'one int' => [[1]],
        ];
    }

    public function testShouldTryToFindValue(): void
    {
        $tuple = Tuple::of('foo', 'bar');

        $this->assertArrayHasKey(0, $tuple);
        $this->assertArrayHasKey(1, $tuple);
        $this->assertArrayNotHasKey(2, $tuple);
    }

    public function testShouldNotAddValueToTuple(): void
    {
        $foo = Tuple::of('foo', 'bar');

        $this->expectException(TupleBadMethodCallException::class);
        $this->expectExceptionMessage('Altering existing tuple is not permitted.');

        $foo->offsetSet(0, 'bar');
    }

    public function testShouldNotAddValueToTupleByArrayNotation(): void
    {
        $foo = Tuple::of('foo', 'bar');

        $this->expectException(TupleBadMethodCallException::class);
        $this->expectExceptionMessage('Altering existing tuple is not permitted.');
        $foo[] = 'bar';
    }

    public function testShouldNotUnsetValueFromTuple(): void
    {
        $foo = Tuple::of('foo', 'bar');

        $this->expectException(TupleBadMethodCallException::class);
        $this->expectExceptionMessage('Altering existing tuple is not permitted.');
        $foo->offsetUnset(0);
    }

    public function testShouldNotUnsetValueFromTupleByArrayNotation(): void
    {
        $foo = Tuple::of('foo', 'bar');

        $this->expectException(TupleBadMethodCallException::class);
        $this->expectExceptionMessage('Altering existing tuple is not permitted.');
        unset($foo[0]);
    }

    public function testShouldTransformToArrayNatively(): void
    {
        $tupleString = (string) Tuple::of(1, 2, 3);

        $this->assertSame('(1, 2, 3)', $tupleString);
    }

    /** @dataProvider provideTupleCount */
    public function testShouldCountTupleValues(array $input, int $expectedCount): void
    {
        $tuple = Tuple::from($input);

        $this->assertCount($expectedCount, $tuple);
        $this->assertSame($expectedCount, $tuple->count());
    }

    public function provideTupleCount(): array
    {
        return [
            // tupleInput, expectedCount
            'ints' => [[1, 2], 2],
            'mixed' => [['value', 1, 1.2, true], 4],
            'array' => [['value', [1, 1.2], true], 3],
        ];
    }

    public function testShouldGetFirstValueFromTuple(): void
    {
        $tuple = Tuple::parse('(1, 2, 3)');

        $first = $tuple->first();

        $this->assertSame(1, $first);
    }

    public function testShouldGetSecondValueFromTuple(): void
    {
        $tuple = Tuple::parse('(1, 2, 3)');

        $first = $tuple->second();

        $this->assertSame(2, $first);
    }

    public function testShouldGetNthValueFromTuple(): void
    {
        $tuple = Tuple::parse('(1, 2, 3)');

        [, , $third] = $tuple;

        $this->assertSame(3, $third);
    }

    /** @dataProvider provideSameTuples */
    public function testShouldCheckWhetherAreTuplesSame(ITuple $one, ITuple $two, bool $shouldBeSame): void
    {
        $result = $one->isSame($two);

        $this->assertSame($shouldBeSame, $result);
    }

    public function provideSameTuples(): array
    {
        return [
            // one, two, shouldBeSame
            'same ints' => [Tuple::from([1, 2]), Tuple::of(1, 2), true],
            'same strings' => [Tuple::from(['foo', 'bar']), Tuple::parse('(foo, bar)'), true],
            'same mixed' => [Tuple::from([1, 'bar']), Tuple::parse('(1, bar)'), true],
            'different order - ints' => [Tuple::from([1, 2]), Tuple::parse('(2, 1)'), false],
            'different order - strings' => [Tuple::from(['bar', 'foo']), Tuple::of('foo', 'bar'), false],
            'different' => [Tuple::from([1, 'foo', true]), Tuple::parse('(4, 5)'), false],
            'different arrays' => [Tuple::from([[1, 2], 'foo', true]), Tuple::parse('(1, 2, foo, true)'), false],
            'same arrays' => [Tuple::from([[1, 2], 'foo', true]), Tuple::parse('([1; 2], foo, true)'), true],
        ];
    }

    public function testShouldCheckWhetherTupleMatchesType(): void
    {
        $tuple = Tuple::of('foo', 1);

        $this->assertTrue($tuple->match('string', 'int'));
    }

    public function testShouldCheckWhetherTupleMatchesTypeOfMoreValues(): void
    {
        $tuple = Tuple::of('foo', 1, ['array']);

        $this->assertTrue($tuple->match('string', 'int', 'array'));
    }

    /** @dataProvider provideTuplesToMatch */
    public function testShouldCheckWhetherTuplesMatchesTypes(
        ITuple $tuple,
        array $typesToMatch,
        bool $shouldMatch,
    ): void {
        $result = $tuple->matchTypes($typesToMatch);

        $this->assertSame($shouldMatch, $result);
    }

    public function provideTuplesToMatch(): array
    {
        return [
            // tuple, typesToMatch, shouldMatch
            'ints' => [Tuple::from([1, 2]), ['int', 'int'], true],
            'integers' => [Tuple::from([1, 2]), ['integer', 'int'], true],
            'nullable ints' => [Tuple::from([1, 2, 1, null]), ['?int', '?integer', 'int', '?integer'], true],
            'bools' => [Tuple::from([1, true]), ['int', 'bool'], true],
            'booleans' => [Tuple::from([1, true]), ['integer', 'boolean'], true],
            'strings' => [Tuple::from(['foo', 'bar']), ['string', 'string'], true],
            'mixed' => [Tuple::from([1, 'bar', 2.1]), ['int', 'string', 'float'], true],
            'parsed' => [
                Tuple::parse('("complex string", string, 1, 2.1, true)'),
                ['string', 'string', 'int', 'float', 'bool'],
                true,
            ],
            'nullable array' => [Tuple::from([1, null]), ['int|array', '?array'], true],
            'not match - ints' => [Tuple::from([1, 2]), ['int', 'int', 'string'], false],
            'not match - order' => [Tuple::from([1, 'string']), ['string', 'int'], false],
            'not match - mixed' => [Tuple::from([1, 'foo', true]), ['float', 'string', 'bool'], false],
            'not match - less types' => [Tuple::from([1, 'foo', true]), ['int', 'string'], false],
            'not match - more types' => [Tuple::from([1, 'foo', true]), ['int', 'string', 'bool', 'any'], false],
            // wildcard
            'matched - mixed' => [Tuple::from([1, 'foo', true]), ['int', 'mixed', 'bool'], true],
            'matched - any' => [Tuple::from([1, 'foo', true]), ['int', 'any', 'bool'], true],
            'matched - any with null' => [Tuple::from([1, null, true]), ['int', 'any', 'bool'], true],
            'matched - any with null - array' => [Tuple::from([[1], null]), ['array', 'any'], true],
            'matched - any with array' => [Tuple::from([[1], null]), ['any', '*'], true],
            // by parse
            'parse - nulls - int' => [Tuple::parse('(null, null)'), ['int', 'int'], false],
            'parse - nulls - ?int' => [Tuple::parse('(null, null)'), ['?int', '?int'], true],
            'parse - nulls - string' => [Tuple::parse('(null, null)'), ['string', 'string'], false],
            'parse - nulls - ?string' => [Tuple::parse('(null, null)'), ['?string', '?string'], true],
            'parse - ints' => [Tuple::parse('(1, 2)'), ['int', 'int'], true],
            'parse - integers' => [Tuple::parse('(1, 42)'), ['integer', 'int'], true],
            'parse - bools' => [Tuple::parse('(1, true)'), ['int', 'bool'], true],
            'parse - booleans' => [Tuple::parse('1, true'), ['integer', 'boolean'], true],
            'parse - strings' => [Tuple::parse("'foo', 'bar'"), ['string', 'string'], true],
            'parse - mixed' => [Tuple::parse('(1, \'bar\', 2.1)'), ['int', 'string', 'float'], true],
            'parse - not match - ints' => [Tuple::parse('(1, 2'), ['int', 'int', 'string'], false],
            'parse - not match - order' => [Tuple::parse('(1, \'string\')'), ['string', 'int'], false],
            'parse - not match - mixed' => [Tuple::parse('(1, foo, true)'), ['float', 'string', 'bool'], false],
            // multiple types
            'ints|string 1' => [Tuple::from(['foo', 2]), ['string|int', 'string|?int'], true],
            'ints|string 2' => [Tuple::from([1, 'foo']), ['string|int', 'string|?int'], true],
            'ints|string 3' => [Tuple::from(['string', null]), ['string|int', 'string|?int'], true],
            'ints|string 4' => [Tuple::from([null, 2]), ['string|int', 'string|?int'], false],
            'ints|string 5' => [Tuple::from([null, 'foo']), ['string|int', 'string|?int'], false],
            'int|array' => [Tuple::from([1, ['foo']]), ['int|array', 'int|array'], true],
        ];
    }

    /** @dataProvider provideInvalidTypes */
    public function testShouldNotMatchWhenAskToMatchNotEnoughTypes(array $types): void
    {
        $tuple = Tuple::of('foo', 'bar');

        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('Tuples has always at least 2 values. It would always be false by giving less then 2 types.');

        $tuple->matchTypes($types);
    }

    public function provideInvalidTypes(): array
    {
        return [
            // invalid types
            'empty' => [[]],
            'one int' => [['int']],
            'one string' => [['string']],
        ];
    }

    public function testShouldUnpackTuple(): void
    {
        $result = sprintf('Title: %s | Value: %s', ...Tuple::of('foo', 'bar'));

        $this->assertSame('Title: foo | Value: bar', $result);
    }

    public function testShouldUnpackTuples(): void
    {
        $format = fn (string $title, string $value) => sprintf('%s: %s', $title, $value);

        $values = [
            Tuple::of('title', 'value'),
            Tuple::of('type', 'great'),
        ];

        $result = array_map(fn (Tuple $tuple) => $format(...$tuple), $values);

        $this->assertSame(['title: value', 'type: great'], $result);
    }

    /**
     * @dataProvider provideTupleMerge
     */
    public function testShouldMergeTuple(ITuple $base, array $additional, ITuple $expected): void
    {
        $result = Tuple::merge($base, ...$additional);

        $this->assertSame($expected->toArray(), $result->toArray());
    }

    public function provideTupleMerge(): array
    {
        return [
            // base tuple, additional, expected
            '(1, 2) + 3 - ints' => [Tuple::of(1, 2), [3], Tuple::of(1, 2, 3)],
            '(1, 2) + [3, 4] - array' => [Tuple::of(1, 2), [[3, 4]], Tuple::of(1, 2, [3, 4])],
            '(1, 2) + (3, 4) - strings' => [
                Tuple::of('1', '2'),
                [Tuple::of('3', '4')],
                Tuple::of('1', '2', '3', '4'),
            ],
            '(1, 2) + (3, 4) + 5 + [6, 7, 8] - mixed' => [
                Tuple::of('1', '2'),
                [Tuple::of('3', '4'), 5, [6, 7, 8]],
                Tuple::of('1', '2', '3', '4', 5, [6, 7, 8]),
            ],
            '(foo, bar) + boo - string' => [
                Tuple::parse('(foo, bar)'),
                ['boo'],
                Tuple::of('foo', 'bar', 'boo'),
            ],
            '(1, 2, 3) + four - mixed' => [
                Tuple::parse('(1, 2, 3)'),
                ['four'],
                Tuple::of(1, 2, 3, 'four'),
            ],
            '(1, 2) + (3, 4) + (5, 6) - ints' => [
                Tuple::parse('(1, 2)'),
                [Tuple::of(3, 4), Tuple::from([5, 6])],
                Tuple::of(1, 2, 3, 4, 5, 6),
            ],
        ];
    }

    /**
     * @dataProvider provideTupleMergeMatch
     */
    public function testShouldMatchTupleAfterMerging(
        ITuple $base,
        array $additional,
        array $expectedTypes,
        ITuple $expected,
    ): void {
        $result = Tuple::mergeMatch($expectedTypes, $base, ...$additional);

        $this->assertSame($expected->toArray(), $result->toArray());
    }

    public function provideTupleMergeMatch(): array
    {
        return [
            // base tuple, additional, expected types, expected message
            '(1, 2, 3) + "4" = (int, int, int, string)' => [
                Tuple::parse('(1, 2, 3)'),
                ['4'],
                ['int', 'int', 'int', 'string'],
                Tuple::of(1, 2, 3, '4'),
            ],
            '(1, 2) + 3 = (int, int, int)' => [
                Tuple::parse('(1, 2)'),
                [3],
                ['int', 'int', 'int'],
                Tuple::of(1, 2, 3),
            ],
            '([1, 2], 3) + 4 = (array, int, int)' => [
                Tuple::parse('([1; 2], 3)'),
                [4],
                ['array', 'int', 'int'],
                Tuple::of([1, 2], 3, 4),
            ],
        ];
    }

    /**
     * @dataProvider provideTupleMergeDoNotMatch
     */
    public function testShouldNotMatchTupleAfterMerging(
        ITuple $base,
        array $additional,
        array $expectedTypes,
        string $expectedMessage,
    ): void {
        $this->expectException(TupleMatchException::class);
        $this->expectExceptionMessage($expectedMessage);

        Tuple::mergeMatch($expectedTypes, $base, ...$additional);
    }

    public function provideTupleMergeDoNotMatch(): array
    {
        return [
            // base tuple, additional, expected types, expected message
            '(1, 2, 3) + "4" <> (int, int)' => [
                Tuple::parse('(1, 2, 3)'),
                ['4'],
                ['int', 'int'],
                'Given tuple does NOT match expected types (int, int) - got (int, int, int, string).',
            ],
            '(1, 2) + 3 <> (int, string)' => [
                Tuple::parse('(1, 2)'),
                [3],
                ['int', 'string'],
                'Given tuple does NOT match expected types (int, string) - got (int, int, int).',
                '(int, string) expected but got (int, int, int)',
            ],
        ];
    }

    /**
     * @dataProvider provideTupleForUrl
     */
    public function testShouldFormatTupleForUrl(ITuple $tuple, string $expected): void
    {
        $result = $tuple->toStringForUrl();

        $this->assertSame($expected, $result);

        $parsed = Tuple::parse($result);
        $this->assertSame($tuple->toArray(), $parsed->toArray());
    }

    public function provideTupleForUrl(): array
    {
        return [
            // tuple, expected
            'simple strings' => [Tuple::from(['foo', 'bar', 'boo']), '(foo,bar,boo)'],
            'ints' => [Tuple::from([1, 2, 3]), '(1,2,3)'],
            'floats' => [Tuple::from([1.2, 3.4]), '(1.2,3.4)'],
            '?bools' => [Tuple::from([true, false, null]), '(true,false,null)'],
            'arrays' => [Tuple::from(['one', [2, 3], 4]), '(one,[2;3],4)'],
            'string with numbers, underscores, dashesh, dots, space, ...' => [
                Tuple::from(['a_b-c.d', 'a1-b2', 'x y']),
                '(a_b-c.d,a1-b2,x y)',
            ],
            'complex strings' => [
                Tuple::from(['foo, bar & boo', 'Another "complexString"', 'simple']),
                '("foo, bar & boo","Another "complexString"",simple)',
            ],
            'complex strings in array' => [
                Tuple::from([['foo bar & boo', 'Another \'complexString\''], 'simple']),
                '(["foo bar & boo";"Another \'complexString\'"],simple)',
            ],
        ];
    }

    /** @dataProvider provideEmptyTuple */
    public function testShouldCheckIfTUpleIsEmpty(ITuple $tuple, bool $expected): void
    {
        $this->assertSame($expected, $tuple->isEmpty());
    }

    public function provideEmptyTuple(): array
    {
        return [
            // tuple, isEmpty
            'not-empty' => [Tuple::of('one', 'two'), false],
            'empty strings' => [Tuple::of('', ''), true],
            'nulls' => [Tuple::of(null, null), true],
        ];
    }
}


text:
package com.janeluo.jfinalplus.kit;

import com.jfinal.kit.HttpKit;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 *
 * @author BruceZCQ
 */
final public class HttpExtKit {

	/**
	 * Send Hex String request
	 */
	public static String postHexString(String url, Map<String, String> queryParas, byte[] data, Map<String, String> headers) {
		return HttpKit.post(url, queryParas, HexKit.byteToHexString(data), headers);
	}

	/**
	 * Send byte data by post request
	 */
	public static String post(String url, Map<String, String> queryParas, byte[] data, Map<String, String> headers) {
		return HttpKit.post(url, queryParas, (new String(data)), headers);
	}

	public static byte[] readHexByteData(HttpServletRequest request) {
		String ret = HttpKit.readData(request);
		return HexKit.HexStringToBytes(ret);
	}

	public static byte[] readByteData(HttpServletRequest request) {
		String ret = HttpKit.readData(request);
		byte[] data = null;
		try {
			data = ret.getBytes("UTF-8");
		} catch (UnsupportedEncodingException e) {
			new RuntimeException(e);
		}
		return data;
	}
}


text:
<!DOCTYPE html>

        <meta charset="utf-8" content="width=device-width, initial-scale=1, maximum-scale=1">
        <title>ProjectAgilApps</title>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.0.min.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.4.0.min.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile.theme-1.4.0.min.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile.external-png-1.4.0.min.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile.icons-1.4.0.min.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile.inline-png-1.4.0.min.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile.inline-svg-1.4.0.min.css" />

ProjectAgilapps

                    Iniciar Sesion
                    Registro

Agilapps 2014


text:
/* *
 *
 *  Highcharts cylinder - a 3D series
 *
 *  (c) 2010-2021 Highsoft AS
 *
 *  Author: Kacper Madej
 *
 *  License: www.highcharts.com/license
 *
 *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
 *
 * */
'use strict';
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import SeriesRegistry from '../../Core/Series/SeriesRegistry.js';
var ColumnPoint = SeriesRegistry.seriesTypes.column.prototype.pointClass;
import U from '../../Core/Utilities.js';
var extend = U.extend;
/* *
 *
 *  Class
 *
 * */
var CylinderPoint = /** @class */ (function (_super) {
    __extends(CylinderPoint, _super);
    function CylinderPoint() {
        /* *
         *
         *  Properties
         *
         * */
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.options = void 0;
        _this.series = void 0;
        return _this;
    }
    return CylinderPoint;
}(ColumnPoint));
extend(CylinderPoint.prototype, {
    shapeType: 'cylinder'
});
/* *
 *
 *  Default Export
 *
 * */
export default CylinderPoint;


text:
package com.phloc.commons.lang;

import com.phloc.commons.ICloneable;

/**
 * This class needs to be in the same package as {@link CloneHelper} so that the
 * test works!<br>
 * Should invoke the Object.clone() method.
 *
 * @author Philip Helger
 */
public final class MockICloneable implements ICloneable <MockICloneable>
{
  private final int m_i;

  public MockICloneable ()
  {
    this (0);
  }

  private MockICloneable (final int j)
  {
    m_i = j;
  }

  public int getI ()
  {
    return m_i;
  }

  public MockICloneable getClone ()
  {
    return new MockICloneable (m_i + 1);
  }
}


text:
@interface FadeBlackView : UIView

- (void)show;
- (void)hide;

@end


text:
//
//  UIPickerView+IDNPickDate.h
//  IDNFramework
//
//  Created by photondragon on 15/6/23.
//  Copyright (c) 2015年 iosdev.net. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIPickerView(IDNPickDate)

/**
 在[[UIApplication sharedApplication].delegate window]里显示UIPickerView,内部只是
 简单调用了UIView(IDNPickDate)的功能
 @code
 [UIPickerView pickDateWithChoosedBlock:^(NSDate *date) {
     NSLog(@"选择的时间为:%@", date);
  } mode:UIDatePickerModeDate currentDate:nil minDate:nil maxDate:[NSDate date]];
 @endcode
 */
+ (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock;
+ (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock mode:(UIDatePickerMode)mode currentDate:(NSDate*)currentDate minDate:(NSDate*)minDate maxDate:(NSDate*)maxDate;

@end

@interface UIView(IDNPickDate)
/**
 在指定view里显示一个UIPickerView,用户可以选择一个时间,点确定按钮,然后dateChoosedBlock
 会被调用,参数就是用户选择的时间。
 如果用户取消了选择,dateChoosedBlock不会被调用
 @code
 [self.navigationController.view pickDateWithChoosedBlock:^(NSDate *date) {
     NSLog(@"选择的时间为:%@", date);
  } mode:UIDatePickerModeDate currentDate:nil minDate:nil maxDate:[NSDate date]];
 @endcode
 */
- (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock;
- (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock mode:(UIDatePickerMode)mode currentDate:(NSDate*)currentDate minDate:(NSDate*)minDate maxDate:(NSDate*)maxDate;

@end