text:
.. highlight:: groovy

Gradle plugin
#############

Chaquopy is distributed as a plugin for Android's Gradle-based build system. It can be used in
any app which meets the following requirements:

* In your project's top-level `build.gradle` file, the Android Gradle plugin version should be
  between 4.1 and 7.2. Older versions as far back as 2.2 are supported by :doc:`older versions
  of Chaquopy <../versions>`.

  * The Android plugin may be listed as `com.android.application`, `com.android.library` or
    `com.android.tools.build:gradle`.

.. (extra space)

* `minSdkVersion <https://developer.android.com/guide/topics/manifest/uses-sdk-element>`_ must
  be at least 21. Older versions as far back as 15 are supported by :doc:`older versions of
  Chaquopy <../versions>`.

Basic setup
===========

.. _android-plugin:

Gradle plugin
-------------

In your project's `settings.gradle` or `build.gradle` file, find the repositories list in
`pluginManagement` or `buildscript`, and make sure it includes `mavenCentral()`. If your
project was generated by a recent version of Android Studio, this line should already be there.

.. note:: The following instructions use the `plugins` syntax. If your project uses the
          previous `buildscript` and `apply` syntax, follow the instructions `here
          <../10.0/android.html#android-plugin>`_, but replace the Chaquopy version number with
          the current one shown below.

In your *top-level* `build.gradle` file, set the Chaquopy version:

.. parsed-literal::
    plugins {
        id 'com.chaquo.python' version '|release|' apply false
    }

In the *module-level* `build.gradle` file (usually in the `app` directory), apply the
Chaquopy plugin *after* the Android plugin::

    plugins {
        id 'com.android.application'
        id 'com.chaquo.python'
    }

All other configuration will be done in this module-level `build.gradle`. The examples below
will show the configuration within `defaultConfig`, but it can also be done within a `product
flavor <https://developer.android.com/studio/build/build-variants#product-flavors>`_.

The Chaquopy plugin can also be used in an `Android library module
<https://developer.android.com/studio/projects/android-library>`_ (AAR). However, it can only
be used in one module in a project: either in the app module, or in exactly one library module.
If you use it in multiple modules, the build may fail, and even if it succeeds, only one
module's Python code will be included in the app

.. _android-abis:

ABI selection
-------------

The Python interpreter is a native component, so you must use the `abiFilters
<https://developer.android.com/studio/projects/gradle-external-native-builds#specify-abi>`_
setting to specify which ABIs you want the app to support. The currently available ABIs are:

* `armeabi-v7a`, supported by virtually all Android devices.
* `arm64-v8a`, supported by most recent Android devices.
* `x86`, for the Android emulator.
* `x86_64`, for the Android emulator.

