text:
<!DOCTYPE html>

<link href='http://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../">
  <title data-ice="title">Function | Arva API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">

<link data-ice="userStyle" rel="stylesheet" href="user/css/0-styles.css">

  Home

  Reference
  Source

    <input class="search-input">

components
CDataBoundScrollView

CReflowingScrollView

components/logic/branding
CBrandingEngine

CBrandingEngineSingleton

core
CApp

CController

CModel

CRouter

CView

data
CDataSource

CPrioritisedArray

CPrioritisedObject

CSnapshot

data/datasources
CFirebaseDataSource

CSharePointDataSource

data/datasources/SharePoint
CDataModelGenerator

CSharePointSnapshot

data/datasources/SharePoint/SPSoapAdapter
CSettings

CSharePoint

data/datasources/SharePoint/SPSoapAdapter/Worker
CSharePointClient

CSoapClient

data/local
CLocalModel

CLocalPrioritisedArray

layout
Fevent._subscribe

Fevent.on

Fevent.once

Fevent.pipe

Fflow.defaultOptions

Fflow.defaultState

Fflow.multipleStateStep

Fflow.stateStep

Fflow.viewStates

Flayout._dockTo

Flayout.align

Flayout.animate

Flayout.columnDockPadding

Flayout.custom

Flayout.dock.bottom

Flayout.dock.fill

Flayout.dock.left

Flayout.dock.none

Flayout.dock.right

Flayout.dock.top

Flayout.dockPadding

Flayout.dockSpace

Flayout.draggable

Flayout.flow

Flayout.fullSize

Flayout.nativeScrollable

Flayout.opacity

Flayout.origin

Flayout.renderable

Flayout.rotate

Flayout.rotateFrom

Flayout.scale

Flayout.scrollable

Flayout.size

Flayout.skew

Flayout.swipable

Flayout.translate

Flayout.translateFrom

FTrueSizedLayoutDockHelper

Vevent

Vflow

Vlayout

VflowStates

routers
CArvaRouter

utils
CBlobHelper

CDialogManager

CInjection

CKeyboardHelper

CObjectHelper

CThrottler

FcallbackToPromise

FsuccessAndErrorToPromise

FwaitMilliseconds

FcombineOptions

Flimit

utils/di
CClassProvider

CFactoryProvider

CInject

CProvide

CSuperConstructor

CTransientScope

CInjector

Fannotate

FhasAnnotation

Finject

Fprovide

FreadAnnotations

FcreateProviderFromFnOrClass

FisFunction

FisObject

FisUpperCase

FtoString

VownKeys

utils/request
FExistsRequest

FGetRequest

FPostRequest

FUrlParser

FParseStringToXml

utils/view
CBaseLayoutHelper

CDockedLayoutHelper

CFullSizeLayoutHelper

CTraditionalLayoutHelper

CRenderableHelper

CSizeResolver

CUtils

Function

Static Public Summary

      public

           ExistsRequest(url: *): *

      public

           GetRequest(url: String): Promise

Prepares a GET request and initiates the communication.

      public

           ParseStringToXml(text: *): *

      public

           PostRequest(options: Object): Promise

Prepares a POST request and initiates the communication.

      public

           TrueSizedLayoutDockHelper(context: LayoutContext, options: Object)

      public

           UrlParser(url: *): *

Parses a url

      public

           annotate(fn: *, annotation: *)

      public

           callbackToPromise(functionWithCallback: *, args: ...*): *

      public

           combineOptions(defaultOptions: *, options: *): *

      public

           createProviderFromFnOrClass(fnOrClass: *, annotations: *): *

      public

           event._subscribe(subscriptionType: String, eventName: String, callback: Function): Function

Internal function used by the event decorators to generalize the idea of on, once, and off.

      public

           event.on(eventName: *, callback: *): Function

Adds an event listener to the renderable when specific event happened.

      public

           event.once(eventName: *, callback: *): Function

Adds an event listener to the renderable when specific event happened once.

      public

           event.pipe(pipeToName: *): Function

Pipes events from one renderable to another.

      public

           flow.defaultOptions(flowOptions: Object): Function

Sets the default flow options for a View.

      public

           flow.defaultState(stateName: String, stateOptions: Object, transformations: Array.Function): Function

Functions the same as @flow.stateStep(), and additionally also immediately applies the decorators passed into the 'transformations' argument.

      public

           flow.multipleStateStep(stateName: String, states: Array.Object): Function

A wrapper around @flow.stateStep, to allow defining multiple steps with the same state name.

      public

           flow.stateStep(stateName: String, stateOptions: Object, transformations: Array.Function): Function

Used to define a state that the renderable is able to flow to.

      public

           flow.viewStates(states: Object): Function

Defines the View-level states, that exist of concurrently and sequentially executed renderable-level states.

      public

           hasAnnotation(fn: *, annotationClass: *): boolean

      public

           inject(tokens: ...*): *

      public

           isFunction(value: *): *

      public

           isObject(value: *): *

      public

           isUpperCase(char: *): *

      public

           layout._dockTo(dockMethod: *, size: *, space: *, zIndex: *): Function

Internal function to do docking

      public

           layout.align(): Function

Translates the renderable by a proportion of the context size.

      public

           layout.animate(options: Object): Function

Creates an animation controller to show/hide the renderable.

      public

           layout.columnDockPadding(maxContentWidth: Number, defaultPadding: Array.Number): Function

Like @layout.dockPadding, sets the padding between this view and its docked content.

      public

           layout.custom(customLayoutFunction: *): Function

Adds a custom layout function to the view.

      public

           layout.dock.bottom(space: Number, zIndex: Number): Function

Docks the renderable to the bottom.

      public

           layout.dock.fill(): Function

Fills the space that is left after the docking with this renderable.

      public

           layout.dock.left(): Function

Docks the renderable to the left.

      public

           layout.dock.none(): Function

Marks the renderable as not being docked anymore.

      public

           layout.dock.right(): Function

Docks the renderable to the right.

      public

           layout.dock.top(space: Number, zIndex: Number): Function

Docks the renderable to the top.

      public

           layout.dockPadding(firstMargin: Number, secondMargin: Number, thirdMargin: Number, fourthMargin: Number): Function

Sets the margins for the docked content.

      public

           layout.dockSpace(space: Number): Function

Specifies the space that should come before the docked renderable.

      public

           layout.draggable(): Function

Makes the renderable allowed to be dragged around.

      public

           layout.flow(Options: Object): Function

Makes the view flow by tweening all intermediate stages of a changed attribute of any renderable.

      public

           layout.fullSize(): Function

Marks the renderable to cover the entire screen.

      public

           layout.nativeScrollable(options: Object): Function

Experimental feature of scrolling natively.

      public

           layout.opacity(opacity: Number): Function

Sets the opacity of a renderable.

      public

           layout.origin(): Function

Sets the point where the renderable has its anchor from where rotation and translation will be done.

      public

           layout.renderable(): Function

Merely marks a view property as a decorated renderable, which allows it to be rendered.

      public

           layout.rotate(x: Number, y: Number, z: Number): Function

Rotates the renderable around any of the three axes (in radians).

      public

           layout.rotateFrom(x: Number, y: Number, z: Number): Function

Rotates the renderable around any of the three axes (in radians) relatively to the current rotation

      public

           layout.scale(x: Number, y: Number, z: Number): Function

Specifies the scale of a renderable.

      public

           layout.scrollable(options: {}): Function

Makes the view as scrollable.

      public

           layout.size(x: Number | Function, y: Number | Function): Function

Specifies the size of the renderable.

      public

           layout.skew(x: Number, y: Number, z: Number): Function

Specifies the skew of a renderable.

      public

           layout.swipable(options: Object): Function

Makes the renderable swipable with physics-like velocity after the dragging is released.

      public

           layout.translate(x: Number, y: Number, z: Number): Function

Specifies a translation of a renderable.

      public

           layout.translateFrom(x: Number, y: Number, z: Number): Function

Specifies a relative translation of a renderable.

      public

           limit(min: *, value: *, max: *): *

@author: Tom Clement (tjclement)

      public

           provide(tokens: ...*): *

      public

           readAnnotations(fn: *): *

      public

           successAndErrorToPromise(): *

      public

           toString(token: *): *

      public

           waitMilliseconds(milliseconds: *): *

Static Public

    public

    ExistsRequest(url: *): *

      source

import {ExistsRequest} from 'arva-js/utils/request/RequestClient.js'

Params:

Name	Type	Attribute	Description

      url
      *

Return:

        *

    public

    GetRequest(url: String): Promise

      source

import {GetRequest} from 'arva-js/utils/request/RequestClient.js'

Prepares a GET request and initiates the communication.

Params:

Name	Type	Attribute	Description

      url
      String

Return:

        Promise

Returns an asynchronous response object which can be managed to read the response in an chaining proces.

    public

    ParseStringToXml(text: *): *

      source

import {ParseStringToXml} from 'arva-js/utils/request/XmlParser.js'

@author: Hans van den Akker (mysim1)

Params:

Name	Type	Attribute	Description

      text
      *

Return:

        *

    public

    PostRequest(options: Object): Promise

      source

import {PostRequest} from 'arva-js/utils/request/RequestClient.js'

Prepares a POST request and initiates the communication.

Params:

Name	Type	Attribute	Description

      options
      Object

Provide properties: { headers: <Map>, data: <string>, url: <string> }

Return:

        Promise

Returns an asynchronous response object which can be managed to read the response in an chaining proces.

    public

    TrueSizedLayoutDockHelper(context: LayoutContext, options: Object)

      source

import {TrueSizedLayoutDockHelper} from 'arva-js/layout/TrueSizedLayoutDockHelper.js'

Params:

Name	Type	Attribute	Description

      context
      LayoutContext

layout-context

      options
      Object

optional

additional options

      options.margins
      Object

optional

margins to start out with (default: 0px)

      options.translateZ
      Number

optional

z-index to use when translating objects (default: 0)

    public

    UrlParser(url: *): *

      source

import {UrlParser} from 'arva-js/utils/request/UrlParser.js'

Parses a url

Params:

Name	Type	Attribute	Description

      url
      *

Return:

        *

    public

    annotate(fn: *, annotation: *)

      source

import {annotate} from 'arva-js/utils/di/Decorators.js'

Params:

Name	Type	Attribute	Description

      fn
      *

      annotation
      *

    public

    callbackToPromise(functionWithCallback: *, args: ...*): *

      source

import {callbackToPromise} from 'arva-js/utils/CallbackHelpers.js'

