text:
<?php

add_action( 'widgets_init', 'init_latest_custom_posts' );
function init_latest_custom_posts() { return register_widget('latest_custom_posts'); }

class latest_custom_posts extends WP_Widget {

	function latest_custom_posts() {
		parent::WP_Widget( 'latest_custom_posts_widget', $name = 'Latest Custom Posts' );
	}

	function widget( $args, $instance ) {

		global $post;
		extract($args);

		// Widget options
		$title 	 = apply_filters('widget_title',  isset($instance['title']) ? $instance['title'] : __('Recent','showshop') ); // Title
		$custom_post_list	= isset($instance['types']) ? $instance['types'] : '';
	    $types				= $custom_post_list ? explode(',', $custom_post_list) : '';
		$number				= isset($instance['number']) ? $instance['number'] : '';
		$img_width			= isset($instance['img_width']) ? $instance['img_width'] : '';

        // Output
		echo wp_kses_post($before_widget);

	    if ( $title ) echo wp_kses_post($before_title . $title . $after_title);

		$my_query = new WP_Query(array(
								'post_type' => $types,
								'showposts' => $number )
								);

		if( $my_query->have_posts() ) :
		?>

			<?php while($my_query->have_posts()) : $my_query->the_post(); ?>

				<a href="<?php the_permalink() ?>" title="<?php echo the_title_attribute (array('echo' => 0)); ?>"  class="tip-top" data-tooltip>

				<div class="widget-post-thumbs" style="<?php echo ($img_width ? 'width:'.$img_width.'px; height:auto' : '')?>">

					<?php echo as_image( 'thumbnail' );?>

<?php echo esc_html(get_the_title());?>

			<?php
			endwhile;
			wp_reset_postdata();
			?>

		<?php endif; ?>
		<?php
		// widget close
		echo wp_kses_post($after_widget);
	}

	/* Widget control update */
	function update( $new_instance, $old_instance ) {
		$instance    = $old_instance;

		//Let's turn that array into something the Wordpress database can store
		$types       = implode(',', (array)$new_instance['types']);

		$instance['title']  = strip_tags( $new_instance['title'] );
		$instance['types']  = $types;
		$instance['number'] = strip_tags( $new_instance['number'] );
		$instance['img_width'] = strip_tags( $new_instance['img_width'] );
		return $instance;
	}

	/* widget settings */
	function form( $instance ) {

		    // instance exist? if not set defaults
		    if ( $instance ) {
				$title  = $instance['title'];
		        $types  = $instance['types'];
		        $number = $instance['number'];
		        $img_width = $instance['img_width'];
		    } else {
			    //These are our defaults
				$title  = '';
		        $types  = 'post';
		        $number = '5';
				$img_width = 50;
		    }

			//Let's turn $types into an array
			$types = explode(',', $types);

			//Count number of post types for select box sizing
			$custom_post_list_types = get_post_types( array( 'public' => true ), 'names' );
			foreach ($custom_post_list_types as $custom_post_list ) {
			   $custom_post_list_ar[] = $custom_post_list;
			}
			$n = count($custom_post_list_ar);
			if($n > 10) { $n = 10;}

			// The widget form
			?>

				<label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e( 'Title:','showshop' ); ?>
				<input id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo sanitize_text_field($title); ?>" class="widefat" />

				<label for="<?php echo esc_attr($this->get_field_id('types')); ?>"><?php esc_html_e( 'Post type(s):','showshop' ); ?>
				<select name="<?php echo esc_attr($this->get_field_name('types')); ?>[]" id="<?php echo esc_attr($this->get_field_id('types')); ?>" class="widefat" style="height: auto;" size="<?php echo esc_attr($n) ?>" multiple>
				<?php
				$args = array( 'public' => true );
				$post_types = get_post_types( $args, 'names' );
				foreach ($post_types as $post_type ) {
					if( !( $post_type == 'revision' || $post_type == 'nav_menu_item' || $post_type == 'attachment' || $post_type == 'options' )) {
				?>
					<option value="<?php echo esc_attr($post_type); ?>" <?php if( in_array($post_type, $types)) { echo 'selected="selected"'; } ?>><?php echo esc_html($post_type);?></option>
				<?php
					} //endif
				}// end foreach
				?>
				</select>

				<label for="<?php echo esc_attr($this->get_field_id('number')); ?>"><?php esc_html_e( 'Number of items for display:', 'showshop' ); ?>
				<input id="<?php echo esc_attr($this->get_field_id('number')); ?>" name="<?php echo esc_attr($this->get_field_name('number')); ?>" type="text" value="<?php echo sanitize_text_field($number); ?>" size="3" />

				<label for="<?php echo esc_attr($this->get_field_id('img_width')); ?>"><?php esc_html_e( 'Image width', 'showshop' ); ?>
				<input id="<?php echo esc_attr($this->get_field_id('img_width')); ?>" name="<?php echo esc_attr($this->get_field_name('img_width')); ?>" type="text" value="<?php echo sanitize_text_field($img_width); ?>" size="3" />

	<?php
	}

} // class latest_custom_posts

?>


text:
    {% if site.github_username %}

    {% endif %}
    {% if site.bitbucket_username %}

    {% endif %}
    {% if site.stackoverflow_id %}

    {% endif %}
    {% if site.twitter_username %}

    {% endif %}
    {% if site.linkedin_username %}

    {% endif %}
    {% if site.google_plus_id %}

    {% endif %}
    {% if site.email %}

    {% endif %}
    {% if site.angellist_username %}

    {% endif %}
    {% if site.medium_id %}

    {% endif %}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace Elewant\Webapp\Application\Controllers;

use Elewant\Herding\DomainModel\Breed\Breed;
use Elewant\Herding\DomainModel\Breed\BreedDesireWasEliminatedByHerd;
use Elewant\Herding\DomainModel\Herd\HerdId;
use Elewant\Herding\DomainModel\ShepherdId;

class ApiCommandEliminateDesireForBreedTest extends ApiCommandBase
{
    private HerdId $herdId;

    public function setUp(): void
    {
        parent::setUp();

        $shepherdId = ShepherdId::generate();

        $this->formHerd($shepherdId, 'MyHerdName');
        $this->herdId = $this->recordedEvents[0]->herdId();

        $this->client = $this->desireBreed($this->herdId, Breed::blackAmsterdamphpRegular());
        $this->client = $this->eliminateDesireForBreed($this->herdId, Breed::blackAmsterdamphpRegular());
    }

    public function test_command_desire_breed_returns_http_status_202(): void
    {
        self::assertEquals(202, $this->client->getResponse()->getStatusCode());
    }

    public function test_command_eliminate_desire_for_breed_emits_BreedDesireWasEliminatedByHerd_event(): void
    {
        self::assertCount(3, $this->recordedEvents);

        /** @var BreedDesireWasEliminatedByHerd $eventUnderTest */
        $eventUnderTest = $this->recordedEvents[2];

        self::assertInstanceOf(BreedDesireWasEliminatedByHerd::class, $eventUnderTest);
        self::assertSame(Breed::BLACK_AMSTERDAMPHP_REGULAR, $eventUnderTest->breed()->toString());
        self::assertTrue($this->herdId->equals($eventUnderTest->herdId()));
    }

    public function test_command_eliminate_desire_for_breed_created_a_correct_herd_projection(): void
    {
        /** @var BreedDesireWasEliminatedByHerd $eventUnderTest */
        $eventUnderTest = $this->recordedEvents[2];

        $expectedDesiredBreedsProjection = [];

        $this->runProjection('herd_projection');

        $desiredBreeds = $this->retrieveDesiredBreedsFromListing(
            $eventUnderTest->herdId()->toString()
        );
        self::assertSame($expectedDesiredBreedsProjection, $desiredBreeds);
    }
}


text:
<?php
namespace Payum\Core\Tests;

use Omnipay\Dummy\Gateway as OmnipayGateway;
use Payum\AuthorizeNet\Aim\AuthorizeNetAimGatewayFactory;
use Payum\Be2Bill\Be2BillDirectGatewayFactory;
use Payum\Be2Bill\Be2BillOffsiteGatewayFactory;
use Payum\Core\Bridge\PlainPhp\Security\HttpRequestVerifier;
use Payum\Core\CoreGatewayFactory;
use Payum\Core\Extension\StorageExtension;
use Payum\Core\Gateway;
use Payum\Core\GatewayFactory;
use Payum\Core\GatewayFactoryInterface;
use Payum\Core\Model\ArrayObject;
use Payum\Core\Model\Payment;
use Payum\Core\Model\Payout;
use Payum\Core\Payum;
use Payum\Core\PayumBuilder;
use Payum\Core\Registry\RegistryInterface;
use Payum\Core\Registry\SimpleRegistry;
use Payum\Core\Registry\StorageRegistryInterface;
use Payum\Core\Security\GenericTokenFactory;
use Payum\Core\Security\GenericTokenFactoryInterface;
use Payum\Core\Security\HttpRequestVerifierInterface;
use Payum\Core\Security\TokenFactoryInterface;
use Payum\Core\Storage\StorageInterface;
use Payum\Klarna\Checkout\KlarnaCheckoutGatewayFactory;
use Payum\Klarna\Invoice\KlarnaInvoiceGatewayFactory;
use Payum\Offline\OfflineGatewayFactory;
use Payum\OmnipayV3Bridge\OmnipayGatewayFactory;
use Payum\Payex\PayexGatewayFactory;
use Payum\Paypal\ExpressCheckout\Nvp\PaypalExpressCheckoutGatewayFactory;
use Payum\Paypal\Masspay\Nvp\PaypalMasspayGatewayFactory;
use Payum\Paypal\ProCheckout\Nvp\PaypalProCheckoutGatewayFactory;
use Payum\Paypal\Rest\PaypalRestGatewayFactory;
use Payum\Stripe\StripeCheckoutGatewayFactory;
use Payum\Stripe\StripeJsGatewayFactory;
use PHPUnit\Framework\TestCase;

