#! /usr/bin/env python

import sqlite3
import sys
import threading
from decimal import InvalidOperation, Decimal
from numbers import Integral

from jmdaemon.protocol import JM_VERSION
from jmbase.support import get_log, joinmarket_alert, DUST_THRESHOLD
log = get_log()

def dict_factory(cursor, row):
    d = {}
    for idx, col in enumerate(cursor.description):
        d[col[0]] = row[idx]
    return d

class JMTakerError(Exception):
    pass

class OrderbookWatch(object):

    def set_msgchan(self, msgchan):
        self.msgchan = msgchan
        self.msgchan.register_orderbookwatch_callbacks(self.on_order_seen,
                                                       self.on_order_cancel)
        self.msgchan.register_channel_callbacks(
            self.on_welcome, self.on_set_topic, None, self.on_disconnect,
            self.on_nick_leave, None)

        self.dblock = threading.Lock()
        con = sqlite3.connect(":memory:", check_same_thread=False)
        con.row_factory = dict_factory
        self.db = con.cursor()
        try:
            self.dblock.acquire(True)
            self.db.execute("CREATE TABLE orderbook(counterparty TEXT, "
                            "oid INTEGER, ordertype TEXT, minsize INTEGER, "
                            "maxsize INTEGER, txfee INTEGER, cjfee TEXT);")
        finally:
            self.dblock.release()

    @staticmethod
    def on_set_topic(newtopic):
        chunks = newtopic.split('|')
        for msg in chunks[1:]:
            try:
                msg = msg.strip()
                params = msg.split(' ')
                min_version = int(params[0])
                max_version = int(params[1])
                alert = msg[msg.index(params[1]) + len(params[1]):].strip()
            except (ValueError, IndexError):
                continue
            if min_version < JM_VERSION < max_version:
                print('=' * 60)
                print('JOINMARKET ALERT')
                print(alert)
                print('=' * 60)
                joinmarket_alert[0] = alert

    def on_order_seen(self, counterparty, oid, ordertype, minsize, maxsize,
                      txfee, cjfee):
        try:
            self.dblock.acquire(True)
            if sys.version_info >= (3,0):
                maxint = sys.maxsize
            else:
                maxint = sys.maxint
            if int(oid) < 0 or int(oid) > maxint:
                log.debug("Got invalid order ID: " + oid + " from " +
                          counterparty)
                return
            # delete orders eagerly, so in case a buggy maker sends an
            # invalid offer, we won't accidentally !fill based on the ghost
            # of its previous message.
            self.db.execute(
                ("DELETE FROM orderbook WHERE counterparty=? "
                 "AND oid=?;"), (counterparty, oid))
            # now validate the remaining fields
            if int(minsize) < 0 or int(minsize) > 21 * 10**14:
                log.debug("Got invalid minsize: {} from {}".format(
                    minsize, counterparty))
                return
            if int(minsize) < DUST_THRESHOLD:
                minsize = DUST_THRESHOLD
                log.debug("{} has dusty minsize, capping at {}".format(
                    counterparty, minsize))
                # do not pass return, go not drop this otherwise fine offer
            if int(maxsize) < 0 or int(maxsize) > 21 * 10**14:
                log.debug("Got invalid maxsize: " + maxsize + " from " +
                          counterparty)
                return
            if int(txfee) < 0:
                log.debug("Got invalid txfee: {} from {}".format(txfee,
                                                                 counterparty))
                return
            if int(minsize) > int(maxsize):

                fmt = ("Got minsize bigger than maxsize: {} - {} "
                       "from {}").format
                log.debug(fmt(minsize, maxsize, counterparty))
                return
            if ordertype in ['swabsoffer', 'absoffer']\
                    and not isinstance(cjfee, Integral):
                try:
                    cjfee = int(cjfee)
                except ValueError:
                    log.debug("Got non integer coinjoin fee: " + str(cjfee) +
                              " for an absoffer from " + counterparty)
                    return
            self.db.execute(
                'INSERT INTO orderbook VALUES(?, ?, ?, ?, ?, ?, ?);',
                (counterparty, oid, ordertype, minsize, maxsize, txfee,
                 str(Decimal(cjfee))))  # any parseable Decimal is a valid cjfee
        except InvalidOperation:
            log.debug("Got invalid cjfee: " + cjfee + " from " + counterparty)
        except Exception as e:
            log.debug("Error parsing order " + oid + " from " + counterparty)
            log.debug("Exception was: " + repr(e))
        finally:
            self.dblock.release()

    def on_order_cancel(self, counterparty, oid):
        try:
            self.dblock.acquire(True)
            self.db.execute(
                ("DELETE FROM orderbook WHERE "
                 "counterparty=? AND oid=?;"), (counterparty, oid))
        finally:
            self.dblock.release()

    def on_nick_leave(self, nick):
        try:
            self.dblock.acquire(True)
            self.db.execute('DELETE FROM orderbook WHERE counterparty=?;',
                            (nick,))
        finally:
            self.dblock.release()

    def on_disconnect(self):
        try:
            self.dblock.acquire(True)
            self.db.execute('DELETE FROM orderbook;')
        finally:
            self.dblock.release()


---
alias: ohmohx8yei
description: Open the Prisma Console in your browser
---

# `prisma console`

Open the Prisma Console in your browser.

#### Usage

```sh
prisma console
```


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<!-- Copyright © 1991-2017 Unicode, Inc.
For terms of use, see http://www.unicode.org/copyright.html
Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
-->
<ldml>
	<identity>
		<version number="$Revision: 13706 $"/>
		<language type="sw"/>
		<territory type="CD"/>
	</identity>
	<localeDisplayNames>
		<languages>
			<language type="ak">Kiakan</language>
			<language type="ar_001">Kiarabu cha Dunia Kilichosanifishwa</language>
			<language type="arq">Kiarabu cha Aljeria</language>
			<language type="az">Kiazabajani</language>
			<language type="bug">Kibugini</language>
			<language type="gv">Kimanksi</language>
			<language type="gwi">Kigwichiin</language>
			<language type="hup">Kihupa</language>
			<language type="jbo">Kilojban</language>
			<language type="kac">Kikachin</language>
			<language type="khq">Kikoyra Chiini</language>
			<language type="kkj">Kikako</language>
			<language type="koi">Kikomipermyak</language>
			<language type="kru">Kikurukh</language>
			<language type="kum">Kikumyk</language>
			<language type="ky">Kikirigizi</language>
			<language type="lam">Kilamba</language>
			<language type="li">Kilimburgi</language>
			<language type="mak">mak</language>
			<language type="mdf">Kimoksha</language>
			<language type="mic">Kimikmaki</language>
			<language type="mk">Kimasedonia</language>
			<language type="moh">Kimohoki</language>
			<language type="mos">Kimossi</language>
			<language type="nnh">Kingiemboon</language>
			<language type="nqo">Kiinko</language>
			<language type="pcm">Pijini ya Nijeria</language>
			<language type="quc">Kikiiche</language>
			<language type="root">Kiroot</language>
			<language type="shu">Kiarabu cha Chadi</language>
			<language type="srn">Kitongo cha Sranan</language>
			<language type="swb">Kikomoro</language>
			<language type="syr">Kisiria</language>
			<language type="udm">Kiudumurti</language>
			<language type="wae">Kiwalser</language>
			<language type="yi">Kiyidi</language>
		</languages>
		<territories>
			<territory type="030">Asia Mashariki</territory>
			<territory type="AF">Afuganistani</territory>
			<territory type="AZ">Azabajani</territory>
			<territory type="BJ">Benini</territory>
			<territory type="CI">Kodivaa</territory>
			<territory type="CX">Kisiwa cha Christmas</territory>
			<territory type="CY">Saiprasi</territory>
			<territory type="DK">Denmaki</territory>
			<territory type="HR">Kroeshia</territory>
			<territory type="JO">Yordani</territory>
			<territory type="LB">Lebanoni</territory>
			<territory type="LI">Lishenteni</territory>
			<territory type="LU">Lasembagi</territory>
			<territory type="LV">Lativia</territory>
			<territory type="MA">Moroko</territory>
			<territory type="MM">Myama</territory>
			<territory type="MV">Maldivi</territory>
			<territory type="NE">Nijeri</territory>
			<territory type="NG">Nijeria</territory>
			<territory type="NO">Norwe</territory>
			<territory type="NP">Nepali</territory>
			<territory type="OM">Omani</territory>
			<territory type="PR">Puetoriko</territory>
			<territory type="QA">Katari</territory>
			<territory type="SD">Sudani</territory>
			<territory type="ST">Sao Tome na Prinsipe</territory>
			<territory type="TD">Chadi</territory>
			<territory type="TL">Timori ya Mashariki</territory>
			<territory type="VN">Vietnamu</territory>
		</territories>
	</localeDisplayNames>
	<characters>
		<exemplarCharacters>[a b c d e f g h i j k l m n o p r s t u v w y z]</exemplarCharacters>
		<exemplarCharacters type="auxiliary">[q x]</exemplarCharacters>
	</characters>
	<dates>
		<calendars>
			<calendar type="generic">
				<dateTimeFormats>
					<availableFormats>
						<dateFormatItem id="MMMEd">E d MMM</dateFormatItem>
						<dateFormatItem id="ms">m:ss</dateFormatItem>
					</availableFormats>
				</dateTimeFormats>
			</calendar>
		</calendars>
		<fields>
			<field type="era">
				<displayName>Wakati</displayName>
			</field>
			<field type="week">
				<displayName>Juma</displayName>
			</field>
			<field type="weekday">
				<displayName>Siku ya juma</displayName>
			</field>
			<field type="dayperiod">
				<displayName>Muda wa siku</displayName>
			</field>
			<field type="zone">
				<displayName>Majira ya saa</displayName>
			</field>
		</fields>
	</dates>
	<numbers>
		<symbols numberSystem="latn">
			<decimal>,</decimal>
			<group>.</group>
		</symbols>
		<currencies>
			<currency type="CDF">
				<symbol>FC</symbol>
			</currency>
			<currency type="CNY">
				<displayName>Yuan Renminbi ya China</displayName>
			</currency>
			<currency type="ETB">
				<displayName>Bir ya Uhabeshi</displayName>
			</currency>
			<currency type="JPY">
				<displayName>Sarafu ya Kijapani</displayName>
			</currency>
			<currency type="MGA">
				<displayName>Ariary ya Bukini</displayName>
			</currency>
			<currency type="MRO">
				<displayName>Ugwiya ya Moritania</displayName>
			</currency>
			<currency type="SCR">
				<displayName>Rupia ya Shelisheli</displayName>
			</currency>
			<currency type="XAF">
				<displayName>Faranga CFA BEAC</displayName>
			</currency>
			<currency type="XOF">
				<displayName>Faranga CFA BCEAO</displayName>
			</currency>
		</currencies>
	</numbers>
</ldml>


#
# Copyright 2018 Confluent Inc.
#
# Licensed under the Confluent Community License (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.confluent.io/confluent-community-license
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations under the License.
#

log4j.rootLogger=OFF


resource "digitalocean_ssh_key" "dossh" {
    name = "home-kali"
    public_key = "${file("${var.ssh-public-key}")}"
}