Params:

Name	Type	Attribute	Description

      functionWithCallback
      *

      args
      ...*

Return:

        *

    public

    combineOptions(defaultOptions: *, options: *): *

      source

import {combineOptions} from 'arva-js/utils/CombineOptions.js'

Params:

Name	Type	Attribute	Description

      defaultOptions
      *

      options
      *

Return:

        *

    public

    createProviderFromFnOrClass(fnOrClass: *, annotations: *): *

      source

import {createProviderFromFnOrClass} from 'arva-js/utils/di/providers.js'

Params:

Name	Type	Attribute	Description

      fnOrClass
      *

      annotations
      *

Return:

        *

    public

    event._subscribe(subscriptionType: String, eventName: String, callback: Function): Function

      source

Internal function used by the event decorators to generalize the idea of on, once, and off.

Params:

Name	Type	Attribute	Description

      subscriptionType
      String

A type of subscription function, e.g. on

      eventName
      String

The event name

      callback
      Function

that is called when event has happened

Return:

        Function

    public

    event.on(eventName: *, callback: *): Function

      source

Adds an event listener to the renderable when specific event happened.

Params:

Name	Type	Attribute	Description

      eventName
      *

      callback
      *

Return:

        Function

A decorator function

Example:

@layout.on('click', function() {this._handleClick})
thing = new Surface({properties: {backgroundColor: 'red'}});

_handleClick() { ... }

    public

    event.once(eventName: *, callback: *): Function

      source

Adds an event listener to the renderable when specific event happened once.

Params:

Name	Type	Attribute	Description

      eventName
      *

      callback
      *

Return:

        Function

A decorator function

Example:

@layout.size(100,100)
@layout.stick.center()
@layout.once('click', function() {this._handleClick})
thing = new Surface({properties: {backgroundColor: 'red'}});

_handleClick() { ... }

    public

    event.pipe(pipeToName: *): Function

      source

Pipes events from one renderable to another. The other renderable has to be declared above the one that is doing
the piping, otherwise an exception will be thrown.

Params:

Name	Type	Attribute	Description

      pipeToName
      *

Return:

        Function

Example:

@layout.fullSize()
@layout.pipe('dbsv')
//Pipe events to another renderable declared above, called 'dbsv'
scrollableSurface = new Surface();

    public

    flow.defaultOptions(flowOptions: Object): Function

      source

Sets the default flow options for a View. These options will be overridden by
each of its renderables, if they have flow options defined through e.g. flow.stateStep()

Params:

Name	Type	Attribute	Description

      flowOptions
      Object

Options to set as default.

      flowOptions.delay
      Object

optional

The amount of milliseconds to wait in between state transitions.

      flowOptions.transition
      Object

optional

A Famo.us-compatible transition object defining the animation specifics.

      flowOptions.transition.curve
      Object

optional

The animation curve to use when flowing from one state to another, e.g. Easing.outCubic.

      flowOptions.transition.duration
      Object

optional

The amount of milliseconds a flow animation should take.

Return:

        Function

Example:

@flow.defaultOptions({ transition: { curve: Easing.outCubic, duration: 200 } })
class MyView extends View {
}

    public

    flow.defaultState(stateName: String, stateOptions: Object, transformations: Array.Function): Function

      source

Functions the same as @flow.stateStep(), and additionally also immediately applies the decorators passed into the 'transformations' argument.
Used to define a state step, without having to also manually apply the same decorators to the renderable to ensure it is rendered this way
on initial show.

Params:

Name	Type	Attribute	Description

      stateName
      String

The state name to assign to this state step.

      stateOptions
      Object

optional

Flow options to use in the state step.

      stateOptions.delay
      Object

optional

The amount of milliseconds to wait in between state transitions.

      stateOptions.transition
      Object

optional

A Famo.us-compatible transition object defining the animation specifics.

      stateOptions.transition.curve
      Object

optional

The animation curve to use when flowing from one state to another, e.g. Easing.outCubic.

      stateOptions.transition.duration
      Object

optional

The amount of milliseconds a flow animation should take.

      transformations
      Array.Function

Decorators to assign to this state, and to apply initially, passed in as regular comma-separated arguments.

Return:

        Function

Example:

// Initial size is [100, 100], and rendered at center of parent.
@flow.defaultState('active', {}, layout.size(100, 100), layout.stick.center())
myRenderable = new Surface();

    public

    flow.multipleStateStep(stateName: String, states: Array.Object): Function

      source

A wrapper around @flow.stateStep, to allow defining multiple steps with the same state name.

Params:

Name	Type	Attribute	Description

      stateName
      String

State name to assign states to.

      states
      Array.Object

An array of {stateOptions: [..], transformations: [..]} objects, with stateOptions and transformations
being the same usage as @flow.stateStep().

Return:

        Function

    public

    flow.stateStep(stateName: String, stateOptions: Object, transformations: Array.Function): Function

      source

Used to define a state that the renderable is able to flow to. When multiple state steps with the same state name
are defined, flowing into that state will sequentially execute all defined steps with that state name.

Params:

Name	Type	Attribute	Description

      stateName
      String

The state name to assign to this state step.

      stateOptions
      Object

optional

Flow options to use in the state step.

      stateOptions.delay
      Object

optional

The amount of milliseconds to wait in between state transitions.

      stateOptions.transition
      Object

optional

A Famo.us-compatible transition object defining the animation specifics.

      stateOptions.transition.curve
      Object

optional

The animation curve to use when flowing from one state to another, e.g. Easing.outCubic.

      stateOptions.transition.duration
      Object

optional

The amount of milliseconds a flow animation should take.

      transformations
      Array.Function

Decorators to assign to this state, and to apply initially, passed in as regular comma-separated arguments.

Return:

        Function

Example:

// Initial size is [0, 0], and rendered at top left of parent, because no @flow.defaultStep() was done,
// and no other decorators are applied to the renderable.
@flow.stateStep('active', {}, layout.size(100, 100), layout.stick.center())
myRenderable = new Surface();

    public

    flow.viewStates(states: Object): Function

      source

Defines the View-level states, that exist of concurrently and sequentially executed renderable-level states.
When e.g. View.setViewFlowState('active') is called, the renderable states defined in the view-level state 'active' are executed.

Params:

Name	Type	Attribute	Description

      states
      Object

An object keyed by View-level state names, with values of arrays of objects.

Return:

        Function

Example:

// Calling setViewFlowState('active') will first hide the loader, and when that is completed, show both buttons at the same time.
@flow.viewStates({ 'active': [{loader: 'hidden'}, { button1: 'active', button2: 'active' }] })
class MyView extends View {

  @flow.defaultState('shown', {}, layout.opacity(1), layout.fullSize())
  @flow.stateStep('hidden', {}, layout.opacity(0))
  loader = new Surface();

  @flow.defaultState('inactive', {}, layout.opacity(0), layout.size(100, 100), layout.stick.top())
  @flow.stateStep('active', {}, layout.opacity(1))
  button1 = new Surface();

  @flow.defaultState('inactive', {}, layout.opacity(0), layout.size(100, 100), layout.stick.bottom())
  @flow.stateStep('active', {}, layout.opacity(1))
  button1 = new Surface();
}

    public

    hasAnnotation(fn: *, annotationClass: *): boolean

      source

import {hasAnnotation} from 'arva-js/utils/di/Decorators.js'

Params:

Name	Type	Attribute	Description

      fn
      *

      annotationClass
      *

Return:

        boolean

    public

    inject(tokens: ...*): *

      source

import {inject} from 'arva-js/utils/di/Decorators.js'

Params:

Name	Type	Attribute	Description

      tokens
      ...*

Return:

        *

    public

    isFunction(value: *): *

      source

import {isFunction} from 'arva-js/utils/di/util.js'

Params:

Name	Type	Attribute	Description

      value
      *

Return:

        *

    public

    isObject(value: *): *

      source

import {isObject} from 'arva-js/utils/di/util.js'

Params:

Name	Type	Attribute	Description

      value
      *

Return:

        *

    public

    isUpperCase(char: *): *

      source

import {isUpperCase} from 'arva-js/utils/di/util.js'

Params:

Name	Type	Attribute	Description

      char
      *

Return:

        *

    public

    layout._dockTo(dockMethod: *, size: *, space: *, zIndex: *): Function

      source

Internal function to do docking

Params:

Name	Type	Attribute	Description

      dockMethod
      *

      size
      *

      space
      *

      zIndex
      *

Return:

        Function

    public

    layout.align(): Function

      source

Translates the renderable by a proportion of the context size.

Params:

Name	Type	Attribute	Description

      x.
      Number

The proportion of the context width that is going to be translated.

      y.
      Number

The proportion of the context height that is going to be translated.

Return:

        Function

A decorator function.

Example:

@layout.align(0.5, 0.5)
@layout.size(100,100)
//Displays a red box just below the vertical mid point and past the horizontal mid point
renderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.animate(options: Object): Function

      source

Creates an animation controller to show/hide the renderable. Renderables can be shown by calling
this.showRenderable(renderableName) and hidden using this.hideRenderable(renderableName) or
this.showRenderable(renderableName, false). When a renderable has been shown, it will emit the event 'shown'.

Params:

Name	Type	Attribute	Description

      options
      Object

optional

The same as famous-flex Animation Controller, plus 2 more:

      options.showInitially
      Boolean

optional

Whether to show the renderable when the view is created. (Default: true).

      options.waitFor
      String

optional

If specified, it will wait for the renderable with the specified name to show
before showing the renderable

      options.transition
      Object

optional

Transition options.

      options.animation
      Function

optional

Animation function (default: AnimationController.Animation.FadedZoom).

      options.zIndexOffset
      Number

optional

Optional z-index difference between the hiding & showing renderable (default: 0).

      options.keepHiddenViewsInDOMCount
      Number

optional

Keeps views in the DOM after they have been hidden (default: 0).

      options.show
      Object

optional

Show specific options.

      options.show.transition
      Object

optional

Show specific transition options.

      options.show.animation
      Function

optional

Show specific animation function.

      options.hide
      Object

optional

Hide specific options.

      options.hide.transition
      Object

optional

Hide specific transition options.

      options.hide.animation
      Function

optional

Hide specific animation function.

      options.transfer
      Object

optional

Transfer options.

      options.transfer.transition
      Object

optional

Transfer specific transition options.

      options.transfer.zIndex
      Number

optional

Z-index the tranferables are moved on top while animating (default: 10).

      options.transfer.fastResize
      Bool

