text:
<?php
namespace LSI\SystemBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class DailyStatsForm extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('day_of_week', 'hidden')
            ->add('hours_worked', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6')))
            ->add('doors_knocked', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6')))
            ->add('contacts_made', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6')))
            ->add('demos_given', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6')))
            ->add('referrals_received', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6')))
            ->add('customers', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6','disabled'=>'disabled')))
            ->add('sets_sold', 'text',array('label'=>false,'attr'=>array('class'=>'col-xs-6','disabled'=>'disabled')));
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'LSI\SystemBundle\Entity\RepDailyReport',
        ));
    }

    public function getName()
    {
        return 'lsi_system_dailystats';
    }

}


text:
var assert = require('assert');
var NumberFormatter = require('../../lib/utils/NumberFormatter');

describe('NumberFormatter', function() {

  it('should create a new NumberFormatter', function () {
    assert.deepEqual(new NumberFormatter(0),        {sign: '', coefficients: [0], exponent: 0});
    assert.deepEqual(new NumberFormatter(2.3),      {sign: '', coefficients: [2, 3], exponent: 0});

    var a = new NumberFormatter(2.3);
    assert.strictEqual(a.coefficients[0], 2);
    assert.strictEqual(a.coefficients[1], 3);
    assert.strictEqual(a.exponent, 0);

    assert.deepEqual(new NumberFormatter(-2.3),     {sign: '-', coefficients: [2, 3], exponent: 0});
    assert.deepEqual(new NumberFormatter('02.3'),   {sign: '', coefficients: [2, 3], exponent: 0});
    assert.deepEqual(new NumberFormatter(2300),     {sign: '', coefficients: [2, 3], exponent: 3});
    assert.deepEqual(new NumberFormatter(0.00023),  {sign: '', coefficients: [2, 3], exponent: -4});
    assert.deepEqual(new NumberFormatter('0.00023'),{sign: '', coefficients: [2, 3], exponent: -4});
    assert.deepEqual(new NumberFormatter('000.0002300'),  {sign: '', coefficients: [2, 3], exponent: -4});
    assert.deepEqual(new NumberFormatter('002300'), {sign: '', coefficients: [2, 3], exponent: 3});
    assert.deepEqual(new NumberFormatter('2.3e3'),  {sign: '', coefficients: [2, 3], exponent: 3});
    assert.deepEqual(new NumberFormatter('2.3e+3'),  {sign: '', coefficients: [2, 3], exponent: 3});
    assert.deepEqual(new NumberFormatter('-2.3e3'), {sign: '-', coefficients: [2, 3], exponent: 3});
    assert.deepEqual(new NumberFormatter('23e3'),   {sign: '', coefficients: [2, 3], exponent: 4});
    assert.deepEqual(new NumberFormatter('-23e3'),  {sign: '-', coefficients: [2, 3], exponent: 4});
    assert.deepEqual(new NumberFormatter('2.3e-3'), {sign: '', coefficients: [2, 3], exponent: -3});
    assert.deepEqual(new NumberFormatter('23e-3'),  {sign: '', coefficients: [2, 3], exponent: -2});
    assert.deepEqual(new NumberFormatter('-23e-3'),  {sign: '-', coefficients: [2, 3], exponent: -2});
    assert.deepEqual(new NumberFormatter('99.99'),  {sign: '', coefficients: [9,9,9,9], exponent: 1});
  });

  it('should clone a NumberFormatter', function () {
    var a = new NumberFormatter(2.3);
    var clone = a.clone();
    assert.deepEqual(clone, a);
    assert.notStrictEqual(clone, a);
  });

  it('should round a NumberFormatter', function () {
    assert.deepEqual(new NumberFormatter(123456).roundDigits(3), new NumberFormatter(123000));
    assert.deepEqual(new NumberFormatter(123456).roundDigits(4), new NumberFormatter(123500));
    assert.deepEqual(new NumberFormatter(0.00555).roundDigits(2), new NumberFormatter(0.0056));
    assert.deepEqual(new NumberFormatter(99.99).roundDigits(2), new NumberFormatter(100));
  });

  it('should format a number with toFixed', function () {
    assert.strictEqual(new NumberFormatter(0).toFixed(), '0');
    assert.strictEqual(new NumberFormatter(2300).toFixed(), '2300');
    assert.strictEqual(new NumberFormatter(-2300).toFixed(), '-2300');
    assert.strictEqual(new NumberFormatter(19.9).toFixed(), '20');
    assert.strictEqual(new NumberFormatter(99.9).toFixed(), '100');
    assert.strictEqual(new NumberFormatter(99.5).toFixed(), '100');
    assert.strictEqual(new NumberFormatter(99.4).toFixed(), '99');
    assert.strictEqual(new NumberFormatter(2.3).toFixed(), '2');
    assert.strictEqual(new NumberFormatter(2.5).toFixed(), '3');
    assert.strictEqual(new NumberFormatter(2.9).toFixed(), '3');
    assert.strictEqual(new NumberFormatter(1.5).toFixed(), '2');
    assert.strictEqual(new NumberFormatter(-1.5).toFixed(), '-2');
    assert.strictEqual(new NumberFormatter(123.45).toFixed(), '123');
    assert.strictEqual(new NumberFormatter(0.005).toFixed(), '0');
    assert.strictEqual(new NumberFormatter(0.7).toFixed(), '1');

    assert.strictEqual(new NumberFormatter(0.15).toFixed(1), '0.2');
    assert.strictEqual(new NumberFormatter(123.4567).toFixed(1), '123.5');
    assert.strictEqual(new NumberFormatter(-123.4567).toFixed(1), '-123.5');
    assert.strictEqual(new NumberFormatter(0.23).toFixed(1), '0.2');
    assert.strictEqual(new NumberFormatter(0.005).toFixed(5), '0.00500');
    assert.strictEqual(new NumberFormatter(0.00567).toFixed(4), '0.0057');
    assert.strictEqual(new NumberFormatter(0.00999).toFixed(2), '0.01');
    assert.strictEqual(new NumberFormatter(0.00999).toFixed(3), '0.010');
    assert.strictEqual(new NumberFormatter(-0.00999).toFixed(3), '-0.010');
  });

  it('should format a number with toExponential', function () {
    assert.strictEqual(new NumberFormatter(0).toExponential(), '0e+0');
    assert.strictEqual(new NumberFormatter(0.15).toExponential(), '1.5e-1');
    assert.strictEqual(new NumberFormatter(1).toExponential(), '1e+0');
    assert.strictEqual(new NumberFormatter(-1).toExponential(), '-1e+0');
    assert.strictEqual(new NumberFormatter(1000).toExponential(), '1e+3');
    assert.strictEqual(new NumberFormatter(2300).toExponential(), '2.3e+3');
    assert.strictEqual(new NumberFormatter(-2300).toExponential(), '-2.3e+3');
    assert.strictEqual(new NumberFormatter(3.568).toExponential(), '3.568e+0');
    assert.strictEqual(new NumberFormatter(0.00123).toExponential(), '1.23e-3');
    assert.strictEqual(new NumberFormatter(-0.00123).toExponential(), '-1.23e-3');
    assert.strictEqual(new NumberFormatter('20.3e2').toExponential(), '2.03e+3');

    assert.strictEqual(new NumberFormatter(0).toExponential(2), '0.0e+0');
    assert.strictEqual(new NumberFormatter(0.15).toExponential(1), '2e-1');
    assert.strictEqual(new NumberFormatter(1234).toExponential(2), '1.2e+3');
    assert.strictEqual(new NumberFormatter(-1234).toExponential(2), '-1.2e+3');
    assert.strictEqual(new NumberFormatter(1234).toExponential(6), '1.23400e+3');
    assert.strictEqual(new NumberFormatter(9999).toExponential(2), '1.0e+4');
  });

  it('should format a number with toPrecision', function () {
    assert.strictEqual(new NumberFormatter(0).toPrecision(), '0');
    assert.strictEqual(new NumberFormatter(0.15).toPrecision(), '0.15');
    assert.strictEqual(new NumberFormatter(2300).toPrecision(), '2300');
    assert.strictEqual(new NumberFormatter(-2300).toPrecision(), '-2300');
    assert.strictEqual(new NumberFormatter(0.00123).toPrecision(), '0.00123');
    assert.strictEqual(new NumberFormatter(-0.00123).toPrecision(), '-0.00123');
    assert.strictEqual(new NumberFormatter(1.2e-8).toPrecision(), '1.2e-8');

    assert.strictEqual(new NumberFormatter(2300).toPrecision(6), '2300.00');
    assert.strictEqual(new NumberFormatter(1234.5678).toPrecision(6), '1234.57');
    assert.strictEqual(new NumberFormatter(1234.5678).toPrecision(2), '1200');
    assert.strictEqual(new NumberFormatter(1234).toPrecision(2), '1200');
    assert.strictEqual(new NumberFormatter(0.15).toPrecision(1), '0.2');
    assert.strictEqual(new NumberFormatter(0.004).toPrecision(3), '0.00400');
    assert.strictEqual(new NumberFormatter(0.00123456).toPrecision(5), '0.0012346');
    assert.strictEqual(new NumberFormatter(999).toPrecision(2), '1000');
    assert.strictEqual(new NumberFormatter(99900).toPrecision(2), '100000');
    assert.strictEqual(new NumberFormatter(99999).toPrecision(2), '100000');
    assert.strictEqual(new NumberFormatter(999e7).toPrecision(2), '1.0e+10');
    assert.strictEqual(new NumberFormatter(0.00999).toPrecision(2), '0.010');
    assert.strictEqual(new NumberFormatter(-0.00999).toPrecision(2), '-0.010');
  });

  it('should should throw an error on invalid input', function () {
    assert.throws(function () {new NumberFormatter('2.3.4')}, /SyntaxError/);
    assert.throws(function () {new NumberFormatter('2.3ee')}, /SyntaxError/);
    assert.throws(function () {new NumberFormatter('2.3e4.3')}, /SyntaxError/);
    assert.throws(function () {new NumberFormatter('2.3a')}, /SyntaxError/);
    assert.throws(function () {new NumberFormatter('foo')}, /SyntaxError/);
    assert.throws(function () {new NumberFormatter(new Date())}, /SyntaxError/);
  });

});

redpajama_set_name: RedPajamaGithub


text:
package com.github.dockerjava.cmd;

import com.github.dockerjava.api.command.CreateContainerResponse;
import com.github.dockerjava.api.exception.NotFoundException;
import com.github.dockerjava.core.util.CompressArchiveUtil;
import com.github.dockerjava.utils.TestUtils;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class CopyArchiveFromContainerCmdIT extends CmdIT {
    public static final Logger LOG = LoggerFactory.getLogger(CopyArchiveFromContainerCmdIT.class);

    @Test
    public void copyFromContainer() throws Exception {
        // TODO extract this into a shared method
        CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE)
                .withName("copyFromContainer")
                .withCmd("touch", "/copyFromContainer")
                .exec();

        LOG.info("Created container: {}", container);
        assertThat(container.getId(), not(isEmptyOrNullString()));

        dockerRule.getClient().startContainerCmd(container.getId()).exec();

        InputStream response = dockerRule.getClient().copyArchiveFromContainerCmd(container.getId(), "/copyFromContainer").exec();

        // read the stream fully. Otherwise, the underlying stream will not be closed.
        String responseAsString = TestUtils.asString(response);
        assertNotNull(responseAsString);
        assertTrue(responseAsString.length() > 0);
    }

    @Test(expected = NotFoundException.class)
    public void copyFromNonExistingContainer() throws Exception {

        dockerRule.getClient().copyArchiveFromContainerCmd("non-existing", "/test").exec();
    }

    @Test
    public void copyFromContainerBinaryFile() throws Exception {
        CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE)
                .withName("copyFromContainerBinaryFile")
                .exec();

        LOG.info("Created container: {}", container);
        assertThat(container.getId(), not(isEmptyOrNullString()));

        Path temp = Files.createTempFile("", ".tar.gz");
        Path binaryFile = Paths.get("src/test/resources/testCopyFromArchive/binary.dat");
        CompressArchiveUtil.tar(binaryFile, temp, true, false);

        try (InputStream uploadStream = Files.newInputStream(temp)) {
            dockerRule.getClient().copyArchiveToContainerCmd(container.getId()).withTarInputStream(uploadStream).exec();
        }

        InputStream response = dockerRule.getClient().copyArchiveFromContainerCmd(container.getId(), "/binary.dat").exec();

        try (TarArchiveInputStream tarInputStream = new TarArchiveInputStream(response)) {
            TarArchiveEntry nextTarEntry = tarInputStream.getNextTarEntry();

            assertEquals(nextTarEntry.getName(), "binary.dat");
            try (InputStream binaryFileInputStream = Files.newInputStream(binaryFile, StandardOpenOption.READ)) {
                assertTrue(IOUtils.contentEquals(binaryFileInputStream, tarInputStream));
            }

            assertNull("Nothing except binary.dat is expected to be copied.", tarInputStream.getNextTarEntry());
        }
    }
}


