text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAPI;

namespace XenAdmin.SettingsPanels
{
    public partial class HostMultipathPage : UserControl, IEditPage
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        private Host host;

        public HostMultipathPage()
        {
            InitializeComponent();

            Text = Messages.MULTIPATHING;

            maintenanceWarningImage.Image = SystemIcons.Information.ToBitmap().GetThumbnailImage(16, 16, null, IntPtr.Zero);

            UpdateMaintenanceWarning();
        }

        private bool MaintenanceMode
        {
            get
            {
                if (host == null)
                    return true;

                Host_metrics metrics = host.Connection.Resolve(host.metrics);

                return host.MaintenanceMode || (metrics != null && !metrics.live);
            }
        }

        private void multipathCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            UpdateMaintenanceWarning();
        }

        private void UpdateMaintenanceWarning()
        {
            bool maintenance_mode = MaintenanceMode;

            maintenanceWarningImage.Visible = !maintenance_mode;
            maintenanceWarningLabel.Visible = !maintenance_mode;

            multipathCheckBox.Enabled = maintenance_mode;
        }

        #region IEditPage Members

        public void SetXenObjects(IXenObject orig, IXenObject clone)
        {
            host = clone as Host;
            UpdateMaintenanceWarning();
            Repopulate();
        }

        public void Repopulate()
        {
            if (host == null)
                return;

            multipathCheckBox.Checked = host.MultipathEnabled;
        }

        public AsyncAction SaveSettings()
        {
            return new EditMultipathAction(host, multipathCheckBox.Checked, true);
        }

        public bool ValidToSave
        {
            get
            {
                return true;
            }
        }

        public void ShowLocalValidationMessages()
        {
        }

        public void Cleanup()
        {
        }

        public bool HasChanged
        {
            get
            {
                return multipathCheckBox.Checked != host.MultipathEnabled;
            }
        }

        public String SubText
        {
            get
            {
                return multipathCheckBox.Checked ? Messages.MULTIPATH_ACTIVE : Messages.MULTIPATH_NOT_ACTIVE;
            }
        }

        public Image Image
        {
            get
            {
                return Properties.Resources._000_Storage_h32bit_16;
            }
        }

        #endregion
    }
}


text:
object Variables {
  private var mutableVariable = 0
  private val immutableVariable = 0

  def incrementMutableVariable: Int = {
    mutableVariable = mutableVariable + 1
    mutableVariable
  }

  // Won't compile
//  def incrementImmutableVariable = immutableVariable = immutableVariable + 1
}

//"The Scala perspective, however, is that val and var are
// just two different tools in your toolbox, both useful,
// neither inherently evil. Scala encourages you to lean
// towards vals, but ultimately reach for the best tool
// given the job at hand."
// -- Programming in Scala 3rd Ed
//    Martin Odersky, Lex Spoon, Bill Venners

redpajama_set_name: RedPajamaGithub


text:
'''
Created on Dec 18, 2015

@author: Aaron Klein
'''
import unittest
import george
import numpy as np

from robo.models.gaussian_process import GaussianProcess
from robo.priors import default_priors
from robo.initial_design.init_random_uniform import init_random_uniform
from robo.acquisition.information_gain_per_unit_cost import InformationGainPerUnitCost
from robo.task.synthetic_functions.sin_func import SinFunction
from robo.task.base_task import BaseTask

class TestTask(BaseTask):

    def __init__(self):
        self.original_task = SinFunction()

        # Add an additional dimension for the system size
        X_lower = np.concatenate((self.original_task.original_X_lower,
                                  np.array([0])))

        X_upper = np.concatenate((self.original_task.original_X_upper,
                                  np.array([1])))

        self.is_env = np.zeros([self.original_task.n_dims])
        self.is_env = np.concatenate((self.is_env, np.ones([1])))

        super(TestTask, self).__init__(X_lower, X_upper)

    def objective_function(self, x):
        y = self.original_task.objective_function(x[:, self.is_env == 0]) \
            * np.exp(-(x[:, np.newaxis, -1] - 1))

        cost = np.exp(x[:, self.is_env == 1])

        return y, cost

    def objective_function_test(self, x):
        return self.original_task.objective_function(x[:, self.is_env == 0])

class Test(unittest.TestCase):

    def setUp(self):

        self.task = TestTask()

        kernel = george.kernels.Matern52Kernel(np.ones([self.task.n_dims]) * 0.01,
                                                       ndim=self.task.n_dims)

        noise_kernel = george.kernels.WhiteKernel(1e-9, ndim=self.task.n_dims)
        kernel = 3000 * (kernel + noise_kernel)

        prior = default_priors.TophatPrior(-2, 2)
        model = GaussianProcess(kernel, prior=prior)

        cost_kernel = george.kernels.Matern52Kernel(np.ones([self.task.n_dims]) * 0.01,
                                                       ndim=self.task.n_dims)

        cost_noise_kernel = george.kernels.WhiteKernel(1e-9,
                                                       ndim=self.task.n_dims)
        cost_kernel = 3000 * (cost_kernel + cost_noise_kernel)

        prior = default_priors.TophatPrior(-2, 2)
        cost_model = GaussianProcess(cost_kernel, prior=prior)

        X = init_random_uniform(self.task.X_lower, self.task.X_upper, 3)
        Y, C = self.task.evaluate(X)

        model.train(X, Y, do_optimize=False)
        cost_model.train(X, C, do_optimize=False)
        self.acquisition_func = InformationGainPerUnitCost(model,
                                                    cost_model,
                                                    self.task.X_lower,
                                                    self.task.X_upper,
                                                    self.task.is_env)

        self.acquisition_func.update(model, cost_model)

    def test_sampling_representer_points(self):
        # Check if representer points are inside the configuration subspace
        assert np.any(self.acquisition_func.zb[self.task.is_env == 1] ==
                        self.acquisition_func.X_upper[self.task.is_env == 1])

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()


text:
'''
Created on Jun 7, 2015

@author: tobimag
'''
import unittest
from network import Server

class Test(unittest.TestCase):

    def testPutData(self):
        server = Server(user='test')
        temp = 34.3
        timeLeft = 78.3
        server.putEstimationData(temp, timeLeft)
        pass

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testPut']
    unittest.main()


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ssl_stream::read_some (1 of 2 overloads)</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../read_some.html" title="ssl_stream::read_some">
<link rel="prev" href="../read_some.html" title="ssl_stream::read_some">
<link rel="next" href="overload2.html" title="ssl_stream::read_some (2 of 2 overloads)">

Home
Libraries
People
FAQ
More

ssl_stream::read_some
          (1 of 2 overloads)

            Read some data from the stream.

<h7>
            Synopsis
          </h7>
template<
    class MutableBufferSequence>
std::size_t
read_some(
    MutableBufferSequence const& buffers);

<h7>
            Description
          </h7>

            This function is used to read data from the stream. The function call
            will block until one or more bytes of data has been read successfully,
            or until an error occurs.

<h7>
            Parameters
          </h7>

<colgroup>
<col>
<col>
</colgroup>

                      Name

                      Description

                      buffers

                      The buffers into which the data will be read.

<h7>
            Return
            Value
          </h7>

            The number of bytes read.

<h7>
            Exceptions
          </h7>

<colgroup>
<col>
<col>
</colgroup>

                      Type

                      Thrown On

                      boost::system::system_error

                      Thrown on failure.

<h7>
            Remarks
          </h7>

            The read_some operation
            may not read all of the requested number of bytes. Consider using the
            net::read
            function if you need to ensure that the requested amount of data is read
            before the blocking operation completes.

Copyright © 2016-2019 Vinnie
      Falco

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
package equipment.impl;

/**
 * 2/20/16
 * @author {anobis}
 */
public class Glove extends Armour {
    private static final int MAX_SOCKETS = 4;
    private static final int MAX_LINKS = 4;

    public Glove(int level, int numSockets, int numLinks, BaseType type) {
        super(level, numSockets, numLinks, type);
    }
}


text:
package drt.client.components

import drt.client.SPAMain._
import drt.client.components.styles.DefaultFormFieldsStyle
import drt.client.logger.{Logger, LoggerFactory}
import drt.client.modules.GoogleEventTracker
import drt.client.services.JSDateConversions.SDate
import drt.client.services.LoadingState
import drt.shared.SDateLike
import drt.shared.dates.LocalDate
import io.kinoplan.scalajs.react.material.ui.core.{MuiGrid, MuiTextField}
import japgolly.scalajs.react.component.Scala.Component
import japgolly.scalajs.react.extra.router.RouterCtl
import japgolly.scalajs.react.vdom.html_<^._
import japgolly.scalajs.react.{Callback, CtorType, ReactEventFromInput, Reusability, ScalaComponent}
import scalacss.ScalaCssReactImplicits

