text:
{{{
  "title": "Dedicated Load Balancer Basic Management Using CLI",
  "date": "9-1-2015",
  "author": "Mark Turpin",
  "attachments": [],
  "contentIsHTML": false
}}}

### Dedicated Load Balancer Basic Management Using CLI

This KB will go over the basics of creating a Load Balancer VIP and Services when using the Command Line Interface (CLI) for dedicated Load Balancers

### Prerequisites

* HA Dedicated Load Balancers have been deployed to your account
* Must have an Admin login to the Netscaler
* Must be able to SSH to the RNAT IP of the HA pair (typically ends with .101)

### Notes

* This example will configure a 2 node web server farm that is load balancing traffic on http (port 80) and using "cookie insert" for persistence type
* Least connection is the default load balancing algorithm
* Ping/TCP checks are the default health monitors

### Steps

1. Log into your dedicated load balancer RNAT IP (typically ends with .101) using SSH and an Admin login
2. Now in the CLI, we will create the server objects.  These will be the web servers being load balanced.

  ```
  add server VA1ACMEWEB01 10.10.10.15
  add server VA1ACMEWEB02 10.10.10.16
  ```

3. Next, we will create a service for both servers (using HTTP)

  ```
  add service VA1ACMEWEB01_http_80 VA1ACMEWEB01 http 80
  add service VA1ACMEWEB02_http_80 VA1ACMEWEB02 http 80
  ```

4. Next, we will create the Virtual Server.  We will use the website name and port in the name for ease of management.  The Virtual Server VIP comes from the pool of private IP's provisioned by the NOC during deployment of the HA pair.

  ```
  add lb vserver www-prod-acme_80 http 10.10.10.104 80
  ```

5. Now that we have the Virtual Server object created, we need to bind both services to it.

  ```
  bind lb vserver www-prod-acme_80 VA1ACMEWEB01_http_80
  bind lb vserver www-prod-acme_80 VA1ACMEWEB02_http_80
  ```

6. Lastly, we will set the persistence type on the Virtual Server to use Cookie Insert

  ```
  set lb vserver www-prod-acme_80 -persistenceType COOKIEINSERT
  ```

### Additional Notes

* This example was performed on Netscaler VPX version 10.5
* For configuration with the GUI, please review [Dedicated LB Basic Management](../Network/dedicated-load-balancer-basic-management.md) for the basics of creating a Load Balancer VIP and Service Group when using Dedicated Load Balancers
* If you begin to add additional networks to load balance in your environment, please review [Load Balance Additional Networks](../Network/loadbalance-additional-networks.md)