text:
<?php
App::uses('IvaResponsabilidadesController', 'Risto.Controller');

/**
 * IvaResponsabilidadesController Test Case
 *
 */
class IvaResponsabilidadesControllerTest extends ControllerTestCase {

/**
 * Fixtures
 *
 * @var array
 */
	public $fixtures = array(
		'plugin.risto.iva_responsabilidad',
		'plugin.risto.tipo_factura',
		'plugin.risto.cliente'
	);

/**
 * testIndex method
 *
 * @return void
 */
	public function testIndex() {
		$this->markTestIncomplete('testIndex not implemented.');
	}

/**
 * testView method
 *
 * @return void
 */
	public function testView() {
		$this->markTestIncomplete('testView not implemented.');
	}

/**
 * testAdd method
 *
 * @return void
 */
	public function testAdd() {
		$this->markTestIncomplete('testAdd not implemented.');
	}

/**
 * testEdit method
 *
 * @return void
 */
	public function testEdit() {
		$this->markTestIncomplete('testEdit not implemented.');
	}

/**
 * testDelete method
 *
 * @return void
 */
	public function testDelete() {
		$this->markTestIncomplete('testDelete not implemented.');
	}

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 93(1): 188 (2001)

#### Original name
Paraglomeraceae J.B. Morton & D. Redecker

### Remarks
null


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

<TITLE>
Uses of Class org.hibernate.cfg.Settings (Hibernate API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../jdstyle.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.hibernate.cfg.Settings

Packages that use Settings

org.hibernate.cache

	This package defines APIs and implementations for the
	second-level cache and query cache.

org.hibernate.cfg

	This package defines APIs for configuring Hibernate, and classes
	for building the Hibernate configuration-time metamodel.

org.hibernate.engine

	This package contains classes that are "shared" by other packages,
	and implementations of some key algorithms.

org.hibernate.impl

	This package contains implementations of the
	central Hibernate APIs, especially the
	Hibernate session.

org.hibernate.tool.hbm2ddl

	The <tt>hbm2ddl</tt> tool.

Uses of Settings in org.hibernate.cache

Methods in org.hibernate.cache with parameters of type Settings

 QueryCache
StandardQueryCacheFactory.getQueryCache(String regionName,
              UpdateTimestampsCache updateTimestampsCache,
              Settings settings,
              Properties props)

 QueryCache
QueryCacheFactory.getQueryCache(String regionName,
              UpdateTimestampsCache updateTimestampsCache,
              Settings settings,
              Properties props)

static CacheConcurrencyStrategy
CacheFactory.createCache(String concurrencyStrategy,
            String regionName,
            boolean mutable,
            Settings settings,
            Properties properties)

Constructors in org.hibernate.cache with parameters of type Settings

UpdateTimestampsCache(Settings settings,
                      Properties props)

StandardQueryCache(Settings settings,
                   Properties props,
                   UpdateTimestampsCache updateTimestampsCache,
                   String regionName)

Uses of Settings in org.hibernate.cfg

Methods in org.hibernate.cfg that return Settings

 Settings
SettingsFactory.buildSettings(Properties props)

 Settings
Configuration.buildSettings()

          Create an object-oriented view of the configuration properties

 Settings
Configuration.buildSettings(Properties props)

Uses of Settings in org.hibernate.engine

Methods in org.hibernate.engine that return Settings

 Settings
SessionFactoryImplementor.getSettings()

Uses of Settings in org.hibernate.impl

Methods in org.hibernate.impl that return Settings

 Settings
SessionFactoryImpl.getSettings()

Constructors in org.hibernate.impl with parameters of type Settings

SessionFactoryImpl(Configuration cfg,
                   Mapping mapping,
                   Settings settings,
                   EventListeners listeners)

Uses of Settings in org.hibernate.tool.hbm2ddl

Constructors in org.hibernate.tool.hbm2ddl with parameters of type Settings

SchemaValidator(Configuration cfg,
                Settings settings)

SchemaUpdate(Configuration cfg,
             Settings settings)

SchemaExport(Configuration cfg,
             Settings settings)

          Create a schema exporter for the given Configuration
 and given settings

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
<?php

namespace Conner\Tagging\Providers;

use Illuminate\Support\ServiceProvider;
use Conner\Tagging\Contracts\TaggingUtility;
use Conner\Tagging\Util;

class LumenTaggingServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application events.
     */
    public function boot()
    {
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(TaggingUtility::class, function () {
            return new Util;
        });
    }

    /**
     * (non-PHPdoc)
     * @see \Illuminate\Support\ServiceProvider::provides()
     */
    public function provides()
    {
        return [TaggingUtility::class];
    }
}


text:
class Attachment < ActiveRecord::Base
  belongs_to :page

  has_attachment :storage => :file_system,
    :thumbnails => { :thumb => [50, 50], :small => "100x100>", :large => "400x400>"},
    :processor => :rmagick

end


text:
namespace Fixtures.MirrorPrimitives
{
    using Models;

    /// <summary>
    /// Some cool documentation.
    /// </summary>
    public partial interface ISwaggerDataTypesClient : System.IDisposable
    {
        /// <summary>
        /// The base URI of the service.
        /// </summary>
        System.Uri BaseUri { get; set; }

        /// <summary>
        /// Gets or sets json serialization settings.
        /// </summary>
        Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }

        /// <summary>
        /// Gets or sets json deserialization settings.
        /// </summary>
        Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }

