/*
    tests/eigen.cpp -- automatic conversion of Eigen types

    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>

    All rights reserved. Use of this source code is governed by a
    BSD-style license that can be found in the LICENSE file.
*/

#include "pybind11_tests.h"
#include "constructor_stats.h"
#include <pybind11/eigen.h>
#include <pybind11/stl.h>

#if defined(_MSC_VER)
#  pragma warning(disable: 4996) // C4996: std::unary_negation is deprecated
#endif

#include <Eigen/Cholesky>

using MatrixXdR = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;

// Sets/resets a testing reference matrix to have values of 10*r + c, where r and c are the
// (1-based) row/column number.
template <typename M> void reset_ref(M &x) {
    for (int i = 0; i < x.rows(); i++) for (int j = 0; j < x.cols(); j++)
        x(i, j) = 11 + 10*i + j;
}

// Returns a static, column-major matrix
Eigen::MatrixXd &get_cm() {
    static Eigen::MatrixXd *x;
    if (!x) {
        x = new Eigen::MatrixXd(3, 3);
        reset_ref(*x);
    }
    return *x;
}
// Likewise, but row-major
MatrixXdR &get_rm() {
    static MatrixXdR *x;
    if (!x) {
        x = new MatrixXdR(3, 3);
        reset_ref(*x);
    }
    return *x;
}
// Resets the values of the static matrices returned by get_cm()/get_rm()
void reset_refs() {
    reset_ref(get_cm());
    reset_ref(get_rm());
}

// Returns element 2,1 from a matrix (used to test copy/nocopy)
double get_elem(Eigen::Ref<const Eigen::MatrixXd> m) { return m(2, 1); };

// Returns a matrix with 10*r + 100*c added to each matrix element (to help test that the matrix
// reference is referencing rows/columns correctly).
template <typename MatrixArgType> Eigen::MatrixXd adjust_matrix(MatrixArgType m) {
    Eigen::MatrixXd ret(m);
    for (int c = 0; c < m.cols(); c++) for (int r = 0; r < m.rows(); r++)
        ret(r, c) += 10*r + 100*c;
    return ret;
}

struct CustomOperatorNew {
    CustomOperatorNew() = default;

    Eigen::Matrix4d a = Eigen::Matrix4d::Zero();
    Eigen::Matrix4d b = Eigen::Matrix4d::Identity();

    EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
};

TEST_SUBMODULE(eigen, m) {
    using FixedMatrixR = Eigen::Matrix<float, 5, 6, Eigen::RowMajor>;
    using FixedMatrixC = Eigen::Matrix<float, 5, 6>;
    using DenseMatrixR = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
    using DenseMatrixC = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic>;
    using FourRowMatrixC = Eigen::Matrix<float, 4, Eigen::Dynamic>;
    using FourColMatrixC = Eigen::Matrix<float, Eigen::Dynamic, 4>;
    using FourRowMatrixR = Eigen::Matrix<float, 4, Eigen::Dynamic>;
    using FourColMatrixR = Eigen::Matrix<float, Eigen::Dynamic, 4>;
    using SparseMatrixR = Eigen::SparseMatrix<float, Eigen::RowMajor>;
    using SparseMatrixC = Eigen::SparseMatrix<float>;

    // various tests
    m.def("double_col", [](const Eigen::VectorXf &x) -> Eigen::VectorXf { return 2.0f * x; });
    m.def("double_row", [](const Eigen::RowVectorXf &x) -> Eigen::RowVectorXf { return 2.0f * x; });
    m.def("double_complex", [](const Eigen::VectorXcf &x) -> Eigen::VectorXcf { return 2.0f * x; });
    m.def("double_threec", [](py::EigenDRef<Eigen::Vector3f> x) { x *= 2; });
    m.def("double_threer", [](py::EigenDRef<Eigen::RowVector3f> x) { x *= 2; });
    m.def("double_mat_cm", [](Eigen::MatrixXf x) -> Eigen::MatrixXf { return 2.0f * x; });
    m.def("double_mat_rm", [](DenseMatrixR x) -> DenseMatrixR { return 2.0f * x; });

    // test_eigen_ref_to_python
    // Different ways of passing via Eigen::Ref; the first and second are the Eigen-recommended
    m.def("cholesky1", [](Eigen::Ref<MatrixXdR> x) -> Eigen::MatrixXd { return x.llt().matrixL(); });
    m.def("cholesky2", [](const Eigen::Ref<const MatrixXdR> &x) -> Eigen::MatrixXd { return x.llt().matrixL(); });
    m.def("cholesky3", [](const Eigen::Ref<MatrixXdR> &x) -> Eigen::MatrixXd { return x.llt().matrixL(); });
    m.def("cholesky4", [](Eigen::Ref<const MatrixXdR> x) -> Eigen::MatrixXd { return x.llt().matrixL(); });

    // test_eigen_ref_mutators
    // Mutators: these add some value to the given element using Eigen, but Eigen should be mapping into
    // the numpy array data and so the result should show up there.  There are three versions: one that
    // works on a contiguous-row matrix (numpy's default), one for a contiguous-column matrix, and one
    // for any matrix.
    auto add_rm = [](Eigen::Ref<MatrixXdR> x, int r, int c, double v) { x(r,c) += v; };
    auto add_cm = [](Eigen::Ref<Eigen::MatrixXd> x, int r, int c, double v) { x(r,c) += v; };

    // Mutators (Eigen maps into numpy variables):
    m.def("add_rm", add_rm); // Only takes row-contiguous
    m.def("add_cm", add_cm); // Only takes column-contiguous
    // Overloaded versions that will accept either row or column contiguous:
    m.def("add1", add_rm);
    m.def("add1", add_cm);
    m.def("add2", add_cm);
    m.def("add2", add_rm);
    // This one accepts a matrix of any stride:
    m.def("add_any", [](py::EigenDRef<Eigen::MatrixXd> x, int r, int c, double v) { x(r,c) += v; });

    // Return mutable references (numpy maps into eigen variables)
    m.def("get_cm_ref", []() { return Eigen::Ref<Eigen::MatrixXd>(get_cm()); });
    m.def("get_rm_ref", []() { return Eigen::Ref<MatrixXdR>(get_rm()); });
    // The same references, but non-mutable (numpy maps into eigen variables, but is !writeable)
    m.def("get_cm_const_ref", []() { return Eigen::Ref<const Eigen::MatrixXd>(get_cm()); });
    m.def("get_rm_const_ref", []() { return Eigen::Ref<const MatrixXdR>(get_rm()); });

    m.def("reset_refs", reset_refs); // Restores get_{cm,rm}_ref to original values

    // Increments and returns ref to (same) matrix
    m.def("incr_matrix", [](Eigen::Ref<Eigen::MatrixXd> m, double v) {
        m += Eigen::MatrixXd::Constant(m.rows(), m.cols(), v);
        return m;
    }, py::return_value_policy::reference);

    // Same, but accepts a matrix of any strides
    m.def("incr_matrix_any", [](py::EigenDRef<Eigen::MatrixXd> m, double v) {
        m += Eigen::MatrixXd::Constant(m.rows(), m.cols(), v);
        return m;
    }, py::return_value_policy::reference);

    // Returns an eigen slice of even rows
    m.def("even_rows", [](py::EigenDRef<Eigen::MatrixXd> m) {
        return py::EigenDMap<Eigen::MatrixXd>(
                m.data(), (m.rows() + 1) / 2, m.cols(),
                py::EigenDStride(m.outerStride(), 2 * m.innerStride()));
    }, py::return_value_policy::reference);

    // Returns an eigen slice of even columns
    m.def("even_cols", [](py::EigenDRef<Eigen::MatrixXd> m) {
        return py::EigenDMap<Eigen::MatrixXd>(
                m.data(), m.rows(), (m.cols() + 1) / 2,
                py::EigenDStride(2 * m.outerStride(), m.innerStride()));
    }, py::return_value_policy::reference);

    // Returns diagonals: a vector-like object with an inner stride != 1
    m.def("diagonal", [](const Eigen::Ref<const Eigen::MatrixXd> &x) { return x.diagonal(); });
    m.def("diagonal_1", [](const Eigen::Ref<const Eigen::MatrixXd> &x) { return x.diagonal<1>(); });
    m.def("diagonal_n", [](const Eigen::Ref<const Eigen::MatrixXd> &x, int index) { return x.diagonal(index); });

    // Return a block of a matrix (gives non-standard strides)
    m.def("block", [](const Eigen::Ref<const Eigen::MatrixXd> &x, int start_row, int start_col, int block_rows, int block_cols) {
        return x.block(start_row, start_col, block_rows, block_cols);
    });

    // test_eigen_return_references, test_eigen_keepalive
    // return value referencing/copying tests:
    class ReturnTester {
        Eigen::MatrixXd mat = create();
    public:
        ReturnTester() { print_created(this); }
        ~ReturnTester() { print_destroyed(this); }
        static Eigen::MatrixXd create() { return Eigen::MatrixXd::Ones(10, 10); }
        static const Eigen::MatrixXd createConst() { return Eigen::MatrixXd::Ones(10, 10); }
        Eigen::MatrixXd &get() { return mat; }
        Eigen::MatrixXd *getPtr() { return &mat; }
        const Eigen::MatrixXd &view() { return mat; }
        const Eigen::MatrixXd *viewPtr() { return &mat; }
        Eigen::Ref<Eigen::MatrixXd> ref() { return mat; }
        Eigen::Ref<const Eigen::MatrixXd> refConst() { return mat; }
        Eigen::Block<Eigen::MatrixXd> block(int r, int c, int nrow, int ncol) { return mat.block(r, c, nrow, ncol); }
        Eigen::Block<const Eigen::MatrixXd> blockConst(int r, int c, int nrow, int ncol) const { return mat.block(r, c, nrow, ncol); }
        py::EigenDMap<Eigen::Matrix2d> corners() { return py::EigenDMap<Eigen::Matrix2d>(mat.data(),
                    py::EigenDStride(mat.outerStride() * (mat.outerSize()-1), mat.innerStride() * (mat.innerSize()-1))); }
        py::EigenDMap<const Eigen::Matrix2d> cornersConst() const { return py::EigenDMap<const Eigen::Matrix2d>(mat.data(),
                    py::EigenDStride(mat.outerStride() * (mat.outerSize()-1), mat.innerStride() * (mat.innerSize()-1))); }
    };
    using rvp = py::return_value_policy;
    py::class_<ReturnTester>(m, "ReturnTester")
        .def(py::init<>())
        .def_static("create", &ReturnTester::create)
        .def_static("create_const", &ReturnTester::createConst)
        .def("get", &ReturnTester::get, rvp::reference_internal)
        .def("get_ptr", &ReturnTester::getPtr, rvp::reference_internal)
        .def("view", &ReturnTester::view, rvp::reference_internal)
        .def("view_ptr", &ReturnTester::view, rvp::reference_internal)
        .def("copy_get", &ReturnTester::get)   // Default rvp: copy
        .def("copy_view", &ReturnTester::view) //         "
        .def("ref", &ReturnTester::ref) // Default for Ref is to reference
        .def("ref_const", &ReturnTester::refConst) // Likewise, but const
        .def("ref_safe", &ReturnTester::ref, rvp::reference_internal)
        .def("ref_const_safe", &ReturnTester::refConst, rvp::reference_internal)
        .def("copy_ref", &ReturnTester::ref, rvp::copy)
        .def("copy_ref_const", &ReturnTester::refConst, rvp::copy)
        .def("block", &ReturnTester::block)
        .def("block_safe", &ReturnTester::block, rvp::reference_internal)
        .def("block_const", &ReturnTester::blockConst, rvp::reference_internal)
        .def("copy_block", &ReturnTester::block, rvp::copy)
        .def("corners", &ReturnTester::corners, rvp::reference_internal)
        .def("corners_const", &ReturnTester::cornersConst, rvp::reference_internal)
        ;

    // test_special_matrix_objects
    // Returns a DiagonalMatrix with diagonal (1,2,3,...)
    m.def("incr_diag", [](int k) {
        Eigen::DiagonalMatrix<int, Eigen::Dynamic> m(k);
        for (int i = 0; i < k; i++) m.diagonal()[i] = i+1;
        return m;
    });

    // Returns a SelfAdjointView referencing the lower triangle of m
    m.def("symmetric_lower", [](const Eigen::MatrixXi &m) {
            return m.selfadjointView<Eigen::Lower>();
    });
    // Returns a SelfAdjointView referencing the lower triangle of m
    m.def("symmetric_upper", [](const Eigen::MatrixXi &m) {
            return m.selfadjointView<Eigen::Upper>();
    });

    // Test matrix for various functions below.
    Eigen::MatrixXf mat(5, 6);
    mat << 0,  3,  0,  0,  0, 11,
           22, 0,  0,  0, 17, 11,
           7,  5,  0,  1,  0, 11,
           0,  0,  0,  0,  0, 11,
           0,  0, 14,  0,  8, 11;

    // test_fixed, and various other tests
    m.def("fixed_r", [mat]() -> FixedMatrixR { return FixedMatrixR(mat); });
    m.def("fixed_r_const", [mat]() -> const FixedMatrixR { return FixedMatrixR(mat); });
    m.def("fixed_c", [mat]() -> FixedMatrixC { return FixedMatrixC(mat); });
    m.def("fixed_copy_r", [](const FixedMatrixR &m) -> FixedMatrixR { return m; });
    m.def("fixed_copy_c", [](const FixedMatrixC &m) -> FixedMatrixC { return m; });
    // test_mutator_descriptors
    m.def("fixed_mutator_r", [](Eigen::Ref<FixedMatrixR>) {});
    m.def("fixed_mutator_c", [](Eigen::Ref<FixedMatrixC>) {});
    m.def("fixed_mutator_a", [](py::EigenDRef<FixedMatrixC>) {});
    // test_dense
    m.def("dense_r", [mat]() -> DenseMatrixR { return DenseMatrixR(mat); });
    m.def("dense_c", [mat]() -> DenseMatrixC { return DenseMatrixC(mat); });
    m.def("dense_copy_r", [](const DenseMatrixR &m) -> DenseMatrixR { return m; });
    m.def("dense_copy_c", [](const DenseMatrixC &m) -> DenseMatrixC { return m; });
    // test_sparse, test_sparse_signature
    m.def("sparse_r", [mat]() -> SparseMatrixR { return Eigen::SparseView<Eigen::MatrixXf>(mat); });
    m.def("sparse_c", [mat]() -> SparseMatrixC { return Eigen::SparseView<Eigen::MatrixXf>(mat); });
    m.def("sparse_copy_r", [](const SparseMatrixR &m) -> SparseMatrixR { return m; });
    m.def("sparse_copy_c", [](const SparseMatrixC &m) -> SparseMatrixC { return m; });
    // test_partially_fixed
    m.def("partial_copy_four_rm_r", [](const FourRowMatrixR &m) -> FourRowMatrixR { return m; });
    m.def("partial_copy_four_rm_c", [](const FourColMatrixR &m) -> FourColMatrixR { return m; });
    m.def("partial_copy_four_cm_r", [](const FourRowMatrixC &m) -> FourRowMatrixC { return m; });
    m.def("partial_copy_four_cm_c", [](const FourColMatrixC &m) -> FourColMatrixC { return m; });

    // test_cpp_casting
    // Test that we can cast a numpy object to a Eigen::MatrixXd explicitly
    m.def("cpp_copy", [](py::handle m) { return m.cast<Eigen::MatrixXd>()(1, 0); });
    m.def("cpp_ref_c", [](py::handle m) { return m.cast<Eigen::Ref<Eigen::MatrixXd>>()(1, 0); });
    m.def("cpp_ref_r", [](py::handle m) { return m.cast<Eigen::Ref<MatrixXdR>>()(1, 0); });
    m.def("cpp_ref_any", [](py::handle m) { return m.cast<py::EigenDRef<Eigen::MatrixXd>>()(1, 0); });

    // test_nocopy_wrapper
    // Test that we can prevent copying into an argument that would normally copy: First a version
    // that would allow copying (if types or strides don't match) for comparison:
    m.def("get_elem", &get_elem);
    // Now this alternative that calls the tells pybind to fail rather than copy:
    m.def("get_elem_nocopy", [](Eigen::Ref<const Eigen::MatrixXd> m) -> double { return get_elem(m); },
            py::arg().noconvert());
    // Also test a row-major-only no-copy const ref:
    m.def("get_elem_rm_nocopy", [](Eigen::Ref<const Eigen::Matrix<long, -1, -1, Eigen::RowMajor>> &m) -> long { return m(2, 1); },
            py::arg().noconvert());

    // test_issue738
    // Issue #738: 1xN or Nx1 2D matrices were neither accepted nor properly copied with an
    // incompatible stride value on the length-1 dimension--but that should be allowed (without
    // requiring a copy!) because the stride value can be safely ignored on a size-1 dimension.
    m.def("iss738_f1", &adjust_matrix<const Eigen::Ref<const Eigen::MatrixXd> &>, py::arg().noconvert());
    m.def("iss738_f2", &adjust_matrix<const Eigen::Ref<const Eigen::Matrix<double, -1, -1, Eigen::RowMajor>> &>, py::arg().noconvert());

    // test_issue1105
    // Issue #1105: when converting from a numpy two-dimensional (Nx1) or (1xN) value into a dense
    // eigen Vector or RowVector, the argument would fail to load because the numpy copy would fail:
    // numpy won't broadcast a Nx1 into a 1-dimensional vector.
    m.def("iss1105_col", [](Eigen::VectorXd) { return true; });
    m.def("iss1105_row", [](Eigen::RowVectorXd) { return true; });

    // test_named_arguments
    // Make sure named arguments are working properly:
    m.def("matrix_multiply", [](const py::EigenDRef<const Eigen::MatrixXd> A, const py::EigenDRef<const Eigen::MatrixXd> B)
            -> Eigen::MatrixXd {
        if (A.cols() != B.rows()) throw std::domain_error("Nonconformable matrices!");
        return A * B;
    }, py::arg("A"), py::arg("B"));

    // test_custom_operator_new
    py::class_<CustomOperatorNew>(m, "CustomOperatorNew")
        .def(py::init<>())
        .def_readonly("a", &CustomOperatorNew::a)
        .def_readonly("b", &CustomOperatorNew::b);

    // test_eigen_ref_life_support
    // In case of a failure (the caster's temp array does not live long enough), creating
    // a new array (np.ones(10)) increases the chances that the temp array will be garbage
    // collected and/or that its memory will be overridden with different values.
    m.def("get_elem_direct", [](Eigen::Ref<const Eigen::VectorXd> v) {
        py::module::import("numpy").attr("ones")(10);
        return v(5);
    });
    m.def("get_elem_indirect", [](std::vector<Eigen::Ref<const Eigen::VectorXd>> v) {
        py::module::import("numpy").attr("ones")(10);
        return v[0](5);
    });
}


