text:
function(args) {
/*
is_app(true)
component_type("VB")
display_name("Data control")
description("This will return the data control")
base_component_id("mixer_control")
load_once_from_file(true)
visibility("PRIVATE")
read_only(true)
properties(
    [
        {
            id:     "text",
            name:   "Text",
            type:   "String"
        }
        ,
        {
            id:         "connect_status",
            name:       "Connect Status",
            type:       "String",
            default:    "not_connected"
        }
        ,
        {
            id:         "connect_error",
            name:       "Connect Error",
            type:       "String",
            default:    ""
        }
        ,
        {
            id:     "sourceControlName",
            name:   "sourceControlName",
            type:   "String"
        }
        ,
        {
            id:     "sourceComponentType",
            name:   "sourceComponentType",
            type:   "String",
            default: ""
        }
        ,

        {
            id:         "width",
            name:       "Width",
            default:    150,
            type:       "Number"
        }
        ,
        {
            id:     "limit",
            name:   "Limit",
            type:   "Number",
            default_expression: "(typeof $RETURNED_ROWS_LIMIT !== 'undefined')?eval('$RETURNED_ROWS_LIMIT'):100",
        }
        ,
        {
            id:         "height",
            name:       "Height",
            default:    100,
            type:       "Number"
        }
        ,
        {
            id:     "background_color",
            name:   "Background color",
            type:   "String"
        }
        ,

        {
            id:         "has_details_ui",
            name:       "Has details UI?",
            type:       "Boolean",
            default:    true,
            hidden:     true
        }
        ,
        {
            id:     "changed_event",
            name:   "Changed event",
            type:   "Event"
        }
        ,
        {
            id:         "is_container",
            name:       "Is Container?",
            type:       "Boolean",
            default:    true,
            hidden:     true
        }
        ,
        {
            id:         "hide_children",
            name:       "Hide Children?",
            type:       "Boolean",
            default:    true,
            hidden:     true
        }
        ,
        {
            id:         "design_mode_table",
            name:       "Design Table",
            type:       "String",
            default:    "",
            hidden:     true
        }
        ,
        {
            id:         "setData",
            snippet:    `setData([{a: 1, b: "c"},{a: 2, b: "d"}])`,
            name:       "setData",
            type:       "Action"
        }
        ,
        {
            id:         "resetColumns",
            snippet:    `resetColumns()`,
            name:       "resetColumns",
            type:       "Action"
        }
        ,
        {
            id:     "addColumn",
            name:   "addColumn",
            type:   "Action"
        }
        ,
        {
            id:     "source_type",
            name:   "Data Source Type",
            type:   "String"
        }
        ,
        {
            id:     "sql",
            name:   "SQL",
            type:   "String",
            default: "SELECT * FROM pg_catalog.pg_tables;"
        }
        ,

        {
            id:     "tables",
            name:   "Tables",
            type:   "Array",
            hidden: true,
            default:    []
        }
        ,

        {
            id:      "user",
            name:    "USER",
            type:    "String",
            default_expression: "(typeof $POSTGRES_USER !== 'undefined')?eval('$POSTGRES_USER'):'postgres'"
        }
        ,
        {
            id:     "password",
            name:   "Password",
            type:   "String",
            password: true,
            default_expression: "(typeof $POSTGRES_PASSWORD !== 'undefined')?eval('$POSTGRES_PASSWORD'):'password'",
        }
        ,
        {
            id:     "database",
            name:   "Database",
            type:   "String",
            default_expression: "(typeof $POSTGRES_DATABASE !== 'undefined')?eval('$POSTGRES_DATABASE'):'postgres'",
        }
        ,
        {
            id:     "port",
            name:   "Port",
            type:   "Number",
            default_expression: "(typeof $POSTGRES_PORT !== 'undefined')?eval('$POSTGRES_PORT'):5432",
        }
        ,
        {
            id:     "host",
            name:   "Host",
            type:   "String",
            default_expression: "(typeof $POSTGRES_HOST !== 'undefined')?$POSTGRES_HOST:'localhost'",
        }
        ,
        {
            id:     "dataWindowColumns",
            name:   "dataWindowColumns",
            type:   "Array",
            hidden: true,
            default:    []
        }
        ,

        {
            id:      "data",
            name:    "data",
            type:    "Array",
            hidden:  true,
            default:  [],
            types: {table_data: true}
        }
        ,

        {
            id:     "dataWindowColumnsMax",
            name:   "dataWindowColumnsMax",
            type:   "Number",
            hidden: true,
            default:    0
        }
        ,
        {
            id:     "selected_data_window_column_index",
            name:   "selected_data_window_column_index",
            type:   "Number",
            hidden: true,
            default:    -1
        }
        ,
        {
            id:     "selected_data_window_column",
            name:   "selected_data_window_column",
            type:   "String",
            hidden: true,
            default:    ""
        }
        ,
        {
            id:     "layout",
            name:   "Layout",
            type:   "",
            hidden: false,
            type:       "Select",
            default:    "fitColumns",
            values:     [
                            {display: "Fit Columns",   value: "fitColumns"},
                            {display: "Fit Data",  value: "fitData"},
                            {display: "Fit Data Fill",  value: "fitDataFill"}

                        ]
        }

        ,
        {
            id:     "allow_col_resize",
            name:   "allow_col_resize",
            type:   "Boolean",
            hidden: true,
            default:    false
        }
        ,
        {
            id:     "allow_col_move",
            name:   "allow_col_move",
            type:   "Boolean",
            hidden: true,
            default:    false
        }
        ,
        {
            id:     "allow_row_resize",
            name:   "allow_row_resize",
            type:   "Boolean",
            hidden: true,
            default:    false
        }

        ,
        {
            id:     "columns",
            name:   "columns",
            type:   "Array",
            hidden: true,
            default:    []
        }

        ,
        {
            id:     "where_clause",
            name:   "where_clause",
            type:   "String",
            hidden: true,
            default:    ""
        }

        ,
        {
            id:     "selected_column",
            name:   "selected_column",
            type:   "String",
            hidden: true,
            default:    ""
        }

        ,

        {
            id:     "result",
            name:   "result",
            type:   "Array",
            default:    []
        }
        ,
        {
            id:         "executeSql",
            pre_snippet: `await `,
            async: true,
            snippet:    `executeSql()`,
            name:       "executeSql",
            type:       "Action",
            help:       `
Help text for
                            executeSql function

The SQL is store in the "sql" property

`
        }
        ,

        {
            id:         "test",
            pre_snippet: ` `,
            snippet:    `test()`,
            name:       "test",
            type:       "Action"
        }
        ,

        {
            id:         "on_property_in",
            name:       "on_property_in",
            type:       "event",
            default:    "alert(JSON.stringify(to_value),null,2)"
        }
        ,

        {
            id:         "data1",
            name:       "Data 1",
            type:       "Array",
            default:    [],
            editor:     "detail_editor",
            accept_types: {table_data: true}
        }

        ,

        {
            id:         "data2",
            name:       "Data 2",
            type:       "Array",
            default:    [],
            editor:     "detail_editor",
            accept_types: {table_data: true}
        }

        ]
)//properties
logo_url("/driver_icons/mixer.png")
*/

    Vue.component("mixer_control",{
      props: ["meta","name","properties","args","refresh","design_mode", "children", "properties"]
      ,
      template:
`

                        Data source connection

                    Schema and tables

                    Columns

                    Where

                    Options

                Connection

                    Connected

                    Not Connected: {{properties.connect_error}}

                <select  @change='chooseSource($event)'
                          style="margin-top: 5px;"
                          v-if="  properties.sourceComponentType == ''  ">

                      <option   value=""
                              selected='true'>
                      </option>
                      <option   v-for='propVal in data_sources'
                                v-bind:value="propVal.base_component_id"
                                v-bind:selected2='(propVal.base_component_id == "postgres")'>

                            {{propVal.display_name}}

                      </option>
                </select>

                    <button     class="btn btn-primary"
                                style="margin-top: 5px;"
                                v-on:click="connect">
                          Connect
                    </button>
                    <button     class="btn btn-danger"
                                style="margin-top: 5px;"
                                v-on:click="disconnect">
                          Remove
                    </button>

                    <slot v-bind:refresh='refresh'>
                    </slot>

                    <button    class="btn btn-primary"
                            v-on:click="connect">
                          Connect
                    </button>
                    <button    class="btn btn-danger"
                               v-on:click="disconnect">
                          Remove
                    </button>

               Database tables for schema "{{args.sourceComponentType}}"

                         {{table}}

                Columns for table "{{args.design_mode_table}}"

                              {{column}}

                        <button    class="btn btn-primary"
                                :disabled="(args.selected_column && args.selected_column.length > 0)?false:true"
                                v-on:click="var newId = args.dataWindowColumnsMax++;args.dataWindowColumns.push({id:    newId, value: args.selected_column, name: args.selected_column});setSql();args.selected_data_window_column_index = newId;args.selected_data_window_column = args.dataWindowColumns[args.dataWindowColumns.length - 1];">

                              Add >>

                        </button>
                        <button    class="btn btn-primary"
                                style="margin-top:20px;"
                                :disabled="(args.selected_data_window_column_index > -1)?false:true"
                                v-on:click="args.dataWindowColumns.splice(args.selected_data_window_column_index,1);setSql(); args.selected_data_window_column_index = -1;args.selected_data_window_column='';">

                              << Remove

                        </button>

                                  {{dwcolumn.value}}

                            <button     class="btn btn-primary"
                                        :disabled="(args.selected_data_window_column_index > 0)?false:true"
                                        style="margin-top:20px; margin-left: 0px;"
                                        v-on:click="array_move(args.dataWindowColumns,args.selected_data_window_column_index,args.selected_data_window_column_index-1);args.selected_data_window_column_index --;">

                                  Move Up

                            </button>

                            <button class="btn btn-primary"
                                    :disabled="((args.selected_data_window_column_index > -1) && (args.selected_data_window_column_index < (args.dataWindowColumns.length - 1)))?false:true"
                                    style="margin-top:20px; margin-left: 20px;"
                                    v-on:click="array_move(args.dataWindowColumns,args.selected_data_window_column_index,args.selected_data_window_column_index + 1);args.selected_data_window_column_index ++;">

                                  Move Down

                            </button>

                                  Title
                                  <input  type=text
                                          class="form-control"
                                          style="margin-bottom: 30px;"
                                          id=col_input_name
                                          name="col_input_name"
                                          required
                                          v-bind:value='args.selected_data_window_column.name'
                                          v-on:change="var qwe = document.getElementById('col_input_name').value;args.dataWindowColumns[args.selected_data_window_column_index].name=qwe;args.selected_data_window_column.name = qwe;"
                                          >
                                  </input>

                                  DB Col ID
                                  <input  type=text
                                          class="form-control"
                                          id=col_input_value
                                          style="margin-bottom: 30px;"
                                          name="col_input_value"
                                          required
                                          v-bind:value='args.selected_data_window_column.value'

                                          v-on:change="var qwe = document.getElementById('col_input_value').value;args.dataWindowColumns[args.selected_data_window_column_index].value=qwe;args.selected_data_window_column.value = qwe;"
                                          >
                                  </input>

Valid.

Please fill out this field.

                                    Col Width px
                                    <input  type=text
                                            style="margin-bottom: 30px;"
                                            class="form-control"
                                            id=col_input_width
                                            name="col_input_width"
                                            v-bind:value='args.selected_data_window_column.width?args.selected_data_window_column.width:""'

                                            v-on:change="var qwe = document.getElementById('col_input_width').value;args.selected_data_window_column.width = qwe;args.dataWindowColumns[args.selected_data_window_column_index].width=qwe;"
                                            >
                                    </input>

                Where Clause
                <input  type=text
                        style="margin-bottom: 30px;"
                        class="form-control"
                        id=where_clause
                        name="where_clause"
                        v-bind:value='(args.where_clause && (args.where_clause.length > 0))?args.where_clause:""'

                        v-on:change="args.where_clause = document.getElementById('where_clause').value;setSql()"
                        >
                </input>

                Options tab

                <form>

                        <input  type="checkbox" class="form-check-input" id="allow_col_resize"
                                :checked='args.allow_col_resize' v-model='args.allow_col_resize'>
                        Allow col resize

                        <input  type="checkbox" class="form-check-input" id="allow_col_move"
                                :checked='args.allow_col_move' v-model='args.allow_col_move'>
                        Allow col move

                        <input  type="checkbox" class="form-check-input" id="allow_row_resize"
                                :checked='args.allow_row_resize' v-model='args.allow_row_resize'>
                        Allow row resize

                </form>

                 <slot v-bind:refresh='refresh'>
                 </slot>

                     SQL:
                        {{args.sql}}

`
      ,

      data: function() {
       return {
         selected_index:      null
         ,
         columnDefinitions:  [ ]
         ,
         data_sources: []

         ,
         designDetailTab:     "connection"
       }
     }
     ,

     watch: {
       // This would be called anytime the value of the input changes
       refresh: function(newValue, oldValue) {
           //console.log("refresh: " + this.args.text)
           if (isValidObject(this.args)) {
               //this.getTables()
               //alert(JSON.stringify(this.tables,null,2))
           }
       }
     }
     ,

     mounted: async function() {
         registerComponent(this)
         let mm = this

         let listLL = await findComponentsImplementing(["getSchema"])
         //aaa
         //alert(JSON.stringify(listLL,null,2))
         this.data_sources = listLL.values

         if (isValidObject(this.args)) {
         }

         if (this.design_mode == "never") {
             this.table = new Tabulator(this.$refs.exampletable, {
                    width:                    this.args.width
                    ,
                    height:                    this.args.height
                    ,
                    tables:                    []
                    ,
                    data:                      this.args.data
                    ,
                	layout:                    "fitColumns"
                    ,
                	responsiveLayout:          "hide"
                    ,
                	tooltips:                   true
                    ,
                	addRowPos:                 "top"
                    ,
                	history:                    true
                    ,
                	pagination:                "local"
                    ,
                	paginationSize:             7
                    ,
                	movableColumns:             true
                    ,
                    resizableColumns:           this.args.allow_col_resize
                    ,
                	resizableRows:              this.args.allow_row_resize
                    ,
                    movableColumns:            this.args.allow_col_move
                    ,
                    layout:                    this.args.layout
                    ,
                    tableNames:              []
                    ,

                	initialSort:                [
                                            	]
                    ,

                	columns:                    this.columnDefinitions
                });

         }
         if (this.design_mode) {
             //await this.getTables()

         }

         if (!this.design_mode) {

           //zzz
           //debugger

           //hack city!!!! This should not be done via timeout, but via some
           // sort of callback. The reason a timeout is needed here is because
           // other uninitialised (as of yet) controls on the same form are
           // referenced
           setTimeout(async function(){
             await mm.connect()
             await mm.executeSql()
           },300)
             //alert(JSON.stringify(results,null,2))
             //await this.setData(results)
         }

      }
      ,

      methods: {
          chooseSource: async function(event) {
              //debugger
              let mm = this
              let typeName = event.target.value
              await loadV2([typeName])
              mm.args.sourceControlName = typeName + "_" + this.meta.getEditor().getNextComponentid()
              mm.properties.sourceComponentType = typeName
              await this.meta.getEditor().addControl(
                  {
                            "leftX": 10,
                            "topY": 10,
                            "name": mm.args.sourceControlName,
                            "base_component_id": typeName,
                            parent_base_component_id: mm.args.base_component_id,
                            parent_name: mm.args.name
                          }

              )
              //debugger
              //await mm.meta.getEditor().updateComponentMethods()
              let newcontrol =  mm.meta.lookupComponent(mm.args.sourceControlName)
              let retttq = newcontrol.getDynamic()
              //mm.properties.connect_error = retttq
              newcontrol.width = 600
              newcontrol.height = 700

              //let newcontrol =  mm.meta.getEditor().form_runtime_info[mm.meta.getEditor().active_form].component_lookup_by_name["aaa"]
              //newcontrol.setText2("helo duck")

          }
          ,
          test: function() {
              //debugger
              let mm = this
              //let newcontrol =  mm.meta.getEditor().form_runtime_info[mm.meta.getEditor().active_form].component_lookup_by_name[newName]
              let newcontrol = mm.meta.getEditor().form_runtime_info[mm.meta.getEditor().active_form].component_lookup_by_name["aaa"]
              //mm.dynamic = newcontrol.getDynamic()
              newcontrol.setText2("helo duck")
          }
          ,
          connect: async function() {

             //alert(1)
             //debugger
             let mm = this
             let newcontrol =  mm.meta.lookupComponent(mm.args.sourceControlName)
             let retttq = await newcontrol.executeSql()
             if (newcontrol.result && newcontrol.result.failed) {
                  mm.properties.connect_error = JSON.stringify(newcontrol.result.failed.routine,null,2)
                  mm.properties.connect_status = "not_connected"
             } else {
                    mm.properties.connect_error = ""
                    mm.getTables()
                    mm.properties.connect_status = "connected"
             }

          }
          ,
          disconnect: async function() {

             //alert(1)
             //debugger
             let mm = this
             mm.properties.connect_status = "not_connected"
             mm.properties.connect_error = ""
             //let newcontrol =  mm.meta.lookupComponent(mm.properties.sourceControlName)
             await this.meta.getEditor().deleteComponentByName(mm.properties.sourceControlName)
             mm.properties.sourceControlName == ""
             mm.properties.sourceComponentType = ""
          }
          ,

            setSql: function() {
                var colSql = "*"
                if (this.args.dataWindowColumns.length > 0) {
                    colSql = ""
                    for (var coli=0; coli < this.args.dataWindowColumns.length; coli ++) {
                        colSql += this.args.dataWindowColumns[coli].value
                        if (coli< (this.args.dataWindowColumns.length - 1)) {
                            colSql += ","
                        }
                    }
                }
                this.args.sql = "select " + colSql + " from " + this.args.design_mode_table

                if (this.args.where_clause && (this.args.where_clause.length > 0)) {
                    this.args.sql += " where " + this.args.where_clause
                }

            }
            ,
            changedFn: function() {
                if (isValidObject(this.args)) {
                }
            }

            ,
            resetColumns: async function(data) {
                this.table.setColumns([])
            }
            ,
            addColumn: async function(colData) {
                this.table.addColumn(colData, true, "name");
            }
            ,

            runEventHandler: function() {
                this.$emit('send', {
                                                type:               "subcomponent_event",
                                                control_name:        this.args.name,
                                                sub_type:           "changed",
                                                code:                this.args.changed_event
                                            })
            }
            ,
            setData: async function(data) {
                this.args.data = data
                this.table.setData(data)

                var keysOfData = new Object()
                if ((this.columnDefinitions == null)  || (this.columnDefinitions.length == 0)) {
                    for (var rr = 0 ; rr < data.length; rr ++) {
                        var dfg = Object.keys(data[rr])
                        for (var qq = 0 ; qq < dfg.length; qq ++) {
                            keysOfData[dfg[qq]] = true
                        }
                    }
                }

                if (this.args.dataWindowColumns.length == 0) {
                    var dfg2 = Object.keys(keysOfData)
                    for (var qq2 = 0 ; qq2 < dfg2.length; qq2 ++) {
                        this.addColumn({title:dfg2[qq2], field:dfg2[qq2]})
                    }

                } else {
                    for (var coli = this.args.dataWindowColumns.length - 1; coli >= 0; coli --) {
                        var colDefn = {title:this.args.dataWindowColumns[coli].name,
                                        field:this.args.dataWindowColumns[coli].value
                                    }
                        if (this.args.dataWindowColumns[coli].width) {
                            colDefn.width = parseInt(this.args.dataWindowColumns[coli].width)
                        }

                        this.addColumn(colDefn)
                    }
                }

            }
            ,

            array_move: function (arr, old_index, new_index) {
                if (new_index >= arr.length) {
                    var k = new_index - arr.length + 1;
                    while (k--) {
                        arr.push(undefined);
                    }
                }
                arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
                return arr; // for testing
            }
            ,

            getTables: async function() {
                console.log("In getTables")
                //debugger

                if (this.design_mode) {
                    //debugger
                    let mm = this
                    let newcontrol =  mm.meta.lookupComponent(mm.args.sourceControlName)
                    let result = await newcontrol.getTables()

                   //alert("executeSql: " + JSON.stringify(result,null,2))
                   console.log(JSON.stringify(result,null,2))
                   if (result) {
                       this.properties.tables = []
                       //alert(JSON.stringify(result,null,2))
                       for (var i=0;i<result.length;i++) {
                           this.properties.tables.push(result[i].name)

                       }
                   }

                }
            }
            ,

            getColumns: async function() {
                console.log("In getColumns")
                //debugger

                if (this.design_mode) {
                    //debugger
                    let mm = this
                    let newcontrol =  mm.meta.lookupComponent(mm.args.sourceControlName)
                    newcontrol.design_mode_table = mm.properties.design_mode_table
                    let result = await newcontrol.getColumns()
                    this.properties.columns = result

                }
            }
            ,

            executeSql: async function() {
                console.log("In executeSql")
                //debugger

                //if (this.design_mode) {
                  debugger
                  let mm = this
                  let newcontrol =  mm.meta.lookupComponent(mm.args.sourceControlName)
                  newcontrol.sql = mm.properties.sql
                  let result = await newcontrol.executeSql()
                  this.properties.result = result
                  this.properties.data = result
                  return this.properties.result

                //}
            }

        }

    })
}