            /// <summary>
        /// Product Types
        /// </summary>
        /// <param name='responseCode'>
        /// The desired returned status code
        /// </param>
        /// <param name='product'>
        /// The only parameter
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Product>> GetProductWithHttpMessagesAsync(string responseCode = default(string), Product product = default(Product), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Product Types
        /// </summary>
        /// <param name='responseCode'>
        /// The desired returned status code
        /// </param>
        /// <param name='product'>
        /// The only parameter
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Product>> PutProductWithHttpMessagesAsync(string responseCode = default(string), Product product = default(Product), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Product Types
        /// </summary>
        /// <param name='responseCode'>
        /// The desired returned status code
        /// </param>
        /// <param name='product'>
        /// The only parameter
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Product>> PostProductWithHttpMessagesAsync(string responseCode = default(string), Product product = default(Product), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Product Types
        /// </summary>
        /// <param name='responseCode'>
        /// The desired returned status code
        /// </param>
        /// <param name='product'>
        /// The only parameter
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Product>> PatchProductWithHttpMessagesAsync(string responseCode = default(string), Product product = default(Product), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>org.openntf.xpt.updatesite</artifactId>
	<parent>
		<groupId>org.openntf.xpt</groupId>
		<artifactId>xpt.parent</artifactId>
		<version>1.3.4-SNAPSHOT</version>
	</parent>
	<packaging>eclipse-update-site</packaging>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptor>assembly.xml</descriptor>
							<finalName>${project.artifactId}-${project.version}</finalName>
							<appendAssemblyId>false</appendAssemblyId>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<properties>
		<lic.file>${project.parent.basedir}/LICENSE_HEADER/apacheV2.txt</lic.file>
	</properties>
</project>


text:
package com.zavtech.morpheus.stats;

/**
 * A Statistic implementation that supports incremental calculation of a sample sum of logs
 *
 *
This is open source software released under the Apache 2.0 License

 *
 * @author  Xavier Witdouck
 */
public class SumLogs implements Statistic1 {

    private long n;
    private double sumLogs;

    /**
     * Constructor
     */
    public SumLogs() {
        super();
    }

    @Override
    public long getN() {
        return n;
    }

    @Override
    public double getValue() {
        return sumLogs;
    }

    @Override
    public StatType getType() {
        return StatType.SUM_LOGS;
    }

    @Override
    public long add(double value) {
        if (!Double.isNaN(value)) {
            this.sumLogs += Math.log(value);
            this.n++;
        }
        return n;
    }

    @Override
    public Statistic1 copy() {
        try {
            return (Statistic1)super.clone();
        } catch (CloneNotSupportedException ex) {
            throw new RuntimeException("Failed to clone statistic", ex);
        }
    }

    @Override
    public Statistic1 reset() {
        this.n = 0L;
        this.sumLogs = 0d;
        return this;
    }
}


text:
define('dojorama/layers/nls/home_ar',{
'dojorama/ui/_global/widget/nls/NavigationWidget':{"labelHome":"Dojorama","labelStorage":"Storage","labelReleaseIndex":"Releases"}
,
'dojorama/ui/_global/widget/nls/FooterWidget':{}
});


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

package com.google.protobuf.util;

import static com.google.common.base.Preconditions.checkArgument;

import com.google.common.primitives.Ints;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Descriptors.FieldDescriptor;
import com.google.protobuf.FieldMask;
import com.google.protobuf.Internal;
import com.google.protobuf.Message;

import java.util.Arrays;

/**
 * Utility helper functions to work with {@link com.google.protobuf.FieldMask}.
 */
public class FieldMaskUtil {
  private static final String FIELD_PATH_SEPARATOR = ",";
  private static final String FIELD_PATH_SEPARATOR_REGEX = ",";
  private static final String FIELD_SEPARATOR_REGEX = "\\.";

  private FieldMaskUtil() {}

  /**
   * Converts a FieldMask to a string.
   */
  public static String toString(FieldMask fieldMask) {
    // TODO(xiaofeng): Consider using com.google.common.base.Joiner here instead.
    StringBuilder result = new StringBuilder();
    boolean first = true;
    for (String value : fieldMask.getPathsList()) {
      if (value.isEmpty()) {
        // Ignore empty paths.
        continue;
      }
      if (first) {
        first = false;
      } else {
        result.append(FIELD_PATH_SEPARATOR);
      }
      result.append(value);
    }
    return result.toString();
  }

  /**
   * Parses from a string to a FieldMask.
   */
  public static FieldMask fromString(String value) {
    // TODO(xiaofeng): Consider using com.google.common.base.Splitter here instead.
    return fromStringList(
        null, Arrays.asList(value.split(FIELD_PATH_SEPARATOR_REGEX)));
  }

  /**
   * Parses from a string to a FieldMask and validates all field paths.
   *
   * @throws IllegalArgumentException if any of the field path is invalid.
   */
  public static FieldMask fromString(Class<? extends Message> type, String value) {
    // TODO(xiaofeng): Consider using com.google.common.base.Splitter here instead.
    return fromStringList(
        type, Arrays.asList(value.split(FIELD_PATH_SEPARATOR_REGEX)));
  }

  /**
   * Constructs a FieldMask for a list of field paths in a certain type.
   *
   * @throws IllegalArgumentException if any of the field path is not valid.
   */
  // TODO(xiaofeng): Consider renaming fromStrings()
  public static FieldMask fromStringList(
      Class<? extends Message> type, Iterable<String> paths) {
    FieldMask.Builder builder = FieldMask.newBuilder();
    for (String path : paths) {
      if (path.isEmpty()) {
        // Ignore empty field paths.
        continue;
      }
      if (type != null && !isValid(type, path)) {
        throw new IllegalArgumentException(
            path + " is not a valid path for " + type);
      }
      builder.addPaths(path);
    }
    return builder.build();
  }

  /**
   * Constructs a FieldMask from the passed field numbers.
   *
   * @throws IllegalArgumentException if any of the fields are invalid for the message.
   */
  public static FieldMask fromFieldNumbers(Class<? extends Message> type, int... fieldNumbers) {
    return fromFieldNumbers(type, Ints.asList(fieldNumbers));
  }

  /**
   * Constructs a FieldMask from the passed field numbers.
   *
   * @throws IllegalArgumentException if any of the fields are invalid for the message.
   */
  public static FieldMask fromFieldNumbers(
      Class<? extends Message> type, Iterable<Integer> fieldNumbers) {
    Descriptor descriptor = Internal.getDefaultInstance(type).getDescriptorForType();

    FieldMask.Builder builder = FieldMask.newBuilder();
    for (Integer fieldNumber : fieldNumbers) {
      FieldDescriptor field = descriptor.findFieldByNumber(fieldNumber);
      checkArgument(
          field != null,
          String.format("%s is not a valid field number for %s.", fieldNumber, type));
      builder.addPaths(field.getName());
    }
    return builder.build();
  }

  /**
   * Checks whether paths in a given fields mask are valid.
   */
  public static boolean isValid(Class<? extends Message> type, FieldMask fieldMask) {
    Descriptor descriptor =
        Internal.getDefaultInstance(type).getDescriptorForType();

    return isValid(descriptor, fieldMask);
  }

  /**
   * Checks whether paths in a given fields mask are valid.
   */
  public static boolean isValid(Descriptor descriptor, FieldMask fieldMask) {
    for (String path : fieldMask.getPathsList()) {
      if (!isValid(descriptor, path)) {
        return false;
      }
    }
    return true;
  }

  /**
   * Checks whether a given field path is valid.
   */
  public static boolean isValid(Class<? extends Message> type, String path) {
    Descriptor descriptor =
        Internal.getDefaultInstance(type).getDescriptorForType();

    return isValid(descriptor, path);
  }

  /**
   * Checks whether paths in a given fields mask are valid.
   */
  public static boolean isValid(Descriptor descriptor, String path) {
    String[] parts = path.split(FIELD_SEPARATOR_REGEX);
    if (parts.length == 0) {
      return false;
    }
    for (String name : parts) {
      if (descriptor == null) {
        return false;
      }
      FieldDescriptor field = descriptor.findFieldByName(name);
      if (field == null) {
        return false;
      }
      if (!field.isRepeated()
          && field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
        descriptor = field.getMessageType();
      } else {
        descriptor = null;
      }
    }
    return true;
  }

  /**
   * Converts a FieldMask to its canonical form. In the canonical form of a
   * FieldMask, all field paths are sorted alphabetically and redundant field
   * paths are moved.
   */
  public static FieldMask normalize(FieldMask mask) {
    return new FieldMaskTree(mask).toFieldMask();
  }

  /**
   * Creates an union of two FieldMasks.
   */
  public static FieldMask union(FieldMask mask1, FieldMask mask2) {
    return new FieldMaskTree(mask1).mergeFromFieldMask(mask2).toFieldMask();
  }

  /**
   * Calculates the intersection of two FieldMasks.
   */
  public static FieldMask intersection(FieldMask mask1, FieldMask mask2) {
    FieldMaskTree tree = new FieldMaskTree(mask1);
    FieldMaskTree result = new FieldMaskTree();
    for (String path : mask2.getPathsList()) {
      tree.intersectFieldPath(path, result);
    }
    return result.toFieldMask();
  }

  /**
   * Options to customize merging behavior.
   */
  public static final class MergeOptions {
    private boolean replaceMessageFields = false;
    private boolean replaceRepeatedFields = false;

    /**
     * Whether to replace message fields (i.e., discard existing content in
     * destination message fields) when merging.
     * Default behavior is to merge the source message field into the
     * destination message field.
     */
    public boolean replaceMessageFields() {
      return replaceMessageFields;
    }

    /**
     * Whether to replace repeated fields (i.e., discard existing content in
     * destination repeated fields) when merging.
     * Default behavior is to append elements from source repeated field to the
     * destination repeated field.
     */
    public boolean replaceRepeatedFields() {
      return replaceRepeatedFields;
    }

    public void setReplaceMessageFields(boolean value) {
      replaceMessageFields = value;
    }

    public void setReplaceRepeatedFields(boolean value) {
      replaceRepeatedFields = value;
    }
  }

  /**
   * Merges fields specified by a FieldMask from one message to another.
   */
  public static void merge(FieldMask mask, Message source,
      Message.Builder destination, MergeOptions options) {
    new FieldMaskTree(mask).merge(source, destination, options);
  }

  /**
   * Merges fields specified by a FieldMask from one message to another.
   */
  public static void merge(FieldMask mask, Message source,
      Message.Builder destination) {
    merge(mask, source, destination, new MergeOptions());
  }
}


text:
using System.Collections.Generic;
using Maplink.Webservices.Places.Client.Entities;

namespace Maplink.Webservices.Places.Client.Factories
{
    public interface IPlaceResultFactory
    {
        PlaceResult Create(
            IEnumerable<Place> places,
            int totalFound,
            int startedAtIndex);
    }
}


text:
sudo apt-get install --only-upgrade mupdf=1.5-1+deb8u1 -y
sudo apt-get install --only-upgrade libmupdf-dev=1.5-1+deb8u1 -y
sudo apt-get install --only-upgrade mupdf-tools=1.5-1+deb8u1 -y


text:
package com.facebook.buck.features.ocaml;

import static com.facebook.buck.features.ocaml.OcamlRuleBuilder.createOcamlLinkTarget;
import static com.facebook.buck.features.ocaml.OcamlRuleBuilder.createStaticLibraryBuildTarget;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeNoException;
import static org.junit.Assume.assumeTrue;

import com.facebook.buck.core.config.BuckConfig;
import com.facebook.buck.core.config.FakeBuckConfig;
import com.facebook.buck.core.exceptions.HumanReadableException;
import com.facebook.buck.core.filesystems.AbsPath;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.BuildTargetFactory;
import com.facebook.buck.core.model.UnconfiguredTargetConfiguration;
import com.facebook.buck.core.model.impl.BuildTargetPaths;
import com.facebook.buck.core.rules.BuildRuleResolver;
import com.facebook.buck.core.rules.resolver.impl.TestActionGraphBuilder;
import com.facebook.buck.core.toolchain.ToolchainCreationContext;
import com.facebook.buck.core.toolchain.ToolchainProvider;
import com.facebook.buck.core.toolchain.impl.ToolchainProviderBuilder;
import com.facebook.buck.cxx.CxxDescriptionEnhancer;
import com.facebook.buck.cxx.CxxSourceRuleFactory;
import com.facebook.buck.cxx.CxxSourceRuleFactoryHelper;
import com.facebook.buck.cxx.config.CxxBuckConfig;
import com.facebook.buck.cxx.toolchain.CxxPlatform;
import com.facebook.buck.cxx.toolchain.CxxPlatformUtils;
import com.facebook.buck.cxx.toolchain.CxxPlatformsProvider;
import com.facebook.buck.cxx.toolchain.HeaderVisibility;
import com.facebook.buck.cxx.toolchain.PicType;
import com.facebook.buck.cxx.toolchain.impl.DefaultCxxPlatforms;
import com.facebook.buck.downwardapi.config.DownwardApiConfig;
import com.facebook.buck.io.ExecutableFinder;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.io.filesystem.TestProjectFilesystems;
import com.facebook.buck.io.filesystem.impl.FakeProjectFilesystem;
import com.facebook.buck.rules.keys.config.TestRuleKeyConfigurationFactory;
import com.facebook.buck.testutil.TemporaryPaths;
import com.facebook.buck.testutil.TestConsole;
import com.facebook.buck.testutil.integration.BuckBuildLog;
import com.facebook.buck.testutil.integration.ProjectWorkspace;
import com.facebook.buck.testutil.integration.TestDataHelper;
import com.facebook.buck.util.DefaultProcessExecutor;
import com.facebook.buck.util.ProcessExecutor;
import com.facebook.buck.util.config.Config;
import com.facebook.buck.util.config.Configs;
import com.facebook.buck.util.environment.EnvVariablesProvider;
import com.facebook.buck.util.environment.Platform;
import com.google.common.collect.ImmutableSet;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

public class OCamlIntegrationTest {

  @Rule public TemporaryPaths tmp = new TemporaryPaths();
  private ProjectWorkspace workspace;

  @Before
  public void checkOcamlIsConfigured() throws IOException {
    workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "ocaml", tmp);
    workspace.setUp();

    ProjectFilesystem filesystem = TestProjectFilesystems.createProjectFilesystem(tmp.getRoot());

    Config rawConfig = Configs.createDefaultConfig(filesystem.getRootPath().getPath());

    BuckConfig buckConfig =
        FakeBuckConfig.builder()
            .setFilesystem(filesystem)
            .setSections(rawConfig.getRawConfig())
            .build();

    ToolchainProvider toolchainProvider =
        new ToolchainProviderBuilder()
            .withToolchain(
                CxxPlatformsProvider.DEFAULT_NAME,
                CxxPlatformsProvider.of(
                    CxxPlatformUtils.DEFAULT_UNRESOLVED_PLATFORM,
                    CxxPlatformUtils.DEFAULT_PLATFORMS))
            .build();

    ProcessExecutor processExecutor = new DefaultProcessExecutor(new TestConsole());
    ExecutableFinder executableFinder = new ExecutableFinder();
    ToolchainCreationContext toolchainCreationContext =
        ToolchainCreationContext.of(
            EnvVariablesProvider.getSystemEnv(),
            buckConfig,
            new FakeProjectFilesystem(),
            processExecutor,
            executableFinder,
            TestRuleKeyConfigurationFactory.create());

    OcamlToolchainFactory factory = new OcamlToolchainFactory();
    Optional<OcamlToolchain> toolchain =
        factory.createToolchain(
            toolchainProvider, toolchainCreationContext, UnconfiguredTargetConfiguration.INSTANCE);

    OcamlPlatform ocamlPlatform =
        toolchain
            .orElseThrow(AssertionError::new)
            .getDefaultOcamlPlatform()
            .resolve(new TestActionGraphBuilder(), UnconfiguredTargetConfiguration.INSTANCE);

    BuildRuleResolver resolver = new TestActionGraphBuilder();
    try {
      ocamlPlatform
          .getOcamlCompiler()
          .resolve(resolver, UnconfiguredTargetConfiguration.INSTANCE)
          .getCommandPrefix(resolver.getSourcePathResolver());
    } catch (HumanReadableException e) {
      assumeNoException(e);
    }
  }

  @Test
  public void testHelloOcamlBuild() throws IOException {
    BuildTarget target = BuildTargetFactory.newInstance("//hello_ocaml:hello_ocaml");
    BuildTarget binary = createOcamlLinkTarget(target);
    BuildTarget lib = BuildTargetFactory.newInstance("//hello_ocaml:ocamllib");
    BuildTarget staticLib =
        createStaticLibraryBuildTarget(lib).withAppendedFlavors(DefaultCxxPlatforms.FLAVOR);
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary, lib, staticLib);

    workspace.runBuckCommand("build", target.toString()).assertSuccess();

    BuckBuildLog buildLog = workspace.getBuildLog();

    assertTrue(buildLog.getAllTargets().containsAll(targets));

    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(staticLib);

    workspace.resetBuildLogFile();

    // Check that running a build again results in no builds since everything is up to
    // date.
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertEquals(ImmutableSet.of(binary, target), buildLog.getAllTargets());
    buildLog.assertTargetHadMatchingRuleKey(binary);
    buildLog.assertTargetHadMatchingRuleKey(target);

    workspace.resetBuildLogFile();

    // Update the source file.
    workspace.replaceFileContents("hello_ocaml/amodule.ml", "v2", "v3");

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));

    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetHadMatchingRuleKey(staticLib);

    workspace.resetBuildLogFile();

    // Update the source file.
    workspace.replaceFileContents("hello_ocaml/ocamllib/m1.ml", "print me", "print Me");

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));

    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(staticLib);

