text:
![License](https://img.shields.io/github/license/heroku/heroku-maven-plugin)
![Maven Central](https://img.shields.io/maven-central/v/com.heroku.sdk/heroku-sdk-parent)
[![CI](https://github.com/heroku/heroku-maven-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/heroku/heroku-maven-plugin/actions/workflows/ci.yml)

This plugin is used to deploy Java applications directly to Heroku without pushing to a Git repository. It uses
[Heroku's Platform API](https://devcenter.heroku.com/articles/platform-api-quickstart).
This can be useful when deploying from a CI server, deploying pre-built JAR or WAR files.

The plugin has two main goals:

- `heroku:deploy` and `heroku:deploy-only` for deploying standalone applications
- `heroku:deploy-war` for deploying WAR files

In addition to those two main goals, three additional goals are available:

- `heroku:dashboard` to open the Heroku dashboard for the configured application
- `heroku:run-war` to locally running WAR files
- `heroku:eclipse-launch-config` to generate launch configurations for Eclipse IDE

## Requirements

- Maven 3.5.x
- Java 8u101 or higher (versions < u101 might experience difficulties displaying build log output)

## Table of Contents
* [Global Configuration](#global-configuration)
* [Cookbook](#cookbook)
    * [Deploying a Standalone Application](#deploying-a-standalone-application)
    * [Deploying a WAR File](#deploying-a-war-file)
    * [Running a WAR File Locally](#running-a-war-file-locally)
    * [Deploying to Multiple Apps](#deploying-to-multiple-apps) (i.e.: staging/production setups)
* [Plugin Configuration](#plugin-configuration)
    * [appName](#appname)
    * [jdkVersion](#jdkversion)
    * [configVars](#configvars)
    * [includes](#includes)
    * [includeTarget](#includetarget)
    * [logProgress](#logprogress)
    * [buildpacks](#buildpacks)
    * [processTypes](#processtypes)
    * [warFile](#warfile)
    * [webappRunnerVersion](#webapprunnerversion)
* [Advanced Features](#advanced-features)
* [Hacking](#hacking)

## Global Configuration

### Heroku API Key
This plugin uses Heroku's Platform API and thus requires an API key to function. If you have the
[Heroku CLI](https://cli.heroku.com/) installed and logged in with `heroku login`, the plugin will automatically
pick up your API key. Alternatively, you can use the `HEROKU_API_KEY` environment variable to set your API key:

```sh-session
$ HEROKU_API_KEY="xxx-xxx-xxxx" mvn heroku:deploy
```

## Cookbook

### Deploying a Standalone Application

Add the following to your `pom.xml`, but replace the `<web>` element with the command used to run your application.

```xml
<build>
  <plugins>
    <plugin>
      <groupId>com.heroku.sdk</groupId>
      <artifactId>heroku-maven-plugin</artifactId>
      <version>3.0.5</version>
      <configuration>
        <appName>${heroku.appName}</appName>
        <processTypes>
          <web>java $JAVA_OPTS -cp target/classes:target/dependency/* com.example.Main</web>
        </processTypes>
      </configuration>
    </plugin>
  </plugins>
</build>
```

You can then run the following command to deploy your application:

```sh-session
$ mvn heroku:deploy
```

### Deploying a WAR File

NOTE: This requires that you use `<packaging>war</packaging>` in your `pom.xml`.

Add the following to your `pom.xml`.

```xml
<build>
  <plugins>
    <plugin>
      <groupId>com.heroku.sdk</groupId>
      <artifactId>heroku-maven-plugin</artifactId>
      <version>3.0.5</version>
      <configuration>
        <appName>${heroku.appName}</appName>
      </configuration>
    </plugin>
  </plugins>
</build>
```

This assumes your project will generate a WAR file in the `target` directory. If the WAR file is located somewhere else,
you can specify this with the `<warFile>` configuration element. The `<processTypes>` element is not needed
and *will be ignored* because the plugin will determine the appropriate process type for you.

You can then run the following command to deploy your application:

```sh-session
$ mvn heroku:deploy-war
```

### Running a WAR File Locally

You can execute your WAR file locally by running the following command:

```sh-session
$ mvn heroku:run-war
```

This will start the web application in a way that is very similar to how it is run on Heroku. If you need more control
over how the WAR file is being run, you can use [webapp-runner](https://github.com/heroku/webapp-runner) directly.

### Deploying to Multiple Apps

In most real-world scenarios, you will need to deploy your application to dev, test and prod environments.
There are several ways of handling this.

#### Using Maven Profiles

Use a profile for each app, and configure the plugin accordingly. For example:

```xml
<build>
  <plugins>
    <plugin>
      <groupId>com.heroku.sdk</groupId>
      <artifactId>heroku-maven-plugin</artifactId>
      <version>3.0.5</version>
      <configuration>
        <processTypes>
          <web>java $JAVA_OPTS -cp target/classes:target/dependency/* Main</web>
        </processTypes>
      </configuration>
    </plugin>
  </plugins>
</build>

<profiles>
  <profile>
    <id>test</id>
    <build>
      <plugins>
        <plugin>
          <groupId>com.heroku.sdk</groupId>
          <artifactId>heroku-maven-plugin</artifactId>
          <configuration>
            <appName>myapp-test</appName>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>

  <profile>
    <id>prod</id>
    <build>
      <plugins>
        <plugin>
          <groupId>com.heroku.sdk</groupId>
          <artifactId>heroku-maven-plugin</artifactId>
          <configuration>
            <appName>myapp-prod</appName>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>
```

#### Using System Properties

You can provide the application name as a system property like this:

```sh-session
$ mvn heroku:deploy -Dheroku.appName=myapp
```

#### Using a Heroku Properties File

This solution is best when multiple developers each need their own apps.
Create a `heroku.properties` file in the root directory of your application and put the following code in it
(but replace "myapp" with the name of your Heroku application):

```
heroku.appName=myapp
```

Then add the file to your `.gitignore` so that each developer can have their own local versions of the file.
The value in `heroku.properties` will take precedence over anything configured in your  `pom.xml`.

## Plugin Configuration
### appName

The name of the application to deploy.

```xml
<appName>my-app-name</appName>
```

The plugin will detect the appName from the following places in this order:

* The `heroku.properties` file
* The `heroku.appName` system property
* The Maven configuration (shown above)
* The "heroku" Git remote

For example, if you specify the `heroku.appName` system property, the Maven configuration shown above will have
no effect. This is useful for [deploying multiple apps](#deploying-to-multiple-apps).

### jdkVersion

The JDK version to use for your application.

```xml
<jdkVersion>11</jdkVersion>
```

The plugin will look for the required JDK version in the following places, in order:

* The Maven configuration (shown above)
* The `heroku.jdkVersion` system property
* The `java.runtime.version` in `system.properties` located in the root directory of your project

For valid values and the current default, refer to [Heroku's DevCenter article about specifing a Java version](https://devcenter.heroku.com/articles/java-support#specifying-a-java-version).

### configVars

Sets configuration variables for the application on each deploy.

```xml
<configVars>
  <MY_VAR>SomeValue</MY_VAR>
  <JAVA_OPTS>-Xss512k -XX:+UseCompressedOops</JAVA_OPTS>
</configVars>
```

Any variable defined in `configVars` will override defaults and previously defined config variables.

Note: If you adhere to the principles of the 12 Factor app, configuration should be strictly separated from code.
Thus, you do not want to tie your configuration to your codebase. There are a few exceptions to this, like some JAVA_OPTS may be universal.
If possible, you should not use `configVars` at all.

### includes
Allows you to include additional files and directories.

```xml
<includes>
  <include>etc/readme.txt</include>
</includes>
```

Included files and directories must be located within your project root directory.

### includeTarget
Allows you to disable automatic inclusion of the `target` directory. (Default is `true`)

```xml
<includeTarget>false</includeTarget>
```

This is useful in cases where you build a single fat JAR with all dependencies you want to deploy.

### logProgress

Enables or disables logging of the source blob upload progress. (Default is `false`)

```xml
<logProgress>true</logProgress>
```

Enabling this will log the upload progress status at `DEBUG` level.

### buildpacks

Defines the buildpacks used by your application.

```xml
<buildpacks>
  <buildpack>https://github.com/DuckyTeam/heroku-buildpack-imagemagick</buildpack>
  <buildpack>heroku/jvm</buildpack>
</buildpacks>
```

It can sometimes be useful to use more than just the default `heroku/jvm` buildpack for your application. In the above
example, you can see how an additional buildpack is used to install imagemagick.

You can also define your buildpacks using the Heroku Dashboard or the Heroku CLI (i.e. the `heroku buildpacks` command).

### processTypes

Adds process types to the generated [Procfile](https://devcenter.heroku.com/articles/procfile) for your application.

```xml
<processTypes>
  <web>java $JAVA_OPTS -cp target/classes:target/dependency/* Main</web>
  <worker>java $JAVA_OPTS -cp target/classes:target/dependency/* Worker</worker>
</processTypes>
```

The plugin will generate a `Procfile` for your application and include it. You can use this configuration to add more
process types. It will also pick up entries in the `Procfile` within your project root directory, but the plugin configuration
will take precedence.

### warFile
Specifies the WAR file to use for `heroku:deploy-war` and `heroku:run-war` goals.

```xml
<warFile>custom/directory/webapp.war</warFile>
```

Normally, the plugin looks for a WAR file in `target` and deploys it. This means you usually don't have to configure
this, unless you want to deploy a WAR file located somewhere else.

### webappRunnerVersion

Configures the version of [webapp-runner](https://github.com/heroku/webapp-runner) to use for `heroku:deploy-war` and `heroku:run-war`.

```xml
<webappRunnerVersion>9.0.30.0</webappRunnerVersion>
```
## Advanced Features

### Customizing the JDK
You can customize the JDK by creating a `.jdk-overlay` directory as described in [this Dev Center article](https://devcenter.heroku.com/articles/customizing-the-jdk).
This plugin will automatically include this directory if present.

## Hacking

To run the entire suite of integration tests, use the following command:

```sh-session
$ ./mvnw clean install -Pit
```

To run an individual integration test, use a command like this:

```sh-session
$ ./mvnw clean install -Pit -Dinvoker.test=simple-deploy-test
```


text:
module TablesawRails
  class Engine < ::Rails::Engine
  end
end

redpajama_set_name: RedPajamaGithub


text:
/**
 * A Spot for Slack!
 */

/**
 * Define a function for initiating a conversation on installation
 * With custom integrations, we don't have a way to find out who installed us, so we can't message them :(
 */

function onInstallation(bot, installer) {
    if (installer) {
        bot.startPrivateConversation({user: installer}, function (err, convo) {
            if (err) {
                console.log(err);
            } else {
                convo.say('I am a bot that has just joined your team');
                convo.say('You must now /invite me to a channel so that I can be of use!');
            }
        });
    }
}

/**
 * Configure the persistence options
 */

var config = {};
if (process.env.MONGOLAB_URI) {
    var BotkitStorage = require('botkit-storage-mongo');
    config = {
        storage: BotkitStorage({mongoUri: process.env.MONGOLAB_URI}),
    };
} else {
    config = {
        json_file_store: ((process.env.TOKEN)?'./db_slack_bot_ci/':'./db_slack_bot_a/'), //use a different name if an app or CI
    };
}

/**
 * Are being run as an app or a custom integration? The initialization will differ, depending
 */

if (process.env.TOKEN || process.env.SLACK_TOKEN) {
    //Treat this as a custom integration
    var customIntegration = require('./lib/custom_integrations');
    var token = (process.env.TOKEN) ? process.env.TOKEN : process.env.SLACK_TOKEN;
    var controller = customIntegration.configure(token, config, onInstallation);
} else if (process.env.CLIENT_ID && process.env.CLIENT_SECRET && process.env.PORT) {
    //Treat this as an app
    var app = require('./lib/apps');
    var controller = app.configure(process.env.PORT, process.env.CLIENT_ID, process.env.CLIENT_SECRET, config, onInstallation);
} else {
    console.log('Error: If this is a custom integration, please specify TOKEN in the environment. If this is an app, please specify CLIENTID, CLIENTSECRET, and PORT in the environment');
    process.exit(1);
}

var apiai = require('botkit-middleware-apiai')({
   token: process.env.APIAI_TOKEN
});
controller.middleware.receive.use(apiai.receive);

/**
 * A demonstration for how to handle websocket events. In this case, just log when we have and have not
 * been disconnected from the websocket. In the future, it would be super awesome to be able to specify
 * a reconnect policy, and do reconnections automatically. In the meantime, we aren't going to attempt reconnects,
 * WHICH IS A B0RKED WAY TO HANDLE BEING DISCONNECTED. So we need to fix this.
 *
 * TODO: fixed b0rked reconnect behavior
 */
// Handle events related to the websocket connection to Slack
controller.on('rtm_open', function (bot) {
    console.log('** The RTM api just connected!');
});

controller.on('rtm_close', function (bot) {
    console.log('** The RTM api just closed');
    // you may want to attempt to re-open
});

/**
 * Core bot logic goes here!
 */
// BEGIN EDITING HERE!

controller.on('bot_channel_join', function (bot, message) {
    bot.reply(message, "I'm here!")
});

/*controller.hears('hello', ['mention', 'direct_mention','direct_message'], function (bot, message) {
    bot.reply(message, 'Hello!');
});*/

controller.hears(['help'], ['direct_message','direct_mention','mention'], function (bot, message) {
   bot.reply(message, 'Here are some things you can ask me: \ncalculate candidate 1000 20: outputs the cost to the client and Lookahead\'s margin \ncalculate client 1300 20: reverses the prior calculation and gives you the day rate and margin \n calculate perm 100000 20: gives you the package total and placement fee \n');
});

controller.hears(['fetch'], ['direct_message','direct_mention','mention'], function (bot, message) {
   bot.reply(message, 'Stop trying to make fetch happen. It\'s never going to happen.');
});

controller.hears(['hello'], 'direct_message', apiai.hears, function (bot, message) {
   bot.reply(message, 'Hello!');
});

controller.hears(['goodbye'], 'direct_message', apiai.hears, function (bot, message) {
   bot.reply(message, 'See you later alligator!');
});

/*controller.hears(['flights'], 'direct_message', apiai.hears, function (bot, message) {
   if(message.fulfillment.speech !== '') {
       bot.reply(message, message.fulfillment.speech);
   } else {
       bot.reply(message, "You requested to fly to " + message.entities['geo-city'] + " on " + message.entities['date']+".");
   }
});*/

controller.hears(['calculate'], ['direct_mention', 'mention', 'direct_message'], apiai.hears, function (bot,message) {
  var userID = message.user
  var user = "<@"+userID+">"
  if(message.fulfillment.speech !== '') {
    bot.reply(message, message.fulfillment.speech);
  } else if (message.entities['keyword'] == 'client') {
    var total = parseInt(message.entities['day_rate']);
    var client_rate = (parseInt(message.entities['rate']) / 100);
    var day_rate = (total / (1.1 + client_rate)).toFixed(2);
    var tax = (day_rate * 0.1).toFixed(2);
    var gst = (total * 0.1).toFixed(2);
    var margin = (total - tax - day_rate).toFixed(2);
    bot.reply(message, user+"\nThe client is paying: *$"+total+"*, plus *$"+gst+"* GST. :the_horns: \nThis is made up of: \nContractor day rate: *$"+day_rate+"* :tada: \nTax/Insurance: *$"+tax+"* :angry: \nLookahead margin: *$"+margin+"* :moneybag:");
  } else if (message.entities['keyword'] == 'perm') {
    var salary = parseInt(message.entities['day_rate']);
    var client_rate = (parseInt(message.entities['rate']) / 100);
    var pkg = (salary * 1.095).toFixed(2);
    var fee = (pkg * client_rate).toFixed(2);
    bot.reply(message, user+"\nThe candidate package is *$"+pkg+"*. :the_horns: \nLookahead fee: *$"+fee+"* :moneybag:");
  } else {
    var day_rate = parseInt(message.entities['day_rate']);
    var client_rate = (parseInt(message.entities['rate']) / 100);
    var total = (day_rate * (1.1 + client_rate)).toFixed(2);
    var tax = (day_rate * 0.1).toFixed(2);
    var gst = (total * 0.1).toFixed(2);
    var margin = (total - tax - day_rate).toFixed(2);
    bot.reply(message, user+"\nThe client will be charged: *$"+total+"*, plus *$"+gst+"* GST. :the_horns: \nTax/Insurance: *$"+tax+"* :angry: \nLookahead earn: *$"+margin+"* :moneybag:");
  }
});

controller.hears(['Dog'], ['direct_message','mention', 'direct_mention'], apiai.hears, function (bot, message) {
   if(message.fulfillment.speech !== '') {
       bot.reply(message, message.fulfillment.speech);
   }
});

/**
 * AN example of what could be:
 * Any un-handled direct mention gets a reaction and a pat response!
 */
//controller.on('direct_message,mention,direct_mention', function (bot, message) {
//    bot.api.reactions.add({
//        timestamp: message.ts,
//        channel: message.channel,
//        name: 'robot_face',
//    }, function (err) {
//        if (err) {
//            console.log(err)
//        }
//        bot.reply(message, 'I heard you loud and clear boss.');
//    });
//});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
using System.Windows;
using System.Windows.Media;

namespace Scoreboard
{
    [ValueConversion(typeof(GamePeriodStatus), typeof(SolidColorBrush))]
    public class GamePeriodStatusColorConverter : IValueConverter
    {
        public static SolidColorBrush ActiveBrush = new SolidColorBrush(Colors.White);
        public static SolidColorBrush InactiveBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0x66, 0x66));

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            GamePeriodStatus status = (GamePeriodStatus)value;
            return status == GamePeriodStatus.Active ? ActiveBrush : InactiveBrush;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<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>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-bigquerydatatransfer-parent</artifactId>
  <packaging>pom</packaging>
  <version>2.3.18-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquerydatatransfer:current} -->
  <name>BigQuery DataTransfer Parent</name>
  <url>https://github.com/googleapis/java-bigquerydatatransfer</url>
  <description>
    Java idiomatic client for Google Cloud Platform services.
  </description>

  <parent>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-shared-config</artifactId>
    <version>1.5.3</version>
  </parent>

  <developers>
    <developer>
      <id>chingor</id>
      <name>Jeff Ching</name>
      <email>chingor@google.com</email>
      <organization>Google</organization>
      <roles>
        <role>Developer</role>
      </roles>
    </developer>
  </developers>
  <organization>
    <name>Google LLC</name>
  </organization>
  <scm>
    <connection>scm:git:git@github.com:googleapis/java-bigquerydatatransfer.git</connection>
    <developerConnection>scm:git:git@github.com:googleapis/java-bigquerydatatransfer.git</developerConnection>
    <url>https://github.com/googleapis/java-bigquerydatatransfer</url>
    <tag>HEAD</tag>
  </scm>
  <issueManagement>
    <url>https://github.com/googleapis/java-bigquerydatatransfer/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <github.global.server>github</github.global.server>
    <site.installationModule>google-cloud-bigquerydatatransfer-parent</site.installationModule>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-shared-dependencies</artifactId>
        <version>3.0.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>proto-google-cloud-bigquerydatatransfer-v1</artifactId>
        <version>2.3.18-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigquerydatatransfer-v1:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>grpc-google-cloud-bigquerydatatransfer-v1</artifactId>
        <version>2.3.18-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigquerydatatransfer-v1:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-bigquerydatatransfer</artifactId>
        <version>2.3.18-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquerydatatransfer:current} -->
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.13</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>false</autoReleaseAfterClose>
            <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <configuration>
            <ignoredUnusedDeclaredDependencies>org.objenesis:objenesis</ignoredUnusedDeclaredDependencies>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <modules>
    <module>google-cloud-bigquerydatatransfer</module>
    <module>grpc-google-cloud-bigquerydatatransfer-v1</module>
    <module>proto-google-cloud-bigquerydatatransfer-v1</module>
    <module>google-cloud-bigquerydatatransfer-bom</module>
  </modules>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.4.1</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>dependency-info</report>
              <report>team</report>
              <report>ci-management</report>
              <report>issue-management</report>
              <report>licenses</report>
              <report>scm</report>
              <report>dependency-management</report>
              <report>distribution-management</report>
              <report>summary</report>
              <report>modules</report>
            </reports>
          </reportSet>
        </reportSets>
        <configuration>
          <dependencyDetailsEnabled>true</dependencyDetailsEnabled>
          <artifactId>${site.installationModule}</artifactId>
          <packaging>jar</packaging>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.1</version>
        <reportSets>
          <reportSet>
            <id>html</id>
            <reports>
              <report>aggregate</report>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
        <configuration>
          <doclint>none</doclint>
          <show>protected</show>
          <nohelp>true</nohelp>
          <outputDirectory>${project.build.directory}/javadoc</outputDirectory>
          <groups>
            <group>
              <title>Test helpers packages</title>
              <packages>com.google.cloud.testing</packages>
            </group>
            <group>
              <title>SPI packages</title>
              <packages>com.google.cloud.spi*</packages>
            </group>
          </groups>

          <links>
            <link>https://grpc.io/grpc-java/javadoc/</link>
            <link>https://developers.google.com/protocol-buffers/docs/reference/java/</link>
            <link>https://googleapis.dev/java/google-auth-library/latest/</link>
            <link>https://googleapis.dev/java/gax/latest/</link>
            <link>https://googleapis.github.io/api-common-java/</link>
          </links>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>include-samples</id>
      <modules>
        <module>samples</module>
      </modules>
    </profile>
  </profiles>
</project>


text:
__version__ = '3.1.5'
__password__ = ''
__hostsdeny__ = ()  # __hostsdeny__ = ('.youtube.com', '.youku.com')
__content_type__ = 'image/gif'
__mirror_userjs__ = ()  # __mirror_userjs__ = '//www.example.com/user.js'

import os
import re
import time
import struct
import zlib
import gzip
import base64
import logging
import urlparse
import io
import string

from google.appengine.api import urlfetch
from google.appengine.runtime import apiproxy_errors

URLFETCH_MAX = 2
URLFETCH_MAXSIZE = 4*1024*1024
URLFETCH_DEFLATE_MAXSIZE = 4*1024*1024
URLFETCH_TIMEOUT = 60

def message_html(title, banner, detail=''):
    MESSAGE_TEMPLATE = '''

    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>$title</title>

Message

$banner

    $detail

    '''
    return string.Template(MESSAGE_TEMPLATE).substitute(title=title, banner=banner, detail=detail)

try:
    from Crypto.Cipher.ARC4 import new as RC4Cipher
except ImportError:
    logging.warn('Load Crypto.Cipher.ARC4 Failed, Use Pure Python Instead.')
    class RC4Cipher(object):
        def __init__(self, key):
            x = 0
            box = range(256)
            for i, y in enumerate(box):
                x = (x + y + ord(key[i % len(key)])) & 0xff
                box[i], box[x] = box[x], y
            self.__box = box
            self.__x = 0
            self.__y = 0
        def encrypt(self, data):
            out = []
            out_append = out.append
            x = self.__x
            y = self.__y
            box = self.__box
            for char in data:
                x = (x + 1) & 0xff
                y = (y + box[x]) & 0xff
                box[x], box[y] = box[y], box[x]
                out_append(chr(ord(char) ^ box[(box[x] + box[y]) & 0xff]))
            self.__x = x
            self.__y = y
            return ''.join(out)

def application(environ, start_response):
    cookie = environ.get('HTTP_COOKIE', '')
    options = environ.get('HTTP_X_GOA_OPTIONS', '')
    if environ['REQUEST_METHOD'] == 'GET' and not cookie:
        if '204' in environ['QUERY_STRING']:
            start_response('204 No Content', [])
            yield ''
        else:
            timestamp = long(os.environ['CURRENT_VERSION_ID'].split('.')[1])/2**28
            ctime = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(timestamp+8*3600))
            html = u'GoAgent Python Server %s \u5df2\u7ecf\u5728\u5de5\u4f5c\u4e86\uff0c\u90e8\u7f72\u65f6\u95f4 %s\n' % (__version__, ctime)
            start_response('200 OK', [('Content-Type', 'text/plain; charset=utf-8')])
            yield html.encode('utf8')
        raise StopIteration

    inflate = lambda x: zlib.decompress(x, -zlib.MAX_WBITS)
    deflate = lambda x: zlib.compress(x)[2:-4]
    rc4crypt = lambda s, k: RC4Cipher(k).encrypt(s) if k else s

    wsgi_input = environ['wsgi.input']
    input_data = wsgi_input.read()

    try:
        if cookie:
            if 'rc4' not in options:
                metadata = inflate(base64.b64decode(cookie))
                payload = input_data or ''
            else:
                metadata = inflate(rc4crypt(base64.b64decode(cookie), __password__))
                payload = rc4crypt(input_data, __password__) if input_data else ''
        else:
            if 'rc4' in options:
                input_data = rc4crypt(input_data, __password__)
            metadata_length, = struct.unpack('!h', input_data[:2])
            metadata = inflate(input_data[2:2+metadata_length])
            payload = input_data[2+metadata_length:]
        headers = dict(x.split(':', 1) for x in metadata.splitlines() if x)
        method = headers.pop('G-Method')
        url = headers.pop('G-Url')
    except (zlib.error, KeyError, ValueError):
        import traceback
        start_response('500 Internal Server Error', [('Content-Type', 'text/html')])
        yield message_html('500 Internal Server Error', 'Bad Request (metadata) - Possible Wrong Password', '
%s
' % traceback.format_exc())
        raise StopIteration

    kwargs = {}
    any(kwargs.__setitem__(x[2:].lower(), headers.pop(x)) for x in headers.keys() if x.startswith('G-'))

    if 'Content-Encoding' in headers:
        if headers['Content-Encoding'] == 'deflate':
            payload = inflate(payload)
            headers['Content-Length'] = str(len(payload))
            del headers['Content-Encoding']

    logging.info('%s "%s %s %s" - -', environ['REMOTE_ADDR'], method, url, 'HTTP/1.1')
    #logging.info('request headers=%s', headers)

    if __password__ and __password__ != kwargs.get('password', ''):
        start_response('403 Forbidden', [('Content-Type', 'text/html')])
        yield message_html('403 Wrong password', 'Wrong password(%r)' % kwargs.get('password', ''), 'GoAgent proxy.ini password is wrong!')
        raise StopIteration

    netloc = urlparse.urlparse(url).netloc

    if __hostsdeny__ and netloc.endswith(__hostsdeny__):
        start_response('403 Forbidden', [('Content-Type', 'text/html')])
        yield message_html('403 Hosts Deny', 'Hosts Deny(%r)' % netloc, detail='url=%r' % url)
        raise StopIteration

    if netloc.startswith(('127.0.0.', '::1', 'localhost')):
        start_response('400 Bad Request', [('Content-Type', 'text/html')])
        html = ''.join('%s
' % (x, x) for x in ('google.com', 'mail.google.com'))
        yield message_html('GoAgent %s is Running' % __version__, 'Now you can visit some websites', html)
        raise StopIteration

    fetchmethod = getattr(urlfetch, method, None)
    if not fetchmethod:
        start_response('405 Method Not Allowed', [('Content-Type', 'text/html')])
        yield message_html('405 Method Not Allowed', 'Method Not Allowed: %r' % method, detail='Method Not Allowed URL=%r' % url)
        raise StopIteration

    deadline = URLFETCH_TIMEOUT
    validate_certificate = bool(int(kwargs.get('validate', 0)))
    accept_encoding = headers.get('Accept-Encoding', '')
    errors = []
    for i in xrange(int(kwargs.get('fetchmax', URLFETCH_MAX))):
        try:
            response = urlfetch.fetch(url, payload, fetchmethod, headers, allow_truncated=False, follow_redirects=False, deadline=deadline, validate_certificate=validate_certificate)
            break
        except apiproxy_errors.OverQuotaError as e:
            time.sleep(5)
        except urlfetch.DeadlineExceededError as e:
            errors.append('%r, deadline=%s' % (e, deadline))
            logging.error('DeadlineExceededError(deadline=%s, url=%r)', deadline, url)
            time.sleep(1)
            deadline = URLFETCH_TIMEOUT * 2
        except urlfetch.DownloadError as e:
            errors.append('%r, deadline=%s' % (e, deadline))
            logging.error('DownloadError(deadline=%s, url=%r)', deadline, url)
            time.sleep(1)
            deadline = URLFETCH_TIMEOUT * 2
        except urlfetch.ResponseTooLargeError as e:
            errors.append('%r, deadline=%s' % (e, deadline))
            response = e.response
            logging.error('ResponseTooLargeError(deadline=%s, url=%r) response(%r)', deadline, url, response)
            m = re.search(r'=\s*(\d+)-', headers.get('Range') or headers.get('range') or '')
            if m is None:
                headers['Range'] = 'bytes=0-%d' % int(kwargs.get('fetchmaxsize', URLFETCH_MAXSIZE))
            else:
                headers.pop('Range', '')
                headers.pop('range', '')
                start = int(m.group(1))
                headers['Range'] = 'bytes=%s-%d' % (start, start+int(kwargs.get('fetchmaxsize', URLFETCH_MAXSIZE)))
            deadline = URLFETCH_TIMEOUT * 2
        except urlfetch.SSLCertificateError as e:
            errors.append('%r, should validate=0 ?' % e)
            logging.error('%r, deadline=%s', e, deadline)
        except Exception as e:
            errors.append(str(e))
            if i == 0 and method == 'GET':
                deadline = URLFETCH_TIMEOUT * 2
    else:
        start_response('500 Internal Server Error', [('Content-Type', 'text/html')])
        error_string = '
\n'.join(errors)
        if not error_string:
            logurl = 'https://appengine.google.com/logs?&app_id=%s' % os.environ['APPLICATION_ID']
            error_string = 'Internal Server Error.
try refresh or goto appengine.google.com for details' % logurl
        yield message_html('502 Urlfetch Error', 'Python Urlfetch Error: %r' % method,  error_string)
        raise StopIteration

    #logging.debug('url=%r response.status_code=%r response.headers=%r response.content[:1024]=%r', url, response.status_code, dict(response.headers), response.content[:1024])

    data = response.content
    response_headers = response.headers
    content_type = response_headers.get('content-type', '')
    if 'content-encoding' not in response_headers and 0 < len(response.content) < URLFETCH_DEFLATE_MAXSIZE and content_type.startswith(('text/', 'application/json', 'application/javascript')):
        if 'gzip' in accept_encoding:
            response_headers['Content-Encoding'] = 'gzip'
            compressobj = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -zlib.MAX_WBITS, zlib.DEF_MEM_LEVEL, 0)
            dataio = io.BytesIO()
            dataio.write('\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff')
            dataio.write(compressobj.compress(data))
            dataio.write(compressobj.flush())
            dataio.write(struct.pack('<LL', zlib.crc32(data) & 0xFFFFFFFFL, len(data) & 0xFFFFFFFFL))
            data = dataio.getvalue()
        elif 'deflate' in accept_encoding:
            response_headers['Content-Encoding'] = 'deflate'
            data = deflate(data)
    if data:
        response_headers['Content-Length'] = str(len(data))
    response_headers_data = deflate('\n'.join('%s:%s' % (k.title(), v) for k, v in response_headers.items() if not k.startswith('x-google-')))
    if 'rc4' not in options or content_type.startswith(('audio/', 'image/', 'video/')):
        start_response('200 OK', [('Content-Type', __content_type__)])
        yield struct.pack('!hh', int(response.status_code), len(response_headers_data))+response_headers_data
        yield data
    else:
        start_response('200 OK', [('Content-Type', __content_type__), ('X-GOA-Options', 'rc4')])
        yield struct.pack('!hh', int(response.status_code), len(response_headers_data))
        yield rc4crypt(response_headers_data, __password__)
        yield rc4crypt(data, __password__)

def mirror(environ, start_response):
    scheme = environ['wsgi.url_scheme']
    method = environ['REQUEST_METHOD']
    path_info = environ['PATH_INFO']
    query_string = environ['QUERY_STRING']
    original_host = environ['HTTP_HOST']

    logging.info('%s "%s %s %s" - -', environ['REMOTE_ADDR'], method, path_info, 'HTTP/1.1')

    server_name = '.'.join(original_host.split('.')[-3:])
    target_host = '.'.join(original_host.split('.')[:-3])

    if not target_host and path_info == '/':
        start_response('200 OK', [('Content-Type', 'text/plain')])
        yield 'GoAgent Mirror %s\n\n' % __version__
        yield 'JTAPI %s is running!\n' % os.environ['CURRENT_VERSION_ID']
        yield '--------------------------------\n'
        yield 'Rest Base URL:          %s://api.twitter.com.%s/1.1/\n' % (scheme, server_name)
        yield 'OAuth Base URL:         %s://api.twitter.com.%s/oauth/\n' % (scheme, server_name)
        yield '--------------------------------\n'
        yield 'How to use with Twidere:\n'
        yield 'Enable "Ignore SSL Error", then set above URLs (It"s better to use HTTPS.)\n'
        yield '--------------------------------\n'
        raise StopIteration

    headers = dict((k[5:].title().replace('_', '-'), v) for k, v in environ.items() if k.startswith('HTTP_'))
    headers['Host'] = target_host
    headers.pop('Accept-Encoding', '')
    if 'Cookie' in headers:
        headers['Cookie'] = headers['Cookie'].replace(original_host, target_host)
    path = '%s?%s' % (path_info, query_string) if query_string else path_info
    url = '%s://%s/%s' % (scheme, target_host, path)
    payload = environ['wsgi.input'].read() if headers.get('Content-Length') else ''

    fetchmethod = getattr(urlfetch, method, None)
    if not fetchmethod:
        start_response('405 Method Not Allowed', [('Content-Type', 'text/html')])
        yield 'Method Not Allowed: %r' % method
        raise StopIteration

    deadline = URLFETCH_TIMEOUT
    errors = []
    for i in xrange(URLFETCH_MAX):
        try:
            response = urlfetch.fetch(url, payload, fetchmethod, headers, allow_truncated=True, follow_redirects=False, deadline=deadline, validate_certificate=False)
            break
        except apiproxy_errors.OverQuotaError as e:
            time.sleep(5)
        except urlfetch.DeadlineExceededError as e:
            errors.append('%r, deadline=%s' % (e, deadline))
            logging.error('DeadlineExceededError(deadline=%s, url=%r)', deadline, url)
            time.sleep(1)
            deadline = URLFETCH_TIMEOUT * 2
        except urlfetch.DownloadError as e:
            errors.append('%r, deadline=%s' % (e, deadline))
            logging.error('DownloadError(deadline=%s, url=%r)', deadline, url)
            time.sleep(1)
            deadline = URLFETCH_TIMEOUT * 2
        except urlfetch.ResponseTooLargeError as e:
            errors.append('%r, deadline=%s' % (e, deadline))
            response = e.response
            logging.error('ResponseTooLargeError(deadline=%s, url=%r) response(%r)', deadline, url, response)
            m = re.search(r'=\s*(\d+)-', headers.get('Range') or headers.get('range') or '')
            if m is None:
                headers['Range'] = 'bytes=0-%d' % URLFETCH_MAXSIZE
            else:
                headers.pop('Range', '')
                headers.pop('range', '')
                start = int(m.group(1))
                headers['Range'] = 'bytes=%s-%d' % (start, start+URLFETCH_MAXSIZE)
            deadline = URLFETCH_TIMEOUT * 2
        except urlfetch.SSLCertificateError as e:
            errors.append('%r, should validate=0 ?' % e)
            logging.error('%r, deadline=%s', e, deadline)
        except Exception as e:
            errors.append(str(e))
            if i == 0 and method == 'GET':
                deadline = URLFETCH_TIMEOUT * 2
    else:
        start_response('500 Internal Server Error', [('Content-Type', 'text/plain')])
        yield 'Internal Server Error: %s' % errors
        raise StopIteration

    #logging.debug('url=%r response.status_code=%r response.headers=%r response.content[:1024]=%r', url, response.status_code, dict(response.headers), response.content[:1024])
    response_status = response.status_code
    response_headers = dict((k.title(), v) for k, v in response.headers.items() if not k.startswith('x-google-'))
    response_content = response.content
    content_encoding = response_headers.get('Content-Encoding', '')
    content_type = response_headers.get('Content-Type', '')
    if 300 <= response_status < 400 and 'Location' in response_headers and original_host:
        response_headers['Location'] = re.sub(r'(?<=://)%s(?=/)' % target_host, original_host, response_headers['Location'])
    if 'Set-Cookie' in response_headers:
        response_headers['Set-Cookie'] = response_headers['Set-Cookie'].replace(target_host, original_host)
    if content_encoding in ('gzip', 'deflate'):
        if content_encoding == 'gzip':
            response_content = gzip.GzipFile(fileobj=io.BytesIO(response_content)).read()
        elif content_encoding == 'deflate':
            response_content = zlib.decompress(response_content, -zlib.MAX_WBITS)
        del response_headers['Content-Encoding']
    if 'Content-Encoding' not in response_headers and content_type.startswith(('text/', 'application/json', 'application/javascript', 'application/x-javascript')):
        response_content = response_content.replace(target_host, original_host)
        if content_type.startswith('text/html'):
            response_content = re.sub(r'(?<=[:\'"]//)([a-z0-9\-\_\.]+)', lambda m: '%s.%s' % (m.group(1), server_name) if not m.group(1).endswith(server_name) else m.group(1), response_content)
            pos = response_content.find('')
            if pos > 0 and __mirror_userjs__:
                script = '\n\n' % __mirror_userjs__
                response_content = response_content[:pos] + script + response_content[pos:]
    start_response(str(response_status), response_headers.items())
    yield response_content

class LegacyHandler(object):
    """GoAgent 1.x GAE Fetch Server"""
    @classmethod
    def application(cls, environ, start_response):
        return cls()(environ, start_response)

    def __call__(self, environ, start_response):
        self.environ = environ
        self.start_response = start_response
        return self.process_request()

    def send_response(self, status, headers, content, content_type=__content_type__):
        headers['Content-Length'] = str(len(content))
        strheaders = '&'.join('%s=%s' % (k, v.encode('hex')) for k, v in headers.iteritems() if v)
        #logging.debug('response status=%s, headers=%s, content length=%d', status, headers, len(content))
        if headers.get('content-type', '').startswith(('text/', 'application/json', 'application/javascript')):
            data = '1' + zlib.compress('%s%s%s' % (struct.pack('>3I', status, len(strheaders), len(content)), strheaders, content))
        else:
            data = '0%s%s%s' % (struct.pack('>3I', status, len(strheaders), len(content)), strheaders, content)
        self.start_response('200 OK', [('Content-type', content_type)])
        return [data]

    def send_notify(self, method, url, status, content):
        logging.warning('%r Failed: url=%r, status=%r', method, url, status)
        content = '
Python Server Fetch Info

%s %r

Return Code: %d

Message: %s
' % (method, url, status, content)
        return self.send_response(status, {'content-type': 'text/html'}, content)

    def process_request(self):
        environ = self.environ
        if environ['REQUEST_METHOD'] == 'GET':
            redirect_url = 'https://%s/2' % environ['HTTP_HOST']
            self.start_response('302 Redirect', [('Location', redirect_url)])
            return [redirect_url]

        data = zlib.decompress(environ['wsgi.input'].read(int(environ['CONTENT_LENGTH'])))
        request = dict((k, v.decode('hex')) for k, _, v in (x.partition('=') for x in data.split('&')))

        method = request['method']
        url = request['url']
        payload = request['payload']

        if __password__ and __password__ != request.get('password', ''):
            return self.send_notify(method, url, 403, 'Wrong password.')

        if __hostsdeny__ and urlparse.urlparse(url).netloc.endswith(__hostsdeny__):
            return self.send_notify(method, url, 403, 'Hosts Deny: url=%r' % url)

        fetchmethod = getattr(urlfetch, method, '')
        if not fetchmethod:
            return self.send_notify(method, url, 501, 'Invalid Method')

        deadline = URLFETCH_TIMEOUT

        headers = dict((k.title(), v.lstrip()) for k, _, v in (line.partition(':') for line in request['headers'].splitlines()))
        headers['Connection'] = 'close'

        errors = []
        for _ in xrange(URLFETCH_MAX if 'fetchmax' not in request else int(request['fetchmax'])):
            try:
                response = urlfetch.fetch(url, payload, fetchmethod, headers, False, False, deadline, False)
                break
            except apiproxy_errors.OverQuotaError as e:
                time.sleep(4)
            except urlfetch.DeadlineExceededError as e:
                errors.append('DeadlineExceededError %s(deadline=%s)' % (e, deadline))
                logging.error('DeadlineExceededError(deadline=%s, url=%r)', deadline, url)
                time.sleep(1)
            except urlfetch.DownloadError as e:
                errors.append('DownloadError %s(deadline=%s)' % (e, deadline))
                logging.error('DownloadError(deadline=%s, url=%r)', deadline, url)
                time.sleep(1)
            except urlfetch.InvalidURLError as e:
                return self.send_notify(method, url, 501, 'Invalid URL: %s' % e)
            except urlfetch.ResponseTooLargeError as e:
                response = e.response
                logging.error('ResponseTooLargeError(deadline=%s, url=%r) response(%r)', deadline, url, response)
                m = re.search(r'=\s*(\d+)-', headers.get('Range') or headers.get('range') or '')
                if m is None:
                    headers['Range'] = 'bytes=0-%d' % URLFETCH_MAXSIZE
                else:
                    headers.pop('Range', '')
                    headers.pop('range', '')
                    start = int(m.group(1))
                    headers['Range'] = 'bytes=%s-%d' % (start, start+URLFETCH_MAXSIZE)
                deadline = URLFETCH_TIMEOUT * 2
            except Exception as e:
                errors.append('Exception %s(deadline=%s)' % (e, deadline))
        else:
            return self.send_notify(method, url, 500, 'Python Server: Urlfetch error: %s' % errors)

        headers = response.headers
        if 'content-length' not in headers:
            headers['content-length'] = str(len(response.content))
        headers['connection'] = 'close'
        return self.send_response(response.status_code, headers, response.content)


text:
declare namespace com {
  namespace sun {
    namespace jdi {

      class ClassNotLoadedException extends java.lang.Exception {
        public constructor(arg0: java.lang.String | string)
        public constructor(arg0: java.lang.String | string, arg1: java.lang.String | string)
        public className(): java.lang.String
      }

    }
  }
}


text:
package test.listeners.github2558;

import org.testng.IExecutionListener;

public class ExecutionListenersHolder {

  public static class ExecutionListenerA implements IExecutionListener {

    @Override
    public void onExecutionStart() {
      CallHolder.addCall(getClass().getName() + ".onExecutionStart()");
    }

    @Override
    public void onExecutionFinish() {
      CallHolder.addCall(getClass().getName() + ".onExecutionFinish()");
    }
  }

  public static class ExecutionListenerB implements IExecutionListener {

    @Override
    public void onExecutionStart() {
      CallHolder.addCall(getClass().getName() + ".onExecutionStart()");
    }

    @Override
    public void onExecutionFinish() {
      CallHolder.addCall(getClass().getName() + ".onExecutionFinish()");
    }
  }
}


text:
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE( default_constructor )
{
  JPetEvent event;
  BOOST_REQUIRE(event.getHits().empty());
}

BOOST_AUTO_TEST_CASE(constructor)
{

  JPetBarrelSlot slot1(43, true, "", 0, 43);
  JPetBarrelSlot slot2(44, true, "", 0, 44);
  JPetHit firstHit;
  JPetHit secondHit;
  firstHit.setBarrelSlot(slot1);
  secondHit.setBarrelSlot(slot2);
  JPetEvent event({firstHit, secondHit}, JPetEventType::kUnknown);

  BOOST_REQUIRE(!event.getHits().empty());
  BOOST_REQUIRE_EQUAL(event.getHits().size(), 2);
}

BOOST_AUTO_TEST_CASE(constructor_orderedHits)
{
  std::vector<JPetHit> hits(4);
  hits[0].setTime(2);
  hits[1].setTime(1);
  hits[2].setTime(4);
  hits[3].setTime(3);
  JPetEvent event(hits, JPetEventType::kUnknown);
  auto results = event.getHits();
  BOOST_REQUIRE_EQUAL(results[0].getTime(), 1);
  BOOST_REQUIRE_EQUAL(results[1].getTime(), 2);
  BOOST_REQUIRE_EQUAL(results[2].getTime(), 3);
  BOOST_REQUIRE_EQUAL(results[3].getTime(), 4);
}

BOOST_AUTO_TEST_CASE(constructor_unorderedHits)
{
  std::vector<JPetHit> hits(4);
  hits[0].setTime(2);
  hits[1].setTime(1);
  hits[2].setTime(4);
  hits[3].setTime(3);
  JPetEvent event(hits, JPetEventType::kUnknown, false);
  auto results = event.getHits();
  BOOST_REQUIRE_EQUAL(results[0].getTime(), 2);
  BOOST_REQUIRE_EQUAL(results[1].getTime(), 1);
  BOOST_REQUIRE_EQUAL(results[2].getTime(), 4);
  BOOST_REQUIRE_EQUAL(results[3].getTime(), 3);
}

BOOST_AUTO_TEST_CASE(set_unorderedHits)
{
  JPetEvent event;
  std::vector<JPetHit> hits(4);
  hits[0].setTime(2);
  hits[1].setTime(1);
  hits[2].setTime(4);
  hits[3].setTime(3);
  event.setHits(hits, false);
  auto results = event.getHits();
  BOOST_REQUIRE_EQUAL(results[0].getTime(), 2);
  BOOST_REQUIRE_EQUAL(results[1].getTime(), 1);
  BOOST_REQUIRE_EQUAL(results[2].getTime(), 4);
  BOOST_REQUIRE_EQUAL(results[3].getTime(), 3);
}

BOOST_AUTO_TEST_CASE(set_orderedHits)
{
  JPetEvent event;
  std::vector<JPetHit> hits(4);
  hits[0].setTime(2);
  hits[1].setTime(1);
  hits[2].setTime(4);
  hits[3].setTime(3);
  event.setHits(hits);
  auto results = event.getHits();
  BOOST_REQUIRE_EQUAL(results[0].getTime(), 1);
  BOOST_REQUIRE_EQUAL(results[1].getTime(), 2);
  BOOST_REQUIRE_EQUAL(results[2].getTime(), 3);
  BOOST_REQUIRE_EQUAL(results[3].getTime(), 4);
}

BOOST_AUTO_TEST_CASE(addHit)
{
  JPetEvent event;
  JPetHit firstHit;
  JPetHit secondHit;
  JPetHit thirdHit;
  event.setHits( {firstHit, secondHit});
  BOOST_REQUIRE(!event.getHits().empty());
  BOOST_REQUIRE_EQUAL(event.getHits().size(), 2);
  event.addHit(thirdHit);
  BOOST_REQUIRE_EQUAL(event.getHits().size(), 3);
}

BOOST_AUTO_TEST_CASE(eventTypes)
{
  JPetEvent event;
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::kUnknown) == JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) != JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) != JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kPrompt) != JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_CASE(eventTypes2)
{
  JPetHit firstHit;
  JPetEvent event( {firstHit}, JPetEventType::kPrompt);
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::kPrompt) == JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) != JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) != JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_CASE(eventTypes3)
{
  JPetHit firstHit;
  JPetEvent event( {firstHit}, static_cast<JPetEventType>(JPetEventType::kPrompt | JPetEventType::k2Gamma));
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::kPrompt) == JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) == JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) != JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_CASE(isTypeOf)
{
  JPetHit firstHit;
  JPetEvent event( {firstHit}, static_cast<JPetEventType>(JPetEventType::kPrompt | JPetEventType::k2Gamma));
  BOOST_REQUIRE(event.isTypeOf(JPetEventType::k2Gamma));
  BOOST_REQUIRE(!event.isTypeOf(JPetEventType::k3Gamma));
  BOOST_REQUIRE(event.isTypeOf(JPetEventType::kPrompt));
  BOOST_REQUIRE(!event.isTypeOf(JPetEventType::kUnknown));
  BOOST_REQUIRE(!event.isTypeOf(JPetEventType::kScattered));
}

BOOST_AUTO_TEST_CASE(isOnlyTypeOf)
{
  JPetHit firstHit;
  JPetEvent event( {firstHit}, static_cast<JPetEventType>(JPetEventType::kPrompt | JPetEventType::k2Gamma));
  BOOST_REQUIRE(!event.isOnlyTypeOf(JPetEventType::k2Gamma));
  BOOST_REQUIRE(!event.isOnlyTypeOf(JPetEventType::k3Gamma));
  BOOST_REQUIRE(!event.isOnlyTypeOf(JPetEventType::kPrompt));
  BOOST_REQUIRE(!event.isOnlyTypeOf(JPetEventType::kUnknown));
  BOOST_REQUIRE(!event.isOnlyTypeOf(JPetEventType::kScattered));
  BOOST_REQUIRE(event.isOnlyTypeOf(static_cast<JPetEventType>(JPetEventType::kPrompt | JPetEventType::k2Gamma)));

  JPetEvent event2;
  event2.addEventType(JPetEventType::kPrompt);
  BOOST_REQUIRE(event2.isOnlyTypeOf(JPetEventType::kPrompt));
  BOOST_REQUIRE(!event2.isOnlyTypeOf(JPetEventType::k2Gamma));
  BOOST_REQUIRE(!event2.isOnlyTypeOf(JPetEventType::k3Gamma));
  BOOST_REQUIRE(!event2.isOnlyTypeOf(JPetEventType::kUnknown));
  BOOST_REQUIRE(!event2.isOnlyTypeOf(JPetEventType::kScattered));
}

BOOST_AUTO_TEST_CASE(setGetType)
{
  JPetHit firstHit;
  JPetEvent event( {firstHit}, JPetEventType::kPrompt);
  event.setEventType(static_cast<JPetEventType>(JPetEventType::k2Gamma | JPetEventType::k3Gamma));
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::kPrompt) != JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) == JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) == JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_CASE(addEventType)
{
  JPetHit firstHit;
  JPetEvent event( {firstHit}, JPetEventType::kPrompt);
  event.addEventType(JPetEventType::k2Gamma);
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::kPrompt) == JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) == JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) != JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_CASE(addEventType2)
{
  JPetEvent event; /// default is kUnknown
  event.addEventType(JPetEventType::k2Gamma);
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) == JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) != JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kPrompt) != JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_CASE(addEventType3)
{
  JPetEvent event; /// default is kUnknown
  event.addEventType(JPetEventType::k2Gamma);
  auto type = event.getEventType();
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) == JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) != JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kPrompt) != JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);

  event.addEventType(JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::k2Gamma) == JPetEventType::k2Gamma);
  BOOST_REQUIRE((type & JPetEventType::k3Gamma) == JPetEventType::k3Gamma);
  BOOST_REQUIRE((type & JPetEventType::kUnknown) != JPetEventType::kUnknown);
  BOOST_REQUIRE((type & JPetEventType::kPrompt) != JPetEventType::kPrompt);
  BOOST_REQUIRE((type & JPetEventType::kScattered) != JPetEventType::kScattered);
}

BOOST_AUTO_TEST_SUITE_END()


text:
<?php

namespace MongoObjectTest;

use MongoId;
use MongoDate;

class MapperTest extends AbstractTestCase
{
    public function setUp()
    {
        parent::setUp();
        $this->admin = $this->mapper->findObjectByProp('User', 'login', 'admin');
        $this->data = [
            'login' => 'testuser',
            'type' => User::TYPE_USER,
            'name' => 'Test user',
            'password' => hash('sha256', 'user'),
            'active' => false,
            'age' => 22.5,
            'created' => new MongoDate(),
            'manager' => null,
        ];
    }

    public function testFindObject()
    {
        $user = $this->mapper->findObject('User', $this->admin->_id);
        $this->assertInstanceOf('MongoObjectTest\User', $user);
        $this->assertEquals($this->admin->_id, $user->_id);

        $user = $this->mapper->findObject('User', (string) $this->admin->_id);
        $this->assertInstanceOf('MongoObjectTest\User', $user);
        $this->assertEquals($this->admin->_id, $user->_id);

        $user = $this->mapper->findObject('User', new MongoId());
        $this->assertNull($user);

        $user = $this->mapper->findObject('User', "invalid id");
        $this->assertNull($user);

        $user = $this->mapper->findObject('User', null);
        $this->assertNull($user);

        $user = $this->mapper->findObject('User', 12355);
        $this->assertNull($user);
    }

    /**
     * @depends testFindObject
     */
    public function testFindObjectByProp()
    {
        $user = $this->mapper->findObjectByProp('User', 'login', 'admin2');
        $this->assertInstanceOf('MongoObjectTest\User', $user);
        $this->assertEquals('admin2', $user->login);

        $user = $this->mapper->findObjectByProp('User', "_id", null);
        $this->assertNull($user);

        $user = $this->mapper->findObjectByProp('User', "_id", '11223');
        $this->assertNull($user);

        $user = $this->mapper->findObjectByProp('User', "nothing", 1);
        $this->assertNull($user);
    }

    /**
     * @depends testFindObjectByProp
     */
    public function testCountObjects()
    {
        $this->assertSame(0, $this->mapper->countObjects('User', ['type' => 100]));
        $this->assertSame(2, $this->mapper->countObjects('User', ['type' => User::TYPE_ADMIN]));
        $this->assertSame(1, $this->mapper->countObjects('User', ['type' => User::TYPE_GUEST]));
        $this->assertSame(3, $this->mapper->countObjects('User', []));
        $this->assertSame(false, $this->mapper->countObjects('UnkonwnType', ['type' => User::TYPE_ADMIN]));
        $this->assertSame(0, $this->mapper->countObjects('User', ['none' => 1]));
    }

    /**
     * @depends testCountObjects
     */
    public function testNewObject()
    {
        $user = $this->mapper->newObject('User', $this->data);
        $this->assertInstanceOf('MongoObjectTest\User', $user);
        $this->assertSame($this->data['login'], $user->login);
        $user = $this->mapper->newObject('WrongUser', $this->data);
        $this->assertNull($user);
    }

    /**
     * @depends testNewObject
     */
    public function testMagicGet()
    {
        $this->assertInstanceOf('MongoDB', $this->mapper->mongodb);
    }

    /**
     * @depends testMagicGet
     */
    public function testFetchObjects()
    {
        $users = $this->mapper->fetchObjects('User', ['type' => User::TYPE_ADMIN]);
        $this->assertSame(2, count($users));
        $this->assertInstanceOf('MongoObjectTest\User', $users[0]);
        $this->assertInstanceOf('MongoObjectTest\User', $users[1]);

        $users = $this->mapper->fetchObjects('User', ['type' => User::TYPE_ADMIN], ['login' => 1]);
        $this->assertSame(2, count($users));
        $this->assertInstanceOf('MongoObjectTest\User', $users[0]);
        $this->assertInstanceOf('MongoObjectTest\User', $users[1]);
        $this->assertSame('admin', $users[0]->login);
        $this->assertSame('admin2', $users[1]->login);

        $users = $this->mapper->fetchObjects('User', ['type' => User::TYPE_ADMIN], ['login' => 1], 1);
        $this->assertSame(1, count($users));
        $this->assertInstanceOf('MongoObjectTest\User', $users[0]);
        $this->assertSame('admin', $users[0]->login);

        $users = $this->mapper->fetchObjects('User', ['type' => User::TYPE_ADMIN], ['login' => 1], null, 1);
        $this->assertSame(1, count($users));
        $this->assertInstanceOf('MongoObjectTest\User', $users[0]);
        $this->assertSame('admin2', $users[0]->login);

        $users = $this->mapper->fetchObjects('User', ['type' => 100]);
        $this->assertSame(0, count($users));
    }

    /**
     * @depends testFetchObjects
     */
    public function testErrors()
    {
        $this->assertNull($this->mapper->findObject('UnknownClass', 1));
        $this->assertNull($this->mapper->findObjectByProp('UnknownClass', 'attr', 'val'));
        $this->assertNull($this->mapper->fetchObjects('UnknownClass'));
    }

    /**
     * @depends testErrors
     */
    public function testUpdate()
    {
        $result = $this->mapper->updateObjects('User', ['type' => User::TYPE_ADMIN], ['age' => 6]);
        $this->assertSame($result, 2);
        $users = $this->mapper->fetchObjects('User', ['age' => 6.0]);
        $this->assertSame(2, count($users));
        $this->assertSame(6.0, $users[0]->age);
        $this->assertSame(6.0, $users[1]->age);

        $result = $this->mapper->updateObjects('UnknownType', ['type' => User::TYPE_ADMIN], ['age' => 6]);
        $this->assertSame($result, false);
    }

    /**
     * @depends testUpdate
     */
    public function testDelete()
    {
        $result = $this->mapper->deleteObjects('UnknownType', ['type' => User::TYPE_ADMIN]);
        $this->assertSame($result, false);

        $result = $this->mapper->deleteObjects('User', ['age' => 6.0]);
        $this->assertSame($result, true);
    }
}


text:
package org.hl7.types.impl;

import org.hl7.types.ANY;
import org.hl7.types.BL;
import org.hl7.types.INT;
import org.hl7.types.NullFlavor;
import org.hl7.types.Numeric;
import org.hl7.types.ORD;
import org.hl7.types.QTY;
import org.hl7.types.REAL;

/**
 * Minimal implementation of INT as a model we can use for all other type. This one is only used to convey NULL values.
 * Again, we have static values of it, so we don't create so many objects in a running program.
 */
public class INTnull extends ORDimpl implements INT, Numeric {
	public static final INTnull NI = new INTnull(NullFlavorImpl.NI);
	public static final INTnull NA = new INTnull(NullFlavorImpl.NA);
	public static final INTnull UNK = new INTnull(NullFlavorImpl.UNK);
	public static final INTnull NASK = new INTnull(NullFlavorImpl.NASK);
	public static final INTnull ASKU = new INTnull(NullFlavorImpl.ASKU);
	public static final INTnull NAV = new INTnull(NullFlavorImpl.NAV);
	public static final INTnull OTH = new INTnull(NullFlavorImpl.OTH);
	public static final INTnull PINF = INTpinf.VALUE;
	public static final INTnull NINF = INTninf.VALUE;

	protected INTnull(final NullFlavor nf) {
		super(nf);
	}

	/**
	 * Get the a null value according to the null flavor code.
	 */
	public static INTnull valueOf(final String nullFlavor) {
	    return ANYimpl.nullValueOf(INTnull.class, nullFlavor);
	}

	/**
	 * FIXME: is NA correct or should it be derived from this and that?
	 *
	 * FIXME: infinities may need to be treated differently!
	 */
	// public BL equal(ANY that) { return BLimpl.NA; }
	/**
	 * the equal will tell whether the given ANY is equal to this object.
	 *
	 * At least this function will return BLimpl.TRUE on INTnull.PINF.equal(INTnull.PINF) and BLimpl.FALSE on
	 * INTnull.PINF.equal(INTnull.NI)!
	 *
	 * @param that
	 * @return BLimpl.TRUE if that is equal to this object.
	 */
	@Override
    public BL equal(final ANY that) {
		/**
		 * The contract of equal shall be carried no matter the semantics value of the class itself.
		 */
		if (that instanceof INTnull) {
			final INTnull thatObj = (INTnull) that;
			return thatObj.nullFlavor().equal(this.nullFlavor());
		} else {
			return BLimpl.FALSE;
		}
	}

	// equals() method has been overriden in ANYimpl class
	/**
	 * override hashCode() method.
	 *
	 * @return hashCode
	 */
	@Override
    public int hashCode() {
		return this.nullFlavor().hashCode();
	}

	public BL equal(final int x) {
		return BLimpl.NA;
	}

	public BL equal(final long x) {
		return BLimpl.NA;
	}

	public BL equal(final float x) {
		return BLimpl.NA;
	}

	public BL equal(final double x) {
		return BLimpl.NA;
	}

	// FIXME: we're returning NAs here. Shouldn't we return a null
	// that is this flavor or a flavor that's a result of the
	// combination of this and that?
	// FIXME: infinities can be compared!
	@Override
    public BL lessOrEqual(final ORD x) {
		return BLimpl.NA;
	}

	public BL lessOrEqual(final int x) {
		return BLimpl.NA;
	}

	public BL lessOrEqual(final long x) {
		return BLimpl.NA;
	}

	public BL lessOrEqual(final float x) {
		return BLimpl.NA;
	}

	public BL lessOrEqual(final double x) {
		return BLimpl.NA;
	}

	@Override
    public BL compares(final ORD x) {
		return BLimpl.NA;
	}

	public BL compares(final long x) {
		return BLimpl.TRUE;
	}

	public QTY plus(final QTY.diff x) {
		return INTnull.NA;
	}

	public INT plus(final INT x) {
		return INTnull.NA;
	}

	public INT plus(final int x) {
		return INTnull.NA;
	}

	public INT plus(final long x) {
		return INTnull.NA;
	}

	public INT plus(final float x) {
		return INTnull.NA;
	}

	public INT plus(final double x) {
		return INTnull.NA;
	}

	public INT minus(final QTY x) {
		return INTnull.NA;
	}

	public INT minus(final QTY.diff x) {
		return INTnull.NA;
	}

	public INT minus(final INT x) {
		return INTnull.NA;
	}

	public INT minusReverse(final int x) {
		return INTnull.NA;
	}

	public INT minusReverse(final long x) {
		return INTnull.NA;
	}

	public INT minusReverse(final float x) {
		return INTnull.NA;
	}

	public INT minusReverse(final double x) {
		return INTnull.NA;
	}

	public BL isZero() {
		return BLimpl.NA;
	}

	public BL nonZero() {
		return BLimpl.NA;
	}

	public BL isOne() {
		return BLimpl.NA;
	}

	public INT successor() {
		return INTnull.NA;
	}

	public INT predecessor() {
		return INTnull.NA;
	}

	public INT times(final REAL x) {
		return INTnull.NA;
	}

	public INT times(final INT x) {
		return INTnull.NA;
	}

	public INT times(final int x) {
		return INTnull.NA;
	}

	public INT times(final long x) {
		return INTnull.NA;
	}

	public INT dividedBy(final INT that) {
		return INTnull.NA;
	}

	public INT dividedByReverse(final int that) {
		return INTnull.NA;
	}

	public INT dividedByReverse(final long that) {
		return INTnull.NA;
	}

	public INT negated() {
		return INTnull.NA;
	}

	public BL isNegative() {
		return BLimpl.NA;
	}

	public BL nonNegative() {
		return BLimpl.NA;
	}

	public int intValue() {
		throw new NullPointerException();
	}

	public long longValue() {
		throw new NullPointerException();
	}

	public float floatValue() {
		throw new NullPointerException();
	}

	public double doubleValue() {
		throw new NullPointerException();
	}

	public REAL toREAL() {
		return REALnull.valueOf(nullFlavor().toString());
	}

	public INT epsilon() {
		return INTlongAdapter.ONE;
	}
};


text:
@implementation UICollectionView (GCDelegateAndDataSourceBlock)

- (void)usingBlocks {
    [self registerBlockProxyWithClass:[UICollectionViewDelegateAndDataSourceImplementationProxy class]];
}

@dynamic blockForItemNumber;
@dynamic blockForSectionNumber;
@dynamic blockForItemCell;
@dynamic blockForSupplementaryElement;

@dynamic blockForItemShouldSelect;
@dynamic blockForItemDidSelect;
@dynamic blockForItemShouldDeselect;
@dynamic blockForItemDidDeselect;
@dynamic blockForItemShouldHighlight;
@dynamic blockForItemDidHighlight;
@dynamic blockForItemDidUnhighlight;
@dynamic blockForItemWillDisplay;
@dynamic blockForSupplementaryWillDisplay;
@dynamic blockForItemCellDidEndDisplay;
@dynamic blockForSupplementaryDidEndDisplay;
@dynamic blockForLayoutTransition;
@dynamic blockForItemMenuShouldShow;
@dynamic blockForItemCanPerformAction;
@dynamic blockForItemPerformAction;

@dynamic blockForFlowLayoutSize;
@dynamic blockForFlowLayoutSectionInset;
@dynamic blockForFlowLayoutSectionMinimumSpacing;
@dynamic blockForFlowLayoutSectionMinimumInteritemSpacing;
@dynamic blockForFlowLayoutHeaderReferenceSize;
@dynamic blockForFlowLayoutFooterReferenceSize;

+ (void)load {
    [self extensionAccessorGenerator];
}

@end


text:
Buildah - A command line tool that facilitates building OCI container images.

## SYNOPSIS
buildah [OPTIONS] COMMAND [ARG...]

## DESCRIPTION
The Buildah package provides a command line tool which can be used to:

    * Create a working container, either from scratch or using an image as a starting point.
    * Mount a working container's root filesystem for manipulation.
    * Unmount a working container's root filesystem.
    * Use the updated contents of a container's root filesystem as a filesystem layer to create a new image.
    * Delete a working container or an image.
    * Rename a local container.

## OPTIONS

**--cgroup-manager**=*manager*

The CGroup manager to use for container cgroups. Supported values are cgroupfs or systemd. Default is systemd unless overridden in the containers.conf file.

Note: Setting this flag can cause certain commands to break when called on containers previously created by the other CGroup manager type.
Note: CGroup manager is not supported in rootless mode when using CGroups Version V1.

**--log-level** **value**

The log level to be used. Either "trace", "debug", "info", "warn", "error", "fatal", or "panic", defaulting to "warn".

**--help, -h**

Show help

**--registries-conf** *path*

Pathname of the configuration file which specifies which container registries should be
consulted when completing image names which do not include a registry or domain
portion.  It is not recommended that this option be used, as the default
behavior of using the system-wide configuration
(*/etc/containers/registries.conf*) is most often preferred.

**--registries-conf-dir** *path*

Pathname of the directory which contains configuration snippets which specify
registries which should be consulted when completing image names which do not
include a registry or domain portion.  It is not recommended that this option
be used, as the default behavior of using the system-wide configuration
(*/etc/containers/registries.d*) is most often preferred.

**--root** **value**

Storage root dir (default: "/var/lib/containers/storage" for UID 0, "$HOME/.local/share/containers/storage" for other users)
Default root dir is configured in /etc/containers/storage.conf

**--runroot** **value**

Storage state dir (default: "/run/containers/storage" for UID 0, "/run/user/$UID" for other users)
Default state dir is configured in /etc/containers/storage.conf

**--short-name-alias-conf** *path*

Pathname of the file which contains cached mappings between short image names
and their corresponding fully-qualified names.  It is used for mapping from
names of images specified using short names like "ubi8" which don't
include a registry component and a corresponding fully-specified name which
includes a registry and any other components, such as
"registry.access.redhat.com/ubi8".  It is not recommended that this option be
used, as the default behavior of using the system-wide cache
(*/var/cache/containers/short-name-aliases.conf*) or per-user cache
(*$HOME/.cache/containers/short-name-aliases.conf*) to supplement system-wide
defaults is most often preferred.

**--storage-driver** **value**

Storage driver.  The default storage driver for UID 0 is configured in /etc/containers/storage.conf (`$HOME/.config/containers/storage.conf` in rootless mode), and is *vfs* for other users.  The `STORAGE_DRIVER` environment variable overrides the default.  The --storage-driver specified driver overrides all.

Examples: "overlay", "devicemapper", "vfs"

Overriding this option will cause the *storage-opt* settings in /etc/containers/storage.conf to be ignored.  The user must
specify additional options via the `--storage-opt` flag.

**--storage-opt** **value**

Storage driver option, Default storage driver options are configured in /etc/containers/storage.conf (`$HOME/.config/containers/storage.conf` in rootless mode). The `STORAGE_OPTS` environment variable overrides the default. The --storage-opt specified options overrides all.

**--userns-gid-map** *mapping*

Directly specifies a GID mapping which should be used to set ownership, at the
filesystem level, on the working container's contents.
Commands run when handling `RUN` instructions will default to being run in
their own user namespaces, configured using the UID and GID maps.

Entries in this map take the form of one or more colon-separated triples of a starting
in-container GID, a corresponding starting host-level GID, and the number of
consecutive IDs which the map entry represents.

This option overrides the *remap-gids* setting in the *options* section of
/etc/containers/storage.conf.

If this option is not specified, but a global --userns-gid-map setting is
supplied, settings from the global option will be used.

If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-gid-map
are specified, but --userns-uid-map is specified, the GID map will be set to
use the same numeric values as the UID map.

**NOTE:** When this option is specified by a rootless user, the specified mappings are relative to the rootless usernamespace in the container, rather than being relative to the host as it would be when run rootful.

**--userns-uid-map** *mapping*

Directly specifies a UID mapping which should be used to set ownership, at the
filesystem level, on the working container's contents.
Commands run when handling `RUN` instructions will default to being run in
their own user namespaces, configured using the UID and GID maps.

Entries in this map take the form of one or more colon-separated triples of a starting
in-container UID, a corresponding starting host-level UID, and the number of
consecutive IDs which the map entry represents.

This option overrides the *remap-uids* setting in the *options* section of
/etc/containers/storage.conf.

If this option is not specified, but a global --userns-uid-map setting is
supplied, settings from the global option will be used.

If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-uid-map
are specified, but --userns-gid-map is specified, the UID map will be set to
use the same numeric values as the GID map.

**NOTE:** When this option is specified by a rootless user, the specified mappings are relative to the rootless usernamespace in the container, rather than being relative to the host as it would be when run rootful.

**--version**, **-v**

Print the version

## Environment Variables

Buildah can set up environment variables from the env entry in the [engine] table in the containers.conf(5). These variables can be overridden by passing environment variables before the `buildah` commands.

## COMMANDS

| Command    | Man Page                                         | Description                                                                                |
| ---------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| add        | [buildah-add(1)](buildah-add.1.md)               | Add the contents of a file, URL, or a directory to the container.                                    |
| build      | [buildah-build(1)](buildah-build.1.md)           | Builds an OCI image using instructions in one or more Containerfiles.                                |
| commit     | [buildah-commit(1)](buildah-commit.1.md)         | Create an image from a working container.                                                            |
| config     | [buildah-config(1)](buildah-config.1.md)         | Update image configuration settings.                                                                 |
| containers | [buildah-containers(1)](buildah-containers.1.md) | List the working containers and their base images.                                                   |
| copy       | [buildah-copy(1)](buildah-copy.1.md)             | Copies the contents of a file, URL, or directory into a container's working directory.               |
| from       | [buildah-from(1)](buildah-from.1.md)             | Creates a new working container, either from scratch or using a specified image as a starting point. |
| images     | [buildah-images(1)](buildah-images.1.md)         | List images in local storage.                                                                        |
| info       | [buildah-info(1)](buildah-info.1.md)             | Display Buildah system information.                                                                  |
| inspect    | [buildah-inspect(1)](buildah-inspect.1.md)       | Inspects the configuration of a container or image                                                   |
| login      | [buildah-login(1)](buildah-login.1.md)           | Login to a container registry.                                                                       |
| logout     | [buildah-logout(1)](buildah-logout.1.md)         | Logout of a container registry                                                                       |
| manifest   | [buildah-manifest(1)](buildah-manifest.1.md)     | Create and manipulate manifest lists and image indexes.                                              |
| mount      | [buildah-mount(1)](buildah-mount.1.md)           | Mount the working container's root filesystem.                                                       |
| pull       | [buildah-pull(1)](buildah-pull.1.md)             | Pull an image from the specified location.                                                           |
| push       | [buildah-push(1)](buildah-push.1.md)             | Push an image from local storage to elsewhere.                                                       |
| rename     | [buildah-rename(1)](buildah-rename.1.md)         | Rename a local container.                                                                            |
| rm         | [buildah-rm(1)](buildah-rm.1.md)                 | Removes one or more working containers.                                                              |
| rmi        | [buildah-rmi(1)](buildah-rmi.1.md)               | Removes one or more images.                                                                          |
| run        | [buildah-run(1)](buildah-run.1.md)               | Run a command inside of the container.                                                               |
| source     | [buildah-source(1)](buildah-source.1.md)         | Create, push, pull and manage source images and associated source artifacts.                         |
| tag        | [buildah-tag(1)](buildah-tag.1.md)               | Add an additional name to a local image.                                                             |
| umount     | [buildah-umount(1)](buildah-umount.1.md)         | Unmount a working container's root file system.                                                      |
| unshare    | [buildah-unshare(1)](buildah-unshare.1.md)       | Launch a command in a user namespace with modified ID mappings.                                      |
| version    | [buildah-version(1)](buildah-version.1.md)       | Display the Buildah Version Information                                                              |

## Files

**storage.conf** (`/etc/containers/storage.conf`)

storage.conf is the storage configuration file for all tools using containers/storage

The storage configuration file specifies all of the available container storage options for tools using shared container storage.

**mounts.conf** (`/usr/share/containers/mounts.conf` and optionally `/etc/containers/mounts.conf`)

The mounts.conf files specify volume mount files or directories that are automatically mounted inside containers when executing the `buildah run` or `buildah build` commands.  Container processes can then use this content.  The volume mount content does not get committed to the final image.

Usually these directories are used for passing secrets or credentials required by the package software to access remote package repositories.

For example, a mounts.conf with the line "`/usr/share/rhel/secrets:/run/secrets`", the content of `/usr/share/rhel/secrets` directory is mounted on `/run/secrets` inside the container.  This mountpoint allows Red Hat Enterprise Linux subscriptions from the host to be used within the container.  It is also possible to omit the destination if it's equal to the source path.  For example, specifying `/var/lib/secrets` will mount the directory into the same container destination path `/var/lib/secrets`.

Note this is not a volume mount. The content of the volumes is copied into container storage, not bind mounted directly from the host.

**registries.conf** (`/etc/containers/registries.conf`)

registries.conf is the configuration file which specifies which container registries should be consulted when completing image names which do not include a registry or domain portion.

**registries.d** (`/etc/containers/registries.d`)

Directory which contains configuration snippets which specify registries which should be consulted when completing image names which do not include a registry or domain portion.

## SEE ALSO
containers.conf(5), containers-mounts.conf(5), newuidmap(1), newgidmap(1), containers-registries.conf(5), containers-storage.conf(5)

## HISTORY
December 2017, Originally compiled by Tom Sweeney <tsweeney@redhat.com>


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.11.29 at 12:35:53 PM GMT
//

package org.mule.modules.hybris.model;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for atomicTypeDTO complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="atomicTypeDTO">
 *   <complexContent>
 *     <extension base="{}typeDTO">
 *       <sequence>
 *         <element name="javaClass" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="subtypes" minOccurs="0">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <sequence>
 *                   <element name="atomicType" type="{}atomicTypeDTO" maxOccurs="unbounded" minOccurs="0"/>
 *                 </sequence>
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element name="superType" type="{}atomicTypeDTO" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "atomicTypeDTO", propOrder = {
    "javaClass",
    "subtypes",
    "superType"
})
public class AtomicTypeDTO
    extends TypeDTO
{

    protected String javaClass;
    protected AtomicTypeDTO.Subtypes subtypes;
    protected AtomicTypeDTO superType;

    /**
     * Gets the value of the javaClass property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getJavaClass() {
        return javaClass;
    }

    /**
     * Sets the value of the javaClass property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setJavaClass(String value) {
        this.javaClass = value;
    }

    /**
     * Gets the value of the subtypes property.
     *
     * @return
     *     possible object is
     *     {@link AtomicTypeDTO.Subtypes }
     *
     */
    public AtomicTypeDTO.Subtypes getSubtypes() {
        return subtypes;
    }

    /**
     * Sets the value of the subtypes property.
     *
     * @param value
     *     allowed object is
     *     {@link AtomicTypeDTO.Subtypes }
     *
     */
    public void setSubtypes(AtomicTypeDTO.Subtypes value) {
        this.subtypes = value;
    }

    /**
     * Gets the value of the superType property.
     *
     * @return
     *     possible object is
     *     {@link AtomicTypeDTO }
     *
     */
    public AtomicTypeDTO getSuperType() {
        return superType;
    }

    /**
     * Sets the value of the superType property.
     *
     * @param value
     *     allowed object is
     *     {@link AtomicTypeDTO }
     *
     */
    public void setSuperType(AtomicTypeDTO value) {
        this.superType = value;
    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       <sequence>
     *         <element name="atomicType" type="{}atomicTypeDTO" maxOccurs="unbounded" minOccurs="0"/>
     *       </sequence>
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "atomicType"
    })
    public static class Subtypes {

        protected List<AtomicTypeDTO> atomicType;

        /**
         * Gets the value of the atomicType property.
         *
         *

         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a set method for the atomicType property.
         *
         *

         * For example, to add a new item, do as follows:
         *

         *    getAtomicType().add(newItem);
         *

         *
         *
         *

         * Objects of the following type(s) are allowed in the list
         * {@link AtomicTypeDTO }
         *
         *
         */
        public List<AtomicTypeDTO> getAtomicType() {
            if (atomicType == null) {
                atomicType = new ArrayList<AtomicTypeDTO>();
            }
            return this.atomicType;
        }

    }

}


text:
@implementation FLCameraViewControllerBottomButtonView

@synthesize leftButton = _leftButton;
@synthesize rightButton = _rightButton;
@synthesize centerButton = _centerButton;

- (void) initSelf
{

	self.frame = FLRectSetHeight(self.frame, 54);
	self.backgroundColor = [UIColor blackColor];
//	  self.viewContentsDescriptor = FLViewContentsDescriptorMakeWithItemsAndPadding(FLViewContentItemNone, FLViewContentItemNone, UIEdgeInsetsMake(PADDING,PADDING,PADDING,PADDING));

	self.backgroundColor = [UIColor clearColor];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
	if ((self = [super initWithCoder:aDecoder]))
	{
		[self initSelf];

	}

	return self;
}

- (id)initWithFrame:(CGRect)frame
{
	if ((self = [super initWithFrame:frame]))
	{
		[self initSelf];
	}

	return self;
}

- (void) setCommonTraitsForButtons:(UIButton*) button
{
	button.alpha = 0.6;
	button.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];
	[button setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
	[button setTitleShadowColor:[UIColor whiteColor] forState:UIControlStateNormal];
	button.titleLabel.shadowOffset = CGSizeMake(0, 1.0);
	[button setTitleColor:[UIColor grayColor] forState:UIControlStateDisabled];
}

- (void) setLeftButton:(id) button
{
	if(_leftButton != button)
	{
		[_leftButton removeFromSuperview];
		FLReleaseWithNil(_leftButton);
	}
	_leftButton = FLRetain(button);

	[self addSubview:_leftButton];
}

- (void) setRightButton:(id) button
{
	if(_rightButton != button)
	{
		[_rightButton removeFromSuperview];
		FLReleaseWithNil(_rightButton);
	}
	_rightButton = FLRetain(button);

	[self addSubview:_rightButton];
}

- (void) setCenterButton:(id) button
{
	if(_centerButton != button)
	{
		[_centerButton removeFromSuperview];
		FLReleaseWithNil(_centerButton);
	}
	_centerButton = FLRetain(button);

	[self addSubview:_centerButton];
}

- (void) dealloc
{
	FLReleaseWithNil(_leftButton);
	FLReleaseWithNil(_rightButton);
	FLReleaseWithNil(_centerButton);

	FLSuperDealloc();
}

- (void) layoutSubviews
{
	[super layoutSubviews];

	[self setFrameIfChanged:FLRectJustifyRectInRectBottom(self.superview.bounds, self.frame)];
}

//- (void) layoutSubviews
//{
//	[super layoutSubviews];
//	[_leftButton positionInSuperview];
//	[_rightButton positionInSuperview];
//	[_centerButton positionInSuperview];
//}

@end


text:
![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png) 2

To use the Crestron Home Automation skill, try saying...

* *Alexa, launch Crestron*

* *Alexa, tell Crestron I'd like to read in the bedroom*

* *Alexa, ask Crestron to raise the shades in the living room*

An Alexa enabled Crestron Home Automation system allows you to do more than just control lights and thermostats. It allows you to talk to your house. Tell your house you'd like to watch TV in the bedroom, and we can lower the shades, turn on the TV, and set the lighting just right.

Some example requests:
"Alexa, ask Crestron to turn on the lights in the kitchen"
"Alexa, tell Crestron to set the kitchen lights to 50 percent"
"Alexa, ask Crestron to lower the kitchen lights by 20 percent"
"Alexa, tell Crestron to set the temperature in the living room to 70 degrees"
"Alexa, ask Crestron to lower the living room temperature by 5 degrees"
"Alexa, tell Crestron to lower the shades in the office"
"Alexa, ask Crestron to set the office shades to half"
"Alexa, ask Crestron to recall the morning scene in the master bathroom"
"Alexa, tell Crestron I'd like to watch a movie in the living room"

For more help with controlling your Crestron system with Alexa, go to http://partners.crestron.com/alexa/faq

Talk to your integrator to enable your Crestron 3-Series processor for Alexa control.

For information about all Crestron products, including Home Automation products, go to http://www.crestron.com

***

### Skill Details

* **Invocation Name:** crestron
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.a675266c-7074-42d4-b50c-1ee1d8ca1dc1
* **ASIN:** B01M1DRK54
* **Author:** Crestron Electronics, Inc.
* **Release Date:** December 2, 2016 @ 17:05:13
* **Privacy Policy:** http://www.crestron.com/legal/privacy-policy
* **In-App Purchasing:** No


text:
package com.infinityraider.agricraft.plugins.theoneprobe;

import com.infinityraider.agricraft.api.v1.plugin.*;
import com.infinityraider.agricraft.reference.Names;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;

@SuppressWarnings("unused")
@AgriPlugin(modId = Names.Mods.THE_ONE_PROBE)
public class TheOneProbePlugin implements IAgriPlugin {
    @Override
    public boolean isEnabled() {
        return ModList.get().isLoaded(this.getId());
    }

    @Override
    public String getId() {
        return Names.Mods.THE_ONE_PROBE;
    }

    @Override
    public String getDescription() {
        return "The One Probe compatibility";
    }

    @Override
    public void onInterModEnqueueEvent(InterModEnqueueEvent event) {
        InterModComms.sendTo(this.getId(), "getTheOneProbe", TheOneProbeSupplier.getSupplier());
    }
}


text: Reporter for IntelliJ / WebStorm.


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EnumerableExtensionMethodsTest.cs" company="Slash Games">
//   Copyright (c) Slash Games. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Slash.Collections.Tests.Source.Extensions
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    using NUnit.Framework;

    using Slash.Collections.Extensions;
    using Slash.Collections.Utils;

    public class EnumerableExtensionMethodsTest
    {
        #region Public Methods and Operators

        [Test]
        public void TestIsNullOrEmptyEmpty()
        {
            IEnumerable nullEnumerable = new object[] { };
            IEnumerable<object> nullEnumerableT = new List<object>();
            Assert.IsTrue(nullEnumerable.IsNullOrEmpty());
            Assert.IsTrue(nullEnumerableT.IsNullOrEmpty());
        }

        [Test]
        public void TestIsNullOrEmptyNotEmpty()
        {
            IEnumerable nullEnumerable = new[] { new object() };
            IEnumerable<object> nullEnumerableT = new List<object> { new object(), new object() };
            Assert.IsFalse(nullEnumerable.IsNullOrEmpty());
            Assert.IsFalse(nullEnumerableT.IsNullOrEmpty());
        }

        [Test]
        public void TestIsNullOrEmptyNull()
        {
            IEnumerable nullEnumerable = null;
            IEnumerable<object> nullEnumerableT = null;
            Assert.IsTrue(nullEnumerable.IsNullOrEmpty());
            Assert.IsTrue(nullEnumerableT.IsNullOrEmpty());
        }

        [Test]
        public void TestRandomSelectLessThanNumberOfSelections()
        {
            IEnumerable<object> enumerable = new List<object> { new object(), new object() };
            Assert.AreEqual(enumerable, enumerable.RandomSelect(enumerable.Count() + 1));

            IList<object> selectedItems = new List<object>();
            enumerable.RandomSelect(enumerable.Count() + 1, selectedItems.Add);
            Assert.IsTrue(CollectionUtils.SequenceEqual(enumerable, selectedItems));
        }

        [Test]
        public void TestRandomSelectNull()
        {
            IEnumerable<object> nullEnumerable = null;
            Assert.Throws(typeof(ArgumentNullException), () => nullEnumerable.RandomSelect());
            Assert.Throws(typeof(ArgumentNullException), () => nullEnumerable.RandomSelect(23));
            Assert.Throws(typeof(ArgumentNullException), () => nullEnumerable.RandomSelect(42, o => { }));
        }

        [Test]
        public void TestRandomSelectOne()
        {
            IEnumerable<object> enumerable = new List<object> { 0, 1, 2, 3 };
            Assert.DoesNotThrow(() => enumerable.RandomSelect());
            Assert.DoesNotThrow(() => enumerable.RandomSelect(1));
            Assert.DoesNotThrow(() => enumerable.RandomSelect(1, o => { }));
        }

        #endregion
    }
}