/*
 * Copyright (c) Enalean, 2020 - present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap 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.
 *
 * Tuleap 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 Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

import { shallowMount, ShallowMountOptions, Wrapper } from "@vue/test-utils";
import ReleaseBadgesOpenSprint from "./ReleaseBadgesOpenSprint.vue";
import { createStoreMock } from "../../../../../../../../src/scripts/vue-components/store-wrapper-jest";
import { MilestoneData, StoreOptions } from "../../../type";
import { createReleaseWidgetLocalVue } from "../../../helpers/local-vue-for-test";
import ReleaseButtonsDescription from "../ReleaseDescription/ReleaseButtonsDescription.vue";

let sprint_data: MilestoneData & Required<Pick<MilestoneData, "planning">>;
const total_sprint = 10;
const component_options: ShallowMountOptions<ReleaseBadgesOpenSprint> = {};

const project_id = 102;

describe("ReleaseBadgesOpenSprint", () => {
    let store_options: StoreOptions;
    let store;

    async function getPersonalWidgetInstance(
        store_options: StoreOptions
    ): Promise<Wrapper<ReleaseBadgesOpenSprint>> {
        store = createStoreMock(store_options);

        component_options.mocks = { $store: store };
        component_options.localVue = await createReleaseWidgetLocalVue();

        return shallowMount(ReleaseBadgesOpenSprint, component_options);
    }

    beforeEach(() => {
        store_options = {
            state: {
                project_id: project_id,
            },
        };

        sprint_data = {
            label: "mile",
            id: 2,
            total_sprint,
            resources: {
                milestones: {
                    accept: {
                        trackers: [
                            {
                                label: "Sprint1",
                            },
                        ],
                    },
                },
            },
        } as MilestoneData;

        component_options.propsData = { sprint_data };
    });

    describe("Display sprint data", () => {
        it("When the component is rendered, Then the label of sprint is displayed", async () => {
            const wrapper = await getPersonalWidgetInstance(store_options);

            expect(wrapper.get("[data-test=sprint-label]").text()).toEqual("mile");
        });

        it("When the component is rendered, Then ReleaseBadgesButtonOpenSprint is rendered", async () => {
            const wrapper = await getPersonalWidgetInstance(store_options);

            expect(wrapper.findComponent(ReleaseButtonsDescription).exists()).toBe(true);
        });

        it("When a release is not in progress, Then the badge is outline", async () => {
            const wrapper = await getPersonalWidgetInstance(store_options);

            expect(wrapper.get("[data-test=sprint-label]").attributes("class")).toContain(
                "tlp-badge-outline"
            );
        });

        it("When a release is in progress, Then the badge is not outline", async () => {
            const end_date = new Date();
            end_date.setDate(end_date.getDate() + 1);

            sprint_data = {
                label: "mile",
                id: 2,
                start_date: new Date().toString(),
                end_date: end_date.toString(),
                total_sprint,
                resources: {
                    milestones: {
                        accept: {
                            trackers: [
                                {
                                    label: "Sprint1",
                                },
                            ],
                        },
                    },
                },
            } as MilestoneData;

            component_options.propsData = { sprint_data };

            const wrapper = await getPersonalWidgetInstance(store_options);

            expect(wrapper.get("[data-test=sprint-label]").attributes("class")).not.toContain(
                "tlp-badge-outline"
            );
        });
    });
});


// Copyright 2010 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: jdtang@google.com (Jonathan Tang)

#include "attribute.h"

#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>

#include "util.h"

struct GumboInternalParser;

GumboAttribute* gumbo_get_attribute(
    const GumboVector* attributes, const char* name) {
  for (unsigned int i = 0; i < attributes->length; ++i) {
    GumboAttribute* attr = attributes->data[i];
    if (!strcasecmp(attr->name, name)) {
      return attr;
    }
  }
  return NULL;
}

void gumbo_destroy_attribute(
    struct GumboInternalParser* parser, GumboAttribute* attribute) {
  gumbo_parser_deallocate(parser, (void*) attribute->name);
  gumbo_parser_deallocate(parser, (void*) attribute->value);
  gumbo_parser_deallocate(parser, (void*) attribute);
}


// g2o - General Graph Optimization
// Copyright (C) 2011 H. Strasdat
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notice,
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#ifndef G2O_SE3QUAT_H_
#define G2O_SE3QUAT_H_

#include "se3_ops.h"

#include <Eigen/Core>
#include <Eigen/Geometry>

namespace g2o {
  using namespace Eigen;

  typedef Matrix<double, 6, 1> Vector6d;
  typedef Matrix<double, 7, 1> Vector7d;

  class SE3Quat {
    public:
      EIGEN_MAKE_ALIGNED_OPERATOR_NEW;

    protected:

      Quaterniond _r;
      Vector3d _t;

    public:
      SE3Quat(){
        _r.setIdentity();
        _t.setZero();
      }

      SE3Quat(const Matrix3d& R, const Vector3d& t):_r(Quaterniond(R)),_t(t){
        normalizeRotation();
      }

      SE3Quat(const Quaterniond& q, const Vector3d& t):_r(q),_t(t){
        normalizeRotation();
      }

      /**
       * templaized constructor which allows v to be an arbitrary Eigen Vector type, e.g., Vector6d or Map<Vector6d>
       */
      template <typename Derived>
        explicit SE3Quat(const MatrixBase<Derived>& v)
        {
          assert((v.size() == 6 || v.size() == 7) && "Vector dimension does not match");
          if (v.size() == 6) {
            for (int i=0; i<3; i++){
              _t[i]=v[i];
              _r.coeffs()(i)=v[i+3];
            }
            _r.w() = 0.; // recover the positive w
            if (_r.norm()>1.){
              _r.normalize();
            } else {
              double w2=1.-_r.squaredNorm();
              _r.w()= (w2<0.) ? 0. : sqrt(w2);
            }
          }
          else if (v.size() == 7) {
            int idx = 0;
            for (int i=0; i<3; ++i, ++idx)
              _t(i) = v(idx);
            for (int i=0; i<4; ++i, ++idx)
              _r.coeffs()(i) = v(idx);
            normalizeRotation();
          }
        }

      inline const Vector3d& translation() const {return _t;}

      inline void setTranslation(const Vector3d& t_) {_t = t_;}

      inline const Quaterniond& rotation() const {return _r;}

      void setRotation(const Quaterniond& r_) {_r=r_;}

      inline SE3Quat operator* (const SE3Quat& tr2) const{
        SE3Quat result(*this);
        result._t += _r*tr2._t;
        result._r*=tr2._r;
        result.normalizeRotation();
        return result;
      }

      inline SE3Quat& operator*= (const SE3Quat& tr2){
        _t+=_r*tr2._t;
        _r*=tr2._r;
        normalizeRotation();
        return *this;
      }

      inline Vector3d operator* (const Vector3d& v) const {
        return _t+_r*v;
      }

      inline SE3Quat inverse() const{
        SE3Quat ret;
        ret._r=_r.conjugate();
        ret._t=ret._r*(_t*-1.);
        return ret;
      }

      inline double operator [](int i) const {
        assert(i<7);
        if (i<3)
          return _t[i];
        return _r.coeffs()[i-3];
      }

      inline Vector7d toVector() const{
        Vector7d v;
        v[0]=_t(0);
        v[1]=_t(1);
        v[2]=_t(2);
        v[3]=_r.x();
        v[4]=_r.y();
        v[5]=_r.z();
        v[6]=_r.w();
        return v;
      }

      inline void fromVector(const Vector7d& v){
        _r=Quaterniond(v[6], v[3], v[4], v[5]);
        _t=Vector3d(v[0], v[1], v[2]);
      }

      inline Vector6d toMinimalVector() const{
        Vector6d v;
        v[0]=_t(0);
        v[1]=_t(1);
        v[2]=_t(2);
        v[3]=_r.x();
        v[4]=_r.y();
        v[5]=_r.z();
        return v;
      }

      inline void fromMinimalVector(const Vector6d& v){
        double w = 1.-v[3]*v[3]-v[4]*v[4]-v[5]*v[5];
        if (w>0){
          _r=Quaterniond(sqrt(w), v[3], v[4], v[5]);
        } else {
          _r=Quaterniond(0, -v[3], -v[4], -v[5]);
        }
        _t=Vector3d(v[0], v[1], v[2]);
      }

      Vector6d log() const {
        Vector6d res;
        Matrix3d _R = _r.toRotationMatrix();
        double d =  0.5*(_R(0,0)+_R(1,1)+_R(2,2)-1);
        Vector3d omega;
        Vector3d upsilon;

        Vector3d dR = deltaR(_R);
        Matrix3d V_inv;

        if (d>0.99999)
        {

          omega=0.5*dR;
          Matrix3d Omega = skew(omega);
          V_inv = Matrix3d::Identity()- 0.5*Omega + (1./12.)*(Omega*Omega);
        }
        else
        {
          double theta = acos(d);
          omega = theta/(2*sqrt(1-d*d))*dR;
          Matrix3d Omega = skew(omega);
          V_inv = ( Matrix3d::Identity() - 0.5*Omega
              + ( 1-theta/(2*tan(theta/2)))/(theta*theta)*(Omega*Omega) );
        }

        upsilon = V_inv*_t;
        for (int i=0; i<3;i++){
          res[i]=omega[i];
        }
        for (int i=0; i<3;i++){
          res[i+3]=upsilon[i];
        }

        return res;

      }

      Vector3d map(const Vector3d & xyz) const
      {
        return _r*xyz + _t;
      }

      static SE3Quat exp(const Vector6d & update)
      {
        Vector3d omega;
        for (int i=0; i<3; i++)
          omega[i]=update[i];
        Vector3d upsilon;
        for (int i=0; i<3; i++)
          upsilon[i]=update[i+3];

        double theta = omega.norm();
        Matrix3d Omega = skew(omega);

        Matrix3d R;
        Matrix3d V;
        if (theta<0.00001)
        {
          //TODO: CHECK WHETHER THIS IS CORRECT!!!
          R = (Matrix3d::Identity() + Omega + Omega*Omega);

          V = R;
        }
        else
        {
          Matrix3d Omega2 = Omega*Omega;

          R = (Matrix3d::Identity()
              + sin(theta)/theta *Omega
              + (1-cos(theta))/(theta*theta)*Omega2);

          V = (Matrix3d::Identity()
              + (1-cos(theta))/(theta*theta)*Omega
              + (theta-sin(theta))/(pow(theta,3))*Omega2);
        }
        return SE3Quat(Quaterniond(R),V*upsilon);
      }

      Matrix<double, 6, 6> adj() const
      {
        Matrix3d R = _r.toRotationMatrix();
        Matrix<double, 6, 6> res;
        res.block(0,0,3,3) = R;
        res.block(3,3,3,3) = R;
        res.block(3,0,3,3) = skew(_t)*R;
        res.block(0,3,3,3) = Matrix3d::Zero(3,3);
        return res;
      }

      Matrix<double,4,4> to_homogeneous_matrix() const
      {
        Matrix<double,4,4> homogeneous_matrix;
        homogeneous_matrix.setIdentity();
        homogeneous_matrix.block(0,0,3,3) = _r.toRotationMatrix();
        homogeneous_matrix.col(3).head(3) = translation();

        return homogeneous_matrix;
      }

      void normalizeRotation(){
        if (_r.w()<0){
          _r.coeffs() *= -1;
        }
        _r.normalize();
      }

      /**
       * cast SE3Quat into an Eigen::Isometry3d
       */
      operator Eigen::Isometry3d() const
      {
        Eigen::Isometry3d result = (Eigen::Isometry3d) rotation();
        result.translation() = translation();
        return result;
      }
  };

  inline std::ostream& operator <<(std::ostream& out_str, const SE3Quat& se3)
  {
    out_str << se3.to_homogeneous_matrix()  << std::endl;
    return out_str;
  }

} // end namespace

#endif


//
//  NativeEventNavigationViewController.m
//  XLForm ( https://github.com/xmartlabs/XLForm )
//
//  Copyright (c) 2015 Xmartlabs ( http://xmartlabs.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 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.

#import "XLForm.h"
#import "DateAndTimeValueTrasformer.h"
#import "NativeEventFormViewController.h"

@implementation NativeEventNavigationViewController

-(void)viewDidLoad
{
    [super viewDidLoad];
    [self.view setTintColor:[UIColor redColor]];
}

@end

@interface NativeEventFormViewController ()

@end

@implementation NativeEventFormViewController

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        [self initializeForm];
    }
    return self;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initializeForm];
    }
    return self;
}