    workspace.resetBuildLogFile();

    // Update the source file.
    workspace.replaceFileContents("hello_ocaml/BUCK", "#INSERT_POINT", "'ocamllib/dummy.ml',");

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));

    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(staticLib);

    workspace.resetBuildLogFile();

    BuildTarget lib1 = BuildTargetFactory.newInstance("//hello_ocaml:ocamllib1");
    BuildTarget staticLib1 =
        createStaticLibraryBuildTarget(lib1).withAppendedFlavors(DefaultCxxPlatforms.FLAVOR);
    ImmutableSet<BuildTarget> targets1 = ImmutableSet.of(target, binary, lib1, staticLib1);
    // We rebuild if lib name changes
    workspace.replaceFileContents(
        "hello_ocaml/BUCK", "name = \"ocamllib\"", "name = \"ocamllib1\"");
    workspace.replaceFileContents("hello_ocaml/BUCK", ":ocamllib", ":ocamllib1");

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets1));

    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(staticLib1);
  }

  @Test
  public void testNativePlugin() throws Exception {
    // Build the plugin
    BuildTarget pluginTarget =
        BuildTargetFactory.newInstance("//ocaml_native_plugin:plugin#default");
    workspace.runBuckCommand("build", pluginTarget.toString()).assertSuccess();

    // Also build a test binary that we'll use to verify that the .cmxs file
    // works
    BuildTarget binTarget = BuildTargetFactory.newInstance("//ocaml_native_plugin:tester");
    workspace.runBuckCommand("build", binTarget.toString()).assertSuccess();

    ProjectFilesystem filesystem = workspace.getProjectFileSystem();
    AbsPath basePath = filesystem.getRootPath().toRealPath();

    Path testerExecutableFile =
        basePath
            .resolve(BuildTargetPaths.getGenPath(filesystem.getBuckPaths(), binTarget, "%s/tester"))
            .getPath();

    Path pluginCmxsFile =
        basePath
            .resolve(
                BuildTargetPaths.getGenPath(
                    filesystem.getBuckPaths(), pluginTarget, "%s/libplugin.cmxs"))
            .getPath();

    // Run `./tester /path/to/plugin.cmxs`
    String out =
        workspace
            .runCommand(testerExecutableFile.toString(), pluginCmxsFile.toString())
            .getStdout()
            .get();

    assertEquals("it works!\n", out);
  }

  @Test
  public void testLexAndYaccBuild() throws IOException {
    BuildTarget target = BuildTargetFactory.newInstance("//calc:calc");
    BuildTarget binary = createOcamlLinkTarget(target);

    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary);

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertEquals(targets, buildLog.getAllTargets());
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    workspace.resetBuildLogFile();

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertEquals(ImmutableSet.of(binary, target), buildLog.getAllTargets());
    buildLog.assertTargetHadMatchingRuleKey(binary);
    buildLog.assertTargetHadMatchingRuleKey(target);

    workspace.resetBuildLogFile();

    workspace.replaceFileContents("calc/lexer.mll", "The type token", "the type token");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertEquals(targets, buildLog.getAllTargets());
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    workspace.resetBuildLogFile();

    workspace.replaceFileContents("calc/parser.mly", "the entry point", "The entry point");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertEquals(targets, buildLog.getAllTargets());
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);
  }

  @Test
  public void testCInteropBuild() throws IOException {
    BuildTarget target = BuildTargetFactory.newInstance("//ctest:ctest");
    BuildTarget binary = createOcamlLinkTarget(target);
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary);

    workspace.runBuckCommand("build", target.toString()).assertSuccess();

    BuckBuildLog buildLog = workspace.getBuildLog();

    assertTrue(buildLog.getAllTargets().containsAll(targets));

    buildLog.assertTargetBuiltLocally(target);

    workspace.resetBuildLogFile();
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertEquals(ImmutableSet.of(binary, target), buildLog.getAllTargets());
    buildLog.assertTargetHadMatchingRuleKey(binary);
    buildLog.assertTargetHadMatchingRuleKey(target);

    workspace.resetBuildLogFile();
    workspace.replaceFileContents("ctest/ctest.c", "NATIVE PLUS", "Native Plus");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    workspace.resetBuildLogFile();
    workspace.replaceFileContents("ctest/BUCK", "#INSERTION_POINT", "compiler_flags=['-noassert']");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    workspace.resetBuildLogFile();
    workspace.replaceFileContents(
        "ctest/BUCK", "compiler_flags=['-noassert']", "compiler_flags=[]");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    workspace.resetBuildLogFile();
    workspace.replaceFileContents("ctest/BUCK", "compiler_flags=[]", "compiler_flags=[]");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    assertEquals(ImmutableSet.of(binary, target), buildLog.getAllTargets());
    buildLog.assertTargetHadMatchingRuleKey(binary);
    buildLog.assertTargetHadMatchingRuleKey(target);
  }

  @Test
  public void testSimpleBuildWithLib() {
    BuildTarget target = BuildTargetFactory.newInstance("//:plus");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
  }

  @Test
  public void testRootBuildTarget() {
    BuildTarget target = BuildTargetFactory.newInstance("//:main");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
  }

  /**
   * Manually compiles a library to be used via prebuilt_ocaml_library
   *
   * @throws IOException
   * @throws InterruptedException
   */
  private void setUpPrebuiltLibraryBytecodeOnly(ProjectWorkspace workspace)
      throws IOException, InterruptedException {
    Path ocamlc =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlc"), EnvVariablesProvider.getSystemEnv());

    ProcessExecutor.Result result;

    // Compile .cma (bytecode archive)
    result =
        workspace.runCommand(
            ocamlc.toString(),
            "-a",
            "-o",
            "prebuilt_ocaml_library/bytecode_only/lib/plus.cma",
            "prebuilt_ocaml_library/bytecode_only/src/plus.ml");
    assertEquals(0, result.getExitCode());

    // Copy compiled header
    workspace.move(
        "prebuilt_ocaml_library/bytecode_only/src/plus.cmi",
        "prebuilt_ocaml_library/bytecode_only/lib/plus.cmi");
  }

  @Test
  public void testPrebuiltLibraryBytecodeOnly() throws IOException, InterruptedException {
    setUpPrebuiltLibraryBytecodeOnly(workspace);

    BuildTarget target = BuildTargetFactory.newInstance("//prebuilt_ocaml_library:bytecode_only");
    BuildTarget binary = createOcamlLinkTarget(target);
    BuildTarget bytecode = OcamlBuildRulesGenerator.addBytecodeFlavor(binary);
    BuildTarget libplus =
        BuildTargetFactory.newInstance("//prebuilt_ocaml_library/bytecode_only/lib:plus");
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, bytecode, libplus);

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    assertFalse(buildLog.getAllTargets().contains(binary));
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(bytecode);
  }

  /**
   * Manually compiles a library to be used via prebuilt_ocaml_library
   *
   * @throws IOException
   * @throws InterruptedException
   */
  private void setUpPrebuiltLibraryWithC(ProjectWorkspace workspace)
      throws IOException, InterruptedException {
    Path ocamlc =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlc"), EnvVariablesProvider.getSystemEnv());
    Path ocamlopt =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlopt"), EnvVariablesProvider.getSystemEnv());
    Path ocamlmklib =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlmklib"), EnvVariablesProvider.getSystemEnv());

    ProcessExecutor.Result result;

    // Compile stubs .o
    result =
        workspace.runCommand(
            ocamlc.toString(),
            "-o",
            "plus_stubs.o",
            "prebuilt_ocaml_library/c_extension/src/plus_stubs.c");
    assertEquals(0, result.getExitCode());
    workspace.move("plus_stubs.o", "prebuilt_ocaml_library/c_extension/lib/plus_stubs.o");

    // Compile stubs lib
    result =
        workspace.runCommand(
            ocamlmklib.toString(),
            "-o",
            "prebuilt_ocaml_library/c_extension/lib/plus_stubs",
            "prebuilt_ocaml_library/c_extension/lib/plus_stubs.o");
    assertEquals(0, result.getExitCode());

    // Compile .cmxa (native archive)
    result =
        workspace.runCommand(
            ocamlopt.toString(),
            "-a",
            "-o",
            "prebuilt_ocaml_library/c_extension/lib/plus.cmxa",
            "prebuilt_ocaml_library/c_extension/src/plus.ml");
    assertEquals(0, result.getExitCode());

    // Compile .cma (bytecode archive)
    result =
        workspace.runCommand(
            ocamlc.toString(),
            "-a",
            "-o",
            "prebuilt_ocaml_library/c_extension/lib/plus.cma",
            "prebuilt_ocaml_library/c_extension/src/plus.ml",
            "prebuilt_ocaml_library/c_extension/src/plus_stubs.c");
    assertEquals(0, result.getExitCode());

    // Copy compiled header
    workspace.move(
        "prebuilt_ocaml_library/c_extension/src/plus.cmi",
        "prebuilt_ocaml_library/c_extension/lib/plus.cmi");
  }

  @Test
  public void testPrebuiltLibraryWithC() throws IOException, InterruptedException {
    setUpPrebuiltLibraryWithC(workspace);

    BuildTarget target = BuildTargetFactory.newInstance("//prebuilt_ocaml_library:c_extension");
    BuildTarget binary = createOcamlLinkTarget(target);
    BuildTarget bytecode = OcamlBuildRulesGenerator.addBytecodeFlavor(binary);
    BuildTarget libplus =
        BuildTargetFactory.newInstance("//prebuilt_ocaml_library/c_extension/lib:plus");
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary, bytecode, libplus);

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    BuckBuildLog buildLog = workspace.getBuildLog();
    for (BuildTarget t : targets) {
      assertTrue(
          String.format("Expected %s to be built", t.toString()),
          buildLog.getAllTargets().contains(t));
    }
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    /* TODO: caching is disabled for ocaml. ideally it would not rebuild
    workspace.resetBuildLogFile();
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    for (BuildTarget t : targets) {
      assertTrue(
          String.format("Expected %s to be built", t.toString()),
          buildLog.getAllTargets().contains(t));
    }
    buildLog.assertTargetHadMatchingRuleKey(target);
    buildLog.assertTargetHadMatchingRuleKey(binary);
    */
  }

  /**
   * Manually compiles a library to be used via prebuilt_ocaml_library
   *
   * @throws IOException
   * @throws InterruptedException
   */
  private void setUpPrebuiltLibraryBytecodeAndNative(ProjectWorkspace workspace)
      throws IOException, InterruptedException {
    Path ocamlc =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlc"), EnvVariablesProvider.getSystemEnv());
    Path ocamlopt =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlopt"), EnvVariablesProvider.getSystemEnv());

    ProcessExecutor.Result result;

    // Compile .cmxa (native archive)
    result =
        workspace.runCommand(
            ocamlopt.toString(),
            "-a",
            "-o",
            "prebuilt_ocaml_library/bytecode_and_native/lib/plus.cmxa",
            "prebuilt_ocaml_library/bytecode_and_native/src/plus.ml");
    assertEquals(0, result.getExitCode());

    // Compile .cma (bytecode archive)
    result =
        workspace.runCommand(
            ocamlc.toString(),
            "-a",
            "-o",
            "prebuilt_ocaml_library/bytecode_and_native/lib/plus.cma",
            "prebuilt_ocaml_library/bytecode_and_native/src/plus.ml");
    assertEquals(0, result.getExitCode());

    // Copy compiled header
    workspace.move(
        "prebuilt_ocaml_library/bytecode_and_native/src/plus.cmi",
        "prebuilt_ocaml_library/bytecode_and_native/lib/plus.cmi");
  }

  @Test
  public void testPrebuiltLibraryWithBytecodeAndNative() throws IOException, InterruptedException {
    setUpPrebuiltLibraryBytecodeAndNative(workspace);

    BuildTarget target =
        BuildTargetFactory.newInstance("//prebuilt_ocaml_library:bytecode_and_native");
    BuildTarget binary = createOcamlLinkTarget(target);
    BuildTarget bytecode = OcamlBuildRulesGenerator.addBytecodeFlavor(binary);
    BuildTarget libplus =
        BuildTargetFactory.newInstance("//prebuilt_ocaml_library/bytecode_and_native/lib:plus");
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary, bytecode, libplus);

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    BuckBuildLog buildLog = workspace.getBuildLog();
    for (BuildTarget t : targets) {
      assertTrue(
          String.format("Expected %s to be built", t.toString()),
          buildLog.getAllTargets().contains(t));
    }
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    /* TODO: caching is disabled for ocaml. ideally it would not rebuild
    workspace.resetBuildLogFile();
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    for (BuildTarget t : targets) {
      assertTrue(
          String.format("Expected %s to be built", t.toString()),
          buildLog.getAllTargets().contains(t));
    }
    buildLog.assertTargetHadMatchingRuleKey(target);
    buildLog.assertTargetHadMatchingRuleKey(binary);
    */
  }

  @Test
  public void testCppLibraryDependency() throws IOException {
    BuildTarget target = BuildTargetFactory.newInstance("//clib:clib");
    BuildTarget binary = createOcamlLinkTarget(target);
    BuildTarget libplus = BuildTargetFactory.newInstance("//clib:plus");
    BuildTarget libplusStatic =
        createStaticLibraryBuildTarget(libplus).withAppendedFlavors(DefaultCxxPlatforms.FLAVOR);
    BuildTarget cclib = BuildTargetFactory.newInstance("//clib:cc");

    BuckConfig buckConfig = FakeBuckConfig.empty();
    CxxPlatform cxxPlatform =
        CxxPlatformUtils.build(new CxxBuckConfig(buckConfig), DownwardApiConfig.of(buckConfig));
    CxxSourceRuleFactory cxxSourceRuleFactory =
        CxxSourceRuleFactoryHelper.of(workspace.getDestPath(), cclib, cxxPlatform);
    BuildTarget cclibbin =
        CxxDescriptionEnhancer.createStaticLibraryBuildTarget(
            cclib, cxxPlatform.getFlavor(), PicType.PDC, Optional.empty());
    String sourceName = "cc/cc.cpp";
    BuildTarget ccObj = cxxSourceRuleFactory.createCompileBuildTarget(sourceName);
    BuildTarget headerSymlinkTreeTarget =
        CxxDescriptionEnhancer.createHeaderSymlinkTreeTarget(
            cclib, HeaderVisibility.PRIVATE, cxxPlatform.getFlavor());
    BuildTarget exportedHeaderSymlinkTreeTarget =
        CxxDescriptionEnhancer.createHeaderSymlinkTreeTarget(
            cclib,
            HeaderVisibility.PUBLIC,
            CxxPlatformUtils.getHeaderModeForDefaultPlatform(tmp.getRoot()).getFlavor());

    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    BuckBuildLog buildLog = workspace.getBuildLog();
    buildLog.assertTargetBuiltLocally(binary);
    buildLog.assertTargetBuiltLocally(libplusStatic);
    buildLog.assertTargetBuiltLocally(cclibbin);
    buildLog.assertTargetBuiltLocally(ccObj);
    buildLog.assertTargetBuiltLocally(headerSymlinkTreeTarget);
    buildLog.assertTargetBuiltLocally(exportedHeaderSymlinkTreeTarget);

    workspace.resetBuildLogFile();
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    buildLog.assertTargetHadMatchingRuleKey(binary);
    buildLog.assertTargetHadMatchingRuleKey(target);

    workspace.resetBuildLogFile();
    workspace.replaceFileContents("clib/cc/cc.cpp", "Hi there", "hi there");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    buildLog.assertTargetBuiltLocally(binary);
    buildLog.assertTargetBuiltLocally(libplusStatic);
    buildLog.assertTargetBuiltLocally(cclibbin);
    buildLog.assertTargetBuiltLocally(ccObj);
  }

  @Test
  public void testConfigWarningsFlags() throws IOException {
    ProjectWorkspace workspace =
        TestDataHelper.createProjectWorkspaceForScenario(
            this, "config_warnings_flags", tmp.newFolder());
    workspace.setUp();

    BuildTarget target = BuildTargetFactory.newInstance("//:unused_var");
    BuildTarget binary = createOcamlLinkTarget(target);

    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary);

    workspace.runBuckCommand("build", target.toString()).assertFailure();
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetFailed(target.toString());
    buildLog.assertTargetFailed(binary.toString());

    workspace.resetBuildLogFile();
    workspace.replaceFileContents(".buckconfig", "warnings_flags=+a", "");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);
  }

  @Test
  public void testConfigInteropIncludes() throws IOException, InterruptedException {
    ProjectWorkspace workspace =
        TestDataHelper.createProjectWorkspaceForScenario(
            this, "config_interop_includes", tmp.newFolder());
    workspace.setUp();

    Path ocamlc =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlc"), EnvVariablesProvider.getSystemEnv());

    ProcessExecutor.Result result = workspace.runCommand(ocamlc.toString(), "-where");
    assertEquals(0, result.getExitCode());
    String stdlibPath = result.getStdout().get();

    BuildTarget target = BuildTargetFactory.newInstance("//:test");
    BuildTarget binary = createOcamlLinkTarget(target);

    ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary);

    // Points somewhere with no stdlib in it, so fails to find Pervasives
    workspace.runBuckCommand("build", target.toString()).assertFailure();
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertThat(buildLog.getAllTargets(), Matchers.hasItems(targets.toArray(new BuildTarget[0])));
    buildLog.assertTargetFailed(target.toString());
    buildLog.assertTargetFailed(binary.toString());

    workspace.resetBuildLogFile();

    // Point to the real stdlib (from `ocamlc -where`)
    workspace.replaceFileContents(
        ".buckconfig", "interop.includes=lib", "interop.includes=" + stdlibPath);
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);

    workspace.resetBuildLogFile();

    // Remove the config, should default to a valid place
    workspace.replaceFileContents(".buckconfig", "interop.includes=" + stdlibPath, "");
    workspace.runBuckCommand("build", target.toString()).assertSuccess();
    buildLog = workspace.getBuildLog();
    buildLog.assertTargetBuiltLocally(target);
    buildLog.assertTargetBuiltLocally(binary);
  }

  @Test
  public void testGenruleDependency() throws IOException {
    BuildTarget binary = BuildTargetFactory.newInstance("//generated:binary");
    BuildTarget generated = BuildTargetFactory.newInstance("//generated:generated");
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(binary, generated);

    // Build the binary.
    workspace.runBuckCommand("build", binary.toString()).assertSuccess();

    // Make sure the generated target is built as well.
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetBuiltLocally(binary);
  }

  @Test
  public void testCompilerFlagsDependency() throws IOException, InterruptedException {
    ProjectWorkspace workspace =
        TestDataHelper.createProjectWorkspaceForScenario(
            this, "compiler_flag_macros", tmp.newFolder());
    workspace.setUp();

    String ocamlVersion = this.getOcamlVersion(workspace);
    assumeTrue("Installed ocaml is too old for this test", "4.02.0".compareTo(ocamlVersion) <= 0);

    BuildTarget binary = BuildTargetFactory.newInstance("//:main");
    BuildTarget lib = BuildTargetFactory.newInstance("//:lib");
    BuildTarget helper = BuildTargetFactory.newInstance("//:test");
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(binary, lib, helper);

    // Build the binary.
    workspace.runBuckCommand("build", binary.toString()).assertSuccess();

    // Make sure the helper target is built as well.
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetBuiltLocally(binary);

    // Make sure the ppx flag worked
    String out = workspace.runBuckCommand("run", binary.toString()).getStdout();
    assertEquals("42!\n", out);
  }

  @Test
  public void testOcamlDepFlagMacros() throws IOException {
    BuildTarget binary = BuildTargetFactory.newInstance("//ocamldep_flags:main");
    BuildTarget lib = BuildTargetFactory.newInstance("//ocamldep_flags:code");
    ImmutableSet<BuildTarget> targets = ImmutableSet.of(binary, lib);

    workspace.runBuckCommand("build", binary.toString()).assertSuccess();
    BuckBuildLog buildLog = workspace.getBuildLog();
    assertTrue(buildLog.getAllTargets().containsAll(targets));
    buildLog.assertTargetBuiltLocally(binary);

    // Make sure the ppx flag worked
    String out = workspace.runBuckCommand("run", binary.toString()).getStdout();
    assertEquals("142!\n", out);
  }

  private String getOcamlVersion(ProjectWorkspace workspace)
      throws IOException, InterruptedException {
    Path ocamlc =
        new ExecutableFinder(Platform.detect())
            .getExecutable(Paths.get("ocamlc"), EnvVariablesProvider.getSystemEnv());

    ProcessExecutor.Result result = workspace.runCommand(ocamlc.toString(), "-version");
    assertEquals(0, result.getExitCode());
    return result.getStdout().get();
  }
}