text:
Path: `/pacts/provider/{provider}/for-verification`

Allowed methods: `POST`

Content type: `application/hal+json`

Returns a deduplicated list of pacts to be verified by the specified provider.

### Body

Example: This data structure represents the way a user might specify "I want to verify the latest 'main' pact, all the pacts for the consumer versions that are currently deployed, and when I publish the verification results, the provider version will be be on the "main" branch.

    {
      "consumerVersionSelectors": [
        {
          "branch": "main"
        },
        {
          "deployed": true
        }
      ],
      "providerVersionBranch": "main",
      "includePendingStatus": true,
      "includeWipPactsSince": "2020-01-01"
    }

`consumerVersionSelectors.mainBranch`: if the key is specified, can only be set to `true`. Return the pacts for the configured `mainBranch` of each consumer. Use of this selector requires that the consumer has configured the `mainBranch` property, and has set a branch name when publishing the pacts.

`consumerVersionSelectors.branch`: the branch name of the consumer versions to get the pacts for. Use of this selector requires that the consumer has configured a branch name when publishing the pacts.

`consumerVersionSelectors.matchingBranch`: if the key is specified, can only be set to `true`. When true, returns the latest pact for any branch with the same name as the specified `providerVersionBranch`.

`consumerVersionSelectors.fallbackBranch`: the name of the branch to fallback to if the specified `branch` does not exist. Use of this property is discouraged as it may allow a pact to pass on a feature branch while breaking backwards compatibility with the main branch, which is generally not desired. It is better to use two separate consumer version selectors, one with the main branch name, and one with the feature branch name, rather than use this property.