class PayumBuilderTest extends TestCase
{
    public function setUp(): void
    {
        $_SERVER = [
            'HTTP_HOST' => 'payum.dev',
        ];
    }

    /**
     * @test
     */
    public function throwsIfTokenStorageIsNotSet()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('Token storage must be configured.');
        $payum = (new PayumBuilder())->getPayum();

        $this->assertInstanceOf(Payum::class, $payum);
    }

    /**
     * @test
     */
    public function shouldBuildDefaultPayum()
    {
        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertInstanceOf(HttpRequestVerifier::class, $payum->getHttpRequestVerifier());
        $this->assertInstanceOf(GenericTokenFactory::class, $payum->getTokenFactory());

        $this->assertIsArray($payum->getGateways());
        $this->assertCount(0, $payum->getGateways());

        $this->assertIsArray($payum->getStorages());
        $this->assertCount(3, $payum->getStorages());
        $this->assertArrayHasKey(Payment::class, $payum->getStorages());
        $this->assertArrayHasKey(ArrayObject::class, $payum->getStorages());
        $this->assertArrayHasKey(Payout::class, $payum->getStorages());

        $factories = $payum->getGatewayFactories();
        $this->assertIsArray($factories);
        $this->assertGreaterThan(40, $factories);

        $this->assertArrayHasKey('paypal_express_checkout', $factories);
        $this->assertInstanceOf(PaypalExpressCheckoutGatewayFactory::class, $factories['paypal_express_checkout']);

        $this->assertArrayHasKey('paypal_masspay', $factories);
        $this->assertInstanceOf(PaypalMasspayGatewayFactory::class, $factories['paypal_masspay']);

        $this->assertArrayHasKey('paypal_pro_checkout', $factories);
        $this->assertInstanceOf(PaypalProCheckoutGatewayFactory::class, $factories['paypal_pro_checkout']);

        $this->assertArrayHasKey('paypal_rest', $factories);
        $this->assertInstanceOf(PaypalRestGatewayFactory::class, $factories['paypal_rest']);

        $this->assertArrayHasKey('authorize_net_aim', $factories);
        $this->assertInstanceOf(AuthorizeNetAimGatewayFactory::class, $factories['authorize_net_aim']);

        $this->assertArrayHasKey('be2bill_direct', $factories);
        $this->assertInstanceOf(Be2BillDirectGatewayFactory::class, $factories['be2bill_direct']);

        $this->assertArrayHasKey('be2bill_offsite', $factories);
        $this->assertInstanceOf(Be2BillOffsiteGatewayFactory::class, $factories['be2bill_offsite']);

        $this->assertArrayHasKey('klarna_checkout', $factories);
        $this->assertInstanceOf(KlarnaCheckoutGatewayFactory::class, $factories['klarna_checkout']);

        $this->assertArrayHasKey('klarna_invoice', $factories);
        $this->assertInstanceOf(KlarnaInvoiceGatewayFactory::class, $factories['klarna_invoice']);

        $this->assertArrayHasKey('offline', $factories);
        $this->assertInstanceOf(OfflineGatewayFactory::class, $factories['offline']);

        $this->assertArrayHasKey('payex', $factories);
        $this->assertInstanceOf(PayexGatewayFactory::class, $factories['payex']);

        $this->assertArrayHasKey('stripe_checkout', $factories);
        $this->assertInstanceOf(StripeCheckoutGatewayFactory::class, $factories['stripe_checkout']);

        $this->assertArrayHasKey('stripe_js', $factories);
        $this->assertInstanceOf(StripeJsGatewayFactory::class, $factories['stripe_js']);
    }

    /**
     * @test
     */
    public function shouldUseCustomHttpRequestVerifier()
    {
        /** @var HttpRequestVerifierInterface $expectedVerifier */
        $expectedVerifier = $this->createMock(HttpRequestVerifierInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setHttpRequestVerifier($expectedVerifier)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedVerifier, $payum->getHttpRequestVerifier());
    }

    /**
     * @test
     */
    public function shouldUseHttpRequestVerifierBuilder()
    {
        /** @var HttpRequestVerifierInterface $expectedVerifier */
        $expectedVerifier = $this->createMock(HttpRequestVerifierInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setHttpRequestVerifier(function ($tokenStorage) use ($expectedVerifier) {
                $this->assertInstanceOf(StorageInterface::class, $tokenStorage);

                return $expectedVerifier;
            })
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedVerifier, $payum->getHttpRequestVerifier());
    }

    /**
     * @test
     */
    public function throwsIfHttpRequestVerifierBuilderReturnsInvalidInstance()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('Builder returned invalid instance');
        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setHttpRequestVerifier(function () {
                return new \stdClass();
            })
            ->getPayum()
        ;
    }

    /**
     * @test
     */
    public function shouldUseCustomGenericTokenFactory()
    {
        /** @var GenericTokenFactoryInterface $expectedTokenFactory */
        $expectedTokenFactory = $this->createMock(GenericTokenFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setGenericTokenFactory($expectedTokenFactory)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedTokenFactory, $payum->getTokenFactory());
    }

    /**
     * @test
     */
    public function shouldUseGenericTokenFactoryBuilder()
    {
        /** @var GenericTokenFactoryInterface $expectedTokenFactory */
        $expectedTokenFactory = $this->createMock(GenericTokenFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setGenericTokenFactory(function ($tokenFactory, $paths) use ($expectedTokenFactory) {
                $this->assertInstanceOf(TokenFactoryInterface::class, $tokenFactory);

                $this->assertIsArray($paths);
                $this->assertEquals([
                    'capture' => 'capture.php',
                    'notify' => 'notify.php',
                    'authorize' => 'authorize.php',
                    'refund' => 'refund.php',
                    'payout' => 'payout.php',
                ], $paths);

                return $expectedTokenFactory;
            })
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedTokenFactory, $payum->getTokenFactory());
    }

    /**
     * @test
     */
    public function shouldUseCustomGenericTokenFactoryPaths()
    {
        $expectedPaths = [
            'capture' => 'capture_custom.php',
            'notify' => 'notify_custom.php',
            'authorize' => 'authorize_custom.php',
            'refund' => 'refund_custom.php',
            'payout' => 'payout_custom.php',
        ];

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setGenericTokenFactoryPaths($expectedPaths)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);

        $genericTokenFactory = $payum->getTokenFactory();
        $ref = new \ReflectionProperty($genericTokenFactory, 'paths');
        $ref->setAccessible(true);

        $this->assertSame($expectedPaths, $ref->getValue($genericTokenFactory));
    }

    /**
     * @test
     */
    public function throwsIfGenericTokenFactoryBuilderReturnInvalidInstance()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('Builder returned invalid instance');
        (new PayumBuilder())
            ->addDefaultStorages()
            ->setGenericTokenFactory(function () {
                return new \stdClass();
            })
            ->getPayum()
        ;
    }

    /**
     * @test
     */
    public function shouldUseCustomTokenFactory()
    {
        /** @var TokenFactoryInterface $expectedTokenFactory */
        $expectedTokenFactory = $this->createMock(TokenFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setTokenFactory($expectedTokenFactory)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);

        $genericTokenFactory = $payum->getTokenFactory();
        $ref = new \ReflectionProperty($genericTokenFactory, 'tokenFactory');
        $ref->setAccessible(true);

        $this->assertSame($expectedTokenFactory, $ref->getValue($genericTokenFactory));
    }

    /**
     * @test
     */
    public function shouldUseTokenFactoryBuilder()
    {
        /** @var TokenFactoryInterface $expectedTokenFactory */
        $expectedTokenFactory = $this->createMock(TokenFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setTokenFactory(function ($tokenStorage, $storageRegistry) use ($expectedTokenFactory) {
                $this->assertInstanceOf(StorageInterface::class, $tokenStorage);
                $this->assertInstanceOf(StorageRegistryInterface::class, $storageRegistry);

                return $expectedTokenFactory;
            })
            ->getPayum()
        ;

        $genericTokenFactory = $payum->getTokenFactory();
        $ref = new \ReflectionProperty($genericTokenFactory, 'tokenFactory');
        $ref->setAccessible(true);

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedTokenFactory, $ref->getValue($genericTokenFactory));
    }

    /**
     * @test
     */
    public function throwsIfTokenFactoryBuilderReturnInvalidInstance()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('Builder returned invalid instance');
        (new PayumBuilder())
            ->addDefaultStorages()
            ->setTokenFactory(function () {
                return new \stdClass();
            })
            ->getPayum()
        ;
    }

    /**
     * @test
     */
    public function shouldAllowGetGatewayAddedAsInstance()
    {
        $expectedGateway = new Gateway();

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGateway('a_gateway', $expectedGateway)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedGateway, $payum->getGateway('a_gateway'));
    }

    /**
     * @test
     */
    public function shouldAllowGetGatewayAddedAsConfig()
    {
        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGateway('a_gateway', [
                'factory' => 'offline'
            ])
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertInstanceOf(Gateway::class, $payum->getGateway('a_gateway'));
    }

    /**
     * @test
     */
    public function throwIfTryToAddGatewayConfigWithoutFactoryKeySet()
    {
        $this->expectException(\Payum\Core\Exception\InvalidArgumentException::class);
        $this->expectExceptionMessage('Gateway config must have factory set in it and it must not be empty.');
        (new PayumBuilder())
            ->addDefaultStorages()
            ->addGateway('a_gateway', [
            ])
            ->getPayum()
        ;
    }

    /**
     * @test
     */
    public function shouldAllowGetStorageAddedAsInstance()
    {
        /** @var StorageInterface $expectedStorage */
        $expectedStorage = $this->createMock(StorageInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addStorage('a_storage', $expectedStorage)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedStorage, $payum->getStorage('a_storage'));
    }

    /**
     * @test
     */
    public function shouldAllowGetGatewayFactoryAddedAsInstance()
    {
        /** @var GatewayFactoryInterface $expectedFactory */
        $expectedFactory = $this->createMock(GatewayFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGatewayFactory('a_factory', $expectedFactory)
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedFactory, $payum->getGatewayFactory('a_factory'));
    }

    /**
     * @test
     */
    public function shouldAllowGetGatewayFactoryAddedAsCallbackFactory()
    {
        $expectedFactory = null;

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGatewayFactory('a_factory', function (array $config, GatewayFactoryInterface $coreGatewayFactory) use (&$expectedFactory) {
                $expectedFactory = new GatewayFactory($config, $coreGatewayFactory);

                return $expectedFactory;
            })
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($expectedFactory, $payum->getGatewayFactory('a_factory'));
    }

    /**
     * @test
     */
    public function shouldPassAddedConfigToGatewayCallbackFactory()
    {
        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGatewayFactoryConfig('a_factory', ['foo' => 'fooVal'])
            ->addGatewayFactory('a_factory', function (array $config, GatewayFactoryInterface $coreGatewayFactory) use (&$expectedFactory) {
                $this->assertEquals(['foo' => 'fooVal'], $config);

                return new GatewayFactory($config, $coreGatewayFactory);
            })
            ->getPayum()
        ;
    }

    /**
     * @test
     */
    public function shouldReuseAddedFactoriesForGatewayCreatedFromConfig()
    {
        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGatewayFactory('a_factory', new OfflineGatewayFactory())
            ->addGateway('a_gateway', [
                'factory' => 'a_factory',
            ])
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertInstanceOf(Gateway::class, $payum->getGateway('a_gateway'));
    }

    /**
     * @test
     */
    public function shouldReuseGatewaysFromMainRegistryAndFallbackOne()
    {
        $fallbackGateway = new Gateway();
        $mainGateway = new Gateway();

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGateway('fallback_factory', $fallbackGateway)
            ->setMainRegistry(new SimpleRegistry([
                'main_gateway' => $mainGateway
            ]))
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($mainGateway, $payum->getGateway('main_gateway'));
        $this->assertSame($fallbackGateway, $payum->getGateway('fallback_factory'));
    }

    /**
     * @test
     */
    public function shouldAllowSetReuseGatewaysFromMainRegistryAndFallbackOne()
    {
        $fallbackGateway = new Gateway();
        $mainGateway = new Gateway();

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGateway('fallback_factory', $fallbackGateway)
            ->setMainRegistry(new SimpleRegistry([
                'main_gateway' => $mainGateway
            ]))
            ->getPayum()
        ;

        $this->assertInstanceOf(Payum::class, $payum);
        $this->assertSame($mainGateway, $payum->getGateway('main_gateway'));
        $this->assertSame($fallbackGateway, $payum->getGateway('fallback_factory'));
    }

    /**
     * @test
     */
    public function shouldUseCustomCoreGatewayFactory()
    {
        $expectedCoreGatewayFactory = $this->createMock(GatewayFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setCoreGatewayFactory($expectedCoreGatewayFactory)
            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('offline');

        $this->assertInstanceOf(OfflineGatewayFactory::class, $gatewayFactory);

        $ref = new \ReflectionProperty($gatewayFactory, 'coreGatewayFactory');
        $ref->setAccessible(true);

        $this->assertSame($expectedCoreGatewayFactory, $ref->getValue($gatewayFactory));
    }

    /**
     * @test
     */
    public function shouldUseCoreGatewayFactoryBuilder()
    {
        $expectedCoreGatewayFactory = $this->createMock(GatewayFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setCoreGatewayFactory(function ($config) use ($expectedCoreGatewayFactory) {
                $this->assertIsArray($config);
                $this->assertNotEmpty($config);

                return $expectedCoreGatewayFactory;
            })
            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('offline');

        $this->assertInstanceOf(OfflineGatewayFactory::class, $gatewayFactory);

        $ref = new \ReflectionProperty($gatewayFactory, 'coreGatewayFactory');
        $ref->setAccessible(true);

        $this->assertSame($expectedCoreGatewayFactory, $ref->getValue($gatewayFactory));
    }

    /**
     * @test
     */
    public function shouldAddStorageExtensionForTheAddedStorage()
    {
        /** @var StorageInterface $expectedStorage */
        $expectedStorage = $this->createMock(StorageInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addStorage(TestModel::class, $expectedStorage)
            ->setCoreGatewayFactory(function ($config) use ($expectedStorage) {
                $this->assertIsArray($config);
                $this->assertArrayHasKey('payum.extension.storage_payum_core_tests_testmodel', $config, var_export($config, true));
                $this->assertInstanceOf(StorageExtension::class, $config['payum.extension.storage_payum_core_tests_testmodel']);

                $ref = new \ReflectionProperty($config['payum.extension.storage_payum_core_tests_testmodel'], 'storage');
                $ref->setAccessible(true);

                $this->assertSame($expectedStorage, $ref->getValue($config['payum.extension.storage_payum_core_tests_testmodel']));

                return new CoreGatewayFactory($config);
            })
            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('offline');

        $this->assertInstanceOf(OfflineGatewayFactory::class, $gatewayFactory);

        $config = $gatewayFactory->createConfig([]);

        $this->assertArrayHasKey('payum.extension.storage_payum_core_tests_testmodel', $config, var_export($config, true));
        $this->assertInstanceOf(StorageExtension::class, $config['payum.extension.storage_payum_core_tests_testmodel']);

        $ref = new \ReflectionProperty($config['payum.extension.storage_payum_core_tests_testmodel'], 'storage');
        $ref->setAccessible(true);

        $this->assertSame($expectedStorage, $ref->getValue($config['payum.extension.storage_payum_core_tests_testmodel']));
    }

    /**
     * @test
     */
    public function shouldAllowAddGatewayFactorySpecificConfig()
    {
        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->addGatewayFactoryConfig('offline', ['foo' => 'fooVal'])

            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('offline');

        $this->assertInstanceOf(OfflineGatewayFactory::class, $gatewayFactory);

        $config = $gatewayFactory->createConfig([]);

        $this->assertArrayHasKey('foo', $config, var_export($config, true));
        $this->assertEquals('fooVal', $config['foo']);
    }

    /**
     * @test
     */
    public function throwsIfCoreGatewayFactoryBuilderReturnInvalidInstance()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('Builder returned invalid instance');
        $expectedCoreGateway = $this->createMock(GatewayFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setCoreGatewayFactory(function () {
                return new \stdClass();
            })
            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('offline');

        $this->assertInstanceOf(OfflineGatewayFactory::class, $gatewayFactory);

        $ref = new \ReflectionProperty($gatewayFactory, 'coreGatewayFactory');
        $ref->setAccessible(true);

        $this->assertSame($expectedCoreGateway, $ref->getValue($gatewayFactory));
    }

    /**
     * @test
     */
    public function shouldRegisterOmnipayV3Factories()
    {
        if (false == class_exists(OmnipayGateway::class)) {
            $this->markTestSkipped('Either omnipay or\and omnipay bridge are not installed. Skip');
        }

        $expectedCoreGatewayFactory = $this->createMock(GatewayFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setCoreGatewayFactory($expectedCoreGatewayFactory)
            ->getPayum()
        ;

        $gatewayFactories = $payum->getGatewayFactories();

        $this->assertArrayHasKey('omnipay', $gatewayFactories);
    }

    /**
     * @test
     */
    public function shouldInjectCoreGatewayFactoryToOmnipayV3Factory()
    {
        if (false == class_exists(OmnipayGateway::class)) {
            $this->markTestSkipped('Either omnipay or\and omnipay bridge are not installed. Skip');
        }

        $expectedCoreGatewayFactory = $this->createMock(GatewayFactoryInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setCoreGatewayFactory($expectedCoreGatewayFactory)
            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('omnipay');

        $this->assertInstanceOf(OmnipayGatewayFactory::class, $gatewayFactory);

        $ref = new \ReflectionProperty($gatewayFactory, 'coreGatewayFactory');
        $ref->setAccessible(true);

        $this->assertSame($expectedCoreGatewayFactory, $ref->getValue($gatewayFactory));
    }

    /**
     * @test
     */
    public function shouldInjectExpectedOmnipayV3GatewayInstanceAsApi()
    {
        if (false == class_exists(OmnipayGateway::class)) {
            $this->markTestSkipped('Either omnipay or\and omnipay bridge are not installed. Skip');
        }

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->getPayum()
        ;

        $gatewayFactory = $payum->getGatewayFactory('omnipay');

        $this->assertInstanceOf(OmnipayGatewayFactory::class, $gatewayFactory);

        $gateway = $gatewayFactory->create([
            'type' => 'dummy',
        ]);

        $ref = new \ReflectionProperty($gateway, 'apis');
        $ref->setAccessible(true);
        $apis = $ref->getValue($gateway);

        $this->assertCount(2, $apis);
        $this->assertInstanceOf(OmnipayGateway::class, $apis[1]);
        $this->assertEquals('Dummy', $apis[1]->getName());
    }

    /**
     * @test
     */
    public function shouldAddTokenStorageToCoreGatewayConfig()
    {
        $tokenStorageMock = $this->createMock(StorageInterface::class);

        $payum = (new PayumBuilder())
            ->addDefaultStorages()
            ->setTokenStorage($tokenStorageMock)
            ->setCoreGatewayFactory(function ($config) use ($tokenStorageMock) {
                $this->assertIsArray($config);
                $this->assertArrayHasKey('payum.security.token_storage', $config);
                $this->assertSame($tokenStorageMock, $config['payum.security.token_storage']);

                return new CoreGatewayFactory();
            })
            ->getPayum()
        ;
    }

    /**
     * @test
     */
    public function shouldAllowAddCoreGatewayConfig()
    {
        $payumBuilder = new PayumBuilder();

        $payumBuilder->setCoreGatewayFactoryConfig(['foo' => 'fooVal', 'bar' => 'barVal']);
        $ref = new \ReflectionProperty($payumBuilder, 'coreGatewayFactoryConfig');
        $ref->setAccessible(true);

        $this->assertSame(['foo' => 'fooVal', 'bar' => 'barVal'], $ref->getValue($payumBuilder));

        $payumBuilder->addCoreGatewayFactoryConfig(['baz' => 'bazVal', 'foo' => 'fooNewVal']);

        $this->assertSame(['foo' => 'fooNewVal', 'bar' => 'barVal', 'baz' => 'bazVal'], $ref->getValue($payumBuilder));
    }

    /**
     * @test
     */
    public function shouldAllowAddGatewayConfigSeveralTimes()
    {
        $payumBuilder = new PayumBuilder();

        $payumBuilder->addGateway('foo', ['factory' => 'aFactory', 'foo' => 'fooVal', 'bar' => 'barVal']);
        $ref = new \ReflectionProperty($payumBuilder, 'gatewayConfigs');
        $ref->setAccessible(true);

        $this->assertSame(['foo' => ['factory' => 'aFactory', 'foo' => 'fooVal', 'bar' => 'barVal']], $ref->getValue($payumBuilder));

        $payumBuilder->addGateway('foo', ['baz' => 'bazVal', 'foo' => 'fooNewVal']);

        $this->assertSame(['foo' => ['factory' => 'aFactory', 'foo' => 'fooNewVal', 'bar' => 'barVal', 'baz' => 'bazVal']], $ref->getValue($payumBuilder));
    }

    /**
     * @test
     */
    public function shouldAllowAddGatewayFactoryConfigSeveralTimes()
    {
        $payumBuilder = new PayumBuilder();

        $payumBuilder->addGatewayFactoryConfig('foo', ['foo' => 'fooVal', 'bar' => 'barVal']);
        $ref = new \ReflectionProperty($payumBuilder, 'gatewayFactoryConfigs');
        $ref->setAccessible(true);

        $this->assertSame(['foo' => ['foo' => 'fooVal', 'bar' => 'barVal']], $ref->getValue($payumBuilder));

        $payumBuilder->addGatewayFactoryConfig('foo', ['baz' => 'bazVal', 'foo' => 'fooNewVal']);

        $this->assertSame(['foo' => ['foo' => 'fooNewVal', 'bar' => 'barVal', 'baz' => 'bazVal']], $ref->getValue($payumBuilder));
    }

    /**
     * @test
     */
    public function shouldAllowBuildGatewayWithCoreGatewayFactory()
    {
        $payumBuilder = new PayumBuilder();

        $payum = $payumBuilder
            ->addDefaultStorages()
            ->addGateway('foo', ['factory' => 'core'])

            ->getPayum()
        ;

        $gateway = $payum->getGateway('foo');

        $this->assertInstanceOf(Gateway::class, $gateway);
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|RegistryInterface
     */
    protected function createRegistryMock()
    {
        return $this->createMock(RegistryInterface::class);
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|HttpRequestVerifierInterface
     */
    protected function createHttpRequestVerifierMock()
    {
        return $this->createMock(HttpRequestVerifierInterface::class);
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|GenericTokenFactoryInterface
     */
    protected function createGenericTokenFactoryMock()
    {
        return $this->createMock(GenericTokenFactoryInterface::class);
    }
}

class TestModel
{
}


text:
typedef void (^CompleteCallback)(NSString*);

@interface NativeAudioAsset : NSObject<AVAudioPlayerDelegate> {
    NSMutableArray* voices;
    int playIndex;
    NSString* audioId;
    CompleteCallback finished;
    NSNumber *initialVolume;
    NSNumber *fadeDelay;
}

- (id) initWithPath:(NSString*) path withVoices:(NSNumber*) numVoices withVolume:(NSNumber*) volume withFadeDelay:(NSNumber *)delay;
- (void) play;
- (void) playWithFade;
- (void) stop;
- (void) stopWithFade;
- (void) loop;
- (void) unload;
- (void) setVolume:(NSNumber*) volume;
- (void) setCallbackAndId:(CompleteCallback)cb audioId:(NSString*)audioId;
- (void) audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag;
- (void) audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error;
@end


text:
Command for append [Babel](https://github.com/babel/babel) dependencies

### Usage
```
bbt babel <options>
```

See on [best practies](./babel.md#best-practices)

### Available options
```--type, -t``` Setting the type of project
* __choices__ _one of:_ ["front", "service", "back", "standalone", "npm"]
* __type__ _string_

```--presets, --pr``` Set extend presets
* __type__ _array_

```--plugins, -p``` Set plugins
* __type__ _array_

```--fast, -f``` It will use only defaults and not prompt you for most options
* __type__ _boolean_
* __default__ _false_

```--bbt``` Special option for [BlackBird Team](https://github.com/blackbird-team) Tech Rules support
* __type__ _boolean_
* __default__ _false_

# Examples

## Call without options

```
bbt babel
```
On this case you should see dialog for advanced setting required inputs:

__Step 1__

__Step 2__

__Step 3__

__Step 4__

## options ```--fast```
```
bbt babel -f
```
Running the same steps above with setting default values.

You will not see dialog for inputs which have defaults.

## options ```--type```
```
bbt babel -t front
```

## options ```--presets```
```
bbt babel --pr <[array]>
```

## options ```--plugins```
```
bbt babel -p <[array]>
```

## options ```--bbt```
```
bbt babel --bbt
```

# Best Practices
```
bbt babel -t <type> --pr <[array]> -p <[array]>
```


text:
define([
    'background/enum/chromeCommand',
    'common/enum/repeatButtonState'
], function (ChromeCommand, RepeatButtonState) {
    'use strict';

    var RepeatButton = Backbone.Model.extend({
        localStorage: new Backbone.LocalStorage('RepeatButton'),

        defaults: {
            //  Need to set the ID for Backbone.LocalStorage
            id: 'RepeatButton',
            state: RepeatButtonState.Disabled
        },

        initialize: function () {
            //  Load from Backbone.LocalStorage
            this.fetch();

            chrome.commands.onCommand.addListener(this._onChromeCommandsCommand.bind(this));
        },

        toggleRepeatState: function () {
            var nextState = null;

            switch (this.get('state')) {
                case RepeatButtonState.Disabled:
                    nextState = RepeatButtonState.RepeatStream;
                    break;
                case RepeatButtonState.RepeatStream:
                    nextState = RepeatButtonState.RepeatSong;
                    break;
                case RepeatButtonState.RepeatSong:
                    nextState = RepeatButtonState.Disabled;
                    break;
                default:
                    console.error("Unhandled repeatButtonState:", this.state);
                    break;
            }

            this.save({
                state: nextState
            });
        },

        getStateMessage: function () {
            var message = '';
            switch (this.get('state')) {
                case RepeatButtonState.Disabled:
                    message = chrome.i18n.getMessage('repeatDisabled');
                    break;
                case RepeatButtonState.RepeatSong:
                    message = chrome.i18n.getMessage('repeatSongEnabled');
                    break;
                case RepeatButtonState.RepeatStream:
                    message = chrome.i18n.getMessage('repeatStreamEnabled');
            }

            return message;
        },

        _onChromeCommandsCommand: function (command) {
            if (command === ChromeCommand.ToggleRepeat) {
                this.toggleRepeatState();

                Streamus.channels.backgroundNotification.commands.trigger('show:notification', {
                    message: this.getStateMessage()
                });
            }
        }
    });

    return RepeatButton;
});


text:
package com.hannesdorfmann.mosby3.mvp.delegate;

import android.app.Activity;
import android.support.annotation.NonNull;
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
import com.hannesdorfmann.mosby3.mvp.MvpView;

/**
 * The MvpDelegate callback that will be called from  {@link
 * FragmentMvpDelegate} or {@link ViewGroupMvpDelegate}. This interface must be implemented by all
 * Fragment or android.view.View that you want to support mosbys mvp. Please note that Activties
 * need a special callback {@link ActivityMvpDelegateCallback}
 *
 * @param <V> The type of {@link MvpView}
 * @param <P> The type of {@link MvpPresenter}
 * @author Hannes Dorfmann
 * @see ActivityMvpDelegateCallback
 * @since 1.1.0
 */
public interface MvpDelegateCallback<V extends MvpView, P extends MvpPresenter<V>> {

  /**
   * Creates the presenter instance
   *
   * @return the created presenter instance
   */
  @NonNull P createPresenter();

  /**
   * Get the presenter. If null is returned, then a internally a new presenter instance gets
   * created
   * by calling {@link #createPresenter()}
   *
   * @return the presenter instance. can be null.
   */
  P getPresenter();

  /**
   * Sets the presenter instance
   *
   * @param presenter The presenter instance
   */
  void setPresenter(P presenter);

  /**
   * Get the MvpView for the presenter
   *
   * @return The view associated with the presenter
   */
  V getMvpView();
}


text:
.. index:: StreamURLs

StreamURLs
***********

StreamURLs und deren Verbreitungskanäle bilden in Streaming-Infrastrukturen die wichtigste Schnittstelle für die Verbreitung digitaler Radio-Kanäle im Netz.

Ihnen gilt ganz besondere Aufmerksamkeit. Ihre Systematisierung ist wichtig und spielt gerade beim Betrieb von sehr vielen Audiostreams eine große Rolle.

Um so mehr Verbreitung die StreamURL durch Aggregatoren wie z.B. TuneIn, radio.de, etc. erfahren, desto größer ist die sogenannte `technische Reichweite <https://de.wikipedia.org/wiki/Technische_Reichweite>`_ des Streams.
Es gilt, je mehr Verbreitung die StreamURL erfährt, desto mehr Personen werden den Stream hören können.
Eigene Apps und Websites erhöhen auch die technische Reichweite.

----

.. index:: StreamURLs Schema
.. index:: Aufbau StreamURLs

Nach welchem Schema sind die StreamURLs aufgebaut?
--------------------------------------------------
Es erfolgt eine Systematisierung der StreamURLs nach folgendem Schema:

`https://domain/programm/format/aggregator/listenerid/`

----

.. index:: StreamURLs & Aggreagtoren
.. index:: Aggreagtoren messen

Wie ist es möglich mit der StreamURL die jeweiligen Reichweiten von Homepage, Apps und Aggreagtoren zu messen?
--------------------------------------------------------------------------------------------------------------
Um zu messen, wieviel Hörer den Stream z.B. über die Homepage hören, dafür muss an die StreamURL lediglich das Wort 'Homepage' angehangen werden und auf der Homepage verlinkt werden..

z.B.

\https://domain/programm/format/**Homepage/**

Das Gleiche gilt auch für jeden anderen Aggreagtor. Zum Beispiel in der App diese URL nutzen:

\https://domain/programm/format/**App/**

oder an TuneIn diese StreamURL weitergeben:

\https://domain/programm/format/**Tunein/**

----

.. index:: Hörer-ID an StreamURL übergeben
.. index:: Hörer-ID für Capping übergeben

Kann ich mit der StreamURL eine eindeutige Hörer-ID übergeben?
--------------------------------------------------------------
Um das Capping für Werbeausspielung zu optimieren, kann eine vom Player erzeugte Hörer-ID an die StreamURL gehängt werden.

z.B.

\http://domain/programm/format/Homepage/**Hörer-ID/**

Die Hörer-ID muss als weiterer Teil des URL-Path nach dem Aggregator angegeben werden. Die Hörer-ID kann ein alphanumerischer Wert sein.

\http://domain/programm/format/App/**ak446W4ggg12UU8/**

----

.. index:: Https-StreamURLs

Ist Https für die StreamURLs und Audiostreams verfügbar?
--------------------------------------------------------
Ja, für alle Streams ist https aktiviert.

----

.. index:: individuelle StreamURL-Domain
.. index:: DNS-Eintrag für StreamURL-Domain

Ist es möglich eine eigene Domain für die StreamURLs zu nutzen?
---------------------------------------------------------------
Ja. Es ist möglich, eine individuelle StreamURL-Domain eintragen zu lassen.
Dafür bitte innerhalb der |Console| den Bereich "StreamURLs" -> "Domain hinzufügen / löschen" aufrufen.
Unter "System StreamURL-Domänen" finden Sie ihrer aktuell eingerichtete StreamURL-Domain.

Sie müssen nun im DNS für die gewünschte Domain einen CNAME auf ihrer aktuell eingerichtete StreamURL-Domain einrichten:
z.B.
    streams.meine-domain.de IN CNAME  {system-name}.stream.vip.

Anschließend uns kurz Bescheid geben. Dafür bitte ein Ticket öffnen: https://streamabc.zammad.com

Wir schalten dann ihre individuelle StreamURL-Domain frei.

----

Bei weiteren Fragen bitte ein Ticket öffnen: |helpdesk|

Besuchen Sie unsere Unternehmens-Website |www.quantumcast-digital.de|

.. |helpdesk| raw:: html

    https://streamabc.zammad.com

.. |www.quantumcast-digital.de| raw:: html

   www.quantumcast-digital.de

.. |Console| raw:: html

   Console


text:
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Primitives;

namespace Microsoft.Extensions.FileProviders.Embedded.Manifest;

internal class ManifestDirectory : ManifestEntry
{
    protected ManifestDirectory(string name, ManifestEntry[] children)
        : base(name)
    {
        if (children == null)
        {
            throw new ArgumentNullException(nameof(children));
        }

        Children = children;
    }

    public IReadOnlyList<ManifestEntry> Children { get; protected set; }

    public override ManifestEntry Traverse(StringSegment segment)
    {
        if (segment.Equals(".", StringComparison.Ordinal))
        {
            return this;
        }

        if (segment.Equals("..", StringComparison.Ordinal))
        {
            return Parent ?? UnknownPath;
        }

        foreach (var child in Children)
        {
            if (segment.Equals(child.Name, StringComparison.OrdinalIgnoreCase))
            {
                return child;
            }
        }

        return UnknownPath;
    }

    public virtual ManifestDirectory ToRootDirectory() => CreateRootDirectory(CopyChildren());

    public static ManifestDirectory CreateDirectory(string name, ManifestEntry[] children)
    {
        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException($"'{nameof(name)}' must not be null, empty or whitespace.", nameof(name));
        }

        if (children == null)
        {
            throw new ArgumentNullException(nameof(children));
        }

        var result = new ManifestDirectory(name, children);
        ValidateChildrenAndSetParent(children, result);

        return result;
    }

    public static ManifestRootDirectory CreateRootDirectory(ManifestEntry[] children)
    {
        if (children == null)
        {
            throw new ArgumentNullException(nameof(children));
        }

        var result = new ManifestRootDirectory(children);
        ValidateChildrenAndSetParent(children, result);

        return result;
    }

    internal static void ValidateChildrenAndSetParent(ManifestEntry[] children, ManifestDirectory parent)
    {
        foreach (var child in children)
        {
            if (child == UnknownPath)
            {
                throw new InvalidOperationException($"Invalid entry type '{nameof(ManifestSinkDirectory)}'");
            }

            if (child is ManifestRootDirectory)
            {
                throw new InvalidOperationException($"Can't add a root folder as a child");
            }

            child.SetParent(parent);
        }
    }

    private ManifestEntry[] CopyChildren()
    {
        var list = new List<ManifestEntry>(Children.Count);
        for (var i = 0; i < Children.Count; i++)
        {
            var child = Children[i];
            switch (child)
            {
                case ManifestSinkDirectory:
                case ManifestRootDirectory:
                    throw new InvalidOperationException("Unexpected manifest node.");
                case ManifestDirectory d:
                    var grandChildren = d.CopyChildren();
                    var newDirectory = CreateDirectory(d.Name, grandChildren);
                    list.Add(newDirectory);
                    break;
                case ManifestFile f:
                    var file = new ManifestFile(f.Name, f.ResourcePath);
                    list.Add(file);
                    break;
                default:
                    throw new InvalidOperationException("Unexpected manifest node.");
            }
        }

        return list.ToArray();
    }
}


text:
layout: data_model
title: DNSQueryObjectType
this_version: 4.1
---

DNSQueryObjectTypeDNS Query Object Schema

      <form id="nav-version">
        <select>

            <option value="4.1" selected="selected">MAEC 4.1</option>

        </select>
      </form>

The DNSQueryType is intended to characterize a single DNS query and its components.

      Field Name
      Type
      Description

      @object_referenceoptional

          QName

The object_reference field specifies a unique ID reference to an Object defined elsewhere. This construct allows for the re-use of the defined Properties of one Object within another, without the need to embed the full Object in the location from which it is being referenced. Thus, this ID reference is intended to resolve to the Properties of the Object that it points to.

      Custom_Properties0..1

          CustomPropertiesType

The Custom_Properties construct is optional and enables the specification of a set of custom Object Properties that may not be defined in existing Properties schemas.

      @successfuloptional

          boolean

The successful field specifies whether or not the DNS Query was successful.

      Transaction_ID0..1

          HexBinaryObjectPropertyType

The Transaction_ID field specifies the Transaction ID value of the DNS query message header.

      Question0..1

          DNSQuestionType

The Question field specifies the DNS question component of the DNS query.

      Answer_Resource_Records0..1

          DNSResourceRecordsType

The Answers field specifies any Answers resource records that were returned for the DNS query.

      Authority_Resource_Records0..1

          DNSResourceRecordsType

The Authority_Resource_Records field specifies any Authority resource records that were returned for the DNS query.

      Additional_Records0..1

          DNSResourceRecordsType

The Authority_Resource_Records field specifies any Additional resource records that were returned for the DNS query.

      Date_Ran0..1

          DateTimeObjectPropertyType

The Date_Ran field specifies the date and time that the DNS query was run.

      Service_Used0..1

          StringObjectPropertyType

The Service_Used field specifies the service used to run the DNS Query.


text:
const { basename, relative, dirname } = require('path')
const { write } = require('./fs-promise')

const IMG_PLACEHOLDER = 'SPRITE.png'

/**
 * generate style
 * @param  {Array}   infoList                The images (merged to sprite) info list, generated by `generateSprite`
 * @param  {Object}  options                 options
           {String}         options.connector       className connector, default to "-"
           {String}         options.prefix          className prefix, default to "icon"
           {String}         options.suffix          className suffix
           {String}         options.eol             new line
           {Boolean}        options.retina          generate retina style
           {Boolean}        options.writeToFile     whether write style to file
           {String}         options.stylePath       style path
           {String}         options.imagePath       image path
           {String}         options.retinaImagePath retina image path
           {Boolean|String} options.banner          banner
 * @return {String}                          generated style text
 */
function generateStyle (infoList, {
    connector = '-',
    prefix = 'icon',
    suffix = '',
    eol,
    retina = false,
    writeToFile = false,
    stylePath,
    imagePath,
    retinaImagePath,
    banner = false
} = {}) {
    if (!infoList || !infoList.length) {
        return Promise.reject('invalid arguments')
    }

    // adjust options
    if (!imagePath) {
        imagePath = IMG_PLACEHOLDER
    } else {
        imagePath = stylePath ? relative(dirname(stylePath), imagePath) : imagePath
    }
    if (!retinaImagePath) {
        retinaImagePath = imagePath.replace(/(\.\w+)$/i, `@2x$1`)
    } else {
        retinaImagePath = stylePath ? relative(dirname(stylePath), retinaImagePath) : retinaImagePath
    }
    if (eol == null) {
        eol = require('os').EOL
    }
    if (typeof banner !== 'string') {
        banner = banner ? `/**${eol}* Created at ${new Date().toLocaleString()}.${eol}**/${eol}` : ''
    }

    // generate style
    const retinaBackgroundImage = retina ? `background-image: -webkit-image-set(url(${imagePath}) 1x, url(${retinaImagePath}) 2x);` : ''

    let style = `${banner}.${prefix} {${
        eol}    display: inline-block;${
        eol}    background-repeat: no-repeat;${
        eol}    background-image: url(${imagePath});${
        eol}`
    style += retinaBackgroundImage ? `    ${retinaBackgroundImage}${eol}}` : '}'
    infoList.forEach(({ x, y, width, height, margin, path }) => {
        let name = basename(path)
        let css = `.${prefix + connector + name.slice(0, name.lastIndexOf('.')) + (suffix ? connector + suffix : '')} {${
            eol}    background-position: ${-x - margin / 2}px ${-y - margin / 2}px;${
            eol}    width: ${width - margin}px;${
            eol}    height: ${height - margin}px;${
        eol}}`
        style += eol + css
    })

    return (writeToFile && stylePath)
        ? write(stylePath, style, { encoding: 'utf8' }, true).then(() => style)
        : Promise.resolve(style)
}

module.exports = generateStyle


text:
import unittest
import sys
import os
from io import StringIO
from ios_code_generator.generators import generate

__author__ = 'banxi'

def test_data_model():
    strio = StringIO(u"-User(tos,hash,eq,ctor)\nid:i;url:[u;title;author:r;follows(type=Follow):[r;counts:[i;created:di;realname\n")
    sys.stdin = strio
    text = generate("model")
    print(text)

def test_refModel():
    strio = StringIO(u"-ShopCard\nshopCardBase:r;shopCardLog(field=logs):[r\n")
    sys.stdin = strio
    text = generate("model")
    print(text)

def test_with_underscore():
    strio = StringIO(u"""
PlayerInfo
userid;nickname;avatar:u;buyin:i;income:i;permission:i
    """)
    sys.stdin = strio
    text = generate("model")
    print(text)

def test_json2fields():
    strio = StringIO(u''' "id":"20", "name":"\u4e1c\u76df\u7ecf\u6d4e\u5f00\u53d1\u533a", "distrct":[ ] ''')
    sys.stdin = strio


text:
import hasClass from './../hasClass';

export function clickList(e, store, catalog, team) {
    if (hasClass(e.target,'galleryBlock__up') || hasClass(e.target.parentNode,'galleryBlock__up')) {
        let input = e.target;
        let id = input.closest('.block').getAttribute('data-block-id');
        let subblockId = input.closest('.subblock').getAttribute('data-subblock-id');
        let block = input.closest('.block');
        let subblock = input.closest('.subblock');
        let prevBlock = subblock.previousSibling;
        if (subblock != subblock.parentNode.firstChild && prevBlock) {
            subblock.parentNode.insertBefore(subblock, prevBlock);
            store.dispatch({type: 'SET_IMAGE_UP', blockId: id, subblockId: subblockId});
        }
    }

    if (hasClass(e.target,'galleryBlock__down') || hasClass(e.target.parentNode,'galleryBlock__down')) {
        let input = e.target;
        let id = input.closest('.block').getAttribute('data-block-id');
        let subblockId = input.closest('.subblock').getAttribute('data-subblock-id');
        let block = input.closest('.block');
        let subblock = input.closest('.subblock');
        let nextBlock = subblock.nextSibling;
        if (subblock != subblock.parentNode.lastChild && nextBlock) {
            nextBlock.parentNode.insertBefore(nextBlock, subblock);
            store.dispatch({type: 'SET_IMAGE_DOWN', blockId: id, subblockId: subblockId});
        }

    }

    if (hasClass(e.target,'galleryBlock__delete') || hasClass(e.target.parentNode,'galleryBlock__delete')) {
        let input = e.target;
        let id = input.closest('.block').getAttribute('data-block-id');
        let subblockId = input.closest('.subblock').getAttribute('data-subblock-id');
        let block = input.closest('.block');
        let subblock = input.closest('.subblock');
        let parent = subblock.parentNode;
        parent.removeChild(subblock);
        store.dispatch({type: 'DELETE_IMAGE', blockId: id, subblockId: subblockId});
    }

    if (hasClass(e.target, 'addImageButton')) {
        let state = store.getState();
        let blockId = e.target.closest('.block').getAttribute('data-block-id');
        let id = 0;
        let blockIndex = 0;
        if (state.content) {
            for (let i= 0; i<state.content.length; i++) {
                if (state.content[i].blockId == blockId) {
                    blockIndex = i;
                    break;
                }
            }
            if (state.content[blockIndex].content) {
                for (let i = 0; i < state.content[blockIndex].content.length; i++) {
                    if (state.content[blockIndex].content[i].subBlockId >= id) {
                        id = state.content[blockIndex].content[i].subBlockId + 1;
                    }
                }
            }
        }
        let html = ``;
        if (hasClass(e.target, 'addImageButtonTeam')) {
            html = `<button class="galleryBlock__up"></button>
            <button class="galleryBlock__down"></button>
            <button class="galleryBlock__delete"></button>

                    Podpis
                    <input type="text" name="block-gallery__title" class="block-gallery__text block-gallery__input block-gallery__title" placeholder="np. Projekt budynku">

`;
        } else {
            html = `<button class="galleryBlock__up"></button>
            <button class="galleryBlock__down"></button>
            <button class="galleryBlock__delete"></button>

                    Podpis
                    <input type="text" name="block-gallery__title" class="block-gallery__text block-gallery__input block-gallery__title" placeholder="np. Projekt budynku">

                Wybrane zdjęcie

`;
        }
        let node = document.createElement('div');
        node.className = 'subblock galleryBlock__subblock';
        node.setAttribute('data-subblock-id',id);
        node.innerHTML = html;
        let qs = '[data-block-id="'+blockId+'"] .galleryBlock-container';
        let container = document.querySelector(qs);
        container.appendChild(node);
        if (hasClass(e.target, 'addImageButtonTeam')) {
            teamPost(blockId, id, team);
        } else {
            galleryPost(blockId, id,catalog);
        }
        store.dispatch({type: 'CREATE_IMAGE', blockId: blockId, subblockId: id});
    }
}

function galleryPost(blockId, subBlockId,catalog) {
    let html = '';
    var timestamp = Date.now();
    catalog.forEach(function(dir){
        let subhtml = '';
        dir.photos.forEach(function(pic) {
            subhtml += '
<input type="radio" name="img-'+blockId+'-'+subBlockId+'" class="block-gallery__image" id="'+dir.path+'/'+pic.path+'-'+blockId+'-'+subBlockId+'" value="'+dir.path+'/'+pic.path+'">
';
    }, this);
        html += '

'+dir.path+'

'+subhtml+'
';
    }, this);
    let qs = `[data-block-id="${blockId}"] [data-subblock-id="${subBlockId}"] .block-gallery__wrapper-image`;
    let radioContainer = document.querySelector(qs);
    if (radioContainer) {
        let p = document.createElement('div');
        p.innerHTML = html;
        radioContainer.appendChild(p);
    }
}

function teamPost(blockId, subBlockId, team) {
    let html = '';
    team.forEach(function(pic) {
        html += '
<input type="radio" name="img-'+blockId+'-'+subBlockId+'" class="block-gallery__image" id="'+pic+'-'+blockId+'-'+subBlockId+'" value="'+pic+'">
';
    }, this);
    let qs = `[data-block-id="${blockId}"] [data-subblock-id="${subBlockId}"] .block-gallery__wrapper-image`;
    let radioContainer = document.querySelector(qs);
    if (radioContainer) {
        let p = document.createElement('div');
        p.innerHTML = html;
        radioContainer.appendChild(p);
    }
}

export function blurList(e, store) {
    if (hasClass(e.target,'block-gallery__title')) {
        let input = e.target;
        let id = input.closest('.block').getAttribute('data-block-id');
        let subBlock = input.closest('.subblock').getAttribute('data-subblock-id');
        let title = e.target.value;
        store.dispatch({type: 'SET_IMAGE_TITLE', blockId: id, subblockId: subBlock, title: title});
    }

    if (hasClass(e.target,'block-gallery__section-title')) {
        let input = e.target;
        let id = input.closest('.block').getAttribute('data-block-id');
        let title = e.target.value;
        store.dispatch({type: 'SET_BLOCK_GALLERY_TITLE', blockId: id, title: title});
    }
}

export function changeList(e, store) {
    if (hasClass(e.target,'block-gallery__image')) {
        let input = e.target;
        let id = input.closest('.block').getAttribute('data-block-id');
        let subId = input.closest('.subblock').getAttribute('data-subblock-id');
        let img = e.target.value;
        store.dispatch({type: 'SET_IMAGE', blockId: id, subblockId: subId, img: img});
    }
}


text:
#pragma once
#include <aws/organizations/Organizations_EXPORTS.h>
#include <aws/organizations/OrganizationsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/organizations/model/PolicyType.h>
#include <utility>

namespace Aws
{
namespace Organizations
{
namespace Model
{

  /**
   */
  class AWS_ORGANIZATIONS_API EnablePolicyTypeRequest : public OrganizationsRequest
  {
  public:
    EnablePolicyTypeRequest();
    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline const Aws::String& GetRootId() const{ return m_rootId; }

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline void SetRootId(const Aws::String& value) { m_rootIdHasBeenSet = true; m_rootId = value; }

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline void SetRootId(Aws::String&& value) { m_rootIdHasBeenSet = true; m_rootId = std::move(value); }

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline void SetRootId(const char* value) { m_rootIdHasBeenSet = true; m_rootId.assign(value); }

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline EnablePolicyTypeRequest& WithRootId(const Aws::String& value) { SetRootId(value); return *this;}

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline EnablePolicyTypeRequest& WithRootId(Aws::String&& value) { SetRootId(std::move(value)); return *this;}

    /**
     *
The unique identifier (ID) of the root in which you want to enable a policy
     * type. You can get the ID from the ListRoots operation.

The regex pattern for a root ID string
     * requires "r-" followed by from 4 to 32 lower-case letters or digits.

     */
    inline EnablePolicyTypeRequest& WithRootId(const char* value) { SetRootId(value); return *this;}

    /**
     *
The policy type that you want to enable.

     */
    inline const PolicyType& GetPolicyType() const{ return m_policyType; }

    /**
     *
The policy type that you want to enable.

     */
    inline void SetPolicyType(const PolicyType& value) { m_policyTypeHasBeenSet = true; m_policyType = value; }

    /**
     *
The policy type that you want to enable.

     */
    inline void SetPolicyType(PolicyType&& value) { m_policyTypeHasBeenSet = true; m_policyType = std::move(value); }

    /**
     *
The policy type that you want to enable.

     */
    inline EnablePolicyTypeRequest& WithPolicyType(const PolicyType& value) { SetPolicyType(value); return *this;}

    /**
     *
The policy type that you want to enable.

     */
    inline EnablePolicyTypeRequest& WithPolicyType(PolicyType&& value) { SetPolicyType(std::move(value)); return *this;}

  private:
    Aws::String m_rootId;
    bool m_rootIdHasBeenSet;
    PolicyType m_policyType;
    bool m_policyTypeHasBeenSet;
  };

} // namespace Model
} // namespace Organizations
} // namespace Aws


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

<title>TopValuesAggregateResult (orchestrate-java-client 0.11.1 API)</title>
<meta name="date" content="2015-09-01">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

io.orchestrate.client

Class TopValuesAggregateResult

java.lang.Object

io.orchestrate.client.AggregateResult

io.orchestrate.client.TopValuesAggregateResult

public class TopValuesAggregateResult
extends AggregateResult

This class represents the results of a TopValuesAggregate function, providing
 the minimum, maximum, mean, sum, sum-of-squares, variance, and standard
 deviation for all numeric field values of the designated database field.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.util.List<CountedValue>
getEntries()

Returns the paged list of entries for this top-values aggregate, with paging
 corresponding to the offset and limit parameters of the original request.

double
getLimit()

Returns the limit parameter for this top-values aggregate, as designated in the
 original request.

int
getOffset()

Returns the offset parameter for this top-values aggregate, as designated in the
 original request.

Methods inherited from class io.orchestrate.client.AggregateResult

getAggregateKind, getFieldName, getValueCount

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getEntries

public java.util.List<CountedValue> getEntries()

Returns the paged list of entries for this top-values aggregate, with paging
 corresponding to the offset and limit parameters of the original request.

Returns:

getOffset

public int getOffset()

Returns the offset parameter for this top-values aggregate, as designated in the
 original request. This param represents the index of the first top-values result
 entry to return in this paged result set. If the full aggregate result set contains
 fewer unique values than requested, this paged aggregate result set will be empty.

Returns:

the offset parameter

getLimit

public double getLimit()

Returns the limit parameter for this top-values aggregate, as designated in the
 original request. This param represents the maximum number of entries to return
 in this paged result set. However, if the full aggregate result set contains
 fewer unique values than the sum of the offset plus limit, then the paged
 aggregate result may have fewer items than requested.

Returns:

the limit parameter

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Visao;

import Thread.Recipient;
import Thread.ThreadArquivo;
import Thread.ThreadResultadoArquivo;
import Util.Utilitarios;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
 *
 * @author Jonathan
 */
public class FrmArquivo extends javax.swing.JFrame {

    public File arquivo;
    Utilitarios util;

    /**
     * Creates new form FrmArquivo
     */
    public FrmArquivo() {
        initComponents();
        util = new Utilitarios();
        this.setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlArquivo = new javax.swing.JPanel();
        btnSelecionar = new javax.swing.JButton();
        btnProcessar = new javax.swing.JButton();
        btnSair = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        lblExtensao = new javax.swing.JLabel();
        lblNome = new javax.swing.JLabel();
        lblRegistros = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        pnlArquivo.setBorder(javax.swing.BorderFactory.createTitledBorder("Envio de Arquivo"));

        btnSelecionar.setText("SELECIONAR");
        btnSelecionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSelecionarActionPerformed(evt);
            }
        });

        btnProcessar.setText("PROCESSAR");
        btnProcessar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProcessarActionPerformed(evt);
            }
        });

        btnSair.setText("SAIR");
        btnSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSairActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações"));

        jLabel1.setText("Nome:");

        jLabel2.setText("Extensão:");

        jLabel3.setText("Registros:");

        lblExtensao.setText("-");

        lblNome.setText("-");

        lblRegistros.setText("-");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblRegistros, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblExtensao, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(lblNome))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(lblExtensao))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(lblRegistros))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout pnlArquivoLayout = new javax.swing.GroupLayout(pnlArquivo);
        pnlArquivo.setLayout(pnlArquivoLayout);
        pnlArquivoLayout.setHorizontalGroup(
            pnlArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlArquivoLayout.createSequentialGroup()
                .addGroup(pnlArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(pnlArquivoLayout.createSequentialGroup()
                        .addComponent(btnSelecionar)
                        .addGap(18, 18, 18)
                        .addComponent(btnProcessar)
                        .addGap(12, 12, 12)
                        .addComponent(btnSair, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlArquivoLayout.setVerticalGroup(
            pnlArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlArquivoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(pnlArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSelecionar)
                    .addComponent(btnProcessar)
                    .addComponent(btnSair))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlArquivo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlArquivo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnSelecionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSelecionarActionPerformed
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setCurrentDirectory(new File(System.getProperty("user.home")));
        int result = fileChooser.showOpenDialog(jLabel1);
        if (result == JFileChooser.APPROVE_OPTION)
        {
            arquivo = fileChooser.getSelectedFile();

            String extension = "";

            int i = arquivo.getName().lastIndexOf('.');
            if (i > 0) {
                extension = arquivo.getName().substring(i+1);
            }

            if("ret".equals(extension.toLowerCase()))
            {
                lblNome.setText(arquivo.getName());
                lblExtensao.setText(extension);
            }
            else
            {
                JOptionPane.showMessageDialog(fileChooser, "O arquivo selecionado não contém a extensão permitida *.RET");
                arquivo = null;
            }
        }
    }//GEN-LAST:event_btnSelecionarActionPerformed

    private void btnProcessarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProcessarActionPerformed
        if(arquivo == null)
            JOptionPane.showMessageDialog(rootPane, "Importe um arquivo antes de processar");
        else
        {
            try
            {
                JOptionPane.showMessageDialog(rootPane, "Processando...enquanto isso, você pode continuar usando o sistema normalmente");
                processarArquivo(arquivo);
            }
            catch
            (IOException ex)
            {
                Logger.getLogger(FrmArquivo.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
    }//GEN-LAST:event_btnProcessarActionPerformed

    private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
        util.fecharJanela(this);
    }//GEN-LAST:event_btnSairActionPerformed

    private void processarArquivo(File file) throws FileNotFoundException, IOException
    {
        Recipient stack = new Recipient();

        List<String> linhas = new ArrayList();
        try
        {
            BufferedReader br = new BufferedReader(new FileReader(file));
            String line = br.readLine();

            while (line != null)
            {
                linhas.add(line);
                line = br.readLine();
            }
            br.close();
        }
        catch(FileNotFoundException ex)
        {
            throw new FileNotFoundException("Erro ao processar arquivo" + ex.getMessage());
        }

        //Run this shit
        Thread thread = new Thread(new ThreadArquivo(stack, linhas));
        Thread threadresultado = new Thread(new ThreadResultadoArquivo(stack, linhas.size()));
        thread.start();
        threadresultado.start();
        System.out.println("Threads iniciadas");
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmArquivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmArquivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmArquivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmArquivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmArquivo().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnProcessar;
    private javax.swing.JButton btnSair;
    private javax.swing.JButton btnSelecionar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel lblExtensao;
    private javax.swing.JLabel lblNome;
    private javax.swing.JLabel lblRegistros;
    private javax.swing.JPanel pnlArquivo;
    // End of variables declaration//GEN-END:variables
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="5dp"
        android:src="@drawable/unit0" />

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/imageView1"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="5dp"
        android:gravity="center_horizontal"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Medium Text"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="@color/black" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/textView1"
            android:text="Small Text"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@color/black" />
    </LinearLayout>

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@id/linearLayout1"
        android:layout_alignLeft="@id/imageView1"
        android:layout_alignRight="@id/imageView1"
        android:layout_alignTop="@id/imageView1"
        android:src="@drawable/rate0" />

</RelativeLayout>


text:
require "spec_helper"
require "./lib/fusuma/plugin/events/event"

module Fusuma
  module Plugin
    module Events
      RSpec.describe Event do
        let(:event) { Event.new(**args) }
        let(:args) { {tag: "text", record: "dummy_text"} }

        before {
          allow(Records::Record).to receive(:inherited) # disable autoload
          stub_const("DummyRecord", Class.new(Records::Record))
        }

        describe "#record" do
          context "with text" do
            it { expect(event.record).to be_a Records::Record }
          end

          context "with Record" do
            let(:args) { {tag: "dummy_record", record: DummyRecord.new} }

            it { expect(event.record).to be_a Records::Record }
          end
        end
      end
    end
  end
end


text:
package com.zimbra.qa.selenium.projects.desktop.tests.mail.compose;

import java.util.HashMap;

import org.testng.annotations.Test;

import com.zimbra.qa.selenium.framework.items.MailItem;
import com.zimbra.qa.selenium.framework.items.RecipientItem;
import com.zimbra.qa.selenium.framework.ui.Button;
import com.zimbra.qa.selenium.framework.util.GeneralUtility;
import com.zimbra.qa.selenium.framework.util.HarnessException;
import com.zimbra.qa.selenium.framework.util.ZAssert;
import com.zimbra.qa.selenium.framework.util.ZimbraAccount;
import com.zimbra.qa.selenium.framework.util.ZimbraSeleniumProperties;
import com.zimbra.qa.selenium.projects.desktop.core.AjaxCommonTest;
import com.zimbra.qa.selenium.projects.desktop.ui.mail.FormMailNew;

public class CreateMailHtml extends AjaxCommonTest {

	@SuppressWarnings("serial")
	public CreateMailHtml() {
		logger.info("New "+ CreateMailHtml.class.getCanonicalName());

		// All tests start at the login page
		super.startingPage = app.zPageMail;
		super.startingAccountPreferences = new HashMap<String , String>() {{
				    put("zimbraPrefComposeFormat", "html");
				}};

	}

	@Test(	description = "Send a mail using HTML editor",
			groups = { "sanity" })
	public void CreateMailHtml_01() throws HarnessException {

		// Create the message data to be sent
		MailItem mail = new MailItem();
		mail.dToRecipients.add(new RecipientItem(ZimbraAccount.AccountA()));
		mail.dSubject = "subject" + ZimbraSeleniumProperties.getUniqueString();
		mail.dBodyText = "body" + ZimbraSeleniumProperties.getUniqueString();

		// Open the new mail form
		FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_NEW);
		ZAssert.assertNotNull(mailform, "Verify the new form opened");

		// Fill out the form with the data
		mailform.zFill(mail);

		// Send the message
		mailform.zSubmit();

		GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount());

      MailItem received = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:("+ mail.dSubject +")");

		// TODO: add checks for TO, Subject, Body
		ZAssert.assertEquals(received.dFromRecipient.dEmailAddress, app.zGetActiveAccount().EmailAddress, "Verify the from field is correct");
		ZAssert.assertEquals(received.dToRecipients.get(0).dEmailAddress, ZimbraAccount.AccountA().EmailAddress, "Verify the to field is correct");
		ZAssert.assertEquals(received.dSubject, mail.dSubject, "Verify the subject field is correct");
		ZAssert.assertStringContains(received.dBodyText, mail.dBodyText, "Verify the body field is correct");

	}

}


text:
Seedpod::Application.routes.draw do

  mount RailsAdmin::Engine => '/administration', :as => 'rails_admin'

  devise_for :admins
  devise_for :users, controllers: { registrations: "registrations", sessions: "sessions" }

  resources :users, only: [] do
    resource :subscription, only: [:new] do
      get :confirm
    end
  end

  resources :pods do
    get :getting_started, on: :collection
    get :preview, on: :collection
    get :this_month, on: :collection
    resources :shipments
  end

  resources :gift_codes do
    get :confirm
    get :cancel
  end

  post "/webhooks/gocardless" => "subscriptions#gocardless_webhook", as: 'gocardless_webhook'

  root to: "pods#index"
end