//=============================================================================
// Info, the root of all information holding classes.
//=============================================================================
class Info extends Actor
	abstract
	hidecategories(Movement,Collision,Lighting,LightColor,Karma,Force)
	native;

//------------------------------------------------------------------------------
// Structs for reporting server state data

struct native export KeyValuePair
{
	var() string Key;
	var() string Value;
};

//dkaplan:  Note that future patches to SWAT should NOT change this struct
//  Rather, additional player information should be sent as item(s) in the PlayerInfo array
//
//  This will ensure both forwards and backwards compatibility is maintained for serialization purposes
//
struct native export PlayerResponseLine
{
	var() int PlayerNum;
	var() int PlayerID;
	var() string PlayerName;
	var() int Ping;
	var() int Score;
	var() int StatsID;
	var() array<KeyValuePair> PlayerInfo;

};

//dkaplan:  Note that future patches to SWAT should NOT change this struct
//  Rather, additional server information should be sent as item(s) in the ServerInfo array
//
//  This will ensure both forwards and backwards compatibility is maintained for serialization purposes
//
struct native export ServerResponseLine
{
	var() int ServerID;
	var() string IP;
	var() int Port;
	var() int QueryPort;
	var() string ServerName;
	var() string MapName;
	var() string GameType;
#if IG_SWAT
    var() string GameVersion;
    var() string ModName;
#endif
	var() int CurrentPlayers;
	var() int MaxPlayers;
	var() int Ping;

	var() array<KeyValuePair> ServerInfo;
	var() array<PlayerResponseLine> PlayerInfo;
};

defaultproperties
{
	RemoteRole=ROLE_None
	NetUpdateFrequency=10
     bHidden=True
	 bOnlyDirtyReplication=true
	 bSkipActorPropertyReplication=true
}


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.brooklyn.test.osgi.entities;

import org.apache.brooklyn.core.entity.AbstractApplication;
import org.apache.brooklyn.core.entity.StartableApplication;

public class SimpleApplicationImpl extends AbstractApplication implements StartableApplication, SimpleApplication {

}


program TeeGrid_VCL_Ticker;

uses
  Vcl.Forms,
  Unit_Ticker in 'Unit_Ticker.pas' {TickerForm};

{$R *.res}

begin
  {$IFOPT D+}
  ReportMemoryLeaksOnShutdown:=True;
  {$ENDIF}
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TTickerForm, TickerForm);
  Application.Run;
