text:
title: TestedSetups Mitaka GA
authors: rbowen
---

# Test cases for Mitaka GA test day

Tested Setups for [RDO test day Mitaka GA](/testday/mitaka/ga),
April 13-14, 2016.

See also the [Workarounds][] page.

Some steps from the official Quickstart guide
do not apply to Mitaka; make sure to follow the steps described in the
[How To Test](/testday/mitaka/ga#how-to-test) page instead.

For convenience, during the test day, please feel free to use the [test
day etherpad][], which we'll use to periodically update this page.

1. toc
{:toc}

## Example Entry

Here's how you might fill out an entry once you've tested it. Mark a given test "Good" or "Fail", as appropriate, and link to any tickets that you've opened as a result, and to any place where you've written up your test notes. Mark as Workaround if you have a failure but can get past it. Link to your writeup of the workaround.

| Config Name                                                    | Release          | BaseOS    | Status                                       | HOWTO                                               | Who    | Date       | BZ/LP                                                              | Notes Page |
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
| All-in-One w/ Neutron OVS (no tunnels, fake bridge) Networking | Grizzly 2013.1.3 | RHEL 6.4  | Good | [Neutron-Quickstart](Neutron-Quickstart) | pmyers | 2013-09-08 | None                                                               | None       |
|                                                                |                  | Fedora 19 | FAIL | [Neutron-Quickstart](Neutron-Quickstart) | rbowen | 2013-10-09 | ~~[1017421](https://bugzilla.redhat.com/show_bug.cgi?id=1017421)~~ | None       |

## Packstack Based Installation (Neutron Networking)

Please make sure to use the steps described in the [How To Test](/testday/mitaka/milestone3#how-to-test)  when installing the base RDO system. Do not go through the Quickstart steps unmodified which will instead give you an RDO Liberty deployment.

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
| All-in-One - Sanity | Mitaka  | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) | | | None |
| All-in-One - Sanity | Mitaka  | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) | | | |
|                     | Mitaka | RHEL 7.2  |   | [How To Test](/testday/mitaka/milestone3#how-to-test) | | | None |
| Distributed -IPv6-Deployment- Sanity | Mitaka |  CentOS 7.2 | | [How To Test](/testday/mitaka/milestone3#how-to-test) | | | In notes | |
|                                      |Mitaka | RHEL 7.2   |  | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   |  |
| Distributed -ML2- OVS-VXLAN –  LbaaS |Mitaka | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   |  |
|                                      |Mitaka | RHEL 7.2   |  | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   |  |
| Distributed -ML2- OVS-VXLAN-VRRP     |Mitaka | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   |  |
| |Mitaka | RHEL7.2 | | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   | |
| Distributed -ML2-OVS- VXLAN-IPv6 – VPNaaS | Mitaka | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |  |  |
| |Mitaka | RHEL7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) | |  |  |
| Distributed -ML2-OVS- VXLAN Security Groups |Mitaka | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   |  |
| |Mitaka | RHEL7.2 | | [How To Test](/testday/mitaka/milestone3#how-to-test) |  |   | |
| Distributed -ML2-OVS- VXLAN DVR |Mitaka | RHEL 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test) | |   |  |
|  |Mitaka | CentOS 7.2 | | [How To Test](/testday/mitaka/milestone3#how-to-test) |   |  |  |
| 3,node  -ML2-OVS- VXLAN |Mitaka  | CentOS 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test) |   |   |  |
| | Mitaka | RHEL 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test) |   |   |  |
| 3,node  -ML2-OVS- GRE   | Mitaka | CentOS 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test) |   |   |  |
| | Mitaka | RHEL 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test) |   |   |  |
| 3,node  -ML2-OVS- VLAN  | Mitaka | CentOS 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test) |   |   |  |
| | Mitaka | RHEL 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test) |   |   |  |