text:
import React from 'react'
import PropTypes from 'prop-types'
import Node from './Node'

class CollapsedNode extends Node {
  static propTypes = {
    node: PropTypes.object.isRequired,
    setPopoverIsOpen: PropTypes.func.isRequired,
    collapseNodeAndRewriteTree: PropTypes.func.isRequired
  }

  constructor (props) {
    super(props)
    this.state = {
      isOnDoubleClickInit: false
    }
    this.handleDoubleClick = this.handleDoubleClick.bind(this)
    this.refCallback = this.refCallback.bind(this)
  }

  handleDoubleClick () {
    this.setState({ ...this.state, loading: true })
    this.props.collapseNodeAndRewriteTree(this.props.node)
  }

  getLoading (tx, ty) {
    const color = this.statusColor || '#14c6a4'
    return (
      <g transform={`translate(${tx},${ty})`}>
        <g transform='translate(0 0)'>
          <circle cx='0' cy='0' r='2' fill={color} transform='scale(0.197092 0.197092)'>
            <animateTransform
              attributeName='transform'
              type='scale'
              begin='-0.3333333333333333s'
              calcMode='spline'
              keySplines='0.3 0 0.7 1;0.3 0 0.7 1'
              values='0;1;0'
              keyTimes='0;0.5;1'
              dur='1s'
              repeatCount='indefinite' />
          </circle>
        </g>
        <g transform='translate(5 0)'>
          <circle cx='0' cy='0' r='2' fill={color} transform='scale(0.654226 0.654226)'>
            <animateTransform
              attributeName='transform'
              type='scale'
              begin='-0.16666666666666666s'
              calcMode='spline'
              keySplines='0.3 0 0.7 1;0.3 0 0.7 1'
              values='0;1;0'
              keyTimes='0;0.5;1'
              dur='1s'
              repeatCount='indefinite' />
          </circle>
        </g>
        <g transform='translate(10 0)'>
          <circle cx='0' cy='0' r='2' fill={color} transform='scale(0.990512 0.990512)'>
            <animateTransform
              attributeName='transform'
              type='scale'
              begin='0s'
              calcMode='spline'
              keySplines='0.3 0 0.7 1;0.3 0 0.7 1'
              values='0;1;0'
              keyTimes='0;0.5;1'
              dur='1s'
              repeatCount='indefinite' />
          </circle>
        </g>
      </g>
    )
  }

