text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /home/gerard/sites/modules.w.doctrine/modules.zendframework.com/vendor/doctrine/doctrine-orm-module/src/DoctrineORMModule/Options/DBALConnection.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

/home/gerard/sites/modules.w.doctrine/modules.zendframework.com /

vendor /

doctrine /

doctrine-orm-module /

src /

DoctrineORMModule /

Options /

DBALConnection.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

0.00%

0 / 1

71.43%

10 / 14

      CRAP

61.90%

13 / 21

      DBALConnection

0.00%

0 / 1

71.43%

10 / 14

      24.84

61.90%

13 / 21

       setConfiguration($configuration)

100.00%

1 / 1

      1

100.00%

2 / 2

       getConfiguration()

100.00%

1 / 1

      1

100.00%

1 / 1

       setEventmanager($eventmanager)

100.00%

1 / 1

      1

100.00%

2 / 2

       getEventmanager()

100.00%

1 / 1

      1

100.00%

1 / 1

       setParams($params)

100.00%

1 / 1

      1

100.00%

2 / 2

       getParams()

100.00%

1 / 1

      1

100.00%

1 / 1

       setDoctrineTypeMappings($doctrineTypeMappings)

0.00%

0 / 1

      2

0.00%

0 / 2

       getDoctrineTypeMappings()

100.00%

1 / 1

      1

100.00%

1 / 1

       setDriverClass($driverClass)

0.00%

0 / 1

      2

0.00%

0 / 2

       getDriverClass()

100.00%

1 / 1

      1

100.00%

1 / 1

       setPdo($pdo)

0.00%

0 / 1

      2

0.00%

0 / 2

       getPdo()

100.00%

1 / 1

      1

100.00%

1 / 1

       setWrapperClass($wrapperClass)

0.00%

0 / 1

      2

0.00%

0 / 2

       getWrapperClass()

100.00%

1 / 1

      1

100.00%

1 / 1

1
	<?php

2

19

20
	namespace DoctrineORMModule\Options;

21

22
	use Zend\Stdlib\AbstractOptions;

23

24
	/**

25
	 * DBAL Connection options

26
	 *

27
	 * @license MIT

28
	 * @link    http://www.doctrine-project.org/

29
	 * @author  Kyle Spraggs <theman@spiffyjr.me>

30
	 */

31
	class DBALConnection extends AbstractOptions