end.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Package jjil.j2se
</TITLE>

<META NAME="date" CONTENT="2008-08-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Package
jjil.j2se

No usage of jjil.j2se

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var testing_1 = require("@angular/core/testing");
var first_component_1 = require("../app/ondemand/first.component");
var product_model_1 = require("../app/model/product.model");
var rest_datasource_1 = require("../app/model/rest.datasource");
var Observable_1 = require("rxjs/Observable");
require("rxjs/add/observable/from");
var core_1 = require("@angular/core");
var MockDataSource = (function () {
    function MockDataSource() {
        this.data = [
            new product_model_1.Product(1, "test1", "Soccer", 100),
            new product_model_1.Product(2, "test2", "Chess", 100),
            new product_model_1.Product(3, "test3", "Soccer", 100),
        ];
    }
    MockDataSource.prototype.getData = function () {
        var _this = this;
        return new Observable_1.Observable(function (obs) {
            setTimeout(function () { return obs.next(_this.data); }, 1000);
        });
    };
    MockDataSource = __decorate([
        core_1.Injectable(),
        __metadata('design:paramtypes', [])
    ], MockDataSource);
    return MockDataSource;
}());
describe("FirstComponent", function () {
    var fixture;
    var component;
    var dataSource = new MockDataSource();
    beforeEach(testing_1.async(function () {
        testing_1.TestBed.configureTestingModule({
            declarations: [first_component_1.FirstComponent],
            providers: [
                { provide: rest_datasource_1.RestDataSource, useValue: dataSource }
            ]
        });
        testing_1.TestBed.compileComponents().then(function () {
            fixture = testing_1.TestBed.createComponent(first_component_1.FirstComponent);
            component = fixture.componentInstance;
        });
    }));
    it("performs async op", function () {
        dataSource.data.push(new product_model_1.Product(100, "test100", "Soccer", 100));
        fixture.detectChanges();
        fixture.whenStable().then(function () {
            expect(component.getProducts().length).toBe(3);
        });
    });
});


SUBDIRS = Addition Asteroid Bagels Bandit Bitz "Black Match" Blackjack "Card Dealer" "Chess Clock" Clock "Code Test" Craps Duel "Farmer Brown" Hi-Lo Horserace "Key Train" "Kim Nim" Kim-Tac-Toe "Lunar Lander" Multi-Maze "Music Box" "Ping Pong" Quick Reverse Teaser Timer Wumpus

all:
	@for i in $(SUBDIRS); do \
	echo "make all in $$i..."; \
	(cd "$$i"; $(MAKE) $(MFLAGS) all); done

clean:
	@for i in $(SUBDIRS); do \
	echo "Clearing in $$i..."; \
	(cd "$$i"; $(MAKE) $(MFLAGS) clean); done


package common

import (
	"crypto/aes"
	"crypto/cipher"
	"encoding/binary"
)

// AES CTR stream used as a replacement for SHAKE in Dilithium[1234]-AES.
type AesStream struct {
	c       cipher.Block
	counter uint64
	nonce   uint16
}

// Create a new AesStream as a replacement of SHAKE128.  (Note that
// not all occurrences of SHAKE are replaced by AES in the AES-variants).
func NewAesStream128(key *[32]byte, nonce uint16) AesStream {
	c, _ := aes.NewCipher(key[:])
	return AesStream{c: c, nonce: nonce}
}

// Create a new AesStream as a replacement of SHAKE256.  (Note that
// not all occurrences of SHAKE are replaced by AES in the AES-variants.)
//
// Yes, in an AES mode, Dilithium throws away the last 16 bytes of a seed ...
// See the remark at the end of the caption of Figure 4 in the Round 2 spec.
func NewAesStream256(key *[48]byte, nonce uint16) AesStream {
	c, _ := aes.NewCipher(key[:32])
	return AesStream{c: c, nonce: nonce}
}

// Squeeze some more blocks from the AES CTR stream into buf.
//
// Assumes length of buf is a multiple of 16.
func (s *AesStream) SqueezeInto(buf []byte) {
	var tmp [16]byte
	binary.LittleEndian.PutUint16(tmp[:], s.nonce)

	for len(buf) != 0 {
		binary.BigEndian.PutUint64(tmp[8:], s.counter)
		s.counter++
		s.c.Encrypt(buf, tmp[:])
		buf = buf[16:]
	}
}


/*
 * Copyright © 2014 Intel Corporation
 *
 * 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 (including the next
 * paragraph) 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.
 *
 * Generated by: intel-gpu-tools-1.19-177-g68e2eab2
 */

#include "intel_renderstate.h"

static const u32 gen9_null_state_relocs[] = {
	0x000007a8,
	0x000007b4,
	0x000007bc,
	0x000007cc,
	-1,
};

static const u32 gen9_null_state_batch[] = {
	0x7a000004,
	0x01000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x69040300,
	0x78140000,
	0x04000000,
	0x7820000a,
	0x00000000,
	0x00000000,
	0x80000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78130002,
	0x00000000,
	0x00000000,
	0x02001808,
	0x781f0004,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78510009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78100007,
	0x00000000,
	0x00000000,
	0x00010000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x781b0007,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000800,
	0x00000000,
	0x78110008,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x781e0003,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x781d0009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78120002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78500003,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x781c0002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x780c0000,
	0x00000000,
	0x78520003,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78300000,
	0x08010040,
	0x78310000,
	0x1e000000,
	0x78320000,
	0x1e000000,
	0x78330000,
	0x1e000000,
	0x79190002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x791a0002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x791b0002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79120000,
	0x00000000,
	0x79130000,
	0x00000000,
	0x79140000,
	0x00000000,
	0x79150000,
	0x00000000,
	0x79160000,
	0x00000000,
	0x78150009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78190009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x781a0009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78160009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78170009,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78490001,
	0x00000000,
	0x00000000,
	0x784a0000,
	0x00000000,
	0x784b0000,
	0x00000004,
	0x79170101,
	0x00000000,
	0x00000080,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79180006,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79180006,
	0x20000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79180006,
	0x40000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79180006,
	0x60000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x61010011,
	0x00000001,	 /* reloc */
	0x00000000,
	0x00000000,
	0x00000001,	 /* reloc */
	0x00000000,
	0x00000001,	 /* reloc */
	0x00000000,
	0x00000001,
	0x00000000,
	0x00000001,	 /* reloc */
	0x00000000,
	0x00001001,
	0x00001001,
	0x00000001,
	0x00001001,
	0x00000000,
	0x00000000,
	0x00000000,
	0x61020001,
	0x00000000,
	0x00000000,
	0x79000002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78050006,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79040002,
	0x00000000,
	0x00000000,
	0x00000000,
	0x79040002,
	0x40000000,
	0x00000000,
	0x00000000,
	0x79040002,
	0x80000000,
	0x00000000,
	0x00000000,
	0x79040002,
	0xc0000000,
	0x00000000,
	0x00000000,
	0x79080001,
	0x00000000,
	0x00000000,
	0x790a0001,
	0x00000000,
	0x00000000,
	0x78060003,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78070003,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78040001,
	0x00000000,
	0x00000000,
	0x79110000,
	0x00000000,
	0x780d0000,
	0x00000000,
	0x79060000,
	0x00000000,
	0x7907001f,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x7902000f,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x790c000f,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x780a0003,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78080083,
	0x00004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x04004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x08004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x0c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x10004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x14004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x18004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x1c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x20004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x24004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x28004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x2c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x30004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x34004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x38004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x3c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x40004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x44004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x48004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x4c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x50004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x54004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x58004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x5c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x60004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x64004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x68004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x6c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x70004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x74004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x7c004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x80004000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78090043,
	0x02000000,
	0x22220000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x78550003,
	0x0000000f,
	0x00000000,
	0x00000000,
	0x00000000,
	0x680b0001,
	0x780e0000,
	0x00000e01,
	0x78240000,
	0x00000e41,
	0x784f0000,
	0x80000100,
	0x784d0000,
	0x40000000,
	0x782b0000,
	0x00000000,
	0x782c0000,
	0x00000000,
	0x782d0000,
	0x00000000,
	0x782e0000,
	0x00000000,
	0x782f0000,
	0x00000000,
	0x780f0000,
	0x00000000,
	0x78230000,
	0x00000ea0,
	0x78210000,
	0x00000ec0,
	0x78260000,
	0x00000000,
	0x78270000,
	0x00000000,
	0x78280000,
	0x00000000,
	0x78290000,
	0x00000000,
	0x782a0000,
	0x00000000,
	0x7b000005,
	0x00000004,
	0x00000001,
	0x00000000,
	0x00000001,
	0x00000000,
	0x00000000,
	0x05000000,	 /* cmds end */
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,	 /* state start */
	0x00000000,
	0x3f800000,
	0x3f800000,
	0x3f800000,
	0x3f800000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,
	0x00000000,	 /* state end */
};

RO_RENDERSTATE(9);


/**************************************************************************//**
 *
 * @file
 * @brief x86_64_accton_csp9250 Configuration Header
 *
 * @addtogroup x86_64_accton_csp9250-config
 * @{
 *
 *****************************************************************************/
#ifndef __X86_64_ACCTON_CSP9250_CONFIG_H__
#define __X86_64_ACCTON_CSP9250_CONFIG_H__

#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG
#include <global_custom_config.h>
#endif
#ifdef x86_64_accton_csp9250_INCLUDE_CUSTOM_CONFIG
#include <x86_64_accton_csp9250_custom_config.h>
#endif

/* <auto.start.cdefs(X86_64_ACCTON_CSP9250_CONFIG_HEADER).header> */
#include <AIM/aim.h>
/**
 * X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_LOGGING
 *
 * Include or exclude logging. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_LOGGING
#define X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_LOGGING 1
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_LOG_OPTIONS_DEFAULT
 *
 * Default enabled log options. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_LOG_OPTIONS_DEFAULT
#define X86_64_ACCTON_CSP9250_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_LOG_BITS_DEFAULT
 *
 * Default enabled log bits. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_LOG_BITS_DEFAULT
#define X86_64_ACCTON_CSP9250_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_LOG_CUSTOM_BITS_DEFAULT
 *
 * Default enabled custom log bits. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_LOG_CUSTOM_BITS_DEFAULT
#define X86_64_ACCTON_CSP9250_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_PORTING_STDLIB
 *
 * Default all porting macros to use the C standard libraries. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_PORTING_STDLIB
#define X86_64_ACCTON_CSP9250_CONFIG_PORTING_STDLIB 1
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
 *
 * Include standard library headers for stdlib porting macros. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
#define X86_64_ACCTON_CSP9250_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_ACCTON_CSP9250_CONFIG_PORTING_STDLIB
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_UCLI
 *
 * Include generic uCli support. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_UCLI
#define X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_UCLI 0
#endif

/**
 * X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
 *
 * Assume chassis fan direction is the same as the PSU fan direction. */