  refCallback (item) {
    if (item && !this.state.isOnDoubleClickInit) {
      item.ondblclick = this.handleDoubleClick
      this.setState({ ...this.state, isOnDoubleClickInit: true })
    }
  }
}

export default CollapsedNode


text:
package com.abyx.loyalty.contents;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.abyx.loyalty.exceptions.DatabaseNotOpenException;
import com.abyx.loyalty.exceptions.InvalidCardException;
import com.abyx.loyalty.managers.ChangeObservable;
import com.google.zxing.BarcodeFormat;

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

/**
 * This class manages all the persistent data access for this application. All changes to objects
 * have to be propagated into the database immediate.
 *
 * @author Pieter Verschaffelt
 */
public class Database extends ChangeObservable<List<Card>> {
    private DatabaseHelper helper;
    private SQLiteDatabase database;

    private List<Card> cards;

    // Default sort order is ascending...
    private String orderBy = DatabaseContract.COLUMN_NAME + " COLLATE NOCASE ASC";

    public Database(Context context) {
        helper = new DatabaseHelper(context);
    }

    public void openDatabase() {
        database = helper.getWritableDatabase();
    }

    /**
     * Add a new card to the database. The given Card-object will be saved persistently in the
     * database. The ID-parameter of this card will be filled in by this method.
     *
     * @param card The card that should be added to the database.
     */
    public void addCard(Card card) {
        if (database == null) {
            throw new DatabaseNotOpenException("Database is not open!");
        }

        ContentValues toAdd = generateCardContentValues(card);
        long newID = database.insert(DatabaseContract.TABLE_CARD, null, toAdd);
        card.setID(newID);

        this.getAllCards();
    }

    /**
     * Converts the given Card-object to a ContentValues-object that can be used to update or add
     * the card to the database.
     *
     * @param card The Card-object whose values should be used to populate the ContentValues-object.
     * @return A ContentValues-object containing the correct values and columns for the given card.
     */
    private ContentValues generateCardContentValues(Card card) {
        ContentValues temp = new ContentValues();
        temp.put(DatabaseContract.COLUMN_NAME, card.getName());
        temp.put(DatabaseContract.COLUMN_BARCODE, card.getBarcode());
        temp.put(DatabaseContract.COLUMN_BARCODE_FORMAT, card.getFormat().toString());
        temp.put(DatabaseContract.COLUMN_IMAGE_URL, card.getImageURL());
        temp.put(DatabaseContract.COLUMN_LAST_SEARCHED, card.getLastSearched());
        temp.put(DatabaseContract.COLUMN_HIT_COUNT, card.getHitCount());
        return temp;
    }

    /**
     * All changes to the given Card-object will be saved persistently in the database. The Card-
     * object is uniquely identified by it's ID (Must be bigger than 0).
     *
     * @param card The card that should be updated.
     * @throws InvalidCardException Whenever a card is being updated with an invalid ID (-1).
     * @throws DatabaseNotOpenException Whenever this method is used before calling openDatabase()
     */
    public void updateCard(Card card) {
        if (database == null) {
            throw new DatabaseNotOpenException("Database is not open!");
        }

        if (card.getID() <= 0) {
            throw new InvalidCardException("Card has invalid id: " + card.getName());
        }

        ContentValues toUpdate = generateCardContentValues(card);

        String selection = DatabaseContract.COLUMN_ID + " = ?";
        String[] selectionArgs = {String.valueOf(card.getID())};

        database.update(DatabaseContract.TABLE_CARD, toUpdate, selection, selectionArgs);
        this.getAllCards();
    }

    /**
     * Remove the given card from the persistent storage. This object should not be used afterwards.
     * This Card-object is uniquely identified by it's ID (Must be bigger than 0).
     *
     * @param card The card that should be removed from the persistent storage.
     * @throws InvalidCardException Whenever a card is being deleted with an invalid ID (-1).
     * @throws DatabaseNotOpenException Whenever this method is used before calling openDatabase()
     */
    public void deleteCard(Card card) {
        if (database == null) {
            throw new DatabaseNotOpenException("Database is not open!");
        }

        if (card.getID() <= 0) {
            throw new InvalidCardException("Card has invalid id: " + card.getName());
        }

        String selection = DatabaseContract.COLUMN_ID + " = ?";
        String[] selectionArgs = {String.valueOf(card.getID())};

        database.delete(DatabaseContract.TABLE_CARD, selection, selectionArgs);
        this.getAllCards();
    }

    /**
     * Returns the Card-object associated with the given database ID.
     *
     * @param id Valid database id from whom a new Card-object should be created.
     * @return A new Card-object associated with this ID.
     */
    public Card getCardByID(long id) {
        if (database == null) {
            throw new DatabaseNotOpenException("Database is not open!");
        }

        String[] projection = {
                DatabaseContract.COLUMN_ID,
                DatabaseContract.COLUMN_NAME,
                DatabaseContract.COLUMN_BARCODE,
                DatabaseContract.COLUMN_BARCODE_FORMAT,
                DatabaseContract.COLUMN_IMAGE_URL,
                DatabaseContract.COLUMN_HIT_COUNT
        };

        String selection = DatabaseContract.COLUMN_ID + " = ?";
        String[] selectionArgs = {String.valueOf(id)};

        Cursor cursor = database.query(DatabaseContract.TABLE_CARD, projection, selection, selectionArgs, null, null, null);

        if (cursor.getCount() > 0) {
            cursor.moveToFirst();
            Card output = buildCardFromCursor(cursor);
            cursor.close();
            return updateHitCount(output);
        } else {
            cursor.close();
            return null;
        }
    }

    /**
     * Increment this card's hit count by 1.
     */
    private Card updateHitCount(Card card) {
        card.setHitCount(card.getHitCount() + 1);
        updateCard(card);
        return card;
    }

    public void getAllCardsSortedByName(boolean ascending) {
        if (ascending) {
            this.orderBy = DatabaseContract.COLUMN_NAME + " COLLATE NOCASE ASC";
        } else {
            this.orderBy = DatabaseContract.COLUMN_NAME + " COLLATE NOCASE DESC";
        }
        this.getAllCards();
    }

