text:
<!DOCTYPE html>

    <meta name="top_category" value="develop" />

    <meta name="subcategory" value="reference" />

      <meta name="book_path" value="/reference/android/support/wearable/_book.yaml" />

<title>R.attr | Android Developers
</title>

Summary:

  Fields

  | Ctors

  | Inherited Methods

| [Expand All]

R.attr

  public
  static
  final

  class
  R.attr

    extends Object

    java.lang.Object

         ↳

    android.support.wearable.R.attr

Summary

Fields

    public
    static

    int

      buttonRippleColor

May be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

    public
    static

    int

      circle_border_color

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

    public
    static

    int

      circle_border_width

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      circle_color

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

    public
    static

    int

      circle_padding

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      circle_radius

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      circle_radius_percent

Must be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%".

    public
    static

    int

      circle_radius_pressed

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      circle_radius_pressed_percent

Must be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%".

    public
    static

    int

      circular_layout_gravity

Must be one or more (separated by '|') of the following constant values.

    public
    static

    int

      circular_text_size

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      color_sequence

May be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

    public
    static

    int

      dotColor

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

    public
    static

    int

      dotColorSelected

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

    public
    static

    int

      dotFadeInDuration

Must be an integer value, such as "100".

    public
    static

    int

      dotFadeOutDelay

Must be an integer value, such as "100".

    public
    static

    int

      dotFadeOutDuration

Must be an integer value, such as "100".

    public
    static

    int

      dotFadeWhenIdle

Must be a boolean value, either "true" or "false".

    public
    static

    int

      dotRadius

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      dotRadiusSelected

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      dotShadowColor

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

    public
    static

    int

      dotShadowDx

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      dotShadowDy

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      dotShadowRadius

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      dotSpacing

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      imageScaleMode

Must be one of the following constant values.

    public
    static

    int

      image_circle_percentage

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      image_horizontal_offcenter_percentage

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      image_tint

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

    public
    static

    int

      layoutManager

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.

    public
    static

    int

      layout_box

Must be one or more (separated by '|') of the following constant values.

    public
    static

    int

      layout_gravityRound

Must be one or more (separated by '|') of the following constant values.

    public
    static

    int

      layout_heightRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      layout_marginBottomRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      layout_marginLeftRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      layout_marginRightRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      layout_marginRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      layout_marginTopRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      layout_widthRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      maxTextSize

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      minTextSize

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      pressedButtonTranslationZ

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      rectLayout

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

    public
    static

    int

      reverseLayout

Must be a boolean value, either "true" or "false".

    public
    static

    int

      roundLayout

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

    public
    static

    int

      shadow_width

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

    public
    static

    int

      spanCount

Must be an integer value, such as "100".

    public
    static

    int

      square_dimen

Must be one of the following constant values.

    public
    static

    int

      stackFromEnd

Must be a boolean value, either "true" or "false".

    public
    static

    int

      update_interval

Must be an integer value, such as "100".

Public constructors

      R.attr()

Inherited methods

  From
class

    java.lang.Object

        Object

      clone()

        boolean

      equals(Object arg0)

        void

      finalize()

        final

        Class<?>

      getClass()

        int

      hashCode()

        final

        void

      notify()

        final

        void

      notifyAll()

        String

      toString()

        final

        void

      wait()

        final

        void

      wait(long arg0, int arg1)

        final

        void

      wait(long arg0)

Fields

buttonRippleColor

int buttonRippleColor

May be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

circle_border_color

int circle_border_color

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_border_width

int circle_border_width

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_color

int circle_color

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_padding

int circle_padding

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_radius

int circle_radius

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_radius_percent

int circle_radius_percent

Must be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_radius_pressed

int circle_radius_pressed

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circle_radius_pressed_percent

int circle_radius_pressed_percent

Must be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

circular_layout_gravity

int circular_layout_gravity

Must be one or more (separated by '|') of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

left	0x03

top	0x30

right	0x05

bottom	0x50

center_vertical	0x10

center_horizontal	0x01

center	0x11

circular_text_size

int circular_text_size

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

color_sequence

int color_sequence

May be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

dotColor

int dotColor

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotColorSelected

int dotColorSelected

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotFadeInDuration

int dotFadeInDuration

Must be an integer value, such as "100".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotFadeOutDelay

int dotFadeOutDelay

Must be an integer value, such as "100".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotFadeOutDuration

int dotFadeOutDuration

Must be an integer value, such as "100".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotFadeWhenIdle

int dotFadeWhenIdle

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotRadius

int dotRadius

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotRadiusSelected

int dotRadiusSelected

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotShadowColor

int dotShadowColor

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotShadowDx

int dotShadowDx

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotShadowDy

int dotShadowDy

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotShadowRadius

int dotShadowRadius

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

dotSpacing

int dotSpacing

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

imageScaleMode

int imageScaleMode

Must be one of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

fit	0

center	1

image_circle_percentage

int image_circle_percentage

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

image_horizontal_offcenter_percentage

int image_horizontal_offcenter_percentage

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

image_tint

int image_tint

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layoutManager

int layoutManager

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_box

int layout_box

Must be one or more (separated by '|') of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

left	0x01

top	0x02

right	0x04

bottom	0x08

all	0x0F

layout_gravityRound

int layout_gravityRound

Must be one or more (separated by '|') of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

top	0x30

bottom	0x50

left	0x03

right	0x05

center_vertical	0x10

fill_vertical	0x70

center_horizontal	0x01

fill_horizontal	0x07

center	0x11

fill	0x77

clip_vertical	0x80

clip_horizontal	0x08

start	0x00800003

end	0x00800005

layout_heightRound

int layout_heightRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_marginBottomRound

int layout_marginBottomRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_marginLeftRound

int layout_marginLeftRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_marginRightRound

int layout_marginRightRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_marginRound

int layout_marginRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_marginTopRound

int layout_marginTopRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

layout_widthRound

int layout_widthRound

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

maxTextSize

int maxTextSize

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

minTextSize

int minTextSize

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

pressedButtonTranslationZ

int pressedButtonTranslationZ

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

rectLayout

int rectLayout

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

reverseLayout

int reverseLayout

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

roundLayout

int roundLayout

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

shadow_width

int shadow_width

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

spanCount

int spanCount

Must be an integer value, such as "100".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

square_dimen

int square_dimen

Must be one of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

none	0

height	1

width	2

stackFromEnd

int stackFromEnd

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

update_interval

int update_interval

Must be an integer value, such as "100".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

Public constructors

R.attr

R.attr ()


text:
package org.locationtech.geomesa.accumulo.tools.data

import java.util.Date

import com.beust.jcommander.{ParameterException, Parameters}
import org.locationtech.geomesa.accumulo.data.AccumuloDataStore
import org.locationtech.geomesa.accumulo.iterators.{AgeOffIterator, DtgAgeOffIterator}
import org.locationtech.geomesa.accumulo.tools.data.AccumuloAgeOffCommand.AccumuloAgeOffParams
import org.locationtech.geomesa.accumulo.tools.{AccumuloDataStoreCommand, AccumuloDataStoreParams}
import org.locationtech.geomesa.tools.Command
import org.locationtech.geomesa.tools.data.AgeOffCommand
import org.locationtech.geomesa.tools.data.AgeOffCommand.AgeOffParams
import org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes
import org.opengis.feature.simple.SimpleFeatureType

import scala.concurrent.duration.Duration

class AccumuloAgeOffCommand extends AgeOffCommand[AccumuloDataStore] with AccumuloDataStoreCommand {

  override val params = new AccumuloAgeOffParams()

  override protected def list(ds: AccumuloDataStore, typeName: String): Unit = {
    val sft = getSft(ds, typeName)
    Command.user.info(s"Attribute age-off: ${DtgAgeOffIterator.list(ds, sft).getOrElse("None")}")
    Command.user.info(s"Timestamp age-off: ${AgeOffIterator.list(ds, sft).getOrElse("None")}")
  }

  override protected def set(ds: AccumuloDataStore, typeName: String, expiry: Duration): Unit = {
    val sft = getSft(ds, typeName)
    AgeOffIterator.clear(ds, sft)
    DtgAgeOffIterator.clear(ds, sft)
    AgeOffIterator.set(ds, getSft(ds, typeName), expiry)
  }