During development you'll probably want to enable them all, i.e.::

    defaultConfig {
        ndk {
           abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
    }

There's no need to actually install the NDK, as all of Chaquopy's native libraries are already
pre-compiled and stripped.

Each ABI will add several MB to the size of the app, plus the size of any native
:ref:`requirements <android-requirements>`. If you find this makes your app too large, see
:ref:`the FAQ <faq-size>`.

.. _python-version:

Python version
--------------

You can set your app's Python version like this::

      defaultConfig {
          python {
              version "3.8"
          }
      }

In :doc:`this version of Chaquopy <../versions>`, the default Python version is 3.8, and
the other available versions are 3.9, 3.10 and 3.11. Note that versions other than the
default may have fewer :ref:`packages <android-requirements>` available.

.. _buildPython:

buildPython
-----------

Some features require Python 3.5 or later to be available on the build machine. These features
are indicated by a note in their documentation sections.

By default, Chaquopy will try to find Python on the PATH with the standard command for your
operating system, first with a matching minor version, and then with a matching major version.
For example, if :ref:`your app's Python version <python-version>` is 3.8, then:

* On Linux and Mac it will try `python3.8`, then `python3`.
* On Windows, it will try `py -3.8`, then `py -3`.

If this doesn't work for you, set your Python command using the `buildPython` setting.
For example, on Windows you might use one of the following::

      defaultConfig {
          python {
              buildPython "C:/path/to/python.exe"
              buildPython "C:/path/to/py.exe", "-3.8"
          }
      }

Development
===========

.. _android-source:

Source code
-----------

By default, Chaquopy will look for Python source code in the `python` subdirectory of each
`source set <https://developer.android.com/studio/build/index.html#sourcesets>`_. For example,
the Python code for the `main` source set should go in `src/main/python`.

To include Python source code from other directories, use the `android.sourceSets
<https://developer.android.com/studio/build/build-variants.html#configure-sourcesets>`_ block.
For example::

    android {
        sourceSets {
            main {
                python.srcDir "some/other/dir"
            }
        }
    }

.. note:: The `setRoot <https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/dsl/AndroidSourceSet#setroot>`_
          method only takes effect on the standard Android directories. If you want to set the
          Python directory as well, you must do so explicitly, e.g.::

              main {
                  setRoot "some/other/main"
                  python.srcDirs = ["some/other/main/python"]
              }

`As with Java
<https://developer.android.com/studio/build/build-variants.html#sourceset-build>`_, it is
usually an error if the source directories for a given build variant include multiple copies of
the same filename. This is only permitted if the duplicate files are all empty, such as may
happen with `__init__.py`.

.. _android-startup:

Startup
-------

It's important to structure the app so that `Python.start()
<java/com/chaquo/python/Python.html#start(com.chaquo.python.Python.Platform)>`_ is always
called with an `AndroidPlatform <java/com/chaquo/python/android/AndroidPlatform.html>`_ before
attempting to run Python code. There are two basic ways to achieve this:

If the app always uses Python, then call Python.start() from a location which is guaranteed
to run exactly once per process, such as `Application.onCreate()
<https://developer.android.com/reference/android/app/Application.html#onCreate()>`_. The
easiest way to do this is to use `PyApplication
<java/com/chaquo/python/android/PyApplication.html>`_, or your own subclass of it. Simply
add the following attribute to the `<application>` element in `AndroidManifest.xml`:

.. code-block:: xml

    android:name="com.chaquo.python.android.PyApplication"

Alternatively, if the app only sometimes uses Python, then call Python.start() after first
checking whether it's already been started:

.. code-block:: java

    // "context" must be an Activity, Service or Application object from your app.
    if (! Python.isStarted()) {
        Python.start(new AndroidPlatform(context));
    }

.. _android-requirements:

Requirements
------------

.. note:: This feature requires Python on the build machine, which can be configured with the
          :ref:`buildPython <buildPython>` setting.

External Python packages may be built into the app using the `pip` block in `build.gradle`.
Within this block, add `install` lines, which can take any of the forms accepted by `pip
install <https://pip.pypa.io/en/stable/cli/pip_install/>`_. For example::

    defaultConfig {
        python {
            pip {
                // A requirement specifier, with or without a version number:
                install "scipy"
                install "requests==2.24.0"

                // An sdist or wheel filename, relative to the project directory:
                install "MyPackage-1.2.3-py2.py3-none-any.whl"

                // A directory containing a setup.py, relative to the project
                // directory (must contain at least one slash):
                install "./MyPackage"

                // "-r"` followed by a requirements filename, relative to the
                // project directory:
                install "-r", "requirements.txt"
            }
        }
    }

In our most recent tests, Chaquopy could install over 90% of the top 1000 packages on `PyPI
<https://pypi.org/>`_. This includes almost all pure-Python packages, plus a constantly-growing
selection of packages with native components. To see which native packages are currently
available, you can `browse the repository here <https://chaquo.com/pypi-7.0/>`_. To
request a package to be added or updated, or for any other problem with installing
requirements, please visit our `issue tracker <https://github.com/chaquo/chaquopy/issues>`_.

To pass options to `pip install`, give them as a comma-separated list to the `options` setting.
For example::

    pip {
        options "--extra-index-url", "https://example.com/private/repository"
        install "MyPackage==1.2.3"
    }

Any options in the `pip documentation <https://pip.pypa.io/en/stable/cli/pip_install/>`_ may be
used, except for those which relate to the target environment, such as `--target`, `--user` or
`-e`. If there are multiple `options` lines, they will be combined in the order given.

.. _static-proxy-generator:

Static proxy generator
----------------------

.. note:: This feature requires Python on the build machine, which can be configured with the
          :ref:`buildPython <buildPython>` setting.

The static proxy feature allows a Python class to extend a Java class, or to be referenced
directly in Java code or the `AndroidManifest.xml` file without going through the Java API.

To use this feature, write your Python classes using the syntax described in the
":ref:`static-proxy`" section, then list their containing modules in the `build.gradle` file as
follows::

    defaultConfig {
        python {
            staticProxy "module.one", "module.two"
        }
    }

Packaging
=========

.. _android-data:

Data files
----------

Any data files in your :ref:`source code <android-source>` and :ref:`requirements
<android-requirements>` will be automatically built into your app. You can read them at runtime
using a path relative to `__file__`.

For example, if the data file is in the same directory as the Python file:

.. code-block:: python

    from os.path import dirname, join
    filename = join(dirname(__file__), "filename.txt")

You can then pass this filename to :any:`open`, or any other function which reads a file.

If the data file and the Python file are in different directories, then change the path
accordingly. For example, if the Python file is `alpha/hello.py`, and the data file is
`bravo/filename.txt`, then replace `filename.txt` above with `../bravo/filename.txt`.

Data files within a top-level package (i.e. a top-level directory containing an `__init__.py`
file) will not be available until the first time that package is imported. All other data files
will be available as soon as Python has started.

Do not write any files to these directories at runtime, as they may be deleted when the app is
upgraded. Instead, write files to `os.environ["HOME"]`, as described in the ":ref:`android-os`"
section.

.. _android-bytecode:

Bytecode compilation
--------------------

.. note:: This feature requires Python on the build machine, which can be configured with the
          :ref:`buildPython <buildPython>` setting.

Your app will start up faster if its Python code is compiled to .pyc format, so this is
enabled by default.

Compilation prevents source code text from appearing in stack traces, so during development you
may wish to disable it. There are individual settings for:

* `src`: :ref:`local source code <android-source>`
* `pip`: :ref:`requirements <android-requirements>`
* `stdlib`: the Python standard library

For example, to disable compilation of your local source code::

    defaultConfig {
        python {
            pyc {
                src false
            }
        }
    }

In the case of `src` and `pip`, your :ref:`buildPython <buildPython>` must use the same
bytecode format as Chaquopy itself. Usually this means it must have the same minor version,
e.g. if :ref:`your app's Python version <python-version>` is 3.8, then `buildPython` can be
any version of Python 3.8.

If bytecode compilation fails, the build will continue with a warning, unless you've
explicitly set one of the `pyc` settings to `true`. Your app will still work, but its code will
have to be compiled on the target device, which means it will start up slower and use more
storage space.

Python standard library
=======================

Chaquopy supports the entire Python standard library, except for the modules listed below. If you
discover a problem with any other module, please `let us know
<https://github.com/chaquo/chaquopy/issues>`_.

.. _stdlib-unsupported:

Unsupported modules
-------------------

The following modules are unsupported because they require OS features which aren't available
on Android:

* :any:`crypt`
* :any:`grp`
* :any:`nis`
* :any:`spwd`

The following modules are unsupported because they require libraries which we don't currently
include:

* :any:`curses`
* :any:`dbm.gnu`
* :any:`dbm.ndbm`
* :any:`readline`
* :any:`tkinter`
* :any:`turtle`

multiprocessing
---------------

Because Android doesn't support POSIX semaphores, most of the :any:`multiprocessing` APIs will
fail with the error "This platform lacks a functioning sem_open implementation". The simplest
solution is to edit your code to use :any:`multiprocessing.dummy` instead.

.. _android-os:

os
---

Don't pass a simple filename to functions which write a file, as this will try to write to the
current directory, which is usually read-only on Android. Instead, use a path relative to
`os.environ["HOME"]`, like this:

.. code-block:: python

    import os
    from os.path import join
    filename = join(os.environ["HOME"], "filename.txt")

You can then pass this filename to :any:`open`, or any other function which writes a file.

`os.environ["HOME"]` is set to your app's `internal storage directory
<https://developer.android.com/training/data-storage/app-specific>`_. Any files or
subdirectories created in this location will persist until the app is uninstalled.

If your app is `debuggable <https://developer.android.com/studio/debug#enable-debug>`_, you can
read and write this directory from Android Studio using the `Device File Explorer
<https://developer.android.com/studio/debug/device-file-explorer>`_. Its path will be something
like `/data/data/your.application.id/files`.

ssl
---

The :any:`ssl` module is configured to use a copy of the CA bundle from `certifi
<https://github.com/certifi/python-certifi/>`_ version 2021.10.8. The system CA store is not
used.

sys
---

:any:`sys.stdout` and :any:`sys.stderr` are redirected to the `Logcat
<https://developer.android.com/studio/debug/am-logcat.html>`__ with the tags `python.stdout` and
`python.stderr` respectively. The streams will produce one log line for each call to `write()`,
which may result in lines being split up in the log. Lines may also be split if they exceed the
Logcat message length limit of approximately 4000 bytes.

By default, :any:`sys.stdin` always returns EOF. If you want to run some code which takes
interactive text input, have a look at the `console app template
<https://github.com/chaquo/chaquopy-console>`_.

.. _android-studio-plugin:

Android Studio plugin
=====================

To add Python editing suppport to the Android Studio user interface, you may optionally install
the "Python Community Edition" plugin. However, Chaquopy isn't integrated with this plugin, so
you'll see the warning "No Python interpreter configured for the module", and your code will
probably display many error indicators such as "Unresolved reference" and "No module named".
These are harmless: just go ahead and run your app, and if there really is an error, the
details will be displayed in the `Logcat <https://stackoverflow.com/a/23353174>`__.


text:
<?php

namespace Mvs\SampleBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Mvs\SampleBundle\Entity\Product;

/**
 * ProductRepository
 *
 * This class was generated by the Doctrine ORM.
 * Add your own custom repository methods below.
 */
class ProductRepository extends EntityRepository implements ProductRepositoryInterface
{
    /**
     * @return array
     */
    public function findAllOrderedByName()
    {
        $query = $this->createQueryBuilder('p')
            ->orderBy('p.name', 'ASC')
            ->getQuery();

        return $query->getResult();
    }

    /**
     * @param int $id
     * @return Product
     */
    public function findOneById($id)
    {
        return $this->find($id);
    }

    /**
     * @param array $data
     * @return Product
     */
    public function createOne(array $data)
    {
        $product = $this->fromArray($data);

        $em = $this->getEntityManager();
        $em->persist($product);
        $em->flush();

        return $product;
    }

    /**
     * @return Product
     */
    protected function createNewEntity()
    {
        $entityClass = $this->getClassName();

        return new $entityClass();
    }

    /**
     * @param array $data
     * @return Product
     */
    protected function fromArray(array $data)
    {
        $entity = $this->createNewEntity();

        foreach ($data as $key => $value) {
            $method = 'set' . ucfirst($key);

            if (method_exists($entity, $method)) {
                $entity->$method($value);
            }
        }

        return $entity;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.hazelcast.map.impl.operation;

import com.hazelcast.config.InMemoryFormat;
import com.hazelcast.map.impl.MapDataSerializerHook;
import com.hazelcast.map.impl.query.Query;
import com.hazelcast.map.impl.query.QueryRunner;
import com.hazelcast.map.impl.query.ResultSegment;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.spi.ReadonlyOperation;

import java.io.IOException;

/**
 * Fetches by query a batch of {@code fetchSize} items from a single partition ID for a map. The query is run by the query
 * engine which means it supports projections and filtering. The {@code lastTableIndex} denotes the position from which
 * to resume the query on the partition.
 * This is an operation for maps configured with {@link InMemoryFormat#BINARY} or {{@link InMemoryFormat#OBJECT} format.
 *
 * @see com.hazelcast.map.impl.proxy.MapProxyImpl#iterator(int, int, com.hazelcast.projection.Projection,
 * com.hazelcast.query.Predicate)
 * @since 3.9
 */
public class MapFetchWithQueryOperation extends MapOperation implements ReadonlyOperation {

    private Query query;
    private int fetchSize;
    private int lastTableIndex;
    private transient ResultSegment response;

    public MapFetchWithQueryOperation() {
    }

    public MapFetchWithQueryOperation(String name, int lastTableIndex, int fetchSize, Query query) {
        super(name);
        this.lastTableIndex = lastTableIndex;
        this.fetchSize = fetchSize;
        this.query = query;
    }

    @Override
    public void run() throws Exception {
        final QueryRunner runner = mapServiceContext.getMapQueryRunner(query.getMapName());
        response = runner.runPartitionScanQueryOnPartitionChunk(query, getPartitionId(), lastTableIndex, fetchSize);
    }

    @Override
    public Object getResponse() {
        return response;
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        super.readInternal(in);
        fetchSize = in.readInt();
        lastTableIndex = in.readInt();
        query = in.readObject();
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        super.writeInternal(out);
        out.writeInt(fetchSize);
        out.writeInt(lastTableIndex);
        out.writeObject(query);
    }

    @Override
    public int getId() {
        return MapDataSerializerHook.FETCH_WITH_QUERY;
    }
}


text:
var firstname = "john";
var lastname = "smith";

console.log(firstname + " " + lastname);


text:
// $Id$

// ----------------------------------------------------------------------
//
//  SeparableInputFirstAllocator: Separable Input-First Allocator
//
// ----------------------------------------------------------------------

#ifndef _SEPARABLE_INPUT_FIRST_HPP_
#define _SEPARABLE_INPUT_FIRST_HPP_

#include <set>

#include "separable.hpp"

class SeparableInputFirstAllocator : public SeparableAllocator {

public:

  SeparableInputFirstAllocator( Module* parent, const string& name, int inputs,
				int outputs, const string& arb_type ) ;

  virtual void Allocate() ;

} ;

#endif


text:
repo: wq-django-template
date: 2015-06-16
---

# wq.start 0.8.2

- Don't assume [python-social-auth](https://psa.matiasaguirre.net/) is installed (as it's no longer a requirement for wq.db)


text:
[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.3.1...HEAD)

**Closed issues:**

- Support Storing Stripe id in Auth0 [\#77](https://github.com/auth0/wp-auth0/issues/77)

- Allow loading / saving Shipping Addresses used by WooCommerce in Auth0 Profile [\#76](https://github.com/auth0/wp-auth0/issues/76)

## [1.3.1](https://github.com/auth0/wp-auth0/tree/1.3.1) (2015-06-10)

[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.3.0...1.3.1)

**Closed issues:**

- Mixed content warning [\#75](https://github.com/auth0/wp-auth0/issues/75)

**Merged pull requests:**

- Fixed Mixed content warning \#75 & added login action for issue \#76 \#77 [\#78](https://github.com/auth0/wp-auth0/pull/78) ([glena](https://github.com/glena))

## [1.3.0](https://github.com/auth0/wp-auth0/tree/1.3.0) (2015-06-01)

[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.2.7...1.3.0)

**Implemented enhancements:**

- Support for SSO [\#64](https://github.com/auth0/wp-auth0/issues/64)

**Merged pull requests:**

- Added SSO features [\#74](https://github.com/auth0/wp-auth0/pull/74) ([glena](https://github.com/glena))

## [1.2.7](https://github.com/auth0/wp-auth0/tree/1.2.7) (2015-05-28)

[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.2.4...1.2.7)

**Closed issues:**

- Add custom js to add custom buttons [\#73](https://github.com/auth0/wp-auth0/issues/73)

- Hardwired redirect url after login [\#71](https://github.com/auth0/wp-auth0/issues/71)

- State shouldn't be required [\#66](https://github.com/auth0/wp-auth0/issues/66)

- Enable new users creation on JWT authentication [\#57](https://github.com/auth0/wp-auth0/issues/57)

**Merged pull requests:**

- fix implicit wf in subdirectories, added custom JS [\#72](https://github.com/auth0/wp-auth0/pull/72) ([glena](https://github.com/glena))

- New jwt auth integration + auto user creation with JWT [\#70](https://github.com/auth0/wp-auth0/pull/70) ([glena](https://github.com/glena))

- Fix array notation [\#69](https://github.com/auth0/wp-auth0/pull/69) ([glena](https://github.com/glena))

- Fix array notation [\#68](https://github.com/auth0/wp-auth0/pull/68) ([glena](https://github.com/glena))

## [1.2.4](https://github.com/auth0/wp-auth0/tree/1.2.4) (2015-05-21)

[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.2.3...1.2.4)

**Merged pull requests:**

- Fix error when the state param is not present [\#67](https://github.com/auth0/wp-auth0/pull/67) ([glena](https://github.com/glena))

## [1.2.3](https://github.com/auth0/wp-auth0/tree/1.2.3) (2015-05-19)

[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.2.2...1.2.3)

**Merged pull requests:**

- Fix issue with email verified requirement [\#65](https://github.com/auth0/wp-auth0/pull/65) ([glena](https://github.com/glena))

## [1.2.2](https://github.com/auth0/wp-auth0/tree/1.2.2) (2015-05-19)

[Full Changelog](https://github.com/auth0/wp-auth0/compare/1.2.1...1.2.2)

**Implemented enhancements:**

- Auto Login \(no widget\) Does not work with WooCommerce My Account Login [\#45](https://github.com/auth0/wp-auth0/issues/45)

**Merged pull requests:**

- Added support for WooCommerce + updated info headers [\#63](https://github.com/auth0/wp-auth0/pull/63) ([glena](https://github.com/glena))

## [1.2.1](https://github.com/auth0/wp-auth0/tree/1.2.1) (2015-05-14)

**Implemented enhancements:**

- Auth0 users with different accounts but same username will not be able to log into the site [\#52](https://github.com/auth0/wp-auth0/issues/52)

- Error: Could not create user. The registration process is not available. [\#48](https://github.com/auth0/wp-auth0/issues/48)

- Enhancement: Allow WordPress plugin to work in enterprise environment without internet access [\#42](https://github.com/auth0/wp-auth0/issues/42)

- Support redirecting to arbitrary URLs after login is succesful [\#29](https://github.com/auth0/wp-auth0/issues/29)

- Add link to create Auth0 Account [\#28](https://github.com/auth0/wp-auth0/issues/28)

- Validate settings before saving [\#24](https://github.com/auth0/wp-auth0/issues/24)

- Show WP Auth0 Logs somewhere so that we can easily diagnose problems [\#22](https://github.com/auth0/wp-auth0/issues/22)

- Add option to enter custom CSS [\#21](https://github.com/auth0/wp-auth0/issues/21)

- Make Widget options accessable by the Plugin [\#15](https://github.com/auth0/wp-auth0/issues/15)

- Make the widget showable as Shortcode and Widget [\#14](https://github.com/auth0/wp-auth0/issues/14)

**Fixed bugs:**

- No widget shown in latest release [\#20](https://github.com/auth0/wp-auth0/issues/20)

**Closed issues:**

- SDK Client headers spec compliant [\#61](https://github.com/auth0/wp-auth0/issues/61)

- Make usernames unique if it is already in use [\#58](https://github.com/auth0/wp-auth0/issues/58)

- Check text on "allow signup" option in plugin settings [\#54](https://github.com/auth0/wp-auth0/issues/54)

- Why is Client Secret Needed [\#53](https://github.com/auth0/wp-auth0/issues/53)

- Client Secret Field in Settings should not be remembered by browser [\#44](https://github.com/auth0/wp-auth0/issues/44)

- Demo is down [\#43](https://github.com/auth0/wp-auth0/issues/43)

- wp-login?wle does not work when "Auto Login \(no widget\)" is enabled [\#38](https://github.com/auth0/wp-auth0/issues/38)

- Add fallback URL to log in with WP credentials even after disabling WP login [\#35](https://github.com/auth0/wp-auth0/issues/35)

- Wordpress login no longer works when the "Auto Login \(no widget\)" option is set. [\#34](https://github.com/auth0/wp-auth0/issues/34)

- Shortcode attributes are being ignored [\#33](https://github.com/auth0/wp-auth0/issues/33)

- Update to Lock [\#19](https://github.com/auth0/wp-auth0/issues/19)

- errors not being shown when something fails [\#18](https://github.com/auth0/wp-auth0/issues/18)

- add nice error message when exchange of token returns 401 [\#11](https://github.com/auth0/wp-auth0/issues/11)

- Don't show widget when registrations are not allowed. [\#5](https://github.com/auth0/wp-auth0/issues/5)

- Auto-create users option [\#4](https://github.com/auth0/wp-auth0/issues/4)

- plugin packaging and publish [\#3](https://github.com/auth0/wp-auth0/issues/3)

- after session times out the login widget is shown inside the iframe and after login the site is embedded in the iframe [\#2](https://github.com/auth0/wp-auth0/issues/2)

- lost your password [\#1](https://github.com/auth0/wp-auth0/issues/1)

**Merged pull requests:**

- Updated info headers [\#62](https://github.com/auth0/wp-auth0/pull/62) ([glena](https://github.com/glena))

- Auth WP V1.2 [\#55](https://github.com/auth0/wp-auth0/pull/55) ([glena](https://github.com/glena))

- Security vulnerability fix on login [\#51](https://github.com/auth0/wp-auth0/pull/51) ([glena](https://github.com/glena))

- Add fallback URL to log in with WP credentials even after disabling WP login \#35 [\#36](https://github.com/auth0/wp-auth0/pull/36) ([glena](https://github.com/glena))

- Issues \#24, \#28 & \#29 [\#30](https://github.com/auth0/wp-auth0/pull/30) ([glena](https://github.com/glena))

-  Add option to enter custom CSS \#21 [\#27](https://github.com/auth0/wp-auth0/pull/27) ([glena](https://github.com/glena))

- Issues ready to merge [\#26](https://github.com/auth0/wp-auth0/pull/26) ([glena](https://github.com/glena))

- New popup widget & some small changes [\#23](https://github.com/auth0/wp-auth0/pull/23) ([glena](https://github.com/glena))

- A0 widget [\#16](https://github.com/auth0/wp-auth0/pull/16) ([glena](https://github.com/glena))

- New feature: Add a new config to allow people to access with the standar... [\#13](https://github.com/auth0/wp-auth0/pull/13) ([glena](https://github.com/glena))

- Fix wp submision problems [\#10](https://github.com/auth0/wp-auth0/pull/10) ([hrajchert](https://github.com/hrajchert))

- Added screenshots [\#9](https://github.com/auth0/wp-auth0/pull/9) ([hrajchert](https://github.com/hrajchert))

- Many improvements [\#8](https://github.com/auth0/wp-auth0/pull/8) ([hrajchert](https://github.com/hrajchert))

- Must check if user exists. [\#56](https://github.com/auth0/wp-auth0/pull/56) ([singularityjay](https://github.com/singularityjay))

- Fixed logging into an existing user when existing username exists \(on user creation\) [\#47](https://github.com/auth0/wp-auth0/pull/47) ([singularityjay](https://github.com/singularityjay))

- Fix sql session [\#41](https://github.com/auth0/wp-auth0/pull/41) ([glena](https://github.com/glena))

- Add title to back link [\#40](https://github.com/auth0/wp-auth0/pull/40) ([felixinx](https://github.com/felixinx))

- Fixes shortcodes \(\#33\) and Wordpress login \(\#34\) [\#32](https://github.com/auth0/wp-auth0/pull/32) ([sandrinodimattia](https://github.com/sandrinodimattia))

- Many improvements [\#7](https://github.com/auth0/wp-auth0/pull/7) ([hrajchert](https://github.com/hrajchert))

- Improvements in the plugin [\#6](https://github.com/auth0/wp-auth0/pull/6) ([hrajchert](https://github.com/hrajchert))

\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>FileUploader with simple list</title>
        <link rel="stylesheet" type="text/css" href="./css/tui-example-style.css" />
        <link rel="stylesheet" type="text/css" href="../dist/tui-file-uploader.css" />

            This example just show a list style.

            So, don't include submit button despite of using batch transfer.

        			Add files
        			<input type="file" name="userfile[]" class="tui-input-file">


text:
package com.github.gavinmeyers.ebookmanager;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = EbookmanagerApplication.class)
@WebAppConfiguration
public class EbookmanagerApplicationTests {

	@Test
	public void contextLoads() {
	}

}


text:
<?php

	/**
	*
	*/
	class KonJalan extends CActiveRecord
	{
		public static function model($className=__CLASS__)
			{
				return parent::model($className);
			}

			public function tableName()
			{
				return 'infra_kondisijln';
			}
	}

?>


text:
package com.brg.dao;

import com.brg.ServiceProvider;
import com.brg.domain.BusinessRule;

import java.lang.reflect.Constructor;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

public class BusinessRuleDAO implements DAO{

    @Override
    public ArrayList<BusinessRule> executeRead(String sql) {
        ArrayList<BusinessRule> rules = new ArrayList<BusinessRule>();

        // Get all rules, query
        try {
            Statement stmt = ServiceProvider.getInstance().getDaoService().getRepositoryConnection().getConnection().createStatement();
            ResultSet set = stmt.executeQuery(sql);

            while (set.next()) {
                // Make business rule
                BusinessRule rule = null;

                // Make rule based on code
                try {
                    String className = "com.brg.domain.rules." + set.getString("ClassName");
                    Class<?> classPosibility = Class.forName(className);
                    Constructor<?> constructor = classPosibility.getConstructor();
                    rule = (BusinessRule)constructor.newInstance(new Object[] {});
                }catch(Exception e) {
                    e.printStackTrace();
                }

                if (rule != null) {
                    // Set values
                    rule.setDescription(set.getString("Description"));
                    rule.setName(set.getString("RULENAME"));
                    rule.setCode(set.getString("CODE"));
                    rule.setOperand(ServiceProvider.getInstance().getPersistenceService().getRuleOperandById(set.getInt("RULEOPERANDID")));
                    rule.setError(set.getString("ERRORMESSAGE"));

                    // Get all bundle contents
                    rule.setValues(ServiceProvider.getInstance().getPersistenceService().getRuleValueBundleById(set.getInt("BUSINESSRULEID")));

                    // Add to array
                    rules.add(rule);
                }
            }

            set.close();
            stmt.close();
        }catch (Exception e) {
            e.printStackTrace();
        }

        return rules;
    }

    /**
     * Get all rules
     * @return All rules that are active
     */
    public ArrayList<BusinessRule> getAllRules() {
        return this.executeRead("SELECT * FROM BUSINESSRULE WHERE BUSINESSRULE.ACTIVE = 1");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>

<content xml:space="preserve">

    <item id="rootTopicTitle">{@RootNamespaceTitle}</item>
    <item id="rootTopicTitleLocalized">Пространства имен</item>
    <item id="productTitle">{@HtmlEncHelpTitle}</item>
    <item id="runningHeaderText">{@HtmlEncHelpTitle}</item>

    <item id="copyCode">Копировать</item>

    <item id="locale">{@Locale}</item>

    <item id="preliminary">
[Это предварительная версия документации. API может измениться в будущем.]
</item>

    <item id="comments">
Отправить комментарий к этому топику на
        {@HtmlEncFeedbackEMailAddress}
        </item>

    <item id="copyright">{@HtmlEncCopyrightInfo}</item>

    <item id="shfbAutoDocConstructor">Инициализирует новый экземпляр класса <see cref="T:{0}"/></item>
    <item id="shfbAutoDocStaticConstructor">Инициализирует статические члены класса <see cref="T:{0}"/></item>
    <item id="shfbAutoDocDispose">Освобождает все ресурсы, используемые <see cref="T:{0}"/></item>
    <item id="shfbAutoDocDisposeBool">Освобождает все неуправляемые ресурсы, используемые <see cref="T:{0}"/>, и, опционально, освобождает управляемые ресурсы</item>
    <item id="shfbAutoDocDisposeParam">True для освобождения как неуправляемых, так и управляемых ресурсов; false для освобождения только неуправляемых ресурсов.</item>
    <item id="shfbMissingTag"><p style="color: #dc143c; font-size: 8.5pt; font-weight: bold;">[&lt;{0}&gt; отсутствует в документации для "{1}"]</p></item>
    <item id="shfbMissingParamTag"><p style="color: #dc143c; font-size: 8.5pt; font-weight: bold;">[&lt;{0} name="{1}"/&gt; отсутствует в документации для "{2}"]</p></item>
    <item id="shfbMissingIncludeTarget"><p style="color: #dc143c; font-size: 8.5pt; font-weight: bold;">[&lt;include&gt; отсутствует в '{0}'.  Файл: '{1}' Путь: '{2}']</p></item>
</content>


text:
using Xunit;

namespace Structurizr.Core.Tests
{

    public class PersonTests
    {

        private Workspace workspace;
        private Model model;
        private Person person;

        public PersonTests()
        {
            workspace = new Workspace("Name", "Description");
            model = workspace.Model;
            person = model.AddPerson("Name", "Description");
        }

        [Fact]
        public void Test_CanonicalName()
        {
            Assert.Equal("Person://Name", person.CanonicalName);
        }

        [Fact]
        public void Test_CanonicalName_WhenNameContainsASlashCharacter()
        {
            person.Name = "Name1/Name2";
            Assert.Equal("Person://Name1Name2", person.CanonicalName);
        }

        [Fact]
        public void Test_Parent_ReturnsNull()
        {
            Assert.Null(person.Parent);
        }

        [Fact]
        public void Test_RemoveTags_DoesNotRemoveRequiredTags()
        {
            Assert.True(person.Tags.Contains(Tags.Element));
            Assert.True(person.Tags.Contains(Tags.Person));

            person.RemoveTag(Tags.Person);
            person.RemoveTag(Tags.Element);

            Assert.True(person.Tags.Contains(Tags.Element));
            Assert.True(person.Tags.Contains(Tags.Person));
        }

    }
}


text:
define(function (require, exports) {
    "use strict";

    var colorObject = require("./color").colorObject,
        unitsIn = require("./unit");

    /**
     * Creates a fill contents object
     *
     * @param {string} type The type of shape fill content. "solidColorLayer" or "patternLayer"
     * @param {array} value
     *      The array of RGB color [red,green,blue] for "solidColorLayer". 0 to 255
     *      The array of Pattern ID and name for "patternLayer".
     *
     * @return {ActionDescriptor} Fill content object
     */
    var fillContentsObject = function (type, value) {
        if (type === "solidColorLayer") {
            return {
                "_obj": "solidColorLayer",
                "_value": {
                    "color": colorObject(value)
                }
            };
        } else if (type === "patternLayer") {
            return {
                "_obj": "patternLayer",
                "_value": {
                    "pattern": {
                        "_obj": "pattern",
                        "_value": {
                            "ID": value[0],
                            "name": value[1]
                        }
                    }
                }
            };
        }
        // TODO: Add a warning in this case
    };

    /**
     * Creates the action descriptor for enabling/disabling fill
     *
     * @param {boolean} enabled Whether the shape fill is enabled.
     *
     * @return {ActionDescriptor} Style that toggles fill
     */
    var shapeFillObject = function (enabled) {
        return {
            "_obj": "strokeStyle",
            "_value": {
                "fillEnabled": enabled,
                "strokeStyleVersion": 2
            }
        };
    };

    /**
     * Creates the action descriptor for enabling/disabling stroke
     *
     * @param {boolean} enabled Whether the shape stroke is enabled.
     *
     * @return {ActionDescriptor} Style that toggles stroke
     */
    var shapeStrokeObject = function (enabled) {
        return {
            "_obj": "strokeStyle",
            "_value": {
                "strokeEnabled": enabled,
                "strokeStyleVersion": 2
            }
        };
    };

    /**
     * Creates a shape object as an Action Descriptor
     *
     * @param {string} shape The kind of shape.
     * @param {Array<number>} values The array of shape values.
     *                  Rectangle or Rounded Rectangle: top,bottom,left,right,topleft,topright,bottomleft,bottomright
     *                  Ellipse: top,bottom,left,right
     *                  top,bottom,left,right: The location of shape
     *                  topleft,topright,bottomleft,bottomright: The shape corner radius values
     *
     * @return {ActionDescriptor} The defined shape
     * Examples:
     * getShapeObject("rectangle",[300,500,250,600,-1,-1,-1,-1]); //rectangle
     * getShapeObject("rectangle",[300,500,250,600,10,10,10,10]); //rounded rectanglg
     * getShapeObject("ellipse",[700,200,500,550]); //ellipse
     */
    var shapeObject = function (shape, values) {
        var shapeVal;

        if (shape === "rectangle") {
            shapeVal = {
                "top": unitsIn.pixels(values[0]),
                "bottom": unitsIn.pixels(values[1]),
                "left": unitsIn.pixels(values[2]),
                "right": unitsIn.pixels(values[3]),
                "topLeft": unitsIn.pixels(values[4]),
                "topRight": unitsIn.pixels(values[5]),
                "bottomLeft": unitsIn.pixels(values[6]),
                "bottomRight": unitsIn.pixels(values[7]),
                "unitValueQuadVersion": 1
            };
        } else if (shape === "ellipse") {
            shapeVal = {
                "top": unitsIn.pixels(values[0]),
                "bottom": unitsIn.pixels(values[1]),
                "left": unitsIn.pixels(values[2]),
                "right": unitsIn.pixels(values[3]),
                "unitValueQuadVersion": 1
            };
        }

        return {
            _obj: shape,
            "_value": shapeVal
        };
    };

    exports.shapeObject = shapeObject;
    exports.fillContentsObject = fillContentsObject;
    exports.shapeFillObject = shapeFillObject;
    exports.shapeStrokeObject = shapeStrokeObject;
});


text:
package org.arakhne.afc.math.test.geometry.d3.i;

import org.junit.jupiter.api.Disabled;

import org.arakhne.afc.math.geometry.d3.Vector3D;
import org.arakhne.afc.math.geometry.d3.i.Point3i;
import org.arakhne.afc.math.geometry.d3.i.Vector3i;
import org.arakhne.afc.math.test.geometry.AbstractUnmodifiableVector3DTest;

@SuppressWarnings("all")
@Disabled("temporary")
public class UnmodifiableVector3iTest extends AbstractUnmodifiableVector3DTest<Vector3i, Point3i> {

	@Override
	public boolean isIntCoordinates() {
		return true;
	}

	@Override
	public Vector3D createTuple(double x, double y, double z) {
		return new Vector3i(x, y, z).toUnmodifiable();
	}

	@Override
	public Vector3i createVector(double x, double y, double z) {
		return new Vector3i(x, y, z);
	}

	@Override
	public Point3i createPoint(double x, double y, double z) {
		return new Point3i(x, y, z);
	}

}


text:
package org.elasticsearch.compat;

import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.Version;
import org.elasticsearch.common.xcontent.ParsedMediaType;

import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.hamcrest.ElasticsearchMatchers;
import org.hamcrest.Matcher;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;

public class CompatibleVersionPluginTests extends ESTestCase {
    CompatibleVersionPlugin compatibleVersionPlugin = new CompatibleVersionPlugin();
    int CURRENT_VERSION = Version.CURRENT.major;
    int PREVIOUS_VERSION = Version.CURRENT.major - 1;
    int OBSOLETE_VERSION = Version.CURRENT.major - 2;

    public void testAcceptAndContentTypeCombinations() {
        assertThat(requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(PREVIOUS_VERSION), bodyPresent()), isCompatible());

        assertThat(requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(PREVIOUS_VERSION), bodyNotPresent()), isCompatible());

        ElasticsearchStatusException e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(CURRENT_VERSION), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "A compatible version is required on both Content-Type and Accept headers "
                    + "if either one has requested a compatible version and the compatible versions must match. "
                    + "Accept="
                    + acceptHeader(PREVIOUS_VERSION)
                    + ", Content-Type="
                    + contentTypeHeader(CURRENT_VERSION)
            )
        );

        // no body - content-type is ignored
        assertThat(requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(CURRENT_VERSION), bodyNotPresent()), isCompatible());
        // no body - content-type is ignored
        assertThat(requestWith(acceptHeader(CURRENT_VERSION), contentTypeHeader(PREVIOUS_VERSION), bodyNotPresent()), not(isCompatible()));

        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(CURRENT_VERSION), contentTypeHeader(PREVIOUS_VERSION), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "A compatible version is required on both Content-Type and Accept headers "
                    + "if either one has requested a compatible version and the compatible versions must match. "
                    + "Accept="
                    + acceptHeader(CURRENT_VERSION)
                    + ", Content-Type="
                    + contentTypeHeader(PREVIOUS_VERSION)
            )
        );

        assertThat(requestWith(acceptHeader(CURRENT_VERSION), contentTypeHeader(CURRENT_VERSION), bodyPresent()), not(isCompatible()));

        assertThat(requestWith(acceptHeader(CURRENT_VERSION), contentTypeHeader(CURRENT_VERSION), bodyNotPresent()), not(isCompatible()));

        // tests when body present and one of the headers missing - versioning is required on both when body is present
        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(null), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "A compatible version is required on both Content-Type and Accept headers "
                    + "if either one has requested a compatible version and the compatible versions must match. "
                    + "Accept="
                    + acceptHeader(PREVIOUS_VERSION)
                    + ", Content-Type="
                    + contentTypeHeader(null)
            )
        );

        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(CURRENT_VERSION), contentTypeHeader(null), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "A compatible version is required on both Content-Type and Accept headers "
                    + "if either one has requested a compatible version. "
                    + "Accept="
                    + acceptHeader(CURRENT_VERSION)
                    + ", Content-Type="
                    + contentTypeHeader(null)
            )
        );

        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(null), contentTypeHeader(CURRENT_VERSION), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "A compatible version is required on both Content-Type and Accept headers "
                    + "if either one has requested a compatible version. "
                    + "Accept="
                    + acceptHeader(null)
                    + ", Content-Type="
                    + contentTypeHeader(CURRENT_VERSION)
            )
        );

        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(null), contentTypeHeader(PREVIOUS_VERSION), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "A compatible version is required on both Content-Type and Accept headers "
                    + "if either one has requested a compatible version and the compatible versions must match. "
                    + "Accept="
                    + acceptHeader(null)
                    + ", Content-Type="
                    + contentTypeHeader(PREVIOUS_VERSION)
            )
        );

        // tests when body NOT present and one of the headers missing
        assertThat(requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(null), bodyNotPresent()), isCompatible());

        assertThat(requestWith(acceptHeader(CURRENT_VERSION), contentTypeHeader(null), bodyNotPresent()), not(isCompatible()));

        // body not present - accept header is missing - it will default to Current version. Version on content type is ignored
        assertThat(requestWith(acceptHeader(null), contentTypeHeader(PREVIOUS_VERSION), bodyNotPresent()), not(isCompatible()));

        assertThat(requestWith(acceptHeader(null), contentTypeHeader(CURRENT_VERSION), bodyNotPresent()), not(isCompatible()));

        assertThat(requestWith(acceptHeader(null), contentTypeHeader(null), bodyNotPresent()), not(isCompatible()));

        // Accept header = application/json means current version. If body is provided then accept and content-Type should be the same
        assertThat(requestWith(acceptHeader("application/json"), contentTypeHeader(null), bodyNotPresent()), not(isCompatible()));

        assertThat(
            requestWith(acceptHeader("application/json"), contentTypeHeader("application/json"), bodyPresent()),
            not(isCompatible())
        );

        assertThat(requestWith(acceptHeader(null), contentTypeHeader("application/json"), bodyPresent()), not(isCompatible()));
    }

    public void testObsoleteVersion() {
        ElasticsearchStatusException e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(OBSOLETE_VERSION), contentTypeHeader(OBSOLETE_VERSION), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "Accept version must be either version "
                    + CURRENT_VERSION
                    + " or "
                    + PREVIOUS_VERSION
                    + ", but found "
                    + OBSOLETE_VERSION
                    + ". "
                    + "Accept="
                    + acceptHeader(OBSOLETE_VERSION)
            )
        );

        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(OBSOLETE_VERSION), contentTypeHeader(null), bodyNotPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "Accept version must be either version "
                    + CURRENT_VERSION
                    + " or "
                    + PREVIOUS_VERSION
                    + ", but found "
                    + OBSOLETE_VERSION
                    + ". "
                    + "Accept="
                    + acceptHeader(OBSOLETE_VERSION)
            )
        );

        e = expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(acceptHeader(PREVIOUS_VERSION), contentTypeHeader(OBSOLETE_VERSION), bodyPresent())
        );
        assertThat(
            e.getMessage(),
            equalTo(
                "Content-Type version must be either version "
                    + CURRENT_VERSION
                    + " or "
                    + PREVIOUS_VERSION
                    + ", but found "
                    + OBSOLETE_VERSION
                    + ". "
                    + "Content-Type="
                    + contentTypeHeader(OBSOLETE_VERSION)
            )
        );
    }

    public void testMediaTypeCombinations() {
        // body not present - ignore content-type
        assertThat(requestWith(acceptHeader(null), contentTypeHeader(PREVIOUS_VERSION), bodyNotPresent()), not(isCompatible()));

        assertThat(requestWith(acceptHeader(null), contentTypeHeader("application/json"), bodyNotPresent()), not(isCompatible()));

        assertThat(requestWith(acceptHeader("*/*"), contentTypeHeader("application/json"), bodyNotPresent()), not(isCompatible()));

        // this is for instance used by SQL
        assertThat(
            requestWith(acceptHeader("application/json"), contentTypeHeader("application/cbor"), bodyPresent()),
            not(isCompatible())
        );

        assertThat(
            requestWith(
                acceptHeader("application/vnd.elasticsearch+json;compatible-with=7"),
                contentTypeHeader("application/vnd.elasticsearch+cbor;compatible-with=7"),
                bodyPresent()
            ),
            isCompatible()
        );

        // different versions on different media types
        expectThrows(
            ElasticsearchStatusException.class,
            () -> requestWith(
                acceptHeader("application/vnd.elasticsearch+json;compatible-with=7"),
                contentTypeHeader("application/vnd.elasticsearch+cbor;compatible-with=8"),
                bodyPresent()
            )
        );
    }

    public void testTextMediaTypes() {
        assertThat(
            requestWith(acceptHeader("text/tab-separated-values"), contentTypeHeader("application/json"), bodyNotPresent()),
            not(isCompatible())
        );

        assertThat(requestWith(acceptHeader("text/plain"), contentTypeHeader("application/json"), bodyNotPresent()), not(isCompatible()));

        assertThat(requestWith(acceptHeader("text/csv"), contentTypeHeader("application/json"), bodyNotPresent()), not(isCompatible()));

        // versioned
        assertThat(
            requestWith(
                acceptHeader("text/vnd.elasticsearch+tab-separated-values;compatible-with=7"),
                contentTypeHeader(7),
                bodyNotPresent()
            ),
            isCompatible()
        );

        assertThat(
            requestWith(acceptHeader("text/vnd.elasticsearch+plain;compatible-with=7"), contentTypeHeader(7), bodyNotPresent()),
            isCompatible()
        );

        assertThat(
            requestWith(acceptHeader("text/vnd.elasticsearch+csv;compatible-with=7"), contentTypeHeader(7), bodyNotPresent()),
            isCompatible()
        );
    }

    public void testVersionParsing() {
        byte version = randomNonNegativeByte();
        assertThat(
            CompatibleVersionPlugin.parseVersion(
                ParsedMediaType.parseMediaType("application/vnd.elasticsearch+json;compatible-with=" + version)
            ),
            equalTo(version)
        );
        assertThat(
            CompatibleVersionPlugin.parseVersion(
                ParsedMediaType.parseMediaType("application/vnd.elasticsearch+cbor;compatible-with=" + version)
            ),
            equalTo(version)
        );
        assertThat(
            CompatibleVersionPlugin.parseVersion(
                ParsedMediaType.parseMediaType("application/vnd.elasticsearch+smile;compatible-with=" + version)
            ),
            equalTo(version)
        );
        assertThat(
            CompatibleVersionPlugin.parseVersion(
                ParsedMediaType.parseMediaType("application/vnd.elasticsearch+x-ndjson;compatible-with=" + version)
            ),
            equalTo(version)
        );
        assertThat(CompatibleVersionPlugin.parseVersion(ParsedMediaType.parseMediaType("application/json")), nullValue());

        assertThat(
            CompatibleVersionPlugin.parseVersion(
                ParsedMediaType.parseMediaType("APPLICATION/VND.ELASTICSEARCH+JSON;COMPATIBLE-WITH=" + version)
            ),
            equalTo(version)
        );
        assertThat(CompatibleVersionPlugin.parseVersion(ParsedMediaType.parseMediaType("APPLICATION/JSON")), nullValue());

        assertThat(CompatibleVersionPlugin.parseVersion(ParsedMediaType.parseMediaType("application/json; sth=123")), is(nullValue()));

    }

    private Matcher<Version> isCompatible() {
        return requestHasVersion(PREVIOUS_VERSION);
    }

    private Matcher<Version> requestHasVersion(int version) {
        return ElasticsearchMatchers.HasPropertyLambdaMatcher.hasProperty(v -> (int) v.major, equalTo(version));
    }

    private String bodyNotPresent() {
        return "";
    }

    private String bodyPresent() {
        return "some body";
    }

    private String contentTypeHeader(int version) {
        return mediaType(String.valueOf(version));
    }

    private String acceptHeader(int version) {
        return mediaType(String.valueOf(version));
    }

    private String acceptHeader(String value) {
        return value;
    }

    private String contentTypeHeader(String value) {
        return value;
    }

    private String mediaType(String version) {
        if (version != null) {
            return "application/vnd.elasticsearch+json;compatible-with=" + version;
        }
        return null;
    }

    private Version requestWith(String accept, String contentType, String body) {
        ParsedMediaType parsedAccept = ParsedMediaType.parseMediaType(accept);
        ParsedMediaType parsedContentType = ParsedMediaType.parseMediaType(contentType);
        return compatibleVersionPlugin.getCompatibleVersion(parsedAccept, parsedContentType, body.isEmpty() == false);
    }

}


text:
package com.slitzerman;

/**
 * Created by Rectormentis on 7.1.2017.
 */
public class Furniture {

    private String name;
    private String type;
    private String location = "";

    public Furniture(String name, String type) {
        this.name = name;
        this.type = type;
    }

    public void stealFurniture(){
        this.location = "not in the house";
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }
}


text:
package org.apache.lucene.analysis.uima;

import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.util.TokenizerFactory;

import java.io.Reader;
import java.util.HashMap;
import java.util.Map;

/**
 * {@link org.apache.lucene.analysis.util.TokenizerFactory} for {@link UIMATypeAwareAnnotationsTokenizer}
 */
public class UIMATypeAwareAnnotationsTokenizerFactory extends TokenizerFactory {

  private String descriptorPath;
  private String tokenType;
  private String featurePath;
  private Map<String, Object> configurationParameters;

  @Override
  public void init(Map<String, String> args) {
    super.init(args);
    configurationParameters = new HashMap<String, Object>();
    for (String k : args.keySet()) {
      if (k.equals("featurePath")) {
        featurePath = args.get("featurePath");
      } else if (k.equals("tokenType")) {
        tokenType = args.get("tokenType");
      } else if (k.equals("descriptorPath")) {
        descriptorPath = args.get("descriptorPath");
      } else {
        configurationParameters.put(k, args.get(k));
      }
    }
    if (descriptorPath == null || tokenType == null || featurePath == null) {
      throw new IllegalArgumentException("descriptorPath, tokenType, and featurePath are mandatory");
    }
  }

  @Override
  public Tokenizer create(Reader input) {
    return new UIMATypeAwareAnnotationsTokenizer(descriptorPath, tokenType, featurePath, configurationParameters, input);
  }
}


text:
<?php

namespace Mackstar\Spout\App;

use BEAR\Package\Provide\Application\AbstractApp;

final class App extends AbstractApp
{
}


text:
@charset "UTF-8";
/**
* SCSS SASa Block-Grid Jekyll Theme.
* --------------------------------------------------
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
/* Social Font-icons by Fontello*/
@font-face {
  font-family: 'fontello';
  src: url("../fonts/fontello.eot?27027209");
  src: url("../fonts/fontello.eot?27027209#iefix") format("embedded-opentype"), url("../fonts/fontello.woff?27027209") format("woff"), url("../fonts/fontello.ttf?27027209") format("truetype"), url("../fonts/fontello.svg?27027209#fontello") format("svg");
  font-weight: normal;
  font-style: normal; }

/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
	@font-face {
		font-family: 'fontello';
		src: url('../fonts/fontello.svg?27027209#fontello') format('svg');
	}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
  font-family: "fontello";
  font-style: normal;
  font-weight: normal;
  speak: none;
  display: inline-block;
  text-decoration: inherit;
  width: 1em;
  margin-right: .2em;
  text-align: center;
  /* opacity: .8; */
  /* For safety - reset parent styles, that can break glyph codes*/
  font-variant: normal;
  text-transform: none;
  /* fix buttons height, for twitter bootstrap */
  line-height: 1em;
  /* Animation center compensation - margins should be symmetric */
  /* remove if not needed */
  margin-left: .2em;
  /* you can be more comfortable with increased icons size */
  /* font-size: 120%; */
  /* Uncomment for 3D effect */
  /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ }

.icon-github:before {
  content: '\e800'; }

/* '' */
.icon-twitter:before {
  content: '\e801'; }

/* '' */
.icon-facebook:before {
  content: '\e802'; }

/* '' */
.icon-gplus:before {
  content: '\e805'; }

/* '' */
.icon-pinterest:before {
  content: '\e806'; }

/* '' */
.icon-tumblr:before {
  content: '\e80a'; }

/* '' */
.icon-linkedin:before {
  content: '\e80b'; }

/* '' */
.icon-dribbble:before {
  content: '\e80c'; }

/* '' */
/* Font-face */
@font-face {
  font-family: "OpenSans-Light";
  font-style: normal;
  font-weight: 200;
  src: url("../fonts/OpenSans-Light-webfont.eot") format("eot"), url("../fonts/OpenSans-Light-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Light-webfont.woff") format("woff"), url("../fonts/OpenSans-Light-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Light-webfont.svg#OpenSans-Light-webfont") format("svg"); }

@font-face {
  font-family: "OpenSans-Bold";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/OpenSans-Bold-webfont.eot") format("eot"), url("../fonts/OpenSans-Bold-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Bold-webfont.woff") format("woff"), url("../fonts/OpenSans-Bold-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Bold-webfont.svg#OpenSans-Bold-webfont") format("svg"); }

/* Reset some elements from SASa Block Grid!*/
blockquote p {
  margin: 0;
  padding-top: 0;
  padding-bottom: 0; }

/* ------------------------------------------*/
/* General Style For Header and Footer */
header img {
  opacity: .5; }
  header img:hover {
    opacity: 1; }

footer {
  font-size: .875em;
  margin: 10px auto 0;
  background-color: #F0F0F0;
  padding: 10px 0; }

/* ------------------------------------------*/
.nav-top {
  margin: 10px auto;
  text-align: center;
  text-transform: uppercase; }
  .nav-top a {
    margin: 10px auto;
    text-align: center;
    padding: 5px 20px;
    color: #666;
    line-height: 2em; }
    .nav-top a:hover {
      color: #fff;
      padding: 5px 20px;
      background-color: #000; }

.menu-list {
  display: inline;
  list-style-type: none; }
  .menu-list li {
    display: inline;
    margin-right: 10px; }

.blog-title {
  margin: 20px auto;
  text-align: center;
  border-bottom: thin dotted #ccc;
  padding-bottom: 10px; }
  .blog-title p {
    font-size: 1.3em;
    color: #808080; }
  .blog-title h1 {
    font-family: "OpenSans-Light", Helvetica, Arial, sans-serif;
    font-weight: 200;
    margin-bottom: 0.1em; }

.post-home {
  min-height: 230px; }
  .post-home h1 {
    font-size: 2em;
    color: #CCC; }

.post-list {
  list-style-type: none;
  margin: 0;
  padding: 0; }
  .post-list li {
    margin-bottom: 10px; }
  .post-list .datetime {
    float: right; }

.post {
  margin: 20px auto; }

pre {
  overflow-x: auto;
  width: 100%;
  line-height: 1.2em;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box; }

code {
  font-size: 13px;
  padding: 2px 5px;
  background-color: #E9E9E9;
  border-radius: 2px;
  line-height: 1.3em;
  display: inline-block;
  vertical-align: baseline;
  zoom: 1;
  *display: inline;
  *vertical-align: auto; }

.paging {
  float: right; }
  .paging a {
    color: #000;
    opacity: 0.25; }
    .paging a:hover {
      opacity: 0.7;
      background: none; }
  .paging .left, .paging .right {
    font-size: 5em; }
  .paging .left {
    margin-left: -30px;
    float: left; }
  .paging .right {
    margin-left: 30px; }

.social-links {
  text-align: right; }


text:
<?php

class Google_Service_Dialogflow_DialogflowEmpty extends Google_Model
{
}


text:
import * as React from 'react';
import {IExecutionStageSummary} from 'core/domain/IExecutionStage';

export interface IExecutionMarkerIconProps {
  stage: IExecutionStageSummary;
}

export class ExecutionMarkerIcon extends React.Component<IExecutionMarkerIconProps, any> {
  public render() {
    return this.props.stage.inSuspendedExecutionWindow ? (<span className="fa fa-clock-o"/>) : null;
  }
}


text:
package com.github.egmerittech.model;

import java.util.Collections;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;

/**
 * @author Greg Baker
 */
@Entity
@SuppressWarnings("serial")
public class Role extends AbstractEntity {

	@Column(unique = true, nullable = false)
	protected String role;

	@ManyToMany(mappedBy = "roles", fetch = FetchType.LAZY)
	protected Set<User> users = Collections.emptySet();

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Set<User> getUsers() {
		return users;
	}

	public void setUser(Set<User> users) {
		this.users = users;
	}

}


text:
<?php

namespace ICANS\Component\IcansLoggingComponent\Transport;

/**
 * Unit tests for ICANS\Component\IcansLoggingComponent\Transport\Message.
 */
class MessageTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Message
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new Message(
            'mypulseid',
            'test-type',
            'test-handle',
            '1'
        );
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
        $this->object = null;
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::__construct
     */
    public function testTheConstructor()
    {
        $this->assertInstanceOf('ICANS\Component\IcansLoggingComponent\Transport\Message', $this->object);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::getRawData
     */
    public function testGetRawData()
    {
        $actual = $this->object->getRawData();
        $expected = array(
            'pulse'=>'mypulseid',
            'event_type'=>'test-type',
            'event_handle'=>'test-handle',
            'event_version'=>1,
        );

        $this->assertEquals(
            $expected,
            $actual
        );
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setOriginType
     * @depends testGetRawData
     */
    public function testSetTheOriginType()
    {
        $originType = 'test-origin-type';
        $this->object->setOriginType($originType);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('origin_type', $actual);
        $this->assertSame($actual['origin_type'], $originType);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setCreationTimeStampInMilliseconds
     * @depends testGetRawData
     */
    public function testSetCreationTimeStampInMilliseconds()
    {
        $milliseconds = 1351072471234;
        $milliDate = $this->getMock('ICANS\Component\IcansLoggingComponent\Transport\MilliSecondDateTime');

        $milliDate->expects($this->once())
            ->method('getTimestampInMilliseconds')
            ->will($this->returnValue($milliseconds));
        $milliDate->expects($this->once())
            ->method('getDateStringWithMilliseconds')
            ->will($this->returnValue('foobar'));

        $this->object->setCreationTimeStampInMilliseconds($milliDate);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('created_timestamp', $actual);
        $this->assertEquals($milliseconds, $actual['created_timestamp']);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setEnvelopeVersion
     * @depends testGetRawData
     */
    public function testSetEnvelopeVersion()
    {
        $envelopeVersion = 12345;
        $this->object->setEnvelopeVersion($envelopeVersion);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('envelope_version', $actual);
        $this->assertSame($actual['envelope_version'], $envelopeVersion);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setOriginServiceType
     * @depends testGetRawData
     */
    public function testSetOriginServiceType()
    {
        $originServiceType = 'test-origin-service-type';
        $this->object->setOriginServiceType($originServiceType);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('origin_service_type', $actual);
        $this->assertSame($actual['origin_service_type'], $originServiceType);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setOriginServiceComponent
     * @depends testGetRawData
     */
    public function testSetOriginServiceComponent()
    {
        $originServiceComponent = 'test-origin-service-component';
        $this->object->setOriginServiceComponent($originServiceComponent);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('origin_service_component', $actual);
        $this->assertSame($actual['origin_service_component'], $originServiceComponent);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setOriginServiceInstance
     * @depends testGetRawData
     */
    public function testSetOriginServiceInstance()
    {
        $originServiceInstance = 'test-origin-service-instance';
        $this->object->setOriginServiceInstance($originServiceInstance);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('origin_service_instance', $actual);
        $this->assertSame($actual['origin_service_instance'], $originServiceInstance);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setLogLevel
     * @depends testGetRawData
     */
    public function testSetLogLevel()
    {
        $logLevelValue = 300;
        $logLevelName = 'log-level-testing';
        $this->object->setLogLevel($logLevelValue, $logLevelName);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('message_loglevel_value', $actual);
        $this->assertArrayHasKey('message_loglevel', $actual);
        $this->assertSame($actual['message_loglevel_value'], $logLevelValue);
        $this->assertSame($actual['message_loglevel'], $logLevelName);
    }

    /**
     * @covers ICANS\Component\IcansLoggingComponent\Transport\Message::setBody
     * @depends testGetRawData
     */
    public function testSetBody()
    {
        $body = array(
            'Body Item 1',
            'Body Item 2',
        );
        $this->object->setBody($body);
        $actual = $this->object->getRawData();
        $this->assertArrayHasKey('event_body', $actual);
        $this->assertSame($actual['event_body'], $body);
    }

}


text:
#ifndef CROSSFEED_H
#define CROSSFEED_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct crossfeed_s {
	float mid[74];
	float side[74];
	float o[3];
	float a_0, a_1, a_2, a_3;
	float b_1, b_2, b_3;
	unsigned short delay;
	unsigned short pos;
	unsigned short opos;
	unsigned short bypass;
} crossfeed_t;

int crossfeed_init(crossfeed_t *filter, int samplerate);
void crossfeed_filter(crossfeed_t *filter, float *input, float *output, unsigned int size);
void crossfeed_filter_inplace_noninterleaved(crossfeed_t *filter, float *left, float *right, unsigned int size);

#ifdef __cplusplus
}
#endif

#endif


text: Une application pour s'entendre chanter sur une musique


text:
package hk.ust.cse;

public class CountofRangeSum327 {
    public int countRangeSum(int[] nums, int lower, int upper) {
    	return 0;
    }
}