`consumerVersionSelectors.deployed`: if the key is specified, can only be set to `true`. Returns the pacts for all versions of the consumer that are currently deployed to any environment. Use of this selector requires that the deployment of the consumer application is recorded in the Pact Broker using the `pact-broker record-deployment` CLI.

`consumerVersionSelectors.released`: if the key is specified, can only be set to `true`. Returns the pacts for all versions of the consumer that are released and currently supported in any environment. Use of this selector requires that the deployment of the consumer application is recorded in the Pact Broker using the `pact-broker record-release` CLI.

`consumerVersionSelectors.deployedOrReleased`: if the key is specified, can only be set to `true`. Returns the pacts for all versions of the consumer that are currently deployed or released and currently supported in any environment. Use of this selector requires that the deployment of the consumer application is recorded in the Pact Broker using the `pact-broker record-deployment` or `record-release` CLI.

`consumerVersionSelectors.environment`: the name of the environment containing the consumer versions for which to return the pacts. Used to further qualify `{ "deployed": true }` or `{ "released": true }`. Normally, this would not be needed, as it is recommended to verify the pacts for all currently deployed/currently supported released versions.

`consumerVersionSelectors.latest`: true. Used in conjuction with the tag property. If a tag is specified, and latest is true, then the latest pact for each of the consumers with that tag will be returned. If a tag is specified and the latest flag is not set to true, all the pacts with the specified tag will be returned. (This might seem a bit weird, but it's done this way to match the syntax used for the matrix query params. See https://docs.pact.io/selectors).

`consumerVersionSelectors.consumer`: allows a selector to only be applied to a certain consumer.

`consumerVersionSelectors.tag`: the tag name(s) of the consumer versions to get the pacts for. *This field is still supported but it is recommended to use the `branch` in preference now.*

`consumerVersionSelectors.fallbackTag`: the name of the tag to fallback to if the specified `tag` does not exist. This is useful when the consumer and provider use matching branch names to coordinate the development of new features. *This field is still supported but it is recommended to use two separate selectors - one with the main branch name and one with the feature branch name.*

`providerVersionBranch`: the repository branch name for the provider application version that will be published with the verification results. This is used by the Broker to determine whether or not a particular pact is in pending state or not.

`includePendingStatus`: true|false (default false). When true, a pending boolean will be added to the verificationProperties in the response, and an extra message will appear in the notices array to indicate why this pact is/is not in pending state. This will allow your code to handle the response based on only what is present in the response, and not have to do ifs based on the user's options together with the response. As requested in the "pacts for verification" issue, please print out these messages in the tests if possible. If not possible, perhaps create a separate task which will list the pact URLs and messages for debugging purposes.

`includeWipPactsSince`: Date string. The date from which to include the "work in progress" pacts. See https://docs.pact.io/wip for more information on work in progress pacts.

`providerVersionTags`: the tag name(s) for the provider application version that will be published with the verification results. This is used by the Broker to determine whether or not a particular pact is in pending state or not. This parameter can be specified multiple times. *This field is still supported but it is recommended to use the `providerVersionBranch` in preference now.*

### Response body

`pending` flag and  the "pending reason" notice will only be included if `includePendingStatus` is set to true.

    {
      "_embedded": {
        "pacts": [
          {
            "verificationProperties": {
              "notices": [
                {
                  "text": "This pact is being verified because it is the pact for the latest version of Foo tagged with 'dev'",
                  "when": "before_verification"
                }
              ],
              "pending": false
            },
            "_links": {
              "self": {
                "href": "http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a",
                "name": "Pact between Foo (v1.0.0) and Bar"
              }
            }
          }
        ]
      },
      "_links": {
        "self": {
          "href": "http://localhost:9292/pacts/provider/Bar/for-verification",
          "title": "Pacts to be verified"
        }
      }
    }

redpajama_set_name: RedPajamaGithub


text:
var concat     = require('broccoli-sourcemap-concat');
var Funnel     = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
var compileES6 = require('broccoli-es6modules');
var jshintTree = require('broccoli-jshint');
var replace    = require('broccoli-string-replace');
var gitVersion = require('git-repo-version');

// extract version from git
// note: remove leading `v` (since by default our tags use a `v` prefix)
var version = gitVersion().replace(/^v/, '');

var packages = [
  {
    name: 'orbit-firebase',
    include: [/orbit-firebase\/lib\/cache-utils.js/,
              /orbit-firebase\/lib\/array-utils.js/,
              /orbit-firebase\/lib\/object-utils.js/,
              /orbit-firebase\/lib\/promise-utils.js/,
              /orbit-firebase\/lib\/operation-utils.js/,
              /orbit-firebase\/lib\/schema-utils.js/,
              /orbit-firebase\/mixins\/invocations-tracker.js/,
              /orbit-firebase\/cache-source.js/,
              /orbit-firebase\/operation-sequencer.js/,
              /orbit-firebase\/operation-filter.js/,
              /orbit-firebase\/related-inverse-links.js/,
              /orbit-firebase\/firebase-client.js/,
              /orbit-firebase\/firebase-connector.js/,
              /orbit-firebase\/firebase-serializer.js/,
              /orbit-firebase\/firebase-transformer.js/,
              /orbit-firebase\/firebase-requester.js/,
              /orbit-firebase\/firebase-source.js/,
              /orbit-firebase\/firebase-listener.js/,
              /orbit-firebase\/transformations.js/,
              /orbit-firebase\/operation-serializer.js/,
              /orbit-firebase\/subscriptions\/subscription.js/,
              /orbit-firebase\/subscriptions\/record-subscription.js/,
              /orbit-firebase\/subscriptions\/attribute-subscription.js/,
              /orbit-firebase\/subscriptions\/has-one-subscription.js/,
              /orbit-firebase\/subscriptions\/has-many-subscription.js/,
              /orbit-firebase\/subscriptions\/options.js/,
              /orbit-firebase\/operation-decomposer.js/,
              /orbit-firebase\/operation-matcher.js/,
              /orbit-firebase\/transformers\/add-record.js/,
              /orbit-firebase\/transformers\/remove-record.js/,
              /orbit-firebase\/transformers\/replace-attribute.js/,
              /orbit-firebase\/transformers\/add-to-has-many.js/,
              /orbit-firebase\/transformers\/add-to-has-one.js/,
              /orbit-firebase\/transformers\/remove-has-one.js/,
              /orbit-firebase\/transformers\/replace-has-many.js/,
              /orbit-firebase\/transformers\/remove-from-has-many.js/,
              /orbit-firebase\/transformers\/update-meta.js/]
  }
];

var loader = new Funnel('bower_components', {
  srcDir: 'loader',
  files: ['loader.js'],
  destDir: '/assets/'
});

var globalizedLoader = new Funnel('build-support', {
  srcDir: '/',
  files: ['globalized-loader.js'],
  destDir: '/assets/'
});

var generatedBowerConfig = new Funnel('build-support', {
  srcDir: '/',
  destDir: '/',
  files: ['bower.json']
});

generatedBowerConfig = replace(generatedBowerConfig, {
  files: ['bower.json'],
  pattern: {
    match: /VERSION_PLACEHOLDER/,
    replacement: function() {
      return version;
    }
  }
});

var tests = new Funnel('test', {
  srcDir: '/tests',
  include: [/.js$/],
  destDir: '/tests'
});

var buildExtras = new Funnel('build-support', {
  srcDir: '/',
  destDir: '/',
  files: ['README.md', 'LICENSE']
});

var lib = {};
var main = {};
var globalized = {};

packages.forEach(function(package) {
  lib[package.name] = new Funnel('lib', {
    srcDir: '/',
    include: package.include,
    exclude: package.exclude || [],
    destDir: '/'
  });

  main[package.name] = mergeTrees([ lib[package.name] ]);
  main[package.name] = concat(new compileES6(main[package.name]), {
    inputFiles: ['**/*.js'],
    outputFile: '/' + package.name + '.amd.js'
  });

  var support = new Funnel('build-support', {
    srcDir: '/',
    files: ['iife-start.js', 'globalize-' + package.name + '.js', 'iife-stop.js'],
    destDir: '/'
  });

  var loaderTree = (package.name === 'orbit' ? loader : globalizedLoader);
  var loaderFile = (package.name === 'orbit' ? 'loader.js' : 'globalized-loader.js');

  globalized[package.name] = concat(mergeTrees([loaderTree, main[package.name], support]), {
    inputFiles: ['iife-start.js', 'assets/' + loaderFile, package.name + '.amd.js', 'globalize-' + package.name + '.js', 'iife-stop.js'],
    outputFile: '/' + package.name + '.js'
  });
});

var allLib = mergeTrees(Object.keys(lib).map(function(package) {
  return lib[package];
}));
var allMain = mergeTrees(Object.keys(main).map(function(package) {
  return main[package];
}));
var allGlobalized = mergeTrees(Object.keys(globalized).map(function(package) {
  return globalized[package];
}));

var jshintLib = jshintTree(allLib);
var jshintTest = jshintTree(tests);

var mainWithTests = mergeTrees([allLib, tests, jshintLib, jshintTest]);
mainWithTests = concat(new compileES6(mainWithTests), {
  inputFiles: ['**/*.js'],
  outputFile: '/assets/tests.amd.js'
});

mainWithTests = replace(mainWithTests, {
  files: "/assets/tests.amd.js",
  patterns: [
    {match: /%FIREBASE_URL/g, replacement: process.env.ORBIT_FIREBASE_FIREBASE_URL},
    {match: /%FIREBASE_SECRET/g, replacement: process.env.ORBIT_FIREBASE_FIREBASE_SECRET},
  ]
});

var vendor = concat('bower_components', {
  inputFiles: [
    'jquery/dist/jquery.js',
    'rsvp/rsvp.js',
    'firebase/firebase-debug.js',
    'firebase-token-generator/dist/firebase-token-generator.js',
    'orbit.js/orbit.amd.js',
    'orbit.js/orbit-common.amd.js'],
  outputFile: '/assets/vendor.js'
});

var qunit = new Funnel('bower_components', {
  srcDir: '/qunit/qunit',
  files: ['qunit.js', 'qunit.css'],
  destDir: '/assets'
});

var testSupport = concat('test', {
  inputFiles: ['../test/test-support/sinon.js', '../test/test-support/test-shims.js', '../test/test-support/test-loader.js'],
  outputFile: '/assets/test-support.js'
});

var testIndex = new Funnel('test', {
  srcDir: '/',
  files: ['index.html'],
  destDir: '/tests'
});

module.exports = mergeTrees([loader, globalizedLoader, allMain,
  allGlobalized, mainWithTests, vendor, qunit, testSupport, testIndex,
  generatedBowerConfig, buildExtras]);


text:
python -m classification.run \
  --gpus 0,1 \
  --split train \
  --dset ntu-rgbd \
  --subsample 33 \
  --pretrained_ckpt_name sub \
  --xfer_to jjd \
  --modalities rgb oflow depth jjd jjv jld


text:
var gulp   = require('gulp');
var less   = require('gulp-less');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');

// Less Task

gulp.task('less', function() {
	return gulp.src('./app/less/main.less')
		.pipe(less())
		.pipe(concat('style.css'))
		.pipe(minify())
		.pipe(gulp.dest('./public/assets/css'));
});

// CSS Task

gulp.task('css', function() {
	return gulp.src([
			// Bower CSS Files

			'normalize.css/normalize.css',

		].map(function(str) { return './bower_components/' + str }))
		.pipe(concat('libraries.css'))
		.pipe(minify())
		.pipe(gulp.dest('./public/assets/css'));
});

// JavaScript Task

gulp.task('js', function() {
	return gulp.src([
			// Bower JavaScript Files

			'jquery/dist/jquery.min.js',

		].map(function(str) { return './bower_components/' + str }).concat([
			// Asset JavaScript Files

			'main.js',

		].map(function(str) { return './app/js/' + str })))
		.pipe(concat('scripts.js'))
		.pipe(uglify())
		.pipe(gulp.dest('./public/assets/js'));
});

// Watch Task

gulp.task('watch', function() {
	var watch   = require('gulp-watch');

	gulp.watch('app/js/*.js', ['js']);
	gulp.watch('app/less/*.less', ['less']);
});

// Default Task

gulp.task('default', ['less', 'css', 'js']);


text:
:orphan:

The hard way
------------

If you want to use ESCAPE as a Multi-domain Orchestrator without Mininet-based
Infrastructure Layer, you should use the easy way: :ref:`install_steps`

Obviously ESCAPE can be installed on a host machine or on a different platform too.
If the install script fails on a newer OS for some reason, the installation steps need to be carried out manually.

**Submodules**

The project uses several dependent component as a Git submodule. To acquire these
source codes a symlink have to be created in the project's root folder at first,
referring to the gitmodules config of the actual project.

Moreover, the required submodules need to be configured with the related project's gitmodules file recursively.
For this task the ``project-setup.sh`` wrapper script can be used with the referred project's name:

.. code-block:: text

    $ ./project-setup.sh -h
    Setup submodules according to given project for ESCAPE.
    If project name is not given the script tries to detect it
    from the git's local configurations.

    Usage: ./project-setup.sh [-h] [-p project]
    Parameters:
         -h, --help      show this help message and exit
         -p, --project   setup project name based on: .gitmodules.<name>

    Example: ./project-setup.sh -p 5gex

The submodule configuration can be set up and updated manually as well:

.. code-block:: bash

    $ ln -s .gitmodules.<project_name> .gitmodules
    $ git submodule update --init --remote --recursive --merge

**Dependencies**

If ESCAPE's Python dependencies are not wanted to be installed globally, follow the
hard way and setup a virtual environment step-by-step.

.. note::

    neo4j requires Java 7 which can't be found in the official Ubuntu 14.04 repositories.
    To install the Java package and the latest Python 2.7 on Ubuntu 14.04, the following
    PPA repositories can be used:

.. code-block:: bash

    $ sudo apt-get install -y software-properties-common
    $ sudo add-apt-repository -y ppa:openjdk-r/ppa
    $ sudo add-apt-repository -y ppa:jonathonf/python-2.7
    $ sudo apt-get install openjdk-7-jdk python2.7

Required system and Python packages:

.. code-block:: bash

    $ sudo apt-get -y install python-dev python-pip zlib1g-dev libxml2-dev libxslt1-dev \
        libssl-dev libffi-dev python-crypto openvswitch-switch neo4j=2.2.7

    $ sudo -H pip install numpy jinja2 py2neo networkx requests ncclient cryptography==1.3.1

For Mininet emulation tool:

.. code-block:: bash

    $ sudo apt-get -y install gcc make socat psmisc xterm ssh iperf iproute telnet \
    python-setuptools cgroup-bin ethtool help2man pyflakes pylint pep8 openvswitch-switch

For our rudimentary GUI:

.. code-block:: bash

    $ sudo apt-get install -y python-tk
    $ sudo -H pip install networkx_viewer

For doc generations:

.. code-block:: bash

    # html
    $ sudo apt-get -y install graphviz
    $ sudo -H pip install sphinx
    # latex
    $ sudo apt-get install -y texlive-latex-extra

For domain emulation scripts:

.. code-block:: bash

    $ sudo -H pip install tornado openvswitch-switch

If a newer version of ``neo4j`` has been installed on the system, use the following commands to downgrade.
In this case the authentication bypass needs to be done again.

.. code-block:: bash

    $ sudo -i
    $ apt-get purge neo4j
    $ rm -rf /var/lib/neo4j/data/
    $ rm -rf /etc/neo4j/
    $ apt-get install -y neo4j=2.2.7
    $ apt-mark hold neo4j

In extreme cases, e.g. the `install_dep.sh` ran into an error, these dependencies should be installed
one by one according to the used OS, distro or development environment.
For that follow the steps in the install script and/or the online documentations
referenced in entry 4. of the previous subsection.

In case of the additional DO functionality other required programs (OpenYuma, click, neo4j, etc.),
which are installed by the `install_dep.sh` script by default, are also need to be installed manually.
The relevant command can be found in the ``install-dep.sh`` script's *install_mn_dep()* and
*install_infra()* functions.

To use the Infrastructure Layer of ESCAPE, Mininet must be installed on the host machine
(more precisely the **Open vSwitch** implementation and the specific **mnexec** utility
is only required to be installed globally).

If Mininet has already been installed, there is nothing to do.
ESCAPE always uses the specifically-modified Mininet files in the project folder (*Mininet v2.1.0mod-ESCAPE*)
which will use the globally installed Mininet utility scripts (mnexec).

Otherwise these assets have to be installed manually which could be done from our
Mininet folder (escape/mininet) or from the official Mininet git repository
(`<https://github.com/mininet/mininet/>`__). Mininet has an install script for
the installations (see the help with the ``-h`` flag) but this script will install
the whole Mininet tool with unnecessary packages:

.. code-block:: bash

    $ sudo mininet/util/install.sh -n

In this case you can run the following command to check whether the installation was correct or not:

.. code-block:: bash

    $ sudo mn --test pingall

But the script will install the whole Mininet package and additional dependencies.
For a minimal install, compile the ``mnexec`` source by manual and
copy the binary into a folder which is in your ``PATH`` system variable.

.. code-block:: bash

    $ cd mininet/
    $ make mnexec
    $ sudo install mnexec /usr/bin

If ESCAPE is intended to be used on a host machine, it is recommended to create
a separate user for the netconfd server. This user's name and password will be
used for the connection establishment between ESCAPE and the Execution Environments (EE).

.. note::

  These parameters can be changed conveniently in the global config under the
  config entry of *VNFStarter Adapter* .

Another solution is to define a system user for the netconfd. To create a user
(advisable to use `mininet` as in the Mininet-based VM) use the following commands:

.. code-block:: bash

    $ sudo adduser --system --shell /bin/bash --no-create-home mininet
    $ sudo addgroup mininet sudo
    $ echo "mininet:mininet" | sudo chpasswd

For security reasons, it's highly recommended to limit the SSH connections for the
`mininet` user only to localhost.

.. code-block:: bash

    $ sudo echo -e 'Match Host *,!localhost\n  DenyUsers  mininet' >> /etc/ssh/sshd_config
    $ sudo service ssh reload

Check the created user with the following command:

.. code-block:: bash

    $ ssh mininet@localhost


text:
<?php

namespace Croogo\Extensions\Test\Fixture;

use Croogo\TestSuite\CroogoTestFixture;

class MovieFixture extends CroogoTestFixture
{

/**
 * fields property
 *
 * @var array
 */
    public $fields = [
        'id' => ['type' => 'integer'],
        'title' => ['type' => 'string', 'null' => false],
        'year' => ['type' => 'integer', 'null' => false],
        'user_id' => ['type' => 'integer', 'null' => true],
        'created' => 'datetime',
        'updated' => 'datetime',
        '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
    ];

/**
 * records property
 *
 * @var array
 */
    public $records = [
    ];
}


text:
title: Messages as Interfaces
summary: ' NServiceBus allows you to use interfaces as well as standard XSD and class serialization.'
tags: []
redirects:
- nservicebus/messages-as-interfaces
---

Message schema flexibility is at the core of NServiceBus. Beyond just standard XSD and class serialization, NServiceBus allows you to use interfaces as well.

One advantage of using interfaces to define messages instead of classes is that you get "multiple inheritance"; i.e., one message can extend multiple other messages. This is useful for solving a specific class of versioning problems.

Say that the business logic represents a state machine with states X and Y. When the system gets into state X, it publishes the message `EnteredStateX`. When the system gets into state Y, it publishes the message `EnteredStateY`. (For more information on how to publish a message, see below.)

In the next version of the system, you add a new state Z, which represents the co-existence of both X and Y. So, you define the message `EnteredStateZ`, which inherits both `EnteredStateX` and `EnteredStateY`.

When the system publishes `EnteredStateZ`, clients subscribed to `EnteredStateX` and/or `EnteredStateY` are notified.

Without the ability to extend a message to multiple others, you would have to use composition, thereby preventing the infrastructure from automatically routing messages to pre-existing subscribers of the composed messages.

The versioning advantages of NServiceBus message types allow for easily extending endpoints without breaking clients or subscribers.

## Use classes for commands

When writing commands, it is recommended to use classes rather than interfaces for those messages. The advantage of using a class is that you can include validation logic in the class constructor so that clients sending these messages are not able to send invalid commands. Of course, you will re-validating these commands on the server side anyway.

## Use interfaces for events

Since events represent something that occurred in the past, the importance of validation is much decreased. Also, only the publisher of an event is the one that creates and sends the event. Subscribers cannot invalidate an event that was published. As such, the ability to put logic in the class representing a message is less relevant for events.

The other reason to use interfaces is that they enable multiple inheritance, which is very useful for extending a system over time from one version to the next, without breaking existing subscribers.

Let's say that in version 1 of a publisher, it exposed an event of type X. In Version 2, we added a new event of type Y. Then in Version 3, a new requirement comes along for a type of event, Z, which means that both X and Y occurred. If X, Y, and Z were implemented as interfaces, we could have Z inherit both X and Y. The main advantage of this is that when Z is published, subscribers of X and Y receive the event with no changes required of them, as well as subscribers of Z, of course.

This would not be possible using classes.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.13"/>

        <title>CubbyFlow: Core/Utils/Serialization.hpp File Reference</title>

        <link href="search/search.css" rel="stylesheet" type="text/css"/>

        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">

                    CubbyFlow v0.71

Core

Utils

Classes |
Namespaces |
Functions

Serialization.hpp File Reference

#include <Core/Array/ArrayView.hpp>

#include <vector>

#include <Core/Utils/Serialization-Impl.hpp>

Go to the source code of this file.

Classes

class  	CubbyFlow::Serializable

 	Abstract base class for any serializable class.  More...

Namespaces

  	CubbyFlow

Functions

void 	CubbyFlow::Serialize (const Serializable *serializable, std::vector< uint8_t > *buffer)

 	Serializes serializable object.  More...

void 	CubbyFlow::Serialize (const uint8_t *data, size_t size, std::vector< uint8_t > *buffer)

 	Serializes data chunk using common schema.  More...

template<typename T >

void 	CubbyFlow::Serialize (const ConstArrayView1< T > &array, std::vector< uint8_t > *buffer)

 	Serializes data chunk using common schema.  More...

void 	CubbyFlow::Deserialize (const std::vector< uint8_t > &buffer, Serializable *serializable)

 	Deserializes buffer to serializable object.  More...

void 	CubbyFlow::Deserialize (const std::vector< uint8_t > &buffer, std::vector< uint8_t > *data)

 	Deserializes buffer to data chunk using common schema.  More...

template<typename T >

void 	CubbyFlow::Deserialize (const std::vector< uint8_t > &buffer, Array1< T > *array)

 	Deserializes buffer to data chunk using common schema.  More...

<address class="footer">
Generated on Thu Jul 15 2021 02:18:15 for CubbyFlow by

 1.8.13
</address>


text:
/**
 * Base search class for AJAX forms in the UI
 */

!function(global, $) {
    'use strict';

    function ConcreteAjaxForm($form, options) {
        var my = this;
        options = options || {};
        options = $.extend({
            'beforeSubmit': my.before,
            'complete': my.complete,
            'data': {}
        }, options);
        my.$form = $form;
        ConcreteAjaxRequest.call(my, options);
        return my.$form;
    }

    ConcreteAjaxForm.prototype = Object.create(ConcreteAjaxRequest.prototype);

    ConcreteAjaxForm.prototype.execute = function() {
        var my = this,
            options = my.options,
            successCallback = options.success,
            errorCallback = options.error;

        my.$form.ajaxForm({
            type: options.type,
            data: options.data,
            url: options.url,
            dataType: options.dataType,
            beforeSubmit: function() {
                options.beforeSubmit(my);
            },
            error: function(r) {
                my.error(r, my, errorCallback);
            },
            success: function(r) {
                my.success(r, my, successCallback);
            },
            complete: function() {
                options.complete(my);
            }
        });
    }

    ConcreteAjaxForm.prototype.error = function(r, my, callback) {
        ConcreteAjaxRequest.prototype.error(r, my);
        if (callback) {
            callback(r);
        }
    }

    ConcreteAjaxForm.prototype.success = function(r, my, callback) {
        if (my.validateResponse(r)) {
            if (callback) {
                callback(r);
            } else {
                // if we get a success function passed through, we use it. Otherwise we use the standard
                ConcreteEvent.publish('AjaxFormSubmitSuccess', {response: r, form: my.$form.attr('data-dialog-form')});
                if (r.redirectURL) {
                    window.location.href = r.redirectURL;
                } else {
                    if (my.$form.attr('data-dialog-form')) {
                        jQuery.fn.dialog.closeTop();
                    }
                    if (r.message) {
                        ConcreteAlert.notify({
                            'message': r.message,
                            'title': r.title
                        });
                    }
                }
            }
        }
    }

    // jQuery Plugin
    $.fn.concreteAjaxForm = function(options) {
        return $.each($(this), function(i, obj) {
            new ConcreteAjaxForm($(this), options);
        });
    }

    global.ConcreteAjaxForm = ConcreteAjaxForm;

}(this, $);


text:
=pod

=head1 NAME

SSL_CTX_get0_param, SSL_get0_param, SSL_CTX_set1_param, SSL_set1_param -
get and set verification parameters

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx)
 X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl)
 int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm)
 int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm)