optional

When enabled, scales the renderable i.s.o. resizing when doing the transfer animation (default: true).

      options.transfer.items
      Array

optional

Ids (key/value) pairs (source-id/target-id) of the renderables that should be transferred.

Return:

        Function

Example:

@layout.stick.center()
@layout.size(100,100)
@layout.animate({transition: {duration: 350}})
renderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.columnDockPadding(maxContentWidth: Number, defaultPadding: Array.Number): Function

      source

Like @layout.dockPadding, sets the padding between this view and its docked content.
When the screen width plus this padding exceeds maxContentWidth, the padding
is increased, so that the content is never wider than maxContentWidth.

Params:

Name	Type	Attribute	Description

      maxContentWidth
      Number

Maximum width the content should be allowed to be.

      defaultPadding
      Array.Number

A 1-D, 2-D, or 4-D array of padding numbers, just like the padding spec in CSS.

Return:

        Function

Example:

@layout.columnDockPadding(720, [16])
//Creates a class with 16px margin on all sides for docked renderables
class myView extends View{

 //Will be displayed with margin to the top and sides, and will at max be 720px wide.
 @layout.dock.top(20)
 onTop = new Surface({content: "hello world"});

 //Will be displayed without margin since we're using @layout.stick instead of @layout.dock
 @layout.stick.bottom
 onButtom = new Surface({content: "hey hey"});
}

    public

    layout.custom(customLayoutFunction: *): Function

      source

Adds a custom layout function to the view.
This decorator works directly on the object so you shouldn't pass any arguments nor use parentheses.

Params:

Name	Type	Attribute	Description

      customLayoutFunction
      *

Return:

        Function

A decorator function

Example:

@layout.custom((context) => {
 context.set('myRenderable', {
 size: [100, 100]
})
class MyView extends View {
 constructor(options) {
     super(options);
     this.renderables.myRenderable = new Surface({properties: {backgroundColor: 'red'}});
 }
}

    public

    layout.dock.bottom(space: Number, zIndex: Number): Function

      source

Docks the renderable to the bottom.
When using both a docked size and the layout.size decorator, then that layout.size becomes the actual inner size.
The renderable can then be stickd within the docking area with origin and align. When combined with align, treats
the context size the docking size.
When using layout.size without specifying a docked size, it will use that size as docking size. Useful for
automatic sizing when parent defines true size and orthogonal size (e.g. height for dock 'left') has to be defined.

Params:

Name	Type	Attribute	Description

      size].
      Number | Function

optional

The size of the renderable in the one dimension that is being docked, e.g.
dock left or right will be width, whereas dock top or bottom will result in height. For more information about
different variations, see layout.size.

      space
      Number

optional

= 0]. Any space that should be inserted before the docked renderable

      zIndex
      Number

optional

= 0]. DEPRECATED: Use translate(0, 0, zIndex) instead.

Return:

        Function

A decorator function

Example:

@layout.dock.bottom(30, 0, 10)
@layout.size(15, undefined)
@layout.origin(0.5, 0)
@layout.align(0.5, 0)
dockedRenderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.dock.fill(): Function

      source

Fills the space that is left after the docking with this renderable. When using layout.size, it will use that
size as an inner size. This works similarly to other docking, from where translate, size, origin, align, etc
can be specified.

Return:

        Function

A decorator function

Example:

@layout.dock.fill()
filledRenderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.dock.left(): Function

      source

Docks the renderable to the left.
When using both a docked size and the layout.size decorator, then that layout.size becomes the actual inner size.
The renderable can then be stickd within the docking area with origin and align. When combined with align, treats
the context size the docking size.
When using layout.size without specifying a docked size, it will use that size as docking size. Useful for
automatic sizing when parent defines true size and orthogonal size (e.g. height for dock 'left') has to be defined.

Params:

Name	Type	Attribute	Description

      size].
      Number | Function

optional

The size of the renderable in the one dimension that is being docked, e.g.
dock left or right will be width, whereas dock top or bottom will result in height. For more information about
different variations, see layout.size.

      space].
      Number

optional

Any space that should be inserted before the docked renderable

      zIndex].
      Number

optional

DEPRECATED: Use translate(0, 0, zIndex) instead.

Return:

        Function

A decorator function

Example:

@layout.dock.left(30, 0, 10)
@layout.size(15, undefined)
@layout.origin(0.5, 0)
@layout.align(0.5, 0)
dockedRenderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.dock.none(): Function

      source

Marks the renderable as not being docked anymore. Useful when dynamically changing decorations through
this.decorateRenderable or this.setRenderableFlowState

Return:

        Function

A decorator function

Example:

@layout.dock.fill()
@flow.stateStep('nonFilled', layout.dock.none(), layout.size(100, 100))
filledRenderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.dock.right(): Function

      source

Docks the renderable to the right.
When using both a docked size and the layout.size decorator, then that layout.size becomes the actual inner size.
The renderable can then be stickd within the docking area with origin and align. When combined with align, treats
the context size the docking size.
When using layout.size without specifying a docked size, it will use that size as docking size. Useful for
automatic sizing when parent defines true size and orthogonal size (e.g. height for dock 'left') has to be defined.

Params:

Name	Type	Attribute	Description

      size].
      Number | Function

optional

The size of the renderable in the one dimension that is being docked, e.g.
dock left or right will be width, whereas dock top or bottom will result in height. For more information about
different variations, see layout.size.

      space].
      Number

optional

Any space that should be inserted before the docked renderable

      zIndex].
      Number

optional

DEPRECATED: Use translate(0, 0, zIndex) instead.

Return:

        Function

A decorator function

Example:

@layout.dock.right(30, 0, 10)
@layout.size(15, undefined)
@layout.origin(0.5, 0)
@layout.align(0.5, 0)
dockedRenderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.dock.top(space: Number, zIndex: Number): Function

      source

Docks the renderable to the top.
When using both a docked size and the layout.size decorator, then that layout.size becomes the actual inner size.
The renderable can then be stickd within the docking area with origin and align. When combined with align, treats
the context size the docking size.
When using layout.size without specifying a docked size, it will use that size as docking size. Useful for
automatic sizing when parent defines true size and orthogonal size (e.g. height for dock 'left') has to be defined.

Params:

Name	Type	Attribute	Description

      size].
      Number | Function

optional

The size of the renderable in the one dimension that is being docked, e.g.
dock left or right will be width, whereas dock top or bottom will result in height. For more information about
different variations, see layout.size.

      space
      Number

optional

= 0]. Any space that should be inserted before the docked renderable

      zIndex
      Number

optional

= 0]. DEPRECATED: Use translate(0, 0, zIndex) instead.

Return:

        Function

A decorator function

Example:

@layout.dock.top(30, 0, 10)
@layout.size(15, undefined)
@layout.origin(0.5, 0)
@layout.align(0.5, 0)
dockedRenderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.dockPadding(firstMargin: Number, secondMargin: Number, thirdMargin: Number, fourthMargin: Number): Function

      source

Sets the margins for the docked content. This can be applied both to a child and a class. When in conflict,
the parent will override the child's setting. If the margin is set on a Surface, then CSS padding will be set.
margins can be 1, 2, or 4, parameters, which can be specified as shorthand in the same way
as CSS does it.

Params:

Name	Type	Attribute	Description

      firstMargin
      Number

      secondMargin
      Number

optional

      thirdMargin
      Number

optional

      fourthMargin
      Number

optional

Return:

        Function

A decorator function

Example:

@layout.dockPadding(15)
//Creates a class with 15px margin on all sides for docked renderables
class myView extends View{

 //Will be displayed with margin
 @layout.dock.top(20)
 onTop = new Surface({content: "hello world"});

 //Will be displayed without margin since we're using @layout.stick
 @layout.stick.bottom
 onButtom = new Surface({content: "hey hey"});
}

    public

    layout.dockSpace(space: Number): Function

      source

Specifies the space that should come before the docked renderable. Useful when not specifying the size in the
layout.dock function. Note that the space does not appear if there isn't any renderable with a size greater than
zero before it.

Params:

Name	Type	Attribute	Description

      space
      Number

The space that is inserted before the renderable.

Return:

        Function

A decorator function

Example:

// there's a 20px space before this box
@layout.dockSpace(20)
@layout.size(100, 100)
@layout.dock.left()
box = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.draggable(): Function

      source

Makes the renderable allowed to be dragged around. this.renderables[name] refers to a RenderNode containing this
draggable along with the renderable itself.

Params:

Name	Type	Attribute	Description

      draggableOptions].
      Object

optional

Same options that can be passed to a Famous Draggable.

      options.snapX
      Number

optional

grid width for snapping during drag

      options.snapY
      Number

optional

grid height for snapping during drag

      options.xRange
      Array.Number

optional

maxmimum [negative, positive] x displacement from start of drag

      options.yRange
      Array.Number

optional

maxmimum [negative, positive] y displacement from start of drag

      options.scale
      Number

optional

one pixel of input motion translates to this many pixels of output drag motion

      options.projection
      Number

optional

User should set to Draggable._direction.x or
   Draggable._direction.y to constrain to one axis.

Return:

        Function

Example:

@layout.draggable({xRange: [0, 100}, yRange: [0, 200]})
@layout.size(100, 100)
// Makes a draggable square that is red
draggableRenderable = new Surface({properties: {backgroundColor: 'red'});

    public

    layout.flow(Options: Object): Function

      source

Makes the view flow by tweening all intermediate stages of a changed attribute of any renderable.

Params:

Name	Type	Attribute	Description

      Options
      Object

to pass as flowOptions to the LayoutController

      flowOptions.transition
      Bool

optional

If specified, sets the default transition to use

      flowOptions.reflowOnResize
      Bool

optional

Smoothly reflows renderables on resize (only used when flow = true) (default: true).

      flowOptions.spring
      Object

optional

Spring options used by nodes when reflowing (default: {dampingRatio: 0.8, period: 300}).

      flowOptions.properties
      Object

optional

Properties which should be enabled or disabled for flowing.

      flowOptions.insertSpec
      Spec

optional

Size, transform, opacity... to use when inserting new renderables into the scene (default: {}).

      flowOptions.removeSpec
      Spec

optional

Size, transform, opacity... to use when removing renderables from the scene (default: undefined).

Return:

        Function

A decorator function

Example:

@layout.flow({spring: {dampingRatio: 0.8, period: 1000}})
class myView extends View{
...
}

    public

    layout.fullSize(): Function

      source

Marks the renderable to cover the entire screen. Translate can also be specified on such a renderable.

Return:

        Function

A decorator function

Example:

@layout.fullSize()
// View will have a red background
background = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.nativeScrollable(options: Object): Function

      source

Experimental feature of scrolling natively.

Params:

Name	Type	Attribute	Description

      options
      Object

optional

Options on how to scroll

      options.scrollY
      Boolean

optional

Defaults to true

      options.scrollX
      Boolean

optional

Defaults to false

Return:

        Function

A decorator function

    public

    layout.opacity(opacity: Number): Function

      source

Sets the opacity of a renderable.

Params:

Name	Type	Attribute	Description

      opacity
      Number

The opacity, between 0 and 1

Return:

        Function

A decorator function

Example:

@layout.opacity(0.5)
@layout.size(100, 10)
@layout.place.center()
// Writes text that is half invisible
renderable = new Surface({content: 'Half invisible'});

    public

    layout.origin(): Function

      source

Sets the point where the renderable has its anchor from where rotation and translation will be done.
You could consider it as translating the negative of the proportion times its size. The arguments are always
between and including 0 and 1.

Params:

Name	Type	Attribute	Description

      x.
      Number

The x of the origin.

      y.
      Number

The y of the origin.

Return:

        Function

A decorator function.

Example:

@layout.origin(0.5, 0)
@layout.align(0.5, 0.5)
@layout.size(100,100)
//Displays a red box horizontically centered and displays just below the vertical mid point
renderable = new Surface({properties: {backgroundColor: 'red'}});

    public

    layout.renderable(): Function

      source

Merely marks a view property as a decorated renderable, which allows it to be rendered.
Use this in combination with a @layout.custom decorator on the view in which this renderable resides.

Return:

        Function

A decorator function

Example:

@layout.renderable
renderable = new Surface();

    public

    layout.rotate(x: Number, y: Number, z: Number): Function

      source

Rotates the renderable around any of the three axes (in radians).

Params:

Name	Type	Attribute	Description

      x
      Number

The rotation around the x axis (flips vertically)

      y
      Number

The rotation around the y axis (flips horizontally)

      z
      Number

The rotation around the z axis (rotatesin in the more intuitive sense)

Return:

        Function

A decorator function

Example:

@layout.size(100,100)
@layout.rotate(0, 0, Math.PI)
// Writes text upside down
renderable = new Surface({content: 'upside down text'});

    public

    layout.rotateFrom(x: Number, y: Number, z: Number): Function

      source

Rotates the renderable around any of the three axes (in radians) relatively to the current rotation

Params:

Name	Type	Attribute	Description

      x
      Number

The rotation around the x axis (flips vertically)

      y
      Number

The rotation around the y axis (flips horizontally)

      z
      Number

The rotation around the z axis (rotatesin in the more intuitive sense)

Return:

        Function

A decorator function

Example:

@layout.size(100,100)
@layout.rotate(0, 0, Math.PI)
// Writes text upside down
renderable = new Surface({content: 'upside down text'});

    public

    layout.scale(x: Number, y: Number, z: Number): Function

      source

Specifies the scale of a renderable. Can be applied to every kind of renderable.

Params:

Name	Type	Attribute	Description

      x
      Number

Scales the renderable along the x axis.

      y
      Number

Scales the renderable along the y axis.

      z
      Number

Scales the renderable along the z axis.

Return:

        Function

A decorator function.

Example:

 class myView extends View{
 @layout.scale(2, 2, 2)
 @layout.fullscreen
 // Will scale the renderable by 2 in the x,y,z dimension
 myBackground = new Surface({properties: {backgroudColor: 'red'}});
}

    public

    layout.scrollable(options: {}): Function

      source

Makes the view as scrollable. This will put the entire content in a ReflowingScrollView that uses getSize on the
view to determine scrolling size. If the size cannot be determined, you might consider declaring your own
getSize() on the View.

Params:

Name	Type	Attribute	Description

      options
      {}

optional

default: {}

Return:

        Function

A decorator function

Example:

@layout.scrollable()
class myView extends View{
...
}

    public

    layout.size(x: Number | Function, y: Number | Function): Function

      source

Specifies the size of the renderable. For both of the parameters, sizes can be interpreted as follows:

If specified as a function, then the argument passed is the context size of the specified dimension
(width or height). Note that if an arrow function is used, this scoping cannot be used when inside a
decorator, since the scope will be the global scope.

If true is specified or a tilde with a size (e.g. ~300), then the renderable will be automatically sized.
If a tilde is used to indicate the size, then the size after the tilde will be used when/if the
renderable doesn't have a size, or turn into the actual size if it can be determined. This is useful when wanting
to reduce the flickering of surfaces who's size cannot be determined the first render tick.
Beware that true sizing of surfaces or other raw dom elements (input surfaces, image surfaces, text boxes etc)
often comes with a perfomance penalty and should only be used when necessary.
Also beware that any negative size will be interpreted as a tilde, since ~x = 1 - x

If undefined is specified, then the size of that dimension will equal the entire context size.

If a size between 0 and 1 is specified, then that will be interpreted as a proportion of the context size. For
example if 0.5 is specified, then the size will be half of the context size (the parent's size). Instead of
specifying 1 to cover the entire context size, use undefined instead.

Params:

Name	Type	Attribute	Description

      x
      Number | Function

      y
      Number | Function

Return:

        Function

A decorator function

Example:

@layout.size(function(contextWidth) {return Math.max(contextWidth, this.options.maxWidth)}, ~300)
// Creates a renderable where the width is equal to the text width and the height is whatever is bigger,
// options.maxWidth, or the context size
text = new Surface({content: 'This is some text', properties: {backgroundColor: 'red'}});

    public

    layout.skew(x: Number, y: Number, z: Number): Function

      source

Specifies the skew of a renderable. Can be applied to every kind of renderable.

Params:

Name	Type	Attribute	Description

      x
      Number

Skews the renderable along the x axis.

      y
      Number

Skews the renderable along the y axis.

      z
      Number

Skews the renderable along the z axis.

Return:

        Function

A decorator function.

Example:

 class myView extends View{
 @layout.skew(2, 2, 2)
 @layout.fullscreen
 // Will skew the renderable by 2 in the x,y,z dimension
 myBackground = new Surface({properties: {backgroudColor: 'red'}});
}

    public

    layout.swipable(options: Object): Function

      source

Makes the renderable swipable with physics-like velocity after the dragging is released. Emits event
'thresholdReached' with arguments ('x'|'y', 0|1) when any thresholds have been reached. this.renderables[name]
now refers to a a RenderNode containing a positionModifier along with the renderable itself.

Params:

Name	Type	Attribute	Description

      options
      Object

      options.snapX
      Boolean

optional

Whether to snap to the x axis

      options.snapY
      Boolean

optional

Whether to snap to the Y axis

      options.enabled
      Boolean

optional

Whether the swipable should be initially enabled

      options.xThreshold
      Array.Number

optional

Two values of the thresholds that trigger the thresholdReached event with
argument 'x' and second argument 0 or 1, depending on the direction.
Specify undefined in one of them to disable threshold to that direction.

      options.yThreshold
      Array.Number

optional

Two values of the thresholds that trigger the thresholdReached event with
argument 'y'  and second argument 0 or 1, depending on the direction.
Specify undefined in one of them to disable threshold to that direction.

Return:

        Function

A decorator function

Example:

@layout.size(100, 100)
@layout.swipable({xRange: [0, 100], snapX: true})
//Make a red box that can slide to the right
swipable = new Surface({properties: {backgroundColor: 'red'});

    public

    layout.translate(x: Number, y: Number, z: Number): Function

      source

Specifies a translation of a renderable. Can be applied to every kind of renderable (docked, fullSize,
and normal). Can also be applied on view level to translate every renderable of that view. The view wide translation defaults
to [0, 0, 10] in order to always increase the z space of every level of the Famous rendering tree.

Params:

Name	Type	Attribute	Description

      x
      Number

Moves the renderable along the x axis.

      y
      Number

Moves the renderable along the y axis.

      z
      Number

Moves the renderable along the z axis.

Return:

        Function

A decorator function.

Example:

@layout.translate(0, 0, 20)
class myView extends View{
 @layout.translate(0, 0, -20)
 @layout.fullSize()
 // Will display relatively at z level 0 (20 minus 20)
 myBackground = new Surface({properties: {backgroudColor: 'red'}});
}

    public

    layout.translateFrom(x: Number, y: Number, z: Number): Function

      source

Specifies a relative translation of a renderable. Can be applied to every kind of renderable (docked, fullSize,
and normal).
Can also be applied on view level to translate every renderable of that view. The view wide translation defaults
to [0, 0, 10] in order to always increase the z space of every level of the Famous rendering tree.

Params:

Name	Type	Attribute	Description

      x
      Number

Moves the renderable along the x axis.

      y
      Number

Moves the renderable along the y axis.

      z
      Number

Moves the renderable along the z axis.

Return:

        Function

A decorator function.

Example:

@layout.translateFrom(0, 0, 20)
class myView extends View{
 @layout.translateFrom(0, 0, -20)
 @layout.fullSize()
 // Will display relatively at z level 0 (20 minus 20)
 myBackground = new Surface({properties: {backgroudColor: 'red'}});
}

    public

    limit(min: *, value: *, max: *): *

      source

import {limit} from 'arva-js/utils/Limiter.js'

@author: Tom Clement (tjclement)

Params:

Name	Type	Attribute	Description

      min
      *

      value
      *

      max
      *

Return:

        *

    public

    provide(tokens: ...*): *

      source

import {provide} from 'arva-js/utils/di/Decorators.js'

Params:

Name	Type	Attribute	Description

      tokens
      ...*

Return:

        *

    public

    readAnnotations(fn: *): *

      source

import {readAnnotations} from 'arva-js/utils/di/Decorators.js'

Params:

Name	Type	Attribute	Description

      fn
      *

Return:

        *

    public

    successAndErrorToPromise(): *

      source

import {successAndErrorToPromise} from 'arva-js/utils/CallbackHelpers.js'

Return:

        *

    public

    toString(token: *): *

      source

import {toString} from 'arva-js/utils/di/util.js'

Params:

Name	Type	Attribute	Description

      token
      *

Return:

        *

    public

    waitMilliseconds(milliseconds: *): *

      source

import {waitMilliseconds} from 'arva-js/utils/CallbackHelpers.js'

Params:

Name	Type	Attribute	Description

      milliseconds
      *

Return:

        *

  Generated by ESDoc(0.5.0-alpha)


text:
"""Fichier contenant les convertisseurs de la classe Rapport."""

class Convertisseur:

    """Classe pour envelopper les convertisseurs."""

    def depuis_version_0(objet, classe):
        objet.set_version(classe, 1)
        objet.str_statut = objet._statut

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace CartTest\Model;

use Cart\Entity\CartItem;
use Cart\Utils\CartItemAdder;
use Cart\Repository\CartItemsRepositoryInterface;
use Common\Test\SeekAppRootTrait;
use Common\Value\QuantityRequested;
use Products\Entity\Product;
use Products\Value\Price;
use Products\Value\QuantityAvailable;
use Zend\Test\PHPUnit\Controller\AbstractControllerTestCase;

class CartAdderTest extends AbstractControllerTestCase
{
    use SeekAppRootTrait;

    public function setUp()
    {
        $this->setApplicationConfig(
            include $this->seekAppConfig(__DIR__)
        );
        parent::setUp();
    }

    /** @test */
    public function shouldAddProductToCart()
    {
        $product = new Product('Test product', '', '', new Price(200), new QuantityAvailable(5));

        /** @var \PHPUnit_Framework_MockObject_Builder_InvocationMocker|CartItemsRepositoryInterface $cartRepoMock */
        $cartRepoMock = $this->getMockBuilder('\Cart\Repository\CartItemsRepositoryInterface')->getMock();

        $cartItemAdder = new CartItemAdder($cartRepoMock, 'test_session_id');
        $result = $cartItemAdder->addToCart($product, new QuantityRequested(1));
        $this->assertInstanceOf('\Cart\Entity\CartItem', $result);
    }

    /** @test */
    public function secondAddedItemShouldIncreaseQuantity()
    {
        $product = new Product('Test product', '', '', new Price(200), new QuantityAvailable(5));

        /** @var \PHPUnit_Framework_MockObject_Builder_InvocationMocker|CartItemsRepositoryInterface $cartRepoMock */
        $cartRepoMock = $this->getMockBuilder('\Cart\Repository\CartItemsRepositoryInterface')->getMock();

        $cartRepoMock->method('findItemByProductAndSession')->willReturn(
            new CartItem('test_session_id', new QuantityRequested(1), $product)
        );

        $cartItemAdder = new CartItemAdder($cartRepoMock, 'test_session_id');
        $item = $cartItemAdder->addToCart($product, new QuantityRequested(1));
        $this->assertEquals(2, $item->getQuantityRequested()->getQuantity());
    }

    /** @test */
    public function increaseItemQuantity()
    {
        $product = new Product('Test product', '', '', new Price(200), new QuantityAvailable(50));

        /** @var \PHPUnit_Framework_MockObject_Builder_InvocationMocker|CartItemsRepositoryInterface $cartRepoMock */
        $cartRepoMock = $this->getMockBuilder('\Cart\Repository\CartItemsRepositoryInterface')->getMock();

        $cartRepoMock->method('findItemByProductAndSession')->willReturn(
            new CartItem('test_session_id', new QuantityRequested(2), $product)
        );

        $cartItemAdder = new CartItemAdder($cartRepoMock, 'test_session_id');
        $item = $cartItemAdder->addToCart($product, new QuantityRequested(5));
        $this->assertEquals(7, $item->getQuantityRequested()->getQuantity());
    }

}


text:
package kariminf.nalangen.nlg.simplenlg;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

import kariminf.nalangen.nlg.UnivRealizer;
import kariminf.nalangen.nlg.simplenlg.EngRealizer;
import kariminf.nalangen.nlg.simplenlg.FraRealizer;
import kariminf.nalangen.ston.Ston2Text;
import kariminf.sentrep.UnivMap;
import kariminf.sentrep.ston.Ston2UnivMap;

public class Ston2TextTest {
	static String stonFile = "../SentRep/ston/exp/that.ston";
	//static String stonFile = "../SentRep/ston/exp/at.ston";
	//static String stonFile = "../SentRep/ston/exp/comp1.ston";
	//static String stonFile = "../SentRep/ston/exp/comp2.ston";
	//static String stonFile = "../SentRep/ston/exp/pn_quant.ston";
	static String wordnetPath = "../LangPi/wordnetDB/wordnet.sqlite";
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String specif = readFile(stonFile);
		UnivMap stonMap = new Ston2UnivMap();
		UnivRealizer realizer;
		Ston2Text translator;

		realizer = new EngRealizer();
		translator = new Ston2Text(realizer, stonMap, "eng", wordnetPath);
		translator.parse(specif);
		if(translator.parsed()){
			System.out.println(realizer.getText());
		} else {
			System.out.println("English parse failed");
		}

		realizer = new FraRealizer();
		translator = new Ston2Text(realizer, stonMap, "fra", wordnetPath);
		translator.parse(specif);
		if(translator.parsed()){
			System.out.println(realizer.getText());
		} else {
			System.out.println("French parse failed");
		}

	}

	public static String readFile (String f) {
		try {
			String contents = "";

			BufferedReader input = new BufferedReader(new FileReader(f));

			for(String line = input.readLine(); line != null; line = input.readLine()) {
				contents += line + "\n";
			}
			input.close();

			return contents;

		} catch(IOException e) {
			e.printStackTrace();
			System.exit(1);
			return null;
		}
	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Nest.Resolvers.Converters;
using Newtonsoft.Json;

namespace Nest
{
	[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
	[JsonConverter(typeof(ReadAsTypeConverter<MaxAggregator>))]
	public interface IMaxAggregator : IMetricAggregator
	{
	}
	public class MaxAggregator : MetricAggregator, IMaxAggregator
	{
	}

	public class MaxAggregationDescriptor<T> : MetricAggregationBaseDescriptor<MaxAggregationDescriptor<T>, T>, IMaxAggregator where T : class
	{

	}
}


text:
package com.github.aureliano.evtbridge.core;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import com.github.aureliano.evtbridge.common.exception.EventBridgeException;

public class EventBridgeMetadata {

	private static final String METADATA_RESOURCE = "metadata.properties";

	private static EventBridgeMetadata metadata;
	private Properties properties;

	private EventBridgeMetadata() {
		this.loadProperties();
	}

	public static EventBridgeMetadata instance() {
		if (metadata == null) {
			metadata = new EventBridgeMetadata();
		}

		return metadata;
	}

	public String getProperty(String key) {
		return this.properties.getProperty(key);
	}

	private void loadProperties() {
		this.properties = new Properties();
		InputStream stream = ClassLoader.getSystemResourceAsStream(METADATA_RESOURCE);

		if (stream == null) {
			throw new EventBridgeException("Resource not '" + METADATA_RESOURCE + "' found.");
		}

		try {
			this.properties.load(stream);
			stream.close();
		} catch (IOException ex) {
			throw new EventBridgeException(ex);
		}
	}
}


text:
#include <aws/imagebuilder/model/ListContainerRecipesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::imagebuilder::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

ListContainerRecipesRequest::ListContainerRecipesRequest() :
    m_owner(Ownership::NOT_SET),
    m_ownerHasBeenSet(false),
    m_filtersHasBeenSet(false),
    m_maxResults(0),
    m_maxResultsHasBeenSet(false),
    m_nextTokenHasBeenSet(false)
{
}

Aws::String ListContainerRecipesRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_ownerHasBeenSet)
  {
   payload.WithString("owner", OwnershipMapper::GetNameForOwnership(m_owner));
  }

  if(m_filtersHasBeenSet)
  {
   Array<JsonValue> filtersJsonList(m_filters.size());
   for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
   {
     filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
   }
   payload.WithArray("filters", std::move(filtersJsonList));

  }

  if(m_maxResultsHasBeenSet)
  {
   payload.WithInteger("maxResults", m_maxResults);

  }

  if(m_nextTokenHasBeenSet)
  {
   payload.WithString("nextToken", m_nextToken);

  }

  return payload.View().WriteReadable();
}


text:
user_name="$( echo ${USER} | tr '[:upper:]' '[:lower:]')"
cluster_name="${user_name}-ml-cluster"
persistent_data_path="/home/jovyan/persistent_data"
local_data_path="`pwd`"
usage="Usage: sh sync.sh [get|push]"

auth_to_cluster() {
    gcloud container clusters get-credentials ${cluster_name}
    pod_name=`kubectl get pod -o=custom-columns=NAME:.metadata.name | grep jupyter-server-pod`
}

get_remote_files() {
    if [ $# -ne 1 ];
        then echo "Must specify a file in ${persistent_data_path}"
        exit 1
    fi
    file=$1
    base_file=`basename ${file}`
    auth_to_cluster
    echoRun "kubectl cp ${pod_name}:${persistent_data_path}/${file} ${local_data_path}/${base_file}"
}

echoRun() {
    echo "${yellow}> $1${reset}"
    eval $1
}

copy_local_files() {
    if [ $# -ne 2 ];
        then echo "Must specify source file in ${local_data_path} and a target directory in ${persistent_data_path}"
        exit 1
    fi
    source_file=$1
    target_dir=$2
    base_file=`basename ${source_file}`
    auth_to_cluster
    echoRun "kubectl cp ${source_file} ${pod_name}:${persistent_data_path}/${target_dir}/"
}

if [ $# -eq 0 ];
    then echo "${usage}"
    exit 1
fi

if [ $1 = "get" ]
then
    get_remote_files $2
elif [ $1 = "push" ]
then
    copy_local_files $2 $3
else
    echo "${usage}"
fi


text:
layout: post
title: Pour qui est ce guide?
date: 2016-12-21 00:00:00
lang: fr
ref: who-is-this-guide-for
context: true
comments_id: who-is-this-guide-for/96
---

Ce guide est à destination des développeurs full-stack, ou des développeurs qui souhaitent construire une application full-stack. En fournissant un guide étape par étape pour le frontend et le backend, nous espérons couvrir tous les aspects du développement d'une application serverless. Il y a un certain nombre de tutoriels existants sur le web mais nous pensons qu'il serait utile d'avoir un point d'entrée unique pour le processus entier. Ce guide est construit pour servir de ressource pour apprendre comment construire et déployer des applications serverless, pas nécessairement le seul ni le meilleur moyen possible.

En tant que développeur backend qui souhaite en apprendre plus sur la partie frontend du développement d'une application serverless ou en tant que développeur backend qui souhaite en apprendre plus à propos du backend; ce guide couvre vos besoins.

Nous couvrons uniquement les besoins des développeurs JavaScript pour le moment. Nous ciblerons peut-être d'autres langages et environnements dans le future. Mais nous pensons que c'est un bon point de départ, car cela peut être réellement bénéfique d'utiiser un seul langage (JavaScript) et environnement (Node.js) pour construire votre application complète.

D'un point de vue personnel, l'approche serverless a été un énorme révélation pour nous et nous souhaitions créer une ressource pour partager ce que nous avons appris. Vous pouvez en lire plus sur nous [**ici**]({% link about/index.html %}). Et [voir un échantillon de ce qui nous avons fait avec SST]({% link showcase.md %}).

Commençons par regarder les aspects que nous aborderons.


text:
<?xml version="1.0"?>
<definitions>
	<definition>
		<key>text_title</key>
		<value><![CDATA[Credit Card / Debit Card (Cardstream)]]></value>
	</definition>
</definitions>


text:
TextGlass Reference Domains
===========================

What is this?
-------------

These are the reference domains for the TextGlass project.

These domains can be used to validate a TextGlass client.

Specification
-------------

https://github.com/TextGlass/reference/wiki/Domain-Specification


text: java -jar pulse-@version@.jar


text:
/*************************************************************************/
/*  multimesh_instance_3d.h                                              */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef MULTIMESH_INSTANCE_3D_H
#define MULTIMESH_INSTANCE_3D_H

#include "scene/3d/visual_instance_3d.h"
#include "scene/resources/multimesh.h"

class MultiMeshInstance3D : public GeometryInstance3D {
	GDCLASS(MultiMeshInstance3D, GeometryInstance3D);

	Ref<MultiMesh> multimesh;

protected:
	static void _bind_methods();
	// bind helpers

public:
	virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const override;

	void set_multimesh(const Ref<MultiMesh> &p_multimesh);
	Ref<MultiMesh> get_multimesh() const;

	virtual AABB get_aabb() const override;

	MultiMeshInstance3D();
	~MultiMeshInstance3D();
};

#endif // MULTIMESH_INSTANCE_H


text:
<!DOCTYPE html>

    <title ng-bind="pageTitle"></title>

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

    <% styles.forEach( function ( file ) { %>
    <link rel="stylesheet" type="text/css" href="<%= file %>" /><% }); %>

    <% scripts.forEach( function ( file ) { %>
    <% }); %>

          <button type="button" class="navbar-toggle" ng-init="menuCollapsed = true"
            ng-click="menuCollapsed = ! menuCollapsed">
            Toggle navigation

          </button>

            ngbp

              <a href="http://github.com/ngbp/ngbp/blob/v<%= version %>-release/CHANGELOG.md">
                v<%= version %>

                Home

                Register

            (c) 2013 Josh David Miller.
            Fork this
            to kickstart your next project.

            ngbp is based on
            AngularJS,
            Bootstrap,
            UI Bootstrap,
            and
            Font Awesome.


text:
@interface JCHATRegisterViewController ()

@end

@implementation JCHATRegisterViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  DDLogDebug(@"Action - viewDidLoad");
  [self setupNavigationBar];
  [self layoutAllView];
}

- (void)setupNavigationBar {
  self.title = @"极光IM";

  UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  [backBtn setFrame:kNavigationLeftButtonRect];

  [backBtn setImage:[UIImage imageNamed:@"goBack"] forState:UIControlStateNormal];
  [backBtn setImageEdgeInsets:kGoBackBtnImageOffset];
  [backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];

  UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
  self.navigationItem.leftBarButtonItem = backItem;
  self.navigationController.navigationBar.translucent = NO;
}

- (void)layoutAllView {
  self.registerBtn.layer.cornerRadius = 4;
  [self.registerBtn.layer setMasksToBounds:YES];
  [self.registerBtn setBackgroundImage:[ViewUtil colorImage:UIColorFromRGB(0x3f80de) frame:self.registerBtn.frame] forState:UIControlStateNormal];
  [self.registerBtn setBackgroundImage:[ViewUtil colorImage:UIColorFromRGB(0x2840b0) frame:self.registerBtn.frame] forState:UIControlStateHighlighted];
  [self.usernameTextField becomeFirstResponder];
  self.passwordTextField.secureTextEntry = YES;
  self.passwordTextField.keyboardType = UIKeyboardTypeDefault;

}

- (void)doBack:(id)sender
{
  [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
  [self.usernameTextField resignFirstResponder];
  [self.passwordTextField resignFirstResponder];
}

- (IBAction)registerBtnClick:(id)sender {
  DDLogDebug(@"Action - registerBtnClick");
  if ([self.usernameTextField.text isEqualToString:@""]) {
    [MBProgressHUD showMessage:@"用户名不能为空" view:self.view];
    return;
  }

  if ([self.passwordTextField.text isEqualToString:@""]) {
    [MBProgressHUD showMessage:@"密码不能为空" view:self.view];
    return;
  }

  [self.usernameTextField resignFirstResponder];
  [self.passwordTextField resignFirstResponder];

  NSString *username = self.usernameTextField.text.stringByTrimingWhitespace;
  NSString *password = self.passwordTextField.text.stringByTrimingWhitespace;

  if ([self checkValidUsername:username AndPassword:password]) {
    [MBProgressHUD showMessage:@"正在注册" view:self.view];
    [[JCHATTimeOutManager ins] startTimerWithVC:self];
    [JMSGUser registerWithUsername:username
                          password:password
                 completionHandler:^(id resultObject, NSError *error) {
                   [[JCHATTimeOutManager ins] stopTimer];
                   if (error == nil) {
                     [MBProgressHUD hideHUDForView:self.view animated:YES];
                     [MBProgressHUD showMessage:@"注册成功" view:self.view];
                     [[JCHATTimeOutManager ins] startTimerWithVC:self];
                     [JMSGUser loginWithUsername:username
                                        password:password
                               completionHandler:^(id resultObject, NSError *error) {
                                 [[JCHATTimeOutManager ins] stopTimer];
                                 if (error == nil) {
                                   [[NSUserDefaults standardUserDefaults] setObject:username forKey:kuserName];
                                   [[NSUserDefaults standardUserDefaults] setObject:username forKey:klastLoginUserName];

                                   [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
                                   JCHATSetDetailViewController *detailVC = [[JCHATSetDetailViewController alloc] init];
                                   [self.navigationController pushViewController:detailVC animated:YES];
                                   [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
                                 } else {
                                   DDLogDebug(@"login fail error  %@",error);
                                   NSString *alert = [JCHATStringUtils errorAlert:error];
                                   alert = [JCHATStringUtils errorAlert:error];
                                   [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
                                   [MBProgressHUD showMessage:alert view:self.view];
                                   DDLogError(alert);
                                 }
                               }];
                   } else {
                     NSString *alert = @"注册失败";
                     alert = [JCHATStringUtils errorAlert:error];
                     [MBProgressHUD hideHUDForView:self.view animated:YES];
                     [MBProgressHUD showMessage:alert view:self.view];
                   }
                 }];
  }
}

- (void)userLoginSave {
  NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  [userDefaults setObject:self.usernameTextField.text forKey:kuserName];
  [userDefaults setObject:self.passwordTextField.text forKey:kPassword];
  [userDefaults synchronize];
}

// TODO javen 还没有加基本的有效性校验
- (BOOL)checkValidUsername:username AndPassword:password {
  if (![password isEqualToString:@""] && ![username isEqualToString:@""]) {
    return YES;
  }

  NSString *alert = @"用户名或者密码不合法.";
  if ([password isEqualToString:@""]) {
    alert = @"密码不能为空";
  } else if ([username isEqualToString:@""]) {
    alert =  @"用户名不能为空";
  }

  [MBProgressHUD hideHUDForView:self.view animated:YES];
  [MBProgressHUD showMessage:alert view:self.view];

  DDLogError(alert);

  return NO;
}

- (void)viewWillAppear:(BOOL)animated {
  [super viewWillAppear:YES];
}

@end


text:
import json
import subprocess as sp
import re

class Config(object):
    def __init__(self, root_dir):
        self.root_dir = root_dir

        json_file = open(root_dir + "/install/config.json")
        self.config = json.load(json_file)
        json_file.close()

    def get(self, key):
        """ Return a configuration item from the json
        """
        if key in self.config:
            return self.config[key]
        else:
            return None
    def findVenv(self):
        paths = sp.Popen("whereis virtualenv", shell=True, stdout=sp.PIPE)
        found = paths.stdout.read()
        found = re.search(r"(?P<venvpath>/.*?/virtualenv)[\n\s$]", found)
        if found:
            return found.group('venvpath')
        else:
            return None


text:
require 'spec_helper'

module Aws
  module S3
    describe Bucket do
      describe 'waiters' do

        let(:client) { S3::Client.new(stub_responses:true) }

        let(:bucket) { Bucket.new('bucket-name', client: client) }

        it 'yields the waiter to the given block' do
          client.handle(step: :send) do |context|
            context.http_response.signal_headers(200, {})
            context.http_response.signal_done
            Seahorse::Client::Response.new(context:context)
          end

          yielded = nil
          bucket.wait_until_exists { |w| yielded = w }
          expect(yielded).to be_kind_of(Aws::Waiters::Waiter)
        end

      end
    end
  end
end


text:
#import "IRCCertificateTrust.h"
#import "ConversationItemView.h"
#import "CertificateItemRow.h"
#import "AppPreferences.h"

@implementation IRCCertificateTrust

- (instancetype)init:(SecTrustRef)trust onClient:(IRCClient *)client {
    if ((self = [super init])) {
        self.trustReference = trust;
        self.subjectInformation = nil;
        self.trustStatus = AWAITING_RESPONSE;
        self.issuerInformation = nil;
        self.certificateInformation = nil;
        self.client = client;
        return self;
    }
    return nil;
}

- (void)displayCertificateInformation
{
	CFIndex count = SecTrustGetCertificateCount(self.trustReference);
	if (count > 0) {
		[self setFieldInformation];

		/* Make a request to the UI for a certificate information dialog and wait for the response */
		ConversationListViewController *controller = ((AppDelegate *)[UIApplication sharedApplication].delegate).conversationsController;
		[controller displayInformationForCertificate:self];
	}
}

- (void)setFieldInformation
{
	/* iOS does not have any useful APIs for getting information from certificates so we will convert
	 this into an OpenSSL X509 certificate object and parse it using the OpenSSL C library. */
	SecCertificateRef certificate = SecTrustGetCertificateAtIndex(self.trustReference, 0);
	NSData *certificateData = (__bridge_transfer NSData *)SecCertificateCopyData(certificate);
	const unsigned char *certificateDataBytes = (const unsigned char *)[certificateData bytes];
	X509 *certificateX509 = d2i_X509(NULL, &certificateDataBytes, [certificateData length]);

	/* Create dictionaries with all the fields required for the details dialog. */
	self.subjectInformation      = [IRCCertificateTrust getCertificateSubject:certificateX509];
	self.issuerInformation       = [IRCCertificateTrust getCertificateIssuer:certificateX509];
	self.certificateInformation  = [IRCCertificateTrust getCertificateAlgorithmInformation:certificateX509];
    OPENSSL_free(certificateX509);
}

- (void)requestTrustFromUser:(void (^)(BOOL shouldTrustPeer))completionHandler
{
    CFIndex count = SecTrustGetCertificateCount(self.trustReference);
    if (count > 0) {
		[self setFieldInformation];

        /* The user may already have chosen to trust this certificate, in which case there is no point going further,
         we will approve the connection */
        CertificateItemRow *certificateSignature = [self.certificateInformation objectAtIndex:6];
        for (NSString *signature in [[self.client configuration] trustedSSLSignatures]) {
            if ([signature isEqualToString:[certificateSignature itemDescription]]) {
                completionHandler(YES);
                return;
            }
        }
        self.signature = certificateSignature.itemDescription;

        /* Make a request to the UI for a certificate trust dialog and wait for the response */
        ConversationListViewController *controller = ((AppDelegate *)[UIApplication sharedApplication].delegate).conversationsController;
        [controller requestUserTrustForCertificate:self];

        /* The certificate trust operation is unfortunately not asynchronous so we will have to continually run in a loop
         on another thread and check for a response from the user every 100ms */
        [self checkTrustActionCompleted:completionHandler];
    }
}

- (void)checkTrustActionCompleted:(void (^)(BOOL shouldTrustPeer))completionHandler
{
    switch (self.trustStatus) {
        case CERTIFICATE_ACCEPTED: {
            /* The user approved the connection, we will save the certificate and approve the connection */
            [self addSignature:self.signature];
            completionHandler(YES);
            break;
        }

        case CERTIFICATE_DENIED: {
            /* The user did not approve the connection, there is nothing we can do anymore so we will disconnect */
            completionHandler(NO);
            [self.client disconnect];
            break;
        }

        case AWAITING_RESPONSE: {
            /* The user has not yet approved the certificate, we will wait another 100ms and try again */
            SEL selector = @selector(checkTrustActionCompleted:);
            NSMethodSignature *signature = [self methodSignatureForSelector:selector];
            NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
            [invocation setTarget:self];
            [invocation setSelector:selector];
            [invocation setArgument:&completionHandler atIndex:2];
            [NSTimer scheduledTimerWithTimeInterval:0.1 invocation:invocation repeats:NO];
            break;
        }
    }
}

- (void)addSignature:(NSString *)signature
{
    /* Add a signature to the configuration file for this connection */
    NSMutableArray *signatures = [[[self.client configuration] trustedSSLSignatures] mutableCopy];
    [signatures addObject:signature];
    self.client.configuration.trustedSSLSignatures = signatures;
}

- (void)receivedTrustFromUser:(BOOL)trust
{
    if (trust == YES) {
        self.trustStatus = CERTIFICATE_ACCEPTED;
    } else {
        self.trustStatus = CERTIFICATE_DENIED;
    }
}

+ (NSArray *) getCertificateSubject:(X509 *)certificateX509
{
    NSMutableArray *subject = [[NSMutableArray alloc] init];
    if (certificateX509 != NULL) {
        X509_NAME *subjectX509Name = X509_get_subject_name(certificateX509);

        /* Retrieve the necessary information fields for the subject of this SSL certificate. */
        if (subjectX509Name != NULL) {
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Country", @"Country") andDescription:getKeyString(NID_countryName, subjectX509Name)]];
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Province/State", @"Province/State") andDescription:getKeyString(NID_stateOrProvinceName, subjectX509Name)]];
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Locality", @"Locality") andDescription:getKeyString(NID_localityName, subjectX509Name)]];
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Organisation", @"Organisation") andDescription:getKeyString(NID_organizationName, subjectX509Name)]];
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Organisational Unit", @"Organisational Unit") andDescription:getKeyString(NID_organizationalUnitName, subjectX509Name)]];
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Common Name", @"Common Name") andDescription:getKeyString(NID_commonName, subjectX509Name)]];
            [subject addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Email Address", @"Email Address") andDescription:getKeyString(NID_pkcs9_emailAddress, subjectX509Name)]];
        }
    }
    return subject;
}

+ (NSArray *) getCertificateIssuer:(X509 *)certificateX509
{
    NSMutableArray *issuer = [[NSMutableArray alloc] init];
    if (certificateX509 != NULL) {
        X509_NAME *issuerX509Name = X509_get_issuer_name(certificateX509);

        /* Retrieve the necessary information for the issuer of this SSL certificate. */
        if (issuerX509Name != NULL) {
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Country", @"Country") andDescription:getKeyString(NID_countryName, issuerX509Name)]];
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Province/State", @"Province/State") andDescription:getKeyString(NID_stateOrProvinceName, issuerX509Name)]];
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Locality", @"Locality") andDescription:getKeyString(NID_localityName, issuerX509Name)]];
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Organisation", @"Organisation") andDescription:getKeyString(NID_organizationName, issuerX509Name)]];
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Organisational Unit", @"Organisational Unit") andDescription:getKeyString(NID_organizationalUnitName, issuerX509Name)]];
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Common Name", @"Common Name") andDescription:getKeyString(NID_commonName, issuerX509Name)]];
            [issuer addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Email Address", @"Email Address") andDescription:getKeyString(NID_pkcs9_emailAddress, issuerX509Name)]];
        }
    }
    return issuer;
}

+ (NSArray *) getCertificateAlgorithmInformation:(X509 *)certificateX509
{
    /* Retrieve the necessary information about the actual SSL certificate. */
    NSMutableArray *algorithm = [[NSMutableArray alloc] init];
    if (certificateX509 != NULL) {
        char alg[128];

        /* Get the algorithm used for this SSL certificate, for example SHA-1 with RSA Encryption */
        OBJ_obj2txt(alg, sizeof(alg), certificateX509->sig_alg->algorithm, 0);
        NSString *signatureAlgorithm;
        if (alg) {
            signatureAlgorithm = [NSString stringWithUTF8String:alg];
        } else {
            signatureAlgorithm = @"";
        }
        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Algorithm", @"Algorithm") andDescription:signatureAlgorithm]];

        /* Get the version of OpenSSL used to create this certificate */
        NSString *version = [NSString stringWithFormat:@"%ld", X509_get_version(certificateX509)];
        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Version", @"Version") andDescription:version]];

        /* Get the serial number the certificate authority assigned to this certficiate */
        long serial = ASN1_INTEGER_get(X509_get_serialNumber(certificateX509));
        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Serial", @"Serial") andDescription:[NSString stringWithFormat:@"%ld", serial]]];

        /* Create a date formatter to be used to convert NSDate objects to the format commonly used to display
         date times in SSL certificate dialogs */
        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
        [formatter setDateFormat:@"dd/MM/yyyy HH:mm:ss"];

        /* Get the date and time this certficiate was created */
        NSDate *certStartTime = CertificateGetStartDate(certificateX509);
        NSString *startTimeString = [formatter stringFromDate:certStartTime];
        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Not Valid Before", @"Not Valid Before") andDescription:startTimeString]];

        /* Get the date and time this certificate will expire */
        NSDate *certExpireTime = CertificateGetExpiryDate(certificateX509);
        NSString *expireTimeString = [formatter stringFromDate:certExpireTime];
        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Not Valid After", @"Not Valid After") andDescription:expireTimeString]];

        /* Get the public key and display it as a string of hexadecimal pairs */
        ASN1_BIT_STRING *pubKey = X509_get0_pubkey_bitstr(certificateX509);
        NSString *publicKey = @"";
        for (int i = 0; i < pubKey->length; i++) {
            publicKey = [publicKey stringByAppendingString:[NSString stringWithFormat:@"%02X ", pubKey->data[i]]];
        }

        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Public Key", @"Public Key") andDescription:publicKey]];

        /* Get the signature of the certficiate and display it as a string of hexadecimal pairs */
        ASN1_BIT_STRING *signature = certificateX509->signature;
        NSString *signatureKey = @"";
        for (int i = 0; i < signature->length; i++) {
            signatureKey = [signatureKey stringByAppendingString:[NSString stringWithFormat:@"%02X ", signature->data[i]]];
        }

        [algorithm addObject:[[CertificateItemRow alloc] initWithName:NSLocalizedString(@"Signature", @"Signature") andDescription:signatureKey]];
    }
    return algorithm;
}

static NSString *getKeyString(int nid, X509_NAME *issuer)
{
    /* Short hand function used to convert an X509 name entry into an NSString, by key. */
    int index = X509_NAME_get_index_by_NID(issuer, nid, -1);
    X509_NAME_ENTRY *issuerNameEntry = X509_NAME_get_entry(issuer, index);
    if (issuerNameEntry) {
        ASN1_STRING *issuerNameASN1 = X509_NAME_ENTRY_get_data(issuerNameEntry);
        if (issuerNameASN1 != NULL) {
            unsigned char *issuerName = ASN1_STRING_data(issuerNameASN1);
            return [NSString stringWithUTF8String:(char *)issuerName];
        }
    }
    return @"";
}

static NSDate *CertificateGetStartDate(X509 *certificateX509)
{
    /* Method used to retrieve the date and time the certificate was created */
    NSDate *startDate = nil;
    if (certificateX509 != NULL) {
        ASN1_TIME *certificateStartASN1 = X509_get_notBefore(certificateX509);
        if (certificateStartASN1 != NULL) {

            /* Retrieve the actual value from the certificate */
            ASN1_GENERALIZEDTIME *certificateStartASN1Generalized = ASN1_TIME_to_generalizedtime(certificateStartASN1, NULL);
            if (certificateStartASN1Generalized != NULL) {

                /* Convert it into a string that we can parse */
                unsigned char *certificateStartData = ASN1_STRING_data(certificateStartASN1Generalized);
                NSString *startTimeStr = [NSString stringWithUTF8String:(char *)certificateStartData];

                /* Turn it into an NSDate object that we can use to display the date to our needs. */
                NSDateComponents *startDateComponents = [[NSDateComponents alloc] init];
                startDateComponents.year   = [[startTimeStr substringWithRange:NSMakeRange(0, 4)] intValue];
                startDateComponents.month  = [[startTimeStr substringWithRange:NSMakeRange(4, 2)] intValue];
                startDateComponents.day    = [[startTimeStr substringWithRange:NSMakeRange(6, 2)] intValue];
                startDateComponents.hour   = [[startTimeStr substringWithRange:NSMakeRange(8, 2)] intValue];
                startDateComponents.minute = [[startTimeStr substringWithRange:NSMakeRange(10, 2)] intValue];
                startDateComponents.second = [[startTimeStr substringWithRange:NSMakeRange(12, 2)] intValue];

                NSCalendar *calendar = [NSCalendar currentCalendar];
                startDate = [calendar dateFromComponents:startDateComponents];
            }
        }
    }
    return startDate;
}

static NSDate *CertificateGetExpiryDate(X509 *certificateX509)
{
    NSDate *expiryDate = nil;

    if (certificateX509 != NULL) {
        ASN1_TIME *certificateExpiryASN1 = X509_get_notAfter(certificateX509);
        if (certificateExpiryASN1 != NULL) {

            /* Retrieve the actual value from the certificate */
            ASN1_GENERALIZEDTIME *certificateExpiryASN1Generalized = ASN1_TIME_to_generalizedtime(certificateExpiryASN1, NULL);
            if (certificateExpiryASN1Generalized != NULL) {

                 /* Convert it into a string that we can parse*/
                unsigned char *certificateExpiryData = ASN1_STRING_data(certificateExpiryASN1Generalized);
                NSString *expiryTimeStr = [NSString stringWithUTF8String:(char *)certificateExpiryData];

                /* Turn it into an NSDate object that we can use to display the date to our needs. */
                NSDateComponents *expiryDateComponents = [[NSDateComponents alloc] init];
                expiryDateComponents.year   = [[expiryTimeStr substringWithRange:NSMakeRange(0, 4)] intValue];
                expiryDateComponents.month  = [[expiryTimeStr substringWithRange:NSMakeRange(4, 2)] intValue];
                expiryDateComponents.day    = [[expiryTimeStr substringWithRange:NSMakeRange(6, 2)] intValue];
                expiryDateComponents.hour   = [[expiryTimeStr substringWithRange:NSMakeRange(8, 2)] intValue];
                expiryDateComponents.minute = [[expiryTimeStr substringWithRange:NSMakeRange(10, 2)] intValue];
                expiryDateComponents.second = [[expiryTimeStr substringWithRange:NSMakeRange(12, 2)] intValue];

                NSCalendar *calendar = [NSCalendar currentCalendar];
                expiryDate = [calendar dateFromComponents:expiryDateComponents];
            }
        }
    }
    return expiryDate;
}

@end


text:
package com.onsemi.matrix.api;

public interface SettingsProvider {
	public String getDefaultIP();
	public String getTestIP();
	public int getAfterTestDelay();
	public int getDefaultTimeout();
	public String getPushServiceUrl();
    public String getPushMessage();
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using Microsoft.CodeAnalysis.Diagnostics;

namespace Microsoft.CodeAnalysis.Shared.Extensions
{
    internal static class DiagnosticDescriptorExtensions
    {
        private const string DotnetAnalyzerDiagnosticPrefix = "dotnet_analyzer_diagnostic";
        private const string DotnetDiagnosticPrefix = "dotnet_diagnostic";
        private const string CategoryPrefix = "category";
        private const string SeveritySuffix = "severity";

        private const string DotnetAnalyzerDiagnosticSeverityKey = DotnetAnalyzerDiagnosticPrefix + "." + SeveritySuffix;

        public static ImmutableArray<string> ImmutableCustomTags(this DiagnosticDescriptor descriptor)
        {
            Debug.Assert(descriptor.CustomTags is ImmutableArray<string>);
            return (ImmutableArray<string>)descriptor.CustomTags;
        }

        /// <summary>
        /// Gets project-level effective severity of the given <paramref name="descriptor"/> accounting for severity configurations from both the following sources:
        /// 1. Compilation options from ruleset file, if any, and command line options such as /nowarn, /warnaserror, etc.
        /// 2. Analyzer config documents at the project root directory or in ancestor directories.
        /// </summary>
        public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, AnalyzerConfigOptionsResult? analyzerConfigOptions)
        {
            var effectiveSeverity = descriptor.GetEffectiveSeverity(compilationOptions);

            // Apply analyzer config options, unless configured with a non-default value in compilation options.
            // Note that compilation options (/nowarn, /warnaserror) override analyzer config options.
            if (analyzerConfigOptions.HasValue &&
                (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
                 reportDiagnostic == ReportDiagnostic.Default))
            {
                if (analyzerConfigOptions.Value.TreeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default ||
                    TryGetSeverityFromBulkConfiguration(descriptor, analyzerConfigOptions.Value, out reportDiagnostic))
                {
                    Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
                    effectiveSeverity = reportDiagnostic;
                }
            }

            return effectiveSeverity;
        }

        public static bool IsDefinedInEditorConfig(this DiagnosticDescriptor descriptor, AnalyzerConfigOptions analyzerConfigOptions)
        {
            // Check if the option is defined explicitly in the editorconfig
            var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}";
            if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) &&
                EditorConfigSeverityStrings.TryParse(value, out var severity))
            {
                return true;
            }

            // Check if the option is defined as part of a bulk configuration
            // Analyzer bulk configuration does not apply to:
            //  1. Disabled by default diagnostics
            //  2. Compiler diagnostics
            //  3. Non-configurable diagnostics
            if (!descriptor.IsEnabledByDefault ||
                descriptor.ImmutableCustomTags().Any(tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
            {
                return false;
            }

            // If user has explicitly configured default severity for the diagnostic category, that should be respected.
            // For example, 'dotnet_analyzer_diagnostic.category-security.severity = error'
            var categoryBasedKey = $"{DotnetAnalyzerDiagnosticPrefix}.{CategoryPrefix}-{descriptor.Category}.{SeveritySuffix}";
            if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) &&
                EditorConfigSeverityStrings.TryParse(value, out severity))
            {
                return true;
            }

            // Otherwise, if user has explicitly configured default severity for all analyzer diagnostics, that should be respected.
            // For example, 'dotnet_analyzer_diagnostic.severity = error'
            if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
                EditorConfigSeverityStrings.TryParse(value, out severity))
            {
                return true;
            }

            // option not defined in editorconfig, assumed to be the default
            return false;
        }

        public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, AnalyzerConfigOptions analyzerConfigOptions)
        {
            // Check if the option is defined explicitly in the editorconfig
            var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}";
            if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) &&
                EditorConfigSeverityStrings.TryParse(value, out var severity))
            {
                return severity;
            }

            // Check if the option is defined as part of a bulk configuration
            // Analyzer bulk configuration does not apply to:
            //  1. Disabled by default diagnostics
            //  2. Compiler diagnostics
            //  3. Non-configurable diagnostics
            if (!descriptor.IsEnabledByDefault ||
                descriptor.ImmutableCustomTags().Any(tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
            {
                return ReportDiagnostic.Default;
            }

            // If user has explicitly configured default severity for the diagnostic category, that should be respected.
            // For example, 'dotnet_analyzer_diagnostic.category-security.severity = error'
            var categoryBasedKey = $"{DotnetAnalyzerDiagnosticPrefix}.{CategoryPrefix}-{descriptor.Category}.{SeveritySuffix}";
            if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) &&
                EditorConfigSeverityStrings.TryParse(value, out severity))
            {
                return severity;
            }

            // Otherwise, if user has explicitly configured default severity for all analyzer diagnostics, that should be respected.
            // For example, 'dotnet_analyzer_diagnostic.severity = error'
            if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
                EditorConfigSeverityStrings.TryParse(value, out severity))
            {
                return severity;
            }

            // option not defined in editorconfig, assumed to be the default
            return ReportDiagnostic.Default;
        }

        /// <summary>
        /// Tries to get configured severity for the given <paramref name="descriptor"/>
        /// from bulk configuration analyzer config options, i.e.
        ///     'dotnet_analyzer_diagnostic.category-%RuleCategory%.severity = %severity%'
        ///         or
        ///     'dotnet_analyzer_diagnostic.severity = %severity%'
        /// Docs: https://docs.microsoft.com/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#set-rule-severity-of-multiple-analyzer-rules-at-once-in-an-editorconfig-file for details
        /// </summary>
        private static bool TryGetSeverityFromBulkConfiguration(
            DiagnosticDescriptor descriptor,
            AnalyzerConfigOptionsResult analyzerConfigOptions,
            out ReportDiagnostic severity)
        {
            Debug.Assert(!analyzerConfigOptions.TreeOptions.ContainsKey(descriptor.Id));

            // Analyzer bulk configuration does not apply to:
            //  1. Disabled by default diagnostics
            //  2. Compiler diagnostics
            //  3. Non-configurable diagnostics
            if (!descriptor.IsEnabledByDefault ||
                descriptor.ImmutableCustomTags().Any(tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
            {
                severity = default;
                return false;
            }

            // If user has explicitly configured default severity for the diagnostic category, that should be respected.
            // For example, 'dotnet_analyzer_diagnostic.category-security.severity = error'
            var categoryBasedKey = $"{DotnetAnalyzerDiagnosticPrefix}.{CategoryPrefix}-{descriptor.Category}.{SeveritySuffix}";
            if (analyzerConfigOptions.AnalyzerOptions.TryGetValue(categoryBasedKey, out var value) &&
                EditorConfigSeverityStrings.TryParse(value, out severity))
            {
                return true;
            }

            // Otherwise, if user has explicitly configured default severity for all analyzer diagnostics, that should be respected.
            // For example, 'dotnet_analyzer_diagnostic.severity = error'
            if (analyzerConfigOptions.AnalyzerOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
                EditorConfigSeverityStrings.TryParse(value, out severity))
            {
                return true;
            }

            severity = default;
            return false;
        }

        public static bool IsCompilationEnd(this DiagnosticDescriptor descriptor)
            => descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.CompilationEnd);

        // TODO: the value stored in descriptor should already be valid URI (https://github.com/dotnet/roslyn/issues/59205)
        internal static Uri? GetValidHelpLinkUri(this DiagnosticDescriptor descriptor)
           => Uri.TryCreate(descriptor.HelpLinkUri, UriKind.Absolute, out var uri) &&
              (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) ? uri : null;
    }
}