  override protected def set(ds: AccumuloDataStore, typeName: String, dtg: String, expiry: Duration): Unit = {
    val sft = getSft(ds, typeName)
    if (!Option(sft.getDescriptor(dtg)).exists(d => classOf[Date].isAssignableFrom(d.getType.getBinding))) {
      throw new ParameterException(s"Attribute '$dtg' does not exist or is not an date type in $typeName " +
          SimpleFeatureTypes.encodeType(sft))
    }
    AgeOffIterator.clear(ds, sft)
    DtgAgeOffIterator.clear(ds, sft)
    DtgAgeOffIterator.set(ds, sft, expiry, dtg)
  }

  override protected def remove(ds: AccumuloDataStore, typeName: String): Unit = {
    val sft = getSft(ds, typeName)
    AgeOffIterator.clear(ds, sft)
    DtgAgeOffIterator.clear(ds, sft)
  }

  private def getSft(ds: AccumuloDataStore, typeName: String): SimpleFeatureType = {
    val sft = ds.getSchema(typeName)
    if (sft == null) {
      throw new ParameterException(s"SimpleFeatureType '$typeName' does not exist in the data store")
    }
    sft
  }
}

object AccumuloAgeOffCommand {
  @Parameters(commandDescription = "List/set/remove age-off for a GeoMesa feature type")
  class AccumuloAgeOffParams extends AgeOffParams with AccumuloDataStoreParams
}

redpajama_set_name: RedPajamaGithub


text:
package com.example.spanner;

import static com.google.common.truth.Truth.assertThat;

import com.google.cloud.spanner.DatabaseAdminClient;
import com.google.cloud.spanner.Spanner;
import com.google.cloud.spanner.SpannerOptions;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Collections;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * Tests for quickstart sample.
 */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
public class QuickstartSampleIT {
  private static String instanceId = System.getProperty("spanner.test.instance");
  private static String dbId = formatForTest(System.getProperty("spanner.quickstart.database"));
  private static Spanner spanner;
  private static DatabaseAdminClient dbClient;

  private ByteArrayOutputStream bout;
  private PrintStream stdOut = System.out;
  private PrintStream out;

  @BeforeClass
  public static void createDatabase() throws InterruptedException, ExecutionException {
    final SpannerOptions options =
        SpannerOptions.newBuilder().setAutoThrottleAdministrativeRequests().build();
    spanner = options.getService();
    dbClient = spanner.getDatabaseAdminClient();
    dbClient.createDatabase(instanceId, dbId, Collections.emptyList()).get();
  }

  @AfterClass
  public static void dropDatabase() {
    dbClient.dropDatabase(instanceId, dbId);
    spanner.close();
  }

  @Before
  public void setUp() {
    bout = new ByteArrayOutputStream();
    out = new PrintStream(bout);
    System.setOut(out);
  }

  @After
  public void tearDown() {
    System.setOut(stdOut);
  }

  @Test
  public void testQuickstart() throws Exception {
    assertThat(instanceId).isNotNull();
    assertThat(dbId).isNotNull();
    QuickstartSample.main(instanceId, dbId);
    String got = bout.toString();
    assertThat(got).contains("1");
  }

  private static String formatForTest(String name) {
    return name + "-" + UUID.randomUUID().toString().substring(0, 20);
  }
}


text:
/*jshint node:true*/
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
  var app = new EmberAddon(defaults, {
    // Add options here
    'nullbase-theme-service': {
      directory: path.join('tests', 'dummy')
    }
  });

  /*
    This build file specifies the options for the dummy test app of this
    addon, located in `/tests/dummy`
    This build file does *not* influence how the addon or the app using it
    behave. You most likely want to be modifying `./index.js` or app's build file
  */

  return app.toTree();
};


text:
using System;
using DateObject = System.DateTime;

using Microsoft.Recognizers.Definitions.Spanish;

namespace Microsoft.Recognizers.Text.DateTime.Spanish
{
    public class DateTimePeriodParser : BaseDateTimePeriodParser
    {
        public DateTimePeriodParser(IDateTimePeriodParserConfiguration configuration) : base(configuration)
        {
        }

        protected override DateTimeResolutionResult ParseSpecificTimeOfDay(string text, DateObject referenceTime)
        {
            var ret = new DateTimeResolutionResult();
            var trimedText = text.Trim().ToLowerInvariant();

            // handle morning, afternoon..
            if (!this.Config.GetMatchedTimeRange(trimedText, out string timeStr, out int beginHour, out int endHour, out int endMin))
            {
                return ret;
            }

            var match = this.Config.SpecificTimeOfDayRegex.Match(trimedText);
            if (match.Success && match.Index == 0 && match.Length == trimedText.Length)
            {
                var swift = this.Config.GetSwiftPrefix(trimedText);

                var date = referenceTime.AddDays(swift).Date;
                int day = date.Day, month = date.Month, year = date.Year;

                ret.Timex = FormatUtil.FormatDate(date) + timeStr;
                ret.FutureValue =
                    ret.PastValue =
                        new Tuple<DateObject, DateObject>(DateObject.MinValue.SafeCreateFromValue(year, month, day, beginHour, 0, 0),
                            DateObject.MinValue.SafeCreateFromValue(year, month, day, endHour, endMin, endMin));
                ret.Success = true;
                return ret;
            }

            var startIndex = trimedText.IndexOf(DateTimeDefinitions.Tomorrow, StringComparison.Ordinal) == 0 ? DateTimeDefinitions.Tomorrow.Length : 0;

            // handle Date followed by morning, afternoon
            // Add handling code to handle morning, afternoon followed by Date
            // Add handling code to handle early/late morning, afternoon
            match = this.Config.TimeOfDayRegex.Match(trimedText.Substring(startIndex));
            if (match.Success)
            {
                var beforeStr = trimedText.Substring(0, match.Index + startIndex).Trim();
                var ers = this.Config.DateExtractor.Extract(beforeStr, referenceTime);
                if (ers.Count == 0)
                {
                    return ret;
                }

                var pr = this.Config.DateParser.Parse(ers[0], referenceTime);
                var futureDate = (DateObject)((DateTimeResolutionResult)pr.Value).FutureValue;
                var pastDate = (DateObject)((DateTimeResolutionResult)pr.Value).PastValue;

                ret.Timex = pr.TimexStr + timeStr;

                ret.FutureValue =
                    new Tuple<DateObject, DateObject>(
                        DateObject.MinValue.SafeCreateFromValue(futureDate.Year, futureDate.Month, futureDate.Day, beginHour, 0, 0),
                        DateObject.MinValue.SafeCreateFromValue(futureDate.Year, futureDate.Month, futureDate.Day, endHour, endMin, endMin));

                ret.PastValue =
                    new Tuple<DateObject, DateObject>(
                        DateObject.MinValue.SafeCreateFromValue(pastDate.Year, pastDate.Month, pastDate.Day, beginHour, 0, 0),
                        DateObject.MinValue.SafeCreateFromValue(pastDate.Year, pastDate.Month, pastDate.Day, endHour, endMin, endMin));

                ret.Success = true;

                return ret;
            }

            return ret;
        }
    }
}


text:
"""
[2017-04-24] Challenge #312 [Easy] L33tspeak Translator

https://www.reddit.com/r/dailyprogrammer/comments/67dxts/20170424_challenge_312_easy_l33tspeak_translator/

# Description
L33tspeak - the act of speaking like a computer hacker (or hax0r) - was popularized in the late 1990s as a mechanism of
abusing ASCII art and character mappings to confuse outsiders. It was a lot of fun. [One popular comic
strip](http://megatokyo.com/strip/9) in 2000 showed just how far the joke ran.
In L33Tspeak you substitute letters for their rough outlines in ASCII characters, e.g. symbols or numbers. You can have
1:1 mappings (like E -> 3) or 1:many mappings (like W -> `//). So then you wind up with words like this:
    BASIC => 6451C
    ELEET => 31337 (pronounced elite)
    WOW => `//0`//
    MOM => (V)0(V)
## Mappings
For this challenge we'll be using a subset of American Standard Leetspeak:
    A -> 4
    B -> 6
    E -> 3
    I -> 1
    L -> 1
    M -> (V)
    N -> (\)
    O -> 0
    S -> 5
    T -> 7
    V -> \/
    W -> `//
Your challenge, should you choose to accept it, is to translate to and from L33T.
# Input Description
You'll be given a word or a short phrase, one per line, and asked to convert it from L33T or to L33T. Examples:
    31337
    storm
# Output Description
You should emit the translated words: Examples:
    31337 -> eleet
    storm -> 570R(V)
# Challenge Input
    I am elite.
    Da pain!
    Eye need help!
    3Y3 (\)33d j00 t0 g37 d4 d0c70r.
    1 n33d m4 p1llz!
# Challenge Output
    I am elite. -> 1 4m 37173
    Da pain! -> D4 P41(\)!
    Eye need help! -> 3Y3 (\)33D H31P!
    3Y3 (\)33d j00 t0 g37 d4 d0c70r. -> Eye need j00 to get da doctor.
    1 n33d m4 p1llz! -> I need ma pillz!
"""