=head1 DESCRIPTION

SSL_CTX_get0_param() and SSL_get0_param() retrieve an internal pointer to
the verification parameters for B<ctx> or B<ssl> respectively. The returned
pointer must not be freed by the calling application.

SSL_CTX_set1_param() and SSL_set1_param() set the verification parameters
to B<vpm> for B<ctx> or B<ssl>.

=head1 NOTES

Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure
using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies
them to suit its needs: for example to add a hostname check.

=head1 EXAMPLE

Check hostname matches "www.foo.com" in peer certificate:

 X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
 X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);

=head1 RETURN VALUES

SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an
B<X509_VERIFY_PARAM> structure.

SSL_CTX_set1_param() and SSL_set1_param() return 1 for success and 0
for failure.

=head1 SEE ALSO

L<X509_VERIFY_PARAM_set_flags(3)|X509_VERIFY_PARAM_set_flags(3)>

=head1 HISTORY

These functions were first added to OpenSSL 1.0.2.

=cut


text:
<?php

namespace PHPCI\Model\Build;

use PHPCI\Model\Build\RemoteGitBuild;

/**
* Gitlab Build Model
* @author       André Cianfarani <a.cianfarani@c2is.fr>
* @package      PHPCI
* @subpackage   Core
*/
class GitlabBuild extends RemoteGitBuild
{