#ifndef X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
#define X86_64_ACCTON_CSP9250_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0
#endif

/**
 * All compile time options can be queried or displayed
 */

/** Configuration settings structure. */
typedef struct x86_64_accton_csp9250_config_settings_s {
    /** name */
    const char* name;
    /** value */
    const char* value;
} x86_64_accton_csp9250_config_settings_t;

/** Configuration settings table. */
/** x86_64_accton_csp9250_config_settings table. */
extern x86_64_accton_csp9250_config_settings_t x86_64_accton_csp9250_config_settings[];

/**
 * @brief Lookup a configuration setting.
 * @param setting The name of the configuration option to lookup.
 */
const char* x86_64_accton_csp9250_config_lookup(const char* setting);

/**
 * @brief Show the compile-time configuration.
 * @param pvs The output stream.
 */
int x86_64_accton_csp9250_config_show(struct aim_pvs_s* pvs);

/* <auto.end.cdefs(X86_64_ACCTON_CSP9250_CONFIG_HEADER).header> */

#include "x86_64_accton_csp9250_porting.h"

#endif /* __X86_64_ACCTON_CSP9250_CONFIG_H__ */
/* @} */


vertical_model{
    model_name: "./";
    model_type: "CaffeNet";
    input_blob: "data_org";
    output_blob: "prob";
    weight_file: "models/rcg_all/2018-04-03/vertical/baidu_iter_250000.caffemodel";
    proto_file: "models/rcg_all/2018-04-03/vertical/deploy.prototxt";
    classify_threshold: 0.5;
    classify_resize_width: 32;
    classify_resize_height: 96;
    mean_r: 69.06;
    mean_g: 66.58;
    mean_b: 66.56;
    is_bgr: false;
    scale: 0.01
}

quadrate_model{
    model_name: "./";
    model_type: "CaffeNet";
    input_blob: "data_org";
    output_blob: "prob";
    weight_file: "models/rcg_all/2018-04-03/quadrate/baidu_iter_200000.caffemodel";
    proto_file: "models/rcg_all/2018-04-03/quadrate/deploy.prototxt";
    classify_threshold: 0.5;
    classify_resize_width: 64;
    classify_resize_height: 64;
    mean_r: 69.06;
    mean_g: 66.58;
    mean_b: 66.56;
    is_bgr: false;
    scale: 0.01
}

horizontal_model{
    model_name: "./";
    model_type: "CaffeNet";
    input_blob: "data_org";
    output_blob: "prob";
    weight_file: "models/rcg_all/2018-04-03/horizontal/baidu_iter_200000.caffemodel";
    proto_file: "models/rcg_all/2018-04-03/horizontal/deploy.prototxt";
    classify_threshold: 0.5;
    classify_resize_width: 96;
    classify_resize_height: 32;
    mean_r: 69.06;
    mean_g: 66.58;
    mean_b: 66.56;
    is_bgr: false;
    scale: 0.01
}


<?xml version="1.0" encoding="UTF-8"?>
<ObjectDefinition xmlns:xi="http://www.w3.org/2001/XInclude" type="frm">
	<Document type="default">
		<xi:include href="../../Services/Object/LuceneDataSource.xml" />
		<xi:include href="../../Services/Tagging/LuceneDataSource.xml" />
	</Document>
	<Document type="subItem">
		<DataSource type="JDBC" action="create">
			<Query>
				SELECT 'frm' type,thr_subject,thr_author_id, thr_pk, top_frm_fk
				FROM frm_data JOIN frm_threads ON top_pk = thr_top_fk
				WHERE top_frm_fk IN (?)
			</Query>
			<Param format="list" type="int" value="objId" />
			<Field store="YES" index="ANALYZED" column="thr_subject" type="text" name="propertyMedium" />
			<Field store="YES" index="NOT_ANALYZED" column="thr_author_id" type="integer" name="owner" />
			<Field store="YES" index="NOT_ANALYZED" column="thr_pk" type="integer" name="subItem" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="top_frm_fk" type="integer" name="objId" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="type" type="text" name="type" />
			<DataSource type="JDBC" action="append">
				<Query>
					SELECT pos_author_id, pos_message, pos_subject
					FROM frm_posts
					JOIN frm_data ON pos_top_fk = top_pk
					WHERE pos_thr_fk IN (?)
				</Query>
				<Param format="single" type="int" value="thr_pk" />
				<Field store="YES" index="ANALYZED" column="pos_message" type="text" name="content">
					<Transformer name="QuotingSanitizer" />
				</Field>
				<Field store="YES" index="ANALYZED" column="pos_subject" type="text" name="propertyLow" />
				<Field store="YES" index="NOT_ANALYZED" column="pos_author_id" type="integer" name="owner" />
			</DataSource>
		</DataSource>
	</Document>
</ObjectDefinition>


<!doctype html>

<title>CodeMirror: Html Embedded Scripts mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">

<link rel="stylesheet" href="../../lib/codemirror.css">

CodeMirror

Home

Manual

Code

Language modes

Html Embedded Scripts

Html Embedded Scripts mode

<form><textarea id="code" name="code">
<%
function hello(who) {
	return "Hello " + who;
}
%>
This is an example of EJS (embedded javascript)

The program says <%= hello("world") %>.

</textarea></form>

Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
    JavaScript, CSS and XML.
Other dependancies include those of the scriping language chosen.

MIME types defined: application/x-aspx (ASP.NET),
    application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)


"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Dies ist ein wichtiges Update. Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?";

"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?";

"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ kann nicht aktualisiert werden, da es aus dem Downloads-Order, oder von einer DMG Datei oder Laufwerk ohne Schreibzugriff gestartet wurde. Kopiere %1$@ in den Programmeordner, starte es von dort aus und versuche es erneut zu aktualisieren.";

"%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zurzeit die neueste verfügbare Version.";

/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ ist verfügbar – du verwendest Version %3$@. Möchtest du die neue Version jetzt laden?";

/* Description text for SUUpdateAlert when the update informational with no download. */
"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ ist verfügbar – du verwendest Version %3$@. Möchtest du mehr über dieses Update erfahren?";

"%@ downloaded" = "%@ geladen";

"%@ of %@" = "%1$@ von %2$@";

"A new version of %@ is available!" = "Eine neue Version von %@ ist verfügbar!";

"A new version of %@ is ready to install!" = "Eine neue Version von %@ steht zur Installation bereit!";

"An error occurred in retrieving update information. Please try again later." = "Beim Laden der Updateinformationen trat ein Fehler auf. Bitte versuche es später erneut.";

"An error occurred while downloading the update. Please try again later." = "Beim Laden des Updates ist ein Fehler aufgetreten. Bitte versuche es später erneut.";

"An error occurred while extracting the archive. Please try again later." = "Beim Entpacken des Archivs ist ein Fehler aufgetreten. Bitte versuche es später erneut.";

"An error occurred while installing the update. Please try again later." = "Beim Installieren des Updates ist ein Fehler aufgetreten. Bitte versuche es später erneut.";

"An error occurred while parsing the update feed." = "Beim Lesen der Updateinformationen ist ein Fehler aufgetreten.";

"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "Beim Neustart von %1$@ ist ein Fehler aufgetreten. Die neue Version von %1$@ steht beim nächsten Programmstart zur Verfügung.";

"An important update to %@ is ready to install" = "Ein wichtiges Update von %@ steht zur Installation bereit";

/* the unit for bytes */
"B" = "B";

"Cancel" = "Abbrechen";

"Cancel Update" = "Aktualisierung abbrechen";

"Checking for updates..." = "Nach Updates suchen …";

/* Take care not to overflow the status window. */
"Downloading update..." = "Update laden …";

/* Take care not to overflow the status window. */
"Extracting update..." = "Update entpacken …";

/* the unit for gigabytes */
"GB" = "GB";

"Install and Relaunch" = "Installieren und neu starten";

/* Take care not to overflow the status window. */
"Installing update..." = "Update installieren …";

/* the unit for kilobytes */
"KB" = "KB";

/* the unit for megabytes */
"MB" = "MB";

"OK" = "OK";

"Ready to Install" = "Bereit zum Installieren";

"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Soll %1$@ automatisch nach Updates suchen? Du kannst im %1$@-Menü auch manuell nach Updates suchen.";

"The update is improperly signed." = "Das Update ist nicht ordnungsgemäß signiert.";

"Update Error!" = "Fehler beim Aktualisieren!";

"Updating %@" = "Aktualisierung von %@";

"You already have the newest version of %@." = "Du hast bereits die neueste Version von %@.";

"You're up-to-date!" = "Du bist auf dem neuesten Stand!";

/* Alternative name for "Install" button if we have a paid update or other update
	without a download but with a URL. */

"Learn More..." = "Mehr über …";


#ifndef _LINUX_SOCKET_H
#define _LINUX_SOCKET_H

/*
 * Desired design of maximum size and alignment (see RFC2553)
 */
#define _K_SS_MAXSIZE	128	/* Implementation specific max size */
#define _K_SS_ALIGNSIZE	(__alignof__ (struct sockaddr *))
				/* Implementation specific desired alignment */

typedef unsigned short __kernel_sa_family_t;

struct __kernel_sockaddr_storage {
	__kernel_sa_family_t	ss_family;		/* address family */
	/* Following field(s) are implementation specific */
	char		__data[_K_SS_MAXSIZE - sizeof(unsigned short)];
				/* space to achieve desired size, */
				/* _SS_MAXSIZE value minus size of ss_family */
} __attribute__ ((aligned(_K_SS_ALIGNSIZE)));	/* force desired alignment */

#endif /* _LINUX_SOCKET_H */


public class Solution {
       public int NumIslands(char[][] grid)
        {
            int islandCount = 0;
            for (int y = 0; y < grid.Length; y++)
            {
                for (int x = 0; x < grid[y].Length; x++)
                {
                    if (grid[y][x] == '1')
                    {
                        TraceIsland(grid, y, x);
                        islandCount++;
                    }
                }
            }

            return islandCount;
        }

        public void TraceIsland(char[][] grid, int y, int x)
        {
            if (y < 0 || x < 0 || y >= grid.Length || x >= grid[y].Length)
            {
                return;
            }
            if (grid[y][x] == '1')
            {
                grid[y][x] = '2';
                TraceIsland(grid, y + 1, x);
                TraceIsland(grid, y - 1, x);
                TraceIsland(grid, y, x + 1);
                TraceIsland(grid, y, x - 1);
            }
            else
            {
                return;
            }
        }
}


swagger: '2.0'
schemes:
  - https