object DaySelectorComponent extends ScalaCssReactImplicits {

  val log: Logger = LoggerFactory.getLogger(getClass.getName)

  case class Props(router: RouterCtl[Loc],
                   terminalPageTab: TerminalPageTabLoc,
                   loadingState: LoadingState,
                   minuteTicker: Int
                  )

  case class State(date: LocalDate) {
    def selectedDate: SDateLike = SDate(date)

    def update(d: LocalDate): State = copy(date = d)
  }

  val today: SDateLike = SDate.now()

  implicit val propsReuse: Reusability[Props] = Reusability.by(
    p => (p.terminalPageTab.viewMode.hashCode(), p.loadingState.isLoading, p.minuteTicker)
  )

  implicit val stateReuse: Reusability[State] = Reusability.by(_.hashCode())

  val component: Component[Props, State, Unit, CtorType.Props] = ScalaComponent.builder[Props]("DatePicker")
    .initialStateFromProps { p =>
      val viewMode = p.terminalPageTab.viewMode
      val time = viewMode.time
      State(time.toLocalDate)
    }
    .renderPS(r = (scope, props, state) => {

      def isCurrentSelection = state.selectedDate.ddMMyyString == props.terminalPageTab.dateFromUrlOrNow.ddMMyyString

      def updateState(e: ReactEventFromInput): Callback = {
        e.persist()
        LocalDate.parse(e.target.value) match {
          case Some(d) =>
            scope.modState(_.update(d))
          case _ => Callback.empty
        }
      }

      def updateUrlWithDateCallback(date: Option[SDateLike]): Callback =
        props.router.set(
          props
            .terminalPageTab
            .withUrlParameters(UrlDateParameter(date.map(_.toISODateOnly)), UrlTimeRangeStart(None), UrlTimeRangeEnd(None))
        )

      def selectPointInTime = (_: ReactEventFromInput) => {
        GoogleEventTracker.sendEvent(props.terminalPageTab.terminalName, "Point In time", state.selectedDate.toISODateOnly)
        updateUrlWithDateCallback(Option(state.selectedDate))
      }

      def selectYesterday = (_: ReactEventFromInput) => {
        val yesterday = SDate.midnightThisMorning().addMinutes(-1)
        GoogleEventTracker.sendEvent(props.terminalPageTab.terminalName, "Yesterday", yesterday.toISODateOnly)
        updateUrlWithDateCallback(Option(yesterday))
      }

      def selectTomorrow = (_: ReactEventFromInput) => {
        val tomorrow = SDate.midnightThisMorning().addDays(2).addMinutes(-1)
        GoogleEventTracker.sendEvent(props.terminalPageTab.terminalName, "Tomorrow", tomorrow.toISODateOnly)
        updateUrlWithDateCallback(Option(tomorrow))
      }

      def selectToday = (_: ReactEventFromInput) => {
        GoogleEventTracker.sendEvent(props.terminalPageTab.terminalName, "Today", "Today")
        updateUrlWithDateCallback(None)
      }

      def goButton(loading: Boolean, isCurrentSelection: Boolean): TagMod = (loading, isCurrentSelection) match {
        case (true, true) =>
          <.div(^.id := "snapshot-done", Icon.spinner)
        case (false, true) =>
          <.div(^.id := "snapshot-done", Icon.checkCircleO)
        case _ =>
          <.div(^.id := "snapshot-done", <.input.button(^.value := "Go", ^.className := "btn btn-primary", ^.onClick ==> selectPointInTime))
      }

      val yesterdayActive = if (state.selectedDate.ddMMyyString == SDate.now().addDays(-1).ddMMyyString) "active" else ""

      def isTodayActive = state.selectedDate.ddMMyyString == SDate.now().ddMMyyString

      val todayActive = if (isTodayActive) "active" else ""

      val tomorrowActive = if (state.selectedDate.ddMMyyString == SDate.now().addDays(1).ddMMyyString) "active" else ""

      def defaultTimeRangeWindow = if (isTodayActive)
        CurrentWindow()
      else
        WholeDayWindow()

      MuiGrid(container = true, spacing = MuiGrid.Spacing.`0`)(^.className := "date-selector",
        DefaultFormFieldsStyle.daySelector,
        MuiGrid(item = true, xs = 6)(
          <.div(^.className := "btn-group no-gutters", VdomAttr("data-toggle") := "buttons",
            <.div(^.id := "yesterday", ^.className := s"btn btn-primary $yesterdayActive", "Yesterday", ^.onClick ==> selectYesterday),
            <.div(^.id := "today", ^.className := s"btn btn-primary $todayActive", "Today", ^.onClick ==> selectToday),
            <.div(^.id := "tomorrow", ^.className := s"btn btn-primary $tomorrowActive end-spacer", "Tomorrow", ^.onClick ==> selectTomorrow)),
        ),
        MuiGrid(item = true, xs = 6)(
          MuiGrid(container = true, spacing = MuiGrid.Spacing.`16`)(
            MuiGrid(item = true, xs = 7)(
              MuiTextField()(
                DefaultFormFieldsStyle.datePicker,
                ^.`type` := "date",
                ^.defaultValue := s"${state.date.toISOString}",
                ^.onChange ==> updateState
              )
            ),
            MuiGrid(item = true, xs = 5)(
              DefaultFormFieldsStyle.goButton,
              goButton(props.loadingState.isLoading, isCurrentSelection),
            )
          )
        ),
        MuiGrid(item = true, xs = 12)(
          TimeRangeFilter(
            TimeRangeFilter.Props(props.router, props.terminalPageTab, defaultTimeRangeWindow, isTodayActive, props.minuteTicker)
          )
        )
      )

    })
    .configure(Reusability.shouldComponentUpdate)
    .build

  def apply(props: Props): VdomElement = component(props)
}


text:
# Underscored Attributes Reference

**WARNING:** This information is provided primarily for compiler and standard
library developers. Usage of these attributes outside of the Swift monorepo
is STRONGLY DISCOURAGED.

The Swift reference has a chapter discussing [stable attributes][Attributes].
This document is intended to serve as a counterpart describing underscored
attributes, whose semantics are subject to change and most likely need to
go through the Swift evolution process before being stabilized.

[Attributes]: https://docs.swift.org/swift-book/ReferenceManual/Attributes.html

The attributes are organized in alphabetical order.

## `@_alignment(numericValue)`

Allows controlling the alignment of a type.

The alignment value specified must be a power of two, and cannot be less
than the "natural" alignment of the type that would otherwise be used by
the Swift ABI. This attribute is intended for the SIMD types in the standard
library which use it to increase the alignment of their internal storage to at
least 16 bytes.

## `@_alwaysEmitConformanceMetadata`

Forces conformances of the attributed protocol to always have their Type Metadata get emitted into the binary and prevents it from being optimized away or stripped by the linker.

## `@_alwaysEmitIntoClient`

Forces the body of a function to be emitted into client code.

Note that this is distinct from `@inline(__always)`; it doesn't force inlining
at call-sites, it only means that the implementation is compiled into the
module which uses the code.

This means that `@_alwaysEmitIntoClient` definitions are _not_ part of the
defining module's ABI, so changing the implementation at a later stage
does not break ABI.

Most notably, default argument expressions are implicitly
`@_alwaysEmitIntoClient`, which means that adding a default argument to a
function which did not have one previously does not break ABI.

## `@_assemblyVision`

Forces emission of assembly vision remarks for a function or method, showing
where various runtime calls and performance impacting hazards are in the code
at source level after optimization.

Adding this attribute to a type leads to remarks being emitted for all methods.

## `@_backDeploy(before: ...)`

Causes the body of a function to be emitted into the module interface to be
available for emission into clients with deployment targets lower than the
ABI availability of the function. When the client's deployment target is
before the function's ABI availability, the compiler replaces calls to that
function with a call to a thunk that checks at runtime whether the original
library function is available. If the original is available then it is
called. Otherwise, the fallback copy of the function that was emitted into the
client is called instead.