- (void)initializeForm
{
    XLFormDescriptor * form;
    XLFormSectionDescriptor * section;
    XLFormRowDescriptor * row;

    form = [XLFormDescriptor formDescriptorWithTitle:@"Add Event"];
    section = [XLFormSectionDescriptor formSection];
    [form addFormSection:section];

    // Title
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"Title" rowType:XLFormRowDescriptorTypeText];
    [row.cellConfigAtConfigure setObject:@"Title" forKey:@"textField.placeholder"];
    row.required = YES;
    [section addFormRow:row];

    // Location
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"location" rowType:XLFormRowDescriptorTypeText];
    [row.cellConfigAtConfigure setObject:@"Location" forKey:@"textField.placeholder"];
    [section addFormRow:row];

    section = [XLFormSectionDescriptor formSection];
    [form addFormSection:section];

    // All-day
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"all-day" rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"All-day"];
    [section addFormRow:row];

    // Starts
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"starts" rowType:XLFormRowDescriptorTypeDateTimeInline title:@"Starts"];
    row.value = [NSDate dateWithTimeIntervalSinceNow:60*60*24];
    [section addFormRow:row];

    // Ends
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"ends" rowType:XLFormRowDescriptorTypeDateTimeInline title:@"Ends"];
    row.value = [NSDate dateWithTimeIntervalSinceNow:60*60*25];
    [section addFormRow:row];

    section = [XLFormSectionDescriptor formSection];
    [form addFormSection:section];

    // Repeat
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"repeat" rowType:XLFormRowDescriptorTypeSelectorPush title:@"Repeat"];
    row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Never"];
    row.selectorTitle = @"Repeat";
    row.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Never"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Every Day"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Every Week"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(3) displayText:@"Every 2 Weeks"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(4) displayText:@"Every Month"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(5) displayText:@"Every Year"],
                            ];
    [section addFormRow:row];

    section = [XLFormSectionDescriptor formSection];
    [form addFormSection:section];

    // Alert
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"alert" rowType:XLFormRowDescriptorTypeSelectorPush title:@"Alert"];
    row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"None"];
    row.selectorTitle = @"Event Alert";
    row.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"None"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"At time of event"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"5 minutes before"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(3) displayText:@"15 minutes before"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(4) displayText:@"30 minutes before"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(5) displayText:@"1 hour before"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(6) displayText:@"2 hours before"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(7) displayText:@"1 day before"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(8) displayText:@"2 days before"],
                            ];
    [section addFormRow:row];

    section = [XLFormSectionDescriptor formSection];
    [form addFormSection:section];

    // Show As
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"showAs" rowType:XLFormRowDescriptorTypeSelectorPush title:@"Show As"];
    row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Busy"];
    row.selectorTitle = @"Show As";
    row.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Busy"],
                            [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Free"]];
    [section addFormRow:row];

    section = [XLFormSectionDescriptor formSection];
    [form addFormSection:section];

    // URL
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"url" rowType:XLFormRowDescriptorTypeURL];
    [row.cellConfigAtConfigure setObject:@"URL" forKey:@"textField.placeholder"];
    [section addFormRow:row];

    // Notes
    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"notes" rowType:XLFormRowDescriptorTypeTextView];
    [row.cellConfigAtConfigure setObject:@"Notes" forKey:@"textView.placeholder"];
    [section addFormRow:row];

    self.form = form;
}

-(void)viewDidLoad
{
    [super viewDidLoad];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelPressed:)];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(savePressed:)];
}

#pragma mark - XLFormDescriptorDelegate