## TripleO

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|-------------|---------|--------|--------|-------|-----|------|-------|-----------
| Minimal | Mitaka | CentOS 7.2 | | [Install Guide](https://www.rdoproject.org/tripleo/) | | | |
| | Mitaka | RHEL 7.2 | |[Install Guide](https://www.rdoproject.org/tripleo/) | | | None  |
| | Mitaka | RHEL 7.2 |  |[Install Guide](https://www.rdoproject.org/tripleo/) | | |None  |
| | Mitaka | CentOS 7.2 | |[Install Guide](https://www.rdoproject.org/tripleo/) | | |   |
| | Liberty | CentOS 7.2 | | [Install Guide](https://www.rdoproject.org/tripleo/) | | | |
| | Liberty | RHEL 7.2 | | [Install Guide](https://www.rdoproject.org/tripleo/) | | | |
| HA | Mitaka | CentOS 7.2 |  |[Install Guide](https://www.rdoproject.org/tripleo/) | |  |
| | Mitaka | CentOS 7.2 |  |[Install Guide](https://www.rdoproject.org/tripleo/) | | |  |
| | Mitaka | RHEL 7.2 | | [Install Guide](https://www.rdoproject.org/tripleo/) | | | |
| | Liberty | CentOS 7.2 | | [Install Guide](https://www.rdoproject.org/tripleo/) | | | |
| | Liberty | RHEL 7.2 | | [Install Guide](https://www.rdoproject.org/tripleo/) | | | |

## Packstack Based Installation (Storage Components)

Please see [Docs - Storage](/documentation/storage) for configuration guides as well as suggestions on what could be tested for both Cinder and Glance and make sure to use the steps described in the [How To Test](testday/mitaka/milestone3#how-to-test) page when installing the base RDO system. '''Do not''' go through the Quickstart steps unmodified which will instead give you an RDO Liberty deployment.

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
| Glance=localfs, Cinder=lvm | Mitaka | CentOS 7.2 | | [QuickStart](/Quickstart) | |   |   |
| | Mitaka | RHEL 7.2 | | [QuickStart](/Quickstart) | |   |   |
| Glance=localfs, Cinder=glusterfs | Mitaka | CentOS 7.2 | | [QuickStart](/Quickstart) | |  | |
| | Mitaka | RHEL 7.2 | | [QuickStart](/Quickstart) | |  | |
| Glance=localfs, Cinder=windows_iscsi | Mitaka | CentOS 7.2 |  | [QuickStart](/Quickstart) |  |  |  |
| | Mitaka | RHEL 7.2 |  | [QuickStart](/Quickstart) |  |  |  |
| Glance=swift, Cinder=thinlvm | Mitaka | CentOS 7.2 |  | [QuickStart](/Quickstart) | | | |
| | Mitaka | RHEL 7.2 |  | [QuickStart](/Quickstart) | | | |
| Glance=s3(amazon s3), Cinder=nfs | Mitaka | CentOS 7.2 |  | [QuickStart](/Quickstart) | |    | |
| | Mitaka | RHEL 7.2 |  | [QuickStart](/Quickstart) |  |    | |
| Glance=s3(swift s3), Cinder=nfs | Mitaka | CentOS 7.2 |  | [QuickStart](/Quickstart) | |    | |
| | Mitaka | RHEL 7.2 |  | [QuickStart](/Quickstart) |  |    | |
| Glance=ceph, Cinder=ceph | Mitaka | CentOS 7.2 |  | [QuickStart](/Quickstart) |  |    |  |
| | Mitaka | RHEL 7.2 |  | [QuickStart](/Quickstart) |  |    |  |
| Glance=XtreamIO, Cinder=XtreamIO | Mitaka | CentOS 7.2 |  | [QuickStart](/Quickstart) |  |   |  |
| | Mitaka | RHEL 7.2 |  |[QuickStart](/Quickstart) |  |   |  |
| Glance=lvm, Cinder=glusterfs | Mitaka |  CentOS 7.2 |  | [QuickStart](/Quickstart) |    |   |  |
| | Mitaka |  RHEL 7.2 |  | [QuickStart](/Quickstart) |    |   |  |
| Glance=lvm, Cinder=netapp_iscsi | Mitaka |CentOS 7.2 |  |[QuickStart](/Quickstart) |  |    | |
| | Mitaka | RHEL 7.2 |  | [QuickStart](/Quickstart) |  |    | |
| Glance=lvm, Cinder=netapp_nfs | Mitaka | CentOS 7.2 |  |[QuickStart](/Quickstart) |   |    |  |
| | Mitaka | RHEL 7.2 |  |[QuickStart](/Quickstart) |   |    |  |
| Glance=nfs, Cinder=netapp_iscsi | Mitaka | CentOS 7.2 | | [QuickStart](/Quickstart) |  |    |   |
| | Mitaka | RHEL 7.2 | |[QuickStart](/Quickstart) |  |    |   |

## Packstack Based Installation (Misc Components)

Various components which don't fit the large test efforts above.

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
| Ceilometer: All-in-One w/ Neutron Networking | Mitaka | RHEL 7.2 |    |[How To Test](/testday/mitaka/milestone3#how-to-test)| |    |    |   |
| | Mitaka | CentOS 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test)|| | ||
| Nova Compute: 2 Distributed Compute nodes  | Mitaka | RHEL 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test)| | ||
| | Mitaka | CentOS 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test)| | ||

## Core Tests

### General openstack tests

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
| Distributed Horizon | Mitaka | RHEL 7.2 |   | [How To Test](/testday/mitaka/milestone3#how-to-test)  |     |  |   |
| | Mitaka | CentOS 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test) | | | | |
| Heat tests | Mitaka | RHEL 7.2 |   |[How To Test](/testday/mitaka/milestone3#how-to-test) |    |  | Packstack + environment creation sanity |
| | Mitaka | CentOS 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test) | | | | |
| 2.node Nova tests | Mitaka | RHEL 7.2 | |[How To Test](/testday/mitaka/milestone3#how-to-test) |   | | Packstack + nova live migration (block / shared storage) |
|  | Mitaka | Centos 7.2 | | [How To Test](/testday/mitaka/milestone3#how-to-test) |     |  |  |

## Manual configuration of OpenStack

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
|2,node+minimal OpenStack+Neutron+OVS+GRE | Mitaka | RHEL 7.2 |  |[How To Test](/testday/mitaka/milestone3#how-to-test)  |  |  |  |
| | Mitaka | CentOS 7.2 |  | [How To Test](/testday/mitaka/milestone3#how-to-test)  |  |  | |
| Ceph quickstart | Mitaka | CentOS 7 |  | [Ceph quickstart](https://wiki.centos.org/SpecialInterestGroup/Storage/ceph-Quickstart) | | | |

## Post Installation Tests

| Config Name | Release | BaseOS | Status | HOWTO | Who | Date | BZ/LP | Notes Page
|----------------------------------------------------------------|------------------|-----------|----------------------------------------------|-----------------------------------------------------|--------|------------|--------------------------------------------------------------------|------------|
| Post Installation | Mitaka |  CentOS 7.2 |  |[Post Deployment Test](docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html#post-deployment) |  |  |  |
| | Mitaka | RHEL 7.2 | |[Post Deployment Test](docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html#post-deployment)  | | | |

[test day etherpad]: https://etherpad.openstack.org/p/rdo-test-days-mitaka-ga
[Tested Setups]: /testday/mitaka/testedsetupsga
[Workarounds]: /testday/mitaka/workaroundsga


text:
@interface CityViewController : UIViewController

@property (nonatomic,copy)void(^myblock)(NSString *text,NSString *url);

@property(nonatomic,copy)void(^cityblock)(NSString *cityName);

@end

redpajama_set_name: RedPajamaGithub


text:
/* Styles that make the demo lovelier */

body{
	background: #fff;
}

h1 {
	font-family: "Helvetica Neue","HelveticaNeue","Helvetica",sans-serif;
	border-bottom: 2px solid #000;
	line-height: 2.0;
	font-size: 100%;
	font-weight: 500;
}

/* Bump down the HUD's position so it looks nice */

x-status-hud{
  margin-top: 3em;
}


text:
**A git log to CHANGELOG.md tool**

[![npm](https://nodei.co/npm/my-changelog.png?downloads=true&downloadRank=true)](https://nodei.co/npm/my-changelog/)
[![npm](https://nodei.co/npm-dl/my-changelog.png?months=6&height=3)](https://nodei.co/npm/my-changelog/)

## Eh?

**my-changelog** is a formalisation of the [Node.js](https://github.com/nodejs/node) CHANGELOG.md entry process but flexible enough to be used on other repositories.

**my-changelog** will look at the git log of the current directory, pulling entries since the last tag. Commits with just a version number in the summary are removed, as are commits prior to, and including summaries that say `working on <version>` (this is an io.js / Node ism).

After collecting the list of commits, any that have `PR-URL: <url>` in them are looked up on Stash and the labels of the pull request are collected, specifically looking for labels that start with `semver` (the assumption is that `semver-minor`, `semver-major` labels are used to indicate non-patch version bumps).

Finally, the list is formatted as Markdown and printed to stdout.

Each commit will come out something like this (on one line):

```
* [[`20f8e7f17a`](https://stash.domain.com/projects/DEMO/repos/app/commits/20f8e7f17a)] - **test**: remove flaky test functionality (Rod Vagg)
* [[`f0e2aced96`](https://github.com/lestad/clinic/commit/f0e2aced96)] - **fix**: Hide "Hello" for small screens (Sergey Sova)
```

Note:

* When running `my-changelog` on the command-line, the default Stash) repo is computed from the `package.json` that exists on `cwd`, otherwise fallback to `nodejs/node`, you can change this by supplying the user/org as the first argument and project as the second. e.g `my-changelog joyent node`.
* Commit links will go to the assumed repo (default: nodejs/node)
* If a commit summary starts with a word, followed by a `:`, this is treated as a special label and rendered in bold
* Commits that have `semver*` labels on the pull request referred to in their `PR-URL` have those labels printed out at the start of the summary, in bold, upper cased.
* Pull request URLs come from the `PR-URL` data, if it matches the assumed repo (default: nodejs/node) then just a `#` followed by the number, if another repo then a full `user/project#number`.

When printing to a console some special behaviours are invoked:

* Commits with a summary that starts with `doc:` are rendered in grey
* Commits that have a `semver*` label on the pull request referred to in their `PR-URL` are rendered in bold green

## Install

```
$ npm i -g my-changelog
```

## Usage

**`my-changelog [--simple] [--url=https://stash.domain.com/projects/NAME] [--group] [--start-ref=<ref>] [--end-ref=<ref>] [github-user[, github-project]]`**

* `github-user` and `github-project` should point to the GitHub repository that can be used to find the `PR-URL` data if just an issue number is provided and will also impact how the PR-URL issue numbers are displayed
* `--quiet` do not print to `process.stdout`
* `--url` set default repo url. If `--url` was provided, simple commit path added to end
* `--all` process all commits since beginning, instead of last tag.
* `--simple` will print a simple form, without additional Markdown cruft
* `--group` will reorder commits so that they are listed in groups where the `xyz:` prefix of the commit message defines the group. Commits are listed in original order _within_ group.
* `--start-ref=<ref>` will use the given git `<ref>` as a starting point rather than the _last tag_. The `<ref>` can be anything commit-ish including a commit sha, tag, branch name. If you specify a `--start-ref` argument the commit log will not be pruned so that version commits and `working on <version>` commits are left in the list.
* `--end-ref=<ref>` will use the given git `<ref>` as a end-point rather than the _now_. The `<ref>` can be anything commit-ish including a commit sha, tag, branch name.
* `--filter-release`: Exclude Node-style release commits from the list. e.g. `Working on v1.0.0` or `2015-10-21 Version 2.0.0` and also `npm version X` style commits containing _only_ an `x.y.z` semver designator.

## License

**changelog-maker** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

**my-changelog** is Copyright (c) 2016 Sergey Sova [LestaD] <i.am@lestad.net>


text:
package com.fps.starter.ui;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import com.fps.starter.R;
import com.fps.starter.bo.FragmentContent;
import com.fps.starter.bo.Test;
import com.fps.starter.db.BaseDao;
import com.fps.starter.ui.fragment.TestFragment;

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

import butterknife.Bind;
import butterknife.ButterKnife;

public class MainActivity extends StackAbleFragmentActivity {

    public static final String TAG = MainActivity.class.getName();

    @Bind(R.id.main_toolbar)
    Toolbar mToolbar;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        setFragmentContainerLayout(R.id.fragment_container);
        setSupportActionBar(mToolbar);

        //TODO: Add new application fragment_class_name.
        //TODO: Add new package shame.
        //TODO: Change the release key.
        //TODO: Remove Calligraphy if you dont need it.

        //Display a TestFragment
        addFragmentContentToStack(new FragmentContent(TestFragment.class.getName(), "GERI STARTER CUCCA 1"));

        //Make an initial insert.
        boolean isDataBaseFilled = false;

        if (!isDataBaseFilled) {
            List<Test> testList = new ArrayList<>();
            testList.add(new Test("Test Description 1"));
            testList.add(new Test("Test Description 2"));
            testList.add(new Test("Test Description 3"));
            testList.add(new Test("Test Description 4"));

            try {
                Test.insertList(testList,false);
            } catch (BaseDao.DatabaseConnectorException e) {
                e.printStackTrace();
            }
        }

        Log.d(TAG,"------ GET ALL -----");
        List<Test> selectedList1 = Test.getAll();

        for (Test test : selectedList1) {
            Log.d(TAG, test.toString());
        }

        Log.d(TAG,"------ GET BY INTERVAL -----");
        List<Test> selectedList2 = Test.getIntervalList(2,4);

        for (Test test : selectedList2) {
            Log.d(TAG, test.toString());
        }

        Log.d(TAG,"------ GET BY ID -----");
        Log.d(TAG, Test.getById(1).toString());
    }

    @Override
    public void setScreenTitle(CharSequence title) {
        setTitle(title);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

//    We have to wrap context with calligraphy, if we want to use custom fonts.
//    @Override
//    protected void attachBaseContext(Context newBase) {
//        super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
//    }

}


text:
import * as assert from 'assert';
import { compile } from '../contracts/compile';
import { client } from './test';

describe('Setting and Getting Values:', function () {
  const source = `
pragma solidity >=0.0.0;

contract GetSet {

	uint uintfield;
	bytes32 bytesfield;
	string stringfield;
	bool boolfield;

	function testExist() public pure returns (uint output){
		return 1;
	}

	function setUint(uint input) public {
		uintfield = input;
		return;
	}

	function getUint() public view returns (uint output){
		output = uintfield;
		return output;
	}

	function setBytes(bytes32 input) public {
		bytesfield = input;
		return;
	}

	function getBytes() public view returns (bytes32 output){
		output = bytesfield;
		return output;
	}

	function setString(string memory input) public {
		stringfield = input;
		return;
	}

	function getString() public view returns (string memory output){
		output = stringfield;
		return output;
	}

	function setBool(bool input) public {
		boolfield = input;
		return;
	}

	function getBool() public view returns (bool output){
		output = boolfield;
		return output;
	}
}
`;

  const testUint = 42;
  const testBytes = Buffer.from('DEADBEEF00000000000000000000000000000000000000000000000000000000', 'hex');
  const testString = 'Hello World!';
  const testBool = true;

  let TestContract: any;

  before(async () => {
    const contract = compile(source, 'GetSet');
    TestContract = await contract.deploy(client);
  });

  it('Uint', async () => {
    await TestContract.setUint(testUint);
    const output = await TestContract.getUint();
    assert.strictEqual(output[0], testUint);
  });

  it('Bool', async () => {
    await TestContract.setBool(testBool);
    const output = await TestContract.getBool();
    assert.strictEqual(output[0], testBool);
  });

  it('Bytes', async () => {
    await TestContract.setBytes(testBytes);
    const output = await TestContract.getBytes();
    assert.deepStrictEqual(output[0], testBytes);
  });

  it('String', async () => {
    await TestContract.setString(testString);
    const output = await TestContract.getString();
    assert.strictEqual(output[0], testString);
  });
});


text:
#include "stdlib/stats/base/snanmskmin.h"
#include <node_api.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>

/**
* Add-on namespace.
*/
namespace stdlib_stats_base_snanmskmin {

	/**
	* Computes the minimum value of a single-precision floating-point strided array according to a mask, ignoring `NaN` values.
	*
	* ## Notes
	*
	* -   When called from JavaScript, the function expects five arguments:
	*
	*     -   `N`: number of indexed elements
	*     -   `X`: input array
	*     -   `strideX`: `X` stride length
	*     -   `Mask`: mask array
	*     -   `strideMask`: `Mask` stride length
	*/
	napi_value node_snanmskmin( napi_env env, napi_callback_info info ) {
		napi_status status;

		size_t argc = 5;
		napi_value argv[ 5 ];
		status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr );
		assert( status == napi_ok );

		if ( argc < 5 ) {
			napi_throw_error( env, nullptr, "invalid invocation. Must provide 5 arguments." );
			return nullptr;
		}

		napi_valuetype vtype0;
		status = napi_typeof( env, argv[ 0 ], &vtype0 );
		assert( status == napi_ok );
		if ( vtype0 != napi_number ) {
			napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." );
			return nullptr;
		}

		bool res1;
		status = napi_is_typedarray( env, argv[ 1 ], &res1 );
		assert( status == napi_ok );
		if ( res1 == false ) {
			napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float32Array." );
			return nullptr;
		}

		napi_valuetype vtype2;
		status = napi_typeof( env, argv[ 2 ], &vtype2 );
		assert( status == napi_ok );
		if ( vtype2 != napi_number ) {
			napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a number." );
			return nullptr;
		}

		bool res3;
		status = napi_is_typedarray( env, argv[ 3 ], &res3 );
		assert( status == napi_ok );
		if ( res3 == false ) {
			napi_throw_type_error( env, nullptr, "invalid argument. Fourth argument must be a Uint8Array." );
			return nullptr;
		}

		napi_valuetype vtype4;
		status = napi_typeof( env, argv[ 4 ], &vtype4 );
		assert( status == napi_ok );
		if ( vtype4 != napi_number ) {
			napi_throw_type_error( env, nullptr, "invalid argument. Fifth argument must be a number." );
			return nullptr;
		}

		int64_t N;
		status = napi_get_value_int64( env, argv[ 0 ], &N );
		assert( status == napi_ok );

		int64_t strideX;
		status = napi_get_value_int64( env, argv[ 2 ], &strideX );
		assert( status == napi_ok );

		int64_t strideMask;
		status = napi_get_value_int64( env, argv[ 4 ], &strideMask );
		assert( status == napi_ok );

		napi_typedarray_type vtype1;
		size_t xlen;
		void *X;
		status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, nullptr, nullptr );
		assert( status == napi_ok );
		if ( vtype1 != napi_float32_array ) {
			napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float32Array." );
			return nullptr;
		}
		if ( (N-1)*llabs(strideX) >= (int64_t)xlen ) {
			napi_throw_range_error( env, nullptr, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." );
			return nullptr;
		}

		napi_typedarray_type vtype3;
		size_t mlen;
		void *Mask;
		status = napi_get_typedarray_info( env, argv[ 3 ], &vtype3, &mlen, &Mask, nullptr, nullptr );
		assert( status == napi_ok );
		if ( vtype3 != napi_uint8_array ) {
			napi_throw_type_error( env, nullptr, "invalid argument. Fourth argument must be a Uint8Array." );
			return nullptr;
		}
		if ( (N-1)*llabs(strideMask) >= (int64_t)mlen ) {
			napi_throw_range_error( env, nullptr, "invalid argument. Fourth argument has insufficient elements based on the associated stride and the number of indexed elements." );
			return nullptr;
		}

		napi_value v;
		status = napi_create_double( env, (double)stdlib_strided_snanmskmin( N, (float *)X, strideX, (uint8_t *)Mask, strideMask ), &v );
		assert( status == napi_ok );

		return v;
	}

	napi_value Init( napi_env env, napi_value exports ) {
		napi_status status;
		napi_value fcn;
		status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_snanmskmin, NULL, &fcn );
		assert( status == napi_ok );
		return fcn;
	}

	NAPI_MODULE( NODE_GYP_MODULE_NAME, Init )
} // end namespace stdlib_stats_base_snanmskmin


text:
/* jslint node: true, esnext: true */
"use strict";

const llm = require('loglevel-mixin');
class _Logger {}
llm.defineLoggerMethods(_Logger.prototype, llm.defaultLogLevels);

function getTime() {
	function fill(val) {
		if (val < 10) {
			return "0" + val;
		}
		return val;
	}
	const date = new Date(Date.now());
	const dateStr = `${date.getFullYear()}-${fill(date.getMonth() + 1)}-${fill(date.getDate())}`;
	const timeStr = `${fill(date.getHours())}:${fill(date.getMinutes())}:${fill(date.getSeconds())}`;
	return dateStr + " " + timeStr;
}

class Logger extends llm.LogLevelMixin(_Logger, llm.defaultLogLevels, llm.defaultLogLevels.debug) {

	log(level, arg) {
		this._validationErrorCount++;
		console.log(`${getTime()} ${level.toUpperCase()}: ${JSON.stringify(arg, null, 2)}`);
	}

}

module.exports = Logger;


text:
                            Author

{{ site.owner.name }}

{{ site.owner.email }}

{{ site.owner.description }}


text:
<?php

namespace PHPExiftool\Driver\Tag\DICOM;

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

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

    protected $Id = '0046,0077';

    protected $Name = 'KeratometricAxis';

    protected $FullName = 'DICOM::Main';

    protected $GroupName = 'DICOM';

    protected $g0 = 'DICOM';

    protected $g1 = 'DICOM';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Keratometric Axis';

}


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\nsIAccessibleEvent.idl
 */

#ifndef __gen_nsIAccessibleEvent_h__
#define __gen_nsIAccessibleEvent_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIAccessible; /* forward declaration */

class nsIAccessibleDocument; /* forward declaration */

class nsIDOMNode; /* forward declaration */

#define NS_ACCESSIBLE_EVENT_TOPIC "accessible-event"

/* starting interface:    nsIAccessibleEvent */
#define NS_IACCESSIBLEEVENT_IID_STR "7f66a33a-9ed7-4fd4-87a8-e431b0f43368"

#define NS_IACCESSIBLEEVENT_IID \
  {0x7f66a33a, 0x9ed7, 0x4fd4, \
    { 0x87, 0xa8, 0xe4, 0x31, 0xb0, 0xf4, 0x33, 0x68 }}

class NS_NO_VTABLE nsIAccessibleEvent : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IACCESSIBLEEVENT_IID)

  enum {
    EVENT_SHOW = 1U,
    EVENT_HIDE = 2U,
    EVENT_REORDER = 3U,
    EVENT_ACTIVE_DECENDENT_CHANGED = 4U,
    EVENT_FOCUS = 5U,
    EVENT_STATE_CHANGE = 6U,
    EVENT_LOCATION_CHANGE = 7U,
    EVENT_NAME_CHANGE = 8U,
    EVENT_DESCRIPTION_CHANGE = 9U,
    EVENT_VALUE_CHANGE = 10U,
    EVENT_HELP_CHANGE = 11U,
    EVENT_DEFACTION_CHANGE = 12U,
    EVENT_ACTION_CHANGE = 13U,
    EVENT_ACCELERATOR_CHANGE = 14U,
    EVENT_SELECTION = 15U,
    EVENT_SELECTION_ADD = 16U,
    EVENT_SELECTION_REMOVE = 17U,
    EVENT_SELECTION_WITHIN = 18U,
    EVENT_ALERT = 19U,
    EVENT_FOREGROUND = 20U,
    EVENT_MENU_START = 21U,
    EVENT_MENU_END = 22U,
    EVENT_MENUPOPUP_START = 23U,
    EVENT_MENUPOPUP_END = 24U,
    EVENT_CAPTURE_START = 25U,
    EVENT_CAPTURE_END = 26U,
    EVENT_MOVESIZE_START = 27U,
    EVENT_MOVESIZE_END = 28U,
    EVENT_CONTEXTHELP_START = 29U,
    EVENT_CONTEXTHELP_END = 30U,
    EVENT_DRAGDROP_START = 31U,
    EVENT_DRAGDROP_END = 32U,
    EVENT_DIALOG_START = 33U,
    EVENT_DIALOG_END = 34U,
    EVENT_SCROLLING_START = 35U,
    EVENT_SCROLLING_END = 36U,
    EVENT_MINIMIZE_START = 37U,
    EVENT_MINIMIZE_END = 38U,
    EVENT_DOCUMENT_LOAD_COMPLETE = 39U,
    EVENT_DOCUMENT_RELOAD = 40U,
    EVENT_DOCUMENT_LOAD_STOPPED = 41U,
    EVENT_DOCUMENT_ATTRIBUTES_CHANGED = 42U,
    EVENT_DOCUMENT_CONTENT_CHANGED = 43U,
    EVENT_PROPERTY_CHANGED = 44U,
    EVENT_PAGE_CHANGED = 45U,
    EVENT_TEXT_ATTRIBUTE_CHANGED = 46U,
    EVENT_TEXT_CARET_MOVED = 47U,
    EVENT_TEXT_CHANGED = 48U,
    EVENT_TEXT_INSERTED = 49U,
    EVENT_TEXT_REMOVED = 50U,
    EVENT_TEXT_UPDATED = 51U,
    EVENT_TEXT_SELECTION_CHANGED = 52U,
    EVENT_VISIBLE_DATA_CHANGED = 53U,
    EVENT_TEXT_COLUMN_CHANGED = 54U,
    EVENT_SECTION_CHANGED = 55U,
    EVENT_TABLE_CAPTION_CHANGED = 56U,
    EVENT_TABLE_MODEL_CHANGED = 57U,
    EVENT_TABLE_SUMMARY_CHANGED = 58U,
    EVENT_TABLE_ROW_DESCRIPTION_CHANGED = 59U,
    EVENT_TABLE_ROW_HEADER_CHANGED = 60U,
    EVENT_TABLE_ROW_INSERT = 61U,
    EVENT_TABLE_ROW_DELETE = 62U,
    EVENT_TABLE_ROW_REORDER = 63U,
    EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED = 64U,
    EVENT_TABLE_COLUMN_HEADER_CHANGED = 65U,
    EVENT_TABLE_COLUMN_INSERT = 66U,
    EVENT_TABLE_COLUMN_DELETE = 67U,
    EVENT_TABLE_COLUMN_REORDER = 68U,
    EVENT_WINDOW_ACTIVATE = 69U,
    EVENT_WINDOW_CREATE = 70U,
    EVENT_WINDOW_DEACTIVATE = 71U,
    EVENT_WINDOW_DESTROY = 72U,
    EVENT_WINDOW_MAXIMIZE = 73U,
    EVENT_WINDOW_MINIMIZE = 74U,
    EVENT_WINDOW_RESIZE = 75U,
    EVENT_WINDOW_RESTORE = 76U,
    EVENT_HYPERLINK_END_INDEX_CHANGED = 77U,
    EVENT_HYPERLINK_NUMBER_OF_ANCHORS_CHANGED = 78U,
    EVENT_HYPERLINK_SELECTED_LINK_CHANGED = 79U,
    EVENT_HYPERTEXT_LINK_ACTIVATED = 80U,
    EVENT_HYPERTEXT_LINK_SELECTED = 81U,
    EVENT_HYPERLINK_START_INDEX_CHANGED = 82U,
    EVENT_HYPERTEXT_CHANGED = 83U,
    EVENT_HYPERTEXT_NLINKS_CHANGED = 84U,
    EVENT_OBJECT_ATTRIBUTE_CHANGED = 85U,
    EVENT_VIRTUALCURSOR_CHANGED = 86U,
    EVENT_LAST_ENTRY = 87U
  };

  /* readonly attribute unsigned long eventType; */
  NS_IMETHOD GetEventType(uint32_t *aEventType) = 0;

  /* readonly attribute nsIAccessible accessible; */
  NS_IMETHOD GetAccessible(nsIAccessible * *aAccessible) = 0;

  /* readonly attribute nsIAccessibleDocument accessibleDocument; */
  NS_IMETHOD GetAccessibleDocument(nsIAccessibleDocument * *aAccessibleDocument) = 0;

  /* readonly attribute nsIDOMNode DOMNode; */
  NS_IMETHOD GetDOMNode(nsIDOMNode * *aDOMNode) = 0;

  /* readonly attribute boolean isFromUserInput; */
  NS_IMETHOD GetIsFromUserInput(bool *aIsFromUserInput) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibleEvent, NS_IACCESSIBLEEVENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIACCESSIBLEEVENT \
  NS_IMETHOD GetEventType(uint32_t *aEventType) override; \
  NS_IMETHOD GetAccessible(nsIAccessible * *aAccessible) override; \
  NS_IMETHOD GetAccessibleDocument(nsIAccessibleDocument * *aAccessibleDocument) override; \
  NS_IMETHOD GetDOMNode(nsIDOMNode * *aDOMNode) override; \
  NS_IMETHOD GetIsFromUserInput(bool *aIsFromUserInput) override;

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIACCESSIBLEEVENT(_to) \
  NS_IMETHOD GetEventType(uint32_t *aEventType) override { return _to GetEventType(aEventType); } \
  NS_IMETHOD GetAccessible(nsIAccessible * *aAccessible) override { return _to GetAccessible(aAccessible); } \
  NS_IMETHOD GetAccessibleDocument(nsIAccessibleDocument * *aAccessibleDocument) override { return _to GetAccessibleDocument(aAccessibleDocument); } \
  NS_IMETHOD GetDOMNode(nsIDOMNode * *aDOMNode) override { return _to GetDOMNode(aDOMNode); } \
  NS_IMETHOD GetIsFromUserInput(bool *aIsFromUserInput) override { return _to GetIsFromUserInput(aIsFromUserInput); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIACCESSIBLEEVENT(_to) \
  NS_IMETHOD GetEventType(uint32_t *aEventType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEventType(aEventType); } \
  NS_IMETHOD GetAccessible(nsIAccessible * *aAccessible) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAccessible(aAccessible); } \
  NS_IMETHOD GetAccessibleDocument(nsIAccessibleDocument * *aAccessibleDocument) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAccessibleDocument(aAccessibleDocument); } \
  NS_IMETHOD GetDOMNode(nsIDOMNode * *aDOMNode) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDOMNode(aDOMNode); } \
  NS_IMETHOD GetIsFromUserInput(bool *aIsFromUserInput) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsFromUserInput(aIsFromUserInput); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsAccessibleEvent : public nsIAccessibleEvent
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIACCESSIBLEEVENT

  nsAccessibleEvent();

private:
  ~nsAccessibleEvent();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsAccessibleEvent, nsIAccessibleEvent)

nsAccessibleEvent::nsAccessibleEvent()
{
  /* member initializers and constructor code */
}

nsAccessibleEvent::~nsAccessibleEvent()
{
  /* destructor code */
}

/* readonly attribute unsigned long eventType; */
NS_IMETHODIMP nsAccessibleEvent::GetEventType(uint32_t *aEventType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIAccessible accessible; */
NS_IMETHODIMP nsAccessibleEvent::GetAccessible(nsIAccessible * *aAccessible)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIAccessibleDocument accessibleDocument; */
NS_IMETHODIMP nsAccessibleEvent::GetAccessibleDocument(nsIAccessibleDocument * *aAccessibleDocument)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIDOMNode DOMNode; */
NS_IMETHODIMP nsAccessibleEvent::GetDOMNode(nsIDOMNode * *aDOMNode)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean isFromUserInput; */
NS_IMETHODIMP nsAccessibleEvent::GetIsFromUserInput(bool *aIsFromUserInput)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIAccessibleEvent_h__ */


text:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Hashtable;

import javax.jms.BytesMessage;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.apache.commons.codec.binary.Base64;

import twitter4j.JSONException;
import twitter4j.JSONObject;
import twitter4j.StallWarning;
import twitter4j.Status;
import twitter4j.StatusDeletionNotice;
import twitter4j.StatusListener;
import twitter4j.TwitterException;
import twitter4j.TwitterStream;
import twitter4j.TwitterStreamFactory;

public class Sender {

	public static void main(String[] args) throws NamingException,
			JMSException, IOException, InterruptedException, TwitterException {

		// Configure JNDI environment
		Hashtable<String, String> env = new Hashtable<String, String>();
		env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory");
		env.put(Context.PROVIDER_URL, "servicebus.properties");
		Context context = new InitialContext(env);

		ConnectionFactory cf = (ConnectionFactory) context.lookup("SBCF");
		Destination queue = (Destination) context.lookup("EventHub");
		Connection connection = cf.createConnection();

		// Create sender-side Session and MessageProducer
		Session sendSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
		MessageProducer sender = sendSession.createProducer(queue);

		//Create a tweet listener
	    StatusListener listener = new StatusListener(){

	        public void onStatus(Status status) {

	            System.out.println(status.getUser().getName() + " : " + status.getText());

	            try {

					String tweetScore = GetSentimentScore(status.getText());
	                sendBytesMessage(sendSession, sender, tweetScore);

				} catch (UnsupportedEncodingException e) {
					e.printStackTrace();
				} catch (JMSException e) {
					e.printStackTrace();
				}
	        }

	        public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {}
	        public void onTrackLimitationNotice(int numberOfLimitedStatuses) {}
	        public void onException(Exception ex) { ex.printStackTrace(); }
			@Override
			public void onScrubGeo(long arg0, long arg1) {}
			@Override
			public void onStallWarning(StallWarning arg0) {}

	    };

	    TwitterStream twitterStream = new TwitterStreamFactory().getInstance();
	    twitterStream.addListener(listener);
	    twitterStream.filter("welc2017");
	}

	private static String GetSentimentScore(String tweet) throws UnsupportedEncodingException{

		//Your Text Analytics key needs to be encoded so that it can be used in the authorization header
		String taToken = "AccountKey:" +  "<YOUR TEXT ANALYTICS ACCOUNT KEY>";
		byte[]   taTokenEncoded = Base64.encodeBase64(taToken.getBytes());
        String authorizationHeaderTA = "Basic " + new String(taTokenEncoded);

        //Replacing spaces with + so that it can be used in the API call and remove hashtag
        String tweetEdited = tweet.replaceAll("\\s+","+");
        tweetEdited = tweetEdited.replaceAll("#","");

        String responseString = "{\"Topic\" : \"" + tweet + "\", \"SentimentScore\" : \"0\"}";
        String url = "https://api.datamarket.azure.com/data.ashx/amla/text-analytics/v1/GetSentiment?Text=" + tweetEdited;

		try {

			URL obj = new URL(url);

			HttpURLConnection con = (HttpURLConnection) obj.openConnection();

			con.setRequestMethod("GET");
			con.setRequestProperty("Authorization", authorizationHeaderTA);
			con.setRequestProperty("Accept", "application/json");

			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
			String inputLine;
			StringBuffer response = new StringBuffer();

			while ((inputLine = in.readLine()) != null) {
				response.append(inputLine);
			}
			in.close();

			JSONObject responseJson = new JSONObject(response.toString());
			String score = responseJson.getString("Score");

			responseString = "{\"Topic\" : \"" + tweet + "\", \"SentimentScore\" : \"" + score + "\"}";

		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return responseString;
	}

	private static void sendBytesMessage(Session sendSession, MessageProducer sender, String jsonMessage)
			throws JMSException, UnsupportedEncodingException {

	    BytesMessage message = sendSession.createBytesMessage();
	    message.writeBytes(jsonMessage.getBytes("UTF-8"));

	    sender.send(message);
		System.out.println("Sent message: " + jsonMessage + "\n");

	}
}


text:
{% load i18n %}
{% extends "html/services/page.html" %}

{% block title %}{% trans %}Service Support{% endtrans %}{% endblock %}

{% block module_title %}{{ status }}{% endblock %}
{% block module_subtitle %}{% trans %}Ticket Status{% endtrans %}{% endblock %}

{% block module_topmenu %}
{% trans %}New Ticket{% endtrans %}
{% trans %}View{% endtrans %}
{% if request.user.get_profile().is_admin('treeio.services') %}
{% trans %}Edit{% endtrans %}
{% trans %}Delete{% endtrans %}
{% endif %}
{% endblock %}

{% block service_ticket_statuses %}
{% if statuses %}
{% trans %}By Status{% endtrans %}
{% for istatus in statuses %}
{{ istatus }}
{% endfor %}
{% endif %}

{% endblock %}

{% block sidebar_right %}

{% trans %}Filter by{% endtrans %}
<form action="" method="get" class="content-filter-form">

        {{ filters.as_ul()|htsafe }}

    <input type="submit" value="{% trans %}Submit{% endtrans %}">
</form>
{% trans %}Permissions{% endtrans %}

    {{ permission_block(status) }}

{% trans %}Links{% endtrans %}

    {{ link_block(status) }}

{% trans %}Subscribers{% endtrans %}

    {{ subscription_block(status) }}

{% trans %}Download as:{% endtrans %}
{% if '?' in request.get_full_path() %}<a class="pdf-block-link" href="{{ request.get_full_path()|replace('.ajax','').replace('?','.pdf?') }}"{% else %}PDF

{% endblock %}

{% block module_content %}

    {% trans %}Active{% endtrans %}:
    {% if status.active %}{% trans %}Yes{% endtrans %}{% else %}{% trans %}No{% endtrans %}{% endif %}

    {% trans %}Hidden{% endtrans %}:
    {% if status.hidden %}{% trans %}Yes{% endtrans %}{% else %}{% trans %}No{% endtrans %}{% endif %}

{% if status.details %}

    {% trans %}Details{% endtrans %}:
    {{ status.details|htsafe }}

{% endif %}

<form action="" method="post">
{% csrf_token %}

            {% if tickets %}
            <input type="checkbox" name="mass-status-{{ status.id }}" value="mass-status-{{ status.id }}" class="group-control" />
            {% else %}
            <input type="checkbox" name="mass-status-{{ status.id }}" value="mass-status-{{ status.id }}" class="group-control" disabled="true" />
            {% endif %}
            {% trans %}Tickets{% endtrans %}:

                <input type="hidden" name="massform" value="massform" />
                 {{ massform.as_ul()|htsafe }}

                    <input type="submit" value="{% trans %}Save{% endtrans %}" />

        {% if not tickets %}

            {% trans %}No Tickets with {{ status }} Status{% endtrans %}

        {% endif %}

    {{ services_ticket_list(htsort(paginate(tickets)), tick_group='status') }}

    {{ pager(tickets) }}
</form>
{% endblock %}


text:
David Hagen gave an [introductory talk](https://www.youtube.com/watch?v=9JSGGSRgUcw) on Parsita at SciPy 2021. The documentation is more thorough, but the talk is useful for anyone looking for a quick walk-through.

## Defining a parser

Parsita parsers are written inside the bodies of classes that inherit from `TextParsers`. (If you are parsing something other than a string, such a stream of tokens, there is the `GeneralParsers` class.) Such classes are not meant to be instantiated. They are used purely as a kind of souped-up context manager.

The metaclass of `TextParsers` takes a `whitespace` named argument, which is a regular expression, or more commonly, a string that can be parsed into a regular expression. This becomes the definition of whitespace for all `Parser`s defined in this class body, making it so that whitespace as defined does not need to be explicitly captured and discarded. The default value is `r'\s*'`—all whitespace including newlines. With `whitespace=None`, no whitespace is ignored.

```python
from parsita import *

class NumericListParsers(TextParsers, whitespace=r'[ ]*'):
    integer_list = '[' >> repsep(reg('(+-)?[0-9]+') > int, ',') << ']'
```

Pretty much every function in Parsita returns an object with type `Parser`. Various operators, like `&` and `|`, are defined so that `Parser`s can be combined to make new, more complex, parsers, hence the name "parser combinators".

## Invoking a parser

### `Parser.parse`

The only method of note on a `Parser` is the `parse` method. The `parse` method takes a `str` as input and returns an instance of the `Result` class, which has two subclasses `Success` and `Failure`. The standard way to test if a result is a `Success` or `Failure` is to use `isinstance(result, Success)`. If `Success`, the parsed value can be obtained with `result.value`. If `Failure`, the error message can be obtained with `result.message`.

```python
from parsita import *

class NumericListParsers(TextParsers, whitespace=r'[ ]*'):
    integer_list = '[' >> repsep(reg('(+-)?[0-9]+') > int, ',') << ']'

result = NumericListParsers.integer_list.parse('[1, 1, 2, 3, 5]')

if isinstance(result, Success):
    python_list = result.value
else:
    raise RuntimeError(result.message)
```

### `Result.or_die`

Alternatively, `result.or_die()` returns the value if it is a `Success` and raises a `ParseError` exception with the message if it is a `Failure`. It is common to apply this immediately after the call to `parse` when an exception on failure is desired.

```python
from parsita import *

class NumericListParsers(TextParsers, whitespace=r'[ ]*'):
    integer_list = '[' >> repsep(reg('(+-)?[0-9]+') > int, ',') << ']'

python_list = NumericListParsers.integer_list.parse('[1, 1, 2, 3, 5]').or_die()
```


text:
Check for dav presence
--SKIPIF--
<?php if (!extension_loaded("tnc_dav")) print "skip"; ?>
--FILE--
<?php
echo "webdav extension is available";
?>
--EXPECT--
webdav extension is available


text:
void cSetErrorCallback (void);

void cSetPosCallback(void* window);
void cSetSizeCallback(void* window);
void cSetCloseCallback(void* window);
void cSetRefreshCallback(void* window);
void cSetFocusCallback(void* window);
void cSetIconifyCallback(void* window);
//void cSetFramebufferSizeCallback(void* window);

void cSetKeyCallback(void* window);
void cSetCharCallback(void* window);
void cSetMouseButtonCallback(void* window);
void cSetCursorPosCallback(void* window);
void cSetCursorEnterCallback(void* window);
void cSetScrollCallback(void* window);


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
  d: "M11.59 7.41 15.17 11H1v2h14.17l-3.59 3.59L13 18l6-6-6-6-1.41 1.41zM20 6v12h2V6h-2z"
}), 'KeyboardTabOutlined');
exports.default = _default;


text:
package cn.elvea.platform.commons.sequence.manager;

import cn.elvea.platform.commons.sequence.Sequence;

/**
 * @author elvea
 * @since 0.0.1
 */
public interface IdWorkerManager {

    Sequence getIdWorker();

}


text:
title: Snapshots, and how to produce an RSS/Atom feed
author: Jasper Van der Jeugt
---

Basic feed configuration
------------------------

Hakyll has built-in support for two types of feeds: RSS and Atom. This tutorial
explains how you can add these to your blog or website. The first step is to
define a `FeedConfiguration` to set some basic options. For example, a cooking
blog may have the following declaration:

```haskell
myFeedConfiguration :: FeedConfiguration
myFeedConfiguration = FeedConfiguration
    { feedTitle       = "Healthy cooking: latest recipes"
    , feedDescription = "This feed provides fresh recipes for fresh food!"
    , feedAuthorName  = "John Doe"
    , feedAuthorEmail = "test@example.com"
    , feedRoot        = "http://healthycooking.example.com"
    }
```

Simple feed rendering
---------------------

Now, let's look at how we actually create a feed. Two functions are available:

```haskell
renderAtom :: FeedConfiguration
           -> Context String
           -> [Item String]
           -> Compiler (Item String)
```

```haskell
renderRss :: FeedConfiguration
          -> Context String
          -> [Item String]
          -> Compiler (Item String)
```

As you can see, they have exactly the same signature: we're going to use
`renderAtom` in this tutorial, but it's trivial to change this to an RSS feed.

```haskell
create ["atom.xml"] $ do
    route idRoute
    compile $ do
        let feedCtx = postCtx `mappend`
                constField "description" "This is the post description"

        posts <- take 10 . recentFirst <$> loadAll "posts/*"
        renderAtom myFeedConfiguration feedCtx posts
```

There we go! We simply take the 10 last posts and pass them to `renderAtom`,
with our configuration and a `Context`.

It's a bit of a problem that we don't have a description for our posts, and the
Atom/RSS feed renderer requires this. One option is to add a `description: Foo`
header to our all posts. However, the description is the body text as it appears
in most RSS readers, so we would prefer to include the entire content of the
posts here.

Snapshots
---------

This poses a problem: if we just `load` all posts and take their content: we get
the *finished, processed* content. This means all templates have been applied at
that point (including `templates/default.html`). We don't want to include our
entire site with navigation in the RSS feed, but rather just the post HTML.

Snapshots provide a solution to this problem. They allow you to save an `Item`
at any point during its compilation, so you can `load` it later. Let's apply
this to our concrete problem.

```haskell
match "posts/*" $ do
    route $ setExtension "html"
    compile $ pandocCompiler
        >>= loadAndApplyTemplate "templates/post.html"    postCtx
        >>= loadAndApplyTemplate "templates/default.html" postCtx
        >>= relativizeUrls
```

now becomes:

```haskell
match "posts/*" $ do
    route $ setExtension "html"
    compile $ pandocCompiler
        >>= loadAndApplyTemplate "templates/post.html"    postCtx
        >>= saveSnapshot "content"
        >>= loadAndApplyTemplate "templates/default.html" postCtx
        >>= relativizeUrls
```

The `saveSnapshot` function is really simple: it takes an item and returns the
same item, after saving it. This return value makes it easier to use
`saveSnapshot` in a chain of compilers as we did in the above example, but you
can discard it if you want.

```haskell
type Snapshot = String

saveSnapshot :: (Typeable a, Binary a)
             => Snapshot -> Item a -> Compiler (Item a)
```

Including the post body
-----------------------

With this modification, we can update our Atom code. Instead of loading the
compiled posts, we just load their content (i.e. the snapshot we just took).

We update the `Context` to map `$description$` to the post body, and we're done!

```haskell
create ["atom.xml"] $ do
    route idRoute
    compile $ do
        let feedCtx = postCtx `mappend` bodyField "description"
        posts <- take 10 . recentFirst <$> loadAllSnapshots "posts/*" "content"
        renderAtom myFeedConfiguration feedCtx posts
```


text:
from .search import search_apmex
from .search import search_gainesvillecoins
from .search import search_goldeneaglecoins
# from .search import search_jmbullion
from .search import search_provident
from .search import search_shinybars
from .search import search_silvertowne


text:
<!DOCTYPE html>

    <title>API</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">

        Back

               Primary color
               <input id="input" />

Set / Get Value

                            <input id="value" type="text" class="k-textbox" />
                            <button id="set" class="k-button">Set value</button>

                            <button id="get" class="k-button">Get value</button>

Find item

                            <input id="word" value="B" class="k-textbox" />
                            <button id="search" class="k-button">Search</button>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
using System.IO;
using System.Windows.Controls;
using System.Text.RegularExpressions;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Rendering;
using Gherkin.Util;
using WpfMath;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using System.Globalization;
using System.Diagnostics;
using ICSharpCode.AvalonEdit;

namespace Gherkin.Model
{
    /// <summary>
    /// Custom Element Generators for AvalonEdit
    /// Remark:
    /// http://danielgrunwald.de/coding/AvalonEdit/rendering.php
    /// </summary>
    public abstract class CustomElementGenerator : VisualLineElementGenerator
    {
        protected TextEditor TextEditor { get; set; }
        protected TextDocument Document => TextEditor.Document;

        public CustomElementGenerator(TextEditor textEditor)
        {
            TextEditor = textEditor;
        }

        /// Gets the first offset >= startOffset where the generator wants to construct
        /// an element.
        /// Return -1 to signal no interest.
        public override int GetFirstInterestedOffset(int startOffset)
        {
            if (CanApplyGenerator())
            {
                Match m = FindMatch(startOffset);
                return m.Success ? (startOffset + m.Index) : -1;
            }
            else
                return -1;
        }

        protected virtual bool CanApplyGenerator()
        {
            return GherkinUtil.IsFeatureFile(Document.FileName);
        }

        protected abstract Regex GetRegex();

        protected Match FindMatch(int startOffset)
        {
            string relevantText = GetRelevantText(startOffset);
            return GetRegex().Match(relevantText);
        }

        protected bool IsPrinting => (CurrentContext == null);

        /// <summary>
        /// fetch the end offset of the VisualLine being generated
        /// </summary>
        /// <param name="startOffset"></param>
        /// <returns></returns>
        private string GetRelevantText(int startOffset)
        {
            if (CurrentContext != null)
            {
                // This is original implementation in
                // http://danielgrunwald.de/coding/AvalonEdit/rendering.php
                // It works perfectly.
                int endOffset = CurrentContext.VisualLine.LastDocumentLine.EndOffset;
                return Document.GetText(startOffset, endOffset - startOffset);
            }
            else
            {
                // This is customized implementation for printing preview & printing
                // in which CurrentContext is not available(would be null).
                // Here we directly use TextDocument to fetch "relevant text".
                DocumentLine line = Document.GetLineByOffset(startOffset);
                int endOffset = startOffset - (startOffset - line.Offset) + line.TotalLength;
                string relevantText = Document.GetText(startOffset, endOffset - startOffset);
                return relevantText;
            }
        }

        /// Constructs an element at the specified offset.
        /// May return null if no element can be constructed.
        public override VisualLineElement ConstructElement(int offset)
        {
            InlineObjectElement mainUIElement = ConstructMainElement(offset);

            if ((mainUIElement == null) || !IsPrinting)
                return mainUIElement;
            else
                return ConstructElements4Printing(offset, mainUIElement);
        }

        protected abstract InlineObjectElement ConstructMainElement(int offset);

        private InlineObjectElementWithText ConstructElements4Printing(int offset, InlineObjectElement mainUIElement)
        {
            Debug.Assert(mainUIElement != null);

            InlineObjectElementWithText inlineObject = new InlineObjectElementWithText(mainUIElement.DocumentLength, mainUIElement.Element);

            var line = Document.GetLineByOffset(offset);
            inlineObject.LeadingText = GetLeadingText(Document, line, offset);
            inlineObject.TrailingText = GetTrailingText(Document, line, offset, mainUIElement.DocumentLength);

            return inlineObject;
        }

        private string GetLeadingText(IDocument document, IDocumentLine line, int visualLineElementOffset)
        {
            int leadingTextLen = visualLineElementOffset - line.Offset;
            if (leadingTextLen > 0)
            {
                string leadingText = document.GetText(line.Offset, leadingTextLen);
                return leadingText;
            }

            return null;
        }

        private string GetTrailingText(IDocument document, IDocumentLine line, int visualLineElementOffset, int documentLength)
        {
            int leadingTextLen = visualLineElementOffset - line.Offset;
            int trailingTextLen = line.Length - leadingTextLen - documentLength;
            if (trailingTextLen > 0)
            {
                string trailingText = document.GetText(visualLineElementOffset + documentLength, trailingTextLen);
                return trailingText;
            }

            return null;
        }
    }
}


text:
using System;

namespace WildFarm
{
    public class Tiger : Felime
    {
        public Tiger(string animalName, string animalType, double animalWeight, string livingR) : base(animalName, animalType, animalWeight, livingR)
        {
            this.FoodEaten = 0;
        }

        public override void eat(Food food)
        {
            if (food.GetType().Name != "Meat") throw new ArgumentException("Tigers are not eating that type of food!");

            this.FoodEaten = food.Quantity;
        }

        public override void makeSound()
        {
            Console.WriteLine("ROAAR!!!");
        }
    }
}


text:
NixFont.directive('toolbar', function ($rootScope, FontService) {
  'use strict';

  var remote = require('electron').remote;

  return {
    replace: true,
    templateUrl: './feapp/shared/toolbar/toolbar.html',
    link: function (scope, element, attrs) {
      var browserWindow = remote.getCurrentWindow();

      scope.search = function () {
        $rootScope.$emit('search', FontService.search(scope.query));
      };

      scope.close = function () {
        browserWindow.close();
      };

      scope.minimize = function () {
        browserWindow.minimize();
      };
    }
  }
});


text:
Логин

<?php
use yii\helpers\Url;
use yii\widgets\ActiveForm;

$this->title = 'Авторизация';
$this->params['breadcrumbs'][] = $this->title;
?>

<?php $form = ActiveForm::begin();  ?>

<?= $form->field($login_model,'login')->textInput()->label('Логин') ?>

<?= $form->field($login_model,'password')->passwordInput()->label('Пароль') ?>

    <button class="btn btn-success" type="submit">Войти</button>

<a class="btn btn-default" href="<?php echo Url::to(['account/signup']);  ?>">Регистрация

<?php  $form = ActiveForm::end(); ?>


text:
// Copyright (C) 2008 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.sshd.commands;

import static com.google.gerrit.sshd.CommandMetaData.Mode.MASTER_OR_SLAVE;

import com.google.common.cache.Cache;
import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.extensions.annotations.RequiresCapability;
import com.google.gerrit.extensions.registration.DynamicMap;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.sshd.BaseCommand;
import com.google.gerrit.sshd.CommandMetaData;
import com.google.inject.Inject;

import org.kohsuke.args4j.Option;

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

/** Causes the caches to purge all entries and reload. */
@RequiresCapability(GlobalCapability.FLUSH_CACHES)
@CommandMetaData(name = "flush-caches", description = "Flush some/all server caches from memory",
  runsAt = MASTER_OR_SLAVE)
final class FlushCaches extends CacheCommand {
  private static final String WEB_SESSIONS = "web_sessions";

  @Option(name = "--cache", usage = "flush named cache", metaVar = "NAME")
  private List<String> caches = new ArrayList<String>();

  @Option(name = "--all", usage = "flush all caches")
  private boolean all;

  @Option(name = "--list", usage = "list available caches")
  private boolean list;

  @Inject
  IdentifiedUser currentUser;

  @Override
  protected void run() throws Failure {
    if (caches.contains(WEB_SESSIONS)
        && !currentUser.getCapabilities().canAdministrateServer()) {
      String msg = String.format(
          "fatal: only site administrators can flush %s",
          WEB_SESSIONS);
      throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg);
    }

    if (list) {
      if (all || caches.size() > 0) {
        throw error("error: cannot use --list with --all or --cache");
      }
      doList();
      return;
    }

    if (all && caches.size() > 0) {
      throw error("error: cannot combine --all and --cache");
    } else if (!all && caches.size() == 1 && caches.contains("all")) {
      caches.clear();
      all = true;
    } else if (!all && caches.isEmpty()) {
      all = true;
    }

    final SortedSet<String> names = cacheNames();
    for (final String n : caches) {
      if (!names.contains(n)) {
        throw error("error: cache \"" + n + "\" not recognized");
      }
    }
    doBulkFlush();
  }

  private static UnloggedFailure error(final String msg) {
    return new UnloggedFailure(1, msg);
  }

  private void doList() {
    for (final String name : cacheNames()) {
      stderr.print(name);
      stderr.print('\n');
    }
    stderr.flush();
  }

  private void doBulkFlush() {
    try {
      for (DynamicMap.Entry<Cache<?, ?>> e : cacheMap) {
        String n = cacheNameOf(e.getPluginName(), e.getExportName());
        if (flush(n)) {
          try {
            e.getProvider().get().invalidateAll();
          } catch (Throwable err) {
            stderr.println("error: cannot flush cache \"" + n + "\": " + err);
          }
        }
      }
    } finally {
      stderr.flush();
    }
  }

  private boolean flush(final String cacheName) {
    if (caches.contains(cacheName)) {
      return true;

    } else if (all) {
      if (WEB_SESSIONS.equals(cacheName)) {
        return false;
      }
      return true;

    } else {
      return false;
    }
  }
}


text:
"""
This module implements the central application object.
"""
import asyncio
import ssl
from time import gmtime, strftime

from aiorest_ws.__init__ import __version__
from aiorest_ws.request import RequestHandlerFactory, RequestHandlerProtocol
from aiorest_ws.validators import check_and_set_subclass
from aiorest_ws.utils.websocket import deflate_offer_accept as accept
from aiorest_ws.urls.base import set_urlconf

__all__ = ('Application', )

class Application(object):
    """
    Main application of aiorest-ws framework.
    """

    _factory = RequestHandlerFactory
    _protocol = RequestHandlerProtocol
    _certificate = None
    _key = None
    _middlewares = []

    def __init__(self, *args, **options):
        """
        Initialization of Application instance.
        """
        super(Application, self).__init__()
        self.factory = options.get('factory')
        self.protocol = options.get('protocol')
        self.certificate = options.get('certificate')
        self.key = options.get('key')

        middleware_classes = options.get('middlewares', ())
        for middleware in middleware_classes:
            self._middlewares.append(middleware())

    @property
    def factory(self):
        """
        Get factory class.
        """
        return self._factory

    @factory.setter
    def factory(self, factory):
        """
        Set factory class.

        :param factory: subclass of RequestHandlerFactory.
        """
        if factory:
            check_and_set_subclass(self, '_factory', factory,
                                   RequestHandlerFactory)

    @property
    def middlewares(self):
        """
        Get list of used middlewares.
        """
        return self._middlewares

    @property
    def protocol(self):
        """
        Get protocol class.
        """
        return self._protocol

    @protocol.setter
    def protocol(self, protocol):
        """
        Set protocol class.

        :param factory: subclass of RequestHandlerProtocol.
        """
        if protocol:
            check_and_set_subclass(self, '_protocol', protocol,
                                   RequestHandlerProtocol)

    @property
    def certificate(self):
        """
        Get filepath to certificate.
        """
        return self._certificate

    @certificate.setter
    def certificate(self, certificate):
        """
        Setter for certificate.

        :param certificate: path to certificate file.
        """
        self._certificate = certificate

    @property
    def key(self):
        """
        Get private key for certificate.
        """
        return self._key

    @key.setter
    def key(self, key):
        """
        Set private key for certificate.

        :param key: private key for certificate.
        """
        self._key = key

    @property
    def url(self):
        """
        Get url to WebSocket REST API.
        """
        return "wss://{0}:{1}/{2}" if self.isSecure else "ws://{0}:{1}/{2}"

    @property
    def isSecure(self):
        """
        Property, which help us to understand, use SSL or not.
        """
        return self.certificate and self.key

    def _get_ssl_context(self):
        """
        Generating SSL context for asyncio loop.
        """
        if self.isSecure:
            ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
            ssl_context.load_cert_chain(self.certificate, self.key)
        else:
            ssl_context = None
        return ssl_context

    def _init_factory(self, url, **options):
        """
        Create a factory instance.
        """
        log_level = options.get('log_level', 'info')
        factory = self.factory(url)
        factory.protocol = self.protocol
        factory.log._set_log_level(log_level)
        return factory

    def _enable_compressing(self, factory, **options):
        """
        Set compression message for factory, if defined.
        """
        compress = options.get('compress', False)
        accept_function = options.get('accept_function', accept)
        protocol_options = {"perMessageCompressionAccept": accept_function}

        if compress:
            factory.setProtocolOptions(**protocol_options)

    def _set_factory_router(self, factory, **options):
        """
        Set users router for factory, if defined.
        """
        router = options.get('router', None)
        assert router, "Argument `router` must be defined for the Application."

        factory.router = router
        factory.router._middlewares = self.middlewares

    def _init_urlconf(self, factory, url, **options):
        """
        Initialize urlconf thread variable.
        """
        data = {
            'path': url.strip('/'),
            'urls': factory.router._urls,
            'routes': factory.router._routes
        }
        set_urlconf(data)

    def generate_factory(self, url, **options):
        """
        Create and initialize factory instance.
        """
        factory = self._init_factory(url, **options)
        self._enable_compressing(factory, **options)
        self._set_factory_router(factory, **options)
        self._init_urlconf(factory, url, **options)
        return factory

    def generate_url(self, host, port, path=''):
        """
        Generate URL to application.
        """
        return self.url.format(host, port, path)

    def run(self, **options):
        """
        Create and start web server with some IP and PORT.

        :param options: parameters, which can be used for configuration
                        of the Application.
        """
        host = options.get('host', '127.0.0.1')
        port = options.get('port', 8080)
        path = options.get('path', '')
        url = self.generate_url(host, port, path)

        factory = self.generate_factory(url, **options)
        ssl_context = self._get_ssl_context()

        loop = asyncio.get_event_loop()
        server_coroutine = loop.create_server(
            factory, host, port, ssl=ssl_context
        )
        server = loop.run_until_complete(server_coroutine)

        print(strftime("%d %b, %Y - %X", gmtime()))
        print("aiorest-ws version {0}".format(__version__))
        print("Server started at {0}".format(url))
        print("Quit the server with CONTROL-C.")

        try:
            loop.run_forever()
        except KeyboardInterrupt:
            pass
        finally:
            server.close()
            loop.close()


text:
About The Floating IPs Extension
================================
The Floating IPs extension enables assigning and allocation of floating IP addresses to instances running in an OpenStack cloud. It is used with the OpenStack Compute 1.1 API to add or remove floating IP addresses on named instances.

To obtain current information the extensions available to you, issue an EXTENSION query on the OpenStack system where it is installed, such as http://mycloud.com/v1.1/tenant/extension.

Floating IPs Extension Overview
-------------------------------

Name
	Floating IPs

Namespace
	http://docs.openstack.org/ext/floating_ips/api/v1.1

Alias
	OPS-FLO

Contact
	Anthony Young <sleepsonthefloor@gmail.com>

Status
	Alpha

Extension Version
	v1.0 (2011-09-14)

Dependencies
	Compute API 1.1

Doc Link (PDF)
	http://

Doc Link (WADL)
	http://

Short Description
	This extension enables assigning floating IP addresses to instances.

Sample Query Responses
----------------------

As shown below, responses to an EXTENSION query in XML or JSON provide basic information about the extension.

Extension Query Response: XML::

	None

Extension Query Response: JSON::

	{"extensions":
	[{"updated": "2011-06-16T00:00:00+00:00",
	"name": "Floating_ips",
	"links": [],
	"namespace": "http://docs.openstack.org/ext/floating_ips/api/v1.1",
	"alias": "os-floating-ips",
	"description": "Floating IPs support"}]}

Document Change History
-----------------------

============= =====================================
Revision Date Summary of Changes
2011-09-14    Initial draft
============= =====================================

Summary of Changes
==================
This extension to the Compute API enables support for floating IP addresses.

To support these new actions, the extension also issues new (faults, headers, resources, states, you name it.)

New Action
----------
This extension uses POST to add or remove floating IP addresses to instances.

Normal Response Code: 202

addFloatingIp

removeFloatingIp

Include the response codes, transitions if applicable, and XML and JSON examples.

New Faults
----------
None

New Headers
-----------
None

New Resources
-------------
This extension provides an os-floating-ips resource extension to do the following:

List a tenant's floating ips::

	GET /v1.1/tenant_id/os-floating-ips/

    # Sample Response:
    { "floating_ips" : [ { "fixed_ip" : "10.0.0.3",
            "id" : 1,
            "instance_id" : 1,
            "ip" : "10.6.0.0"
          },
          { "fixed_ip" : null,
            "id" : 2,
            "instance_id" : null,
            "ip" : "10.6.0.1"
          }
        ] }

    Normal Response Code: 200

Allocate a floating ip to a tenant::

	POST /v1.1/tenant_id/os-floating-ips/

    # Sample Response:
    { "floating_ip" : { "fixed_ip" : "10.0.0.3",
            "id" : 1,
            "instance_id" : 1,
            "ip" : "10.6.0.0"
        }}

    If there are no floating ips available, 400 will be returned, with a
    message indicating that no more floating ips are available

De-allocate a floating ip from a tenant::

	DELETE /v1.1/tenant_id/os-floating-ips/id

    Normal Response Code: 202

Show a floating ip::

	GET /v1.1/tenant_id/os-floating-ips/id

    # Sample Response:
    { "floating_ip" : { "fixed_ip" : "10.0.0.3",
            "id" : 1,
            "instance_id" : 1,
            "ip" : "10.6.0.0"
        }}

    Normal Response Code: 200

New States
----------
None

Changes to the Cloud Servers Specification
------------------------------------------

List the specific changes to the API. For example:

In the List Addresses section of the Cloud Servers Specification: Examples 4.21 and 4.22 should be replaced with examples below.

Provide examples in XML and JSON


text:
package com.netflix.servo.jmx;

import com.netflix.servo.MonitorRegistry;
import com.netflix.servo.monitor.Monitor;
import com.netflix.servo.monitor.MonitorConfig;
import com.netflix.servo.util.UnmodifiableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.management.DynamicMBean;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;

/**
 * Monitor registry backed by JMX. The monitor annotations on registered
 * objects will be used to export the data to JMX. For details about the
 * representation in JMX see {@link MonitorMBean}. The {@link ObjectName}
 * used for each monitor depends on the implementation of {@link ObjectNameMapper}
 * that is specified for the registry. See {@link ObjectNameMapper#DEFAULT} for
 * the default naming implementation.
 */
public final class JmxMonitorRegistry implements MonitorRegistry {

  private static final Logger LOG = LoggerFactory.getLogger(JmxMonitorRegistry.class);

  private final MBeanServer mBeanServer;
  private final ConcurrentMap<MonitorConfig, Monitor<?>> monitors;
  private final String name;
  private final ObjectNameMapper mapper;
  private final ConcurrentMap<ObjectName, Object> locks = new ConcurrentHashMap<>();

  private final AtomicBoolean updatePending = new AtomicBoolean(false);
  private final AtomicReference<Collection<Monitor<?>>> monitorList =
      new AtomicReference<>(UnmodifiableList.<Monitor<?>>of());

  /**
   * Creates a new instance that registers metrics with the local mbean
   * server using the default ObjectNameMapper {@link ObjectNameMapper#DEFAULT}.
   *
   * @param name the registry name
   */
  public JmxMonitorRegistry(String name) {
    this(name, ObjectNameMapper.DEFAULT);
  }

  /**
   * Creates a new instance that registers metrics with the local mbean
   * server using the ObjectNameMapper provided.
   *
   * @param name   the registry name
   * @param mapper the monitor to object name mapper
   */
  public JmxMonitorRegistry(String name, ObjectNameMapper mapper) {
    this.name = name;
    this.mapper = mapper;
    mBeanServer = ManagementFactory.getPlatformMBeanServer();
    monitors = new ConcurrentHashMap<>();
  }

  private void register(ObjectName objectName, DynamicMBean mbean) throws Exception {
    synchronized (getLock(objectName)) {
      if (mBeanServer.isRegistered(objectName)) {
        mBeanServer.unregisterMBean(objectName);
      }
      mBeanServer.registerMBean(mbean, objectName);
    }
  }

  /**
   * The set of registered Monitor objects.
   */
  @Override
  public Collection<Monitor<?>> getRegisteredMonitors() {
    if (updatePending.getAndSet(false)) {
      monitorList.set(UnmodifiableList.copyOf(monitors.values()));
    }
    return monitorList.get();
  }

  /**
   * Register a new monitor in the registry.
   */
  @Override
  public void register(Monitor<?> monitor) {
    try {
      List<MonitorMBean> beans = MonitorMBean.createMBeans(name, monitor, mapper);
      for (MonitorMBean bean : beans) {
        register(bean.getObjectName(), bean);
      }
      monitors.put(monitor.getConfig(), monitor);
      updatePending.set(true);
    } catch (Exception e) {
      LOG.warn("Unable to register Monitor:" + monitor.getConfig(), e);
    }
  }

  /**
   * Unregister a Monitor from the registry.
   */
  @Override
  public void unregister(Monitor<?> monitor) {
    try {
      List<MonitorMBean> beans = MonitorMBean.createMBeans(name, monitor, mapper);
      for (MonitorMBean bean : beans) {
        try {
          mBeanServer.unregisterMBean(bean.getObjectName());
          locks.remove(bean.getObjectName());
        } catch (InstanceNotFoundException ignored) {
          // ignore errors attempting to unregister a non-registered monitor
          // a common error is to unregister twice
        }
      }
      monitors.remove(monitor.getConfig());
      updatePending.set(true);
    } catch (Exception e) {
      LOG.warn("Unable to un-register Monitor:" + monitor.getConfig(), e);
    }
  }

  @Override
  public boolean isRegistered(Monitor<?> monitor) {
    try {
      List<MonitorMBean> beans = MonitorMBean.createMBeans(name, monitor, mapper);
      for (MonitorMBean bean : beans) {
        if (mBeanServer.isRegistered(bean.getObjectName())) {
          return true;
        }
      }
    } catch (Exception e) {
      return false;
    }
    return false;
  }

  private Object getLock(ObjectName objectName) {
    return locks.computeIfAbsent(objectName, k -> new Object());
  }
}


text:
define('ember', [], function() {
  return {
    default: Ember
  };
});


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

Tests that shadow roots are displayed correctly in breadcrumbs.

<input type="text">

<template id="tmpl">

inner

</template>


text:
package info.jdavid.ok.server.handler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.annotation.Nullable;

import info.jdavid.ok.server.Response;
import okhttp3.HttpUrl;

/**
 * Handler that accepts request based on the request method and a regular expression for the request url path.
 * The regex captured groups are passed as parameters to the handle method.
 */
@SuppressWarnings({ "WeakerAccess", "unused" })
public abstract class RegexHandler implements Handler {

  final Pattern pattern;
  final List<String> methods;

  /**
   * Creates an handler that will accept a request with the specified methods,
   * whose path matches the specified regular expression.
   * @param methods the request methods.
   * @param regex the regular expression.
   */
  protected RegexHandler(final Collection<String> methods, final String regex) {
    if (methods.isEmpty()) {
      throw new NullPointerException("The accepted request method cannot be null.");
    }
    final List<String> list = this.methods = new ArrayList<>(methods.size());
    for (final String method: methods) {
      list.add(method.toUpperCase());
    }
    pattern = Pattern.compile(regex);
  }

  /**
   * Creates an handler that will accept a request with the specified method, whose path matches the specified
   * regular expression.
   * @param method the request method.
   * @param regex the regular expression.
   */
  protected RegexHandler(final String method, final String regex) {
    methods = Collections.singletonList(method.toUpperCase());
    pattern = Pattern.compile(regex);
  }

  @Override public Handler setup() { return this; }

  @Override
  public @Nullable String[] matches(final String method, final HttpUrl url) {
    if (methods.contains(method)) {
      final String encodedPath = url.encodedPath();
      final Matcher matcher = pattern.matcher(url.encodedPath());
      if (matcher.find()) {
        if (matcher.start() > 0) return null;
        if (matcher.end() < encodedPath.length()) return null;
        final int n = matcher.groupCount();
        final String[] params = new String[n];
        for (int i=0; i<n; ++i) {
          params[i] = matcher.group(i + 1);
        }
        return params;
      }
    }
    return null;
  }

  /**
   * Adds a check on the request methods and path to the specified handler.
   * @param methods the accepted methods.
   * @param regex the regular expression that the the url path should match.
   * @param delegate the delegate handler.
   * @return the handler with the additional requirements.
   */
  public static Handler create(final Collection<String> methods, final String regex, final Handler delegate) {
    return new RegexHandlerWrapper(methods, regex, delegate);
  }

  /**
   * Adds a check on the request method and path to the specified handler.
   * @param method the accepted method.
   * @param regex the regular expression that the the url path should match.
   * @param delegate the delegate handler.
   * @return the handler with the additional requirements.
   */
  public static Handler create(final String method, final String regex, final Handler delegate) {
    //noinspection Duplicates
    return new RegexHandlerWrapper(method, regex, delegate);
  }

  static class RegexHandlerWrapper extends RegexHandler {

    final Handler delegate;

    protected RegexHandlerWrapper(final Collection<String> methods, final String regex, final Handler delegate) {
      super(methods, regex);
      this.delegate = delegate;
    }

    protected RegexHandlerWrapper(final String method, final String regex, final Handler delegate) {
      super(method, regex);
      this.delegate = delegate;
    }

    @Override public Handler setup() {
      delegate.setup();
      return this;
    }

    @Override public String[] matches(final String method, final HttpUrl url) {
      return super.matches(method, url) == null ? null : delegate.matches(method, url);
    }

    @Override public Response.Builder handle(final Request request, final String[] params) {
      return delegate.handle(request, params);
    }

  }

}