def main():
    pass

if __name__ == "__main__":
    main()


text:
package org.apache.hadoop.hbase.regionserver.wal;

import static java.util.stream.Collectors.toCollection;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellComparator;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.PrivateCellUtil;
import org.apache.hadoop.hbase.client.RegionInfo;
import org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.wal.WAL.Entry;
import org.apache.hadoop.hbase.wal.WALEdit;
import org.apache.hadoop.hbase.wal.WALKeyImpl;
import org.apache.yetus.audience.InterfaceAudience;

import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils;

/**
 * A WAL Entry for {@link AbstractFSWAL} implementation.  Immutable.
 * A subclass of {@link Entry} that carries extra info across the ring buffer such as
 * region sequence id (we want to use this later, just before we write the WAL to ensure region
 * edits maintain order).  The extra info added here is not 'serialized' as part of the WALEdit
 * hence marked 'transient' to underline this fact.  It also adds mechanism so we can wait on
 * the assign of the region sequence id.  See #stampRegionSequenceId().
 */
@InterfaceAudience.Private
class FSWALEntry extends Entry {
  // The below data members are denoted 'transient' just to highlight these are not persisted;
  // they are only in memory and held here while passing over the ring buffer.
  private final transient long txid;
  private final transient boolean inMemstore;
  private final transient RegionInfo regionInfo;
  private final transient Set<byte[]> familyNames;

  FSWALEntry(final long txid, final WALKeyImpl key, final WALEdit edit,
      final RegionInfo regionInfo, final boolean inMemstore) {
    super(key, edit);
    this.inMemstore = inMemstore;
    this.regionInfo = regionInfo;
    this.txid = txid;
    if (inMemstore) {
      // construct familyNames here to reduce the work of log sinker.
      Set<byte []> families = edit.getFamilies();
      this.familyNames = families != null? families: collectFamilies(edit.getCells());
    } else {
      this.familyNames = Collections.<byte[]>emptySet();
    }
  }

  @VisibleForTesting
  static Set<byte[]> collectFamilies(List<Cell> cells) {
    if (CollectionUtils.isEmpty(cells)) {
      return Collections.emptySet();
    } else {
      return cells.stream()
           .filter(v -> !CellUtil.matchingFamily(v, WALEdit.METAFAMILY))
           .collect(toCollection(() -> new TreeSet<>(CellComparator.getInstance()::compareFamilies)))
           .stream()
           .map(CellUtil::cloneFamily)
           .collect(toCollection(() -> new TreeSet<>(Bytes.BYTES_COMPARATOR)));
    }
  }

  @Override
  public String toString() {
    return "sequence=" + this.txid + ", " + super.toString();
  }

  boolean isInMemStore() {
    return this.inMemstore;
  }

  RegionInfo getRegionInfo() {
    return this.regionInfo;
  }

  /**
   * @return The transaction id of this edit.
   */
  long getTxid() {
    return this.txid;
  }

  /**
   * Here is where a WAL edit gets its sequenceid. SIDE-EFFECT is our stamping the sequenceid into
   * every Cell AND setting the sequenceid into the MVCC WriteEntry!!!!
   * @return The sequenceid we stamped on this edit.
   */
  long stampRegionSequenceId(MultiVersionConcurrencyControl.WriteEntry we) throws IOException {
    long regionSequenceId = we.getWriteNumber();
    if (!this.getEdit().isReplay() && inMemstore) {
      for (Cell c : getEdit().getCells()) {
        PrivateCellUtil.setSequenceId(c, regionSequenceId);
      }
    }

    getKey().setWriteEntry(we);
    return regionSequenceId;
  }