    public void getAllCardsSortedByHitCount(boolean ascending) {
        if (ascending) {
            this.orderBy = DatabaseContract.COLUMN_HIT_COUNT + " COLLATE NOCASE ASC";
        } else {
            this.orderBy = DatabaseContract.COLUMN_HIT_COUNT + " COLLATE NOCASE DESC";
        }
        this.getAllCards();
    }

    /**
     * This method receives all cards from the database and sends the queried data to all listeners.
     * NOTE: Database must be open before invoking this function.
     */
    public void getAllCards() {
        if (database == null) {
            throw new DatabaseNotOpenException("Database is not open!");
        }

        String[] projection = {
                DatabaseContract.COLUMN_ID,
                DatabaseContract.COLUMN_NAME,
                DatabaseContract.COLUMN_BARCODE,
                DatabaseContract.COLUMN_BARCODE_FORMAT,
                DatabaseContract.COLUMN_IMAGE_URL,
                DatabaseContract.COLUMN_HIT_COUNT
        };

        Cursor cursor = database.query(DatabaseContract.TABLE_CARD, projection, null, null, null, null, this.orderBy);

        cards = new ArrayList<>();

        if (cursor != null && cursor.getCount() > 0) {
            cursor.moveToFirst();
            while (!cursor.isAfterLast()) {
                cards.add(buildCardFromCursor(cursor));
                cursor.moveToNext();
            }
        }

        if (cursor != null) {
            cursor.close();
        }

        this.notifyListeners(cards);
    }

    /**
     * Close the database. The database must always be opened again when using it after calling this
     * method!
     */
    public void closeDatabase() {
        database.close();
        helper.close();
        database = null;
    }

    /**
     * Uses all data at the current position in the given Cursor to build a Card object.
     *
     * @param cursor The Cursor from which all data is read and used to create the new Card.
     * @return A Card based upon the given Cursor's data.
     */
    private Card buildCardFromCursor(Cursor cursor) {
        long cardID = cursor.getLong(cursor.getColumnIndex(DatabaseContract.COLUMN_ID));
        String name = cursor.getString(cursor.getColumnIndex(DatabaseContract.COLUMN_NAME));
        String barcode = cursor.getString(cursor.getColumnIndex(DatabaseContract.COLUMN_BARCODE));
        String barcodeFormat = cursor.getString(cursor.getColumnIndex(DatabaseContract.COLUMN_BARCODE_FORMAT));
        String imageURL = cursor.getString(cursor.getColumnIndex(DatabaseContract.COLUMN_IMAGE_URL));

        int lastSearched;
        if (cursor.getColumnIndex(DatabaseContract.COLUMN_LAST_SEARCHED) != -1) {
            lastSearched = cursor.getInt(cursor.getColumnIndex(DatabaseContract.COLUMN_LAST_SEARCHED));
        } else {
            lastSearched = 0;
        }

        int hitCount;
        if (cursor.getColumnIndex(DatabaseContract.COLUMN_HIT_COUNT) != -1) {
            hitCount = cursor.getInt(cursor.getColumnIndex(DatabaseContract.COLUMN_HIT_COUNT));
        } else {
            hitCount = 0;
        }

        Card output = new Card(name, barcode, imageURL, BarcodeFormat.valueOf(barcodeFormat), lastSearched, hitCount);
        output.setID(cardID);

        return output;
    }
}


text:
<?php

class Revision6_deleteForeignKey extends opMigration
{
  public function up()
  {
    $this->dropForeignKey('intro_friend', 'intro_friend_member_id_to_member_relationship_member_id_to');
  }
}


text:
namespace ui {

namespace {

base::LazyInstance<base::string16> g_cursor_resource_module_name;

const wchar_t* GetCursorId(gfx::NativeCursor native_cursor) {
  switch (native_cursor.native_type()) {
    case kCursorNull:
      return IDC_ARROW;
    case kCursorPointer:
      return IDC_ARROW;
    case kCursorCross:
      return IDC_CROSS;
    case kCursorHand:
      return IDC_HAND;
    case kCursorIBeam:
      return IDC_IBEAM;
    case kCursorWait:
      return IDC_WAIT;
    case kCursorHelp:
      return IDC_HELP;
    case kCursorEastResize:
      return IDC_SIZEWE;
    case kCursorNorthResize:
      return IDC_SIZENS;
    case kCursorNorthEastResize:
      return IDC_SIZENESW;
    case kCursorNorthWestResize:
      return IDC_SIZENWSE;
    case kCursorSouthResize:
      return IDC_SIZENS;
    case kCursorSouthEastResize:
      return IDC_SIZENWSE;
    case kCursorSouthWestResize:
      return IDC_SIZENESW;
    case kCursorWestResize:
      return IDC_SIZEWE;
    case kCursorNorthSouthResize:
      return IDC_SIZENS;
    case kCursorEastWestResize:
      return IDC_SIZEWE;
    case kCursorNorthEastSouthWestResize:
      return IDC_SIZENESW;
    case kCursorNorthWestSouthEastResize:
      return IDC_SIZENWSE;
    case kCursorMove:
      return IDC_SIZEALL;
    case kCursorProgress:
      return IDC_APPSTARTING;
    case kCursorNoDrop:
      return IDC_NO;
    case kCursorNotAllowed:
      return IDC_NO;
    case kCursorColumnResize:
      return MAKEINTRESOURCE(IDC_COLRESIZE);
    case kCursorRowResize:
      return MAKEINTRESOURCE(IDC_ROWRESIZE);
    case kCursorMiddlePanning:
      return MAKEINTRESOURCE(IDC_PAN_MIDDLE);
    case kCursorEastPanning:
      return MAKEINTRESOURCE(IDC_PAN_EAST);
    case kCursorNorthPanning:
      return MAKEINTRESOURCE(IDC_PAN_NORTH);
    case kCursorNorthEastPanning:
      return MAKEINTRESOURCE(IDC_PAN_NORTH_EAST);
    case kCursorNorthWestPanning:
      return MAKEINTRESOURCE(IDC_PAN_NORTH_WEST);
    case kCursorSouthPanning:
      return MAKEINTRESOURCE(IDC_PAN_SOUTH);
    case kCursorSouthEastPanning:
      return MAKEINTRESOURCE(IDC_PAN_SOUTH_EAST);
    case kCursorSouthWestPanning:
      return MAKEINTRESOURCE(IDC_PAN_SOUTH_WEST);
    case kCursorWestPanning:
      return MAKEINTRESOURCE(IDC_PAN_WEST);
    case kCursorVerticalText:
      return MAKEINTRESOURCE(IDC_VERTICALTEXT);
    case kCursorCell:
      return MAKEINTRESOURCE(IDC_CELL);
    case kCursorZoomIn:
      return MAKEINTRESOURCE(IDC_ZOOMIN);
    case kCursorZoomOut:
      return MAKEINTRESOURCE(IDC_ZOOMOUT);
    case kCursorGrab:
      return MAKEINTRESOURCE(IDC_HAND_GRAB);
    case kCursorGrabbing:
      return MAKEINTRESOURCE(IDC_HAND_GRABBING);
    case kCursorCopy:
      return MAKEINTRESOURCE(IDC_COPYCUR);
    case kCursorAlias:
      return MAKEINTRESOURCE(IDC_ALIAS);
    case kCursorNone:
      return MAKEINTRESOURCE(IDC_CURSOR_NONE);
    case kCursorContextMenu:
    case kCursorCustom:
      NOTIMPLEMENTED();
      return IDC_ARROW;
    default:
      NOTREACHED();
      return IDC_ARROW;
  }
}

}  // namespace

CursorLoader* CursorLoader::Create() {
  return new CursorLoaderWin;
}

CursorLoaderWin::CursorLoaderWin() {
}

CursorLoaderWin::~CursorLoaderWin() {
}

void CursorLoaderWin::LoadImageCursor(int id,
                                      int resource_id,
                                      const gfx::Point& hot) {
  // NOTIMPLEMENTED();
}

void CursorLoaderWin::LoadAnimatedCursor(int id,
                                         int resource_id,
                                         const gfx::Point& hot,
                                         int frame_delay_ms) {
  // NOTIMPLEMENTED();
}

void CursorLoaderWin::UnloadAll() {
  // NOTIMPLEMENTED();
}

void CursorLoaderWin::SetPlatformCursor(gfx::NativeCursor* cursor) {
  if (cursor->native_type() != kCursorCustom) {
    if (cursor->platform()) {
      cursor->SetPlatformCursor(cursor->platform());
    } else {
      const wchar_t* cursor_id = GetCursorId(*cursor);
      PlatformCursor platform_cursor = LoadCursor(NULL, cursor_id);
      if (!platform_cursor && !g_cursor_resource_module_name.Get().empty()) {
        platform_cursor = LoadCursor(
            GetModuleHandle(g_cursor_resource_module_name.Get().c_str()),
                            cursor_id);
      }
      cursor->SetPlatformCursor(platform_cursor);
    }
  }
}

// static
void CursorLoaderWin::SetCursorResourceModule(
    const base::string16& module_name) {
  g_cursor_resource_module_name.Get() = module_name;
}

}  // namespace ui


text:
#pragma once
#include <aws/states/SFN_EXPORTS.h>
#include <aws/core/utils/DateTime.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace SFN
{
namespace Model
{
  class AWS_SFN_API UpdateStateMachineResult
  {
  public:
    UpdateStateMachineResult();
    UpdateStateMachineResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    UpdateStateMachineResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The date and time the state machine was updated.

     */
    inline const Aws::Utils::DateTime& GetUpdateDate() const{ return m_updateDate; }

    /**
     *
The date and time the state machine was updated.

     */
    inline void SetUpdateDate(const Aws::Utils::DateTime& value) { m_updateDate = value; }

    /**
     *
The date and time the state machine was updated.

     */
    inline void SetUpdateDate(Aws::Utils::DateTime&& value) { m_updateDate = std::move(value); }

    /**
     *
The date and time the state machine was updated.

     */
    inline UpdateStateMachineResult& WithUpdateDate(const Aws::Utils::DateTime& value) { SetUpdateDate(value); return *this;}

    /**
     *
The date and time the state machine was updated.

     */
    inline UpdateStateMachineResult& WithUpdateDate(Aws::Utils::DateTime&& value) { SetUpdateDate(std::move(value)); return *this;}

  private:

    Aws::Utils::DateTime m_updateDate;
  };

} // namespace Model
} // namespace SFN
} // namespace Aws