32
	{

33
	    /**

34
	     * Set the configuration key for the Configuration. Configuration key

35
	     * is assembled as "doctrine.configuration.{key}" and pulled from

36
	     * service locator.

37
	     *

38
	     * @var string

39
	     */

40
	    protected $configuration = 'orm_default';

41

42
	    /**

43
	     * Set the eventmanager key for the EventManager. EventManager key

44
	     * is assembled as "doctrine.eventmanager.{key}" and pulled from

45
	     * service locator.

46
	     *

47
	     * @var string

48
	     */

49
	    protected $eventmanager = 'orm_default';

50

51
	    /**

52
	     * Set the PDO instance, if any, to use. If a string is set

53
	     * then the alias is pulled from the service locator.

54
	     *

55
	     * @var null|string|\PDO

56
	     */

57
	    protected $pdo = null;

58

59
	    /**

60
	     * Setting the driver is deprecated. You should set the

61
	     * driver class directly instead.

62
	     *

63
	     * @var string

64
	     */

65
	    protected $driverClass = 'Doctrine\DBAL\Driver\PDOMySql\Driver';

66

67
	    /**

68
	     * Set the wrapper class for the driver. In general, this shouldn't

69
	     * need to be changed.

70
	     *

71
	     * @var string|null

72
	     */

73
	    protected $wrapperClass = null;

74

75
	    /**

76
	     * Driver specific connection parameters.

77
	     *

78
	     * @var array

79
	     */

80
	    protected $params = array();

81

82
	    /**

83
	     * @var array

84
	     */

85
	    protected $doctrineTypeMappings = array();

86

87
	    /**

88
	     * @param string $configuration

89
	     */

90
	    public function setConfiguration($configuration)

91
	    {

     <tr class="success popin" data-title="6 tests cover line 92" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
92
	        $this->configuration = $configuration;

     <tr class="success popin" data-title="6 tests cover line 93" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
93
	    }

94

95
	    /**

96
	     * @return string

97
	     */

98
	    public function getConfiguration()

99
	    {

     <tr class="success popin" data-title="6 tests cover line 100" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
100
	        return "doctrine.configuration.{$this->configuration}";

101
	    }

102

103
	    /**

104
	     * @param string $eventmanager

105
	     */

106
	    public function setEventmanager($eventmanager)

107
	    {

     <tr class="success popin" data-title="6 tests cover line 108" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
108
	        $this->eventmanager = $eventmanager;

     <tr class="success popin" data-title="6 tests cover line 109" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
109
	    }

110

111
	    /**

112
	     * @return string

113
	     */

114
	    public function getEventmanager()

115
	    {

     <tr class="success popin" data-title="6 tests cover line 116" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
116
	        return "doctrine.eventmanager.{$this->eventmanager}";

117
	    }

118

119
	    /**

120
	     * @param array $params

121
	     */

122
	    public function setParams($params)

123
	    {

     <tr class="success popin" data-title="6 tests cover line 124" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
124
	        $this->params = $params;

     <tr class="success popin" data-title="6 tests cover line 125" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
125
	    }

126

127
	    /**

128
	     * @return array

129
	     */

130
	    public function getParams()

131
	    {

     <tr class="success popin" data-title="6 tests cover line 132" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
132
	        return $this->params;

133
	    }

134

135
	    /**

136
	     * @param  array                                     $doctrineTypeMappings

137
	     * @return \DoctrineORMModule\Options\DBALConnection

138
	     */

139
	    public function setDoctrineTypeMappings($doctrineTypeMappings)

140
	    {

141
	        $this->doctrineTypeMappings = (array) $doctrineTypeMappings;

142

143
	        return $this;

144
	    }

145

146
	    /**

147
	     *

148
	     * @return array

149
	     */

150
	    public function getDoctrineTypeMappings()

151
	    {

     <tr class="success popin" data-title="6 tests cover line 152" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
152
	        return $this->doctrineTypeMappings;

153
	    }

154

155
	    /**

156
	     * @param null|string $driverClass

157
	     */

158
	    public function setDriverClass($driverClass)

159
	    {

160
	        $this->driverClass = $driverClass;

161
	    }

162

163
	    /**

164
	     * @return null|string

165
	     */

166
	    public function getDriverClass()

167
	    {

     <tr class="success popin" data-title="6 tests cover line 168" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
168
	        return $this->driverClass;

169
	    }

170

171
	    /**

172
	     * @param null|\PDO|string $pdo

173
	     */

174
	    public function setPdo($pdo)

175
	    {

176
	        $this->pdo = $pdo;

177
	    }

178

179
	    /**

180
	     * @return null|\PDO|string

181
	     */

182
	    public function getPdo()

183
	    {

     <tr class="success popin" data-title="6 tests cover line 184" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
184
	        return $this->pdo;

185
	    }

186

187
	    /**

188
	     * @param string $wrapperClass

189
	     */

190
	    public function setWrapperClass($wrapperClass)

191
	    {

192
	        $this->wrapperClass = $wrapperClass;

193
	    }

194

195
	    /**

196
	     * @return string

197
	     */

198
	    public function getWrapperClass()

199
	    {

     <tr class="success popin" data-title="6 tests cover line 200" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="success">ExampleTest::testExample</li><li class="success">UserTest::testExample</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
200
	        return $this->wrapperClass;

201
	    }

202
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 1.2.13 using PHP 5.3.10-1ubuntu3.8 and PHPUnit 3.7.27 at Sat Oct 12 3:31:18 CEST 2013.


text:
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()

from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
from object_detection.protos import ssd_anchor_generator_pb2 as object__detection_dot_protos_dot_ssd__anchor__generator__pb2

DESCRIPTOR = _descriptor.FileDescriptor(
  name='object_detection/protos/anchor_generator.proto',
  package='object_detection.protos',
  syntax='proto2',
  serialized_pb=_b('\n.object_detection/protos/anchor_generator.proto\x12\x17object_detection.protos\x1a\x33object_detection/protos/grid_anchor_generator.proto\x1a\x32object_detection/protos/ssd_anchor_generator.proto\"\xc7\x01\n\x0f\x41nchorGenerator\x12M\n\x15grid_anchor_generator\x18\x01 \x01(\x0b\x32,.object_detection.protos.GridAnchorGeneratorH\x00\x12K\n\x14ssd_anchor_generator\x18\x02 \x01(\x0b\x32+.object_detection.protos.SsdAnchorGeneratorH\x00\x42\x18\n\x16\x61nchor_generator_oneof')
  ,
  dependencies=[object__detection_dot_protos_dot_grid__anchor__generator__pb2.DESCRIPTOR,object__detection_dot_protos_dot_ssd__anchor__generator__pb2.DESCRIPTOR,])

_ANCHORGENERATOR = _descriptor.Descriptor(
  name='AnchorGenerator',
  full_name='object_detection.protos.AnchorGenerator',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='grid_anchor_generator', full_name='object_detection.protos.AnchorGenerator.grid_anchor_generator', index=0,
      number=1, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='ssd_anchor_generator', full_name='object_detection.protos.AnchorGenerator.ssd_anchor_generator', index=1,
      number=2, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto2',
  extension_ranges=[],
  oneofs=[
    _descriptor.OneofDescriptor(
      name='anchor_generator_oneof', full_name='object_detection.protos.AnchorGenerator.anchor_generator_oneof',
      index=0, containing_type=None, fields=[]),
  ],
  serialized_start=181,
  serialized_end=380,
)

_ANCHORGENERATOR.fields_by_name['grid_anchor_generator'].message_type = object__detection_dot_protos_dot_grid__anchor__generator__pb2._GRIDANCHORGENERATOR
_ANCHORGENERATOR.fields_by_name['ssd_anchor_generator'].message_type = object__detection_dot_protos_dot_ssd__anchor__generator__pb2._SSDANCHORGENERATOR
_ANCHORGENERATOR.oneofs_by_name['anchor_generator_oneof'].fields.append(
  _ANCHORGENERATOR.fields_by_name['grid_anchor_generator'])
_ANCHORGENERATOR.fields_by_name['grid_anchor_generator'].containing_oneof = _ANCHORGENERATOR.oneofs_by_name['anchor_generator_oneof']
_ANCHORGENERATOR.oneofs_by_name['anchor_generator_oneof'].fields.append(
  _ANCHORGENERATOR.fields_by_name['ssd_anchor_generator'])
_ANCHORGENERATOR.fields_by_name['ssd_anchor_generator'].containing_oneof = _ANCHORGENERATOR.oneofs_by_name['anchor_generator_oneof']
DESCRIPTOR.message_types_by_name['AnchorGenerator'] = _ANCHORGENERATOR
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

AnchorGenerator = _reflection.GeneratedProtocolMessageType('AnchorGenerator', (_message.Message,), dict(
  DESCRIPTOR = _ANCHORGENERATOR,
  __module__ = 'object_detection.protos.anchor_generator_pb2'
  # @@protoc_insertion_point(class_scope:object_detection.protos.AnchorGenerator)
  ))
_sym_db.RegisterMessage(AnchorGenerator)

# @@protoc_insertion_point(module_scope)

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Storage.Models
{
    public partial class SkuInformation
    {
        internal static SkuInformation DeserializeSkuInformation(JsonElement element)
        {
            SkuName name = default;
            SkuTier? tier = default;
            string resourceType = default;
            Kind? kind = default;
            IReadOnlyList<string> locations = default;
            IReadOnlyList<SKUCapability> capabilities = default;
            IReadOnlyList<Restriction> restrictions = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = new SkuName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("tier"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    tier = property.Value.GetString().ToSkuTier();
                    continue;
                }
                if (property.NameEquals("resourceType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    resourceType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    kind = new Kind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("locations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List<string> array = new List<string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(item.GetString());
                        }
                    }
                    locations = array;
                    continue;
                }
                if (property.NameEquals("capabilities"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List<SKUCapability> array = new List<SKUCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(SKUCapability.DeserializeSKUCapability(item));
                        }
                    }
                    capabilities = array;
                    continue;
                }
                if (property.NameEquals("restrictions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List<Restriction> array = new List<Restriction>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(Restriction.DeserializeRestriction(item));
                        }
                    }
                    restrictions = array;
                    continue;
                }
            }
            return new SkuInformation(name, tier, resourceType, kind, locations, capabilities, restrictions);
        }
    }
}


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var core_1 = require('@angular/core');
var nested_option_1 = require('../../core/nested-option');
var nested_option_2 = require('../../core/nested-option');
var DxoHeightComponent = (function (_super) {
    __extends(DxoHeightComponent, _super);
    function DxoHeightComponent(parentOptionHost, optionHost) {
        _super.call(this);
        parentOptionHost.setNestedOption(this);
        optionHost.setHost(this, this._fullOptionPath.bind(this));
    }
    Object.defineProperty(DxoHeightComponent.prototype, "rangeMaxPoint", {
        get: function () {
            return this._getOption('rangeMaxPoint');
        },
        set: function (value) {
            this._setOption('rangeMaxPoint', value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DxoHeightComponent.prototype, "rangeMinPoint", {
        get: function () {
            return this._getOption('rangeMinPoint');
        },
        set: function (value) {
            this._setOption('rangeMinPoint', value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DxoHeightComponent.prototype, "_optionPath", {
        get: function () {
            return 'height';
        },
        enumerable: true,
        configurable: true
    });
    DxoHeightComponent.decorators = [
        { type: core_1.Component, args: [{
                    selector: 'dxo-height',
                    template: '',
                    styles: [''],
                    providers: [nested_option_1.NestedOptionHost]
                },] },
    ];
    DxoHeightComponent.ctorParameters = function () { return [
        { type: nested_option_1.NestedOptionHost, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host },] },
        { type: nested_option_1.NestedOptionHost, decorators: [{ type: core_1.Host },] },
    ]; };
    DxoHeightComponent.propDecorators = {
        'rangeMaxPoint': [{ type: core_1.Input },],
        'rangeMinPoint': [{ type: core_1.Input },],
    };
    return DxoHeightComponent;
}(nested_option_2.NestedOption));
exports.DxoHeightComponent = DxoHeightComponent;
var DxoHeightModule = (function () {
    function DxoHeightModule() {
    }
    DxoHeightModule.decorators = [
        { type: core_1.NgModule, args: [{
                    declarations: [
                        DxoHeightComponent
                    ],
                    exports: [
                        DxoHeightComponent
                    ],
                },] },
    ];
    DxoHeightModule.ctorParameters = function () { return []; };
    return DxoHeightModule;
}());
exports.DxoHeightModule = DxoHeightModule;
//# sourceMappingURL=height.js.map


text:
package com.wantedtech.common.xpresso.web.service;

import java.util.*;

/**
 * HttpContext represents a mapping between the root URI path of an application
 * to a {@link HttpHandler} which is invoked to handle requests destined
 * for that path on the associated HttpServer or HttpsServer.
 *

 * HttpContext instances are created by the create methods in HttpServer
 * and HttpsServer
 *

 * A chain of {@link Filter} objects can be added to a HttpContext. All exchanges processed by the
 * context can be pre- and post-processed by each Filter in the chain.
 * @since 1.6
 */
public abstract class HttpContext {

    protected HttpContext () {
    }

    /**
     * returns the handler for this context
     * @return the HttpHandler for this context
     */
    public abstract HttpHandler getHandler () ;

    /**
     * Sets the handler for this context, if not already set.
     * @param h the handler to set for this context
     * @throws IllegalArgumentException if this context's handler is already set.
     * @throws NullPointerException if handler is null
     */
    public abstract void setHandler (HttpHandler h) ;

    /**
     * returns the path this context was created with
     * @return this context's path
     */
    public abstract String getPath() ;

    /**
     * returns the server this context was created with
     * @return this context's server
     */
    public abstract HttpServer getServer () ;

    /**
     * returns a mutable Map, which can be used to pass
     * configuration and other data to Filter modules
     * and to the context's exchange handler.
     *

     * Every attribute stored in this Map will be visible to
     * every HttpExchange processed by this context
     */
    public abstract Map<String,Object> getAttributes() ;

    /**
     * returns this context's list of Filters. This is the
     * actual list used by the server when dispatching requests
     * so modifications to this list immediately affect the
     * the handling of exchanges.
     */
    public abstract List<Filter> getFilters();

}


text:
struct replicator_queue;

struct notify_connection *
notify_connection_create(int fd, struct replicator_queue *queue);
void notify_connection_ref(struct notify_connection *conn);
void notify_connection_unref(struct notify_connection **conn);

void notify_connections_destroy_all(void);

#endif


text:
ember-rails-template
====================

This template is an interactive configuration for existing rails applications that will help get your application all set up for ember development with [ember-rails](https://github.com/emberjs/ember-rails). The template asks you questions about how you would like your application configured and then configures your application accordingly.

I made this template because I realized that getting a rails project fully configured with ember-rails was not quite as easy as I had hoped. There are more things to do, and this template is the quickest and easiest way to get everything else configured.

Usage
=====

    rake rails:template LOCATION=https://raw2.github.com/mrinterweb/ember-rails-template/master/ember-template.rb

Some of the stuff this template can do (based on your choices):

* install the emberjs.com/edge_template.rb
* clean up your gemfile (goodbye turbolinks)
* install gems
* configuraiton for CoffeeScript or JavaScript
* install bower
* phantomjs
* rspec
* set up ember-rails
* guard
* teaspoon with QUnit (JavaScript testing suite)
* download recent ember libs with the correct version of jquery
* adds a handy generator shortcut
* and more!

If you're starting with a new rails app, I'd recommend starting with this:

    rails new my_project --skip-javascript --skip-test-unit

* Since the JavaScript dependencies are managed for you by the template, you can skip them.
* Skip the test unit only if you plan on not using test unit.

Watch the thrilling screencast!
==============================
[![Youtube ScreenShot](https://img.youtube.com/vi/KaBbGUVQrAw/0.jpg)](https://www.youtube.com/watch?v=KaBbGUVQrAw&feature=youtu.be)

The template no longer requires the highline gem dependency.

Q&A
===

### How does this compare with ember-appkit-rails?

I prefer writing CoffeeScript to JavaScript. Ember AppKit Rails assumes that all the files you will be writing will be js files, and the file extension changes from ".js" to ".es6". There is a keyword conflict between CoffeeScript and ES6 modules "require" & "import". CoffeeScript does not get much love from the ES6 transpiler so I tend to avoid ES6 modules until better CoffeeScript support is added. I understand the need for dependency management, but I don't believe in alienating a large group of users just so ES6 modules can be used. Since the template does not currently help configure any dependency management that remains a responsibility of the user.

Also I do not prefer how Ember AppKit Rails adds ember javascript folders directly into app instead of app/assets/javascripts. This means that your models and controller directories are no longer just for ruby files. I do not find that this plays nicely with existing rails applications and conflicts with rails conventions.

### How do I ask a question about ember-rails-template or request a feature?

Ask me on Twitter [@mrinterweb](https://twitter.com/mrinterweb), or ask me on [reddit](http://www.reddit.com/r/emberjs/comments/1ym4w4/rails_template_that_helps_configure_emberrails/)

Thoughts
========

After getting further into this I started thinking that I should just merge this into ember-rails. It would take a decent amount of refactoring to get this into ember-rails. I also learned a thing or two about rails templates. Writing my own CLI class in place of highline was entertaining.


text:
if (-not $ExecutionContext.SessionState.InvokeCommand.GetCommand('Register-ArgumentCompleter','Function,Cmdlet')) {

    #############################################################################
    #
    # TabExpansionPlusPlus
    #
    #

    <#
Copyright (c) 2013, Jason Shirk
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    #>

    # Save off the previous tab completion so it can be restored if this module
    # is removed.
    $oldTabExpansion = $function:TabExpansion
    $oldTabExpansion2 = $function:TabExpansion2

    [bool]$updatedTypeData = $false

    #region Exported utility functions for completers

    #############################################################################
    #
    # Helper function to create a new completion results
    #
    function New-CompletionResult {
        param ([Parameter(ValueFromPipelineByPropertyName, Mandatory, ValueFromPipeline)]
            [ValidateNotNullOrEmpty()]
            [string]
            $CompletionText,

            [Parameter(Position = 1, ValueFromPipelineByPropertyName)]
            [string]
            $ToolTip,

            [Parameter(Position = 2, ValueFromPipelineByPropertyName)]
            [string]
            $ListItemText,

            [System.Management.Automation.CompletionResultType]
            $CompletionResultType = [System.Management.Automation.CompletionResultType]::ParameterValue,

            [switch]
            $NoQuotes = $false
        )

        process {
            $toolTipToUse = if ($ToolTip -eq '') { $CompletionText }
            else { $ToolTip }
            $listItemToUse = if ($ListItemText -eq '') { $CompletionText }
            else { $ListItemText }

            # If the caller explicitly requests that quotes
            # not be included, via the -NoQuotes parameter,
            # then skip adding quotes.

            if ($CompletionResultType -eq [System.Management.Automation.CompletionResultType]::ParameterValue -and -not $NoQuotes) {
                # Add single quotes for the caller in case they are needed.
                # We use the parser to robustly determine how it will treat
                # the argument.  If we end up with too many tokens, or if
                # the parser found something expandable in the results, we
                # know quotes are needed.

                $tokens = $null
                $null = [System.Management.Automation.Language.Parser]::ParseInput("echo $CompletionText", [ref]$tokens, [ref]$null)
                if ($tokens.Length -ne 3 -or
                    ($tokens[1] -is [System.Management.Automation.Language.StringExpandableToken] -and
                        $tokens[1].Kind -eq [System.Management.Automation.Language.TokenKind]::Generic)) {
                    $CompletionText = "'$CompletionText'"
                }
            }
            return New-Object System.Management.Automation.CompletionResult `
            ($CompletionText, $listItemToUse, $CompletionResultType, $toolTipToUse.Trim())
        }

    }

    #############################################################################
    #
    # .SYNOPSIS
    #
    #     This is a simple wrapper of Get-Command gets commands with a given
    #     parameter ignoring commands that use the parameter name as an alias.
    #
    function Get-CommandWithParameter {
        [CmdletBinding(DefaultParameterSetName = 'AllCommandSet')]
        param (
            [Parameter(ParameterSetName = 'AllCommandSet', ValueFromPipeline, ValueFromPipelineByPropertyName)]
            [ValidateNotNullOrEmpty()]
            [string[]]
            ${Name},

            [Parameter(ParameterSetName = 'CmdletSet', ValueFromPipelineByPropertyName)]
            [string[]]
            ${Verb},

            [Parameter(ParameterSetName = 'CmdletSet', ValueFromPipelineByPropertyName)]
            [string[]]
            ${Noun},

            [Parameter(ValueFromPipelineByPropertyName)]
            [string[]]
            ${Module},

            [ValidateNotNullOrEmpty()]
            [Parameter(Mandatory)]
            [string]
            ${ParameterName})

        begin {
            $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Get-Command', [System.Management.Automation.CommandTypes]::Cmdlet)
            $scriptCmd = { & $wrappedCmd @PSBoundParameters | Where-Object { $_.Parameters[$ParameterName] -ne $null } }
            $steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
            $steppablePipeline.Begin($PSCmdlet)
        }
        process {
            $steppablePipeline.Process($_)
        }
        end {
            $steppablePipeline.End()
        }
    }

    #############################################################################
    #
    function Set-CompletionPrivateData {
        param (
            [ValidateNotNullOrEmpty()]
            [string]
            $Key,

            [object]
            $Value,

            [ValidateNotNullOrEmpty()]
            [int]
            $ExpirationSeconds = 604800
        )

        $Cache = [PSCustomObject]@{
            Value          = $Value
            ExpirationTime = (Get-Date).AddSeconds($ExpirationSeconds)
        }
        $completionPrivateData[$key] = $Cache
    }

    #############################################################################
    #
    function Get-CompletionPrivateData {
        param (
            [ValidateNotNullOrEmpty()]
            [string]
            $Key)

        if (!$Key)
        { return $completionPrivateData }

        $cacheValue = $completionPrivateData[$key]
        if ((Get-Date) -lt $cacheValue.ExpirationTime) {
            return $cacheValue.Value
        }
    }

    #############################################################################
    #
    function Get-CompletionWithExtension {
        param ([string]
            $lastWord,

            [string[]]
            $extensions)

        [System.Management.Automation.CompletionCompleters]::CompleteFilename($lastWord) |
            Where-Object {
            # Use ListItemText because it won't be quoted, CompletionText might be
            [System.IO.Path]::GetExtension($_.ListItemText) -in $extensions
        }
    }

    #############################################################################
    #
    function New-CommandTree {
        [CmdletBinding(DefaultParameterSetName = 'Default')]
        param (
            [Parameter(Mandatory, ParameterSetName = 'Default')]
            [Parameter(Mandatory, ParameterSetName = 'Argument')]
            [ValidateNotNullOrEmpty()]
            [string]
            $Completion,

            [Parameter(Position = 1, Mandatory, ParameterSetName = 'Default')]
            [Parameter(Position = 1, Mandatory, ParameterSetName = 'Argument')]
            [string]
            $Tooltip,

            [Parameter(ParameterSetName = 'Argument')]
            [switch]
            $Argument,

            [Parameter(Position = 2, ParameterSetName = 'Default')]
            [Parameter(Position = 1, ParameterSetName = 'ScriptBlockSet')]
            [scriptblock]
            $SubCommands,

            [Parameter(Mandatory, ParameterSetName = 'ScriptBlockSet')]
            [scriptblock]
            $CompletionGenerator
        )

        $actualSubCommands = $null
        if ($null -ne $SubCommands) {
            $actualSubCommands = [NativeCommandTreeNode[]](& $SubCommands)
        }

        switch ($PSCmdlet.ParameterSetName) {
            'Default' {
                New-Object NativeCommandTreeNode $Completion, $Tooltip, $actualSubCommands
                break
            }
            'Argument' {
                New-Object NativeCommandTreeNode $Completion, $Tooltip, $true
            }
            'ScriptBlockSet' {
                New-Object NativeCommandTreeNode $CompletionGenerator, $actualSubCommands
                break
            }
        }
    }

    #############################################################################
    #
    function Get-CommandTreeCompletion {
        param ($wordToComplete,

            $commandAst,

            [NativeCommandTreeNode[]]
            $CommandTree)

        $commandElements = $commandAst.CommandElements

        # Skip the first command element - it's the command name
        # Iterate through the remaining elements, stopping early
        # if we find the element that matches $wordToComplete.
        for ($i = 1; $i -lt $commandElements.Count; $i++) {
            if (!($commandElements[$i] -is [System.Management.Automation.Language.StringConstantExpressionAst])) {
                # Ignore arguments that are expressions.  In some rare cases this
                # could cause strange completions because the context is incorrect, e.g.:
                #    $c = 'advfirewall'
                #    netsh $c firewall
                # Here we would be in advfirewall firewall context, but we'd complete as
                # though we were in firewall context.
                continue
            }

            if ($commandElements[$i].Value -eq $wordToComplete) {
                $CommandTree = $CommandTree |
                    Where-Object { $_.Command -like "$wordToComplete*" -or $_.CompletionGenerator -ne $null }
                break
            }

            foreach ($subCommand in $CommandTree) {
                if ($subCommand.Command -eq $commandElements[$i].Value) {
                    if (!$subCommand.Argument) {
                        $CommandTree = $subCommand.SubCommands
                    }
                    break
                }
            }
        }

        if ($null -ne $CommandTree) {
            $CommandTree | ForEach-Object {
                if ($_.Command) {
                    $toolTip = if ($_.Tooltip) { $_.Tooltip }
                    else { $_.Command }
                    New-CompletionResult -CompletionText $_.Command -ToolTip $toolTip
                } else {
                    & $_.CompletionGenerator $wordToComplete $commandAst
                }
            }
        }
    }

    #endregion Exported utility functions for completers

    #region Exported functions

    #############################################################################
    #
    # .SYNOPSIS
    #     Register a ScriptBlock to perform argument completion for a
    #     given command or parameter.
    #
    # .DESCRIPTION
    #     Argument completion can be extended without needing to do any
    #     parsing in many cases. By registering a handler for specific
    #     commands and/or parameters, PowerShell will call the handler
    #     when appropriate.
    #
    #     There are 2 kinds of extensions - native and PowerShell. Native
    #     refers to commands external to PowerShell, e.g. net.exe. PowerShell
    #     completion covers any functions, scripts, or cmdlets where PowerShell
    #     can determine the correct parameter being completed.
    #
    #     When registering a native handler, you must specify the CommandName
    #     parameter. The CommandName is typically specified without any path
    #     or extension. If specifying a path and/or an extension, completion
    #     will only work when the command is specified that way when requesting
    #     completion.
    #
    #     When registering a PowerShell handler, you must specify the
    #     ParameterName parameter. The CommandName is optional - PowerShell will
    #     first try to find a handler based on the command and parameter, but
    #     if none is found, then it will try just the parameter name. This way,
    #     you could specify a handler for all commands that have a specific
    #     parameter.
    #
    #     A handler needs to return instances of
    #     System.Management.Automation.CompletionResult.
    #
    #     A native handler is passed 2 parameters:
    #
    #         param($wordToComplete, $commandAst)
    #
    #     $wordToComplete  - The argument being completed, possibly an empty string
    #     $commandAst      - The ast of the command being completed.
    #
    #     A PowerShell handler is passed 5 parameters:
    #
    #         param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
    #
    #     $commandName        - The command name
    #     $parameterName      - The parameter name
    #     $wordToComplete     - The argument being completed, possibly an empty string
    #     $commandAst         - The parsed representation of the command being completed.
    #     $fakeBoundParameter - Like $PSBoundParameters, contains values for some of the parameters.
    #                           Certain values are not included, this does not mean a parameter was
    #                           not specified, just that getting the value could have had unintended
    #                           side effects, so no value was computed.
    #
    # .PARAMETER ParameterName
    #     The name of the parameter that the Completion parameter supports.
    #     This parameter is not supported for native completion and is
    #     mandatory for script completion.
    #
    # .PARAMETER CommandName
    #     The name of the command that the Completion parameter supports.
    #     This parameter is mandatory for native completion and is optional
    #     for script completion.
    #
    # .PARAMETER Completion
    #     A ScriptBlock that returns instances of CompletionResult. For
    #     native completion, the script block parameters are
    #
    #         param($wordToComplete, $commandAst)
    #
    #     For script completion, the parameters are:
    #
    #         param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
    #
    # .PARAMETER Description
    #     A description of how the completion can be used.
    #
    function Register-ArgumentCompleter {
        [CmdletBinding(DefaultParameterSetName = "PowerShellSet")]
        param (
            [Parameter(ParameterSetName = "NativeSet", Mandatory)]
            [Parameter(ParameterSetName = "PowerShellSet")]
            [string[]]
            $CommandName = "",

            [Parameter(ParameterSetName = "PowerShellSet", Mandatory)]
            [string]
            $ParameterName = "",

            [Parameter(Mandatory)]
            [scriptblock]
            $ScriptBlock,

            [string]
            $Description,

            [Parameter(ParameterSetName = "NativeSet")]
            [switch]
            $Native)

        $fnDefn = $ScriptBlock.Ast -as [System.Management.Automation.Language.FunctionDefinitionAst]
        if (!$Description) {
            # See if the script block is really a function, if so, use the function name.
            $Description = if ($fnDefn -ne $null) { $fnDefn.Name }
            else { "" }
        }

        if ($MyInvocation.ScriptName -ne (& { $MyInvocation.ScriptName })) {
            # Make an unbound copy of the script block so it has access to TabExpansionPlusPlus when invoked.
            # We can skip this step if we created the script block (Register-ArgumentCompleter was
            # called internally).
            if ($fnDefn -ne $null) {
                $ScriptBlock = $ScriptBlock.Ast.Body.GetScriptBlock() # Don't reparse, just get a new ScriptBlock.
            } else {
                $ScriptBlock = $ScriptBlock.Ast.GetScriptBlock() # Don't reparse, just get a new ScriptBlock.
            }
        }

        foreach ($command in $CommandName) {
            if ($command -and $ParameterName) {
                $command += ":"
            }

            $key = if ($Native) { 'NativeArgumentCompleters' }
            else { 'CustomArgumentCompleters' }
            $tabExpansionOptions[$key]["${command}${ParameterName}"] = $ScriptBlock

            $tabExpansionDescriptions["${command}${ParameterName}$Native"] = $Description
        }
    }

    #############################################################################
    #
    # .SYNOPSIS
    #     Tests the registered argument completer
    #
    # .DESCRIPTION
    #     Invokes the registered parameteter completer for a specified command to make it easier to test
    #     a completer
    #
    # .EXAMPLE
    #  Test-ArgumentCompleter -CommandName Get-Verb -ParameterName Verb -WordToComplete Sta
    #
    # Test what would be completed if Get-Verb -Verb Sta<Tab> was typed at the prompt
    #
    # .EXAMPLE
    #  Test-ArgumentCompleter -NativeCommand Robocopy -WordToComplete /
    #
    # Test what would be completed if Robocopy /<Tab> was typed at the prompt
    #
    function Test-ArgumentCompleter {
        [CmdletBinding(DefaultParametersetName = 'PS')]
        param
        (
            [Parameter(Mandatory, Position = 1, ParameterSetName = 'PS')]
            [string]
            $CommandName
            ,

            [Parameter(Mandatory, Position = 2, ParameterSetName = 'PS')]
            [string]
            $ParameterName
            ,

            [Parameter(ParameterSetName = 'PS')]
            [System.Management.Automation.Language.CommandAst]
            $commandAst
            ,

            [Parameter(ParameterSetName = 'PS')]
            [Hashtable]
            $FakeBoundParameters = @{ }
            ,

            [Parameter(Mandatory, Position = 1, ParameterSetName = 'NativeCommand')]
            [string]
            $NativeCommand
            ,

            [Parameter(Position = 2, ParameterSetName = 'NativeCommand')]
            [Parameter(Position = 3, ParameterSetName = 'PS')]
            [string]
            $WordToComplete = ''

        )

        if ($PSCmdlet.ParameterSetName -eq 'NativeCommand') {
            $Tokens = $null
            $Errors = $null
            $ast = [System.Management.Automation.Language.Parser]::ParseInput($NativeCommand, [ref]$Tokens, [ref]$Errors)
            $commandAst = $ast.EndBlock.Statements[0].PipelineElements[0]
            $command = $commandAst.GetCommandName()
            $completer = $tabExpansionOptions.NativeArgumentCompleters[$command]
            if (-not $Completer) {
                throw "No argument completer registered for command '$Command' (from $NativeCommand)"
            }
            & $completer $WordToComplete $commandAst
        } else {
            $completer = $tabExpansionOptions.CustomArgumentCompleters["${CommandName}:$ParameterName"]
            if (-not $Completer) {
                throw "No argument completer registered for '${CommandName}:$ParameterName'"
            }
            & $completer $CommandName $ParameterName $WordToComplete $commandAst $FakeBoundParameters
        }
    }

    #############################################################################
    #
    # .SYNOPSIS
    # Retrieves a list of argument completers that have been loaded into the
    # PowerShell session.
    #
    # .PARAMETER Name
    # The name of the argument complete to retrieve. This parameter supports
    # wildcards (asterisk).
    #
    # .EXAMPLE
    # Get-ArgumentCompleter -Name *Azure*;
    function Get-ArgumentCompleter {
        [CmdletBinding()]
        param ([string[]]
            $Name = '*')

        if (!$updatedTypeData) {
            # Define the default display properties for the objects returned by Get-ArgumentCompleter
            [string[]]$properties = "Command", "Parameter"
            Update-TypeData -TypeName 'TabExpansionPlusPlus.ArgumentCompleter' -DefaultDisplayPropertySet $properties -Force
            $updatedTypeData = $true
        }

        function WriteCompleters {
            function WriteCompleter($command, $parameter, $native, $scriptblock) {
                foreach ($n in $Name) {
                    if ($command -like $n) {
                        $c = $command
                        if ($command -and $parameter) { $c += ':' }
                        $description = $tabExpansionDescriptions["${c}${parameter}${native}"]
                        $completer = [pscustomobject]@{
                            Command     = $command
                            Parameter   = $parameter
                            Native      = $native
                            Description = $description
                            ScriptBlock = $scriptblock
                            File        = if ($scriptblock.File) { Split-Path -Leaf -Path $scriptblock.File }
                        }

                        $completer.PSTypeNames.Add('TabExpansionPlusPlus.ArgumentCompleter')
                        Write-Output $completer

                        break
                    }
                }
            }

            foreach ($pair in $tabExpansionOptions.CustomArgumentCompleters.GetEnumerator()) {
                if ($pair.Key -match '^(.*):(.*)$') {
                    $command = $matches[1]
                    $parameter = $matches[2]
                } else {
                    $parameter = $pair.Key
                    $command = ""
                }

                WriteCompleter $command $parameter $false $pair.Value
            }

            foreach ($pair in $tabExpansionOptions.NativeArgumentCompleters.GetEnumerator()) {
                WriteCompleter $pair.Key '' $true $pair.Value
            }
        }

        WriteCompleters | Sort-Object -Property Native, Command, Parameter
    }

    #############################################################################
    #
    # .SYNOPSIS
    #     Register a ScriptBlock to perform argument completion for a
    #     given command or parameter.
    #
    # .DESCRIPTION
    #
    # .PARAMETER Option
    #
    #     The name of the option.
    #
    # .PARAMETER Value
    #
    #     The value to set for Option. Typically this will be $true.
    #
    function Set-TabExpansionOption {
        param (
            [ValidateSet('ExcludeHiddenFiles',
                'RelativePaths',
                'LiteralPaths',
                'IgnoreHiddenShares',
                'AppendBackslash')]
            [string]
            $Option,

            [object]
            $Value = $true)

        $tabExpansionOptions[$option] = $value
    }

    #endregion Exported functions

    #region Internal utility functions

    #############################################################################
    #
    # This function checks if an attribute argument's name can be completed.
    # For example:
    #     [Parameter(<TAB>
    #     [Parameter(Po<TAB>
    #     [CmdletBinding(DefaultPa<TAB>
    #
    function TryAttributeArgumentCompletion {
        param (
            [System.Management.Automation.Language.Ast]
            $ast,

            [int]
            $offset
        )

        $results = @()
        $matchIndex = -1

        try {
            # We want to find any NamedAttributeArgumentAst objects where the Ast extent includes $offset
            $offsetInExtentPredicate = {
                param ($ast)
                return $offset -gt $ast.Extent.StartOffset -and
                $offset -le $ast.Extent.EndOffset
            }
            $asts = $ast.FindAll($offsetInExtentPredicate, $true)

            $attributeType = $null
            $attributeArgumentName = ""
            $replacementIndex = $offset
            $replacementLength = 0

            $attributeArg = $asts | Where-Object { $_ -is [System.Management.Automation.Language.NamedAttributeArgumentAst] } | Select-Object -First 1
            if ($null -ne $attributeArg) {
                $attributeAst = [System.Management.Automation.Language.AttributeAst]$attributeArg.Parent
                $attributeType = $attributeAst.TypeName.GetReflectionAttributeType()
                $attributeArgumentName = $attributeArg.ArgumentName
                $replacementIndex = $attributeArg.Extent.StartOffset
                $replacementLength = $attributeArg.ArgumentName.Length
            } else {
                $attributeAst = $asts | Where-Object { $_ -is [System.Management.Automation.Language.AttributeAst] } | Select-Object -First 1
                if ($null -ne $attributeAst) {
                    $attributeType = $attributeAst.TypeName.GetReflectionAttributeType()
                }
            }

            if ($null -ne $attributeType) {
                $results = $attributeType.GetProperties('Public,Instance') |
                    Where-Object {
                    # Ignore TypeId (all attributes inherit it)
                    $_.Name -like "$attributeArgumentName*" -and $_.Name -ne 'TypeId'
                } |
                    Sort-Object -Property Name |
                    ForEach-Object {
                    $propType = [Microsoft.PowerShell.ToStringCodeMethods]::Type($_.PropertyType)
                    $propName = $_.Name
                    New-CompletionResult $propName -ToolTip "$propType $propName" -CompletionResultType Property
                }

                return [PSCustomObject]@{
                    Results           = $results
                    ReplacementIndex  = $replacementIndex
                    ReplacementLength = $replacementLength
                }
            }
        } catch { }
    }

    #############################################################################
    #
    # This function completes native commands options starting with - or --
    # works around a bug in PowerShell that causes it to not complete
    # native command options starting with - or --
    #
    function TryNativeCommandOptionCompletion {
        param (
            [System.Management.Automation.Language.Ast]
            $ast,

            [int]
            $offset
        )

        $results = @()
        $replacementIndex = $offset
        $replacementLength = 0
        try {
            # We want to find any Command element objects where the Ast extent includes $offset
            $offsetInOptionExtentPredicate = {
                param ($ast)
                return $offset -gt $ast.Extent.StartOffset -and
                $offset -le $ast.Extent.EndOffset -and
                $ast.Extent.Text.StartsWith('-')
            }
            $option = $ast.Find($offsetInOptionExtentPredicate, $true)
            if ($option -ne $null) {
                $command = $option.Parent -as [System.Management.Automation.Language.CommandAst]
                if ($command -ne $null) {
                    $nativeCommand = [System.IO.Path]::GetFileNameWithoutExtension($command.CommandElements[0].Value)
                    $nativeCompleter = $tabExpansionOptions.NativeArgumentCompleters[$nativeCommand]

                    if ($nativeCompleter) {
                        $results = @(& $nativeCompleter $option.ToString() $command)
                        if ($results.Count -gt 0) {
                            $replacementIndex = $option.Extent.StartOffset
                            $replacementLength = $option.Extent.Text.Length
                        }
                    }
                }
            }
        } catch { }

        return [PSCustomObject]@{
            Results           = $results
            ReplacementIndex  = $replacementIndex
            ReplacementLength = $replacementLength
        }
    }

    #endregion Internal utility functions

    #############################################################################
    #
    # This function is partly a copy of the V3 TabExpansion2, adding a few
    # capabilities such as completing attribute arguments and excluding hidden
    # files from results.
    #
    function global:TabExpansion2 {
        [CmdletBinding(DefaultParameterSetName = 'ScriptInputSet')]
        param (
            [Parameter(ParameterSetName = 'ScriptInputSet', Mandatory, Position = 0)]
            [string]
            $inputScript,

            [Parameter(ParameterSetName = 'ScriptInputSet', Mandatory, Position = 1)]
            [int]
            $cursorColumn,

            [Parameter(ParameterSetName = 'AstInputSet', Mandatory, Position = 0)]
            [System.Management.Automation.Language.Ast]
            $ast,

            [Parameter(ParameterSetName = 'AstInputSet', Mandatory, Position = 1)]
            [System.Management.Automation.Language.Token[]]
            $tokens,

            [Parameter(ParameterSetName = 'AstInputSet', Mandatory, Position = 2)]
            [System.Management.Automation.Language.IScriptPosition]
            $positionOfCursor,

            [Parameter(ParameterSetName = 'ScriptInputSet', Position = 2)]
            [Parameter(ParameterSetName = 'AstInputSet', Position = 3)]
            [Hashtable]
            $options = $null
        )

        if ($null -ne $options) {
            $options += $tabExpansionOptions
        } else {
            $options = $tabExpansionOptions
        }

        if ($psCmdlet.ParameterSetName -eq 'ScriptInputSet') {
            $results = [System.Management.Automation.CommandCompletion]::CompleteInput(
                <#inputScript#>                $inputScript,
                <#cursorColumn#>                $cursorColumn,
                <#options#>                $options)
        } else {
            $results = [System.Management.Automation.CommandCompletion]::CompleteInput(
                <#ast#>                $ast,
                <#tokens#>                $tokens,
                <#positionOfCursor#>                $positionOfCursor,
                <#options#>                $options)
        }

        if ($results.CompletionMatches.Count -eq 0) {
            # Built-in didn't succeed, try our own completions here.
            if ($psCmdlet.ParameterSetName -eq 'ScriptInputSet') {
                $ast = [System.Management.Automation.Language.Parser]::ParseInput($inputScript, [ref]$tokens, [ref]$null)
            } else {
                $cursorColumn = $positionOfCursor.Offset
            }

            # workaround PowerShell bug that case it to not invoking native completers for - or --
            # making it hard to complete options for many commands
            $nativeCommandResults = TryNativeCommandOptionCompletion -ast $ast -offset $cursorColumn
            if ($null -ne $nativeCommandResults) {
                $results.ReplacementIndex = $nativeCommandResults.ReplacementIndex
                $results.ReplacementLength = $nativeCommandResults.ReplacementLength
                if ($results.CompletionMatches.IsReadOnly) {
                    # Workaround where PowerShell returns a readonly collection that we need to add to.
                    $collection = new-object System.Collections.ObjectModel.Collection[System.Management.Automation.CompletionResult]
                    $results.GetType().GetProperty('CompletionMatches').SetValue($results, $collection)
                }
                $nativeCommandResults.Results | ForEach-Object {
                    $results.CompletionMatches.Add($_)
                }
            }

            $attributeResults = TryAttributeArgumentCompletion $ast $cursorColumn
            if ($null -ne $attributeResults) {
                $results.ReplacementIndex = $attributeResults.ReplacementIndex
                $results.ReplacementLength = $attributeResults.ReplacementLength
                if ($results.CompletionMatches.IsReadOnly) {
                    # Workaround where PowerShell returns a readonly collection that we need to add to.
                    $collection = new-object System.Collections.ObjectModel.Collection[System.Management.Automation.CompletionResult]
                    $results.GetType().GetProperty('CompletionMatches').SetValue($results, $collection)
                }
                $attributeResults.Results | ForEach-Object {
                    $results.CompletionMatches.Add($_)
                }
            }
        }

        if ($options.ExcludeHiddenFiles) {
            foreach ($result in @($results.CompletionMatches)) {
                if ($result.ResultType -eq [System.Management.Automation.CompletionResultType]::ProviderItem -or
                    $result.ResultType -eq [System.Management.Automation.CompletionResultType]::ProviderContainer) {
                    try {
                        $item = Get-Item -LiteralPath $result.CompletionText -ErrorAction Stop
                    } catch {
                        # If Get-Item w/o -Force fails, it is probably hidden, so exclude the result
                        $null = $results.CompletionMatches.Remove($result)
                    }
                }
            }
        }
        if ($options.AppendBackslash -and
            $results.CompletionMatches.ResultType -contains [System.Management.Automation.CompletionResultType]::ProviderContainer) {
            foreach ($result in @($results.CompletionMatches)) {
                if ($result.ResultType -eq [System.Management.Automation.CompletionResultType]::ProviderContainer) {
                    $completionText = $result.CompletionText
                    $lastChar = $completionText[-1]
                    $lastIsQuote = ($lastChar -eq '"' -or $lastChar -eq "'")
                    if ($lastIsQuote) {
                        $lastChar = $completionText[-2]
                    }

                    if ($lastChar -ne '\') {
                        $null = $results.CompletionMatches.Remove($result)

                        if ($lastIsQuote) {
                            $completionText =
                            $completionText.Substring(0, $completionText.Length - 1) +
                            '\' + $completionText[-1]
                        } else {
                            $completionText = $completionText + '\'
                        }

                        $updatedResult = New-Object System.Management.Automation.CompletionResult `
                        ($completionText, $result.ListItemText, $result.ResultType, $result.ToolTip)
                        $results.CompletionMatches.Add($updatedResult)
                    }
                }
            }
        }

        if ($results.CompletionMatches.Count -eq 0) {
            # No results, if this module has overridden another TabExpansion2 function, call it
            # but only if it's not the built-in function (which we assume if function isn't
            # defined in a file.
            if ($oldTabExpansion2 -ne $null -and $oldTabExpansion2.File -ne $null) {
                return (& $oldTabExpansion2 @PSBoundParameters)
            }
        }

        return $results
    }

    #############################################################################
    #
    # Main
    #

    Add-Type @"
using System;
using System.Management.Automation;

public class NativeCommandTreeNode
{
    private NativeCommandTreeNode(NativeCommandTreeNode[] subCommands)
    {
        SubCommands = subCommands;
    }

    public NativeCommandTreeNode(string command, NativeCommandTreeNode[] subCommands)
        : this(command, null, subCommands)
    {
    }

    public NativeCommandTreeNode(string command, string tooltip, NativeCommandTreeNode[] subCommands)
        : this(subCommands)
    {
        this.Command = command;
        this.Tooltip = tooltip;
    }

    public NativeCommandTreeNode(string command, string tooltip, bool argument)
        : this(null)
    {
        this.Command = command;
        this.Tooltip = tooltip;
        this.Argument = true;
    }

    public NativeCommandTreeNode(ScriptBlock completionGenerator, NativeCommandTreeNode[] subCommands)
        : this(subCommands)
    {
        this.CompletionGenerator = completionGenerator;
    }

    public string Command { get; private set; }
    public string Tooltip { get; private set; }
    public bool Argument { get; private set; }
    public ScriptBlock CompletionGenerator { get; private set; }
    public NativeCommandTreeNode[] SubCommands { get; private set; }
}
"@

    # Custom completions are saved in this hashtable
    $tabExpansionOptions = @{
        CustomArgumentCompleters = @{ }
        NativeArgumentCompleters = @{ }
    }
    # Descriptions for the above completions saved in this hashtable
    $tabExpansionDescriptions = @{ }
    # And private data for the above completions cached in this hashtable
    $completionPrivateData = @{ }
}


text:
<?php

declare(strict_types=1);

namespace DaPigGuy\PiggyCustomEnchants\entities;

use DaPigGuy\PiggyCustomEnchants\CustomEnchantManager;
use DaPigGuy\PiggyCustomEnchants\utils\AllyChecks;
use pocketmine\block\VanillaBlocks;
use pocketmine\entity\Entity;
use pocketmine\entity\EntitySizeInfo;
use pocketmine\entity\Living;
use pocketmine\event\entity\EntityCombustByEntityEvent;
use pocketmine\event\entity\EntityDamageByEntityEvent;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
use pocketmine\player\Player;

class PiggyLightning extends Entity
{
    protected int $age = 0;

    public function entityBaseTick(int $tickDiff = 1): bool
    {
        if ($this->closed) return false;
        $this->age += $tickDiff;
        $world = $this->getWorld();
        foreach ($world->getNearbyEntities($this->getBoundingBox()->expandedCopy(4, 3, 4), $this) as $entity) {
            if ($entity instanceof Living && $entity->isAlive() && $this->getOwningEntity() !== $entity) {
                $owner = $this->getOwningEntity();
                if (!$owner instanceof Player || !AllyChecks::isAlly($owner, $entity)) {
                    $ev = new EntityCombustByEntityEvent($this, $entity, mt_rand(3, 8));
                    $ev->call();
                    if (!$ev->isCancelled()) $entity->setOnFire($ev->getDuration());
                }
                $ev = new EntityDamageByEntityEvent($this, $entity, EntityDamageEvent::CAUSE_CUSTOM, 5);
                $ev->call();
                if (!$ev->isCancelled()) $entity->attack($ev);
            }
        }
        if ($this->getWorld()->getBlock($this->location)->canBeFlowedInto() && CustomEnchantManager::getPlugin()->getConfig()->getNested("world-damage.lightning", false) === true) {
            $this->getWorld()->setBlock($this->location, VanillaBlocks::FIRE());
        }
        if ($this->age > 20) $this->flagForDespawn();
        return parent::entityBaseTick($tickDiff);
    }

    public static function getNetworkTypeId(): string
    {
        return EntityIds::LIGHTNING_BOLT;
    }

    protected function getInitialSizeInfo(): EntitySizeInfo
    {
        return new EntitySizeInfo(1.8, 0.3);
    }
}


text:
    <title>IPL HOME PAGE</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link type="text/css" rel="stylesheet" href="<?php echo site_url('media/css/bootstrap.min.css')?>" />
    <link rel="icon" type="image/png" href="<?php echo site_url('media/img/favicon.ico')?>" />

        IPL
        <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">

        </button>

              Home

              Auctions

              Venues

              Teams

              Fixtures

              Awards

              Login

              <img src="<?php echo site_url('media/img/team1.jpg')?>" alt="Antennae Galaxies" />

              <img src="<?php echo site_url('media/img/team2.jpg')?>" alt="Carina Caterpillar" />

              <img src="<?php echo site_url('media/img/team3.jpg')?>" alt="Light Echo" />

          ‹
          ›

News

Get the latest news and annoucements of the IPL. View announcements of your favorite teams and players and stay updated.

          Enter

Teams

View all the participating teams of this tournament. Know owners, coaches, captains etc of all the teams.

          <a href="<?php echo site_url('teams')?>" class="btn btn-default">Enter

Awards

View all the winner of the awards of the tournament like purple cap, orange cap, height run scorer/wicket taker etc.

          <a href="<?php echo site_url('awards')?>" class="btn btn-default">Enter

Matches

Get the latest match details of the tournament. View the latest updates of the results and stats.

          <a href="<?php echo site_url('fixtures')?>" class="btn btn-default">Enter


text:
import React from 'react';
import { inject, observer } from 'mobx-react';

import { MainContainer as Container, AttributeHeader, TitleHeader } from './Views';

export default inject('automataStore')(observer((props) => {
  const { automataStore: { cellStates } } = props;

  return (
    <Container {...props}>
      <AttributeHeader>
        { cellStates.number }
      </AttributeHeader>
      <TitleHeader>
        States
      </TitleHeader>
    </Container>
  );
}));


text:
package com.amazonaws.services.codepipeline.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.codepipeline.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * AWSSessionCredentialsMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AWSSessionCredentialsMarshaller {

    private static final MarshallingInfo<String> ACCESSKEYID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("accessKeyId").build();
    private static final MarshallingInfo<String> SECRETACCESSKEY_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("secretAccessKey").build();
    private static final MarshallingInfo<String> SESSIONTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sessionToken").build();

    private static final AWSSessionCredentialsMarshaller instance = new AWSSessionCredentialsMarshaller();

    public static AWSSessionCredentialsMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(AWSSessionCredentials aWSSessionCredentials, ProtocolMarshaller protocolMarshaller) {

        if (aWSSessionCredentials == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(aWSSessionCredentials.getAccessKeyId(), ACCESSKEYID_BINDING);
            protocolMarshaller.marshall(aWSSessionCredentials.getSecretAccessKey(), SECRETACCESSKEY_BINDING);
            protocolMarshaller.marshall(aWSSessionCredentials.getSessionToken(), SESSIONTOKEN_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package sblectric.lightningcraft.api.util;

import java.awt.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import javax.annotation.Nonnull;

import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTException;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import sblectric.lightningcraft.api.recipes.LightningInfusionRecipe;

/** Helps with ItemStack functionality */
public class StackHelper {

	private static Map<String, Integer> oreMap = new HashMap();
	private static Map<String, Integer> subMap = new HashMap();

	public static Random rand = new Random();

	/** Animate an ItemStack based on makeItemStackFromString (clientside only) */
	@SideOnly(Side.CLIENT)
	public static @Nonnull ItemStack animateItemStackFromString(String stackString, boolean change) {
		int ores;
		if(OreDictionary.doesOreNameExist(stackString)) {
			ores = OreDictionary.getOres(stackString).size();
		} else {
			ores = 1;
		}
		int oreIndex = 0;
		int subIndex = 0;
		ItemStack result;

		if(oreMap.containsKey(stackString))	oreIndex = oreMap.get(stackString);
		if(change) {
			if(ores > 0) {
				oreIndex = rand.nextInt(ores);
			} else {
				oreIndex = 0;
			}
			oreMap.put(stackString, oreIndex);
		}

		ItemStack primary = makeItemStackFromString(stackString, oreIndex);
		if(primary.isEmpty()) return ItemStack.EMPTY;

		NonNullList<ItemStack> subItems = NonNullList.create();
		primary.getItem().getSubItems(null, subItems);

		if(subMap.containsKey(stackString))	subIndex = subMap.get(stackString);
		if(primary.getItemDamage() == OreDictionary.WILDCARD_VALUE && !subItems.isEmpty()) {
			if(change) {
				subIndex = rand.nextInt(subItems.size());
				subMap.put(stackString, subIndex);
			}
			result = subItems.get(subIndex);
		} else {
			result = primary;
		}
		return result;
	}

	/** Returns true if the specified string corresponds to an oredict entry */
	private static boolean isStringOreDict(String stackString) {
		if(stackString == LightningInfusionRecipe.nullIdentifier) return false;
		return OreDictionary.doesOreNameExist(stackString);
	}

	/** Creates a new ItemStack from the string acquired from makeStringFromItemStack or an oredict name, with an oredict index option */
	public static @Nonnull ItemStack makeItemStackFromString(String stackString, int oreIndex) {
		if(stackString == LightningInfusionRecipe.nullIdentifier) return ItemStack.EMPTY;
		try { // try to load it as a regular NBT stack
			if(!isStringOreDict(stackString)) {
				return new ItemStack(JsonToNBT.getTagFromJson(stackString));
			} else {
				throw new NBTException("OreDict exists", "", 0);
			}
		} catch(NBTException e) { // now try to get it as an oredict entry
			List<ItemStack> list;
			if(isStringOreDict(stackString) && oreIndex < (list = OreDictionary.getOres(stackString)).size()) {
				return list.get(oreIndex); // yep
			} else {
				return ItemStack.EMPTY; // guess not
			}
		}
	}

	/** Creates a new ItemStack from the string acquired from makeStringFromItemStack or an oredict name */
	public static @Nonnull ItemStack makeItemStackFromString(String stackString) {
		return makeItemStackFromString(stackString, 0);
	}

	/** Get metadata from a string version of an ItemStack */
	public static int getMetaFromString(String stackString) {
		if(!isStringOreDict(stackString)) {
			ItemStack stack = makeItemStackFromString(stackString);
			return !stack.isEmpty() ? stack.getItemDamage() : 0;
		} else {
			return -1; // oredict flag
		}
	}

	/** Change a string's metadata information (assumes the stack is non-null) */
	public static String changeStringMeta(String stackString, int newMeta) {
		try {
			if(!isStringOreDict(stackString)) {
				ItemStack stack = makeItemStackFromString(stackString);
				stack.setItemDamage(newMeta);
				return makeStringFromItemStack(stack);
			}
		} catch(NullPointerException e) {}
		return stackString;
	}

	/** Change a string's NBT information (assumes the stack is non-null) */
	public static String changeStringNBT(String stackString, NBTTagCompound newTag) {
		try {
			if(!isStringOreDict(stackString)) {
				ItemStack stack = makeItemStackFromString(stackString);
				stack.setTagCompound(newTag);
				return makeStringFromItemStack(stack);
			}
		} catch(NullPointerException e) {}
		return stackString;
	}

	/** Strip a stack of its metadata information (just set it to zero) */
	public static String stripMetaFromString(String stackString) {
		return changeStringMeta(stackString, 0);
	}

	/** Strip a stack of its NBT information (just set it to null) */
	public static String stripNBTFromString(String stackString) {
		return changeStringNBT(stackString, null);
	}

	/** Turn an ItemStack or oredict name into a String */
	public static String makeStringFromItemStack(@Nonnull Object stack) {
		if(stack instanceof ItemStack) {
			ItemStack s = (ItemStack)stack;
			return s.writeToNBT(new NBTTagCompound()).toString();
		} else if(stack instanceof String) {
			return (String)stack;
		} else {
			throw new IllegalArgumentException("Parameter must be a String or an ItemStack, was given " + stack.getClass());
		}
	}

	/** An unlimited type of areItemStacksEqual for crafting recipes (non-amount sensitive, cannot be null) */
	public static boolean areItemStacksEqualForCrafting(@Nonnull ItemStack... stacks) {
		ItemStack comp = stacks[0];
		if(comp.isEmpty()) return false;
		ItemStack comp1 = comp.copy(); comp1.setCount(1);
		for(int n = 1; n < stacks.length; n++) {
			if(stacks[n].isEmpty()) return false;
			ItemStack comp2 = stacks[n].copy(); comp2.setCount(1);
			if(!ItemStack.areItemStacksEqual(comp1, comp2)) { // try regular and oredict
				if(comp1.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
					comp2.setItemDamage(OreDictionary.WILDCARD_VALUE);
					if(!ItemStack.areItemStacksEqual(comp1, comp2)) return false;
				} else {
					return false;
				}
			}
		}
		return true;
	}

	/**
	 * Sets the color for the specified armor ItemStack.
	 */
	public static boolean setStackColor(@Nonnull ItemStack stack, Color color) {
		if(!(stack.getItem() instanceof ItemArmor))
			return false;
		Item armor = stack.getItem();

		if (!(armor == Items.LEATHER_BOOTS || armor == Items.LEATHER_LEGGINGS ||
				armor == Items.LEATHER_CHESTPLATE || armor == Items.LEATHER_HELMET)) {
			return false;
		} else {
			NBTTagCompound nbttagcompound = stack.getTagCompound();
			if(nbttagcompound == null) nbttagcompound = new NBTTagCompound();
			NBTTagCompound disp = new NBTTagCompound();
			disp.setInteger("color", color.getRGB());
			nbttagcompound.setTag("display", disp);
			stack.setTagCompound(nbttagcompound);
			return true;
		}
	}

	/** Gets the enchantments that exist on a specified item stack */
	public static List<NBTTagCompound> getEnchantments(@Nonnull ItemStack s) {
		List enchList = new ArrayList<NBTTagCompound>();

		if(!s.isEmpty() && s.hasTagCompound()) {
			NBTTagList enchants;
			String ench = s.getItem() == Items.ENCHANTED_BOOK ? "StoredEnchantments" : "ench";
			enchants = (NBTTagList) s.getTagCompound().getTag(ench);

			if(enchants != null && enchants.tagCount() > 0) {
				for(int i = 0; i < enchants.tagCount(); i++) {
					NBTTagCompound enchant = enchants.getCompoundTagAt(i);
					enchList.add(enchant);
				}
			}
		}

		return enchList;
	}

	/** Adds a list of enchantments to a specified item stack */
	public static boolean addEnchantments(@Nonnull ItemStack s, List<NBTTagCompound> enchList) {
		if(!s.isEmpty()) {
			String ench = s.getItem() == Items.ENCHANTED_BOOK ? "StoredEnchantments" : "ench";
			if(!s.hasTagCompound()) s.setTagCompound(new NBTTagCompound());
			NBTTagList currentEnchants = (NBTTagList) s.getTagCompound().getTag(ench);

			if(currentEnchants == null) {
				currentEnchants = new NBTTagList();
			}

			for(int i = 0; i < enchList.size(); i++) {
				currentEnchants.appendTag(enchList.get(i));
			}

			s.getTagCompound().setTag(ench, currentEnchants);
			return true;
		}
		return false;
	}

	/** Returns true if the ItemStack has an oredict entry that starts with 'start' */
	public static boolean oreDictNameStartsWith(@Nonnull ItemStack ore, String start) {
		for(int i : OreDictionary.getOreIDs(ore)) {
			if(OreDictionary.getOreName(i).startsWith(start)) return true;
		}
		return false;
	}

	/** Returns true if the ItemStack has an oredict entry that equals 'equals' */
	public static boolean oreDictNameEquals(@Nonnull ItemStack ore, String equals) {
		for(int i : OreDictionary.getOreIDs(ore)) {
			if(OreDictionary.getOreName(i).equals(equals)) return true;
		}
		return false;
	}

	/** Make an integer array based on the size of 'stacks' */
	public static int[] makeIntArray(@Nonnull ItemStack[] stacks) {
		return makeIntArray(stacks.length);
	}

	/** Make an integer array based on a stack size */
	public static int[] makeIntArray(int size) {
		int[] ints = new int[size];
		for(int i = 0; i < size; i++) ints[i] = i;
		return ints;
	}

}


text:
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/

// Utility class to manage DSP parameters which can change value smoothly (be ramped) while rendering, without introducing clicks or other distortion into the signal.
//
// Originally based on Apple sample code, but significantly altered by Aurelius Prochazka

#pragma once

#ifdef __cplusplus

// N.B. This is C++.

#import <AudioToolbox/AudioToolbox.h>
#import <libkern/OSAtomic.h>

#import <atomic>

class ParameterRamper {
    float clampLow, clampHigh;
    std::atomic<float> _uiValue{0};
    float _goal;
    float inverseSlope;
    AUAudioFrameCount samplesRemaining;
    std::atomic<int32_t> changeCounter;
    int32_t updateCounter = 0;

    void setImmediate(float value) {
        // only to be called from the render thread or when resources are not allocated.
        _goal = _uiValue = value;
        inverseSlope = 0.0;
        samplesRemaining = 0;
    }

public:
    ParameterRamper(float value = 0.0f) : changeCounter(0) {
        setImmediate(value);
    }

    void init() {
        /*
         Call this from the kernel init.
         Updates the internal value from the UI value.
         */
        setImmediate(_uiValue);
    }

    void reset() {
        changeCounter = updateCounter = 0;
    }

    void setUIValue(float value) {
        _uiValue = value;
        std::atomic_fetch_add(&changeCounter, 1);
    }

    float getUIValue() const { return _uiValue; }

    void dezipperCheck(AUAudioFrameCount rampDuration)
    {
        // check to see if the UI has changed and if so, start a ramp to dezipper it.
        int32_t changeCounterSnapshot = changeCounter;
        if (updateCounter != changeCounterSnapshot) {
            updateCounter = changeCounterSnapshot;
            startRamp(_uiValue, rampDuration);
        }
    }

    void startRamp(float newGoal, AUAudioFrameCount duration) {
        if (duration == 0) {
            setImmediate(newGoal);
        }
        else {
            /*
             Set a new ramp.
             Assigning to inverseSlope must come before assigning to goal.
             */
            inverseSlope = (get() - newGoal) / float(duration);
            samplesRemaining = duration;
            _goal = _uiValue = newGoal;
        }
    }

    float get() const {
        /*
         For long ramps, integrating a sum loses precision and does not reach
         the goal at the right time. So instead, a line equation is used. y = m * x + b.
         */
        return inverseSlope * float(samplesRemaining) + _goal;
    }

    void step() {
        // Do this in each inner loop iteration after getting the value.
        if (samplesRemaining != 0) {
            --samplesRemaining;
        }
    }

    float getAndStep() {
        // Combines get and step. Saves a multiply-add when not ramping.
        if (samplesRemaining != 0) {
            float value = get();
            --samplesRemaining;
            return value;
        }
        else {
            return _goal;
        }
    }

    void stepBy(AUAudioFrameCount n) {
        /*
         When a parameter does not participate in the current inner loop, you
         will want to advance it after the end of the loop.
         */
        if (n >= samplesRemaining) {
            samplesRemaining = 0;
        }
        else {
            samplesRemaining -= n;
        }
    }
};

#endif


text:
/* Author:
Juliane Doehler
04.10.2012
*/

var height = $(document).height() - 90;
var content_height = $(document).height() - 122;
$("#main").css("min-height", height);
$("#content").css("min-height", content_height);
$("#content_text").css("min-height", content_height);

$("#portfolio").mouseover(function(){
	$("#subnavi").css({"display":"block"});
	$("#portfolio_link").css({"color":"#999"});
});

$(".without_subnavi").mouseover(function(){
	$("#subnavi").css({"display":"none"});
	$("#portfolio_link").css({"color":"#000"});
});


text:
package uk.ac.cam.cstibhotel.otcanalyser.trade;

/*
 * This class contains the possible substrings of a UPI. There is a one-to-one equivalence with the
 * strings in the TextStrings class in the GUI package.
 */

public class UPIStrings {

	public static final String[] TradeType = {"Swap","Option"};

	public static final String[] Assets = {"Credit","InterestRate","Commodity","ForeignExchange",
			"Equity"};

	public static final String[] CreditBaseProducts = {"%","SingleName","IndexTranche","Index",
			"TotalReturnSwap","Swaptions","Exotic"};

	public static final String[][] CreditSubProducts = {
		{},
		{"ABS","Corporate","RecoveryCDS","Loans","Muni","Sovereign"},
		{"CDX","LCDX","MCDX","CDXStructuredTranche","iTraxx","iTraxx Structured Trade","ABX"},
		{"CDX","LCDXstock market analysis equations", "MCDX","iTraxx","ABX","CMBX","IOS","MBX","PO",
				"PrimeX","TRX"},
		{},
		{"iTraxx","Muni","CDX","MCDX","Sovereign","Corporate"},
		{"Corporate","StructuredCDS","Other"}
		};

	public static final String[] InterestBaseProducts = {"%","IRSwap","FRA","CapFloor",
			"CrossCurrency","Option","Exotic"};

	public static final String[][] InterestSubProducts = {
		{},
		{"FixedFloat","FixedFixed","Basis","Inflation","OIS"},
		{},
		{},
		{"Basis","FixedFloat","FixedFixed"},
		{"DebtOption","Swaption"},
		{}
	};

	public static final String[] CommodityBaseProducts = {"%","Metals","Energy","Index",
			"Agriculture","Environmental","Freight","MultiCommodityExotic"};

	public static final String[][] CommoditySubProducts = {
		{},
		{"Precious","NonPrecious"},
		{"Oil","NatGas","Coal","Elec","InterEnergy"},
		{},
		{"GrainsOilSeeds","Dairy","Livestock","Forestry","Softs"},
		{"Weather","Emissions"},
		{},
		{}
	};

	public static final String[] ForexBaseProducts = {"%","Spot","NDF","NDO","Forward",
			"VanillaOption","SimpleExotic","ComplexExotic"};

	public static final String[][] ForexSubProducts = {
		{},
		{},
		{},
		{},
		{},
		{},
		{"Barrier","Digital"},
		{}
	};

	public static final String[] EquityBaseProducts = {"%","Swap","PortfolioSwap",
			"ContractForDifference","Option","Forward","Other"};

	public static final String[][] EquitySubProducts = {
		{},
		{"PriceReturnBasicPerformance","ParameterReturnDividend","ParameterReturnVariance",
				"ParameterReturnVolatility"},
		{"PriceReturnBasicPerformance"},
		{"PriceReturnBasicPerformance"},
		{"PriceReturnBasicPerformance","ParameterReturnDividend","ParameterReturnVariance",
				"ParameterReturnVolatility"},
		{"PriceReturnBasicPerformance"},
		{}
	};

	public static final String[] SettlementTypes = {"Cash","Physical"};

}


text:
'use strict'

let chai = require('chai')
let expect = chai.expect

let Assigner = require('../lib/assign')

describe('Assign.js', function () {
	let assigner = new Assigner().excluded(['age'])
	let person = {
		name: 'Phil',
		address: 'Fine square 2',
		age: 20,
		relatives: {
			philip: true,
			karl: false
		},
		extra: {
			_type: 'String',
			validation: function () { return 'ok' },
			spectrum: [ 1, 2, 3, 4, 5 ]
		}
	}

	let entity = {
		name: 'Peter',
		id: 10,
		address: {
			street: 'Nowhere 1',
			country: 'UK'
		},
		social: {
			twitter: '',
			facebook: ''
		}
	}
	// keep
	let mask = {
		name: true,
		address: {
			country: true
		},
		social: {
			twitter: true,
			facebook: false
		}
	}
	// remove
	let purify = {
		id: 10,
		address: {
			street: true
		},
		social: {
			twitter: true,
			facebook: false
		}
	}

	before(function (done) {
		done()
	})

	describe('Test Assign services', function () {
		it('Clone object', function (done) {
			var cloned = assigner.cloneObject( person )
			cloned.extra.spectrum[1] = 200
			expect( cloned ).to.not.have.property('age')
			expect( cloned.extra.spectrum ).to.eql( [ 1, 200, 3, 4, 5 ] )
			expect( person.extra.spectrum ).to.eql( [ 1, 2, 3, 4, 5 ] )
			done()
		})
		it('Non recursive assign', function (done) {
			assigner.respect( true ).recursive(false)
			let res = assigner.assign( { relatives: {} }, person )
			expect( res ).to.have.property('relatives')
			expect( res.relatives ).to.not.have.property('philip')
			done()
		})
		it('Recursive assign', function (done) {
			assigner.respect( false ).recursive(true)
			let res = assigner.assign( {}, person )
			expect( res ).to.have.property('relatives')
			expect( res.relatives ).to.have.property('philip')
			done()
		})
		it('Assign by attributes', function (done) {
			assigner.recursive(false).attributes( [ 'name', 'address' ] )
			let res = assigner.assign( {}, person )
			expect( res ).to.not.have.property('relatives')
			done()
		})
		it('Respected assign', function (done) {
			assigner.recursive(true).attributes( ).respect( true )
			let res = assigner.assign( { relatives: { philip: false } }, person )
			expect( res.relatives.philip ).to.be.false
			done()
		})

		it('Masking', function (done) {
			let res = assigner.mask( entity, mask )
			console.log( res )
			done()
		})
		it('Purifying', function (done) {
			let res = assigner.purify( entity, purify )
			console.log( res )
			done()
		})
	})

	after(function (done) {
		done()
	})
})


text:
struct Foo { };

template Foo std::tr1::atan2<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::acosh<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::asinh<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::atanh<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::cbrt<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::copysign<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::erf<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::erfc<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::exp2<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::expm1<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::fdim<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::fma<Foo, Foo, Foo>(Foo(), Foo(), Foo()); // { dg-error "not match" }
template Foo std::tr1::fmax<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::fmin<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::hypot<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template int std::tr1::ilogb<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::lgamma<Foo>(Foo); // { dg-error "not match" }
template long long std::tr1::llrint<Foo>(Foo); // { dg-error "not match" }
template long long std::tr1::llround<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::log1p<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::log2<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::logb<Foo>(Foo); // { dg-error "not match" }
template long std::tr1::lrint<Foo>(Foo); // { dg-error "not match" }
template long std::tr1::lround<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::nearbyint<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::nextafter<Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::nexttoward<Foo>(Foo, long double); // { dg-error "not match" }
template Foo std::tr1::remainder<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::remquo<Foo>(Foo, Foo, int*); // { dg-error "not match" }
template Foo std::tr1::rint<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::round<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::scalbln<Foo>(Foo, long); // { dg-error "not match" }
template Foo std::tr1::scalbn<Foo>(Foo, int); // { dg-error "not match" }
template Foo std::tr1::tgamma<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::trunc<Foo>(Foo); // { dg-error "not match" }


text:
function other () {
  console.log('hello');
}

// but not this one
function foo () { }
// this is the comment to find

// needs to find this line as well
//
// and this one

/**
 * And this jsdoc
 *
 * @name withcomment
 * @function
 */

function withcomment () {
  console.log('hi');
}


text:
'use strict';

const ipc = require('electron').ipcRenderer;
const remote = require('electron').remote;
const browserWindow = remote.getCurrentWindow();
const dataStore = require('../../data-store');

// When the help menu is loaded, we create a ruler
// so the user can get a feel of how to use them.
ipc.send('create-ruler', {
	x: browserWindow.getPosition()[0] + 274,
	y: browserWindow.getPosition()[1] + 250
});

let currentStep = 0;
document.querySelector('.help-wrapper__close').addEventListener('click', () => browserWindow.close());
document.querySelector('.next-step').addEventListener('click', () => {
	document.querySelector(`.step--${++currentStep}`).style.opacity = 1;

	if (currentStep === 5) {
		document.querySelector('.next-step .btn__inner').textContent = 'Got it!';
		document.querySelector('.next-step').addEventListener('click', () => {
			browserWindow.close();
			dataStore.saveSettings('tutorialShown', true);
		});
	}
});


text:
# frozen_string_literal: true

if ENV['COVERAGE']
  require 'simplecov'

  ## Start Simplecov
  SimpleCov.start 'rails' do
    add_group 'Redmine Git Hosting', 'plugins/redmine_git_hosting'
  end
end

unless defined? 'HOME_BASE_DIR'
  HOME_BASE_DIR = RUBY_PLATFORM.include?('darwin') ? '/Users' : '/home'
end

## Load Redmine App
ENV['RAILS_ENV'] = 'test'
require File.expand_path "#{File.dirname __FILE__}/../config/environment"
require 'rspec/rails'

## Load FactoryBots factories
Dir[Rails.root.join('plugins/*/spec/factories/**/*.rb')].sort.each { |f| require f }

Dir[Rails.root.join('plugins/*/spec/support/**/*.rb')].sort.each { |f| require f }

## Configure RSpec
RSpec.configure do |config|
  config.include FactoryBot::Syntax::Methods

  config.infer_spec_type_from_file_location!

  config.color = true
  config.fail_fast = false

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.before :suite do
    DatabaseCleaner.clean_with :truncation
  end

  config.before :each do
    DatabaseCleaner.strategy = :transaction
  end

  config.before :each do
    DatabaseCleaner.start
  end

  config.after :each do
    DatabaseCleaner.clean
  end
end

# Disable Test::Unit automatic runner
Test::Unit::AutoRunner.need_auto_run = false if defined?(Test::Unit::AutoRunner)


text:
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import cn from 'classnames';

import { Heading, P } from 'common/base';
import ThumbsUp from 'common/reaction/ThumbsUp';
import Comment from 'common/reaction/Comment';
import styles from './ExperienceBlock.module.css';
import { formatType, formatCreatedAt } from './helper';

const ExperienceBlock = ({ data, size, backable }) => {
  const {
    _id,
    type,
    created_at: createdAt,
    like_count: likeCount,
    reply_count: replyCount,
  } = data;
  const splitter = ' ・ ';

  return (
    <Link
      to={{ pathname: `/experiences/${_id}`, state: { backable } }}
      className={cn(styles.container, styles[size])}
    >

          {`${formatType(type)}${splitter}${formatCreatedAt(createdAt)}`}

        <Heading
          Tag="h2"
          size={size === 'l' ? 'sl' : 'sm'}
          className={styles.heading}
        >
          {data.company.name} {data.job_title}
        </Heading>

        {size === 'l' || size === 'm' ? (

{data.preview} ... ...

        ) : null}
        閱讀更多

        <ThumbsUp count={likeCount} />
        <Comment count={replyCount} />

    </Link>
  );
};

ExperienceBlock.propTypes = {
  data: PropTypes.object.isRequired,
  size: PropTypes.oneOf(['s', 'm', 'l']),
  backable: PropTypes.bool,
};

ExperienceBlock.defaultProps = {
  size: 'm',
  backable: false,
};

export default ExperienceBlock;