  /**
   * @return the family names which are effected by this edit.
   */
  Set<byte[]> getFamilyNames() {
    return familyNames;
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using uEN.UI;

namespace SimpleApp.Contents
{
    /// <summary>
    ///
    /// </summary>
    public partial class Vol09View : BizView
    {
        /// <summary>デフォルトコンストラクタ</summary>
        public Vol09View()
        {
            InitializeComponent();
        }

        protected override void BuildBinding()
        {
            var builder = CreateBindingBuilder<Vol09ViewModel>();

            builder.Element(OkButton)
                   .Binding(Button.ClickEvent, x => x.OkAction);

            builder.Element(YesNoButton)
                   .Binding(Button.ClickEvent, x => x.YesNoAction);

            builder.Element(YesNoCancelButton)
                   .Binding(Button.ClickEvent, x => x.YesNoCancelAction);

            builder.Element(CustomButton)
                   .Binding(Button.ClickEvent, x => x.CustomAction);

        }
    }
}


text:
package container_test

import (
	"context"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	pb "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"

	"github.com/cri-o/cri-o/pkg/container"
)

// The actual test suite
var _ = t.Describe("Container:SetNameAndID", func() {
	// Setup the SUT
	BeforeEach(func() {
		config := &pb.ContainerConfig{
			Metadata: &pb.ContainerMetadata{Name: "name"},
		}
		Expect(sut.SetConfig(config)).To(BeNil())
	})

	It("should succeed", func() {
		// Given
		const (
			name      = "name"
			namespace = "namespace"
			uid       = "uid"
		)
		metadata := &pb.PodSandboxMetadata{
			Name: name, Uid: uid, Namespace: namespace,
		}

		// When
		err := sut.SetNameAndID(metadata)

		// Then
		Expect(err).To(BeNil())
		Expect(len(sut.ID())).To(Equal(64))
		Expect(sut.Name()).To(ContainSubstring(name))
		Expect(sut.Name()).To(ContainSubstring(namespace))
		Expect(sut.Name()).To(ContainSubstring(uid))
	})

	It("should succeed with empty sandbox metadata", func() {
		// Given
		metadata := &pb.PodSandboxMetadata{}

		// When
		err := sut.SetNameAndID(metadata)

		// Then
		Expect(err).To(BeNil())
	})

	It("should fail with config nil", func() {
		// Given
		// When
		err := container.New(context.Background()).SetNameAndID(nil)

		// Then
		Expect(err).NotTo(BeNil())
	})

	It("should fail with sandbox metadata nil", func() {
		// Given
		// When
		err := sut.SetNameAndID(nil)

		// Then
		Expect(err).NotTo(BeNil())
	})
})


text:
package net.openhft.chronicle.hash;

import net.openhft.chronicle.hash.locks.InterProcessReadWriteUpdateLock;

/**
 * {@link InterProcessReadWriteUpdateLock} of a segment in {@code ChronicleHash}.
 *

 *
In Chronicle-Map off-heap design, locks (and concurrency) are per-segment.
 *
 * @see ChronicleHashBuilder#minSegments(int)
 * @see ChronicleHashBuilder#actualSegments(int)
 */
public interface SegmentLock extends InterProcessReadWriteUpdateLock {

    /**
     * Returns the index of the accessed segment.
     */
    int segmentIndex();
}


text:
<?php

namespace Acconplish\CustomSentinel\Users;

interface UserInterface
{
    /**
     * Returns the user primary key.
     *
     * @return int
     */
    public function getUserId();

    /**
     * Returns the user login.
     *
     * @return string
     */
    public function getUserLogin();

    /**
     * Returns the user login attribute name.
     *
     * @return string
     */
    public function getUserLoginName();

    /**
     * Returns the user password.
     *
     * @return string
     */
    public function getUserPassword();
}


text:
/*
 * (C) 2007-2012 Alibaba Group Holding Limited.
 *
 * 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.
 * Authors:
 *   wuhua <wq163@163.com> , boyan <killme2008@gmail.com>
 */
package com.taobao.metamorphosis.server.network;

import java.util.concurrent.ThreadPoolExecutor;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.taobao.gecko.core.command.ResponseCommand;
import com.taobao.gecko.service.Connection;
import com.taobao.gecko.service.RequestProcessor;
import com.taobao.metamorphosis.network.BooleanCommand;
import com.taobao.metamorphosis.network.HttpStatus;
import com.taobao.metamorphosis.network.PutCommand;
import com.taobao.metamorphosis.network.RemotingUtils;
import com.taobao.metamorphosis.server.CommandProcessor;
import com.taobao.metamorphosis.transaction.TransactionId;

/**
 * PutÇëÇó´¦ÀíÆ÷
 *
 * @author boyan
 * @Date 2011-4-21
 *
 */
public class PutProcessor implements RequestProcessor<PutCommand> {
    static final Log log = LogFactory.getLog(PutProcessor.class);

    private final CommandProcessor processor;
    private final ThreadPoolExecutor executor;

    public PutProcessor(final CommandProcessor processor, final ThreadPoolExecutor executor) {
        super();
        this.processor = processor;
        this.executor = executor;
    }

    @Override
    public ThreadPoolExecutor getExecutor() {
        return this.executor;
    }

    @Override
    public void handleRequest(final PutCommand request, final Connection conn) {
        final TransactionId xid = request.getTransactionId();
        final SessionContext context = SessionContextHolder.getOrCreateSessionContext(conn, xid);
        try {
            this.processor.processPutCommand(request, context, new PutCallback() {
                @Override
                public void putComplete(final ResponseCommand resp) {
                    RemotingUtils.response(context.getConnection(), resp);
                }
            });
            // RemotingUtils.response(context.getConnection(),
            // PutProcessor.this.processor.processPutCommand(request, context));
        }
        catch (final Exception e) {
            RemotingUtils.response(context.getConnection(), new BooleanCommand(HttpStatus.InternalServerError,
                e.getMessage(), request.getOpaque()));
        }
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<Type Name="AttachmentReference" FullName="Vulkan.AttachmentReference">
  <TypeSignature Language="C#" Value="public struct AttachmentReference" />
  <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit AttachmentReference extends System.ValueType" />
  <AssemblyInfo>
    <AssemblyName>Vulkan</AssemblyName>
    <AssemblyVersion>0.0.5950.20892</AssemblyVersion>
    <AssemblyVersion>0.0.6105.39043</AssemblyVersion>
    <AssemblyVersion>0.0.6106.39464</AssemblyVersion>
    <AssemblyVersion>0.0.6134.41045</AssemblyVersion>
    <AssemblyVersion>0.0.6142.19338</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.ValueType</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    Structure specifying an attachment reference
    <remarks></remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AttachmentReference ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.5950.20892</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Attachment">
      <MemberSignature Language="C#" Value="public uint Attachment;" />
      <MemberSignature Language="ILAsm" Value=".field public unsigned int32 Attachment" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.6105.39043</AssemblyVersion>
        <AssemblyVersion>0.0.6106.39464</AssemblyVersion>
        <AssemblyVersion>0.0.6134.41045</AssemblyVersion>
        <AssemblyVersion>0.0.6142.19338</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.UInt32</ReturnType>
      </ReturnValue>
      <Docs>
        is the index of the attachment of the render pass, and corresponds to the index of the corresponding element in the pname:pAttachments array of the sname:VkRenderPassCreateInfo structure. If any color or depth/stencil attachments are ename:VK_ATTACHMENT_UNUSED, then no writes occur for those attachments.
        <remarks></remarks>
      </Docs>
    </Member>
    <Member MemberName="Attachment">
      <MemberSignature Language="C#" Value="public uint Attachment { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance unsigned int32 Attachment" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.5950.20892</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.UInt32</ReturnType>
      </ReturnValue>
      <Docs>
        is the index of the attachment of the render pass, and corresponds to the index of the corresponding element in the pname:pAttachments array of the sname:VkRenderPassCreateInfo structure. If any color or depth/stencil attachments are ename:VK_ATTACHMENT_UNUSED, then no writes occur for those attachments.
        <value>To be added.</value>
        <remarks></remarks>
      </Docs>
    </Member>
    <Member MemberName="Layout">
      <MemberSignature Language="C#" Value="public Vulkan.ImageLayout Layout;" />
      <MemberSignature Language="ILAsm" Value=".field public valuetype Vulkan.ImageLayout Layout" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.6105.39043</AssemblyVersion>
        <AssemblyVersion>0.0.6106.39464</AssemblyVersion>
        <AssemblyVersion>0.0.6134.41045</AssemblyVersion>
        <AssemblyVersion>0.0.6142.19338</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Vulkan.ImageLayout</ReturnType>
      </ReturnValue>
      <Docs>
        must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED or ename:VK_IMAGE_LAYOUT_PREINITIALIZED ****
        <remarks></remarks>
      </Docs>
    </Member>
    <Member MemberName="Layout">
      <MemberSignature Language="C#" Value="public Vulkan.ImageLayout Layout { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance valuetype Vulkan.ImageLayout Layout" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.5950.20892</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Vulkan.ImageLayout</ReturnType>
      </ReturnValue>
      <Docs>
        must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED or ename:VK_IMAGE_LAYOUT_PREINITIALIZED ****
        <value>To be added.</value>
        <remarks></remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
from nova import exception
from nova import test
from pylxd import exceptions as lxd_exceptions

import ddt
import mock

from nclxd.nova.virt.lxd import container_image
from nclxd.nova.virt.lxd import container_utils
from nclxd import tests

@ddt.ddt
@mock.patch.object(container_image, 'CONF', tests.MockConf())
@mock.patch.object(container_utils, 'CONF', tests.MockConf())
class LXDTestContainerImage(test.NoDBTestCase):

    @mock.patch.object(container_utils, 'CONF', tests.MockConf())
    def setUp(self):
        super(LXDTestContainerImage, self).setUp()
        self.container_image = container_image.LXDContainerImage()
        alias_patcher = mock.patch.object(self.container_image.lxd,
                                          'alias_list',
                                          return_value=['alias'])
        alias_patcher.start()
        self.addCleanup(alias_patcher.stop)

    def test_fetch_image_existing_alias(self):
        instance = tests.MockInstance()
        context = {}
        image_meta = {'name': 'alias'}
        self.assertEqual(None,
                         self.container_image.fetch_image(context,
                                                          instance,
                                                          image_meta))

    @mock.patch('os.path.exists')
    @mock.patch('oslo_utils.fileutils.ensure_tree')
    @ddt.data(True, False)
    def test_fetch_image_existing_file(self, base_exists, mt, mo):
        mo.side_effect = [base_exists, True]
        instance = tests.MockInstance()
        context = {}
        image_meta = {'name': 'new_image'}
        self.assertEqual(None,
                         self.container_image.fetch_image(context,
                                                          instance,
                                                          image_meta))
        if base_exists:
            self.assertFalse(mt.called)
        else:
            mt.assert_called_once_with('/fake/image/cache')
        self.assertEqual([mock.call('/fake/image/cache'),
                          mock.call('/fake/image/cache/new_image.tar.gz')],
                         mo.call_args_list)

    @mock.patch('os.path.exists', mock.Mock(return_value=False))
    @mock.patch('oslo_utils.fileutils.ensure_tree', mock.Mock())
    @mock.patch('oslo_utils.fileutils.remove_path_on_error')
    def test_fetch_image_new_defined(self, mf):
        instance = tests.MockInstance()
        context = {}
        image_meta = {'name': 'new_image'}
        with (
                mock.patch.object(container_image.IMAGE_API,
                                  'download')) as mi, (
                mock.patch.object(self.container_image.lxd,
                                  'image_defined', return_value=True)) as ml:
            self.assertRaises(exception.ImageUnacceptable,
                              self.container_image.fetch_image,
                              context, instance, image_meta)
            ml.assert_called_once_with('mock_image')
        mf.assert_called_once_with('/fake/image/cache/new_image.tar.gz')
        mi.assert_called_once_with(
            context, 'mock_image',
            dest_path='/fake/image/cache/new_image.tar.gz')

    @mock.patch('os.path.exists', mock.Mock(return_value=False))
    @mock.patch('oslo_utils.fileutils.ensure_tree', mock.Mock())
    @mock.patch('oslo_utils.fileutils.remove_path_on_error',
                mock.MagicMock())
    def test_fetch_image_new_upload_failed(self):
        instance = tests.MockInstance()
        context = {}
        image_meta = {'name': 'new_image'}
        with (
                mock.patch.object(container_image.IMAGE_API,
                                  'download')), (
                mock.patch.object(self.container_image.lxd,
                                  'image_defined', return_value=False)), (
                mock.patch.object(self.container_image.lxd,
                                  'image_upload',
                                  side_effect=lxd_exceptions.APIError(
                                      'Fake error', 500))) as mu:
            self.assertRaises(exception.ImageUnacceptable,
                              self.container_image.fetch_image,
                              context, instance, image_meta)
            mu.assert_called_once_with(
                path='/fake/image/cache/new_image.tar.gz')

    @mock.patch('os.path.exists', mock.Mock(return_value=False))
    @mock.patch('oslo_utils.fileutils.ensure_tree', mock.Mock())
    @mock.patch('oslo_utils.fileutils.remove_path_on_error',
                mock.MagicMock())
    def test_fetch_image_new_alias_failed(self):
        instance = tests.MockInstance()
        context = {}
        image_meta = {'name': 'new_image'}
        with (
                mock.patch.object(container_image.IMAGE_API,
                                  'download')), (
                mock.patch.object(self.container_image.lxd,
                                  'image_defined', return_value=False)), (
                mock.patch.object(self.container_image.lxd,
                                  'image_upload')), (
                mock.patch.object(self.container_image.lxd,
                                  'alias_create',
                                  side_effect=lxd_exceptions.APIError(
                                      'Fake error', 500))), (
                mock.patch('six.moves.builtins.open')) as mo:
            mo.return_value.__enter__.return_value.read.return_value = b'image'
            self.assertRaises(exception.ImageUnacceptable,
                              self.container_image.fetch_image,
                              context, instance, image_meta)

    @mock.patch('os.path.exists', mock.Mock(return_value=False))
    @mock.patch('oslo_utils.fileutils.ensure_tree', mock.Mock())
    @mock.patch('oslo_utils.fileutils.remove_path_on_error',
                mock.MagicMock())
    def test_fetch_image_new(self):
        instance = tests.MockInstance()
        context = {}
        image_meta = {'name': 'new_image'}
        with (
                mock.patch.object(container_image.IMAGE_API,
                                  'download')), (
                mock.patch.object(self.container_image.lxd,
                                  'image_defined', return_value=False)), (
                mock.patch.object(self.container_image.lxd,
                                  'image_upload')), (
                mock.patch.object(self.container_image.lxd,
                                  'alias_create')) as ma, (
                mock.patch('six.moves.builtins.open')) as mo:
            mo.return_value.__enter__.return_value.read.return_value = b'image'
            self.assertEqual(None,
                             self.container_image.fetch_image(context,
                                                              instance,
                                                              image_meta))
            ma.assert_called_with(
                {'name': 'new_image',
                 'target': '6105d6cc76af400325e94d588ce511be'
                 '5bfdbb73b437dc51eca43917d7a43e3d'})


text:
package dataforms.devtool.page.version;

import dataforms.app.page.base.BasePage;

/**
 * バージョン情報ページクラスです。
 *
 */
public class VersionInfoPage extends BasePage {
	/**
	 * コンストラクタ。
	 */
	public VersionInfoPage() {
		this.addForm(new VersionInfoForm());
	}
}


text:
Master repository has moved to gitlab, all new code will be there:

https://gitlab.com/rocket-science/rails_admin_state

### Properly manage [state_machines](https://github.com/state-machines/state_machines) states from rails_admin

Allows easily sending state_machine events to a model from Rails Admin, including support for
ActiveRecord \ Mongoid and custom state field name and multiple state machines per model.

## Screenshot

 ![Rails Admin State Machine](http://rscx.ru/state.png)

## Installing

Add this line to your application's Gemfile:

    gem 'rails_admin_state'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rails_admin_state

## Usage

Add the state action:

    RailsAdmin.config do |config|
      config.actions do
        ......
        state
      end
    end

Mark the field you need display as state:

    rails_admin do
      list do
        field :state, :state
        ...
      end
      edit do
        field :state, :state
        ...
      end
      ...
    end

### States and event button/label custom classes:

    rails_admin do
      list do
        field :state, :state
        ...
      end
      ...
      state({
        events: {dead: 'btn-danger', drain: 'btn-warning', alive: 'btn-success'},
        states: {dead: 'label-important', drain: 'label-warning', alive: 'label-success'}
        disable: [:dead] # disable some events so they are not shown.
      })

    end

Some classes are preset by default (published, deleted, etc)

### CanCan integration

    cannot :manage, Recipes::Recipe
    can :read, Recipes::Recipe
    can :state, Recipes::Recipe # required to do any transitions
    can :all_events, Recipes::Recipe

### i18n (state and event names):

Just as usual for state_machine, see:

http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Integrations/Mongoid

http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Integrations/ActiveRecord

For namespaced models use "/", just as usual: "Blog::Post" is "blog/post"

State name set this way is also used in .human_state_name, error messages, etc

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
package loon.utils.cache;

import loon.LSysException;
import loon.LRelease;
import loon.utils.TimeUtils;

/**
 * LRelease类的缓存实现(Loon中所有具备close函数的类都继承有此接口)
 */
public class ReleaseCache extends CacheObject {

	private int _gc_spawnCount;

	private LRelease _obj;

	public ReleaseCache(LRelease obj) {
		this(obj, false);
	}

	public ReleaseCache(LRelease obj, boolean spawned) {
		super(obj);
		if (obj == null) {
			throw new LSysException("Object is null");
		}
		_obj = obj;
		_gc_spawnCount = spawned ? 1 : 0;
	}

	@Override
	public boolean isUse() {
		return _gc_spawnCount > 0;
	}

	public int getSpawnCount() {
		return _gc_spawnCount;
	}

	public LRelease peek(){
		return this._obj;
	}

	@Override
	public void onSpawn() {
		_gc_spawnCount++;
		_lastUseTime = TimeUtils.millis();
	}

	@Override
	public void onUnspawn() {
		_lastUseTime = TimeUtils.millis();
		_gc_spawnCount--;
		if (_gc_spawnCount < 0) {
			throw new LSysException("Spawn count is less than 0.");
		}
	}

	@Override
	public void disposed(boolean isShutdown) {
		if (isShutdown) {
			_obj.close();
		}
	}

}


text:
Import-Module -Name ./eng/scripts/X509Certificate2 -Verbose

$cert = New-X509Certificate2 -SubjectName 'E=opensource@microsoft.com, CN=Azure SDK, OU=Azure SDK, O=Microsoft, L=Frisco, S=TX, C=US' -ValidDays 365

$pem = (Format-X509Certificate2 -Certificate $cert).ReplaceLineEndings([string]::Empty)
Write-Host $pem
$templateFileParameters['ConfidentialLedgerPrincipalPEM'] = $pem
$pemPk = (Format-X509Certificate2 -Type Pkcs8 -Certificate $cert).ReplaceLineEndings([string]::Empty)
$templateFileParameters['ConfidentialLedgerPrincipalPEMPK'] = $pemPk


text:
package org.archboy.clobaframe.web.tool.controller;

import java.io.IOException;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.archboy.clobaframe.resource.http.NamedResourceSender;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 *
 * Using Spring Web MVC template URL to catch all web resource request
 * that under "/resources/", then @RequestMapping("/resource/{resourceVersionName:.+}")
 *
 * @author yang
 */
@Controller
public class ResourcesController {

	@Inject
	private NamedResourceSender namedResourceSender;

	private String baseLocation = "/resource/";
	private String rootResourceNamePrefix = "root/";

	/**
	 * Send web resource.
	 *
	 * @param request
	 * @param response
	 * @throws IOException
	 */
	//@RequestMapping("/resource/{resourceVersionName:.+}")
	@RequestMapping("/resource/**")
	public void sendResource(
			//@PathVariable("resourceVersionName") String resourceVersionName,
			HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		String path = request.getRequestURI();
		int baseLocationLength = baseLocation.length();
		String resourceVersionName = path.substring(baseLocationLength);
		namedResourceSender.sendByVersionName(resourceVersionName, request, response);
	}

	@RequestMapping("/robots.txt")
	public void sendRebots(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		namedResourceSender.send(rootResourceNamePrefix + "robots.txt", request, response);
	}

	@RequestMapping("/favicon.ico")
	public void sendFavoriteIcon(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		namedResourceSender.send(rootResourceNamePrefix + "favicon-16x16.ico", request, response);
	}

	@RequestMapping("/favicon.png")
	public void sendFavoriteIconInPNG(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		namedResourceSender.send(rootResourceNamePrefix + "favicon-16x16.png", request, response);
	}

	@RequestMapping("/apple-touch-icon.png")
	public void sendAppleTouchIcon(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		namedResourceSender.send(rootResourceNamePrefix + "apple-touch-icon-120x120.png", request, response);
	}

	@RequestMapping("/launcher-icon-192x192.png")
	public void sendLauncherIcon(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		namedResourceSender.send(rootResourceNamePrefix + "launcher-icon-192x192.png", request, response);
	}

}


text:
<!DOCTYPE html>
<html>
  <link rel='stylesheet' type='text/css' href='style.css'>
  <body dir='rtl'>
    <progress value="1.0"></progress>
    <progress value="0.0"></progress>
    <progress value="0.1"></progress>
    <progress value="0.5"></progress>
    <progress value="-1"></progress>
    <progress value="42"></progress>
    <progress value="42" max="100"></progress>
    <progress value="42" max="1"></progress>
    <progress value="42" max="-1"></progress>
    <progress value="0.1" max="-1"></progress>
  </body>
</html>


text:
package org.wso2.andes.client.message;

import javax.jms.JMSException;

public class TestMessageHelper
{
    public static JMSTextMessage newJMSTextMessage() throws JMSException
    {
        return new JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);
    }

    public static JMSBytesMessage newJMSBytesMessage() throws JMSException
    {
        return new JMSBytesMessage(AMQMessageDelegateFactory.FACTORY_0_8);
    }

    public static JMSMapMessage newJMSMapMessage() throws JMSException
    {
        return new JMSMapMessage(AMQMessageDelegateFactory.FACTORY_0_8);
    }

    public static JMSStreamMessage newJMSStreamMessage()
    {
        return new JMSStreamMessage(AMQMessageDelegateFactory.FACTORY_0_8);
    }
}


text:
namespace g{namespace Android{namespace android{namespace view{struct View;}}}}
namespace g{namespace Fuse{namespace Android{namespace Controls{struct Control;}}}}
namespace g{namespace Fuse{namespace Controls{struct Control;}}}

namespace g{
namespace Fuse{
namespace Android{
namespace Controls{

// public abstract extern class Control<T> :315
// {
struct Control_type : ::g::Fuse::Android::Controls::Element_type
{
    void(*fp_Attach)(::g::Fuse::Android::Controls::Control*);
    void(*fp_Detach)(::g::Fuse::Android::Controls::Control*);
    void(*fp_get_ShowKeyboard)(::g::Fuse::Android::Controls::Control*, bool*);
};

Control_type* Control_typeof();
void Control__ctor_2_fn(Control* __this);
void Control__Create_fn(Control* __this, ::g::Android::android::view::View** __retval);
void Control__FindSemanticControl_fn(Control* __this, ::g::Fuse::Controls::Control** __retval);
void Control__OnGotFocus_fn(Control* __this, uObject* s, uObject* a);
void Control__OnLostFocus_fn(Control* __this, uObject* s, uObject* a);
void Control__OnNativeFocusChanged_fn(Control* __this, uObject* s, bool* hasFocus);
void Control__OnRooted_fn(Control* __this);
void Control__OnUnrooted_fn(Control* __this);
void Control__ScheduleFocusLoss_fn(Control* __this);
void Control__get_SemanticControl_fn(Control* __this, ::g::Fuse::Controls::Control** __retval);
void Control__get_ShowKeyboard_fn(Control* __this, bool* __retval);

struct Control : ::g::Fuse::Android::Controls::Element
{
    uStrong< ::g::Fuse::Controls::Control*> _semanticControl;
    uStrong< ::g::Android::android::view::View*> _view;

    void ctor_2();
    void Attach() { (((Control_type*)__type)->fp_Attach)(this); }
    void Detach() { (((Control_type*)__type)->fp_Detach)(this); }
    ::g::Fuse::Controls::Control* FindSemanticControl();
    void OnGotFocus(uObject* s, uObject* a);
    void OnLostFocus(uObject* s, uObject* a);
    void OnNativeFocusChanged(uObject* s, bool hasFocus);
    void ScheduleFocusLoss();
    ::g::Fuse::Controls::Control* SemanticControl();
    bool ShowKeyboard() { bool __retval; return (((Control_type*)__type)->fp_get_ShowKeyboard)(this, &__retval), __retval; }
    static bool ShowKeyboard(Control* __this) { bool __retval; return Control__get_ShowKeyboard_fn(__this, &__retval), __retval; }
};
// }

}}}} // ::g::Fuse::Android::Controls


text:
layout: model
title: Lemma UD model for Urdu (pos_udtb)
author: John Snow Labs
name: pos_udtb
date: 2022-05-01
tags: [open_source, universal_dependency, pos, part_of_speech, ur, urdu]
task: Part of Speech Tagging
language: ur
edition: Spark NLP 3.4.3
spark_version: 3.0
supported: true
annotator: PerceptronModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

Pretrained Lemmatizer model (`pos_udtb`) trained on Universal Dependencies 2.9 (UD_Urdu-UDTB) in Urdu language.

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
[Open in Colab](https://github.com/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/streamlit_notebooks/GRAMMAR_EN.ipynb){:.button.button-orange.button-orange-trans.co.button-icon}
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/pos_udtb_ur_3.4.3_3.0_1651419585123.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python

document = DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")

sentence = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\
.setInputCols(["document"])\
.setOutputCol("sentence")

tokenizer = Tokenizer()\
.setInputCols(["sentence"])\
.setOutputCol("token")

pos = PerceptronModel.pretrained("pos_udtb", "ur")\
.setInputCols(["sentence", "token"])\
.setOutputCol("pos")

pipeline = Pipeline(stages=[document, sentence, tokenizer, pos])

data = spark.createDataFrame([["I love Spark NLP"]]).toDF("text")

result = pipeline.fit(data).transform(data)
```
```scala

val document = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("document")

val sentence = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")
.setInputCols("document")
.setOutputCol("sentence")

val tokenizer = new Tokenizer()
.setInputCols("sentence")
.setOutputCol("token")

val pos = PerceptronModel.pretrained("pos_udtb", "ur")
.setInputCols("sentence", "token")
.setOutputCol("pos")

val pipeline = new Pipeline().setStages(Array(document, sentence, tokenizer, pos))

val data = Seq("I love Spark NLP").toDF("text")

val result = pipeline.fit(data).transform(data)
```

{:.nlu-block}
```python
import nlu
nlu.load("ur.pos").predict("""I love Spark NLP""")
```

</div>

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|pos_udtb|
|Compatibility:|Spark NLP 3.4.3+|
|License:|Open Source|
|Edition:|Official|
|Input Labels:|[sentence, form]|
|Output Labels:|[pos]|
|Language:|ur|
|Size:|1.9 MB|

## References

Model is trained on Universal Dependencies (treebank 2.9) `UD_Urdu-UDTB`
[https://github.com/UniversalDependencies/UD_Urdu-UDTB](https://github.com/UniversalDependencies/UD_Urdu-UDTB)


text:
<<<<<<< HEAD
LoLReportSystem
===============
=======
CucumberScaffold
================

Scaffolding to allow bare features to be tested against pages in a public directory
>>>>>>> 270d4d71080a5ec927bac493e03f4228a33a0710


text:
package haxe.test;

public interface OverloadInterface1
{
	void someOverloadedMethod(String a1);
}


text:
package org.keycloak.testsuite.console.clients;

import org.jboss.arquillian.graphene.page.Page;
import org.junit.Test;
import org.keycloak.representations.idm.ClientRepresentation;
import org.keycloak.testsuite.console.page.clients.settings.ClientSettings;
import org.keycloak.testsuite.util.Timer;
import org.openqa.selenium.By;

import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.*;
import static org.keycloak.testsuite.auth.page.login.Login.OIDC;
import static org.keycloak.testsuite.auth.page.login.Login.SAML;
import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.OidcAccessType.BEARER_ONLY;
import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.OidcAccessType.CONFIDENTIAL;
import static org.keycloak.testsuite.util.WaitUtils.pause;

/**
 *
 * @author Filip Kiss
 * @author tkyjovsk
 * @author Vaclav Muzikar <vmuzikar@redhat.com>
 */
public class ClientSettingsTest extends AbstractClientTest {

    @Page
    private ClientSettings clientSettingsPage;

    private ClientRepresentation newClient;

    @Test
    public void crudOIDCPublic() {
        newClient = createClientRep("oidc-public", OIDC);
        createClient(newClient);

        // read & verify
        ClientRepresentation found = findClientByClientId(newClient.getClientId());
        assertNotNull("Client " + newClient.getClientId() + " was not found.", found);
        assertClientSettingsEqual(newClient, found);

        // update & verify
        newClient.setClientId("oidc-public-updated");
        newClient.setName("updatedName");

        List<String> redirectUris = new ArrayList<>();
        redirectUris.add("http://example2.test/app/*");
        redirectUris.add("http://example2.test/app2/*");
        redirectUris.add("http://example3.test/app/*");
        newClient.setRedirectUris(redirectUris);

        List<String> webOrigins = new ArrayList<>();
        webOrigins.clear();
        webOrigins.add("http://example2.test");
        webOrigins.add("http://example3.test");
        newClient.setWebOrigins(webOrigins);

        clientSettingsPage.form().setClientId("oidc-public-updated");
        clientSettingsPage.form().setName("updatedName");
        clientSettingsPage.form().setRedirectUris(redirectUris);
        clientSettingsPage.form().setWebOrigins(webOrigins);
        clientSettingsPage.form().save();
        assertAlertSuccess();

        found = findClientByClientId(newClient.getClientId());
        assertNotNull("Client " + newClient.getClientId() + " was not found.", found);
        assertClientSettingsEqual(newClient, found);

        // delete
        clientPage.delete();
        assertAlertSuccess();
        found = findClientByClientId(newClient.getClientId());
        assertNull("Deleted client " + newClient.getClientId() + " was found.", found);
    }

    @Test
    public void createOIDCConfidential() {
        newClient = createClientRep("oidc-confidetial", OIDC);
        createClient(newClient);

        newClient.setRedirectUris(TEST_REDIRECT_URIs);
        newClient.setPublicClient(false);

        clientSettingsPage.form().setAccessType(CONFIDENTIAL);
        clientSettingsPage.form().setRedirectUris(TEST_REDIRECT_URIs);
        clientSettingsPage.form().save();

        ClientRepresentation found = findClientByClientId(newClient.getClientId());
        assertNotNull("Client " + newClient.getClientId() + " was not found.", found);
        assertClientSettingsEqual(newClient, found);
    }

    //KEYCLOAK-4022
    @Test
    public void testOIDCConfidentialServiceAccountRolesTab() {
        newClient = createClientRep("oidc-service-account-tab", OIDC);
        createClient(newClient);

        newClient.setRedirectUris(TEST_REDIRECT_URIs);
        newClient.setPublicClient(false);

        clientSettingsPage.form().setAccessType(CONFIDENTIAL);
        clientSettingsPage.form().setServiceAccountsEnabled(true);
        assertTrue(clientSettingsPage.form().isServiceAccountsEnabled());
        //check if Service Account Roles tab is not present
        assertFalse(clientSettingsPage.tabs().isServiceAccountRolesDisplayed());

        clientSettingsPage.form().setRedirectUris(TEST_REDIRECT_URIs);
        clientSettingsPage.form().save();

        //should be there now
        assertTrue(clientSettingsPage.tabs().getTabs().findElement(By.linkText("Service Account Roles")).isDisplayed());
    }

    @Test
    public void saveOIDCConfidentialWithoutRedirectURIs() {
        newClient = createClientRep("oidc-confidential", OIDC);
        createClient(newClient);

        clientSettingsPage.form().setName("name");
        clientSettingsPage.form().save();
        assertAlertDanger();
    }

    @Test
    public void createOIDCBearerOnly() {
        newClient = createClientRep("oidc-bearer-only", OIDC);
        createClient(newClient);

        clientSettingsPage.form().setAccessType(BEARER_ONLY);
        clientSettingsPage.form().save();

        newClient.setBearerOnly(true);
        newClient.setPublicClient(false);

        ClientRepresentation found = findClientByClientId(newClient.getClientId());
        assertNotNull("Client " + newClient.getClientId() + " was not found.", found);
        assertClientSettingsEqual(newClient, found);
    }

    @Test
    public void createSAML() {
        newClient = createClientRep("saml", SAML);
        createClient(newClient);

        ClientRepresentation found = findClientByClientId(newClient.getClientId());
        assertNotNull("Client " + newClient.getClientId() + " was not found.", found);
        assertClientSettingsEqual(newClient, found);
        assertClientSamlAttributes(getSAMLAttributes(), found.getAttributes());
    }

    @Test
    public void invalidSettings() {
        clientsPage.table().createClient();
        createClientPage.form().save();
        assertAlertDanger();

        clientsPage.navigateTo();
        newClient = createClientRep(TEST_CLIENT_ID, OIDC);
        createClient(newClient);

        clientsPage.navigateTo();
        clientsPage.table().createClient();
        createClientPage.form().setClientId(TEST_CLIENT_ID);
        createClientPage.form().save();
        assertAlertDanger();
    }

    public void createClients(String clientIdPrefix, int count) {
        for (int i = 0; i < count; i++) {
            String clientId = String.format("%s%02d", clientIdPrefix, i);
            ClientRepresentation cr = createClientRep(clientId, OIDC);
            Timer.DEFAULT.reset();
            Response r = testRealmResource().clients().create(cr);
            r.close();
            Timer.DEFAULT.reset("create client");
        }
    }

//    @Test
    public void clientsPagination() {
        createClients("test_client_", 100);
        clientsPage.navigateTo();
        pause(120000);
    }

    @Test
    public void disabledClient() {
        newClient = createClientRep("disabled-client", OIDC);
        newClient.setEnabled(false);
        createClient(newClient);

        ClientRepresentation clientRepre = findClientByClientId("disabled-client");
        assertTrue("Client should be disabled", clientRepre.isEnabled());
    }
}


text:
This directory has a simple testing setup for testing the api.opentreeoflife.org
web services. Either write test.conf or run one of the 2*conf.sh scripts
before you run the tests.

Run all of the tests using:

    $ sh run_tests.sh

*Details*

  * opentreetesting.py contains some helpful utilities for writing tests
        using python, and reading in a config file that controls the domain
        that the tests are run against.
  * test.conf is the config file.
  * 2globalconf.sh copies the global testing config to the active location
  * 2localconf.sh copies the local testing config to the active location.
  * test_*.py should take no arguments and use its exit code to indicate
        passing or failing the tests.
  * run_tests.sh runs all of the test_*.py files and summarizes the number
        of tests and failures.

If VERBOSE_TESTING is in the env when you execute a test, you'll get more
verbose output.


text:
package net.lizhaoweb.demo.hbase.mr.hbase2hdfs;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @author 李召(John.Lee)
 * @version 1.0.0.0.1
 * @EMAIL 404644381@qq.com
 * @notes Created on 2017年07月24日

 * Revision of last commit:$Revision$

 * Author of last commit:$Author$

 * Date of last commit:$Date$

 */
public class HBase2HDFSReducer extends Reducer<Text, Text, Text, Text> {

    @Override
    protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        try {
            for (Text value : values) {
                System.out.println(value);
                context.write(value, new Text());
            }
//            for (Medias value : values) {
//                System.out.println(value);
//                context.write(new Text(value.toString()), new Text());
//            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


text:
package main

import (
	"fmt"

	"github.com/traefik/traefik/v2/pkg/config/static"
	"github.com/traefik/traefik/v2/pkg/plugins"
)

const outputDir = "./plugins-storage/"

func createPluginBuilder(staticConfiguration *static.Configuration) (*plugins.Builder, error) {
	client, plgs, localPlgs, err := initPlugins(staticConfiguration)
	if err != nil {
		return nil, err
	}

	return plugins.NewBuilder(client, plgs, localPlgs)
}

func initPlugins(staticCfg *static.Configuration) (*plugins.Client, map[string]plugins.Descriptor, map[string]plugins.LocalDescriptor, error) {
	err := checkUniquePluginNames(staticCfg.Experimental)
	if err != nil {
		return nil, nil, nil, err
	}

	var client *plugins.Client
	plgs := map[string]plugins.Descriptor{}

	if hasPlugins(staticCfg) {
		opts := plugins.ClientOptions{
			Output: outputDir,
			Token:  getPilotToken(staticCfg),
		}

		var err error
		client, err = plugins.NewClient(opts)
		if err != nil {
			return nil, nil, nil, err
		}

		err = plugins.SetupRemotePlugins(client, staticCfg.Experimental.Plugins)
		if err != nil {
			return nil, nil, nil, err
		}

		plgs = staticCfg.Experimental.Plugins
	}

	localPlgs := map[string]plugins.LocalDescriptor{}

	if hasLocalPlugins(staticCfg) {
		err := plugins.SetupLocalPlugins(staticCfg.Experimental.LocalPlugins)
		if err != nil {
			return nil, nil, nil, err
		}

		localPlgs = staticCfg.Experimental.LocalPlugins
	}

	return client, plgs, localPlgs, nil
}

func checkUniquePluginNames(e *static.Experimental) error {
	if e == nil {
		return nil
	}

	for s := range e.LocalPlugins {
		if _, ok := e.Plugins[s]; ok {
			return fmt.Errorf("the plugin's name %q must be unique", s)
		}
	}

	return nil
}

func isPilotEnabled(staticCfg *static.Configuration) bool {
	return staticCfg.Pilot != nil && staticCfg.Pilot.Token != ""
}

func getPilotToken(staticCfg *static.Configuration) string {
	if staticCfg.Pilot == nil {
		return ""
	}

	return staticCfg.Pilot.Token
}

func hasPlugins(staticCfg *static.Configuration) bool {
	return staticCfg.Experimental != nil && len(staticCfg.Experimental.Plugins) > 0
}

func hasLocalPlugins(staticCfg *static.Configuration) bool {
	return staticCfg.Experimental != nil && len(staticCfg.Experimental.LocalPlugins) > 0
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Transactional Cursors</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Getting Started with Berkeley DB Transaction Processing" />
    <link rel="up" href="usingtxns.html" title="Chapter 3. Transaction Basics" />
    <link rel="prev" href="nestedtxn.html" title="Nested Transactions" />
    <link rel="next" href="txnindices.html" title="Secondary Indices with Transaction Applications" />

          Transactional Cursors

          Prev
          Chapter 3. Transaction Basics
           Next

Transactional Cursors

            You can transaction-protect your cursor operations by
            specifying a transaction handle at the time that you create
            your cursor.  Beyond that, you do not ever
            provide a transaction handle directly to a cursor method.

            Note that if you transaction-protect a cursor, then you must
            make sure that the cursor is closed before you either commit or
            abort the transaction. For example:

#include <stdio.h>
#include <stdlib.h>

#include "db.h"

int
main(void)
{
    DBT key, data;
    DBC *cursorp;
    DB_TXN *txn = NULL;
    int ret, c_ret;
    char *replacementString = "new string";

    ...
    /* environment and db handle creation omitted */
    ...

    /* Get the txn handle */
    txn = NULL;
    ret = envp->txn_begin(envp, NULL, &txn, 0);
    if (ret != 0) {
        envp->err(envp, ret, "Transaction begin failed.");
        goto err;
    }

    /* Get the cursor, supply the txn handle at that time */
    ret = dbp->cursor(dbp, txn, &cursorp, 0);
    if (ret != 0) {
        envp->err(envp, ret, "Cursor open failed.");
        txn->abort(txn);
        goto err;
    }

    /*
     * Now use the cursor. Note that we do not supply any txn handles to
     * these methods.
     */
    /* Prepare the DBTs */
    memset(&key, 0, sizeof(DBT));
    memset(&data, 0, sizeof(DBT));
    while (cursor->get(&key, &data, DB_NEXT) == 0) {
        data->data = (void *)replacementString;
        data->size = (strlen(replacementString) + 1) * sizeof(char);
        c_ret = cursor->put(cursor, &key, &data, DB_CURRENT);
        if (c_ret != 0) {
            /* abort the transaction and goto error */
            envp->err(envp, ret, "Cursor put failed.");
            cursorp->close(cursorp);
            cursorp = NULL;
            txn->abort(txn);
            goto err;
        }
    }

    /*
     * Commit the transaction. Note that the transaction handle
     * can no longer be used.
     */
    ret = cursorp->close(cursorp);
    if (ret != 0) {
        envp->err(envp, ret, "Cursor close failed.");
        txn->abort(txn);
        goto err;
    }
    ret = txn->commit(txn, 0);
    if (ret != 0) {
        envp->err(envp, ret, "Transaction commit failed.");
        goto err;
    }

err:
    /* Close the cursor (if the handle is not NULL)
     * and perform whatever other cleanup is required */

    /* Close the database */

    /* Close the environment */

    ...

    if (c_ret != 0)
        ret = c_ret;

    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}

          Prev

            Up

           Next

          Nested Transactions

            Home

           Secondary Indices with Transaction Applications


text:
package org.apache.beam.sdk.extensions.sql.meta.provider.test;

import static com.google.common.base.Preconditions.checkArgument;

import com.google.auto.service.AutoService;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.extensions.sql.BeamSqlTable;
import org.apache.beam.sdk.extensions.sql.meta.Table;
import org.apache.beam.sdk.extensions.sql.meta.provider.InMemoryMetaTableProvider;
import org.apache.beam.sdk.extensions.sql.meta.provider.TableProvider;
import org.apache.beam.sdk.schemas.Schema;
import org.apache.beam.sdk.schemas.SchemaCoder;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.SerializableFunctions;
import org.apache.beam.sdk.values.PBegin;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.PDone;
import org.apache.beam.sdk.values.POutput;
import org.apache.beam.sdk.values.Row;

/**
 * Test in-memory table provider for use in tests.
 *
 * <p>Keeps global state and tracks class instances. Works only in DirectRunner.
 */
@AutoService(TableProvider.class)
public class TestTableProvider extends InMemoryMetaTableProvider {
  static final Map<Long, Map<String, TableWithRows>> GLOBAL_TABLES = new ConcurrentHashMap<>();

  private static final AtomicLong INSTANCES = new AtomicLong(0);
  private final long instanceId = INSTANCES.getAndIncrement();

  public TestTableProvider() {
    GLOBAL_TABLES.put(instanceId, new ConcurrentHashMap<>());
  }

  @Override
  public String getTableType() {
    return "test";
  }

  public Map<String, TableWithRows> tables() {
    return GLOBAL_TABLES.get(instanceId);
  }

  @Override
  public void createTable(Table table) {
    tables().put(table.getName(), new TableWithRows(instanceId, table));
  }

  @Override
  public void dropTable(String tableName) {
    tables().remove(tableName);
  }

  @Override
  public Map<String, Table> getTables() {
    return tables()
        .entrySet()
        .stream()
        .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().table));
  }

  @Override
  public synchronized BeamSqlTable buildBeamSqlTable(Table table) {
    InMemoryTable inMemoryTable = new InMemoryTable(tables().get(table.getName()));
    return inMemoryTable;
  }

  public void addRows(String tableName, Row... rows) {
    checkArgument(tables().containsKey(tableName), "Table not found: " + tableName);
    tables().get(tableName).rows.addAll(Arrays.asList(rows));
  }

  public List<Row> tableRows(String tableName) {
    return tables().get(tableName).rows;
  }

  /** TableWitRows. */
  public static class TableWithRows implements Serializable {
    private Table table;
    private List<Row> rows;
    private long tableProviderInstanceId;

    public TableWithRows(long tableProviderInstanceId, Table table) {
      this.tableProviderInstanceId = tableProviderInstanceId;
      this.table = table;
      this.rows = new CopyOnWriteArrayList<>();
    }

    public List<Row> getRows() {
      return rows;
    }
  }

  private static class InMemoryTable implements BeamSqlTable {
    private TableWithRows tableWithRows;

    @Override
    public PCollection.IsBounded isBounded() {
      return PCollection.IsBounded.BOUNDED;
    }

    public InMemoryTable(TableWithRows tableWithRows) {
      this.tableWithRows = tableWithRows;
    }

    public Coder<Row> rowCoder() {
      return SchemaCoder.of(
          tableWithRows.table.getSchema(),
          SerializableFunctions.identity(),
          SerializableFunctions.identity());
    }

    @Override
    public PCollection<Row> buildIOReader(PBegin begin) {
      TableWithRows tableWithRows =
          GLOBAL_TABLES
              .get(this.tableWithRows.tableProviderInstanceId)
              .get(this.tableWithRows.table.getName());
      return begin.apply(Create.of(tableWithRows.rows).withCoder(rowCoder()));
    }

    @Override
    public POutput buildIOWriter(PCollection<Row> input) {
      input.apply(ParDo.of(new CollectorFn(tableWithRows)));
      return PDone.in(input.getPipeline());
    }

    @Override
    public Schema getSchema() {
      return tableWithRows.table.getSchema();
    }
  }

  private static final class CollectorFn extends DoFn<Row, Row> {
    private TableWithRows tableWithRows;

    CollectorFn(TableWithRows tableWithRows) {
      this.tableWithRows = tableWithRows;
    }

    @ProcessElement
    public void procesElement(ProcessContext context) {
      long instanceId = tableWithRows.tableProviderInstanceId;
      String tableName = tableWithRows.table.getName();
      GLOBAL_TABLES.get(instanceId).get(tableName).rows.add(context.element());
      context.output(context.element());
    }
  }
}