For more details, see the [pitch thread](https://forums.swift.org/t/pitch-function-back-deployment/55769/)
in the forums.

## `@_borrowed`

Indicates that the [conservative access pattern](/docs/Lexicon.md#access-pattern)
for some storage (a subscript or a property) should use the `_read` accessor
instead of `get`.

For more details, see the forum post on
[Value ownership when reading from a storage declaration](https://forums.swift.org/t/value-ownership-when-reading-from-a-storage-declaration/15076).

## `@_cdecl("cName")`

Similar to `@_silgen_name` but uses the C calling convention.

This attribute doesn't have very well-defined semantics. Type bridging is not
done, so the parameter and return types should correspond directly to types
accessible in C. In most cases, it is preferable to define a static method
on an `@objc` class instead of using `@_cdecl`.

For potential ideas on stabilization, see
[Formalizing `@cdecl`](https://forums.swift.org/t/formalizing-cdecl/40677).

## `@_disfavoredOverload`

Marks an overload that the type checker should try to avoid using. When the
expression type checker is considering overloads, it will prefer a solution
with fewer `@_disfavoredOverload` declarations over one with more of them.

Use `@_disfavoredOverload` to work around known bugs in the overload
resolution rules that cannot be immediately fixed without a source break.
Don't use it to adjust overload resolution rules that are otherwise sensible
but happen to produce undesirable results for your particular API; it will
likely be removed or made into a no-op eventually, and then you will be
stuck with an overload set that cannot be made to function in the way
you intend.

`@_disfavoredOverload` was first introduced to work around a bug in overload
resolution with `ExpressibleByXYZLiteral` types. The type checker strongly
prefers to give literals their default type (e.g. `Int` for
`ExpressibleByIntegerLiteral`, `String` for `ExpressibleByStringLiteral`,
etc.). If an API should prefer some other type, but accept the default too,
 marking the declaration taking the default type with `@_disfavoredOverload`
 gives the desired behavior:

```swift
extension LocalizedStringKey: ExpressibleByStringLiteral { ... }

extension Text {
  // We want `Text("foo")` to use this initializer:
  init(_ key: LocalizedStringKey) { ... }

  // But without @_disfavoredOverload, it would use this one instead,
  // because that lets it give the literal its default type:
  @_disfavoredOverload init<S: StringProtocol>(_ str: S) { ... }
}
```

## `@_documentation(metadata: ...)`

Adds "documentation metadata" to the symbol. The identifier in the attribute is
added to the symbol graph in the `"metadata"` field of the symbol. This can be
used to add an arbitrary grouping or other indicator to symbols for use in
documentation.

## `@_documentation(visibility: ...)`

Forces the symbol to be treated as the given access level when checking
visibility. This can be used to, for example, force a symbol with an underscored
name to appear in `public` symbol graphs, or treat an otherwise-`public` symbol
as being `internal` or `private` for the purposes of documentation, to hide it
from `public` docs.

This can also be applied to `@_exported import` statements to only include the
imported symbols in symbol graphs with the given minimum access level. For
example, applying `@_documentation(visibility: internal)` to an `@_exported
import` statement will hide the imported symbols from `public` symbol graphs and
documentation, but show them on `internal` symbol graphs and documentation.

## `@_dynamicReplacement(for: targetFunc(label:))`

Marks a function as the dynamic replacement for another `dynamic` function.
This is similar to method swizzling in other languages such as Objective-C,
except that the replacement happens at program start (or loading a shared
library), instead of at an arbitrary point in time.

For more details, see the forum post on
[dynamic method replacement](https://forums.swift.org/t/dynamic-method-replacement/16619).

## `@_eagerMove`

When applied to a value, indicates that the value's lifetime is _not_ lexical,
that releases of the value may be hoisted without respect to deinit barriers.

When applied to a type, indicates that all values which are _statically_
instances of that type are themselves `@_eagerMove` as above, unless overridden
with `@_lexical`.

Aggregates all of whose fields are `@_eagerMove` or trivial are inferred to be
`@_eagerMove`.

Note that a value of an `@_eagerMove` type that is passed to a generic API (to a
parameter not annotated `@_eagerMove` will, in that generic function's context,
not be statically an instance of the `@_eagerMove` type.  As a result it will
have a lexical lifetime in that function.

## `@_effects(effectname)`

Tells the compiler that the implementation of the defined function is limited
to certain side effects. The attribute argument specifies the kind of side
effect limitations that apply to the function including any other functions
it calls. This is used to provide information to the optimizer that it can't
already infer from static analysis.

Changing the implementation in a way that violates the optimizer's assumptions
about the effects results in undefined behavior.

### `@_effects(readnone)`

Defines that the function does not have any observable memory reads or writes
or any other observable side effects.

This does not mean that the function cannot read or write memory at all.
For example, it's allowed to allocate and write to local objects inside the
function. For example, the following `readnone` function allocates an array and
writes to the array buffer

```swift
@_effects(readnone)
func lookup(_ i: Int) -> Int {
  let a = [7, 3 ,6, 9]
  return a[i]
}
```

A function can be marked as readnone if two calls of the same function with the
same parameters can be simplified to one call (e.g. by the CSE optimization)
without changing the semantics of the program.
For example,

```swift
  let a = lookup(i)
  // some other code, including memory writes
  let b = lookup(i)
```
is equivalent to

```swift
  let a = lookup(i)
  // some other code, including memory writes
  let b = a
```

Some conclusions:

* A `readnone` function must not return a newly allocated class instance.

* A `readnone` function can return a newly allocated copy-on-write object, like
  an Array, because COW data types conceptually behave like value types.

* A `readnone` function must not release any parameter or any object indirectly
  referenced from a parameter.

* Any kind of observable side-effects are not allowed, like `print`, file IO, etc.

### `@_effects(readonly)`

Defines that the function does not have any observable memory writes or any
other observable side effects, beside reading of memory.

Similar to `readnone`, a `readonly` function is allowed to write to local objects.

A function can be marked as `readonly` if it's save to eliminate a call to such
a function in case its return value is not used.
Example:

```swift
@_effects(readonly)
func lookup2(_ instance: SomeClass) -> Int {
  let a = [7, 3 ,6, 9]
  return a[instance.i]
}
```

It is legal to eliminate an unused call to this function:

```
_ = lookup2(i)  // can be completely eliminated
```

Note that it would not be legal to CSE two calls to this function, because
between those calls the member `i` of the class instance could be modified:

```swift
  let a = lookup2(instance)
  instance.i += 1
  let b = lookup2(instance)   // cannot be CSE'd with the first call
```

The same conclusions as for `readnone` also apply to `readonly`.

### `@_effects(releasenone)`

Defines that the function does not release any class instance.

This effect must be used with care.
There are several code patterns which release objects in a non-obvious way.
For example:

* A parameter which is passed to an "owned" argument (and not stored), like
  initializer arguments.

* Assignments, because they release the old value

* COW data types, e.g. Strings. Conceptually they are value types, but
  internally the keep a reference counted buffer.

* Class references deep inside a hierarchy of value types.

### `@_effects(readwrite)`

This effect is not used by the compiler.

### `@_effects(notEscaping <selection>)`

Tells the compiler that a function argument does not escape.
The _selection_ specifies which argument or which "projection" of an argument
does not escape. The _selection_ consists of the argument name or `self` and
an optional projection path.

The projection path consists of field names or one of the following wildcards:

* `class*`: selects any class field, including tail allocated elements
* `value**`: selects any number and any kind of struct, tuple or enum
             fields/payload-cases.
* `**`: selects any number of any fields

For example:

```swift
struct Inner {
  let i: Class
}
struct Str {
	let a: Inner
	let b: Class
}

@_effects(notEscaping s.b)    // s.b does not escape, but s.a.i can escape
func foo1(_ s: Str) { ... }

@_effects(notEscaping s.v**)  // s.b and s.a.i do not escape
func foo2(_ s: Str) { ... }

@_effects(notEscaping s.**)   // s.b, s.a.i and all transitively reachable
                              // references from there do not escape
func foo3(_ s: Str) { ... }
```

### `@_effects(escaping <from-selection> => <to-selection>)`

Defines that an argument escapes to another argument or to the return value,
but not otherwise.
The _to-selection_ can also refer to `return`.

For example:

```swift
@_effects(escapes s.b => return)
func foo1(_ s: Str) -> Class {
  return s.b
}

@_effects(escapes s.b => o.a.i)
func foo2(_ s: Str, o: inout Str) {
  o.a.i = s.b
}
```

### `@_effects(escaping <from-selection> -> <to-selection>)`

This variant of an escaping effect defines a "non-exclusive" escape. This means
that not only the _from-selection_, but also other values
can escape to the _to-selection_.

For example:

```swift
var g: Class

@_effects(escapes s.b -> return)
func foo1(_ s: Str, _ cond: Bool) -> Class {
  return cond ? s.b : g
}
```

## `@_exported`

Re-exports all declarations from an imported module.

This attribute is most commonly used by overlays.

```swift
// module M
public func f() {}

// module N
@_exported import M

// module P
import N
func g() {
  N.f() // OK
}
```

## `@_expose(<language>)`

Indicates that a particular declaration should be included
in the emitted specified foreign language binding.

When applied to a nominal type declaration, all of the
public declarations inside this type become exposed as well.

### `_expose(Cxx[, <"cxxName">])`

Indicates that a particular declaration should be included
in the generated C++ binding header.

The optional "cxxName" string will be used as the name of
the generated C++ declaration.

## `@_fixed_layout`

Same as `@frozen` but also works for classes.

With `@_fixed_layout` classes, vtable layout still happens dynamically, so
non-public virtual methods can be removed, new virtual methods can be added,
and existing virtual methods can be reordered.

## `@_hasInitialValue`

Marks that a property has an initializing expression.

This information is lost in the swiftinterface,
but it is required as it results in a symbol for the initializer
(if a class/struct `init` is inlined, it will call initializers
for properties that it doesn't initialize itself).
This information is necessary for correct TBD file generation.

## `@_hasMissingDesignatedInitializers`

Indicates that there may be designated initializers that are
not printed in the swiftinterface file for a particular class.

This attribute is needed for the initializer model to maintain correctness when
[library evolution](/docs/LibraryEvolution.rst) is enabled. This is because a
class may have non-public designated initializers, and Swift allows the
inheritance of convenience initializers if and only if the subclass overrides
(or has synthesized overrides) of every designated initializer in its
superclass. Consider the following code:

```swift
// Lib.swift
open class A {
  init(invisible: ()) {}

  public init(visible: ()) {}
  public convenience init(hi: ()) { self.init(invisible: ()) }
}

// Client.swift
class B : A {
  var x: String

  public override init(visible: ()) {
    self.x = "Garbage"
    super.init(visible: ())
  }
}
```

In this case, if `B` were allowed to inherit the convenience initializer
`A.init(invisible:)` then an instance created via `B(hi: ())` would fail
to initialize `B.x` resulting in a memory safety hole. What's worse is
there is no way to close this safety hole because the user cannot override
the invisible designated initializer because they lack sufficient visibility.

## `@_hasStorage`

Marks a property as being a stored property in a swiftinterface.

For `@frozen` types, the compiler needs to be able to tell whether a particular
property is stored or computed to correctly perform type layout.

```swift
@frozen struct S {
  @_hasStorage var x: Int { get set } // stored
  var y: Int { get set } // computed
}
```

## `@_implementationOnly`

Used to mark an imported module as an implementation detail.
This prevents types from that module being exposed in API
(types of public functions, constraints in public extension etc.)
and ABI (usage in `@inlinable` code).

## `@_spiOnly`

Marks an import to be used in SPI and implementation details only.
The import statement will be printed in the private swiftinterface only and
skipped in the public swiftinterface. Any use of imported types and decls in API
will be diagnosed.

## `@_implements(ProtocolName, Requirement)`

An attribute that indicates that a function with one name satisfies
a protocol requirement with a different name. This is especially useful
when two protocols declare a requirement with the same name, but the
conforming type wishes to offer two separate implementations.

```swift
protocol P { func foo() }

protocol Q { func foo() }

struct S : P, Q {
  @_implements(P, foo())
  func foo_p() {}
  @_implements(Q, foo())
  func foo_q() {}
}
```

## `@_implicitSelfCapture`

Allows access to `self` inside a closure without explicitly capturing it,
even when `Self` is a reference type.

```swift
class C {
  func f() {}
  func g(_: @escaping () -> Void) {
    g({ f() }) // error: call to method 'f' in closure requires explicit use of 'self'
  }
  func h(@_implicitSelfCapture _: @escaping () -> Void) {
    h({ f() }) // ok
  }
}
```

## `@_inheritActorContext`

(Note that it is "inherit", not "inherits", unlike below.)

Marks that a `@Sendable async` closure argument should inherit the actor
context (i.e. what actor it should be run on) based on the declaration site
of the closure. This is different from the typical behavior, where the closure
may be runnable anywhere unless its type specifically declares that it will
run on a specific actor.

## `@_inheritsConvenienceInitializers`

An attribute that signals that a class declaration inherits its convenience
initializers from its superclass. This implies that all designated initializers
-- even those that may not be visible in a swiftinterface file -- are
overridden. This attribute is often printed alongside
`@_hasMissingDesignatedInitializers` in this case.

## `@_lexical`

When applied to a value, indicates that the value's lifetime is lexical, that
releases of the value may not be hoisted over deinit barriers.

This is the default behavior, unless the value's type is annotated
`@_eagerMove`, in which case this attribute overrides that type-level
annotation.

When applied to a type, indicates that all values which are instances of that
type are themselves `@_lexical` as above.

This is the default behavior, unless the type annotated is an aggregate that
consists entirely of `@_eagerMove` or trivial values, in which case the
attribute overrides the inferred type-level annotation.

## `@_marker`

Indicates that a protocol is a marker protocol. Marker protocols represent some
meaningful property at compile-time but have no runtime representation.

For more details, see [](https://github.com/apple/swift-evolution/blob/main/proposals/0302-concurrent-value-and-concurrent-closures.md#marker-protocols), which introduces marker protocols.
At the moment, the language only has one marker protocol: `Sendable`.

Fun fact: Rust has a very similar concept called
[marker traits](https://doc.rust-lang.org/std/marker/index.html),
including one called `Send`,
which inspired the design of `Sendable`.

## `@_noAllocation`, `@_noLocks`

These attributes are performance annotations. If a function is annotated with
such an attribute, the compiler issues a diagnostic message if the function
calls a runtime function which allocates memory or locks, respectively.
The `@_noLocks` attribute implies `@_noAllocation` because a memory allocation
also locks.

## `@_noImplicitCopy`

Marks a var decl as a variable that must be copied explicitly using the builtin
function Builtin.copy.

## `@_nonEphemeral`

Marks a function parameter that cannot accept a temporary pointer produced from
an inout-to-pointer, array-to-pointer, or string-to-pointer conversion. Such a
parameter may only accept a pointer that is guaranteed to outlive the duration
of the function call.

Attempting to pass a temporary pointer to an `@_nonEphemeral` parameter will
produce a warning. This attribute is primarily used within the standard library
on the various `UnsafePointer` initializers to warn users about
the undefined behavior caused by using a temporary pointer conversion as an
argument:

```swift
func baz() {
  var x = 0

  // warning: Initialization of 'UnsafePointer<Int>' results in a dangling pointer
  let ptr = UnsafePointer(&x)

  // warning: Initialization of 'UnsafePointer<Int>' results in a dangling pointer
  let ptr2 = UnsafePointer([1, 2, 3])
}
```

The temporary pointer conversion produces a pointer that is only
guaranteed to be valid for the duration of the call to the initializer,
and becomes invalid once the call ends.
So the newly created `UnsafePointer` will be dangling.

One exception to this is that inout-to-pointer conversions
on static stored properties and global stored properties
produce non-ephemeral pointers, as long as they have no observers:

```swift
var global = 0

struct S {
  static var staticVar = 0
}

func baz() {
  let ptr = UnsafePointer(&global) // okay
  let ptr2 = UnsafePointer(&S.staticVar) // okay
}
```

Additionally, if they are of a tuple or struct type, their stored members
without observers may also be passed inout as non-ephemeral pointers.

For more details, see the educational note on
[temporary pointer usage](/userdocs/diagnostics/temporary-pointers.md).

## `@_nonoverride`

Marks a declaration that is not an override of another.
When the `-warn-implicit-overrides` flag is used, a warning is issued when a
protocol restates a requirement from another protocol it refines without
annotating the declaration with either `override` or `@_nonoverride`.

An `override` annotation causes the overriding declaration to be treated
identically to the overridden declaration; a conforming type can only
provide one implementation ("witness"). Restating a protocol requirement
and then marking it as an `override` is generally only needed to help
associated type inference, and many `override` annotations correlate
closely with ABI FIXMEs.

Meanwhile, `@_nonoverride` is the "opposite" of `override`, allowing two
protocol requirements to be treated independently; a conforming type can
provide a distinct witness for each requirement (for example, by using
`@_implements`). Use `@_nonoverride` when semantics differ between the
two requirements. For example, `BidirectionalCollection.index(_:offsetBy:)`
allows negative offsets, while `Collection.index(_:offsetBy:)` does not,
and therefore the former is marked `@_nonoverride`.

The `@_nonoverride` annotation can also be specified on class members in
addition to protocol members. Since it is the "opposite" of `override`, it can
be used to suppress "near-miss" diagnostics for declarations that are similar
to but not meant to override another declaration, and it can be used to
intentionally break the override chain, creating an overload instead of an
override.

This attribute and the corresponding `-warn-implicit-overrides` flag are
used when compiling the standard library and overlays.

## `@_nonSendable`

There is no clang attribute to add a Swift conformance to an imported type, but
there *is* a clang attribute to add a Swift attribute to an imported type. So
`@Sendable` (which is not normally allowed on types) is used from clang headers
to indicate that an unconstrained, fully available `Sendable` conformance should
be added to a given type, while `@_nonSendable` indicates that an unavailable
`Sendable` conformance should be added to it.

`@_nonSendable` can have no options after it, in which case it "beats"
`@Sendable` if both are applied to the same declaration, or it can have
`(_assumed)` after it, in which case `@Sendable` "beats" it.
`@_nonSendable(_assumed)` is intended to be used when mass-marking whole regions
of a header as non-`Sendable` so that you can make spot exceptions with
`@Sendable`.

## `@_objc_non_lazy_realization`

Marks a class as being non-lazily (i.e. eagerly) [realized](/docs/Lexicon.md#realization).

This is used for declarations which may be statically referenced and wouldn't
go through the normal lazy realization paths. For example, the empty array
class must be non-lazily realized, because empty arrays are statically
allocated. Otherwise, passing the empty array object to other code without
triggering realization could allow for the unrealized empty array class to be
passed to ObjC runtime APIs which only operate on realized classes, resulting
in a crash.

## `@_optimize([none|size|speed])`

Controls the compiler's optimization mode. This attribute is analogous to the
command-line flags `-Onone`, `-Osize` and `-Ospeed` respectively, but limited
to a single function body.

`@_optimize(none)` is handy for diagnosing and reducing compiler bugs as well
as improving debugging in Release builds.

## `@_originallyDefinedIn(module: "ModuleName", availabilitySpec...)`

Marks a declaration as being originally defined in a different module,
changing the name mangling. This can be used to move declarations
from a module to one of the modules it imports without breaking clients.

Consider the following example where a framework ToasterKit needs
to move some APIs to a lower-level framework ToasterKitCore.
Here are the necessary changes:

1. Add a linker flag `-reexport_framework ToasterKitCore` for ToasterKit.
   This ensures all symbols defined in ToasterKitCore will be accessible during
   runtime via ToasterKit, so existing apps continue to run.
2. In ToasterKit, use `@_exported import ToasterKitCore`.
   This ensures existing source code that only imports ToasterKit continues to
   type-check.
3. Move the necessary declarations from ToasterKit to ToasterKitCore.
   The moved declaration should have two attributes:
   - `@available` indicating when the declaration was introduced in ToasterKit.
   - `@_originallyDefinedIn` indicating the original module and when the
     declaration was moved to ToasterKitCore.
   ```swift
   @available(toasterOS 42, *)
   @_originallyDefinedIn(module: "ToasterKit", toasterOS 57)
   enum Toast {
   case underdone
   case perfect
   case burnt
   }
   ```
4. Add Swift compiler flags `-Xfrontend -emit-ldadd-cfile-path -Xfrontend /tmp/t.c`
   to ToasterKitCore's build settings. Add the emitted `/tmp/t.c` file to
   ToasterKit's compilation.
   This ensures when an app is built for deployment targets prior to the symbols' move,
   the app will look for these symbols in ToasterKit instead of ToasterKitCore.

More generally, multiple availabilities can be specified, like so:

```swift
@available(toasterOS 42, bowlOS 54, mugOS 54, *)
@_originallyDefinedIn(module: "ToasterKit", toasterOS 57, bowlOS 69, mugOS 69)
enum Toast { ... }
```

## `@_private(sourceFile: "FileName.swift")`

Fully bypasses access control, allowing access to private declarations
in the imported module. The imported module needs to be compiled with
`-Xfrontend -enable-private-imports` for this to work.

## `@_semantics("uniquely.recognized.id")`

Allows the optimizer to make use of some key invariants in performance critical
data types, especially `Array`. Since the implementation of these data types
is written in Swift using unsafe APIs, without these attributes the optimizer
would need to make conservative assumptions.

Changing the implementation in a way that violates the optimizer's assumptions
about the semantics results in undefined behavior.

## `@_show_in_interface`

Shows underscored protocols from the standard library in the generated interface.

By default, SourceKit hides underscored protocols from the generated
swiftinterface (for all modules, not just the standard library), but this
attribute can be used to override that behavior for the standard library.

## `@_silgen_name("cName")`

Changes the symbol name for a function, similar to an ASM label in C,
except that the platform symbol mangling (leading underscore on Darwin)
is maintained.

Since this has label-like behavior, it may not correspond to any declaration;
if so, it is assumed that the function is implemented in C.

A function defined by `@_silgen_name` is assumed to use the Swift ABI.

For more details, see the
[Standard Library Programmer's Manual](https://github.com/apple/swift/blob/main/docs/StandardLibraryProgrammersManual.md#_silgen_name).

## `@_specialize(...)`

Forces generation of a specialized implementation for a generic declaration.

See [Generics.rst](/docs/Generics.rst) for more details.

## `@_specializeExtension`

Allows extending `@usableFromInline` internal types from foreign modules.
Consider the following example involving two modules:

```swift
// Module A
@usableFromInline
internal struct S<T> { /* ... */ }

// Module B
import A

@_specializeExtension
extension S { // OK
  // add methods here
}

extension S /* or A.S */ { // error: cannot find 'S' in scope
}
```

This ability can be used to add specializations of existing methods
in downstream libraries when used in conjunction with `@_specialize`.

```swift
// Module A
@usableFromInline
internal struct S<T> {
  @inlinable
  internal func doIt() { /* body */ }
}

// Module B
import A

@_specializeExtension
extension S { // ok
  @_specialize(exported: true, target: doIt(), where T == Int)
  public func specializedDoIt() {}
}

// Module C
import A
import B

func f(_ s: S<Int>) {
  s.doIt() // will call specialized version of doIt() where T == Int from B
}
```

## `@_spi(spiName)`

Marks a declaration as SPI (System Programming Interface), instead of API.
Modules exposing SPI and using library evolution generate an additional
`.private.swiftinterface` file (with `-emit-private-module-interface-path`)
in addition to the usual `.swiftinterface` file. This private interface exposes
both API and SPI.

Clients can access SPI by marking the import as `@_spi(spiName) import Module`.
This design makes it easy to find out which clients are using certain SPIs by
doing a textual search.

## `@_spi_available(platform, version)`

Like `@available`, this attribute indicates a decl is available only as an SPI.
This implies several behavioral changes comparing to regular `@available`:
1. Type checker diagnoses when a client accidently exposes such a symbol in library APIs.
2. When emitting public interfaces, `@_spi_available` is printed as `@available(platform, unavailable)`.
3. ClangImporter imports ObjC macros `SPI_AVAILABLE` and `__SPI_AVAILABLE` to this attribute.

## `@_staticInitializeObjCMetadata`

Indicates that a static initializer should be emitted to register the
Objective-C metadata when the image is loaded, rather than on first use of the
Objective-C metadata.

This attribute is inferred for `NSCoding` classes that won't
have static Objective-C metadata or have an `@NSKeyedArchiveLegacy` attribute.

## `@_transparent`

Marks a function to be "macro-like", i.e., it is guaranteed to be inlined
in debug builds.

See [TransparentAttr.md](/docs/TransparentAttr.md) for more details.

## `@_typeEraser(Proto)`

Marks a concrete nominal type as one that implements type erasure for a
protocol `Proto`.

A type eraser has the following restrictions:

1. It must be a concrete nominal type.
2. It must not have more restrictive access than `Proto`.
3. It must conform to `Proto`.
4. It must have an initializer of the form `init<T: Proto>(erasing: T)`.
  - Other generic requirements are permitted as long as the `init` can always
    be called with a value of any type conforming to `Proto`.
  - The `init` cannot have more restrictive access than `Proto`.

This feature was designed to be used for compiler-driven type erasure for
dynamic replacement of functions with an opaque return type.

## `@_unavailableFromAsync`

Marks a synchronous API as being unavailable from asynchronous contexts. Direct
usage of annotated API from asynchronous contexts will result in a warning from
the compiler.

## `@_unsafeMainActor`, `@_unsafeSendable`

Marks a parameter's (function) type as `@MainActor` (`@Sendable`) in Swift 6 and
within Swift 5 code that has adopted concurrency, but non-`@MainActor`
(non-`@Sendable`) everywhere else.

See the forum post on [Concurrency in Swift 5 and 6](https://forums.swift.org/t/concurrency-in-swift-5-and-6/49337)
for more details.

## `@_unsafeInheritExecutor`

This `async` function uses the pre-SE-0338 semantics of unsafely inheriting the caller's executor.  This is an underscored feature because the right way of inheriting an executor is to pass in the required executor and switch to it.  Unfortunately, there are functions in the standard library which need to inherit their caller's executor but cannot change their ABI because they were not defined as `@_alwaysEmitIntoClient` in the initial release.

## `@_weakLinked`

Allows a declaration to be weakly-referenced, i.e., any references emitted by
client modules to the declaration's symbol will have weak linkage. This means
that client code will compile without the guarantee that the symbol will be
available at runtime. This requires a dynamic safety check (such as using
`dlsym (3)`); otherwise, accessing the symbol when it is unavailable leads
to a runtime crash.

This is an unsafe alternative to using `@available`, which is statically checked.
If the availability of a library symbol is newer than the deployment target of
the client, the symbol will be weakly linked, but checking for `@available` and
`#(un)available` ensures that a symbol is not accessed when it is unavailable.

## `_local`

A distributed actor can be marked as "known to be local" which allows avoiding
the distributed actor isolation checks. This is used for things like `whenLocal`
where the actor passed to the closure is known-to-be-local, and similarly a
`self` of obtained from an _isolated_ function inside a distributed actor is
also guaranteed to be local by construction.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>fastutil</title>
  </head>

  <body>
    <p>Provides type-specific classes for double elements or keys.
  </body>
</html>


text:
namespace io = process::io;

using std::set;
using std::string;
using std::tuple;
using std::vector;

using process::await;
using process::subprocess;

using process::Failure;
using process::Future;
using process::Owned;
using process::Subprocess;

namespace mesos {
namespace uri {

const char CopyFetcherPlugin::NAME[] = "copy";

Try<Owned<Fetcher::Plugin>> CopyFetcherPlugin::create(const Flags& flags)
{
  return Owned<Fetcher::Plugin>(new CopyFetcherPlugin());
}

set<string> CopyFetcherPlugin::schemes() const
{
  return {"file"};
}

string CopyFetcherPlugin::name() const
{
  return NAME;
}

Future<Nothing> CopyFetcherPlugin::fetch(
    const URI& uri,
    const string& directory,
    const Option<string>& data) const
{
  // TODO(jojy): Validate the given URI.

  if (!uri.has_path()) {
    return Failure("URI path is not specified");
  }

  // TODO(jojy): Verify that the path is a file.

  Try<Nothing> mkdir = os::mkdir(directory);
  if (mkdir.isError()) {
    return Failure(
        "Failed to create directory '" +
        directory + "': " + mkdir.error());
  }

  VLOG(1) << "Copying '" << uri.path() << "' to '" << directory << "'";

#ifndef __WINDOWS__
  const char* copyCommand = "cp";
  const vector<string> argv = {"cp", "-a", uri.path(), directory};
#else // __WINDOWS__
  const char* copyCommand = os::Shell::name;
  const vector<string> argv =
    {os::Shell::arg0, os::Shell::arg1, "copy", "/Y", uri.path(), directory};
#endif // __WINDOWS__

  Try<Subprocess> s = subprocess(
      copyCommand,
      argv,
      Subprocess::PATH(os::DEV_NULL),
      Subprocess::PIPE(),
      Subprocess::PIPE());

  if (s.isError()) {
    return Failure("Failed to exec the copy subprocess: " + s.error());
  }

  return await(
      s.get().status(),
      io::read(s.get().out().get()),
      io::read(s.get().err().get()))
    .then([](const tuple<
        Future<Option<int>>,
        Future<string>,
        Future<string>>& t) -> Future<Nothing> {
      const Future<Option<int>>& status = std::get<0>(t);
      if (!status.isReady()) {
        return Failure(
            "Failed to get the exit status of the copy subprocess: " +
            (status.isFailed() ? status.failure() : "discarded"));
      }

      if (status->isNone()) {
        return Failure("Failed to reap the copy subprocess");
      }

      if (status->get() != 0) {
        const Future<string>& error = std::get<2>(t);
        if (!error.isReady()) {
          return Failure(
              "Failed to perform 'copy'. Reading stderr failed: " +
              (error.isFailed() ? error.failure() : "discarded"));
        }

        return Failure("Failed to perform 'copy': " + error.get());
      }

      return Nothing();
    });
}

} // namespace uri {
} // namespace mesos {


text:
from django.db import models

class PublishedManager(models.Manager):

    def get_queryset(self):
        return super(PublishedManager, self).get_queryset(
            ).filter(status='published')


text:
using NUnit.Framework/*<Test>*/;
using System.Collections.Generic/*<List>*/;

namespace Finegamedesign.Utils
{
	public sealed class TestDataUtil
	{
		private static List<int> List354()
		{
			List<int> numbers = new List<int>();
			numbers.Add(3);
			numbers.Add(5);
			numbers.Add(4);
			return numbers;
		}

		[Test]
		public void JoinListOfInt()
		{
			List<int> numbers = List354();
			Assert.AreEqual("3, 5, 4",
				DataUtil.Join(numbers, ", "));
		}

		[Test]
		public void ClearList()
		{
			List<int> numbers = List354();
			DataUtil.Clear(numbers);
			Assert.AreEqual(0, DataUtil.Length(numbers));
		}

		[Test]
		public void ClearListAtEnd()
		{
			List<int> numbers = List354();
			DataUtil.Clear(numbers, 2);
			Assert.AreEqual(2, DataUtil.Length(numbers));
			Assert.AreEqual("3, 5",
				DataUtil.Join(numbers, ", "));
		}

		[Test]
		public void ClearListAtMiddle()
		{
			List<int> numbers = List354();
			DataUtil.Clear(numbers, 1);
			Assert.AreEqual(1, DataUtil.Length(numbers));
			Assert.AreEqual("3",
				DataUtil.Join(numbers, ", "));
		}
	}
}


text:
using commercetools.Common;
using commercetools.CustomFields;

using Newtonsoft.Json;

namespace commercetools.Carts.UpdateActions
{
    /// <summary>
    /// Adds a product variant in the given quantity to the cart.
    /// </summary>
    /// <remarks>
    /// If the cart already contains the product variant for the given supply and distribution channel, then only quantity of the LineItem is increased.
    /// </remarks>
    /// <see href="https://dev.commercetools.com/http-api-projects-carts.html#add-lineitem"/>
    public class AddLineItemAction : UpdateAction
    {
        #region Properties

        /// <summary>
        /// Id of an existing Product.
        /// </summary>
        [JsonProperty(PropertyName = "productId")]
        public string ProductId { get; set; }

        /// <summary>
        /// Id of an existing ProductVariant in the product.
        /// </summary>
        [JsonProperty(PropertyName = "variantId")]
        public int VariantId { get; set; }

        /// <summary>
        /// Number
        /// </summary>
        [JsonProperty(PropertyName = "quantity")]
        public int Quantity { get; set; }

        /// <summary>
        /// By providing supply channel information, you can unique identify inventory entries that should be reserved. Provided channel should have the role InventorySupply.
        /// </summary>
        [JsonProperty(PropertyName = "supplyChannel")]
        public Reference SupplyChannel { get; set; }

        /// <summary>
        /// The channel is used to select a ProductPrice. Provided channel should have the role ProductDistribution.
        /// </summary>
        [JsonProperty(PropertyName = "distributionChannel")]
        public Reference DistributionChannel { get; set; }

        /// <summary>
        /// An external tax rate can be set if the cart has the External TaxMode.
        /// </summary>
        [JsonProperty(PropertyName = "externalTaxRate")]
        public ExternalTaxRateDraft ExternalTaxRate { get; set; }

        /// <summary>
        /// Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode
        /// </summary>
        [JsonProperty(PropertyName = "externalPrice")]
        public Money ExternalPrice { get; set; }

        /// <summary>
        /// Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalPrice LineItemPriceMode
        /// </summary>
        [JsonProperty(PropertyName = "externalTotalPrice")]
        public Money ExternalTotalPrice { get; set; }

        /// <summary>
        /// The custom fields.
        /// </summary>
        [JsonProperty(PropertyName = "custom")]
        public CustomFieldsDraft Custom { get; set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="productId">Id of an existing Product.</param>
        /// <param name="variantId">Id of an existing ProductVariant in the product</param>
        public AddLineItemAction(string productId, int variantId)
        {
            this.Action = "addLineItem";
            this.ProductId = productId;
            this.VariantId = variantId;
        }

        #endregion
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    JBoss, Home of Professional Open Source
    Copyright 2016, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jboss.quickstarts.jdg</groupId>
    <artifactId>jboss-hadoop-quickstart</artifactId>
    <version>7.3.9-SNAPSHOT</version>
    <name>JBoss JDG Quickstart: Hadoop Integration</name>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <distribution>repo</distribution>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>

    <properties>
        <version.org.infinispan>9.4.13.Final-redhat-00002</version.org.infinispan>
        <version.jdg.hadoop>0.4.0.Final-redhat-00001</version.jdg.hadoop>
        <version.org.apache.flink>1.7.1</version.org.apache.flink>
        <version.org.apache.hadoop>3.1.1.redhat-00002</version.org.apache.hadoop>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- maven-compiler-plugin -->
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <compiler.plugin.version>2.3.2</compiler.plugin.version>

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.infinispan</groupId>
                <artifactId>infinispan-bom</artifactId>
                <version>${version.org.infinispan}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- The dependency in the bom is a SNAPSHOT -->
            <dependency>
                <groupId>org.infinispan.hadoop</groupId>
                <artifactId>infinispan-hadoop-core</artifactId>
                <version>${version.jdg.hadoop}</version>
            </dependency>
            <!--
                The following dependency is defined in the infinispan-bom above,
                using a ${version.caffeine} property. However, the property
                is not being resolved for some reason, causing the build to fail.
                We'll redefine it here with the same version as used in the bom (for 7.2.x)
                as a quick workaround.
            -->
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>2.4.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Flink dependency, should be marked as provided -->
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-java</artifactId>
            <scope>provided</scope>
            <version>${version.org.apache.flink}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-shaded-asm</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-hadoop-compatibility_2.11</artifactId>
            <version>${version.org.apache.flink}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-mapreduce-client-core</artifactId>
            <version>${version.org.apache.hadoop}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>${version.org.apache.hadoop}</version>
            <scope>provided</scope>
        </dependency>

        <!-- JBoss Data Grid Hadoop connector dependency -->
        <dependency>
            <groupId>org.infinispan.hadoop</groupId>
            <artifactId>infinispan-hadoop-core</artifactId>
            <version>${version.jdg.hadoop}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.infinispan.quickstart.hadoop.ChampionshipStandings</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <finalName>${project.artifactId}</finalName>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
//
//  GHGlyph.h
//  SVGgh
// The MIT License (MIT)

//  Copyright (c) 2011-2014 Glenn R. Howes

//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.

//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//
//  Created by Glenn Howes on 2/3/13.

#if defined(__has_feature) && __has_feature(modules)
@import Foundation;
@import CoreText;
#else
#import <Foundation/Foundation.h>
#import <CoreText/CoreText.h>
#endif

#import "GHAttributedObject.h"
#import "GHPathDescription.h"
#import "SVGUtilities.h"

NS_ASSUME_NONNULL_BEGIN

/*! @brief A protocol for an object capable of creating GHGlyphs or adding them to a CGContextRef.
*/
@protocol GHGlyphMaker <NSObject>

/*! @brief Add glyphs to an array being built up of GHGlyphs.
 * @param glyphList array to add GHGlyph objects to
 * @param svgContext svg state information at this point of the render
 @ @see GHGlyph
 */
-(void)addGlyphsToArray:(NSMutableArray*)glyphList  withSVGContext:(id<SVGContext>)svgContext;

/*! @brief Draw individually positioned glyphs to the context.
* @param quartzContext context to draw into
* @param svgContext svg state information at this point of the render
*/
-(void)addGlyphsToContext:(CGContextRef)quartzContext withSVGContext:(id<SVGContext>)svgContext;

/*! @brief Draw the glyphs to the context (draw more as lines than individually positioned glyphs).
 * @param quartzContext context to draw into
 * @param theContext svg state information at this point of the render
 */
-(void) renderIntoContext:(CGContextRef)quartzContext withSVGContext:(id<SVGContext>)theContext;

/*! @brief Render the glyphs into a path.
* @return a path. Caller responsible for disposal.
*/
-(CGPathRef) newPath CF_RETURNS_RETAINED;
@end

/*! @brief a class which wraps the CGGlyph object, and allows for individualy positioning glyphs
*/
@interface GHGlyph : GHAttributedObject<GHPathDescription>
@property(nonatomic, readonly)      CTFontRef           font;
@property(nonatomic, readonly)      CGGlyph             glyph;
@property(nonatomic, readonly)      NSDictionary*       textAttributes;
@property(nonatomic, readonly)      CGPoint             offset;
@property(nonatomic, readonly)      CGPoint             renderPoint;
@property(nonatomic, readonly)      CGFloat             rotationAngleInRadians;
@property(nonatomic, readonly)      CGFloat             width;
@property(nonatomic, readonly)      CGRect              runRect; // rect within a run
@property(nonatomic, readonly)      BOOL                notRendering; // wasn't able to lay this out
@property (nonatomic, readonly)     CGAffineTransform	transform;

/*! @property boundingBox
* @see CTFontGetBoundingRectsForGlyphs
*/
@property(nonatomic, readonly)      CGRect              boundingBox;

/*! @brief Routine which attempts to take an array of GHGlyphs and place them along a path.
* @attention algorithm could definitely be improved.
* @param listOfGlyphs array of GHGlyphs that need to be positioned
* @param aPath a Core Graphics path along which to position the baselines of the GHGlyphs
*/
+(void) positionGlyphs:(NSArray*)listOfGlyphs alongCGPath:(CGPathRef)aPath;

/*! @brief Given a list of GHGlyphs that have already been positioned. Figure out their bounding box.
* @param listOfGlyphs pre-positioned GHGlyphs.
*/
+(CGRect)rectForGlyphs:(NSArray*)listOfGlyphs; // glyphs should be prepositioned

/*! @brief the init method you should call lots of parameters
* @param theAttributes the parent entity's SVG attributes
* @param textAttributes Core Text attributes appropriate for describing fonts. See SVGTextUtilities.h
* @param aFont base font to use
* @param aGlyph the Core Graphics glyph we are wrapping
* @param aTransform a transform for positioning and scaling
* @param offset offset along a line
* @param theWidth pre-calculated width of the glyph
* @see coreTextAttributesFromSVGStyleAttributes:
*/
-(instancetype) initWithDictionary:(NSDictionary *)theAttributes textAttributes:(NSDictionary*) textAttributes font:(CTFontRef)aFont glyph:(CGGlyph)aGlyph transform:(CGAffineTransform)aTransform offset:(CGPoint)offset runBox:(CGRect)runRect andWidth:(CGFloat)theWidth;

/*! @brief not allowing a standard init method
*/
-(instancetype) init __attribute__((unavailable("init not available")));

/*! @brief Asks the question for hit testing.
* @param aPoint a point in the same coordinate system as this glyph
* @return YES if the point is in the bounds of this glyph
 */
-(BOOL) isPointInBoundingBox:(CGPoint)aPoint;

/*! @brief Adding a path (but not drawing).
* @param quartzContext a Core Graphics context to add this glyph's path to.
* @param svgContext a drawing state context for extra information
*/
-(void) addPathToContext:(CGContextRef)quartzContext  withSVGContext:(id<SVGContext>) svgContext;
@end

NS_ASSUME_NONNULL_END


text:
package org.apache.ignite.testsuites;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.ignite.internal.processors.cache.CacheStartupInDeploymentModesTest;
import org.apache.ignite.internal.processors.cache.GridCacheAtomicEntryProcessorDeploymentSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheConditionalDeploymentSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheEntryVersionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheReferenceCleanupSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheReloadSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheReplicatedSynchronousCommitTest;
import org.apache.ignite.internal.processors.cache.GridCacheTransactionalEntryProcessorDeploymentSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheValueBytesPreloadingSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheValueConsistencyTransactionalNearEnabledSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheValueConsistencyTransactionalSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheVersionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheVersionTopologyChangeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheGroupsTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheInterceptorSelfTestSuite;
import org.apache.ignite.internal.processors.cache.IgniteCacheScanPredicateDeploymentSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheAsyncOperationsTest;
import org.apache.ignite.internal.processors.cache.distributed.GridCacheMixedModeSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteTxGetAfterStopTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteTxRemoveTimeoutObjectsNearTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteTxRemoveTimeoutObjectsTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheDaemonNodePartitionedSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteTxReentryColocatedSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridCacheValueConsistencyAtomicNearEnabledSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridCacheValueConsistencyAtomicSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePutArrayValueSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteTxReentryNearSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheDaemonNodeReplicatedSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedAtomicGetAndTransformStoreSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedBasicApiTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedBasicOpSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedBasicStoreSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEventDisabledSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEventSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEvictionEventSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedGetAndTransformStoreSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedLockSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedMultiNodeLockSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedMultiNodeSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedNodeFailureSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedPreloadEventsSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedTxMultiThreadedSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedTxSingleThreadedSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedTxTimeoutSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheSyncReplicatedPreloadSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.preloader.GridCacheReplicatedPreloadLifecycleSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.preloader.GridCacheReplicatedPreloadSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.preloader.GridCacheReplicatedPreloadStartStopEventsSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheDaemonNodeLocalSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalByteArrayValuesSelfTest;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.DynamicSuite;
import org.junit.runner.RunWith;

/**
 * Test suite.
 */
@RunWith(DynamicSuite.class)
public class IgniteCacheTestSuite3 {
    /**
     * @return IgniteCache test suite.
     */
    public static List<Class<?>> suite() {
        return suite(null);
    }

    /**
     * @param ignoredTests Tests to ignore.
     * @return Test suite.
     */
    public static List<Class<?>> suite(Collection<Class> ignoredTests) {
        List<Class<?>> suite = new ArrayList<>();

        GridTestUtils.addTestIfNeeded(suite, IgniteCacheGroupsTest.class, ignoredTests);

        // Value consistency tests.
        GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyAtomicSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyAtomicNearEnabledSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyTransactionalSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyTransactionalNearEnabledSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheValueBytesPreloadingSelfTest.class, ignoredTests);

        // Replicated cache.
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedBasicApiTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedBasicOpSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedBasicStoreSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedGetAndTransformStoreSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedAtomicGetAndTransformStoreSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEventSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEventDisabledSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedSynchronousCommitTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedLockSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedMultiNodeLockSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedMultiNodeSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedNodeFailureSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxSingleThreadedSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxTimeoutSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadLifecycleSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheSyncReplicatedPreloadSelfTest.class, ignoredTests);

        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEntrySetSelfTest.class, ignoredTests);
        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedMarshallerTxTest.class, ignoredTests);
        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedOnheapFullApiSelfTest.class, ignoredTests);
        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.class, ignoredTests);
        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxConcurrentGetTest.class, ignoredTests);
        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxMultiNodeBasicTest.class, ignoredTests);
        //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxReadTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, CacheStartupInDeploymentModesTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheConditionalDeploymentSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheScanPredicateDeploymentSelfTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, GridCachePutArrayValueSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEvictionEventSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxMultiThreadedSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadEventsSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadStartStopEventsSelfTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, IgniteTxReentryNearSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteTxReentryColocatedSelfTest.class, ignoredTests);

        // Test for byte array value special case.
        GridTestUtils.addTestIfNeeded(suite, GridCacheLocalByteArrayValuesSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.class, ignoredTests);

        // Near-only cache.
        suite.addAll(IgniteCacheNearOnlySelfTestSuite.suite(ignoredTests));

        // Test cache with daemon nodes.
        GridTestUtils.addTestIfNeeded(suite, GridCacheDaemonNodeLocalSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheDaemonNodePartitionedSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheDaemonNodeReplicatedSelfTest.class, ignoredTests);

        // Write-behind.
        suite.addAll(IgniteCacheWriteBehindTestSuite.suite(ignoredTests));

        // Transform.
        GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, GridCacheEntryVersionSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheVersionSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheVersionTopologyChangeTest.class, ignoredTests);

        // Memory leak tests.
        GridTestUtils.addTestIfNeeded(suite, GridCacheReferenceCleanupSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheReloadSelfTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, GridCacheMixedModeSelfTest.class, ignoredTests);

        // Cache interceptor tests.
        suite.addAll(IgniteCacheInterceptorSelfTestSuite.suite(ignoredTests));

        GridTestUtils.addTestIfNeeded(suite, IgniteTxGetAfterStopTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, CacheAsyncOperationsTest.class, ignoredTests);

        GridTestUtils.addTestIfNeeded(suite, IgniteTxRemoveTimeoutObjectsTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteTxRemoveTimeoutObjectsNearTest.class, ignoredTests);

        return suite;
    }
}


text:
namespace Google.Cloud.PubSub.V1.Snippets
{
    // [START pubsub_v1_generated_SubscriberServiceApi_CreateSubscription_async]
    using Google.Cloud.PubSub.V1;
    using Google.Protobuf.WellKnownTypes;
    using System.Threading.Tasks;

    public sealed partial class GeneratedSubscriberServiceApiClientSnippets
    {
        /// <summary>Snippet for CreateSubscriptionAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CreateSubscriptionRequestObjectAsync()
        {
            // Create client
            SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
            // Initialize request argument(s)
            Subscription request = new Subscription
            {
                SubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
                TopicAsTopicName = TopicName.FromProjectTopic("[PROJECT]", "[TOPIC]"),
                PushConfig = new PushConfig(),
                AckDeadlineSeconds = 0,
                RetainAckedMessages = false,
                MessageRetentionDuration = new Duration(),
                Labels = { { "", "" }, },
                EnableMessageOrdering = false,
                ExpirationPolicy = new ExpirationPolicy(),
                Filter = "",
                DeadLetterPolicy = new DeadLetterPolicy(),
                RetryPolicy = new RetryPolicy(),
                Detached = false,
                EnableExactlyOnceDelivery = false,
                TopicMessageRetentionDuration = new Duration(),
                BigqueryConfig = new BigQueryConfig(),
                State = Subscription.Types.State.Unspecified,
            };
            // Make the request
            Subscription response = await subscriberServiceApiClient.CreateSubscriptionAsync(request);
        }
    }
    // [END pubsub_v1_generated_SubscriberServiceApi_CreateSubscription_async]
}


text:
package io.teknek.collector;

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

import junit.framework.Assert;

import org.junit.Test;

import io.teknek.driver.exception.ExEveryOtherTimeOperator;
import io.teknek.model.ICollector;
import io.teknek.model.ITuple;
import io.teknek.model.Tuple;

public class TestCollectorProcessor {

  @Test
  public void testRetry(){
    CollectorProcessor cp = new CollectorProcessor();
    cp.setTupleRetry(2);
    final List<ITuple> i = new ArrayList<ITuple>();
    final ICollector collect = new ICollector(){
      @Override
      public void emit(ITuple out) {
        i.add(out);
      }
    };
    ExEveryOtherTimeOperator op = new ExEveryOtherTimeOperator();
    op.setCollector(collect);
    cp.getChildren().add(op);
    cp.handleTupple(new Tuple().withField("x", "y"));
    cp.handleTupple(new Tuple().withField("x", "z"));
    Assert.assertEquals(i.size(), 2);
  }

  @Test
  public void testNoRetry(){
    CollectorProcessor cp = new CollectorProcessor();
    cp.setTupleRetry(0);
    final List<ITuple> i = new ArrayList<ITuple>();
    final ICollector collect = new ICollector(){
      @Override
      public void emit(ITuple out) {
        i.add(out);
      }
    };
    ExEveryOtherTimeOperator op = new ExEveryOtherTimeOperator();
    op.setCollector(collect);
    cp.getChildren().add(op);
    cp.handleTupple(new Tuple().withField("x", "y"));
    cp.handleTupple(new Tuple().withField("x", "z"));
    Assert.assertEquals(i.size(), 1);
    Assert.assertEquals("y", i.get(0).getField("x"));
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <View
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="@mipmap/item_divider" />

            <TextView
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:drawableLeft="@mipmap/line"
                android:gravity="center"
                android:padding="@dimen/margin"
                android:text="饮食篇"
                android:textSize="@dimen/size"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/special_2017_frg_tips_food_tv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="@dimen/size_small"
                android:layout_margin="@dimen/margin"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="@mipmap/item_divider" />

            <TextView
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:drawableLeft="@mipmap/line"
                android:gravity="center"
                android:padding="@dimen/margin"
                android:text="防晒篇"
                android:textSize="@dimen/size"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/special_2017_frg_tips_sun_tv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="@dimen/size_small"
                android:layout_margin="@dimen/margin"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="@mipmap/item_divider" />

            <TextView
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:drawableLeft="@mipmap/line"
                android:gravity="center"
                android:padding="@dimen/margin"
                android:text="药品篇"
                android:textSize="@dimen/size"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/special_2017_frg_tips_medicine_tv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="@dimen/size_small"
                android:layout_margin="@dimen/margin"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="@mipmap/item_divider" />

            <TextView
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:drawableLeft="@mipmap/line"
                android:gravity="center"
                android:padding="@dimen/margin"
                android:text="其它"
                android:textSize="@dimen/size"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/special_2017_frg_tips_other_tv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="@dimen/size_small"
                android:layout_margin="@dimen/margin"/>

        </LinearLayout>

    </ScrollView>

</LinearLayout>