host: management.azure.com
info:
  description: The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.
  title: NetworkManagementClient
  version: '2019-08-01'
  x-apisguru-categories:
    - cloud
  x-logo:
    url: 'https://assets.onestore.ms/cdnfiles/onestorerolling-1606-01000/shell/v3/images/logo/microsoft.png'
  x-origin:
    - format: swagger
      url: 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/network/resource-manager/Microsoft.Network/stable/2019-08-01/azureFirewallFqdnTag.json'
      version: '2.0'
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: network-azureFirewallFqdnTag
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: 'https://login.microsoftonline.com/common/oauth2/authorize'
    description: Azure Active Directory OAuth2 Flow.
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
paths:
  '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags':
    get:
      description: Gets all the Azure Firewall FQDN Tags in a subscription.
      operationId: AzureFirewallFqdnTags_ListAll
      parameters:
        - description: Client API version.
          in: query
          name: api-version
          required: true
          type: string
        - description: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        '200':
          description: Success. The operation returns a list of Azure Firewall FQDN Tag resources.
          schema:
            $ref: '#/definitions/AzureFirewallFqdnTagListResult'
      tags:
        - AzureFirewallFqdnTags
      x-ms-examples:
        List all Azure Firewall FQDN Tags for a given subscription:
          parameters:
            api-version: '2019-08-01'
            subscriptionId: subid
          responses:
            '200':
              body:
                value:
                  - etag: w/\00000000-0000-0000-0000-000000000000\
                    id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewallFqdnTags/azfwfqdntag
                    location: West US
                    name: azfwfqdntag
                    properties:
                      fqdnTagName: azfwfqdntag
                      provisioningState: Succeeded
                    tags:
                      key1: value1
                    type: Microsoft.Network/azureFirewallFqdnTags
      x-ms-pageable:
        nextLinkName: nextLink
definitions:
  AzureFirewallFqdnTag:
    allOf:
      - description: Common resource representation.
        properties:
          id:
            description: Resource ID.
            type: string
          location:
            description: Resource location.
            type: string
          name:
            description: Resource name.
            readOnly: true
            type: string
          tags:
            additionalProperties:
              type: string
            description: Resource tags.
            type: object
          type:
            description: Resource type.
            readOnly: true
            type: string
        x-ms-azure-resource: true
    description: Azure Firewall FQDN Tag Resource.
    properties:
      etag:
        description: A unique read-only string that changes whenever the resource is updated.
        readOnly: true
        type: string
      properties:
        $ref: '#/definitions/AzureFirewallFqdnTagPropertiesFormat'
        description: Properties of the azure firewall FQDN tag.
        x-ms-client-flatten: true
  AzureFirewallFqdnTagListResult:
    description: Response for ListAzureFirewallFqdnTags API service call.
    properties:
      nextLink:
        description: URL to get the next set of results.
        type: string
      value:
        description: List of Azure Firewall FQDN Tags in a resource group.
        items:
          $ref: '#/definitions/AzureFirewallFqdnTag'
        type: array
  AzureFirewallFqdnTagPropertiesFormat:
    description: Azure Firewall FQDN Tag Properties.
    properties:
      fqdnTagName:
        description: The name of this FQDN Tag.
        readOnly: true
        type: string
      provisioningState:
        description: The current provisioning state.
        enum:
          - Succeeded
          - Updating
          - Deleting
          - Failed
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: ProvisioningState


<?php

return array(

    'create'				=> 'Crear Modelo de Activo',
    'created_at' 			=> 'Creado el',
    'eol'	 				=> 'Fin de Vida',
    'modelnumber'   		=> 'Modelo No.',
    'name'      			=> 'Nombre de Activo de Modelo',
    'numassets' 			=> 'Activos',
    'title'					=> 'Modelos de Activo',
    'update'				=> 'Actualizar Modelo de Activo',
    'view'					=> 'Ver Modelos de Activo',
    'update'				=> 'Actualizar Modelo de Activo',
    'clone'				=> 'Clonar Modelo',
    'edit'				=> 'Editar Modelo',
);


@(Html.Kendo().Scheduler<SchedulerTooltipDemo.Models.MeetingViewModel>()
    .Name("scheduler")
    .Date(new DateTime(2013, 6, 13))
    .StartTime(new DateTime(2013, 6, 13, 7, 00, 00))
    .Height(600)
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
    })
    .Editable(editable =>
    {
        editable.TemplateName("CustomEditorTemplate");
    })
    .Timezone("Etc/UTC")
    .Resources(resource =>
    {
        resource.Add(m => m.RoomID)
            .Title("Room")
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .BindTo(new[] {
                    new { Text = "Meeting Room 101", Value = 1, Color = "#6eb3fa" },
                    new { Text = "Meeting Room 201", Value = 2, Color = "#f58a8a" }
                });
        resource.Add(m => m.Attendees)
            .Title("Attendees")
            .Multiple(true)
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .BindTo(new[] {
                    new { Text = "Alex", Value = 1, Color = "#f8a398" },
                    new { Text = "Bob", Value = 2, Color = "#51a0ed" },
                    new { Text = "Charlie", Value = 3, Color = "#56ca85" }
                });
    })
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.MeetingID);
            m.Field(f => f.Title).DefaultValue("No title");
            m.RecurrenceId(f => f.RecurrenceID);
        })
        .Events(e => e.Error("error_handler"))
        .Read("Meetings_Read", "Home")
        .Create("Meetings_Create", "Home")
        .Destroy("Meetings_Destroy", "Home")
        .Update("Meetings_Update", "Home")
    )
)

@(Html.Kendo().Tooltip()
    .For("#scheduler")
    .Filter(".k-event:not(.k-event-drag-hint) > div, .k-task")
    .Position(TooltipPosition.Top)
    .Width(120)
    .ContentTemplateId("template")
)