text:
July 21, 2018 14:45:17 Library.fmp12 - CHUNK_findLearnRecordsReferences -1-
test: test: CHUNK_findLearnRecordsReferences
#
#
#Admin tasks.
Allow User Abort [ Off ]
Set Error Capture [ On ]
#
#If the learn record has references then make sure
#the Reference window is open, and then load up
#its reference records, otherwise exit the script.
If [ Get (LayoutTableName) = "testlearnReportTags" ]
If [ testlearnReportTags::kcreference = ""
 or
ValueCount ( testlearnReportTags::kcreference ) - Length ( Filter ( testlearnReportTags::kcreference ; "L" ) ) = 0 ]
Exit Script [ ]
End If
Else
If [ testlearn::kcreference = ""
 or
ValueCount ( testlearn::kcreference ) - Length ( Filter ( testlearn::kcreference ; "L" ) ) = 0 ]
Exit Script [ ]
End If
End If
#
#Prevent halting to loadTagRecord script.
Go to Field [ ]
Set Variable [ $$doNotHaltOtherScripts; Value:1 ]
Set Variable [ $$stopWhenLoadingInfoRecordReferences; Value:1 ]
#
#Capture the keys of the references load.
If [ Get (LayoutTableName) = "testlearnReportTags" ]
Set Variable [ $references; Value:testlearnReportTags::kcreference ]
Else
Set Variable [ $references; Value:testlearn::kcreference ]
End If
#
#Determine how many references there are.
If [ Get (LayoutTableName) = "testlearnReportTags" ]
Set Variable [ $numberOfReferences; Value:ValueCount ( testlearnReportTags::kcreference ) ]
Else
Set Variable [ $numberOfReferences; Value:ValueCount ( testlearn::kcreference ) ]
End If
#
#Prevent loading up records.
Set Variable [ $$stoploadtestinfo; Value:1 ]
Set Variable [ $$stopLoadTagRecord; Value:1 ]
#
#In the test section, go the Reference window
#or open one up if neccessary.
If [ Get (LayoutTableName) = "testlearnReportTags" ]
Select Window [ Name: "Reference"; Current file ]
If [ Get ( LastError ) = 112 ]
If [ $$pictureWindowColor = "test" ]
New Window [ Name: "Reference"; Width: Get ( ScreenWidth ) / 3; Left: ( Get ( ScreenWidth ) / 3 ) * 2; Style:
Document; Close: "Yes"; Minimize: "Yes"; Maximize: "Yes"; Zoom Control Area: "Yes"; Resize: "Yes" ]
Else
New Window [ Name: "Reference"; Width: 290; Left: Get ( ScreenWidth ) - 290; Style: Document; Close: "Yes";
Minimize: "Yes"; Maximize: "Yes"; Zoom Control Area: "Yes"; Resize: "Yes" ]
End If
End If
#
#Go the layout for info references.
Go to Layout [ "TestInfoReference" (reference) ]
#
#
Else
#In the learn section, go to the Tag Menus
#window and the reference layout.
Select Window [ Name: "Tag Menus"; Current file ]
#
#See if user has selected requested menu.
If [ Get (LayoutTableName) ≠ "reference" ]
#
#Menu NOT selected.
Go to Layout [ "learnMenu3CiteS" (reference) ]
End If
End If
#
#Turn back on record load script.
Set Variable [ $$stoploadtestinfo ]
#
#Find the first reference. NOTE: It may be this
#first reference is a learn reference, and so no
#records will be found, but this is OK. This first
#find clears out any records that may have
#been found previously, and replaces them with
#the outcome of this first find, which if none is,
#again, OK. Then next find step expands on
#this find, so to speed things up, it will not look
#for learn references, BUT if this step did not
#look for learn records, the script would in
#effect skip this first find and so leave in place
#the records found previously. Very Bad!
#NOTE: I've had a lot of caffeine.
Enter Find Mode [ ]
Set Field [ reference::_Lreference; GetValue ( $references ; $numberOfReferences ) ]
Perform Find [ ]
#
#If there is more than one reference, then load
#find them one-at-time until all have been found.
Loop
Set Variable [ $numberOfReferences; Value:$numberOfReferences - 1 ]
#
Exit Loop If [ $numberOfReferences = 0 ]
#
#Only find references from the Reference section.
If [ Right ( GetValue ( $references ; $numberOfReferences ) ; 1 ) ≠ "L" ]
Enter Find Mode [ ]
Set Field [ reference::_Lreference; GetValue ( $references ; $numberOfReferences ) ]
Extend Found Set [ ]
End If
#
End Loop
#
#Sort the references by keyword (subject).
Perform Script [ "sortRefBySubject" ]
#
#In the test section ...
#Resize the Reference window along with the
#other windows. The Test and Report sections
#have different window size requirements.
If [ Get (WindowName) = "Reference" ]
If [ $$pictureWindowColor = "test" ]
Move/Resize Window [ Name: "Test"; Current file; Width: Get ( ScreenWidth ) / 3; Left: 0 ]
Move/Resize Window [ Name: "Tag Menus"; Current file; Width: Get ( ScreenWidth ) / 3; Left: Get ( ScreenWidth ) / 3 ]
Select Window [ Name: "Tag Menus"; Current file ]
Else
Select Window [ Name: "Tag Menus"; Current file ]
If [ Get ( ScreenWidth ) - 884 < 334 ]
Move/Resize Window [ Name: "Tag Menus"; Current file; Width: 334; Left: 594 ]
Else
Move/Resize Window [ Name: "Tag Menus"; Current file; Width: Get ( ScreenWidth ) - 884; Left: 594 ]
End If
End If
#
#Turn back on info record record's load script.
Set Variable [ $$stopWhenLoadingInfoRecordReferences ]
#
#
Else
#In the learn section ...
#Clear brainstorm and test tags so there conditional
#formatting in the Learn window is removed.
Go to Field [ ]
Set Variable [ $$tagBrainstorm ]
Set Variable [ $$tagtest ]
Set Variable [ $$tagRecordID ]
Set Variable [ $$tagEdit ]
Set Field [ TEMP::TLBrainstormSort; "" ]
Set Field [ TEMP::TLTestSort; "" ]
#
#Set citationMatch to color menu button with inUse color.
Set Variable [ $$citationMatch; Value:"ref" ]
#Goto correct layout.
#
#If no layout preference is set, then on iDevices
#go the layout with no pictures, and to the
#layout with pictures on desktop computers.
If [ TEMP::layoutLtagR = "" ]
If [ Get (SystemPlatform) = 3 ]
Go to Layout [ "learnMenu3CiteS" (reference) ]
Set Field [ TEMP::layoutLtagR; "more" & Get (LayoutName) ]
Else
Go to Layout [ "learnMenu3Cite" (reference) ]
Set Field [ TEMP::layoutLtagR; "less" & Get (LayoutName) ]
End If
Else
#
#Go the layout the user has selected.
Go to Layout [ Middle ( TEMP::layoutLtagR ; 5 ; 42 ) ]
End If
Set Variable [ $$stopLoadTagRecord ]
Perform Script [ "loadTagRecord" ]
End If
#
#


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>review on Man Parvesh Singh Randhawa</title>
    <link>https://manparvesh.com/tags/review/</link>
    <description>Recent content in review on Man Parvesh Singh Randhawa</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>&copy; Man Parvesh Singh Randhawa</copyright>
    <lastBuildDate>Sat, 13 Jan 2018 10:31:26 +0800</lastBuildDate>

	<atom:link href="https://manparvesh.com/tags/review/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Python for Everybody - a review</title>
      <link>https://manparvesh.com/post/2018-01-13-python-for-everybody/</link>
      <pubDate>Sat, 13 Jan 2018 10:31:26 +0800</pubDate>

      <guid>https://manparvesh.com/post/2018-01-13-python-for-everybody/</guid>
      <description>Completed the specialization: Python for Everybody on Coursera in 4 days!
I learned a lot about the basics of the language. Since I had prior experience in Python, it did not take much time for me to complete it. Recommended for beginners!
I would recommend people who are in their beginning stages of learning how to code to try this. I would be very beneficial to them. You can see my specialization and course certificates here.</description>
    </item>

  </channel>
</rss>


text:
package chapter2;

import chapter2.fuels.Dilithium;
import chapter2.fuels.Gasoline;
import chapter2.vehicles.Car;
import chapter2.vehicles.Enterprise;
import chapter2.vehicles.Truck;
import chapter2.vehicles.Vehicle;

public class App {

    public static void main(String[] args) {
        testAssignment2(new Car(), new Truck(), new Enterprise());
    }

    public static void testAssignment2(Vehicle v1, Vehicle v2, Vehicle v3) {

        boolean v1lLoaded = v1.loadFuel(new Gasoline(5));
        boolean v2lLoaded = v2.loadFuel(new Dilithium(1000));
        boolean v3lLoaded = v3.loadFuel(new Dilithium(3));

        System.out.printf("Vehicle 1 is loaded? %b\n", v1lLoaded);
        System.out.printf("Vehicle 2 is loaded? %b\n", v2lLoaded);
        System.out.printf("Vehicle 3 is loaded? %b\n", v3lLoaded);

        for (int i = 0; v1.move(); i++) {
            System.out.println("Vehicle one is still going strong after " + i + " steps");
        }
        for (int i = 0; v2.move(); i++) {
            System.out.println("Vehicle two is still going strong after " + i + " steps");
        }
        for (int i = 0; v3.move(); i++) {
            System.out.println("Vehicle three is still going strong after " + i + " steps");
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Riskio\Specification;

class OrSpecification extends CompositeSpecification
{
    protected array $specifications;

    public function __construct(SpecificationInterface ...$specifications)
    {
        $this->specifications = $specifications;
    }

    public function isSatisfiedBy(mixed $object): bool
    {
        foreach ($this->specifications as $specification) {
            if ($specification->isSatisfiedBy($object)) {
                return true;
            }
        }

        return false;
    }
}


text:
package org.apache.flink.state.api.utils;

import org.apache.flink.api.common.functions.RuntimeContext;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.typeutils.ResultTypeQueryable;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.source.RichSourceFunction;
import org.apache.flink.streaming.api.functions.source.SourceFunction;

/**
 * A wrapper class that does not return until explicitly canceled so external processes can perform
 * operations such as taking savepoints.
 *
 * @param <T> The output type of the inner source.
 */
public class WaitingSource<T> extends RichSourceFunction<T> implements ResultTypeQueryable<T> {

    private final SourceFunction<T> source;

    private final TypeInformation<T> returnType;

    private volatile boolean running;

    public WaitingSource(SourceFunction<T> source, TypeInformation<T> returnType) {
        this.source = source;
        this.returnType = returnType;

        this.running = true;
    }

    @Override
    public void setRuntimeContext(RuntimeContext t) {
        if (source instanceof RichSourceFunction) {
            ((RichSourceFunction<T>) source).setRuntimeContext(t);
        }
    }

    @Override
    public void open(Configuration parameters) throws Exception {
        if (source instanceof RichSourceFunction) {
            ((RichSourceFunction<T>) source).open(parameters);
        }
    }

    @Override
    public void close() throws Exception {
        if (source instanceof RichSourceFunction) {
            ((RichSourceFunction<T>) source).close();
        }
    }

    @Override
    public void run(SourceContext<T> ctx) throws Exception {
        source.run(ctx);

        while (running) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                // ignore
            }
        }
    }

    @Override
    public void cancel() {
        source.cancel();
        running = false;
    }

    @Override
    public TypeInformation<T> getProducedType() {
        return returnType;
    }
}