text:
Simple Modern Portfolio Theory in Python. Uses [pandas-datareader](http://pandas-datareader.readthedocs.io/en/latest/remote_data.html) for Yahoo Fiance data. Efficient frontier computed using [scipy.optimize.minimize](https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.optimize.minimize.html).

### plotly
[![](https://plot.ly/~zhy0/2/.png)](https://plot.ly/~zhy0/2.embed)

### matplotlib
![](https://github.com/zhy0/mpt/raw/master/frontier.png)

### Possible to-do's:
- Make it easier to use; maybe rewrite in OOP.
- Make it possible to compute based on weekly or monthly data.

redpajama_set_name: RedPajamaGithub


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response

class CountryTestCase(IntegrationTestCase):

    def test_list_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.pricing.v1.phone_numbers \
                                  .countries.list()

        self.holodeck.assert_has_request(Request(
            'get',
            'https://pricing.twilio.com/v1/PhoneNumbers/Countries',
        ))

    def test_read_full_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "countries": [
                    {
                        "country": "Austria",
                        "iso_country": "AT",
                        "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries/AT"
                    }
                ],
                "meta": {
                    "page": 0,
                    "page_size": 50,
                    "first_page_url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=50&Page=0",
                    "previous_page_url": null,
                    "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=50&Page=0",
                    "next_page_url": null,
                    "key": "countries"
                }
            }
            '''
        ))

        actual = self.client.pricing.v1.phone_numbers \
                                       .countries.list()

        self.assertIsNotNone(actual)

    def test_read_empty_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "countries": [],
                "meta": {
                    "first_page_url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=50&Page=0",
                    "key": "countries",
                    "next_page_url": null,
                    "page": 0,
                    "page_size": 50,
                    "previous_page_url": null,
                    "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=50&Page=0"
                }
            }
            '''
        ))

        actual = self.client.pricing.v1.phone_numbers \
                                       .countries.list()

        self.assertIsNotNone(actual)

    def test_fetch_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.pricing.v1.phone_numbers \
                                  .countries("US").fetch()

        self.holodeck.assert_has_request(Request(
            'get',
            'https://pricing.twilio.com/v1/PhoneNumbers/Countries/US',
        ))

    def test_fetch_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "country": "United States",
                "iso_country": "US",
                "phone_number_prices": [
                    {
                        "number_type": "local",
                        "base_price": "1.00",
                        "current_price": "1.00"
                    },
                    {
                        "number_type": "toll free",
                        "base_price": "2.00",
                        "current_price": "2.00"
                    }
                ],
                "price_unit": "USD",
                "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries/US"
            }
            '''
        ))

        actual = self.client.pricing.v1.phone_numbers \
                                       .countries("US").fetch()

        self.assertIsNotNone(actual)


text:
//
//  ZJFrameBoundsViewController.m
//  ZJCoreAnimation
//
//  Created by ZJ on 2019/3/26.
//  Copyright © 2019 YunTu. All rights reserved.
//

#import "ZJFrameBoundsViewController.h"

@interface ZJFrameBoundsViewController ()

@end

@implementation ZJFrameBoundsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
var searchData=
[
  ['likeprof_5fnumber',['likeprof_number',['../classlikeprof__number.html',1,'likeprof_number'],['../classlikeprof__number.html#ad4170b7b791a9c289bd178b416c8a884',1,'likeprof_number::likeprof_number()']]],
  ['log_5fbinit',['log_binit',['../classmodel__parameters.html#a2fba40ad97ce63b49cbd53b4b016e39c',1,'model_parameters']]]
];


text:
<?php

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * NmtInventoryMv
 *
 * @ORM\Table(name="nmt_inventory_mv", indexes={@ORM\Index(name="nmt_inventory_mv_FK1_idx", columns={"created_by"}), @ORM\Index(name="nmt_inventory_mv_FK2_idx", columns={"warehouse_id"}), @ORM\Index(name="nmt_inventory_mv_FK3_idx", columns={"posting_period"}), @ORM\Index(name="nmt_inventory_mv_FK4_idx", columns={"currency_id"}), @ORM\Index(name="nmt_inventory_mv_FK5_idx", columns={"doc_currency_id"}), @ORM\Index(name="nmt_inventory_mv_FK6_idx", columns={"local_currency_id"}), @ORM\Index(name="nmt_inventory_mv_FK7_idx", columns={"target_warehouse"}), @ORM\Index(name="nmt_inventory_mv_FK8_idx", columns={"source_location"}), @ORM\Index(name="nmt_inventory_mv_FK9_idx", columns={"tartget_location"}), @ORM\Index(name="nmt_inventory_mv_FK10_idx", columns={"company_id"}), @ORM\Index(name="nmt_inventory_mv_FK11_idx", columns={"vendor_id"})})
 * @ORM\Entity
 */
class NmtInventoryMv
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="token", type="string", length=45, nullable=true)
     */
    private $token;

    /**
     * @var string
     *
     * @ORM\Column(name="currency_iso3", type="string", length=3, nullable=true)
     */
    private $currencyIso3;

    /**
     * @var string
     *
     * @ORM\Column(name="exchange_rate", type="decimal", precision=15, scale=4, nullable=true)
     */
    private $exchangeRate;

    /**
     * @var string
     *
     * @ORM\Column(name="remarks", type="text", length=65535, nullable=true)
     */
    private $remarks;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_on", type="datetime", nullable=true)
     */
    private $createdOn;

    /**
     * @var string
     *
     * @ORM\Column(name="current_state", type="string", length=45, nullable=true)
     */
    private $currentState;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_active", type="boolean", nullable=true)
     */
    private $isActive;

    /**
     * @var string
     *
     * @ORM\Column(name="trx_type", type="string", length=45, nullable=true)
     */
    private $trxType;

    /**
     * @var integer
     *
     * @ORM\Column(name="lastchange_by", type="integer", nullable=true)
     */
    private $lastchangeBy;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="lastchange_on", type="datetime", nullable=true)
     */
    private $lastchangeOn;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="posting_date", type="datetime", nullable=true)
     */
    private $postingDate;

    /**
     * @var string
     *
     * @ORM\Column(name="sap_doc", type="string", length=45, nullable=true)
     */
    private $sapDoc;

    /**
     * @var string
     *
     * @ORM\Column(name="contract_no", type="string", length=45, nullable=true)
     */
    private $contractNo;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="contract_date", type="datetime", nullable=true)
     */
    private $contractDate;

    /**
     * @var string
     *
     * @ORM\Column(name="quotation_no", type="string", length=45, nullable=true)
     */
    private $quotationNo;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="quotation_date", type="datetime", nullable=true)
     */
    private $quotationDate;

    /**
     * @var string
     *
     * @ORM\Column(name="sys_number", type="string", length=45, nullable=true)
     */
    private $sysNumber;

    /**
     * @var integer
     *
     * @ORM\Column(name="revision_no", type="integer", nullable=true)
     */
    private $revisionNo;

    /**
     * @var string
     *
     * @ORM\Column(name="delivery_mode", type="string", length=45, nullable=true)
     */
    private $deliveryMode;

    /**
     * @var string
     *
     * @ORM\Column(name="incoterm", type="string", length=45, nullable=true)
     */
    private $incoterm;

    /**
     * @var string
     *
     * @ORM\Column(name="incoterm_place", type="string", length=100, nullable=true)
     */
    private $incotermPlace;

    /**
     * @var string
     *
     * @ORM\Column(name="payment_term", type="string", length=45, nullable=true)
     */
    private $paymentTerm;

    /**
     * @var string
     *
     * @ORM\Column(name="payment_method", type="string", length=45, nullable=true)
     */
    private $paymentMethod;

    /**
     * @var string
     *
     * @ORM\Column(name="doc_status", type="string", length=30, nullable=true)
     */
    private $docStatus;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_draft", type="boolean", nullable=true)
     */
    private $isDraft;

    /**
     * @var string
     *
     * @ORM\Column(name="workflow_status", type="string", length=45, nullable=true)
     */
    private $workflowStatus;

    /**
     * @var string
     *
     * @ORM\Column(name="transaction_status", type="string", length=45, nullable=true)
     */
    private $transactionStatus;

    /**
     * @var string
     *
     * @ORM\Column(name="movement_type", type="string", length=10, nullable=false)
     */
    private $movementType;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="movement_date", type="datetime", nullable=true)
     */
    private $movementDate;

    /**
     * @var string
     *
     * @ORM\Column(name="journal_memo", type="string", length=255, nullable=true)
     */
    private $journalMemo;

    /**
     * @var string
     *
     * @ORM\Column(name="movement_flow", type="string", length=10, nullable=false)
     */
    private $movementFlow;

    /**
     * @var string
     *
     * @ORM\Column(name="movement_type_memo", type="text", length=65535, nullable=true)
     */
    private $movementTypeMemo;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_posted", type="boolean", nullable=true)
     */
    private $isPosted;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_reversed", type="boolean", nullable=true)
     */
    private $isReversed;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="reversal_date", type="datetime", nullable=true)
     */
    private $reversalDate;

    /**
     * @var integer
     *
     * @ORM\Column(name="reversal_doc", type="integer", nullable=true)
     */
    private $reversalDoc;

    /**
     * @var string
     *
     * @ORM\Column(name="reversal_reason", type="string", length=100, nullable=true)
     */
    private $reversalReason;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_reversable", type="boolean", nullable=true)
     */
    private $isReversable;

    /**
     * @var string
     *
     * @ORM\Column(name="doc_type", type="string", length=45, nullable=true)
     */
    private $docType;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_transfer_transaction", type="boolean", nullable=true)
     */
    private $isTransferTransaction;

    /**
     * @var boolean
     *
     * @ORM\Column(name="reversal_blocked", type="boolean", nullable=true)
     */
    private $reversalBlocked;

    /**
     * @var string
     *
     * @ORM\Column(name="uuid", type="string", length=36, nullable=true)
     */
    private $uuid;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="doc_date", type="datetime", nullable=true)
     */
    private $docDate;

    /**
     * @var string
     *
     * @ORM\Column(name="doc_number", type="string", length=100, nullable=true)
     */
    private $docNumber;

    /**
     * @var integer
     *
     * @ORM\Column(name="doc_version", type="integer", nullable=true)
     */
    private $docVersion;

    /**
     * @var integer
     *
     * @ORM\Column(name="pmt_term", type="integer", nullable=true)
     */
    private $pmtTerm;

    /**
     * @var string
     *
     * @ORM\Column(name="discount_rate", type="decimal", precision=14, scale=5, nullable=true)
     */
    private $discountRate;

    /**
     * @var integer
     *
     * @ORM\Column(name="relevant_movement_id", type="integer", nullable=true)
     */
    private $relevantMovementId;

    /**
     * @var integer
     *
     * @ORM\Column(name="base_doc_id", type="integer", nullable=true)
     */
    private $baseDocId;

    /**
     * @var string
     *
     * @ORM\Column(name="base_doc_type", type="string", length=45, nullable=true)
     */
    private $baseDocType;

    /**
     * @var integer
     *
     * @ORM\Column(name="target_doc_id", type="integer", nullable=true)
     */
    private $targetDocId;

    /**
     * @var string
     *
     * @ORM\Column(name="target_doc_type", type="string", length=45, nullable=true)
     */
    private $targetDocType;

    /**
     * @var integer
     *
     * @ORM\Column(name="clearing_doc_id", type="integer", nullable=true)
     */
    private $clearingDocId;

    /**
     * @var \Application\Entity\MlaUsers
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\MlaUsers")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="created_by", referencedColumnName="id")
     * })
     */
    private $createdBy;

    /**
     * @var \Application\Entity\NmtApplicationCompany
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationCompany")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="company_id", referencedColumnName="id")
     * })
     */
    private $company;

    /**
     * @var \Application\Entity\NmtBpVendor
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtBpVendor")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="vendor_id", referencedColumnName="id")
     * })
     */
    private $vendor;

    /**
     * @var \Application\Entity\NmtInventoryWarehouse
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtInventoryWarehouse")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="warehouse_id", referencedColumnName="id")
     * })
     */
    private $warehouse;

    /**
     * @var \Application\Entity\NmtFinPostingPeriod
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtFinPostingPeriod")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="posting_period", referencedColumnName="id")
     * })
     */
    private $postingPeriod;

    /**
     * @var \Application\Entity\NmtApplicationCurrency
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationCurrency")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="currency_id", referencedColumnName="id")
     * })
     */
    private $currency;

    /**
     * @var \Application\Entity\NmtApplicationCurrency
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationCurrency")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="doc_currency_id", referencedColumnName="id")
     * })
     */
    private $docCurrency;

    /**
     * @var \Application\Entity\NmtApplicationCurrency
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationCurrency")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="local_currency_id", referencedColumnName="id")
     * })
     */
    private $localCurrency;

    /**
     * @var \Application\Entity\NmtInventoryWarehouse
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtInventoryWarehouse")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="target_warehouse", referencedColumnName="id")
     * })
     */
    private $targetWarehouse;

    /**
     * @var \Application\Entity\NmtInventoryWarehouseLocation
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtInventoryWarehouseLocation")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="source_location", referencedColumnName="id")
     * })
     */
    private $sourceLocation;

    /**
     * @var \Application\Entity\NmtInventoryWarehouseLocation
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtInventoryWarehouseLocation")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="tartget_location", referencedColumnName="id")
     * })
     */
    private $tartgetLocation;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set token
     *
     * @param string $token
     *
     * @return NmtInventoryMv
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     * Set currencyIso3
     *
     * @param string $currencyIso3
     *
     * @return NmtInventoryMv
     */
    public function setCurrencyIso3($currencyIso3)
    {
        $this->currencyIso3 = $currencyIso3;

        return $this;
    }

    /**
     * Get currencyIso3
     *
     * @return string
     */
    public function getCurrencyIso3()
    {
        return $this->currencyIso3;
    }

    /**
     * Set exchangeRate
     *
     * @param string $exchangeRate
     *
     * @return NmtInventoryMv
     */
    public function setExchangeRate($exchangeRate)
    {
        $this->exchangeRate = $exchangeRate;

        return $this;
    }

    /**
     * Get exchangeRate
     *
     * @return string
     */
    public function getExchangeRate()
    {
        return $this->exchangeRate;
    }

    /**
     * Set remarks
     *
     * @param string $remarks
     *
     * @return NmtInventoryMv
     */
    public function setRemarks($remarks)
    {
        $this->remarks = $remarks;

        return $this;
    }

    /**
     * Get remarks
     *
     * @return string
     */
    public function getRemarks()
    {
        return $this->remarks;
    }

    /**
     * Set createdOn
     *
     * @param \DateTime $createdOn
     *
     * @return NmtInventoryMv
     */
    public function setCreatedOn($createdOn)
    {
        $this->createdOn = $createdOn;

        return $this;
    }

    /**
     * Get createdOn
     *
     * @return \DateTime
     */
    public function getCreatedOn()
    {
        return $this->createdOn;
    }

    /**
     * Set currentState
     *
     * @param string $currentState
     *
     * @return NmtInventoryMv
     */
    public function setCurrentState($currentState)
    {
        $this->currentState = $currentState;

        return $this;
    }

    /**
     * Get currentState
     *
     * @return string
     */
    public function getCurrentState()
    {
        return $this->currentState;
    }

    /**
     * Set isActive
     *
     * @param boolean $isActive
     *
     * @return NmtInventoryMv
     */
    public function setIsActive($isActive)
    {
        $this->isActive = $isActive;

        return $this;
    }

    /**
     * Get isActive
     *
     * @return boolean
     */
    public function getIsActive()
    {
        return $this->isActive;
    }

    /**
     * Set trxType
     *
     * @param string $trxType
     *
     * @return NmtInventoryMv
     */
    public function setTrxType($trxType)
    {
        $this->trxType = $trxType;

        return $this;
    }

    /**
     * Get trxType
     *
     * @return string
     */
    public function getTrxType()
    {
        return $this->trxType;
    }

    /**
     * Set lastchangeBy
     *
     * @param integer $lastchangeBy
     *
     * @return NmtInventoryMv
     */
    public function setLastchangeBy($lastchangeBy)
    {
        $this->lastchangeBy = $lastchangeBy;

        return $this;
    }

    /**
     * Get lastchangeBy
     *
     * @return integer
     */
    public function getLastchangeBy()
    {
        return $this->lastchangeBy;
    }

    /**
     * Set lastchangeOn
     *
     * @param \DateTime $lastchangeOn
     *
     * @return NmtInventoryMv
     */
    public function setLastchangeOn($lastchangeOn)
    {
        $this->lastchangeOn = $lastchangeOn;

        return $this;
    }

    /**
     * Get lastchangeOn
     *
     * @return \DateTime
     */
    public function getLastchangeOn()
    {
        return $this->lastchangeOn;
    }

    /**
     * Set postingDate
     *
     * @param \DateTime $postingDate
     *
     * @return NmtInventoryMv
     */
    public function setPostingDate($postingDate)
    {
        $this->postingDate = $postingDate;

        return $this;
    }

    /**
     * Get postingDate
     *
     * @return \DateTime
     */
    public function getPostingDate()
    {
        return $this->postingDate;
    }

    /**
     * Set sapDoc
     *
     * @param string $sapDoc
     *
     * @return NmtInventoryMv
     */
    public function setSapDoc($sapDoc)
    {
        $this->sapDoc = $sapDoc;

        return $this;
    }

    /**
     * Get sapDoc
     *
     * @return string
     */
    public function getSapDoc()
    {
        return $this->sapDoc;
    }

    /**
     * Set contractNo
     *
     * @param string $contractNo
     *
     * @return NmtInventoryMv
     */
    public function setContractNo($contractNo)
    {
        $this->contractNo = $contractNo;

        return $this;
    }

    /**
     * Get contractNo
     *
     * @return string
     */
    public function getContractNo()
    {
        return $this->contractNo;
    }

    /**
     * Set contractDate
     *
     * @param \DateTime $contractDate
     *
     * @return NmtInventoryMv
     */
    public function setContractDate($contractDate)
    {
        $this->contractDate = $contractDate;

        return $this;
    }

    /**
     * Get contractDate
     *
     * @return \DateTime
     */
    public function getContractDate()
    {
        return $this->contractDate;
    }

    /**
     * Set quotationNo
     *
     * @param string $quotationNo
     *
     * @return NmtInventoryMv
     */
    public function setQuotationNo($quotationNo)
    {
        $this->quotationNo = $quotationNo;

        return $this;
    }

    /**
     * Get quotationNo
     *
     * @return string
     */
    public function getQuotationNo()
    {
        return $this->quotationNo;
    }

    /**
     * Set quotationDate
     *
     * @param \DateTime $quotationDate
     *
     * @return NmtInventoryMv
     */
    public function setQuotationDate($quotationDate)
    {
        $this->quotationDate = $quotationDate;

        return $this;
    }

    /**
     * Get quotationDate
     *
     * @return \DateTime
     */
    public function getQuotationDate()
    {
        return $this->quotationDate;
    }

    /**
     * Set sysNumber
     *
     * @param string $sysNumber
     *
     * @return NmtInventoryMv
     */
    public function setSysNumber($sysNumber)
    {
        $this->sysNumber = $sysNumber;

        return $this;
    }

    /**
     * Get sysNumber
     *
     * @return string
     */
    public function getSysNumber()
    {
        return $this->sysNumber;
    }

    /**
     * Set revisionNo
     *
     * @param integer $revisionNo
     *
     * @return NmtInventoryMv
     */
    public function setRevisionNo($revisionNo)
    {
        $this->revisionNo = $revisionNo;

        return $this;
    }

    /**
     * Get revisionNo
     *
     * @return integer
     */
    public function getRevisionNo()
    {
        return $this->revisionNo;
    }

    /**
     * Set deliveryMode
     *
     * @param string $deliveryMode
     *
     * @return NmtInventoryMv
     */
    public function setDeliveryMode($deliveryMode)
    {
        $this->deliveryMode = $deliveryMode;

        return $this;
    }

    /**
     * Get deliveryMode
     *
     * @return string
     */
    public function getDeliveryMode()
    {
        return $this->deliveryMode;
    }

    /**
     * Set incoterm
     *
     * @param string $incoterm
     *
     * @return NmtInventoryMv
     */
    public function setIncoterm($incoterm)
    {
        $this->incoterm = $incoterm;

        return $this;
    }

    /**
     * Get incoterm
     *
     * @return string
     */
    public function getIncoterm()
    {
        return $this->incoterm;
    }

    /**
     * Set incotermPlace
     *
     * @param string $incotermPlace
     *
     * @return NmtInventoryMv
     */
    public function setIncotermPlace($incotermPlace)
    {
        $this->incotermPlace = $incotermPlace;

        return $this;
    }

    /**
     * Get incotermPlace
     *
     * @return string
     */
    public function getIncotermPlace()
    {
        return $this->incotermPlace;
    }

    /**
     * Set paymentTerm
     *
     * @param string $paymentTerm
     *
     * @return NmtInventoryMv
     */
    public function setPaymentTerm($paymentTerm)
    {
        $this->paymentTerm = $paymentTerm;

        return $this;
    }

    /**
     * Get paymentTerm
     *
     * @return string
     */
    public function getPaymentTerm()
    {
        return $this->paymentTerm;
    }

    /**
     * Set paymentMethod
     *
     * @param string $paymentMethod
     *
     * @return NmtInventoryMv
     */
    public function setPaymentMethod($paymentMethod)
    {
        $this->paymentMethod = $paymentMethod;

        return $this;
    }

    /**
     * Get paymentMethod
     *
     * @return string
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }

    /**
     * Set docStatus
     *
     * @param string $docStatus
     *
     * @return NmtInventoryMv
     */
    public function setDocStatus($docStatus)
    {
        $this->docStatus = $docStatus;

        return $this;
    }

    /**
     * Get docStatus
     *
     * @return string
     */
    public function getDocStatus()
    {
        return $this->docStatus;
    }

    /**
     * Set isDraft
     *
     * @param boolean $isDraft
     *
     * @return NmtInventoryMv
     */
    public function setIsDraft($isDraft)
    {
        $this->isDraft = $isDraft;

        return $this;
    }

    /**
     * Get isDraft
     *
     * @return boolean
     */
    public function getIsDraft()
    {
        return $this->isDraft;
    }

    /**
     * Set workflowStatus
     *
     * @param string $workflowStatus
     *
     * @return NmtInventoryMv
     */
    public function setWorkflowStatus($workflowStatus)
    {
        $this->workflowStatus = $workflowStatus;

        return $this;
    }

    /**
     * Get workflowStatus
     *
     * @return string
     */
    public function getWorkflowStatus()
    {
        return $this->workflowStatus;
    }

    /**
     * Set transactionStatus
     *
     * @param string $transactionStatus
     *
     * @return NmtInventoryMv
     */
    public function setTransactionStatus($transactionStatus)
    {
        $this->transactionStatus = $transactionStatus;

        return $this;
    }

    /**
     * Get transactionStatus
     *
     * @return string
     */
    public function getTransactionStatus()
    {
        return $this->transactionStatus;
    }

    /**
     * Set movementType
     *
     * @param string $movementType
     *
     * @return NmtInventoryMv
     */
    public function setMovementType($movementType)
    {
        $this->movementType = $movementType;

        return $this;
    }

    /**
     * Get movementType
     *
     * @return string
     */
    public function getMovementType()
    {
        return $this->movementType;
    }

    /**
     * Set movementDate
     *
     * @param \DateTime $movementDate
     *
     * @return NmtInventoryMv
     */
    public function setMovementDate($movementDate)
    {
        $this->movementDate = $movementDate;

        return $this;
    }

    /**
     * Get movementDate
     *
     * @return \DateTime
     */
    public function getMovementDate()
    {
        return $this->movementDate;
    }

    /**
     * Set journalMemo
     *
     * @param string $journalMemo
     *
     * @return NmtInventoryMv
     */
    public function setJournalMemo($journalMemo)
    {
        $this->journalMemo = $journalMemo;

        return $this;
    }

    /**
     * Get journalMemo
     *
     * @return string
     */
    public function getJournalMemo()
    {
        return $this->journalMemo;
    }

    /**
     * Set movementFlow
     *
     * @param string $movementFlow
     *
     * @return NmtInventoryMv
     */
    public function setMovementFlow($movementFlow)
    {
        $this->movementFlow = $movementFlow;

        return $this;
    }

    /**
     * Get movementFlow
     *
     * @return string
     */
    public function getMovementFlow()
    {
        return $this->movementFlow;
    }

    /**
     * Set movementTypeMemo
     *
     * @param string $movementTypeMemo
     *
     * @return NmtInventoryMv
     */
    public function setMovementTypeMemo($movementTypeMemo)
    {
        $this->movementTypeMemo = $movementTypeMemo;

        return $this;
    }

    /**
     * Get movementTypeMemo
     *
     * @return string
     */
    public function getMovementTypeMemo()
    {
        return $this->movementTypeMemo;
    }

    /**
     * Set isPosted
     *
     * @param boolean $isPosted
     *
     * @return NmtInventoryMv
     */
    public function setIsPosted($isPosted)
    {
        $this->isPosted = $isPosted;

        return $this;
    }

    /**
     * Get isPosted
     *
     * @return boolean
     */
    public function getIsPosted()
    {
        return $this->isPosted;
    }

    /**
     * Set isReversed
     *
     * @param boolean $isReversed
     *
     * @return NmtInventoryMv
     */
    public function setIsReversed($isReversed)
    {
        $this->isReversed = $isReversed;

        return $this;
    }

    /**
     * Get isReversed
     *
     * @return boolean
     */
    public function getIsReversed()
    {
        return $this->isReversed;
    }

    /**
     * Set reversalDate
     *
     * @param \DateTime $reversalDate
     *
     * @return NmtInventoryMv
     */
    public function setReversalDate($reversalDate)
    {
        $this->reversalDate = $reversalDate;

        return $this;
    }

    /**
     * Get reversalDate
     *
     * @return \DateTime
     */
    public function getReversalDate()
    {
        return $this->reversalDate;
    }

    /**
     * Set reversalDoc
     *
     * @param integer $reversalDoc
     *
     * @return NmtInventoryMv
     */
    public function setReversalDoc($reversalDoc)
    {
        $this->reversalDoc = $reversalDoc;

        return $this;
    }

    /**
     * Get reversalDoc
     *
     * @return integer
     */
    public function getReversalDoc()
    {
        return $this->reversalDoc;
    }

    /**
     * Set reversalReason
     *
     * @param string $reversalReason
     *
     * @return NmtInventoryMv
     */
    public function setReversalReason($reversalReason)
    {
        $this->reversalReason = $reversalReason;

        return $this;
    }

    /**
     * Get reversalReason
     *
     * @return string
     */
    public function getReversalReason()
    {
        return $this->reversalReason;
    }

    /**
     * Set isReversable
     *
     * @param boolean $isReversable
     *
     * @return NmtInventoryMv
     */
    public function setIsReversable($isReversable)
    {
        $this->isReversable = $isReversable;

        return $this;
    }

    /**
     * Get isReversable
     *
     * @return boolean
     */
    public function getIsReversable()
    {
        return $this->isReversable;
    }

    /**
     * Set docType
     *
     * @param string $docType
     *
     * @return NmtInventoryMv
     */
    public function setDocType($docType)
    {
        $this->docType = $docType;

        return $this;
    }

    /**
     * Get docType
     *
     * @return string
     */
    public function getDocType()
    {
        return $this->docType;
    }

    /**
     * Set isTransferTransaction
     *
     * @param boolean $isTransferTransaction
     *
     * @return NmtInventoryMv
     */
    public function setIsTransferTransaction($isTransferTransaction)
    {
        $this->isTransferTransaction = $isTransferTransaction;

        return $this;
    }

    /**
     * Get isTransferTransaction
     *
     * @return boolean
     */
    public function getIsTransferTransaction()
    {
        return $this->isTransferTransaction;
    }

    /**
     * Set reversalBlocked
     *
     * @param boolean $reversalBlocked
     *
     * @return NmtInventoryMv
     */
    public function setReversalBlocked($reversalBlocked)
    {
        $this->reversalBlocked = $reversalBlocked;

        return $this;
    }

    /**
     * Get reversalBlocked
     *
     * @return boolean
     */
    public function getReversalBlocked()
    {
        return $this->reversalBlocked;
    }

    /**
     * Set uuid
     *
     * @param string $uuid
     *
     * @return NmtInventoryMv
     */
    public function setUuid($uuid)
    {
        $this->uuid = $uuid;

        return $this;
    }

    /**
     * Get uuid
     *
     * @return string
     */
    public function getUuid()
    {
        return $this->uuid;
    }

    /**
     * Set docDate
     *
     * @param \DateTime $docDate
     *
     * @return NmtInventoryMv
     */
    public function setDocDate($docDate)
    {
        $this->docDate = $docDate;

        return $this;
    }

    /**
     * Get docDate
     *
     * @return \DateTime
     */
    public function getDocDate()
    {
        return $this->docDate;
    }

    /**
     * Set docNumber
     *
     * @param string $docNumber
     *
     * @return NmtInventoryMv
     */
    public function setDocNumber($docNumber)
    {
        $this->docNumber = $docNumber;

        return $this;
    }

    /**
     * Get docNumber
     *
     * @return string
     */
    public function getDocNumber()
    {
        return $this->docNumber;
    }

    /**
     * Set docVersion
     *
     * @param integer $docVersion
     *
     * @return NmtInventoryMv
     */
    public function setDocVersion($docVersion)
    {
        $this->docVersion = $docVersion;

        return $this;
    }

    /**
     * Get docVersion
     *
     * @return integer
     */
    public function getDocVersion()
    {
        return $this->docVersion;
    }

    /**
     * Set pmtTerm
     *
     * @param integer $pmtTerm
     *
     * @return NmtInventoryMv
     */
    public function setPmtTerm($pmtTerm)
    {
        $this->pmtTerm = $pmtTerm;

        return $this;
    }

    /**
     * Get pmtTerm
     *
     * @return integer
     */
    public function getPmtTerm()
    {
        return $this->pmtTerm;
    }

    /**
     * Set discountRate
     *
     * @param string $discountRate
     *
     * @return NmtInventoryMv
     */
    public function setDiscountRate($discountRate)
    {
        $this->discountRate = $discountRate;

        return $this;
    }

    /**
     * Get discountRate
     *
     * @return string
     */
    public function getDiscountRate()
    {
        return $this->discountRate;
    }

    /**
     * Set relevantMovementId
     *
     * @param integer $relevantMovementId
     *
     * @return NmtInventoryMv
     */
    public function setRelevantMovementId($relevantMovementId)
    {
        $this->relevantMovementId = $relevantMovementId;

        return $this;
    }

    /**
     * Get relevantMovementId
     *
     * @return integer
     */
    public function getRelevantMovementId()
    {
        return $this->relevantMovementId;
    }

    /**
     * Set baseDocId
     *
     * @param integer $baseDocId
     *
     * @return NmtInventoryMv
     */
    public function setBaseDocId($baseDocId)
    {
        $this->baseDocId = $baseDocId;

        return $this;
    }

    /**
     * Get baseDocId
     *
     * @return integer
     */
    public function getBaseDocId()
    {
        return $this->baseDocId;
    }

    /**
     * Set baseDocType
     *
     * @param string $baseDocType
     *
     * @return NmtInventoryMv
     */
    public function setBaseDocType($baseDocType)
    {
        $this->baseDocType = $baseDocType;

        return $this;
    }

    /**
     * Get baseDocType
     *
     * @return string
     */
    public function getBaseDocType()
    {
        return $this->baseDocType;
    }

    /**
     * Set targetDocId
     *
     * @param integer $targetDocId
     *
     * @return NmtInventoryMv
     */
    public function setTargetDocId($targetDocId)
    {
        $this->targetDocId = $targetDocId;

        return $this;
    }

    /**
     * Get targetDocId
     *
     * @return integer
     */
    public function getTargetDocId()
    {
        return $this->targetDocId;
    }

    /**
     * Set targetDocType
     *
     * @param string $targetDocType
     *
     * @return NmtInventoryMv
     */
    public function setTargetDocType($targetDocType)
    {
        $this->targetDocType = $targetDocType;

        return $this;
    }

    /**
     * Get targetDocType
     *
     * @return string
     */
    public function getTargetDocType()
    {
        return $this->targetDocType;
    }

    /**
     * Set clearingDocId
     *
     * @param integer $clearingDocId
     *
     * @return NmtInventoryMv
     */
    public function setClearingDocId($clearingDocId)
    {
        $this->clearingDocId = $clearingDocId;

        return $this;
    }

    /**
     * Get clearingDocId
     *
     * @return integer
     */
    public function getClearingDocId()
    {
        return $this->clearingDocId;
    }

    /**
     * Set createdBy
     *
     * @param \Application\Entity\MlaUsers $createdBy
     *
     * @return NmtInventoryMv
     */
    public function setCreatedBy(\Application\Entity\MlaUsers $createdBy = null)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

    /**
     * Get createdBy
     *
     * @return \Application\Entity\MlaUsers
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }

    /**
     * Set company
     *
     * @param \Application\Entity\NmtApplicationCompany $company
     *
     * @return NmtInventoryMv
     */
    public function setCompany(\Application\Entity\NmtApplicationCompany $company = null)
    {
        $this->company = $company;

        return $this;
    }

    /**
     * Get company
     *
     * @return \Application\Entity\NmtApplicationCompany
     */
    public function getCompany()
    {
        return $this->company;
    }

    /**
     * Set vendor
     *
     * @param \Application\Entity\NmtBpVendor $vendor
     *
     * @return NmtInventoryMv
     */
    public function setVendor(\Application\Entity\NmtBpVendor $vendor = null)
    {
        $this->vendor = $vendor;

        return $this;
    }

    /**
     * Get vendor
     *
     * @return \Application\Entity\NmtBpVendor
     */
    public function getVendor()
    {
        return $this->vendor;
    }

    /**
     * Set warehouse
     *
     * @param \Application\Entity\NmtInventoryWarehouse $warehouse
     *
     * @return NmtInventoryMv
     */
    public function setWarehouse(\Application\Entity\NmtInventoryWarehouse $warehouse = null)
    {
        $this->warehouse = $warehouse;

        return $this;
    }

    /**
     * Get warehouse
     *
     * @return \Application\Entity\NmtInventoryWarehouse
     */
    public function getWarehouse()
    {
        return $this->warehouse;
    }

    /**
     * Set postingPeriod
     *
     * @param \Application\Entity\NmtFinPostingPeriod $postingPeriod
     *
     * @return NmtInventoryMv
     */
    public function setPostingPeriod(\Application\Entity\NmtFinPostingPeriod $postingPeriod = null)
    {
        $this->postingPeriod = $postingPeriod;

        return $this;
    }

    /**
     * Get postingPeriod
     *
     * @return \Application\Entity\NmtFinPostingPeriod
     */
    public function getPostingPeriod()
    {
        return $this->postingPeriod;
    }

    /**
     * Set currency
     *
     * @param \Application\Entity\NmtApplicationCurrency $currency
     *
     * @return NmtInventoryMv
     */
    public function setCurrency(\Application\Entity\NmtApplicationCurrency $currency = null)
    {
        $this->currency = $currency;

        return $this;
    }

    /**
     * Get currency
     *
     * @return \Application\Entity\NmtApplicationCurrency
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * Set docCurrency
     *
     * @param \Application\Entity\NmtApplicationCurrency $docCurrency
     *
     * @return NmtInventoryMv
     */
    public function setDocCurrency(\Application\Entity\NmtApplicationCurrency $docCurrency = null)
    {
        $this->docCurrency = $docCurrency;

        return $this;
    }

    /**
     * Get docCurrency
     *
     * @return \Application\Entity\NmtApplicationCurrency
     */
    public function getDocCurrency()
    {
        return $this->docCurrency;
    }

    /**
     * Set localCurrency
     *
     * @param \Application\Entity\NmtApplicationCurrency $localCurrency
     *
     * @return NmtInventoryMv
     */
    public function setLocalCurrency(\Application\Entity\NmtApplicationCurrency $localCurrency = null)
    {
        $this->localCurrency = $localCurrency;

        return $this;
    }

    /**
     * Get localCurrency
     *
     * @return \Application\Entity\NmtApplicationCurrency
     */
    public function getLocalCurrency()
    {
        return $this->localCurrency;
    }

    /**
     * Set targetWarehouse
     *
     * @param \Application\Entity\NmtInventoryWarehouse $targetWarehouse
     *
     * @return NmtInventoryMv
     */
    public function setTargetWarehouse(\Application\Entity\NmtInventoryWarehouse $targetWarehouse = null)
    {
        $this->targetWarehouse = $targetWarehouse;

        return $this;
    }

    /**
     * Get targetWarehouse
     *
     * @return \Application\Entity\NmtInventoryWarehouse
     */
    public function getTargetWarehouse()
    {
        return $this->targetWarehouse;
    }

    /**
     * Set sourceLocation
     *
     * @param \Application\Entity\NmtInventoryWarehouseLocation $sourceLocation
     *
     * @return NmtInventoryMv
     */
    public function setSourceLocation(\Application\Entity\NmtInventoryWarehouseLocation $sourceLocation = null)
    {
        $this->sourceLocation = $sourceLocation;

        return $this;
    }

    /**
     * Get sourceLocation
     *
     * @return \Application\Entity\NmtInventoryWarehouseLocation
     */
    public function getSourceLocation()
    {
        return $this->sourceLocation;
    }

    /**
     * Set tartgetLocation
     *
     * @param \Application\Entity\NmtInventoryWarehouseLocation $tartgetLocation
     *
     * @return NmtInventoryMv
     */
    public function setTartgetLocation(\Application\Entity\NmtInventoryWarehouseLocation $tartgetLocation = null)
    {
        $this->tartgetLocation = $tartgetLocation;

        return $this;
    }

    /**
     * Get tartgetLocation
     *
     * @return \Application\Entity\NmtInventoryWarehouseLocation
     */
    public function getTartgetLocation()
    {
        return $this->tartgetLocation;
    }
}


text:
from django.views.generic import FormView, TemplateView
from django.shortcuts import redirect

from braces.views import LoginRequiredMixin

from models import Exchange
from forms import ExchangeForm
from utils import get_object_or_none

class AjaxMixin(object):
    """
    This mixin is used for views which handle ajax requests because ajax request expects diffrent
    response than normal views return.
    """
    ajax_template_name = None

    def ajax_render_to_response(self, context, **response_kwargs):
        response_kwargs.setdefault('content_type', self.content_type)
        return self.response_class(
            request = self.request,
            template = [self.ajax_template_name],
            context = context,
            **response_kwargs
        )

    def render_to_response(self, context, **response_kwargs):
        if self.request.is_ajax():
            return self.ajax_render_to_response(context, **response_kwargs)
        return super(AjaxMixin, self).render_to_response(context)

class Dashboard(TemplateView):
    """
    Landing page view
    """
    template_name = 'exchange/exchange_form.html'

    def get(self, request, *args, **kwargs):
        if self.request.user.is_authenticated():
            return redirect('exchange')
        return super(Dashboard, self).get(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(Dashboard, self).get_context_data(**kwargs)
        context['latest_updates'] = Exchange.objects.all()[:10]
        return context

class ExchangeFormView(LoginRequiredMixin, AjaxMixin, FormView):
    """
    Main view for exchange rates.
    When user enters date, we show the exchange rate for the selected date
    """
    form_class = ExchangeForm
    template_name = 'exchange/exchange_form.html'
    ajax_template_name = 'exchange/ajax_partial.html'

    def get_context_data(self, **kwargs):
        context = super(ExchangeFormView, self).get_context_data(**kwargs)
        context['latest_updates'] = Exchange.objects.all()[:10]
        return context

    def form_valid(self, form):
        context = self.get_context_data()
        date = form.cleaned_data['date']
        context['rate_asked'] = get_object_or_none(Exchange, exchange_date=date)
        return super(ExchangeFormView, self).ajax_render_to_response(context)


text:
.. python-sdk documentation master file, created by
   sphinx-quickstart on Mon Nov  2 17:57:31 2015.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Neustar Trusted Device Identity (TDI)
=====================================
Release |release|

Neustar TDI (formerly oneID-connect) is an authentication framework for the Internet of Things (IoT), servers and end-users.
By sending messages with digital signatures, you can authenticate the origin of the message and
ensure the message hasn't been tampered with. Neustar TDI makes it simple for projects that need to
send authenticated messages and verify the authentication of messages.

``Neustar-TDI/python-sdk`` can be installed on IoT devices and servers that support python 2.7, 3.4, 3.5 or 3.6.
``Neustar-TDI/python-sdk`` depends on two external libraries: the cryptography.io python package and openSSL.

Introduction
------------
Security for IoT devices can be challenging to implement and difficult to mange at scale.
So Neustar has created a secure two-factor mutual authentication
platform that securely connects users to their IoT devices, while enabling product servers to securely send firmware updates
to those same IoT devices. We do this using state of the art `Elliptical Curve cryptography`_.

Installation
~~~~~~~~~~~~

.. toctree::
   :maxdepth: 3

   installation/index

Tutorials
~~~~~~~~~

.. toctree::
   :maxdepth: 2

   tutorials/index

API
~~~

.. toctree::
   :maxdepth: 2

   api/index

Contributing
~~~~~~~~~~~~

.. toctree::
   :maxdepth: 2

   contributing/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. _Elliptical Curve cryptography: https://en.wikipedia.org/wiki/Elliptic_curve_cryptography


text:
class FTSizeTest : public CppUnit::TestCase
{
    CPPUNIT_TEST_SUITE( FTSizeTest);
        CPPUNIT_TEST( testConstructor);
        CPPUNIT_TEST( testSetCharSize);
    CPPUNIT_TEST_SUITE_END();

    public:
        FTSizeTest() : CppUnit::TestCase( "FTSize Test")
        {}

        FTSizeTest( const std::string& name) : CppUnit::TestCase(name) {}

        void testConstructor()
        {
            FTSize size;

            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.CharSize(), 0.01);
            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.Ascender(), 0.01);
            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.Descender(), 0.01);

            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.Height(), 0.01);
            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.Width(), 0.01);

            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.Underline(), 0.01);

        }

        void testSetCharSize()
        {
            setUpFreetype();

            FTSize size;

            CPPUNIT_ASSERT( size.CharSize( &face, FONT_POINT_SIZE, RESOLUTION, RESOLUTION));
            CPPUNIT_ASSERT( size.Error() == 0);

            CPPUNIT_ASSERT_DOUBLES_EQUAL(  72, size.CharSize(), 0.01);
            CPPUNIT_ASSERT_DOUBLES_EQUAL(  52, size.Ascender(), 0.01);
            CPPUNIT_ASSERT_DOUBLES_EQUAL( -15, size.Descender(), 0.01);

            CPPUNIT_ASSERT_DOUBLES_EQUAL( 81.86, size.Height(), 0.01);
            CPPUNIT_ASSERT_DOUBLES_EQUAL( 76.32, size.Width(), 0.01);

            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, size.Underline(), 0.01);

            tearDownFreetype();
        }

        void setUp()
        {}

        void tearDown()
        {}

    private:
        FT_Library   library;
        FT_Face      face;

        void setUpFreetype()
        {
            FT_Error error = FT_Init_FreeType( &library);
            assert(!error);
            error = FT_New_Face( library, GOOD_FONT_FILE, 0, &face);
            assert(!error);
        }

        void tearDownFreetype()
        {
            FT_Done_Face( face);
            FT_Done_FreeType( library);
        }

};

CPPUNIT_TEST_SUITE_REGISTRATION( FTSizeTest);


text:
package io.coodoo.framework.listing.boundary;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

import java.util.Map;

import org.junit.Before;
import org.junit.Test;

import io.coodoo.framework.listing.control.ListingConfig;

public class ListingParametersTest {

    private ListingParameters classUnderTest;

    @Before
    public void init() {
        classUnderTest = new ListingParameters();
    }

    @Test
    public void testGetLimit_noLimitSet_defaultLimit() {

        Integer limit = classUnderTest.getLimit();

        assertThat(limit, is(equalTo(ListingConfig.DEFAULT_LIMIT)));
    }

    @Test
    public void testGetLimit_limitWanted_limit() {

        classUnderTest.setLimit(83);

        Integer limit = classUnderTest.getLimit();

        assertThat(limit, equalTo(83));
    }

    @Test
    public void testGetLimit_noLimit() {

        classUnderTest.setLimit(0);

        Integer page = classUnderTest.getPage();

        Integer limit = classUnderTest.getLimit();

        assertThat(page, equalTo(1));
        assertThat(limit, equalTo(0));
    }

    @Test
    public void testGetSortAttribute_set() {

        classUnderTest.setSortAttribute("fisch");

        String sortAttribute = classUnderTest.getSortAttribute();

        assertThat(sortAttribute, equalTo("fisch"));
    }

    @Test
    public void testGetDecodedFilterAttributes_true() {

        ListingConfig.URI_DECODE = true;

        classUnderTest.addFilterAttributes("test", "%2B");
        Map<String, String> result = classUnderTest.getFilterAttributes();
        assertThat(result.get("test"), equalTo("+"));
    }

    @Test
    public void testGetDecodedFilterAttributes_false() {

        ListingConfig.URI_DECODE = false;

        classUnderTest.addFilterAttributes("test", "%2B");
        Map<String, String> result = classUnderTest.getFilterAttributes();
        assertThat(result.get("test"), equalTo("%2B"));
    }

    @Test
    public void testGetIndex() throws Exception {

        Integer expected = 77;
        classUnderTest.setIndex(expected);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_DefaultValue() throws Exception {

        Integer expected = ListingConfig.DEFAULT_INDEX;

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_zero() throws Exception {

        Integer expected = ListingConfig.DEFAULT_INDEX;

        classUnderTest.setLimit(0);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_negative() throws Exception {

        Integer expected = ListingConfig.DEFAULT_INDEX;

        classUnderTest.setLimit(-1);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_withPage() throws Exception {

        Integer expected = 820;

        classUnderTest.setPage(83);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_withPage1() throws Exception {

        Integer expected = 0;

        classUnderTest.setPage(1);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_withPageAndLimit() throws Exception {

        Integer expected = 3;

        classUnderTest.setPage(2);
        classUnderTest.setLimit(3);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetIndex_withPage1AndLimit1() throws Exception {

        Integer expected = 0;

        classUnderTest.setPage(1);
        classUnderTest.setLimit(1);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testSetIndex() throws Exception {

        Integer expected = 77;

        classUnderTest.setIndex(expected);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testSetIndex_zero() throws Exception {

        Integer expected = 0;

        classUnderTest.setIndex(expected);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testSetIndex_null() throws Exception {

        Integer expected = ListingConfig.DEFAULT_INDEX;

        classUnderTest.setIndex(null);

        Integer result = classUnderTest.getIndex();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetPage() throws Exception {

        Integer expected = ListingConfig.DEFAULT_PAGE;

        classUnderTest.setPage(expected);

        Integer result = classUnderTest.getPage();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetPage_neagtive() throws Exception {

        Integer expected = ListingConfig.DEFAULT_PAGE;

        classUnderTest.setPage(-3);

        Integer result = classUnderTest.getPage();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetPage_withLimitAndIndex() throws Exception {

        Integer expected = 4;

        classUnderTest.setLimit(7);
        classUnderTest.setIndex(23);

        Integer result = classUnderTest.getPage();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetPage_withLimitAndIndexNewPage() throws Exception {

        Integer expected = 4;

        classUnderTest.setLimit(7);
        classUnderTest.setIndex(28);

        Integer result = classUnderTest.getPage();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetPage_withLimitZeroAndIndex() throws Exception {

        Integer expected = ListingConfig.DEFAULT_PAGE;

        classUnderTest.setLimit(0);
        classUnderTest.setIndex(23);

        Integer result = classUnderTest.getPage();

        assertThat(result, equalTo(expected));
    }

    @Test
    public void testGetPage_withLimitAndIndexZero() throws Exception {

        Integer expected = ListingConfig.DEFAULT_PAGE;

        classUnderTest.setLimit(7);
        classUnderTest.setIndex(0);

        Integer result = classUnderTest.getPage();

        assertThat(result, equalTo(expected));
    }

}


text:
using System;
using System.Collections;
using System.Linq;

namespace Test
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var cmd = Console.ReadLine();

            if (cmd == "client")
            {
                var client = new Rpc.RpcClient("http://localhost:5050/");

                var proxy = client.CreateProxy<Sample>();
                var system = client.CreateProxy<system>();

                Console.WriteLine(proxy.Echo("hello world"));
                var ms = system.methodSignature("Sample.Echo");

                var m = (system.listMethods()).ToArray();

                foreach (var item in m)
                {
                    Console.WriteLine(item);
                }
            }
            else if (cmd == "server")
            {
                var server = new Rpc.RpcServer(5050);

                server.AddListener(new Sample());

                server.Start();
            }

            Console.ReadLine();
        }
    }
}


text:
using namespace ci;
using namespace ci::app;
using namespace std;

namespace Pretzel {

    ScrollPane::ScrollPane(BasePretzel *base, int width, int height) : PretzelRow(base, width, height) {
        bCanScroll = false;
        bHover = false;
		bDragging = false;
        mScrollHandle = Rectf(mBounds.x2-10, 0, mBounds.x2, 50);
        mScrolledPct = 0.0;
        mScrolledHandleAmt = vec2(0,0);
        mScrolledFrameAmt = vec2(0,0);
    }

    void ScrollPane::updateChildrenBounds() {
        PretzelRow::updateChildrenBounds();

        // RESIZE CHILDREN
		vec2 newOffset(0, 0);
		for (vector<BasePretzel*>::const_iterator it = mPretzelChildren.begin(); it != mPretzelChildren.end(); ++it){
			(*it)->updateBounds(newOffset, mBounds - Rectf(0,0,10,0));
			newOffset += vec2(0, (*it)->getHeight());
		}

        // HANDLE SCROLL BAR
        mChildrenHeight = newOffset.y;
        bCanScroll = (mBounds.getHeight() < mChildrenHeight) ? true : false;

        mScrollHandle.x1 = mBounds.x2-10;
        mScrollHandle.x2 = mBounds.x2;

        if( bCanScroll ){
            int rectMaxY = mBounds.y2 - mScrollHandle.getHeight() - 10; // -10 for bottom bar
            mScrolledHandleAmt = vec2(0, rectMaxY*mScrolledPct);

            float scrollableHeight = mChildrenHeight - mBounds.getHeight() + 20; // to accomodate for bottom resize bar
            mScrolledFrameAmt = vec2( 0, scrollableHeight * -mScrolledPct );

            mScrollHandle = Rectf(mBounds.x2-10, 0, mBounds.x2, 50);
            mScrollHandle.offset( mScrolledHandleAmt );
        }else{
            mScrolledPct = 0.0;
            mScrollHandle = Rectf(mBounds.x2-10, 0, mBounds.x2, 50);
        }
	}

    void ScrollPane::mouseDown(const ci::vec2 &pos){
        if(bCanScroll){
            if( mScrollHandle.contains( pos ) ){
                bDragging = true;
                mStartDragOffset = mScrollHandle.getUpperLeft() - pos;
            }
        }

        PretzelRow::mouseDown( pos - mScrolledFrameAmt );
    }

    void ScrollPane::mouseDragged(const ci::vec2 &pos){
        if( bDragging ){
            vec2 localPos = pos + mStartDragOffset;

            int rectMinY = 0;
            int rectMaxY = mBounds.y2 - mScrollHandle.getHeight() - 10; // -10 for bottom bar

            mScrolledPct = ci::math<float>::clamp((float)(localPos.y - rectMinY) / (float)rectMaxY, 0.0, 1.0);
            mScrolledHandleAmt = vec2(0, rectMaxY*mScrolledPct);

            float scrollableHeight = mChildrenHeight - mBounds.getHeight() + 20; // to accomodate for bottom resize bar
            mScrolledFrameAmt = vec2( 0, scrollableHeight * -mScrolledPct );

            mScrollHandle = Rectf(mBounds.x2-10, 0, mBounds.x2, 50);
            mScrollHandle.offset( mScrolledHandleAmt );
        }else{
            PretzelRow::mouseDragged( pos - mScrolledFrameAmt );
        }
    }

    void ScrollPane::mouseUp(const ci::vec2 &pos){
        bDragging = false;
        PretzelRow::mouseUp( pos - mScrolledFrameAmt );
    }

    void ScrollPane::mouseMoved(const ci::vec2 &pos){
        if(bCanScroll){
            if( mScrollHandle.contains(pos) ){
                mGlobal->setCursor(CursorType::HAND);
                bHover = true;
            }else{
                if(bHover){
                    mGlobal->setCursor(CursorType::ARROW);
                }
                bHover = false;
            }
        }

        PretzelRow::mouseMoved( pos - mScrolledFrameAmt );
    }

    void ScrollPane::draw(){
        glEnable(GL_SCISSOR_TEST);
        Rectf tBounds = mBounds;
        vec2 tPos = mOffset + mGlobalOffset;
        float winH = getWindowHeight();

        if ( ci::app::App::get()->isHighDensityDisplayEnabled()) {
            tBounds *= getWindowContentScale();
            winH *= getWindowContentScale();
            tPos *= getWindowContentScale();
        }

        glScissor( tPos.x, winH - tBounds.y2 - tPos.y, tBounds.getWidth(), tBounds.getHeight());

        gl::color(mGlobal->P_BG_COLOR);
        gl::drawSolidRect( mBounds );

        gl::translate(mOffset);

        if( mBounds.getHeight() < mChildrenHeight ){
            gl::pushMatrices();{
                gl::translate( mScrolledFrameAmt );
                PretzelRow::draw();
            }gl::popMatrices();

            if( bDragging ){
                gl::color( mGlobal->P_ACTIVE_COLOR );
            }else{
                gl::color( mGlobal->P_SLIDER_COLOR );
            }
            gl::drawSolidRect( mScrollHandle );

            gl::color( mGlobal->P_GUI_BORDER );
            gl::drawStrokedRect( mScrollHandle );
        }else{
            PretzelRow::draw();
        }

        glDisable(GL_SCISSOR_TEST);
    }
}


text:
import Shape from './shape';

export default class Dot extends Shape {
  drawTile() {
    const halfSize = this._size / 2;

    this._context.beginPath();

    this.setFillProps();

    this.drawDot();
    this.drawDot(halfSize, halfSize);

    this._context.fill();

    return this._canvas;
  }

  drawDot(offsetX = 0, offsetY = 0, diameter = this._size / 10) {
    const size = this._size;
    const quarterSize = size / 4;
    const x = quarterSize + offsetX;
    const y = quarterSize + offsetY;

    this._context.moveTo(x + quarterSize , y);
    this._context.arc(x, y, diameter, 0, 2 * Math.PI);

    this._context.closePath();
  }
}


text:
{% extends "./SiteTemplate.html" %}

{% block content %}

Change content here!

{% endblock %}


text:
'use strict'

const d3 = window.d3
const addLabel = require('./add-label')

function sumAllocs(d) {
  function add(acc, alloc) {
    return acc + (alloc.count * alloc.size)
  }
  return d.allocations.reduce(add, 0)
}

function defaultGetChildren(d) {
  if (!d.children || !d.children.length) return []
  if (typeof d.children.filter !== 'function') return []
  return d.children.filter(x => !!x && !!x.allocations)
}

module.exports = function initFlamegraph({
      graph
    , clazz
    , width = 1400
    , height = 800
    , getChildren = defaultGetChildren
}) {
  const labelMargin = 40

  const svg = d3.select(clazz).append('svg')
    .attr('width', width)
    .attr('height', height + labelMargin)

  function getSize(d) {
    return Math.max(sumAllocs(d), 2.5)
  }

  const partition = d3.layout.partition()
    .size([ width, height ])
    .children(getChildren)
    .value(getSize)

  const color = d3.scale.category20()
  const nodes = partition.nodes(graph)

  const g = svg.selectAll('.node')
      .data(nodes)
      .enter()
        .append('g')

  const el = g.append('rect')
    .attr('class', 'node')
    .attr('x', d => d.x)
    .attr('y', d => height - d.y - d.dy)
    .attr('width', d => d.dx)
    .attr('height', d => d.dy)
    .style('fill', d => color((getChildren(d) ? d : d.parent).name))

  addLabel({ d3, g, el, nodes, sumAllocs, id: 'tip-flamegraph', x: 0, y: height + labelMargin / 2 })
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Asterina crotonis Syd. & P. Syd.

### Remarks
null


text:
int main(int argc, char ** argv) {
        extern int fakemain(int, char **);
        return fakemain(argc, argv);
}


text:
package istic.gla.groupeb.flerjeco.codis.intervention;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.os.Build;
import android.support.v4.app.DialogFragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.Toast;
import android.widget.ToggleButton;

import org.springframework.util.StringUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;

import istic.gla.groupb.nivimoju.entity.IncidentCode;
import istic.gla.groupb.nivimoju.entity.Intervention;
import istic.gla.groupb.nivimoju.entity.Resource;
import istic.gla.groupb.nivimoju.entity.ResourceType;
import istic.gla.groupeb.flerjeco.FlerjecoApplication;
import istic.gla.groupeb.flerjeco.R;
import istic.gla.groupeb.flerjeco.springRest.GetAllIncidentCodeTask;
import istic.gla.groupeb.flerjeco.springRest.GetResourceTypeLabelsTask;
import istic.gla.groupeb.flerjeco.springRest.GetResourceTypesTask;
import istic.gla.groupeb.flerjeco.springRest.IIncidentCode;
import istic.gla.groupeb.flerjeco.springRest.IInterventionActivity;
import istic.gla.groupeb.flerjeco.springRest.IResourceTypeLabelsActivity;
import istic.gla.groupeb.flerjeco.springRest.InterventionPostTask;
import istic.gla.groupeb.flerjeco.springRest.SpringService;
import istic.gla.groupb.nivimoju.util.ResourceRole;
import istic.gla.groupb.nivimoju.util.State;

/**
 * Fragment used for the creation of the intervention of firefighters
 * @see android.support.v4.app.DialogFragment
 */
public class InterventionDialogFragment extends DialogFragment
        implements IIncidentCode, IInterventionActivity, IResourceTypeLabelsActivity {
    private static final String TAG = InterventionDialogFragment.class.getSimpleName();

    Spinner codeSinistreSpinner;

    //Button of intervention creation
    Button intervention_creation_button;

    //Text fields
    EditText nameInterventionEditText;
    EditText addressEditText;
    EditText latitudeEditText;
    EditText longitudeEditText;

    LinearLayout latLongLinearLayout;

    private View mProgressView;
    private View mCreateFormView;

    String[] spinnerArray;
    ArrayAdapter<String> spinnerAdapter;
    SpringService springService =  new SpringService();

    private HashMap<String, Long> spinnerMap;
    private HashMap<String, List<Long>> resourceTypeMap;

    boolean data_local = false, addressOrCoordinates=true;
    private GetAllIncidentCodeTask incidentCodesTask;
    private InterventionPostTask interventionPostTask;
    private GetResourceTypesTask resourceGetTask;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_create_intervention, container, false);
        getDialog().setTitle(R.string.title_fragment_create_intervention);

        mCreateFormView = v.findViewById(R.id.intervention_scroll);
        mProgressView = v.findViewById(R.id.create_progress);

        //Set up code sinistre list
        codeSinistreSpinner = (Spinner) v.findViewById(R.id.CodeSinistreSpinner);
        nameInterventionEditText = (EditText) v.findViewById(R.id.nameInterventionEditText);
        addressEditText = (EditText) v.findViewById(R.id.address);
        latitudeEditText = (EditText) v.findViewById(R.id.latitude);
        longitudeEditText = (EditText) v.findViewById(R.id.longitude);
        latLongLinearLayout = (LinearLayout) v.findViewById(R.id.lat_long);

        //  Set up Button of intervention creation
        intervention_creation_button = (Button) v.findViewById(R.id.intervention_button);

        //Selection of registered claims codes in the database and the list of identifiers of resourceType
        showProgress(true);
        if(FlerjecoApplication.getInstance().getIncidentCodes() != null && FlerjecoApplication.getInstance().getIncidentCodes().length > 0) {
            updateIncidentCodes(FlerjecoApplication.getInstance().getIncidentCodes());
        } else {
            incidentCodesTask = new GetAllIncidentCodeTask(this);
            incidentCodesTask.execute();
        }

        //  add button listener
        intervention_creation_button.setOnClickListener(new View.OnClickListener() {

            public boolean validate() {
                Log.i(TAG, "Validate addressOrCoordinates : "+addressOrCoordinates);
                if(addressOrCoordinates) {
                    if (addressEditText.getText().toString().length() == 0) {
                        addressEditText.setError(getString(R.string.error_field_required));
                        return false;
                    }
                }
                else {
                    if (latitudeEditText.getText().toString().length() == 0) {
                        latitudeEditText.setError(getString(R.string.error_field_required));
                        return false;
                    }
                    if (longitudeEditText.getText().toString().length() == 0) {
                        longitudeEditText.setError(getString(R.string.error_field_required));
                        return false;
                    }
                }
                Log.i(TAG, "Validate OK");
                showProgress(true);
                return true;
            }

            @Override
            public void onClick(View v) {
                if (validate()) {
                    Log.i(TAG, spinnerMap.get(codeSinistreSpinner.getSelectedItem().toString()) + "");

                    //  Selecting sinister code selected resources from the list of identifiers of resourceType already recovered
                    //  Note: at the end of this task in the background, it creates intervention
                    new GetResourceTypeLabelsTask(InterventionDialogFragment.this).execute(resourceTypeMap.get(codeSinistreSpinner.getSelectedItem().toString()));

                }
            }
        });

        ToggleButton toggle = (ToggleButton) v.findViewById(R.id.address_or_coordinate);
        toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
                    addressOrCoordinates = true;
                    addressEditText.setVisibility(View.VISIBLE);
                    latLongLinearLayout.setVisibility(View.GONE);
                } else {
                    addressOrCoordinates = false;
                    latLongLinearLayout.setVisibility(View.VISIBLE);
                    addressEditText.setVisibility(View.GONE);
                }
            }
        });

        return v;
    }

    /**
     * Shows the progress UI and hides the login form.
     */
    @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public void showProgress(final boolean show) {
        // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
        // for very easy animations. If available, use these APIs to fade-in
        // the progress spinner.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
            int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);

            mCreateFormView.setVisibility(show ? View.GONE : View.VISIBLE);
            mCreateFormView.animate().setDuration(shortAnimTime).alpha(
                    show ? 0 : 1).setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    mCreateFormView.setVisibility(show ? View.GONE : View.VISIBLE);
                }
            });

            mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
            mProgressView.animate().setDuration(shortAnimTime).alpha(
                    show ? 1 : 0).setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
                }
            });
        } else {
            // The ViewPropertyAnimator APIs are not available, so simply show
            // and hide the relevant UI components.
            mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
            mCreateFormView.setVisibility(show ? View.GONE : View.VISIBLE);
        }
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void updateIntervention(Intervention intervention) {
        showProgress(false);
        if(intervention != null) {
            Log.i(TAG, "updateIntervention success");
            ((InterventionActivity)getActivity()).addIntervention(intervention);
            ((InterventionActivity)getActivity()).updateInterventions();
            dismiss();
        }
    }

    @Override
    public void updateResourceTypeLabels(ResourceType[] resourceTypes) {
        //Intervention
        istic.gla.groupb.nivimoju.entity.Intervention intervention;
        //Address of the intervention
        Address address = new Address(Locale.getDefault());

        if(addressOrCoordinates) {
            // Create intervention with Address
            address = getCoordinates();
        }
        else {
            // Create intervention with Coordinates
            address.setLatitude(Double.parseDouble(latitudeEditText.getText().toString()));
            address.setLongitude(Double.parseDouble(longitudeEditText.getText().toString()));
        }

        if (null == address) {
            //Toast.makeText(getActivity(), R.string.geocoder_failed, Toast.LENGTH_LONG);
            addressEditText.setError(getString(R.string.geocoder_failed));
            addressEditText.requestFocus();
            showProgress(false);
            return;
        }

        //Les champs text sont toujours vérifié
        intervention = new istic.gla.groupb.nivimoju.entity.Intervention(nameInterventionEditText.getText().toString(),
                spinnerMap.get(codeSinistreSpinner.getSelectedItem().toString()).intValue(),
                address.getLatitude(), address.getLongitude());
        if(addressEditText.getText().toString() != null && !addressEditText.getText().toString().equals("")){
            intervention.setAddress(addressEditText.getText().toString());
        }
        Log.i(TAG, "updateResourceTypeLabels size : "+ resourceTypes.length);
        List<Resource> resources = convertResourcesTypeToResources(resourceTypes);

        //intervention.set
        intervention.setResources(resources);
        interventionPostTask = new InterventionPostTask(this);
        interventionPostTask.execute(intervention);
    }

    @Override
    public void updateIncidentCodes(IncidentCode[] incidentCodes) {
        showProgress(false);
        if(incidentCodes != null && incidentCodes.length > 0 ) {
            FlerjecoApplication.getInstance().setIncidentCodes(incidentCodes);
            int i = 0;
            spinnerArray = new String[incidentCodes.length];
            resourceTypeMap = new HashMap<>();
            spinnerMap = new HashMap();
            for (IncidentCode code : incidentCodes) {
                if(code != null) {

                    spinnerArray[i] = code.getCode();
                    spinnerMap.put(code.getCode(), code.getId());
                    resourceTypeMap.put(code.getCode(), code.getresourceType());
                    i++;
                }
            }
            spinnerAdapter = new ArrayAdapter<String>(InterventionDialogFragment.this.getActivity(), android.R.layout.simple_spinner_item,spinnerArray);
            spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            codeSinistreSpinner.setAdapter(spinnerAdapter);
        }
    }

    @Override
    public Context getContext() {
        return getActivity().getBaseContext();
    }

    public Address getCoordinates() {
        Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());
        int nbTry = 0;
        List<Address> addressList = new ArrayList<>();
        try {
            addressList = geocoder.getFromLocationName(addressEditText.getText().toString(),1);
            while (addressList.size()==0 && nbTry<10) {
                Log.i(TAG, "Try number : "+nbTry);
                addressList = geocoder.getFromLocationName(addressEditText.getText().toString(), 1);
                nbTry++;
            }
            if (addressList.size()>0) {
                return addressList.get(0);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    public ResourceRole roleByName(String name) {
        if(name.contains("VSAV") || name.contains("VSR")) {
            return ResourceRole.people;
        } else if(name.contains("FPT") || name.contains("EPA")){
            return ResourceRole.fire;
        } else if (name.contains("VLCG")) {
            return ResourceRole.commands;
        } else {
            return ResourceRole.otherwise;
        }
    }

    public List<Resource> convertResourcesTypeToResources(ResourceType[] resourcesType){
        List<Resource> resourcesResult= new ArrayList<>();

        for(ResourceType rt : resourcesType){
            if(rt != null) {
                Resource rs = new Resource();
                rs.setLabel(rt.getLabel());
                rs.setResourceRole(roleByName(rt.getLabel()));
                rs.setState(State.validated);
                resourcesResult.add(rs);
            }
        }
        return  resourcesResult;
    }
}


text:
package io.netty.buffer;

import org.apache.drill.exec.memory.Accountor;
import org.apache.drill.exec.memory.BufferAllocator;
import org.apache.drill.exec.memory.OutOfMemoryException;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.proto.ExecProtos.FragmentHandle;

class FakeAllocator implements BufferAllocator {
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FakeAllocator.class);

  public static final Accountor FAKE_ACCOUNTOR = new FakeAccountor();
  public static final BufferAllocator FAKE_ALLOCATOR = new FakeAllocator();

  @Override
  public DrillBuf buffer(int size) {
    throw new UnsupportedOperationException();
  }

  @Override
  public DrillBuf buffer(int minSize, int maxSize) {
    throw new UnsupportedOperationException();
  }

  @Override
  public ByteBufAllocator getUnderlyingAllocator() {
    throw new UnsupportedOperationException();
  }

  @Override
  public BufferAllocator getChildAllocator(FragmentContext context, long initialReservation, long maximumReservation,
                                           boolean applyFragmentLimit)
      throws OutOfMemoryException {
    throw new UnsupportedOperationException();
  }

  @Override
  public DrillBuf getEmpty() {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean takeOwnership(DrillBuf buf) {
    throw new UnsupportedOperationException();
  }

  @Override
  public PreAllocator getNewPreAllocator() {
    throw new UnsupportedOperationException();
  }

  @Override
  public void resetFragmentLimits() {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setFragmentLimit(long l) {
    throw new UnsupportedOperationException();
  }

  @Override
  public long getFragmentLimit(){
    throw new UnsupportedOperationException();
  }

  @Override
  public void close() {
  }

  @Override
  public long getAllocatedMemory() {
    return 0;
  }

  static class FakeAccountor extends Accountor {

    public FakeAccountor() {
      super(null, false, null, null, 0, 0, true);
    }

    @Override
    public boolean transferTo(Accountor target, DrillBuf buf, long size) {
      throw new UnsupportedOperationException();
    }

    @Override
    public long getAvailable() {
      throw new UnsupportedOperationException();
    }

    @Override
    public long getCapacity() {
      throw new UnsupportedOperationException();
    }

    @Override
    public long getAllocation() {
      throw new UnsupportedOperationException();
    }

    @Override
    public boolean reserve(long size) {
      throw new UnsupportedOperationException();
    }

    @Override
    public boolean forceAdditionalReservation(long size) {
      throw new UnsupportedOperationException();
    }

    @Override
    public void reserved(long expected, DrillBuf buf) {
      throw new UnsupportedOperationException();
    }

    @Override
    public void releasePartial(DrillBuf buf, long size) {

    }

    @Override
    public void release(DrillBuf buf, long size) {

    }

    @Override
    public void close() {

    }

  }

}


text:
using System.Collections.Generic;

namespace Humidifier.CodeGen
{
    public class Specification
    {
        public string ResourceSpecificationVersion { get; set; }
        public List<PropertyType> PropertyTypes { get; set; } = new List<PropertyType>();
        public List<ResourceType> ResourceTypes { get; set; } = new List<ResourceType>();
    }

    public class PropertyType
    {
        public string Name { get; set; }
        public string Documentation { get; set; }
        public List<Property> Properties { get; set; }
    }

    public class ResourceType
    {
        public string Name { get; set; }
        public string Documentation { get; set; }
        public List<Property> Properties { get; set; }
        public List<Attribute> Attributes { get; set; }
    }

    /// <summary>
    /// http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification-format.html#cfn-resource-specification-format-propertytypes
    /// </summary>
    public class Property
    {
        public string Name { get; set; }

        /// <summary>
        /// A link to the AWS CloudFormation User Guide that provides information about the property.
        /// </summary>
        public string Documentation { get; set; }

        /// <summary>
        /// Indicates whether the property is required.
        /// </summary>
        public bool Required { get; set; }

        /// <summary>
        /// During a stack update, the update behavior when you add, remove, or modify the property.  AWS CloudFormation replaces the
        /// resource when you change Immutable properties. AWS CloudFormation doesn't replace the resource when you change mutable properties.
        /// Conditional updates can be mutable or immutable, depending on, for example, which other properties you updated.
        /// </summary>
        public string UpdateType { get; set; }

        /// <summary>
        /// For primitive values, the valid primitive type for the property. A primitive type is a basic data type for resource property values.
        ///
        /// The valid primitive types are String, Long, Integer, Double, Boolean, Timestamp or Json.
        ///
        /// If valid values are a non-primitive type, this field is omitted and the Type field indicates the valid value type.
        /// </summary>
        public string PrimitiveType { get; set; }

        /// <summary>
        /// If the value of the Type field is List or Map, indicates the type of list or map if they contain primitive types.
        /// Otherwise, this field is omitted. For lists or maps that contain non-primitive types, the ItemType property indicates
        /// the valid value type.
        ///
        /// The valid primitive types for lists and maps are String, Long, Integer, Double, Boolean, or Timestamp.
        ///
        /// For example, if the type value is List and the item type value is String, you can specify a list of strings for the property. If the type value is Map and the item type value is Boolean, you can specify a string to Boolean mapping for the property.
        /// </summary>
        public string PrimitiveItemType { get; set; }

        /// <summary>
        /// For non-primitive types, valid values for the property. The valid types are a subproperty name, List or Map.
        /// If valid values are a primitive type, this field is omitted and the PrimitiveType field indicates the valid value type.
        ///
        /// A list is a comma-separated list of values. A map is a set of key-value pairs, where the keys are always strings.
        /// The value type for lists and maps are indicated by the ItemType or PrimitiveItemType field.
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// If the value of the Type field is List or Map, indicates the type of list or map if they contain non-primitive types.
        /// Otherwise, this field is omitted. For lists or maps that contain primitive types, the PrimitiveItemType property indicates
        /// the valid value type. A subproperty name is a valid item type.For example, if the type value is List and the item type
        /// value is PortMapping, you can specify a list of port mapping properties.
        /// </summary>
        public string ItemType { get; set; }

        /// <summary>
        /// If the value of the Type field is List, indicates whether AWS CloudFormation allows duplicate values.
        /// If the value is true, AWS CloudFormation ignores duplicate values.
        /// If the value is false, AWS CloudFormation returns an error if you submit duplicate values.
        /// </summary>
        public bool? DuplicatesAllowed { get; set; }
    }
    /// <summary>
    /// http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification-format.html#cfn-resource-specification-format-resourcetype
    /// </summary>
    public class Attribute
    {
        public string Name { get; set; }

        /// <summary>
        /// A link to the AWS CloudFormation User Guide that provides information about the property.
        /// </summary>
        public string Documentation { get; set; }

        /// <summary>
        /// If the value of the Type field is List, indicates the type of list that the Fn::GetAtt function returns for the attribute if the list contains non-primitive types. The valid type is a name of a property.
        /// </summary>
        public string ItemType { get; set; }

        /// <summary>
        /// For primitive return values, the type of primitive value that the Fn::GetAtt function returns for the attribute.
        ///
        /// A primitive type is a basic data type for resource property values. The valid primitive types are String, Long, Integer, Double, Boolean, Timestamp or Json.
        /// </summary>
        public string PrimitiveType { get; set; }

        /// <summary>
        /// If the value of the Type field is List, indicates the type of list that the Fn::GetAtt function returns for the attribute if the list contains primitive types.
        ///
        /// For lists that contain non-primitive types, the ItemType property indicates the valid value type. The valid primitive types for lists are String, Long, Integer, Double, Boolean, or Timestamp.
        ///
        /// For example, if the type value is List and the primitive item type value is String, the Fn::GetAtt function returns a list of strings.
        /// </summary>
        public string PrimitiveItemType { get; set; }

        /// <summary>
        /// For non-primitive return values, the type of value that the Fn::GetAtt function returns for the attribute. The valid types are a property name or List.
        ///
        /// A list is a comma-separated list of values. The value type for lists are indicated by the ItemType or PrimitiveItemType field.
        /// </summary>
        public string Type { get; set; }
    }
}


text:
import "reflect-metadata";
import {createTestingConnections, closeTestingConnections, reloadTestingDatabases} from "../../utils/test-utils";
import {Connection} from "../../../src/connection/Connection";
import {Post} from "./entity/Post";
import {Category} from "./entity/Category";

/**
 * Because lazy relations are overriding prototype is impossible to run these tests on multiple connections.
 * So we run tests only for mysql.
 */
describe("lazy-relations", () => {
    const resourceDir = __dirname + "/../../../../../test/functional/lazy-relations/";
    const userSchema = require(resourceDir + "schema/user.json");
    const profileSchema = require(resourceDir + "schema/profile.json");

    let connections: Connection[];
    before(async () => connections = await createTestingConnections({
        entities: [Post, Category],
        entitySchemas: [userSchema, profileSchema],
        schemaCreate: true,
        dropSchemaOnConnection: true,
        enabledDrivers: ["mysql"] // we can properly test lazy-relations only on one platform
    }));
    beforeEach(() => reloadTestingDatabases(connections));
    after(() => closeTestingConnections(connections));

    it("should persist and hydrate successfully on a relation without inverse side", () => Promise.all(connections.map(async connection => {
        const postRepository = connection.getRepository(Post);
        const categoryRepository = connection.getRepository(Category);

        const savedCategory1 = new Category();
        savedCategory1.name = "kids";
        const savedCategory2 = new Category();
        savedCategory2.name = "people";
        const savedCategory3 = new Category();
        savedCategory3.name = "animals";

        await categoryRepository.persist(savedCategory1);
        await categoryRepository.persist(savedCategory2);
        await categoryRepository.persist(savedCategory3);

        const savedPost = new Post();
        savedPost.title = "Hello post";
        savedPost.text = "This is post about post";
        savedPost.categories = Promise.resolve([
            savedCategory1, savedCategory2, savedCategory3
        ]);

        await postRepository.persist(savedPost);

        savedPost.categories.should.eventually.be.eql([savedCategory1, savedCategory2, savedCategory3]);

        const post = (await postRepository.findOneById(1))!;
        post.title.should.be.equal("Hello post");
        post.text.should.be.equal("This is post about post");

        post.categories.should.be.instanceOf(Promise);

        const categories = await post.categories;
        categories.length.should.be.equal(3);
        categories.should.contain(savedCategory1);
        categories.should.contain(savedCategory2);
        categories.should.contain(savedCategory3);
    })));

    it("should persist and hydrate successfully on a relation with inverse side", () => Promise.all(connections.map(async connection => {
        const postRepository = connection.getRepository(Post);
        const categoryRepository = connection.getRepository(Category);

        const savedCategory1 = new Category();
        savedCategory1.name = "kids";
        const savedCategory2 = new Category();
        savedCategory2.name = "people";
        const savedCategory3 = new Category();
        savedCategory3.name = "animals";

        await categoryRepository.persist(savedCategory1);
        await categoryRepository.persist(savedCategory2);
        await categoryRepository.persist(savedCategory3);

        const savedPost = new Post();
        savedPost.title = "Hello post";
        savedPost.text = "This is post about post";
        savedPost.twoSideCategories = Promise.resolve([
            savedCategory1, savedCategory2, savedCategory3
        ]);

        await postRepository.persist(savedPost);

        savedPost.twoSideCategories.should.eventually.be.eql([savedCategory1, savedCategory2, savedCategory3]);

        const post = (await postRepository.findOneById(1))!;
        post.title.should.be.equal("Hello post");
        post.text.should.be.equal("This is post about post");

        post.twoSideCategories.should.be.instanceOf(Promise);

        const categories = await post.twoSideCategories;
        categories.length.should.be.equal(3);
        categories.should.contain(savedCategory1);
        categories.should.contain(savedCategory2);
        categories.should.contain(savedCategory3);

        const category = (await categoryRepository.findOneById(1))!;
        category.name.should.be.equal("kids");

        const twoSidePosts = await category.twoSidePosts;

        const likePost = new Post();
        likePost.id = 1;
        likePost.title = "Hello post";
        likePost.text = "This is post about post";
        twoSidePosts.should.contain(likePost);
    })));

    it("should persist and hydrate successfully on a one-to-one relation with inverse side loaded from entity schema", () => Promise.all(connections.map(async connection => {
        const userRepository = connection.getRepository("User");
        const profileRepository = connection.getRepository("Profile");

        const profile: any = profileRepository.create();
        profile.country = "Japan";
        await profileRepository.persist(profile);

        const newUser: any = userRepository.create();
        newUser.firstName = "Umed";
        newUser.secondName = "San";
        newUser.profile = Promise.resolve(profile);
        await userRepository.persist(newUser);

        newUser.profile.should.eventually.be.eql(profile);

        // const loadOptions: FindOptions = { alias: "user", innerJoinAndSelect };
        const loadedUser: any = await userRepository.findOneById(1);
        loadedUser.firstName.should.be.equal("Umed");
        loadedUser.secondName.should.be.equal("San");
        loadedUser.profile.should.be.instanceOf(Promise);

        const lazyLoadedProfile = await loadedUser.profile;
        lazyLoadedProfile.country.should.be.equal("Japan");
    })));

});