/*
 * Copyright (C) 2019 Ryan Houdek <Sonicadvance1@gmail.com>
 *
 * 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 (including the next
 * paragraph) 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 __bifrost_print_h__
#define __bifrost_print_h__

#include <stdbool.h>

struct bifrost_instruction;
struct bifrost_block;

void print_mir_instruction(struct bifrost_instruction *ins, bool post_ra);
void print_mir_block(struct bifrost_block *block, bool post_ra);

#endif


package fwdservice

import (
	"fmt"
	"k8s.io/apimachinery/pkg/api/errors"
	"strconv"
	"sync"
	"time"

	"github.com/txn2/kubefwd/pkg/fwdnet"
	"github.com/txn2/kubefwd/pkg/fwdport"
	"github.com/txn2/kubefwd/pkg/fwdpub"

	log "github.com/sirupsen/logrus"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes"
	_ "k8s.io/client-go/plugin/pkg/client/auth"
	restclient "k8s.io/client-go/rest"
)

// Single service which we need to forward, with a reference to all the pods being forwarded for it
type ServiceFWD struct {
	ClientSet    *kubernetes.Clientset
	Context      string
	Namespace    string
	ListOptions  metav1.ListOptions
	Hostfile     *fwdport.HostFileWithLock
	ClientConfig *restclient.Config
	RESTClient   *restclient.RESTClient
	ShortName    bool
	IpC          byte
	IpD          *int
	Domain       string

	PodLabelSelector string                              // The label selector to query for matching pods.
	NamespaceIPLock  *sync.Mutex                         // Synchronization for IP handout for each portforward
	Svc              *v1.Service                         // Reference to the k8s service.
	Headless         bool                                // A headless service will forward all of the pods, while normally only a single pod is forwarded.
	LastSyncedAt     time.Time                           // When was the set of pods last synced
	SyncDebouncer    func(f func())                      // Use debouncer for listing pods so we don't hammer the k8s when a bunch of changes happen at once
	PortForwards     map[string]*fwdport.PortForwardOpts // A mapping of all the pods currently being forwarded. key = podname
	DoneChannel      chan struct{}                       // After shutdown is complete, this channel will be closed
}

func (svcFwd *ServiceFWD) String() string {
	return svcFwd.Svc.Name + "." + svcFwd.Namespace + "." + svcFwd.Context
}

// GetPodsForService queries k8s and returns all pods backing this service
// which are eligible for portforwarding; exclude some pods which are in final/failure state.
func (svcfwd *ServiceFWD) GetPodsForService() []v1.Pod {
	listOpts := metav1.ListOptions{LabelSelector: svcfwd.PodLabelSelector}

	pods, err := svcfwd.ClientSet.CoreV1().Pods(svcfwd.Svc.Namespace).List(listOpts)

	if err != nil {
		if errors.IsNotFound(err) {
			log.Warnf("WARNING: No Pods found for service %s: %s\n", svcfwd, err.Error())
		} else {
			log.Warnf("WARNING: Error in List pods for %s: %s\n", svcfwd, err.Error())
		}
		return nil
	}

	podsEligible := make([]v1.Pod, 0, len(pods.Items))

	for _, pod := range pods.Items {
		if pod.Status.Phase == v1.PodPending || pod.Status.Phase == v1.PodRunning {
			podsEligible = append(podsEligible, pod)
		}
	}

	return podsEligible
}

// SyncPodForwards selects one or all pods behind a service, and invokes the forwarding setup for that or those pod(s).
// It will remove pods in-mem that are no longer returned by k8s, should these not be correctly deleted.
func (svcfwd *ServiceFWD) SyncPodForwards(force bool) {
	sync := func() {
		defer func() { svcfwd.LastSyncedAt = time.Now() }()

		k8sPods := svcfwd.GetPodsForService()

		// If no pods are found currently. Will try again next resync period
		if len(k8sPods) == 0 {
			log.Warnf("WARNING: No Running Pods returned for service %s", svcfwd)
			return
		}

		// Check if the pods currently being forwarded still exist in k8s and if they are not in a (pre-)running state, if not: remove them
		for _, podName := range svcfwd.ListPodNames() {
			keep := false
			for _, pod := range k8sPods {
				if podName == pod.Name && (pod.Status.Phase == v1.PodPending || pod.Status.Phase == v1.PodRunning) {
					keep = true
					break
				}
			}
			if !keep {
				svcfwd.RemovePod(podName)
			}
		}
		// Set up portforwarding for one or all of these pods
		// normal service portforward the first pod as service name. headless service not only forward first Pod as service name, but also portforward all pods.
		if len(k8sPods) != 0 {
			if svcfwd.Headless {
				svcfwd.LoopPodsToForward([]v1.Pod{k8sPods[0]}, true)
				svcfwd.LoopPodsToForward(k8sPods, false)
			} else {
				// Check if currently we are forwarding a pod which is good to keep using
				podNameToKeep := ""
				for _, podName := range svcfwd.ListPodNames() {
					if podNameToKeep != "" {
						break
					}
					for _, pod := range k8sPods {
						if podName == pod.Name && (pod.Status.Phase == v1.PodPending || pod.Status.Phase == v1.PodRunning) {
							podNameToKeep = pod.Name
							break
						}
					}
				}

				// Stop forwarding others, should there be. In case none of the currently forwarded pods are good to keep,
				// podNameToKeep will be the empty string, and the comparison will mean we will remove all pods, which is the desired behaviour.
				for _, podName := range svcfwd.ListPodNames() {
					if podName != podNameToKeep {
						svcfwd.RemovePod(podName)
					}
				}

				// If no good pod was being forwarded already, start one
				if podNameToKeep == "" {
					svcfwd.LoopPodsToForward([]v1.Pod{k8sPods[0]}, false)
				}
			}
		}
	}

	// When a whole set of pods gets deleted at once, they all will trigger a SyncPodForwards() call.
	// This would hammer k8s with load needlessly.  We therefore use a debouncer to only update pods
	// if things have been stable for at least a few seconds.  However, if things never stabilize we
	// will still reload this information at least once every 5 minutes.
	if force || time.Since(svcfwd.LastSyncedAt) > 5*time.Minute {
		// Replace current debounced function with no-op
		svcfwd.SyncDebouncer(func() {})

		// Do the syncing work
		sync()
	} else {
		// Queue sync
		svcfwd.SyncDebouncer(sync)
	}
}

// LoopPodsToForward starts the portforwarding for each pod in the given list
func (svcfwd *ServiceFWD) LoopPodsToForward(pods []v1.Pod, includePodNameInHost bool) {
	publisher := &fwdpub.Publisher{
		PublisherName: "Services",
		Output:        log.IsLevelEnabled(log.DebugLevel),
	}

	// Ip address handout is a critical section for synchronization, use a lock which synchronizes inside each namespace.
	svcfwd.NamespaceIPLock.Lock()
	defer svcfwd.NamespaceIPLock.Unlock()

	for _, pod := range pods {
		// If pod is already configured to be forwarded, skip it
		if _, found := svcfwd.PortForwards[pod.Name]; found {
			continue
		}

		podPort := ""
		svcName := ""

		localIp, dInc, err := fwdnet.ReadyInterface(127, 1, svcfwd.IpC, *svcfwd.IpD, podPort)
		if err != nil {
			log.Warnf("WARNING: error readying interface: %s\n", err)
		}
		*svcfwd.IpD = dInc

		for _, port := range svcfwd.Svc.Spec.Ports {

			podPort = port.TargetPort.String()
			localPort := strconv.Itoa(int(port.Port))

			if _, err := strconv.Atoi(podPort); err != nil {
				// search a pods containers for the named port
				if namedPodPort, ok := portSearch(podPort, pod.Spec.Containers); ok {
					podPort = namedPodPort
				}
			}

			serviceHostName := svcfwd.Svc.Name

			if includePodNameInHost {
				serviceHostName = pod.Name + "." + serviceHostName
			}

			svcName = serviceHostName

			log.Debugf("Resolving:    %s to %s\n",
				serviceHostName,
				localIp.String(),
			)

			log.Printf("Port-Forward: %s.%s.svc.cluster.%s:%d to pod %s:%s\n",
				svcfwd.Svc.Name,
				svcfwd.Svc.Namespace,
				svcfwd.Context,
				port.Port,
				pod.Name,
				podPort,
			)

			pfo := &fwdport.PortForwardOpts{
				Out:        publisher,
				Config:     svcfwd.ClientConfig,
				ClientSet:  svcfwd.ClientSet,
				RESTClient: svcfwd.RESTClient,
				Context:    svcfwd.Context,
				Namespace:  pod.Namespace,
				Service:    svcName,
				ServiceFwd: svcfwd,
				PodName:    pod.Name,
				PodPort:    podPort,
				LocalIp:    localIp,
				LocalPort:  localPort,
				Hostfile:   svcfwd.Hostfile,
				ShortName:  svcfwd.ShortName,
				Domain:     svcfwd.Domain,

				ManualStopChan: make(chan struct{}),
				DoneChan:       make(chan struct{}),
			}

			// Fire and forget. The stopping is done in the service.Shutdown() method.
			go func() {
				svcfwd.AddPod(pfo)
				if err := pfo.PortForward(); err != nil {
					select {
					case <-pfo.ManualStopChan: // if shutdown was given, we don't bother with the error.
					default:
						log.Errorf("PortForward error on %s: %s", pfo.PodName, err.Error())
					}
				} else {
					select {
					case <-pfo.ManualStopChan: // if shutdown was given, don't log a warning as it's an intented stopping.
					default:
						log.Warnf("Stopped forwarding pod %s for %s", pfo.PodName, svcfwd)
					}
				}
			}()

		}

	}
}

func (svcfwd *ServiceFWD) AddPod(pfo *fwdport.PortForwardOpts) {
	svcfwd.NamespaceIPLock.Lock()
	if _, found := svcfwd.PortForwards[pfo.PodName]; !found {
		svcfwd.PortForwards[pfo.PodName] = pfo
	}
	svcfwd.NamespaceIPLock.Unlock()
}

func (svcfwd *ServiceFWD) ListPodNames() []string {
	svcfwd.NamespaceIPLock.Lock()
	currentPodNames := make([]string, 0, len(svcfwd.PortForwards))
	for podName := range svcfwd.PortForwards {
		currentPodNames = append(currentPodNames, podName)
	}
	svcfwd.NamespaceIPLock.Unlock()
	return currentPodNames
}

func (svcfwd *ServiceFWD) RemovePod(podName string) {
	if pod, found := svcfwd.PortForwards[podName]; found {
		pod.Stop()
		<-pod.DoneChan
		svcfwd.NamespaceIPLock.Lock()
		delete(svcfwd.PortForwards, podName)
		svcfwd.NamespaceIPLock.Unlock()
	}
}

func portSearch(portName string, containers []v1.Container) (string, bool) {
	for _, container := range containers {
		for _, cp := range container.Ports {
			if cp.Name == portName {
				return fmt.Sprint(cp.ContainerPort), true
			}
		}
	}

	return "", false
}


<!DOCTYPE html>

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="generator" content="Hugo 0.62.2" />
<meta property="og:title" content="Marco Antonio Martins Junior (Somatório)" />
<meta name="twitter:title" content="Marco Antonio Martins Junior (somatório)"/>
<meta itemprop="name" content="Marco Antonio Martins Junior (somatório)"><meta property="og:description" content="Peão as a Service, entusiasta da cultura DevOps, organizador do DevOpsDays Porto Alegre, Docker community leader (Porto Alegre), fuçador convicto, roda praticamente tudo em containers" />
  <meta name="twitter:description" content="Peão as a Service, entusiasta da cultura DevOps, organizador do DevOpsDays Porto Alegre, Docker community leader (Porto Alegre), fuçador convicto, roda praticamente tudo em containers" />
  <meta itemprop="description" content="Peão as a Service, entusiasta da cultura DevOps, organizador do DevOpsDays Porto Alegre, Docker community leader (Porto Alegre), fuçador convicto, roda praticamente tudo em containers"><meta name="twitter:site" content="@devopsdays">
<meta property="og:type" content="speaker" />
<meta property="og:url" content="/events/2018-salvador/speakers/marco-junior/" /><meta name="twitter:creator" content="@devopsdaysssa" /><meta name="twitter:label1" value="Event" />
  <meta name="twitter:data1" value="devopsdays Salvador 2018" /><meta name="twitter:label2" value="Date" />
    <meta name="twitter:data2" value="October 27, 2018" /><meta property="og:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta itemprop="image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta property="fb:app_id" content="1904065206497317" /><meta itemprop="wordCount" content="25">
<title>Marco Antonio Martins Junior (somatório) - devopsdays Salvador 2018
</title>

<link href="/css/site.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet"><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">

      <link href="/events/index.xml" rel="alternate" type="application/rss+xml" title="DevOpsDays" />
      <link href="/events/index.xml" rel="feed" type="application/rss+xml" title="DevOpsDays" />

  DevOpsDays

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

</button>

events

blog

sponsor

speaking

organizing

about

  Salvador
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar2">

</button>

                  registration

                  program

                  speakers

                  sponsor

                  contact

                  conduct

Marco Antonio Martins Junior (somatório)

Peão as a Service, entusiasta da cultura DevOps, organizador do DevOpsDays Porto Alegre, Docker community leader (Porto Alegre), fuçador convicto, roda praticamente tudo em containers

Marco Antonio Martins Junior (somatório) at Salvador 2018

                Síndrome do Impostor: Você não está sozinho

platinum Sponsors
Join as platinum Sponsor!

Gold Sponsors
Join as Gold Sponsor!

Silver Sponsors
Join as Silver Sponsor!

Bronze Sponsors
Join as Bronze Sponsor!

Community Sponsors
Join as Community Sponsor!

@DEVOPSDAYS

BLOG

Blogs

01 October, 2019

Nota sobre mudança de local do DevOpsDays Salvador 2019

by devopsdays Salvador 2019 - 01 October, 2019

Quando escolhemos a Universidade Federal da Bahia (UFBA), tínhamos como objetivo nos aproximarmos da Academia, nos aproximarmos de uma Universidade Federal e assim, estreitar ainda mais os laços que esta comunidade de tecnologia tem com esse local que tanto formou e ainda forma profissionais para o mercado, não somente soteropolitano, mas sim para o mundo.
Escolhemos a Universidade Federal da Bahia, pois lá estão diversos grupos de professores e alunos que se beneficiariam profundamente com um evento dentro das suas instalações, e quem ainda não conhece a UFBA, teria o prazer de ver sua enorme praça verde, poderia descobrir uma Biblioteca imensa, poderia descobrir que lá está o ponto de presença de Rede Nacional de Pesquisa (RNP) que conecta a maioria dos órgãos federais e locais através da sua rede remessa.
Feed

CFP OPEN
Natal
Vancouver
Houston
Seattle
Toronto
Atlanta
Kraków
Baltimore
Aracaju
Denver
Des Moines
Kyiv
Boise
Poznań
Porto Alegre
Portugal
Salt Lake City
Minneapolis
Zürich (Winterthur)
Cape Town

Propose a talk at an event near you!

About

    devopsdays is a worldwide community conference series for anyone interested in IT improvement.

    About devopsdays

    Privacy Policy

    Code of Conduct


/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

static const uint32 hitRectListOffsets[] = {
	// Scene1001
	1, 0x004B4860,
	// Scene1002
	1, 0x004B4138,
	// Scene1201
	4, 0x004AEBD0,
	// Scene1302
	1, 0x004B0858,
	// Scene1705
	1, 0x004B69D8,
	// Scene2203
	1, 0x004B8320,
	// Scene2205
	1, 0x004B0620,
	0, 0
};

static const uint32 rectListOffsets[] = {
	// Scene1001
	1, 0x004B49F0,
	1, 0x004B4A00,
	// Scene1002
	3, 0x004B43A0,
	1, 0x004B4418,
	// Scene1004
	1, 0x004B7C70,
	// Scene1109
	1, 0x004B63A8,
	1, 0x004B6398,
	// Scene1201
	1, 0x004AEE58,
	1, 0x004AEDC8,
	1, 0x004AEE18,
	1, 0x004AED88,
	// Scene1302
	2, 0x004B0A38,
	// Scene1303
	1, 0x004AF9E8,
	// Scene1304
	1, 0x004B91A8,
	// Scene1305
	1, 0x004B6E98,
	// Scene1306
	1, 0x004AFD28,
	1, 0x004AFD18,
	// Scene1308
	1, 0x004B5990,
	1, 0x004B5980,
	1, 0x004B59A0,
	// Scene1401
	1, 0x004B6758,
	// Scene1402
	1, 0x004B0C48,
	1, 0x004B0C98,
	// Scene1403
	1, 0x004B1FF8,
	1, 0x004B2008,
	// Scene1404
	1, 0x004B8D80,
	// Scene1608
	1, 0x004B47D0,
	1, 0x004B4810,
	// Scene1705
	1, 0x004B6B40,
	1, 0x004B6B30,
	// Scene1901
	1, 0x004B34C8,
	// Scene2001
	1, 0x004B3680,
	1, 0x004B3670,
	// Scene2101
	1, 0x004B9008,
	1, 0x004B8FF8,
	// Scene2203
	1, 0x004B8420,
	// Scene2206
	1, 0x004B8AF8,
	1, 0x004B8B58,
	// Scene2207
	3, 0x004B38B8,
	1, 0x004B3948,
	// Scene2242
	1, 0x004B3DC8,
	1, 0x004B3E18,
	// HallOfRecordsScene
	1, 0x004B2BF8,
	1, 0x004B2BB8,
	// Scene2247
	1, 0x004B5588,
	1, 0x004B55C8,
	// Scene2401
	1, 0x004B3140,
	// Scene2402
	1, 0x004AF900,
	// Scene2403
	1, 0x004B5E18,
	1, 0x004B5E28,
	// Scene2406
	1, 0x004B78C8,
	1, 0x004B78D8,
	// Scene2501
	1, 0x004B2608,
	// Scene2732
	1, 0x004AE360,
	// Scene2801
	1, 0x004B6CE0,
	1, 0x004B6CD0,
	1, 0x004B6CF0,
	// Scene2805
	1, 0x004AE318,
	1, 0x004AE308,
	// Scene2810
	1, 0x004AE810,
	1, 0x004AE800,
	// Scene2812
	1, 0x004AF700,
	1, 0x004AF710,
	0, 0
};

static const uint32 messageListOffsets[] = {
	// Scene1001
	1, 0x004B4888,
	2, 0x004B4898,
	1, 0x004B4970,
	1, 0x004B4890,
	3, 0x004B4910,
	5, 0x004B4938,
	1, 0x004B4960,
	4, 0x004B48A8,
	3, 0x004B48C8,
	// Scene1002
	1, 0x004B4270,
	1, 0x004B4478,
	3, 0x004B4298,
	1, 0x004B4470,
	4, 0x004B4428,
	5, 0x004B4448,
	1, 0x004B44B8,
	2, 0x004B44A8,
	1, 0x004B44A0,
	2, 0x004B43D0,
	4, 0x004B4480,
	2, 0x004B41E0,
	5, 0x004B4148,
	// Scene1004
	3, 0x004B7BF0,
	2, 0x004B7C08,
	1, 0x004B7C18,
	2, 0x004B7C20,
	// Scene1109
	1, 0x004B6260,
	2, 0x004B6268,
	4, 0x004B6318,
	2, 0x004B6278,
	1, 0x004B6258,
	// Scene1201
	1, 0x004AEC08,
	2, 0x004AEC10,
	2, 0x004AEC20,
	2, 0x004AEC30,
	4, 0x004AEC90,
	2, 0x004AECB0,
	2, 0x004AECC0,
	5, 0x004AECF0,
	2, 0x004AECD0,
	2, 0x004AECE0,
	2, 0x004AED38,
	// Scene1302
	4, 0x004B08F0,
	3, 0x004B0920,
	1, 0x004B0950,
	2, 0x004B0940,
	1, 0x004B0938,
	2, 0x004B0910,
	1, 0x004B0968,
	2, 0x004B0878,
	4, 0x004B0978,
	1, 0x004B0870,
	1, 0x004B0868,
	// Scene1303
	1, 0x004AF9A0,
	2, 0x004AF9B8,
	// Scene1304
	1, 0x004B90E8,
	1, 0x004B90F0,
	2, 0x004B9158,
	2, 0x004B9130,
	2, 0x004B9140,
	// Scene1305
	1, 0x004B6E40,
	1, 0x004B6E48,
	// Scene1306
	1, 0x004AFAD0,
	2, 0x004AFAF0,
	1, 0x004AFBC8,
	1, 0x004AFC30,
	4, 0x004AFC38,
	2, 0x004AFB00,
	1, 0x004AFBD0,
	4, 0x004AFBD8,
	2, 0x004AFAE0,
	1, 0x004AFAD8,
	2, 0x004AFC58,
	2, 0x004AFC68,
	// Scene1308
	1, 0x004B57C0,
	1, 0x004B57C8,
	1, 0x004B58B0,
	3, 0x004B57D0,
	3, 0x004B57E8,
	2, 0x004B5868,
	4, 0x004B5848,
	3, 0x004B5830,
	2, 0x004B5800,
	2, 0x004B5868,
	2, 0x004B58E0,
	// Scene1401
	1, 0x004B65C8,
	1, 0x004B65D0,
	1, 0x004B65D8,
	1, 0x004B65E8,
	3, 0x004B6670,
	4, 0x004B6690,
	1, 0x004B66B0,
	3, 0x004B6658,
	2, 0x004B65F0,
	// Scene1402
	1, 0x004B0B48,
	1, 0x004B0B50,
	1, 0x004B0B58,
	1, 0x004B0B60,
	2, 0x004B0B68,
	3, 0x004B0BB8,
	3, 0x004B0BD0,
	// Scene1403
	1, 0x004B1F18,
	1, 0x004B1F20,
	3, 0x004B1F70,
	2, 0x004B1FA8,
	4, 0x004B1F88,
	3, 0x004B1F58,
	2, 0x004B1F28,
	2, 0x004B1FB8,
	// Scene1404
	1, 0x004B8C28,
	1, 0x004B8C30,
	1, 0x004B8C38,
	1, 0x004B8D28,
	3, 0x004B8CB8,
	2, 0x004B8C40,
	6, 0x004B8CE8,
	3, 0x004B8CA0,
	2, 0x004B8CD0,
	2, 0x004B8D18,
	// Scene1608
	1, 0x004B46A8,
	1, 0x004B46B0,
	1, 0x004B47A8,
	3, 0x004B4748,
	2, 0x004B4770,
	2, 0x004B46C8,
	2, 0x004B4760,
	// Scene1705
	1, 0x004B69E8,
	2, 0x004B6A08,
	4, 0x004B6AA0,
	2, 0x004B6A18,
	1, 0x004B69F0,
	2, 0x004B6AC0,
	// Scene1901
	1, 0x004B3408,
	1, 0x004B3410,
	1, 0x004B3400,
	// Scene2001
	1, 0x004B3538,
	2, 0x004B3540,
	4, 0x004B35F0,
	2, 0x004B3550,
	1, 0x004B3530,
	// Scene2101
	1, 0x004B8E48,
	3, 0x004B8E50,
	4, 0x004B8F58,
	2, 0x004B8EB0,
	2, 0x004B8EA0,
	1, 0x004B8F50,
	1, 0x004B8F48,
	4, 0x004B8E80,
	1, 0x004B8EC8,
	2, 0x004B8F78,
	3, 0x004B8F00,
	// Scene2201
	1, 0x004B8118,
	1, 0x004B8130,
	1, 0x004B8178,
	2, 0x004B8120,
	3, 0x004B81A0,
	1, 0x004B81B8,
	2, 0x004B8108,
	5, 0x004B8150,
	4, 0x004B8180,
	3, 0x004B8138,
	2, 0x004B8108,
	2, 0x004B81C8,
	// Scene2203
	1, 0x004B8340,
	1, 0x004B8350,
	1, 0x004B8358,
	1, 0x004B8348,
	3, 0x004B83B0,
	3, 0x004B83C8,
	2, 0x004B8370,
	2, 0x004B8360,
	2, 0x004B83E0,
	2, 0x004B83F0,
	// Scene2205
	1, 0x004B0658,
	2, 0x004B0648,
	1, 0x004B0640,
	4, 0x004B0690,
	2, 0x004B0630,
	// Scene2206
	1, 0x004B88A8,
	2, 0x004B88B8,
	1, 0x004B88C8,
	1, 0x004B8A70,
	1, 0x004B88B0,
	5, 0x004B8948,
	2, 0x004B8970,
	2, 0x004B8988,
	4, 0x004B8998,
	4, 0x004B89B8,
	4, 0x004B89D8,
	5, 0x004B89F8,
	5, 0x004B8A20,
	5, 0x004B8A48,
	// Scene2207
	1, 0x004B38E8,
	4, 0x004B38F0,
	2, 0x004B37D8,
	2, 0x004B3958,
	3, 0x004B3920,
	// Scene2242
	1, 0x004B3C18,
	1, 0x004B3D60,
	1, 0x004B3D48,
	1, 0x004B3C20,
	2, 0x004B3D50,
	5, 0x004B3CF8,
	5, 0x004B3D20,
	4, 0x004B3CB8,
	4, 0x004B3CD8,
	// HallOfRecordsScene
	1, 0x004B2900,
	2, 0x004B2910,
	1, 0x004B2B70,
	1, 0x004B2908,
	2, 0x004B2920,
	4, 0x004B2978,
	4, 0x004B2998,
	4, 0x004B29B8,
	4, 0x004B29D8,
	4, 0x004B29F8,
	4, 0x004B2A18,
	4, 0x004B2A38,
	5, 0x004B2A58,
	5, 0x004B2A80,
	5, 0x004B2AA8,
	5, 0x004B2AD0,
	5, 0x004B2AF8,
	5, 0x004B2B20,
	5, 0x004B2B48,
	// Scene2247
	1, 0x004B5428,
	2, 0x004B5438,
	1, 0x004B5530,
	1, 0x004B5430,
	4, 0x004B54A0,
	4, 0x004B54C0,
	5, 0x004B54E0,
	5, 0x004B5508,
	// Scene2401
	1, 0x004B2F70,
	1, 0x004B2F80,
	1, 0x004B2F78,
	4, 0x004B3090,
	2, 0x004B30B0,
	6, 0x004B3020,
	2, 0x004B3050,
	4, 0x004B2FA8,
	4, 0x004B2FC8,
	// Scene2402
	1, 0x004AF7C8,
	2, 0x004AF7D8,
	1, 0x004AF888,
	1, 0x004AF7D0,
	3, 0x004AF800,
	1, 0x004AF818,
	2, 0x004AF890,
	// Scene2403
	1, 0x004B5C98,
	1, 0x004B5D70,
	4, 0x004B5CA0,
	2, 0x004B5D98,
	// Scene2406
	1, 0x004B76C8,
	3, 0x004B76D8,
	1, 0x004B77C0,
	1, 0x004B7810,
	1, 0x004B76D0,
	2, 0x004B77C8,
	2, 0x004B77D8,
	2, 0x004B7758,
	4, 0x004B7738,
	// Scene2501
	7, 0x004B2538,
	6, 0x004B2570,
	// Scene2732
	1, 0x004AE328,
	// Scene2801
	1, 0x004B6BB8,
	1, 0x004B6BC0,
	1, 0x004B6C10,
	1, 0x004B6BB0,
	2, 0x004B6C40,
	// Scene2803b
	1, 0x004B60D8,
	1, 0x004B6100,
	1, 0x004B60F8,
	1, 0x004B6100,
	3, 0x004B6138,
	3, 0x004B60E0,
	3, 0x004B6180,
	1, 0x004B6198,
	6, 0x004B6108,
	3, 0x004B6150,
	3, 0x004B6168,
	1, 0x004B61A0,
	5, 0x004B61A8,
	// Scene2803
	1, 0x004B79F0,
	5, 0x004B79C8,
	1, 0x004B7A00,
	2, 0x004B7A78,
	1, 0x004B79F8,
	1, 0x004B79C0,
	1, 0x004B7A50,
	2, 0x004B7A58,
	5, 0x004B7A08,
	4, 0x004B7A30,
	2, 0x004B7A68,
	7, 0x004B7A88,
	// Scene2805
	1, 0x004AE1C8,
	2, 0x004AE1D0,
	4, 0x004AE288,
	2, 0x004AE1E0,
	1, 0x004AE1C0,
	// Scene2806
	1, 0x004AF098,
	1, 0x004AF098,
	3, 0x004AF0C8,
	5, 0x004AF0A0,
	1, 0x004AF090,
	2, 0x004AF0E0,
	// Scene2809
	1, 0x004B5B90,
	3, 0x004B5BD0,
	5, 0x004B5BA8,
	1, 0x004B5B88,
	2, 0x004B5B98,
	1, 0x004AE438,
	3, 0x004AE440,
	3, 0x004AE738,
	1, 0x004AE6D8,
	2, 0x004AE6E8,
	1, 0x004AE6E0,
	2, 0x004AE428,
	2, 0x004AE418,
	1, 0x004AE410,
	4, 0x004AE458,
	5, 0x004AE4A8,
	5, 0x004AE4D0,
	5, 0x004AE4F8,
	5, 0x004AE520,
	5, 0x004AE548,
	5, 0x004AE570,
	5, 0x004AE598,
	5, 0x004AE5C0,
	5, 0x004AE5E8,
	5, 0x004AE610,
	5, 0x004AE638,
	5, 0x004AE660,
	5, 0x004AE688,
	2, 0x004AE750,
	// Scene2812
	1, 0x004AF560,
	1, 0x004AF588,
	1, 0x004AF5F0,
	4, 0x004AF568,
	2, 0x004AF658,
	2, 0x004AF668,
	0, 0
};

static const uint32 navigationListOffsets[] = {
	// Module1100
	2, 0x004B8430,
	2, 0x004B8460,
	4, 0x004B84F0,
	4, 0x004B8490,
	2, 0x004B8580,
	2, 0x004B8550,
	// Module1300
	6, 0x004B2718,
	2, 0x004B27A8,
	2, 0x004B27D8,
	2, 0x004B2808,
	2, 0x004B2838,
	// Module1600
	4, 0x004B39D0,
	2, 0x004B3A30,
	2, 0x004B3A60,
	6, 0x004B3A90,
	2, 0x004B3B20,
	2, 0x004B3B50,
	2, 0x004B3B80,
	// Module1700
	2, 0x004AE8B8,
	3, 0x004AE8E8,
	// Module1800
	4, 0x004AFD38,
	1, 0x004AFD98,
	2, 0x004AFDB0,
	4, 0x004AFDE0,
	2, 0x004AFE40,
	// Module2300
	2, 0x004B67B8,
	6, 0x004B67E8,
	2, 0x004B6878,
	3, 0x004B68F0,
	3, 0x004B68A8,
	// Module2000
	3, 0x004B7B48,
	3, 0x004B7B00,
	// Module2600
	2, 0x004B8608,
	4, 0x004B8638,
	2, 0x004B8698,
	2, 0x004B86C8,
	4, 0x004B8758,
	4, 0x004B86F8,
	2, 0x004B87B8,
	// Module3000
	2, 0x004B7C80,
	2, 0x004B7CE0,
	2, 0x004B7CB0,
	3, 0x004B7D58,
	3, 0x004B7D10,
	4, 0x004B7E60,
	4, 0x004B7DA0,
	4, 0x004B7E00,
	4, 0x004B7F20,
	4, 0x004B7EC0,
	2, 0x004B7F80,
	1, 0x004B7FB0,
	0, 0
};

// Hall of Records scene definitions

static const uint32 sceneInfo140Offsets[] = {
	0x004B7180,
	0x004B7198,
	0x004B71B0,
	0x004B71C8,
	0x004B71E0,
	0x004B71F8,
	0x004B7210,
	0x004B7228,
	0x004B7240,
	0x004B7258,
	0x004B7270,
	0x004B7288,
	0x004B72A0,
	0x004B72B8,
	0x004B72D0,
	0x004B72E8,
	0x004B7300,
	0x004B7318,
	0x004B7330,
	0x004B7348,
	0x004B7360,
	0x004B7378,
	0x004B7390,
	0x004B73A8,
	0x004B73C0,
	0x004B73D8,
	0x004B73F0,
	0x004B7408,
	0x004B7420,
	0x004B7438,
	0x004B7450,
	0x004B7468,
	0x004B7480,
	0x004B7498,
	0x004B74B0,
	0x004B74C8,
	0
};

static const uint32 sceneInfo2700Offsets[] = {
	//
	0x004B1710,
	0x004B1738,
	0x004B1760,
	0x004B1788,
	0x004B17B0,
	0x004B17D8,
	0x004B1800,
	0x004B1828,
	0x004B1850,
	0x004B1878,
	0x004B18A0,
	0x004B18C8,
	0x004B18F0,
	0x004B1918,
	//
	0x004B19E0,
	0x004B1A08,
	0x004B1A30,
	0x004B1A58,
	0x004B1A80,
	0x004B1AA8,
	0x004B1AD0,
	0x004B1AF8,
	0x004B1B20,
	0x004B1B48,
	0x004B1B70,
	0x004B1B98,
	0x004B1BC0,
	0x004B1BE8,
	0x004B1C10,
	0x004B1C38,
	0x004B1C60,
	0x004B1C88,
	0x004B1CB0,
	0x004B1CD8,
	0x004B1D00,
	0x004B1D28,
	0x004B1D50,
	0x004B1D78,
	//
	0x004B1DB0,
	//
	0x004B1DE8,
	0x004B1E10,
	0x004B1E38,
	0x004B1E60,
	//
	0x004B1950,
	//
	0x004B2240,
	//
	0x004B5F68,
	0x004B5F8C,
	0x004B5FB0,
	0x004B5FD8,
	0x004B5FFC,
	0x004B6020,
	// Scene2501
	0x004B2628,
	0x004B264C,
	0x004B2670,
	// Scene2502
	0x004B01B8,
	// Scene2503
	0x004B01E0,
	0x004B0208,
	// Scene2505
	0x004B0230,
	// Scene2506
	0x004B0268,
	// Scene2507
	0x004B02A0,
	// Scene2508
	0x004B02C8,
	// Scene2706
	0x004B22A0,
	0x004B22C4,
	0x004B22E8,
	0
};


---
http_interactions:
- request:
    method: get
    uri: http://ps.pndsn.com/v2/auth/grant/sub-key/sub-a-mock-key?auth=ruby-authkey&channel-group=demo&m=1&pnsdk=PubNub-Ruby/4.1.0&r=1&signature=huE5WZODkTOfksM-ipTJb6djxby-8dA5krWT_AAJk5s=&timestamp=1464188712&ttl=300&uuid=ruby-test-uuid-client-one&w=1
    body:
      encoding: UTF-8
      string: ''
    headers:
      User-Agent:
      - HTTPClient/1.0 (2.8.0, ruby 2.3.0 (2015-12-25))
      Accept:
      - "*/*"
      Date:
      - Wed, 25 May 2016 15:05:12 GMT
  response:
    status:
      code: 200
      message: OK
    headers:
      Date:
      - Wed, 25 May 2016 15:05:12 GMT
      Content-Type:
      - text/javascript; charset=UTF-8
      Content-Length:
      - '242'
      Connection:
      - keep-alive
      Access-Control-Allow-Origin:
      - "*"
      Access-Control-Allow-Methods:
      - GET
      Access-Control-Allow-Headers:
      - Origin, X-Requested-With, Content-Type, Accept
      Cache-Control:
      - no-cache, no-store, must-revalidate
    body:
      encoding: UTF-8
      string: '{"message":"Success","payload":{"level":"channel-group+auth","subscribe_key":"sub-a-mock-key","ttl":300,"channel-groups":"demo","auths":{"ruby-authkey":{"r":1,"w":1,"m":1}}},"service":"Access
        Manager","status":200}'
    http_version:
  recorded_at: Wed, 25 May 2016 15:05:12 GMT
recorded_with: VCR 3.0.1


// Copyright 2018 The AITS DNNC Authors.All Rights Reserved.
//
// Licensed to the Apache Software Foundation(ASF) under one
// or more contributor license agreements.See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.See the License for the
// specific language governing permissionsand limitations
// under the License.
//
// This file is part of AITS DNN compiler maintained at
// https://github.com/ai-techsystems/dnnCompiler
//

#include "operators/AveragePool.h"

using namespace dnnc;
using namespace Eigen;

#ifdef DNNC_AVERAGEPOOL_TEST
#include <iostream>
int main() {
  // ADD YOUR TEST CODE HERE
}
#endif