    /**
    * Get link to commit from another source (i.e. Github)
    */
    public function getCommitLink()
    {
        $domain = $this->getProject()->getAccessInformation("domain");
        return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/commit/' . $this->getCommitId();
    }

    /**
    * Get link to branch from another source (i.e. Github)
    */
    public function getBranchLink()
    {
        $domain = $this->getProject()->getAccessInformation("domain");
        return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/tree/' . $this->getBranch();
    }

    /**
     * Get link to specific file (and line) in a the repo's branch
     */
    public function getFileLinkTemplate()
    {
        return sprintf(
            'http://%s/%s/blob/%s/{FILE}#L{LINE}',
            $this->getProject()->getAccessInformation("domain"),
            $this->getProject()->getReference(),
            $this->getBranch()
        );
    }

    /**
    * Get the URL to be used to clone this remote repository.
    */
    protected function getCloneUrl()
    {
        $key = trim($this->getProject()->getSshPrivateKey());

        if (!empty($key)) {
            $user = $this->getProject()->getAccessInformation("user");
            $domain = $this->getProject()->getAccessInformation("domain");
            $port = $this->getProject()->getAccessInformation('port');

            $url = $user . '@' . $domain . ':';

            if (!empty($port)) {
                $url .= $port . '/';
            }

            $url .= $this->getProject()->getReference() . '.git';

            return $url;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Leanwork.CodePack;

namespace Leanwork.CodePack.Tests.Extensions
{
    [TestClass]
    public class BooleanExtensions_Should
    {
        [TestMethod]
        public void Returns_yes_if_value_is_true()
        {
            //arrange
            bool value = true;

            //act
            string result = value.ToLiteral("YES", "NO");

            //assert
            Assert.AreEqual("YES", result);
        }

        [TestMethod]
        public void Returns_no_if_value_is_false()
        {
            //arrange
            bool value = false;

            //act
            string result = value.ToLiteral("YES", "NO");

            //assert
            Assert.AreEqual("NO", result);
        }
    }
}


text:
export enum Direction {
  left = 37,
  up,
  right,
  down,
}

export enum Team {
  top,
  bottom,
}

export const Config = {
  canvas_width: 700,
  canvas_height: 500,
  player_size: 10,
  flag_size: 15,
};

export class Player {
  private readonly speed = 3;
  private readonly r = Config.player_size; //radius of face
  private readonly lineWidth = this.r / 8;

  public x:number;
  public y:number;
  public color:string;
  public team:Team;
  public direction:number|undefined;

  constructor(x, y, team) {
    this.x = x;
    this.y = y;
    this.team = team;
    this.color = (team === Team.top) ? 'yellow' : '#00ffde';
  }

  public draw(ctx) {
    ctx.lineWidth = this.lineWidth;
    ctx.strokeStyle = this.color;
    ctx.fillStyle = this.color;

    ctx.beginPath();
    ctx.arc(this.x, this.y, this.r, 0, Math.PI * 2, true); // face circle
    ctx.moveTo(this.x + this.r * 2 / 3, this.y);
    ctx.arc(this.x, this.y, this.r * 2 / 3, 0, Math.PI, false); // mouth
    ctx.stroke();

    ctx.beginPath();
    ctx.arc(this.x - (this.r / 3), this.y - (this.r / 3), this.r / 5, 0, Math.PI * 2, true); // left eye
    ctx.arc(this.x + (this.r / 3), this.y - (this.r / 3), this.r / 5, 0, Math.PI * 2, true); // right eye
    ctx.fill();
  }

  public move(ctx) {
    switch (this.direction) {
      case Direction.up:
        this.y -= this.speed;
        if (this.y < this.r) { this.y = this.r; }
        break;
      case Direction.left:
        this.x -= this.speed;
        if (this.x < this.r) { this.x = this.r; }
        break;
      case Direction.right:
        this.x += this.speed;
        if (this.x > Config.canvas_width - this.r) { this.x = Config.canvas_width - this.r; }
        break;
      case Direction.down:
        this.y += this.speed;
        if (this.y > Config.canvas_height - this.r) { this.y = Config.canvas_height - this.r; }
        break;
      default:
        break;
    }
    this.draw(ctx);
  }
}

export class Flag {
  private readonly tall = Config.flag_size;

  public color:string;
  public team:Team;
  public x:number;
  public y:number;

  constructor(x, y, team:Team) {
    this.x = x;
    this.y = y;
    this.color = (team === Team.top) ? 'yellow' : '#00ffde';
    this.team = team;
  }

  public draw(ctx) {
    ctx.strokeStyle = this.color;
    ctx.fillStyle = this.color;
    ctx.lineWidth = 5;

    ctx.beginPath();
    ctx.moveTo(this.x, this.y);
    ctx.lineTo(this.x, this.y - this.tall);
    ctx.stroke();
    ctx.lineTo(this.x + this.tall / 2, this.y - this.tall * 2 / 3);
    ctx.lineTo(this.x, this.y - this.tall * 1 / 3);
    ctx.fill();
  }
}

export class Map {
  public width:number;
  public height:number;
  public score:number[];

  constructor(width, height) {
    this.width = width;
    this.height = height;
    this.score = [0, 0];
  }

  public draw(ctx) {
    ctx.strokeStyle = 'red';
    ctx.beginPath();
    ctx.moveTo(0, this.height / 2);
    ctx.lineTo(this.width, this.height / 2);
    ctx.stroke();
    ctx.closePath();

    // show score
    ctx.font = '48px serif';
    ctx.fillStyle = 'white';
    ctx.fillText(this.score[0].toString(), Config.canvas_width - 40, 35);
    ctx.fillText(this.score[1].toString(), Config.canvas_width - 40, Config.canvas_height - 5);
  }
}


text:
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using PodioAPI.Models;
using PodioAPI.Utils.ItemFields;

namespace PodioAPI.Utils.ApplicationFields
{
    public class CategoryApplicationField : ApplicationField
    {
        private IEnumerable<CategoryItemField.Option> _options;

        /// <summary>
        ///     The list of options for the category
        /// </summary>
        public IEnumerable<CategoryItemField.Option> Options
        {
            get
            {
                if (_options == null)
                {
                    _options = this.GetSettingsAs<CategoryItemField.Option>("options");
                }
                return _options;
            }
            set
            {
                InitializeFieldSettings();
                this.InternalConfig.Settings["options"] = value != null ? JToken.FromObject(value) : null;
            }
        }

        /// <summary>
        ///     True if multiple options should be allowed, False otherwise
        /// </summary>
        public bool Multiple
        {
            get { return (bool) this.GetSetting("multiple"); }
            set
            {
                InitializeFieldSettings();
                this.InternalConfig.Settings["multiple"] = value;
            }
        }

        /// <summary>
        ///     The way the options are displayed on the item, one of "inline", "list" or "dropdown"
        /// </summary>
        public string Display
        {
            get { return (string) this.GetSetting("display"); }
            set
            {
                InitializeFieldSettings();
                this.InternalConfig.Settings["display"] = value;
            }
        }
    }
}


text:
import { Template } from 'meteor/templating'
import './booleanExample.html'

// helpers
Template.booleanExample.helpers({
  doc: {
    trueInitialisedBoolean: true,
    falseInitialisedBoolean: false
  }
})


text:
package com.xebialabs.overcast;

import com.typesafe.config.Config;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;
import java.util.Map;

import static com.xebialabs.overcast.OvercastProperties.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class OvercastPropertiesTest {

    @BeforeAll
    static void setup() {
        System.setProperty("user.home", new File("src/test/resources/fake-home").getAbsolutePath());
    }

    @AfterAll
    static void teardown() {
        System.clearProperty("overcast.conf.file");
    }

    @Test
    public void testGetOvercastProperty() {
        assertThat(getOvercastProperty("unittestHost.vagrantDir"), is("/httpd"));
        assertThat(getOvercastProperty("unittestHost.doesNotExist", "default"), is("default"));
    }

    @Test
    public void testGetOvercastMapProperty() {
        Map<String, String> overcastPropertyMap = getOvercastMapProperty("unittestHost.vagrantParameters");
        assertThat(overcastPropertyMap.size(), is(2));
        assertThat(overcastPropertyMap.get("param1"), is("value1"));
        assertThat(overcastPropertyMap.get("param2"), is("value2"));
    }

    @Test
    public void testGetRequiredOvercastProperty() {
        assertThrows(IllegalStateException.class, () -> getRequiredOvercastProperty("unittestHost.doesNotExist"));
    }

    @Test
    public void testParsePortsProperty() {
        Map<Integer, Integer> integerIntegerMap = parsePortsProperty("2222:22,1445:445");

        assertThat(integerIntegerMap.size(), is(2));
        assertThat(integerIntegerMap.get(22), is(2222));
        assertThat(integerIntegerMap.get(445), is(1445));
    }

    @Test
    public void testHaveSystemProperties() {
        Config cfg = PropertiesLoader.loadOvercastConfig();
        assertThat(cfg.getString("user.dir"), is(System.getProperty("user.dir")));
    }

    @Test
    public void testSubstitution() {
        assertThat(getOvercastProperty("some.bar"), is("foo"));
        // to document that no substitution is done inside a string...
        assertThat(getOvercastProperty("some.boz"), is("${value}"));
    }

    @Test
    public void testReplaceEnvVariables() {
        assertThat(getOvercastProperty("unittestHost.home"), is(notNullValue()));
        assertThat(getOvercastProperty("unittestHost.home").contains("${"), is(false));
    }

    @Test
    public void testSystemHasPrecedenceOverRest() {
        System.setProperty("precedenceTestValue", "valueFromEnv");
        OvercastProperties.reloadOvercastProperties();

        assertThat(OvercastProperties.getOvercastProperty("precedenceTestValue"), is("valueFromEnv"));
    }

    @Test
    public void testHomeDirHasPrecedenceOverClasspath() {
        System.clearProperty("precedenceTestValue");
        OvercastProperties.reloadOvercastProperties();

        assertThat(OvercastProperties.getOvercastProperty("precedenceTestValue"), is("valueFromHome"));
    }

    @Test
    public void testPropertyHasPrecedenceOverClasspath() throws IOException {

        System.setProperty("user.home", new File("src/test/resources/dir-without-conf").getAbsolutePath());
        System.clearProperty("precedenceTestValue");
        System.setProperty("overcast.conf.file", "src/test/resources/property-path/overcast.conf");

        File cfg = new File("overcast.conf");
        File bkp = new File("backup.conf");

        try {
            FileUtils.moveFile(cfg, bkp);
            OvercastProperties.reloadOvercastProperties();
            assertThat(OvercastProperties.getOvercastProperty("precedenceTestValue"), is("valueFromProperty"));
        } finally {
            FileUtils.moveFile(bkp, cfg);
        }
    }

    @Test
    public void testWorkDirHasPrecedenceOverProperty() {

        System.setProperty("user.home", new File("src/test/resources/dir-without-conf").getAbsolutePath());
        System.clearProperty("precedenceTestValue");
        System.setProperty("overcast.conf.file", "src/test/resources/property-path/overcast.conf");

        OvercastProperties.reloadOvercastProperties();

        assertThat(OvercastProperties.getOvercastProperty("precedenceTestValue"), is("valueFromWork"));
    }

    @Test
    public void testWorkDirHasPrecedenceOverClasspath() {
        System.setProperty("user.home", new File("src/test/resources/dir-without-conf").getAbsolutePath());
        System.clearProperty("precedenceTestValue");
        OvercastProperties.reloadOvercastProperties();

        assertThat(OvercastProperties.getOvercastProperty("precedenceTestValue"), is("valueFromWork"));
    }
}


text:
declare global {
    namespace Summernote {
        type fontSizeUnitOptions = 'px' | 'pt';

        interface Options {
            airMode?: boolean;
            tabDisable?: boolean;
            codeviewFilter?: boolean;
            codeviewFilterRegex?: string;
            codeviewIframeWhitelistSrc?: string[];
            codeviewIframeFilter?: boolean;
            callbacks?: any; // todo
            codemirror?: CodemirrorOptions;
            colors?: colorsDef;
            dialogsInBody?: boolean;
            dialogsFade?: boolean;
            direction?: string;
            disableDragAndDrop?: boolean;
            focus?: boolean;
            fontNames?: string[];
            fontNamesIgnoreCheck?: string[];
            fontSizes?: string[];
            fontSizeUnits?: fontSizeUnitOptions[];
            height?: number;
            hint?: HintOptions;
            icons?: IconsOptions;
            insertTableMaxSize?: InsertTableMaxSizeOptions;
            keyMap?: KeyMapOptions;
            lang?: string;
            lineHeights?: string[];
            minHeight?: number;
            maxHeight?: number;
            maximumImageFileSize?: any;
            modules?: ModuleOptions;
            popover?: PopoverOptions;
            placeholder?: string;
            shortcuts?: boolean;
            styleTags?: styleTagsOptions[];
            styleWithSpan?: boolean;
            tabsize?: number;
            tableClassName?: string;
            textareaAutoSync?: boolean;
            toolbar?: toolbarDef;
            width?: number;
        }

        type toolbarStyleGroupOptions = 'style' | 'bold' | 'italic' | 'underline' | 'clear';
        type toolbarFontGroupOptions = 'fontname' | 'fontsize' | 'color' | 'forecolor' | 'backcolor' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'superscript' | 'subscript' | 'clear';
        type toolbarFontsizeGroupOptions = 'fontsize' | 'fontname' | 'color';
        type toolbarColorGroupOptions = 'color';
        type toolbarParaGroupOptions = 'ul' | 'ol' | 'paragraph' | 'style' | 'height';
        type toolbarHeightGroupOptions = 'height';
        type toolbarTableGroupOptions = 'table';
        type toolbarInsertGroupOptions = 'link' | 'picture' | 'hr' | 'table' | 'video';
        type toolbarViewGroupOptions = 'fullscreen' | 'codeview' | 'help';
        type toolbarHelpGroupOptions = 'help';
        type miscGroupOptions = 'fullscreen' | 'codeview' | 'undo' | 'redo' | 'help';
        // type toolbarDef = [string, string[]][]
        type toolbarDef = Array<
            ['style', toolbarStyleGroupOptions[]]
            | ['font', toolbarFontGroupOptions[]]
            | ['fontsize', toolbarFontsizeGroupOptions[]]
            | ['color', toolbarColorGroupOptions[]]
            | ['para', toolbarParaGroupOptions[]]
            | ['height', toolbarHeightGroupOptions[]]
            | ['table', toolbarTableGroupOptions[]]
            | ['insert', toolbarInsertGroupOptions[]]
            | ['view', toolbarViewGroupOptions[]]
            | ['help', toolbarHelpGroupOptions[]]
            | ['misc', miscGroupOptions[]]
        >;

        type colorsDef = Array<[string[]]>;
        type styleTagsOptions = 'p' | 'blockquote' | 'pre' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';

        interface InsertTableMaxSizeOptions {
            col: number;
            row: number;
        }

        interface IconsOptions {
            options?: any; // todo
        }

        interface KeyMapOptions {
            pc?: KeyMapPcOptions;
            mac?: KeyMapMacOptions;
        }

        interface KeyMapPcOptions {
            options?: any; // todo
        }

        interface KeyMapMacOptions {
            options?: any; // todo
        }

        type htmlElement = string;

        interface HintOptions {
            words?: string[];
            mentions?: string[];
            match: RegExp;
            search: (keyword: string, callback: (plausibleItems: string[]) => void) => void;
            template?: (item: string) => htmlElement;
            content?: (item: string) => htmlElement | JQuery.Node;
        }

        interface CodemirrorOptions {
            mode?: string;
            htmlNode?: boolean;
            lineNumbers?: boolean;
            theme?: string;
        }

        type popoverImageOptionsImagesize = 'imageSize100' | 'imageSize50' | 'imageSize25';
        type popoverImageOptionsFloat = 'floatLeft' | 'floatRight' | 'floatNone';
        type popoverImageOptionsRemove = 'removeMedia';
        type popoverImageDef = [
            ['imagesize', popoverImageOptionsImagesize[]],
            ['float', popoverImageOptionsFloat[]],
            ['remove', popoverImageOptionsRemove[]]
        ];

        type popoverLinkLinkOptions = 'linkDialogShow' | 'unlink';
        type popoverLinkDef = [
            ['link', popoverLinkLinkOptions[]]
        ];

        type popoverAirOptionsColor = 'color';
        type popoverAirOptionsFont = 'bold' | 'underline' | 'clear';
        type popoverAirOptionsPara = 'ul' | 'paragraph';
        type popoverAirOptionsTable = 'table';
        type popoverAirOptionsInsert = 'link' | 'picture';
        type popoverAirDef = [
            ['color', popoverAirOptionsColor],
            ['font', popoverAirOptionsFont],
            ['para', popoverAirOptionsPara],
            ['table', popoverAirOptionsTable],
            ['insert', popoverAirOptionsInsert]
        ];

        interface PopoverOptions {
            image?: popoverImageDef;
            link?: popoverLinkDef;
            air?: popoverAirDef;
        }

        interface ModuleOptions {
            options?: any; // todo
        }

        interface CreateLinkOptions {
            text: string;
            url: string;
            newWindow: boolean;
        }

        type EditImageCallback = ($image: JQuery.Node) => void;
    }

    interface JQuery {
        summernote(): JQuery;
        summernote(command: string): JQuery;
        summernote(options?: Summernote.Options): JQuery;
        summernote(command: string, markupString: string): JQuery;
        summernote(command: string, value: number): JQuery;
        summernote(command: string, node: JQuery.Node): JQuery;
        summernote(command: string, url: string, filename?: (string | Summernote.EditImageCallback)): JQuery;

        summernote(command: 'destroy'): JQuery;
        summernote(command: 'code', markupStr?: string): JQuery;
        summernote(command: 'editor.pasteHTML' | 'pasteHTML', markup: string): JQuery;

        // Basic API
        summernote(command: 'editor.createRange' | 'createRange'): JQuery;
        summernote(command: 'editor.saveRange' | 'saveRange'): JQuery;
        summernote(command: 'editor.restoreRange' | 'restoreRange'): JQuery;
        summernote(command: 'editor.undo' | 'undo'): JQuery;
        summernote(command: 'editor.redo' | 'redo'): JQuery;
        summernote(command: 'editor.focus' | 'focus'): JQuery;
        summernote(command: 'editor.isEmpty' | 'isEmpty'): boolean;
        summernote(command: 'reset'): JQuery;
        summernote(command: 'disable'): JQuery;
        summernote(command: 'enable'): JQuery;
        // Font style API
        summernote(fontStyle: 'editor.bold' | 'bold'): JQuery;
        summernote(fontStyle: 'editor.italic' | 'italic'): JQuery;
        summernote(fontStyle: 'editor.underline' | 'underline'): JQuery;
        summernote(fontStyle: 'editor.strikethrough' | 'strikethrough'): JQuery;
        summernote(command: 'editor.superscript' | 'superscript'): JQuery;
        summernote(command: 'editor.subscript' | 'subscript'): JQuery;
        summernote(command: 'editor.removeFormat' | 'removeFormat'): JQuery;
        summernote(command: 'backColor', color: string): JQuery;
        summernote(command: 'foreColor', color: string): JQuery;
        summernote(command: 'fontName', fontName: string): JQuery;
        summernote(command: 'editor.fontSize' | 'fontSize', fontSize: number): JQuery;
        // Paragraph API
        summernote(command: 'editor.justifyLeft' | 'justifyLeft'): JQuery;
        summernote(command: 'editor.justifyRight' | 'justifyRight'): JQuery;
        summernote(command: 'editor.justifyCenter' | 'justifyCenter'): JQuery;
        summernote(command: 'editor.justifyFull' | 'justifyFull'): JQuery;
        summernote(command: 'insertParagraph'): JQuery;
        summernote(command: 'editor.insertOrderedList' | 'insertOrderedList'): JQuery;
        summernote(command: 'editor.insertUnorderedList' | 'insertUnorderedList'): JQuery;
        summernote(command: 'editor.indent' | 'indent'): JQuery;
        summernote(command: 'editor.outdent' | 'outdent'): JQuery;
        summernote(command: 'formatPara'): JQuery;
        summernote(command: 'formatH1'): JQuery;
        summernote(command: 'formatH2'): JQuery;
        summernote(command: 'formatH3'): JQuery;
            summernote(command: 'formatH4'): JQuery;
        summernote(command: 'formatH5'): JQuery;
        summernote(command: 'formatH6'): JQuery;
        // Insertion API
        summernote(command: 'editor.insertImage' | 'insertImage', url: string, filename?: (string | Summernote.EditImageCallback)): JQuery;
        summernote(command: 'editor.insertNode' | 'insertNode', node: JQuery.Node): JQuery;
        summernote(command: 'editor.insertText' | 'insertText', text: string): JQuery;
        summernote(command: 'createLink', options: Summernote.CreateLinkOptions): JQuery;
        // TODO: Callbacks

        // TODO: Editor
        // editor.insertImagesOrCallback ??
        // editor.afterCommand ??
        // editor.resizeTo ??
        // editor.resize ??
        // editor.saveTarget ??
        // editor.isActivated ??
        // editor.formatBlock ??
        // editor.color ??
        // editor.lineHeight ??
        // editor.insertTable ??
        // editor.insertHorizontalRule ??
        // editor.floatMe ??
        // editor.removeMedia ??
        // editor.currentStyle ??
        // editor.getLinkInfo ??
        // editor.getSelectedText ??
    }
}

export {};


text:
package net.intelie.omnicron;

import java.time.temporal.Temporal;

public class StarField implements Field {
    private static final long serialVersionUID = 1L;

    @Override
    public boolean matches(Temporal date) {
        return true;
    }

    @Override
    public <T extends Temporal & Comparable<? super T>> T nextOrSame(T date) {
        return date;
    }

    @Override
    public <T extends Temporal & Comparable<? super T>> T prevOrSame(T date) {
        return date;
    }

    @Override
    public String toString() {
        return "*";
    }

    @Override
    public boolean equals(Object o) {
        return this == o || o != null && getClass() == o.getClass();
    }

    @Override
    public int hashCode() {
        return -1520988807;
    }
}


text:
package microsoft.exchange.webservices.data.misc;

import microsoft.exchange.webservices.data.core.EwsServiceXmlWriter;
import microsoft.exchange.webservices.data.core.EwsUtilities;
import microsoft.exchange.webservices.data.core.service.folder.Folder;
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceLocalException;

/**
 * Represents a folder Id provided by a Folder object.
 */
class FolderWrapper extends AbstractFolderIdWrapper {

  /**
   * The Folder object providing the Id.
   */
  private Folder folder;

  /**
   * Initializes a new instance of FolderWrapper.
   *
   * @param folder the folder
   * @throws ServiceLocalException the service local exception
   */
  protected FolderWrapper(Folder folder) throws ServiceLocalException {
    EwsUtilities.ewsAssert(folder != null, "FolderWrapper.ctor", "folder is null");
    EwsUtilities.ewsAssert(!folder.isNew(), "FolderWrapper.ctor", "folder does not have an Id");
    this.folder = folder;
  }

  /**
   * Obtains the Folder object associated with the wrapper.
   *
   * @return The Folder object associated with the wrapper
   */
  public Folder getFolder() {
    return this.folder;
  }

  /**
   * Writes the Id encapsulated in the wrapper to XML.
   *
   * @param writer the writer
   * @throws Exception the exception
   */
  protected void writeToXml(EwsServiceXmlWriter writer) throws Exception {
    this.folder.getId().writeToXml(writer);
  }
}


text:
<!DOCTYPE html>

<meta charset=utf-8>
<title>45 jmlr-2008-JNCC2: The Java Implementation Of Naive Credal Classifier 2    (Machine Learning Open Source Software Paper)</title>

jmlr jmlr2008 jmlr2008-45 jmlr2008-45-reference knowledge-graph by maker-knowledge-mining

45 jmlr-2008-JNCC2: The Java Implementation Of Naive Credal Classifier 2    (Machine Learning Open Source Software Paper)

Source: pdf

Author: Giorgio Corani, Marco Zaffalon

Abstract: JNCC2 implements the naive credal classifier 2 (NCC2). This is an extension of naive Bayes to imprecise probabilities that aims at delivering robust classifications also when dealing with small or incomplete data sets. Robustness is achieved by delivering set-valued classifications (that is, returning multiple classes) on the instances for which (i) the learning set is not informative enough to smooth the effect of choice of the prior density or (ii) the uncertainty arising from missing data prevents the reliable indication of a single class. JNCC2 is released under the GNU GPL license. Keywords: imprecise probabilities, missing data, naive Bayes, naive credal classifier 2, Java

reference text

G. Corani and M. Zaffalon. Learning reliable classifiers from small or incomplete data sets: the naive credal classifier 2. Journal of Machine Learning Research, 9:581–621, 2008. U. M. Fayyad and K. B. Irani. Multi-interval discretization of continuous-valued attributes for classification learning. In Proceedings of the 13th International Joint Conference on Artificial Intelligence, pages 1022–1027, San Francisco, CA, 1993. Morgan Kaufmann. R. J. A. Little and D. B. Rubin. Statistical Analysis with Missing Data. Wiley, New York, 1987. P. Walley. Statistical Reasoning With Imprecise Probabilities. Chapman and Hall, New York, 1991. I. H. Witten and E. Frank. Data Mining: Practical Machine Learning Tools and Techniques (2nd Edition). Morgan Kaufmann, 2005.  2638