-(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor oldValue:(id)oldValue newValue:(id)newValue
{
    [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
    if ([rowDescriptor.tag isEqualToString:@"alert"]){
        if ([[rowDescriptor.value valueData] isEqualToNumber:@(0)] == NO && [[oldValue valueData] isEqualToNumber:@(0)]){

            XLFormRowDescriptor * newRow = [rowDescriptor copy];
            newRow.tag = @"secondAlert";
            newRow.title = @"Second Alert";
            [self.form addFormRow:newRow afterRow:rowDescriptor];
        }
        else if ([[oldValue valueData] isEqualToNumber:@(0)] == NO && [[newValue valueData] isEqualToNumber:@(0)]){
            [self.form removeFormRowWithTag:@"secondAlert"];
        }
    }
    else if ([rowDescriptor.tag isEqualToString:@"all-day"]){
        XLFormRowDescriptor * startDateDescriptor = [self.form formRowWithTag:@"starts"];
        XLFormRowDescriptor * endDateDescriptor = [self.form formRowWithTag:@"ends"];
        XLFormDateCell * dateStartCell = (XLFormDateCell *)[[self.form formRowWithTag:@"starts"] cellForFormController:self];
        XLFormDateCell * dateEndCell = (XLFormDateCell *)[[self.form formRowWithTag:@"ends"] cellForFormController:self];
        if ([[rowDescriptor.value valueData] boolValue] == YES){
            startDateDescriptor.valueTransformer = [DateValueTrasformer class];
            endDateDescriptor.valueTransformer = [DateValueTrasformer class];
            [dateStartCell setFormDatePickerMode:XLFormDateDatePickerModeDate];
            [dateEndCell setFormDatePickerMode:XLFormDateDatePickerModeDate];
        }
        else{
            startDateDescriptor.valueTransformer = [DateTimeValueTrasformer class];
            endDateDescriptor.valueTransformer = [DateTimeValueTrasformer class];
            [dateStartCell setFormDatePickerMode:XLFormDateDatePickerModeDateTime];
            [dateEndCell setFormDatePickerMode:XLFormDateDatePickerModeDateTime];
        }
        [self updateFormRow:startDateDescriptor];
        [self updateFormRow:endDateDescriptor];
    }
    else if ([rowDescriptor.tag isEqualToString:@"starts"]){
        XLFormRowDescriptor * startDateDescriptor = [self.form formRowWithTag:@"starts"];
        XLFormRowDescriptor * endDateDescriptor = [self.form formRowWithTag:@"ends"];
        if ([startDateDescriptor.value compare:endDateDescriptor.value] == NSOrderedDescending) {
            // startDateDescriptor is later than endDateDescriptor
            endDateDescriptor.value =  [[NSDate alloc] initWithTimeInterval:(60*60*24) sinceDate:startDateDescriptor.value];
            [endDateDescriptor.cellConfig removeObjectForKey:@"detailTextLabel.attributedText"];
            [self updateFormRow:endDateDescriptor];
        }
    }
    else if ([rowDescriptor.tag isEqualToString:@"ends"]){
        XLFormRowDescriptor * startDateDescriptor = [self.form formRowWithTag:@"starts"];
        XLFormRowDescriptor * endDateDescriptor = [self.form formRowWithTag:@"ends"];
        XLFormDateCell * dateEndCell = (XLFormDateCell *)[endDateDescriptor cellForFormController:self];
        if ([startDateDescriptor.value compare:endDateDescriptor.value] == NSOrderedDescending) {
            // startDateDescriptor is later than endDateDescriptor
            [dateEndCell update]; // force detailTextLabel update
            NSDictionary *strikeThroughAttribute = [NSDictionary dictionaryWithObject:@1
                                                                               forKey:NSStrikethroughStyleAttributeName];
            NSAttributedString* strikeThroughText = [[NSAttributedString alloc] initWithString:dateEndCell.detailTextLabel.text attributes:strikeThroughAttribute];
            [endDateDescriptor.cellConfig setObject:strikeThroughText forKey:@"detailTextLabel.attributedText"];
            [self updateFormRow:endDateDescriptor];
        }
        else{
            [endDateDescriptor.cellConfig removeObjectForKey:@"detailTextLabel.attributedText"];
            [self updateFormRow:endDateDescriptor];
        }
    }
}

-(void)cancelPressed:(UIBarButtonItem * __unused)button
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

-(void)savePressed:(UIBarButtonItem * __unused)button
{
    NSArray * validationErrors = [self formValidationErrors];
    if (validationErrors.count > 0){
        [self showFormValidationError:[validationErrors firstObject]];
        return;
    }
    [self.tableView endEditing:YES];
}

@end


///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2009-03-06
// Licence : This source is under MIT License
// File    : glm/gtx/projection.inl
///////////////////////////////////////////////////////////////////////////////////////////////////

namespace glm
{
	template <typename vecType>
	GLM_FUNC_QUALIFIER vecType proj
	(
		vecType const & x,
		vecType const & Normal
	)
	{
		return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
	}
}//namespace glm


/**
 * Created by yangsong on 15-1-15.
 */
class GameView extends BaseSpriteView {
    private controller:BaseController;

    private bg:egret.Bitmap;
    private objectContainer:egret.DisplayObjectContainer;
    public hero:Hero;
    public enemys:Array<Enemy>;

    public constructor($controller:BaseController, $parent:egret.DisplayObjectContainer) {
        super($controller, $parent);
        this.controller = $controller;
    }

    /**
     *对面板进行显示初始化，用于子类继承
     *
     */
    public initUI():void {
        super.initUI();

        GameData.MIN_X = 50;
        GameData.MAX_X = App.StageUtils.getWidth() - 50;
        GameData.MIN_Y = App.StageUtils.getHeight() - 300;
        GameData.MAX_Y = App.StageUtils.getHeight() - 10;

        this.bg = App.DisplayUtils.createBitmap("map_jpg");
        App.AnchorUtils.setAnchorX(this.bg, 0.5);
        App.AnchorUtils.setAnchorY(this.bg, 1);
        this.bg.x = App.StageUtils.getWidth() * 0.5;
        this.bg.y = App.StageUtils.getHeight();
        this.addChild(this.bg);

        this.objectContainer = new egret.DisplayObjectContainer();
        this.addChild(this.objectContainer);

        //提前初始化好怪物
        this.enemys = new Array<Enemy>();
        for (var i:number = 0; i < 4; i++) {
            var enemy:Enemy = ObjectPool.pop("Enemy", this.controller);
            enemy.init();
            this.enemys.push(enemy);
        }
        while (this.enemys.length) {
            this.enemys.pop().destory();
        }

        //提前初始化好Boss
        var boss:Boss = ObjectPool.pop("Boss", this.controller);
        boss.destory();

        //创建主角
        this.hero = ObjectPool.pop("Hero", this.controller);
        this.hero.init();
        this.hero.x = App.StageUtils.getWidth() * 0.3;
        this.hero.y = App.StageUtils.getHeight() * 0.7;
        this.objectContainer.addChild(this.hero);

        //创建Enemy
        this.startCreateEnemy();

        if (!App.DeviceUtils.IsMobile) {
            this.touchEnabled = true;
            this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
        }

        //深度排序
        App.TimerManager.doTimer(3, 0, this.sortGameObjs, this);
    }

    /**
     *对面板数据的初始化，用于子类继承
     *
     */
    public initData():void {
        super.initData();
    }

    /**
     * 开始创建怪物
     */
    private startCreateEnemy():void {
        this.enemys.length = 0;
        App.TimerManager.doTimer(100, 0, this.createEnemy, this);
    }

    /**
     * 创建怪物
     */
    private createEnemy():void {
        this.enemys.push(this.createEnemySingle("Enemy"));
        if (this.enemys.length >= 4) {
            App.TimerManager.remove(this.createEnemy, this);
        }
    }

    /**
     * 创建Boss
     */
    private createBoss():void {
        for (var i:number = 0, len:number = this.enemys.length; i < len; i++) {
            if (this.enemys[i] instanceof Boss) {
                return;
            }
        }
        this.enemys.push(this.createEnemySingle("Boss"));
    }

    private createEnemySingle(clsName:string):Enemy {
        var initX:number = Math.random() > 0.5 ? GameData.MAX_X + 200 : GameData.MIN_X - 200;
        var initY:number = App.RandomUtils.limit(GameData.MIN_Y, GameData.MAX_Y);
        var enemy:Enemy = ObjectPool.pop(clsName, this.controller);
        enemy.init();
        enemy.x = initX;
        enemy.y = initY;
        enemy.setPos();
        enemy.scaleX = Math.random() < 0.5 ? 1 : -1;
        this.objectContainer.addChild(enemy);

        var gotoX:number = App.RandomUtils.limit(GameData.MIN_X, GameData.MAX_X);
        var gotoY:number = initY;
        enemy.command_in(3, gotoX, gotoY);
        return enemy;
    }

    public removeEnemy(enemy:Enemy):void {
        var index:number = this.enemys.indexOf(enemy);
        if (index != -1) {
            this.enemys.splice(index, 1);
            if (this.enemys.length == 0) {
                this.startCreateEnemy();
            }
            else if (this.enemys.length == 2) {
                this.createBoss();
            }
        }
    }

    private sortGameObjs():void {
        this.objectContainer.$children.sort(this.sortF);
    }

    private sortF(d1:BaseGameObject, d2:BaseGameObject):number {
        if (d1.y > d2.y) {
            return 1;
        } else if (d1.y < d2.y) {
            return -1;
        } else {
            return 0;
        }
    }

    private onClick(evt:egret.TouchEvent):void {
        if (this.hero.isAttack) {
            return;
        }

        if (evt.localX < GameData.MIN_X
            || evt.localX > GameData.MAX_X
            || evt.localY < GameData.MIN_Y
            || evt.localY > GameData.MAX_Y) {
            return;
        }

        App.RockerUtils.stop();
        this.hero.walkTo(5, evt.localX, evt.localY);
    }
}


op {
  name: "TensorListResize"
  input_arg {
    name: "input_handle"
    type: DT_VARIANT
  }
  input_arg {
    name: "size"
    type: DT_INT32
  }
  output_arg {
    name: "output_handle"
    type: DT_VARIANT
  }
  is_stateful: true
}


[profile]
layer_height = 0.2
wall_thickness = 1.0
retraction_enable = True
solid_layer_thickness = 0.6
fill_density = 20
nozzle_size = 0.5
print_speed = 50
print_temperature = 0
print_temperature2 = 0
print_temperature3 = 0
print_temperature4 = 0
print_bed_temperature = 0
support = None
platform_adhesion = None
support_dual_extrusion = False
wipe_tower = True
wipe_tower_volume = 15
ooze_shield = False
filament_diameter = 1.75
filament_diameter2 = 0
filament_diameter3 = 0
filament_diameter4 = 0
filament_flow = 100.0
retraction_speed = 60.0
retraction_amount = 3
retraction_dual_amount = 10
retraction_min_travel = 1.5
retraction_combing = True
retraction_minimal_extrusion = 0.02
retraction_hop = 0.0
bottom_thickness = 0.2
layer0_width_factor = 100
object_sink = 0.0
overlap_dual = 0.2
travel_speed = 250.0
bottom_layer_speed = 20
infill_speed = 0.0
inset0_speed = 0.0
insetx_speed = 0.0
cool_min_layer_time = 5
fan_enabled = True
skirt_line_count = 1
skirt_gap = 3.0
skirt_minimal_length = 150.0
fan_full_height = 0.5
fan_speed = 100
fan_speed_max = 100
cool_min_feedrate = 10
cool_head_lift = False
solid_top = True
solid_bottom = True
fill_overlap = 15
support_type = Lines
support_angle = 60
support_fill_rate = 15
support_xy_distance = 0.7
support_z_distance = 0.15
spiralize = False
simple_mode = False
brim_line_count = 20
raft_margin = 5
raft_line_spacing = 1.0
raft_base_thickness = 0.3
raft_base_linewidth = 0.7
raft_interface_thickness = 0.2
raft_interface_linewidth = 0.2
raft_airgap_all = 0.0
raft_airgap = 0.22
raft_surface_layers = 2
raft_surface_thickness = 0.27
raft_surface_linewidth = 0.4
fix_horrible_union_all_type_a = False
fix_horrible_union_all_type_b = False
fix_horrible_use_open_bits = False
fix_horrible_extensive_stitching = False
plugin_config = (lp1
	(dp2
	S'params'
	p3
	(dp4
	sS'filename'
	p5
	S'EAtoR.py'
	p6
	sa.
object_center_x = -1
object_center_y = -1

[alterations]
start.gcode = ;Sliced at: {day} {date} {time}
	;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
	;Print time: {print_time}
	;Filament used: {filament_amount}m {filament_weight}g
	;Filament cost: {filament_cost}
	G21        ;metric values
	G90        ;absolute positioning
	M107       ;start with the fan off
	G28 Z0     ;move Z to min endstops
	T0
	M116
end.gcode = ;End GCode
	G28 X0 Y0                              ;move X/Y to min endstops, so the head is out of the way
	M84                         ;steppers off
start2.gcode = ;Sliced at: {day} {date} {time}
	;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
	;Print time: {print_time}
	;Filament used: {filament_amount}m {filament_weight}g
	;Filament cost: {filament_cost}
	G21        ;metric values
	G90        ;absolute positioning
	M107       ;start with the fan off
	G28 Z0     ;move Z to min endstops
	T0
	M116
end2.gcode = ;End GCode
	T99
	M84                         ;steppers off
start3.gcode = ;Sliced at: {day} {date} {time}
	;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
	;Print time: {print_time}
	;Filament used: {filament_amount}m {filament_weight}g
	;Filament cost: {filament_cost}
	;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line
	;M104 S{print_temperature} ;Uncomment to add your own temperature line
	;M109 T1 S{print_temperature2} ;Uncomment to add your own temperature line
	;M109 T0 S{print_temperature} ;Uncomment to add your own temperature line
	G21        ;metric values
	G90        ;absolute positioning
	M107       ;start with the fan off
	G28 X0 Y0  ;move X/Y to min endstops
	G28 Z0     ;move Z to min endstops
	G1 Z15.0 F{travel_speed} ;move the platform down 15mm
	T2                      ;Switch to the 2nd extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F200 E-{retraction_dual_amount}
	T1                      ;Switch to the 2nd extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F200 E-{retraction_dual_amount}
	T0                      ;Switch to the first extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F{travel_speed}
	;Put printing message on LCD screen
	M117 Printing...
end3.gcode = ;End GCode
	M104 T0 S0                     ;extruder heater off
	M104 T1 S0                     ;extruder heater off
	M104 T2 S0                     ;extruder heater off
	M140 S0                     ;heated bed heater off (if you have it)
	G91                                    ;relative positioning
	G1 E-1 F300                            ;retract the filament a bit before lifting the nozzle, to release some of the pressure
	G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more
	G28 X0 Y0                              ;move X/Y to min endstops, so the head is out of the way
	M84                         ;steppers off
	G90                         ;absolute positioning
	;{profile_string}
start4.gcode = ;Sliced at: {day} {date} {time}
	;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
	;Print time: {print_time}
	;Filament used: {filament_amount}m {filament_weight}g
	;Filament cost: {filament_cost}
	;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line
	;M104 S{print_temperature} ;Uncomment to add your own temperature line
	;M109 T2 S{print_temperature2} ;Uncomment to add your own temperature line
	;M109 T1 S{print_temperature2} ;Uncomment to add your own temperature line
	;M109 T0 S{print_temperature} ;Uncomment to add your own temperature line
	G21        ;metric values
	G90        ;absolute positioning
	M107       ;start with the fan off
	G28 X0 Y0  ;move X/Y to min endstops
	G28 Z0     ;move Z to min endstops
	G1 Z15.0 F{travel_speed} ;move the platform down 15mm
	T3                      ;Switch to the 4th extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F200 E-{retraction_dual_amount}
	T2                      ;Switch to the 3th extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F200 E-{retraction_dual_amount}
	T1                      ;Switch to the 2nd extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F200 E-{retraction_dual_amount}
	T0                      ;Switch to the first extruder
	G92 E0                  ;zero the extruded length
	G1 F200 E10             ;extrude 10mm of feed stock
	G92 E0                  ;zero the extruded length again
	G1 F{travel_speed}
	;Put printing message on LCD screen
	M117 Printing...
end4.gcode = ;End GCode
	M104 T0 S0                     ;extruder heater off
	M104 T1 S0                     ;extruder heater off
	M104 T2 S0                     ;extruder heater off
	M104 T3 S0                     ;extruder heater off
	M140 S0                     ;heated bed heater off (if you have it)
	G91                                    ;relative positioning
	G1 E-1 F300                            ;retract the filament a bit before lifting the nozzle, to release some of the pressure
	G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more
	G28 X0 Y0                              ;move X/Y to min endstops, so the head is out of the way
	M84                         ;steppers off
	G90                         ;absolute positioning
	;{profile_string}
support_start.gcode =
support_end.gcode =
cool_start.gcode =
cool_end.gcode =
replace.csv =
preswitchextruder.gcode = ;Switch between the current extruder and the next extruder, when printing with multiple extruders.
	;This code is added before the T(n)
	G1 X0 F12000
postswitchextruder.gcode = ;Switch between the current extruder and the next extruder, when printing with multiple extruders.
	;This code is added after the T(n)
	M116


const acceptValue = ['input', 'textarea', 'option', 'select']

export default (tag, type, attr) => {
  return (
    (attr === 'value' && acceptValue.includes(tag) && type !== 'button') ||
    (attr === 'selected' && tag === 'option') ||
    (attr === 'checked' && tag === 'input') ||
    (attr === 'muted' && tag === 'video')
  )
}


# Generated by superflore -- DO NOT EDIT
#
# Copyright Open Source Robotics Foundation

inherit ros_distro_melodic
inherit ros_superflore_generated

DESCRIPTION = "The tf2_py package"
AUTHOR = "Tully Foote <tfoote@osrfoundation.org>"
HOMEPAGE = "http://ros.org/wiki/tf2_py"
SECTION = "devel"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://package.xml;beginline=11;endline=11;md5=2c00b8d2854109dbebef7818b4dae1e2"

ROS_CN = "geometry2"
ROS_BPN = "tf2_py"

ROS_BUILD_DEPENDS = " \
    rospy \
    tf2 \
"

ROS_BUILDTOOL_DEPENDS = " \
    catkin-native \
"

ROS_EXPORT_DEPENDS = " \
    rospy \
    tf2 \
"

ROS_BUILDTOOL_EXPORT_DEPENDS = ""

ROS_EXEC_DEPENDS = " \
    rospy \
    tf2 \
"

# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags.
ROS_TEST_DEPENDS = ""

DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}"
# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually
# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS.
DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}"

RDEPENDS_${PN} += "${ROS_EXEC_DEPENDS}"

# matches with: https://github.com/ros-gbp/geometry2-release/archive/release/melodic/tf2_py/0.6.5-0.tar.gz
ROS_BRANCH ?= "branch=release/melodic/tf2_py"
SRC_URI = "git://github.com/ros-gbp/geometry2-release;${ROS_BRANCH};protocol=https"
SRCREV = "4992b535a7d0fef7839fc67b9d783c5cbc490dd2"
S = "${WORKDIR}/git"

ROS_BUILD_TYPE = "catkin"

inherit ros_${ROS_BUILD_TYPE}


# where is the VST SDK, version 2.3?
VSTSDKPATH=c:\data\vstsdk2.3


/*
 *
 * (C) COPYRIGHT 2016-2017 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation, and any use by you of this program is subject to the terms
 * of such GNU licence.
 *
 * A copy of the licence is included with the program, and can also be obtained
 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 *
 */

#ifndef _KBASE_IPA_H_
#define _KBASE_IPA_H_

#if defined(CONFIG_MALI_BIFROST_DEVFREQ) && defined(CONFIG_DEVFREQ_THERMAL)

struct devfreq;

struct kbase_ipa_model {
	struct list_head link;
	struct kbase_device *kbdev;
	void *model_data;
	struct kbase_ipa_model_ops *ops;
	struct list_head params;
	bool missing_dt_node_warning;
};

/**
 * kbase_ipa_model_add_param_s32 - Add an integer model parameter
 * @model:	pointer to IPA model
 * @name:	name of corresponding debugfs entry
 * @addr:	address where the value is stored
 * @num_elems:	number of elements (1 if not an array)
 * @dt_required: if false, a corresponding devicetree entry is not required,
 *		 and the current value will be used. If true, a warning is
 *		 output and the data is zeroed
 *
 * Return: 0 on success, or an error code
 */
int kbase_ipa_model_add_param_s32(struct kbase_ipa_model *model,
				  const char *name, s32 *addr,
				  size_t num_elems, bool dt_required);

/**
 * kbase_ipa_model_add_param_string - Add a string model parameter
 * @model:	pointer to IPA model
 * @name:	name of corresponding debugfs entry
 * @addr:	address where the value is stored
 * @size:	size, in bytes, of the value storage (so the maximum string
 *		length is size - 1)
 * @dt_required: if false, a corresponding devicetree entry is not required,
 *		 and the current value will be used. If true, a warning is
 *		 output and the data is zeroed
 *
 * Return: 0 on success, or an error code
 */
int kbase_ipa_model_add_param_string(struct kbase_ipa_model *model,
				     const char *name, char *addr,
				     size_t size, bool dt_required);

struct kbase_ipa_model_ops {
	char *name;
	/* The init, recalculate and term ops on the default model are always
	 * called.  However, all the other models are only invoked if the model
	 * is selected in the device tree. Otherwise they are never
	 * initialized. Additional resources can be acquired by models in
	 * init(), however they must be terminated in the term().
	 */
	int (*init)(struct kbase_ipa_model *model);
	/* Called immediately after init(), or when a parameter is changed, so
	 * that any coefficients derived from model parameters can be
	 * recalculated. */
	int (*recalculate)(struct kbase_ipa_model *model);
	void (*term)(struct kbase_ipa_model *model);
	/*
	 * get_dynamic_coeff() - calculate dynamic power coefficient
	 * @model:		pointer to model
	 * @coeffp:		pointer to return value location
	 * @current_freq:	frequency the GPU has been running at for the
	 *			previous sampling period.
	 *
	 * Calculate a dynamic power coefficient, with units pW/(Hz V^2), which
	 * is then scaled by the IPA framework according to the current OPP's
	 * frequency and voltage.
	 *
	 * Return: 0 on success, or an error code.
	 */
	int (*get_dynamic_coeff)(struct kbase_ipa_model *model, u32 *coeffp,
				 u32 current_freq);
	/*
	 * get_static_coeff() - calculate static power coefficient
	 * @model:		pointer to model
	 * @coeffp:		pointer to return value location
	 *
	 * Calculate a static power coefficient, with units uW/(V^3), which is
	 * scaled by the IPA framework according to the current OPP's voltage.
	 *
	 * Return: 0 on success, or an error code.
	 */
	int (*get_static_coeff)(struct kbase_ipa_model *model, u32 *coeffp);
	/* If false, the model's get_dynamic_coeff() method accounts for how
	 * long the GPU was active over the sample period. If true, the
	 * framework will scale the calculated power according to the
	 * utilization stats recorded by devfreq in get_real_power(). */
	bool do_utilization_scaling_in_framework;
};

/* Models can be registered only in the platform's platform_init_func call */
int kbase_ipa_model_ops_register(struct kbase_device *kbdev,
			     struct kbase_ipa_model_ops *new_model_ops);
struct kbase_ipa_model *kbase_ipa_get_model(struct kbase_device *kbdev,
					    const char *name);

int kbase_ipa_init(struct kbase_device *kbdev);
void kbase_ipa_term(struct kbase_device *kbdev);
void kbase_ipa_model_use_fallback_locked(struct kbase_device *kbdev);
void kbase_ipa_model_use_configured_locked(struct kbase_device *kbdev);
int kbase_ipa_model_recalculate(struct kbase_ipa_model *model);
struct kbase_ipa_model *kbase_ipa_init_model(struct kbase_device *kbdev,
					     struct kbase_ipa_model_ops *ops);
void kbase_ipa_term_model(struct kbase_ipa_model *model);

extern struct kbase_ipa_model_ops kbase_g71_ipa_model_ops;

#if MALI_UNIT_TEST
/**
 * kbase_get_real_power() - get the real power consumption of the GPU
 * @df: dynamic voltage and frequency scaling information for the GPU.
 * @power: where to store the power consumption, in mW.
 * @freq: a frequency, in HZ.
 * @voltage: a voltage, in mV.
 *
 * This function is only exposed for use by unit tests. The returned value
 * incorporates both static and dynamic power consumption.
 *
 * Return: 0 on success, or an error code.
 */
int kbase_get_real_power(struct devfreq *df, u32 *power,
				unsigned long freq,
				unsigned long voltage);
#endif /* MALI_UNIT_TEST */

#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
extern struct devfreq_cooling_ops kbase_ipa_power_model_ops;
#else
extern struct devfreq_cooling_power kbase_ipa_power_model_ops;
#endif

#else /* !(defined(CONFIG_MALI_BIFROST_DEVFREQ) && defined(CONFIG_DEVFREQ_THERMAL)) */

static inline void kbase_ipa_model_use_fallback_locked(struct kbase_device *kbdev)
{ }

static inline void kbase_ipa_model_use_configured_locked(struct kbase_device *kbdev)
{ }

#endif /* (defined(CONFIG_MALI_BIFROST_DEVFREQ) && defined(CONFIG_DEVFREQ_THERMAL)) */

#endif


package tc.oc.parse;

import com.google.inject.TypeLiteral;
import tc.oc.commons.core.inject.KeyedManifest;
import tc.oc.commons.core.inject.Manifest;
import tc.oc.commons.core.util.Pair;
import tc.oc.parse.xml.NodeParser;
import tc.oc.parse.xml.PrimitiveNodeParser;

/**
 * Binds {@link Parser<T>} to the given type, and {@link NodeParser<T>} to {@link PrimitiveNodeParser<T>}
 */
public class PrimitiveParserManifest<T> extends KeyedManifest implements ParserTypeLiterals {

    private final TypeLiteral<T> T;
    private final TypeLiteral<? extends Parser<T>> ParserTImpl;

    public PrimitiveParserManifest(Class<T> type, Class<? extends Parser<T>> ParserTImpl) {
        this(TypeLiteral.get(type), TypeLiteral.get(ParserTImpl));
    }

    public PrimitiveParserManifest(TypeLiteral<T> T, TypeLiteral<? extends Parser<T>> ParserTImpl) {
        this.T = T;
        this.ParserTImpl = ParserTImpl;
    }

    @Override
    protected Object manifestKey() {
        return Pair.of(T, ParserTImpl);
    }

    @Override
    protected void configure() {
        bind(ParserTImpl);
        bind(Parser(T)).to(ParserTImpl);
        bind(NodeParser(T)).to(PrimitiveNodeParser(T));
        bind(ElementParser(T)).to(NodeParser(T));
        bind(DocumentParser(T)).to(NodeParser(T));
    }
}


/*-------------------------------------------------------------------------
 *
 * tsquery_cleanup.c
 *	 Cleanup query from NOT values and/or stopword
 *	 Utility functions to correct work.
 *
 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
 *
 *
 * IDENTIFICATION
 *	  src/backend/utils/adt/tsquery_cleanup.c
 *
 *-------------------------------------------------------------------------
 */

#include "postgres.h"

#include "tsearch/ts_utils.h"
#include "miscadmin.h"

typedef struct NODE
{
	struct NODE *left;
	struct NODE *right;
	QueryItem  *valnode;
} NODE;

/*
 * make query tree from plain view of query
 */
static NODE *
maketree(QueryItem *in)
{
	NODE	   *node = (NODE *) palloc(sizeof(NODE));

	/* since this function recurses, it could be driven to stack overflow. */
	check_stack_depth();

	node->valnode = in;
	node->right = node->left = NULL;
	if (in->type == QI_OPR)
	{
		node->right = maketree(in + 1);
		if (in->qoperator.oper != OP_NOT)
			node->left = maketree(in + in->qoperator.left);
	}
	return node;
}

/*
 * Internal state for plaintree and plainnode
 */
typedef struct
{
	QueryItem  *ptr;
	int			len;			/* allocated size of ptr */
	int			cur;			/* number of elements in ptr */
} PLAINTREE;

static void
plainnode(PLAINTREE *state, NODE *node)
{
	/* since this function recurses, it could be driven to stack overflow. */
	check_stack_depth();

	if (state->cur == state->len)
	{
		state->len *= 2;
		state->ptr = (QueryItem *) repalloc((void *) state->ptr, state->len * sizeof(QueryItem));
	}
	memcpy((void *) &(state->ptr[state->cur]), (void *) node->valnode, sizeof(QueryItem));
	if (node->valnode->type == QI_VAL)
		state->cur++;
	else if (node->valnode->qoperator.oper == OP_NOT)
	{
		state->ptr[state->cur].qoperator.left = 1;
		state->cur++;
		plainnode(state, node->right);
	}
	else
	{
		int			cur = state->cur;

		state->cur++;
		plainnode(state, node->right);
		state->ptr[cur].qoperator.left = state->cur - cur;
		plainnode(state, node->left);
	}
	pfree(node);
}

/*
 * make plain view of tree from a NODE-tree representation
 */
static QueryItem *
plaintree(NODE *root, int *len)
{
	PLAINTREE	pl;

	pl.cur = 0;
	pl.len = 16;
	if (root && (root->valnode->type == QI_VAL || root->valnode->type == QI_OPR))
	{
		pl.ptr = (QueryItem *) palloc(pl.len * sizeof(QueryItem));
		plainnode(&pl, root);
	}
	else
		pl.ptr = NULL;
	*len = pl.cur;
	return pl.ptr;
}

static void
freetree(NODE *node)
{
	/* since this function recurses, it could be driven to stack overflow. */
	check_stack_depth();

	if (!node)
		return;
	if (node->left)
		freetree(node->left);
	if (node->right)
		freetree(node->right);
	pfree(node);
}

/*
 * clean tree for ! operator.
 * It's useful for debug, but in
 * other case, such view is used with search in index.
 * Operator ! always return TRUE
 */
static NODE *
clean_NOT_intree(NODE *node)
{
	/* since this function recurses, it could be driven to stack overflow. */
	check_stack_depth();

	if (node->valnode->type == QI_VAL)
		return node;

	if (node->valnode->qoperator.oper == OP_NOT)
	{
		freetree(node);
		return NULL;
	}

	/* operator & or | */
	if (node->valnode->qoperator.oper == OP_OR)
	{
		if ((node->left = clean_NOT_intree(node->left)) == NULL ||
			(node->right = clean_NOT_intree(node->right)) == NULL)
		{
			freetree(node);
			return NULL;
		}
	}
	else
	{
		NODE	   *res = node;

		Assert(node->valnode->qoperator.oper == OP_AND ||
			   node->valnode->qoperator.oper == OP_PHRASE);

		node->left = clean_NOT_intree(node->left);
		node->right = clean_NOT_intree(node->right);
		if (node->left == NULL && node->right == NULL)
		{
			pfree(node);
			res = NULL;
		}
		else if (node->left == NULL)
		{
			res = node->right;
			pfree(node);
		}
		else if (node->right == NULL)
		{
			res = node->left;
			pfree(node);
		}
		return res;
	}
	return node;
}

QueryItem *
clean_NOT(QueryItem *ptr, int *len)
{
	NODE	   *root = maketree(ptr);

	return plaintree(clean_NOT_intree(root), len);
}

/*
 * Remove QI_VALSTOP (stopword) nodes from query tree.
 *
 * Returns NULL if the query degenerates to nothing.  Input must not be NULL.
 *
 * When we remove a phrase operator due to removing one or both of its
 * arguments, we might need to adjust the distance of a parent phrase
 * operator.  For example, 'a' is a stopword, so:
 *		(b <-> a) <-> c  should become	b <2> c
 *		b <-> (a <-> c)  should become	b <2> c
 *		(b <-> (a <-> a)) <-> c  should become	b <3> c
 *		b <-> ((a <-> a) <-> c)  should become	b <3> c
 * To handle that, we define two output parameters:
 *		ladd: amount to add to a phrase distance to the left of this node
 *		radd: amount to add to a phrase distance to the right of this node
 * We need two outputs because we could need to bubble up adjustments to two
 * different parent phrase operators.  Consider
 *		w <-> (((a <-> x) <2> (y <3> a)) <-> z)
 * After we've removed the two a's and are considering the <2> node (which is
 * now just x <2> y), we have an ladd distance of 1 that needs to propagate
 * up to the topmost (leftmost) <->, and an radd distance of 3 that needs to
 * propagate to the rightmost <->, so that we'll end up with
 *		w <2> ((x <2> y) <4> z)
 * Near the bottom of the tree, we may have subtrees consisting only of
 * stopwords.  The distances of any phrase operators within such a subtree are
 * summed and propagated to both ladd and radd, since we don't know which side
 * of the lowest surviving phrase operator we are in.  The rule is that any
 * subtree that degenerates to NULL must return equal values of ladd and radd,
 * and the parent node dealing with it should incorporate only one of those.
 *
 * Currently, we only implement this adjustment for adjacent phrase operators.
 * Thus for example 'x <-> ((a <-> y) | z)' will become 'x <-> (y | z)', which
 * isn't ideal, but there is no way to represent the really desired semantics
 * without some redesign of the tsquery structure.  Certainly it would not be
 * any better to convert that to 'x <2> (y | z)'.  Since this is such a weird
 * corner case, let it go for now.  But we can fix it in cases where the
 * intervening non-phrase operator also gets removed, for example
 * '((x <-> a) | a) <-> y' will become 'x <2> y'.
 */
static NODE *
clean_stopword_intree(NODE *node, int *ladd, int *radd)
{
	/* since this function recurses, it could be driven to stack overflow. */
	check_stack_depth();

	/* default output parameters indicate no change in parent distance */
	*ladd = *radd = 0;

	if (node->valnode->type == QI_VAL)
		return node;
	else if (node->valnode->type == QI_VALSTOP)
	{
		pfree(node);
		return NULL;
	}

	Assert(node->valnode->type == QI_OPR);

	if (node->valnode->qoperator.oper == OP_NOT)
	{
		/* NOT doesn't change pattern width, so just report child distances */
		node->right = clean_stopword_intree(node->right, ladd, radd);
		if (!node->right)
		{
			freetree(node);
			return NULL;
		}
	}
	else
	{
		NODE	   *res = node;
		bool		isphrase;
		int			ndistance,
					lladd,
					lradd,
					rladd,
					rradd;

		/* First, recurse */
		node->left = clean_stopword_intree(node->left, &lladd, &lradd);
		node->right = clean_stopword_intree(node->right, &rladd, &rradd);

		/* Check if current node is OP_PHRASE, get its distance */
		isphrase = (node->valnode->qoperator.oper == OP_PHRASE);
		ndistance = isphrase ? node->valnode->qoperator.distance : 0;

		if (node->left == NULL && node->right == NULL)
		{
			/*
			 * When we collapse out a phrase node entirely, propagate its own
			 * distance into both *ladd and *radd; it is the responsibility of
			 * the parent node to count it only once.  Also, for a phrase
			 * node, distances coming from children are summed and propagated
			 * up to parent (we assume lladd == lradd and rladd == rradd, else
			 * rule was broken at a lower level).  But if this isn't a phrase
			 * node, take the larger of the two child distances; that
			 * corresponds to what TS_execute will do in non-stopword cases.
			 */
			if (isphrase)
				*ladd = *radd = lladd + ndistance + rladd;
			else
				*ladd = *radd = Max(lladd, rladd);
			freetree(node);
			return NULL;
		}
		else if (node->left == NULL)
		{
			/* Removing this operator and left subnode */
			/* lladd and lradd are equal/redundant, don't count both */
			if (isphrase)
			{
				/* operator's own distance must propagate to left */
				*ladd = lladd + ndistance + rladd;
				*radd = rradd;
			}
			else
			{
				/* at non-phrase op, just forget the left subnode entirely */
				*ladd = rladd;
				*radd = rradd;
			}
			res = node->right;
			pfree(node);
		}
		else if (node->right == NULL)
		{
			/* Removing this operator and right subnode */
			/* rladd and rradd are equal/redundant, don't count both */
			if (isphrase)
			{
				/* operator's own distance must propagate to right */
				*ladd = lladd;
				*radd = lradd + ndistance + rradd;
			}
			else
			{
				/* at non-phrase op, just forget the right subnode entirely */
				*ladd = lladd;
				*radd = lradd;
			}
			res = node->left;
			pfree(node);
		}
		else if (isphrase)
		{
			/* Absorb appropriate corrections at this level */
			node->valnode->qoperator.distance += lradd + rladd;
			/* Propagate up any unaccounted-for corrections */
			*ladd = lladd;
			*radd = rradd;
		}
		else
		{
			/* We're keeping a non-phrase operator, so ladd/radd remain 0 */
		}

		return res;
	}
	return node;
}

/*
 * Number of elements in query tree
 */
static int32
calcstrlen(NODE *node)
{
	int32		size = 0;

	if (node->valnode->type == QI_VAL)
	{
		size = node->valnode->qoperand.length + 1;
	}
	else
	{
		Assert(node->valnode->type == QI_OPR);

		size = calcstrlen(node->right);
		if (node->valnode->qoperator.oper != OP_NOT)
			size += calcstrlen(node->left);
	}

	return size;
}

/*
 * Remove QI_VALSTOP (stopword) nodes from TSQuery.
 */
TSQuery
cleanup_tsquery_stopwords(TSQuery in)
{
	int32		len,
				lenstr,
				commonlen,
				i;
	NODE	   *root;
	int			ladd,
				radd;
	TSQuery		out;
	QueryItem  *items;
	char	   *operands;

	if (in->size == 0)
		return in;

	/* eliminate stop words */
	root = clean_stopword_intree(maketree(GETQUERY(in)), &ladd, &radd);
	if (root == NULL)
	{
		ereport(NOTICE,
				(errmsg("text-search query contains only stop words or doesn't contain lexemes, ignored")));
		out = palloc(HDRSIZETQ);
		out->size = 0;
		SET_VARSIZE(out, HDRSIZETQ);
		return out;
	}

	/*
	 * Build TSQuery from plain view
	 */

	lenstr = calcstrlen(root);
	items = plaintree(root, &len);
	commonlen = COMPUTESIZE(len, lenstr);

	out = palloc(commonlen);
	SET_VARSIZE(out, commonlen);
	out->size = len;

	memcpy(GETQUERY(out), items, len * sizeof(QueryItem));

	items = GETQUERY(out);
	operands = GETOPERAND(out);
	for (i = 0; i < out->size; i++)
	{
		QueryOperand *op = (QueryOperand *) &items[i];

		if (op->type != QI_VAL)
			continue;

		memcpy(operands, GETOPERAND(in) + op->distance, op->length);
		operands[op->length] = '\0';
		op->distance = operands - GETOPERAND(out);
		operands += op->length + 1;
	}

	return out;
}


/*
 * OpenRISC interrupt.
 *
 * Copyright (c) 2011-2012 Jia Liu <proljc@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */

#include "cpu.h"
#include "qemu-common.h"
#include "exec/gdbstub.h"
#include "qemu/host-utils.h"
#ifndef CONFIG_USER_ONLY
#include "hw/loader.h"
#endif

void openrisc_cpu_do_interrupt(CPUState *cs)
{
#ifndef CONFIG_USER_ONLY
    OpenRISCCPU *cpu = OPENRISC_CPU(cs);
    CPUOpenRISCState *env = &cpu->env;

    env->epcr = env->pc;
    if (env->flags & D_FLAG) {
        env->flags &= ~D_FLAG;
        env->sr |= SR_DSX;
        env->epcr -= 4;
    }
    if (cs->exception_index == EXCP_SYSCALL) {
        env->epcr += 4;
    }

    /* For machine-state changed between user-mode and supervisor mode,
       we need flush TLB when we enter&exit EXCP.  */
    tlb_flush(cs, 1);

    env->esr = env->sr;
    env->sr &= ~SR_DME;
    env->sr &= ~SR_IME;
    env->sr |= SR_SM;
    env->sr &= ~SR_IEE;
    env->sr &= ~SR_TEE;
    env->tlb->cpu_openrisc_map_address_data = &cpu_openrisc_get_phys_nommu;
    env->tlb->cpu_openrisc_map_address_code = &cpu_openrisc_get_phys_nommu;

    if (cs->exception_index > 0 && cs->exception_index < EXCP_NR) {
#ifdef OR32_ARCH_DEFAULT
        env->pc = (cs->exception_index << 8);
#else
        env->pc = 0x100000 + (cs->exception_index << 8);
#endif
        //printf("pc = 0x%x\n", env->pc);
    } else {
        cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index);
    }
#endif

    cs->exception_index = -1;
}

bool openrisc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
    OpenRISCCPU *cpu = OPENRISC_CPU(cs);
    CPUOpenRISCState *env = &cpu->env;
    int idx = -1;

    if ((interrupt_request & CPU_INTERRUPT_HARD) && (env->sr & SR_IEE)) {
        idx = EXCP_INT;
    }
    if ((interrupt_request & CPU_INTERRUPT_TIMER) && (env->sr & SR_TEE)) {
        idx = EXCP_TICK;
    }

    // Set up custom interrupts -- make sure to disable the interrupt here,
    // or it will get thrown multiple times
    if ((interrupt_request & CPU_INTERRUPT_FFS_WRITE) && (env->sr & SR_IEE)) {
        idx = EXCP_FFS_WRITE;
        cs->interrupt_request &= ~(CPU_INTERRUPT_FFS_WRITE);
    }

    if ((interrupt_request & CPU_INTERRUPT_FFS_ACK) && (env->sr & SR_IEE)) {
        idx = EXCP_FFS_ACK;
        cs->interrupt_request &= ~(CPU_INTERRUPT_FFS_ACK);
    }
    if (idx >= 0) {
        cs->exception_index = idx;
        openrisc_cpu_do_interrupt(cs);
        return true;
    }
    return false;
}


package com.annimon.stream.function;

import org.junit.Test;

import static com.annimon.stream.test.hamcrest.CommonMatcher.hasOnlyPrivateConstructors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

/**
 * Tests {@code IndexedDoubleConsumer}.
 *
 * @see IndexedDoubleConsumer
 */
public class IndexedDoubleConsumerTest {

    @Test
    public void testPrivateConstructor() throws Exception {
        assertThat(IndexedDoubleConsumer.Util.class, hasOnlyPrivateConstructors());
    }

    @Test
    public void testAndThen() {
        final double[] buffer = new double[] {1.0, 2.5, 4.0, 2.0};
        IndexedDoubleConsumer addConsumer = new IndexedDoubleConsumer() {
            @Override
            public void accept(int index, double value) {
                buffer[index] += value;
            }
        };
        IndexedDoubleConsumer multiplyConsumer = new IndexedDoubleConsumer() {
            @Override
            public void accept(int index, double value) {
                buffer[index] *= value;
            }
        };
        IndexedDoubleConsumer consumer = IndexedDoubleConsumer.Util.andThen(
                addConsumer, multiplyConsumer);

        // 2.5 + 2.5 = 5.0; 5.0 * 2.5 = 12.5
        consumer.accept(1, 2.5);
        assertEquals(12.5, buffer[1], 0.0);

        // 4.0 + (-6.0) = -2.0; -2.0 * (-6.0) = 12.0
        consumer.accept(2, -6.0);
        assertEquals(12.0, buffer[2], 0.0);
    }

    @Test
    public void testUtilAccept() {
        final IntHolder countHolder = new IntHolder();
        final DoubleHolder valueHolder = new DoubleHolder(10.0);
        final IntConsumer indexConsumer = new IntConsumer() {
            @Override
            public void accept(int index) {
                countHolder.value++;
            }
        };
        IndexedDoubleConsumer consumer = IndexedDoubleConsumer.Util
                .accept(indexConsumer, valueHolder);

        for (int i = 1; i < 11; i++) {
            consumer.accept(i, (double) i);
            assertEquals(i, countHolder.value);
        }
        assertEquals(65.0, valueHolder.value, 0.0);
    }

    private static class IntHolder {
        public int value;
    }

    private static class DoubleHolder implements DoubleConsumer {

        public double value;

        DoubleHolder(double value) {
            this.value = value;
        }

        @Override
        public void accept(double value) {
            this.value += value;
        }
    }
}


<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:workflow="uri:oozie:workflow:0.1" xmlns:shell="uri:oozie:shell-action:0.1" exclude-result-prefixes="workflow shell">

<xsl:import href="../nodes/fields/archives.xslt"/>
<xsl:import href="../nodes/fields/capture_output.xslt"/>
<xsl:import href="../nodes/fields/command.xslt"/>
<xsl:import href="../nodes/fields/files.xslt"/>
<xsl:import href="../nodes/fields/job_properties.xslt"/>
<xsl:import href="../nodes/fields/job_xml.xslt"/>
<xsl:import href="../nodes/fields/arguments.xslt"/>
<xsl:import href="../nodes/fields/prepares.xslt"/>

<xsl:template match="shell:shell">

  <object model="oozie.shell" pk="0">

    <xsl:call-template name="archives"/>
    <xsl:call-template name="capture_output"/>
    <xsl:call-template name="command"/>
    <xsl:call-template name="files"/>
    <xsl:call-template name="job_properties"/>
    <xsl:call-template name="job_xml"/>
    <xsl:call-template name="arguments"/>
    <xsl:call-template name="prepares"/>

  </object>

</xsl:template>

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
</xsl:stylesheet>


from tests.utils import W3CTestCase

class TestFlexbox_Flex0NNShrink(W3CTestCase):
    vars().update(W3CTestCase.find_tests(__file__, 'flexbox_flex-0-N-N-shrink'))


      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <link rel="stylesheet" href="../../helpwin.css">
      <title>MATLAB File Help: prtFeatSelExhaustive.showProgressBar</title>

            MATLAB File Help: prtFeatSelExhaustive.showProgressBar</title>

prtFeatSelExhaustive.showProgressBar</title>

 Help Not Available</title> -  No additional information is available at this time.


LOCAL_PATH := $(call my-dir)

# This is a multi-call static binary which contains the
# GPL filesystem tools.

include $(CLEAR_VARS)
LOCAL_MODULE := fstools
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
LOCAL_SRC_FILES := fstools.cpp
LOCAL_FORCE_STATIC_EXECUTABLE := true

LOCAL_WHOLE_STATIC_LIBRARIES += \
	libfuse_static

LOCAL_WHOLE_STATIC_LIBRARIES += \
	libntfs-3g_static \
	libntfs3g_fsck_static \
	libntfs3g_mkfs_main \
	libntfs3g_mount_static

LOCAL_WHOLE_STATIC_LIBRARIES += \
	libext2fs \
	libe2fsck_static \
	libmke2fs_static \
	libtune2fs

LOCAL_WHOLE_STATIC_LIBRARIES += \
	libf2fs_static \
	libf2fs_fsck_static \
	libf2fs_mkfs_static

LOCAL_WHOLE_STATIC_LIBRARIES += \
	libsgdisk_static

LOCAL_STATIC_LIBRARIES := \
	libext2_blkid \
	libext2_uuid \
	libext2_profile \
	libext2_quota \
	libext2_com_err \
	libext2_e2p \
	libc++_static \
	libc \
	libm \
	libselinux

FSTOOLS_LINKS := \
	e2fsck mke2fs tune2fs fsck.ext4 mkfs.ext4 \
	fsck.ntfs mkfs.ntfs mount.ntfs \
	mkfs.f2fs fsck.f2fs

ifeq ($(TARGET_USES_EXFAT),true)
LOCAL_CFLAGS += -DHAVE_EXFAT
LOCAL_WHOLE_STATIC_LIBRARIES += \
	libexfat_static \
	libexfat_fsck_static \
	libexfat_mkfs_static \
	libexfat_mount_static
FSTOOLS_LINKS += \
	fsck.exfat mkfs.exfat mount.exfat
endif

FSTOOLS_LINKS += \
	sgdisk

LOCAL_POST_INSTALL_CMD := \
    $(hide) $(foreach t,$(FSTOOLS_LINKS),ln -sf fstools $(TARGET_RECOVERY_ROOT_OUT)/sbin/$(t);)
include $(BUILD_EXECUTABLE)


#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/calc.h>

/****************************************************************
sub(a,b) = a - b
****************************************************************/

int f_sub(int argc, const int *argt, void **args)
{
    int i;

    if (argc < 2)
	return E_ARG_LO;
    if (argc > 2)
	return E_ARG_HI;

    if (argt[1] != argt[0] || argt[2] != argt[0])
	return E_ARG_TYPE;

    switch (argt[0]) {
    case CELL_TYPE:
	{
	    CELL *res = args[0];
	    CELL *arg1 = args[1];
	    CELL *arg2 = args[2];

	    for (i = 0; i < columns; i++) {
		if (IS_NULL_C(&arg1[i]) || IS_NULL_C(&arg2[i]))
		    SET_NULL_C(&res[i]);
		else
		    res[i] = arg1[i] - arg2[i];
	    }
	    return 0;
	}
    case FCELL_TYPE:
	{
	    FCELL *res = args[0];
	    FCELL *arg1 = args[1];
	    FCELL *arg2 = args[2];

	    for (i = 0; i < columns; i++) {
		if (IS_NULL_F(&arg1[i]) || IS_NULL_F(&arg2[i]))
		    SET_NULL_F(&res[i]);
		else
		    res[i] = arg1[i] - arg2[i];
	    }
	    return 0;
	}
    case DCELL_TYPE:
	{
	    DCELL *res = args[0];
	    DCELL *arg1 = args[1];
	    DCELL *arg2 = args[2];

	    for (i = 0; i < columns; i++) {
		if (IS_NULL_D(&arg1[i]) || IS_NULL_D(&arg2[i]))
		    SET_NULL_D(&res[i]);
		else
		    res[i] = arg1[i] - arg2[i];
	    }
	    return 0;
	}
    default:
	return E_INV_TYPE;
    }
}


# frozen_string_literal: true

require "dry/logic/predicates"
require "hanami/utils/class_attribute"

module Hanami
  module Validations
    # Mixin to include when defining shared predicates
    #
    # @since 0.6.0
    #
    # @see Hanami::Validations::ClassMethods#predicates
    #
    # @example Inline Predicate
    #   require 'hanami/validations'
    #
    #   module MySharedPredicates
    #     include Hanami::Validations::Predicates
    #
    #     predicate :foo? do |actual|
    #       actual == 'foo'
    #     end
    #   end
    #
    #   class MyValidator
    #     include Hanami::Validations
    #     predicates MySharedPredicates
    #
    #     validations do
    #       required(:name).filled(:foo?)
    #     end
    #   end
    module Predicates
      # @since 0.6.0
      # @api private
      def self.included(base)
        base.class_eval do
          include Dry::Logic::Predicates
          include Utils::ClassAttribute

          class_attribute :messages
          class_attribute :messages_path
        end
      end
    end
  end
end


require 'spec_helper'

describe Project do
  it { should have_many(:accounts) }
  it { should have_many(:account_ledgers) }
end


# This file is distributed under the same license as the Django package.
#
# Translators:
# Dimmus <dmitri.chudinov@gmail.com>, 2011.
# Eugene MechanisM <contact@mechanism.name>, 2012.
# Jannis Leidel <jannis@leidel.info>, 2011.
# Алексей Борискин <sun.void@gmail.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-10-15 10:57+0200\n"
"PO-Revision-Date: 2012-03-07 08:58+0000\n"
"Last-Translator: Алексей Борискин <sun.void@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/django/language/"
"ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: tests.py:125 templatetags/humanize.py:167
msgid "today"
msgstr "сегодня"

#: tests.py:125 templatetags/humanize.py:171
msgid "yesterday"
msgstr "вчера"

#: tests.py:125 templatetags/humanize.py:169
msgid "tomorrow"
msgstr "завтра"

#: templatetags/humanize.py:25
msgid "th"
msgstr "ий"

#: templatetags/humanize.py:25
msgid "st"
msgstr "ый"

#: templatetags/humanize.py:25
msgid "nd"
msgstr "ой"

#: templatetags/humanize.py:25
msgid "rd"
msgstr "ий"

#: templatetags/humanize.py:54
#, python-format
msgid "%(value).1f million"
msgid_plural "%(value).1f million"
msgstr[0] "%(value).1f миллион"
msgstr[1] "%(value).1f миллиона"
msgstr[2] "%(value).1f миллионов"

#: templatetags/humanize.py:55
#, python-format
msgid "%(value)s million"
msgid_plural "%(value)s million"
msgstr[0] "%(value)s миллион"
msgstr[1] "%(value)s миллиона"
msgstr[2] "%(value)s миллионов"

#: templatetags/humanize.py:58
#, python-format
msgid "%(value).1f billion"
msgid_plural "%(value).1f billion"
msgstr[0] "%(value).1f миллиард"
msgstr[1] "%(value).1f миллиарда"
msgstr[2] "%(value).1f миллиардов"

#: templatetags/humanize.py:59
#, python-format
msgid "%(value)s billion"
msgid_plural "%(value)s billion"
msgstr[0] "%(value)s миллиард"
msgstr[1] "%(value)s миллиарда"
msgstr[2] "%(value)s миллиардов"

#: templatetags/humanize.py:62
#, python-format
msgid "%(value).1f trillion"
msgid_plural "%(value).1f trillion"
msgstr[0] "%(value).1f триллион"
msgstr[1] "%(value).1f триллиона"
msgstr[2] "%(value).1f триллионов"

#: templatetags/humanize.py:63
#, python-format
msgid "%(value)s trillion"
msgid_plural "%(value)s trillion"
msgstr[0] "%(value)s триллион"
msgstr[1] "%(value)s триллиона"
msgstr[2] "%(value)s триллионов"

#: templatetags/humanize.py:66
#, python-format
msgid "%(value).1f quadrillion"
msgid_plural "%(value).1f quadrillion"
msgstr[0] "%(value).1f квадриллион"
msgstr[1] "%(value).1f квадриллиона"
msgstr[2] "%(value).1f квадриллионов"

#: templatetags/humanize.py:67
#, python-format
msgid "%(value)s quadrillion"
msgid_plural "%(value)s quadrillion"
msgstr[0] "%(value)s квадриллион"
msgstr[1] "%(value)s квадриллиона"
msgstr[2] "%(value)s квадриллионов"

#: templatetags/humanize.py:70
#, python-format
msgid "%(value).1f quintillion"
msgid_plural "%(value).1f quintillion"
msgstr[0] "%(value).1f квинтиллион"
msgstr[1] "%(value).1f квинтиллиона"
msgstr[2] "%(value).1f квинтиллионов"

#: templatetags/humanize.py:71
#, python-format
msgid "%(value)s quintillion"
msgid_plural "%(value)s quintillion"
msgstr[0] "%(value)s квинтиллион"
msgstr[1] "%(value)s квинтиллиона"
msgstr[2] "%(value)s квинтиллионов"

#: templatetags/humanize.py:74
#, python-format
msgid "%(value).1f sextillion"
msgid_plural "%(value).1f sextillion"
msgstr[0] "%(value).1f секстиллион"
msgstr[1] "%(value).1f секстиллиона"
msgstr[2] "%(value).1f секстиллионов"

#: templatetags/humanize.py:75
#, python-format
msgid "%(value)s sextillion"
msgid_plural "%(value)s sextillion"
msgstr[0] "%(value)s секстиллион"
msgstr[1] "%(value)s секстиллиона"
msgstr[2] "%(value)s секстиллионов"

#: templatetags/humanize.py:78
#, python-format
msgid "%(value).1f septillion"
msgid_plural "%(value).1f septillion"
msgstr[0] "%(value).1f септиллион"
msgstr[1] "%(value).1f септиллиона"
msgstr[2] "%(value).1f септиллионов"

#: templatetags/humanize.py:79
#, python-format
msgid "%(value)s septillion"
msgid_plural "%(value)s septillion"
msgstr[0] "%(value)s септиллион"
msgstr[1] "%(value)s септиллиона"
msgstr[2] "%(value)s септиллионов"

#: templatetags/humanize.py:82
#, python-format
msgid "%(value).1f octillion"
msgid_plural "%(value).1f octillion"
msgstr[0] "%(value).1f октиллион"
msgstr[1] "%(value).1f октиллиона"
msgstr[2] "%(value).1f октиллионов"

#: templatetags/humanize.py:83
#, python-format
msgid "%(value)s octillion"
msgid_plural "%(value)s octillion"
msgstr[0] "%(value)s октиллион"
msgstr[1] "%(value)s октиллиона"
msgstr[2] "%(value)s октиллионов"

#: templatetags/humanize.py:86
#, python-format
msgid "%(value).1f nonillion"
msgid_plural "%(value).1f nonillion"
msgstr[0] "%(value).1f нониллион"
msgstr[1] "%(value).1f нониллиона"
msgstr[2] "%(value).1f нониллионов"

#: templatetags/humanize.py:87
#, python-format
msgid "%(value)s nonillion"
msgid_plural "%(value)s nonillion"
msgstr[0] "%(value)s нониллион"
msgstr[1] "%(value)s нониллиона"
msgstr[2] "%(value)s нониллионов"

#: templatetags/humanize.py:90
#, python-format
msgid "%(value).1f decillion"
msgid_plural "%(value).1f decillion"
msgstr[0] "%(value).1f дециллион"
msgstr[1] "%(value).1f дециллиона"
msgstr[2] "%(value).1f дециллионов"

#: templatetags/humanize.py:91
#, python-format
msgid "%(value)s decillion"
msgid_plural "%(value)s decillion"
msgstr[0] "%(value)s дециллион"
msgstr[1] "%(value)s дециллиона"
msgstr[2] "%(value)s дециллионов"

#: templatetags/humanize.py:94
#, python-format
msgid "%(value).1f googol"
msgid_plural "%(value).1f googol"
msgstr[0] "%(value).1f гугол"
msgstr[1] "%(value).1f гугола"
msgstr[2] "%(value).1f гуголов"

#: templatetags/humanize.py:95
#, python-format
msgid "%(value)s googol"
msgid_plural "%(value)s googol"
msgstr[0] "%(value)s гугол"
msgstr[1] "%(value)s гугола"
msgstr[2] "%(value)s гуголов"

#: templatetags/humanize.py:144
msgid "one"
msgstr "один"

#: templatetags/humanize.py:144
msgid "two"
msgstr "два"

#: templatetags/humanize.py:144
msgid "three"
msgstr "три"

#: templatetags/humanize.py:144
msgid "four"
msgstr "четыре"

#: templatetags/humanize.py:144
msgid "five"
msgstr "пять"

#: templatetags/humanize.py:144
msgid "six"
msgstr "шесть"

#: templatetags/humanize.py:144
msgid "seven"
msgstr "семь"

#: templatetags/humanize.py:144
msgid "eight"
msgstr "восемь"

#: templatetags/humanize.py:144
msgid "nine"
msgstr "девять"

#: templatetags/humanize.py:190
#, python-format
msgctxt "naturaltime"
msgid "%(delta)s ago"
msgstr "%(delta)s назад"

#: templatetags/humanize.py:193 templatetags/humanize.py:215
msgid "now"
msgstr "сейчас"

#: templatetags/humanize.py:196
#, python-format
msgid "a second ago"
msgid_plural "%(count)s seconds ago"
msgstr[0] "%(count)s секунду назад"
msgstr[1] "%(count)s секунды назад"
msgstr[2] "%(count)s секунд назад"

#: templatetags/humanize.py:201
#, python-format
msgid "a minute ago"
msgid_plural "%(count)s minutes ago"
msgstr[0] "%(count)s минуту назад"
msgstr[1] "%(count)s минуты назад"
msgstr[2] "%(count)s минут назад"

#: templatetags/humanize.py:206
#, python-format
msgid "an hour ago"
msgid_plural "%(count)s hours ago"
msgstr[0] "%(count)s час назад"
msgstr[1] "%(count)s часа назад"
msgstr[2] "%(count)s часов назад"

#: templatetags/humanize.py:212
#, python-format
msgctxt "naturaltime"
msgid "%(delta)s from now"
msgstr "через %(delta)s"

#: templatetags/humanize.py:218
#, python-format
msgid "a second from now"
msgid_plural "%(count)s seconds from now"
msgstr[0] "через %(count)s секунду"
msgstr[1] "через %(count)s секунды"
msgstr[2] "через %(count)s секунд"

#: templatetags/humanize.py:223
#, python-format
msgid "a minute from now"
msgid_plural "%(count)s minutes from now"
msgstr[0] "через %(count)s минуту"
msgstr[1] "через %(count)s минуты"
msgstr[2] "через %(count)s минут"

#: templatetags/humanize.py:228
#, python-format
msgid "an hour from now"
msgid_plural "%(count)s hours from now"
msgstr[0] "через %(count)s час"
msgstr[1] "через %(count)s часа"
msgstr[2] "через %(count)s часов"


#include "string_utils.h"

#include <stdlib.h>
#include <string.h>

// string_utils_strsep is a string.h strsep version, checking that the delimiter is not preceeded by an escape character ('\').
// To do this, the "pc" variable has been added to https://opensource.apple.com/source/xnu/xnu-1228.7.58/bsd/libkern/strsep.c
char *string_utils_strsep(char **stringp, const char *delim) {
  char *s;
  int sc, pc = 0;
  char *tok;

  if ((s = *stringp) == NULL)
    return (NULL);
  for (tok = s;;) {
    const int c = *s++;
    const char *spanp = delim;
    do {
      if ((sc = *spanp++) == c && pc != '\\') {
        if (c == 0)
          s = NULL;
        else
          s[-1] = 0;
        *stringp = s;
        return (tok);
      }
    } while (sc != 0);
    pc = c;
  }
}

// ref. https://stackoverflow.com/a/779960/2210777
char *string_utils_replace(char *orig, char *rep, char *with) {
  char *result, *ins, *tmp;
  int len_rep, len_with, count;

  if (!orig || !rep)
    return NULL;
  len_rep = strlen(rep);
  if (len_rep == 0)
    return NULL;
  if (!with)
    with = "";
  len_with = strlen(with);

  ins = orig;
  for (count = 0; (tmp = strstr(ins, rep)); ++count)
    ins = tmp + len_rep;

  tmp = result = malloc(strlen(orig) + (len_with - len_rep) * count + 1);
  if (!result)
    return NULL;

  while (count--) {
    ins = strstr(orig, rep);
    const int len_front = ins - orig;
    tmp = strncpy(tmp, orig, len_front) + len_front;
    tmp = strcpy(tmp, with) + len_with;
    orig += len_front + len_rep;
  }
  strcpy(tmp, orig);
  return result;
}


-- | The FromGHC module provides a way to transform the GHC AST into our AST. This transformation is done in
-- the Ghc monad. The conversion can be performed from the Parsed and the Renamed GHC AST. If the renamed AST
-- is given, additional semantic information is looked up while traversing the AST.
module Language.Haskell.Tools.BackendGHC
  ( trfModule, trfModuleRename, addTypeInfos, runTrf
  , SpliceInsertionProblem(..), ConvertionProblem(..)
  ) where

import Language.Haskell.Tools.BackendGHC.AddTypeInfo (addTypeInfos)
import Language.Haskell.Tools.BackendGHC.Modules (trfModule, trfModuleRename)
import Language.Haskell.Tools.BackendGHC.Monad (runTrf, SpliceInsertionProblem(..))
import Language.Haskell.Tools.BackendGHC.Utils (ConvertionProblem(..))


// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyTitle("System.Web.Http.SelfHost")]
[assembly: AssemblyDescription("")]
[assembly: InternalsVisibleTo("System.Web.Http.SelfHost.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]


// Copyright 2017, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package trace

import (
	"time"
)

// samplePeriod is the minimum time between accepting spans in a single bucket.
const samplePeriod = time.Second

// defaultLatencies contains the default latency bucket bounds.
// TODO: consider defaults, make configurable
var defaultLatencies = [...]time.Duration{
	10 * time.Microsecond,
	100 * time.Microsecond,
	time.Millisecond,
	10 * time.Millisecond,
	100 * time.Millisecond,
	time.Second,
	10 * time.Second,
	time.Minute,
}

// bucket is a container for a set of spans for a particular error code or latency range.
type bucket struct {
	nextTime  time.Time   // next time we can accept a span
	buffer    []*SpanData // circular buffer of spans
	nextIndex int         // location next SpanData should be placed in buffer
	overflow  bool        // whether the circular buffer has wrapped around
}

func makeBucket(bufferSize int) bucket {
	return bucket{
		buffer: make([]*SpanData, bufferSize),
	}
}

// add adds a span to the bucket, if nextTime has been reached.
func (b *bucket) add(s *SpanData) {
	if s.EndTime.Before(b.nextTime) {
		return
	}
	if len(b.buffer) == 0 {
		return
	}
	b.nextTime = s.EndTime.Add(samplePeriod)
	b.buffer[b.nextIndex] = s
	b.nextIndex++
	if b.nextIndex == len(b.buffer) {
		b.nextIndex = 0
		b.overflow = true
	}
}

// size returns the number of spans in the bucket.
func (b *bucket) size() int {
	if b.overflow {
		return len(b.buffer)
	}
	return b.nextIndex
}

// span returns the ith span in the bucket.
func (b *bucket) span(i int) *SpanData {
	if !b.overflow {
		return b.buffer[i]
	}
	if i < len(b.buffer)-b.nextIndex {
		return b.buffer[b.nextIndex+i]
	}
	return b.buffer[b.nextIndex+i-len(b.buffer)]
}

// resize changes the size of the bucket to n, keeping up to n existing spans.
func (b *bucket) resize(n int) {
	cur := b.size()
	newBuffer := make([]*SpanData, n)
	if cur < n {
		for i := 0; i < cur; i++ {
			newBuffer[i] = b.span(i)
		}
		b.buffer = newBuffer
		b.nextIndex = cur
		b.overflow = false
		return
	}
	for i := 0; i < n; i++ {
		newBuffer[i] = b.span(i + cur - n)
	}
	b.buffer = newBuffer
	b.nextIndex = 0
	b.overflow = true
}

// latencyBucket returns the appropriate bucket number for a given latency.
func latencyBucket(latency time.Duration) int {
	i := 0
	for i < len(defaultLatencies) && latency >= defaultLatencies[i] {
		i++
	}
	return i
}

// latencyBucketBounds returns the lower and upper bounds for a latency bucket
// number.
//
// The lower bound is inclusive, the upper bound is exclusive (except for the
// last bucket.)
func latencyBucketBounds(index int) (lower time.Duration, upper time.Duration) {
	if index == 0 {
		return 0, defaultLatencies[index]
	}
	if index == len(defaultLatencies) {
		return defaultLatencies[index-1], 1<<63 - 1
	}
	return defaultLatencies[index-1], defaultLatencies[index]
}


import alerts from './alerts'
import datatable from './datatable'
import details from './details'
import itemElements from './item-elements'

export default {
  global: {
    alerts,
    datatable,
    details,
    itemElements,
  },
}


// Package endpoint implements the HAP endpoints.
package endpoint