text:
<?php

namespace dv\SSW2014Bundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Topic
 */
class Topic
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $name;

    /**
     * @var string
     */
    private $isPrimaryTopicOf;

    /**
     * @var \DateTime
     */
    private $created_at;

    /**
     * @var \DateTime
     */
    private $updated_at;

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

    /**
     * Set name
     *
     * @param string $name
     * @return Topic
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

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

    /**
     * Set isPrimaryTopicOf
     *
     * @param string $isPrimaryTopicOf
     * @return Topic
     */
    public function setIsPrimaryTopicOf($isPrimaryTopicOf)
    {
        $this->isPrimaryTopicOf = $isPrimaryTopicOf;

        return $this;
    }

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

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return Topic
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }

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

    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return Topic
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }

    /**
     * Get updated_at
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }
    /**
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        // Add your code here
    }

    /**
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        // Add your code here
    }
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $categories;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->categories = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add categories
     *
     * @param \dv\SSW2014Bundle\Entity\CategoryTopic $categories
     * @return Topic
     */
    public function addCategory(\dv\SSW2014Bundle\Entity\CategoryTopic $categories)
    {
        $this->categories[] = $categories;

        return $this;
    }

    /**
     * Remove categories
     *
     * @param \dv\SSW2014Bundle\Entity\CategoryTopic $categories
     */
    public function removeCategory(\dv\SSW2014Bundle\Entity\CategoryTopic $categories)
    {
        $this->categories->removeElement($categories);
    }

    /**
     * Get categories
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCategories()
    {
        return $this->categories;
    }
}


text:
<?php

namespace Oro\Bundle\EntityExtendBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class UpdateConfigCommand extends ContainerAwareCommand
{
    /**
     * Console command configuration
     */
    public function configure()
    {
        $this
            ->setName('oro:entity-extend:update-config')
            ->setDescription('Prepare entity config');
    }

    /**
     * Runs command
     *
     * @param  InputInterface  $input
     * @param  OutputInterface $output
     * @return int|null|void
     */
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln($this->getDescription());

        $dumper = $this->getContainer()->get('oro_entity_extend.tools.dumper');

        $dumper->updateConfig();
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

/**
 * @ngdoc service
 * @name upstreamApp.registerService
 * @description
 * # registerService
 * Service in the upstreamApp.
 */
angular.module('upstreamApp')
.factory('registerService', function ($resource) {
      var data = $resource('http://162.243.237.149/rest-auth/registration');
      return data;
  });


text:
Public Class BrowserCloudError
    Inherits Exception

    Public Sub New(Message As String)
        MyBase.New(Message)
    End Sub

End Class


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package wad.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.data.jpa.domain.AbstractPersistable;
import org.springframework.security.crypto.bcrypt.BCrypt;

/**
 *
 * @author mikko
 */
@Entity
public class Employer extends AbstractPersistable<Long> {

    @NotBlank(message = "Anna yrityksen nimi")
    @Length(min = 1, message = "Yrityksen nimen täytyy olla vähintään 1 merkki")
    @Column(unique = true)
    private String companyName;

    @NotBlank(message = "anna yhteys sähköposti")
    @Email
    private String email;

    @NotBlank(message = "Anna yrityksen käyttäjätunnus")
    @Length(min = 5, message = "Käyttäjätunnuksen on oltava vähintään 5 merkkiä pitkä")
    @Column(unique = true)
    private String username;

    @NotBlank(message = "Anna yrityksen salasana")
    @Length(min = 5, message = "salasanan on oltava vähintään 5 merkkiä pitkä")
    @Column(unique = true)
    private String password;

    @NotBlank(message = "Anna yrityksen nimi")
    @Length(min = 10, message = "Esittelyn on oltava vähintään 10 merkkiä pitkä")
    private String companyDescription;

    @Temporal(value = TemporalType.TIMESTAMP)
    private Date created;

    @OneToMany(mappedBy = "emp")
    private List<Job> jobs;

    private String salt;

    private String authority;

    public Employer() {
    }

    public Employer(String companyName, String email, String username, String password, String companyDescription, Date created) {
        this.companyName = companyName;
        this.email = email;
        this.username = username;
        this.password = password;
        this.companyDescription = companyDescription;
        this.created = created;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.salt = BCrypt.gensalt();
        this.password = BCrypt.hashpw(password, this.salt);
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getCompanyDescription() {
        return companyDescription;
    }

    public void setCompanyDescription(String companyDescription) {
        this.companyDescription = companyDescription;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public List<Job> getJobs() {
        if (this.jobs == null) {
            this.jobs = new ArrayList<>();
        }
        return jobs;
    }

    public void setJobs(List<Job> jobs) {
        this.jobs = jobs;
    }

    public String getAuthority() {
        return authority;
    }

    public void setAuthority(String authority) {
        this.authority = authority;
    }
}


text:
{% extends "base.html" %}
{% load i18n %}

{% block main_panel %}

{% trans "Please input the password if you want to browse the shared file/directory." %}

    {% if path %}
    <form action="{% url view_name token %}?p={{ path }}" method="post" id="share-passwd-form">{% csrf_token %}
    {% else %}
    <form action="{% url view_name token %}" method="post" id="share-passwd-form">{% csrf_token %}
    {% endif %}
        {% trans "Password: " %}
        <input type="password" name="password" autofocus />
        <input type="submit" value="{% trans "Submit" %}" />
        {% if err_msg %}

{{ err_msg }}

        {% endif %}
    </form>

{% endblock %}
{% block extra_script %}

{% endblock %}


text:
DROP ROLE IF EXISTS test;
CREATE ROLE test LOGIN PASSWORD 'test';
SET ROLE test;


text:
'use strict';

describe('datepicker', function() {

  var bodyEl = $('body'), sandboxEl;
  var $compile, $templateCache, $animate, dateFilter, $datepicker, scope, today, $timeout;

  beforeEach(module('ngAnimate'));
  beforeEach(module('ngAnimateMock'));
  beforeEach(module('ngSanitize'));
  beforeEach(module('mgcrea.ngStrap.datepicker'));

  beforeEach(inject(function (_$rootScope_, _$compile_, _$templateCache_, _$animate_, _dateFilter_, _$datepicker_, _$timeout_) {
    scope = _$rootScope_.$new();
    $compile = _$compile_;
    $templateCache = _$templateCache_;
    $animate = _$animate_;
    dateFilter = _dateFilter_;
    today = new Date();
    bodyEl.html('');
    sandboxEl = $('
').attr('id', 'sandbox').appendTo(bodyEl);
    $datepicker = _$datepicker_;
    $timeout = _$timeout_;
  }));

  afterEach(function() {
    scope.$destroy();
    sandboxEl.remove();
  });

  // Templates

  var templates = {
    'default': {
      scope: {selectedDate: new Date()},
      element: '<input type="text" ng-model="selectedDate" bs-datepicker>'
    },
    'value-past': {
      scope: {selectedDate: new Date(1986, 1, 22)},
      element: '<input type="text" ng-model="selectedDate" bs-datepicker>'
    },
    'markup-ngRepeat': {
      element: '

<input type="text" ng-model="selectedDate" bs-datepicker>

'
    },
    'markup-ngChange': {
      scope: {selectedDate: new Date(1986, 1, 22), onChange: function() {}},
      element: '<input type="text" ng-model="selectedDate" ng-change="onChange()" bs-datepicker>'
    },
    'markup-ngRequired': {
      scope: {selectedDate: new Date(2010, 1, 22)},
      element: '<input type="text" ng-model="selectedDate" ng-required="true" bs-datepicker>'
    },
    'options-animation': {
      element: '

'
    },
    'options-placement': {
      element: '

'
    },
    'options-placement-exotic': {
      element: '

'
    },
    'options-trigger': {
      element: '

'
    },
    'options-template': {
      element: '<input type="text" data-template="custom" ng-model="selectedDate" bs-datepicker>'
    },
    'options-typeStringDateFormat': {
      scope: {selectedDate: '22/02/1986'},
      element: '<input type="text" ng-model="selectedDate" data-date-type="string" data-date-format="dd/MM/yyyy" bs-datepicker>'
    },
    'options-typeStringDateFormatAlternative': {
      scope: {selectedDate: '2014-04-11'},
      element: '<input type="text" ng-model="selectedDate" data-date-type="string" data-date-format="yyyy-MM-dd" bs-datepicker>'
    },
    'options-dateFormat': {
      scope: {selectedDate: new Date(1986, 1, 22)},
      element: '<input type="text" ng-model="selectedDate" data-date-format="yyyy-MM-dd" bs-datepicker>'
    },
    'options-dateFormat-alt': {
      scope: {selectedDate: new Date(1986, 1, 22)},
      element: '<input type="text" ng-model="selectedDate" data-date-format="EEEE MMMM d, yyyy" bs-datepicker>'
    },
    'options-strictFormat': {
      scope: {selectedDate: new Date(1986, 1, 4)},
      element: '<input type="text" ng-model="selectedDate" data-date-format="yyyy-M-d" data-strict-format="1" bs-datepicker>'
    },
    'options-named-dateFormat': {
      scope: {selectedDate: new Date(1986, 1, 22)},
      element: '<input type="text" ng-model="selectedDate" data-date-format="mediumDate" bs-datepicker>'
    },
    'options-minDate': {
      scope: {selectedDate: new Date(1986, 1, 22), minDate: '02/20/86'},
      element: '<input type="text" ng-model="selectedDate" data-min-date="{{minDate}}" bs-datepicker>'
    },
    'options-minDate-today': {
      scope: {selectedDate: new Date()},
      element: '<input type="text" ng-model="selectedDate" data-min-date="today" bs-datepicker>'
    },
    'options-minDate-date': {
      scope: {selectedDate: new Date(1986, 1, 22), minDate: new Date(1986, 1, 20)},
      element: '<input type="text" ng-model="selectedDate" data-min-date="{{minDate}}" bs-datepicker>'
    },
    'options-minDate-number': {
      scope: {selectedDate: new Date(1986, 1, 22), minDate: +new Date(1986, 1, 20)},
      element: '<input type="text" ng-model="selectedDate" data-min-date="{{minDate}}" bs-datepicker>'
    },
    'options-maxDate': {
      scope: {selectedDate: new Date(1986, 1, 22), maxDate: '02/24/86'},
      element: '<input type="text" ng-model="selectedDate" data-max-date="{{maxDate}}" bs-datepicker>'
    },
    'options-maxDate-today': {
      scope: {selectedDate: new Date()},
      element: '<input type="text" ng-model="selectedDate" data-max-date="today" bs-datepicker>'
    },
    'options-maxDate-date': {
      scope: {selectedDate: new Date(1986, 1, 22), maxDate: new Date(1986, 1, 24)},
      element: '<input type="text" ng-model="selectedDate" data-max-date="{{maxDate}}" bs-datepicker>'
    },
    'options-maxDate-number': {
      scope: {selectedDate: new Date(1986, 1, 22), maxDate: +new Date(1986, 1, 24)},
      element: '<input type="text" ng-model="selectedDate" data-max-date="{{maxDate}}" bs-datepicker>'
    },
    'options-startWeek': {
      scope: {selectedDate: new Date(2014, 1, 22), startWeek: 1},
      element: '<input type="text" ng-model="selectedDate" data-start-week="{{startWeek}}" bs-datepicker>'
    },
    'options-startWeek-bis': {
      scope: {selectedDate: new Date(2014, 6, 15), startWeek: 6},
      element: '<input type="text" ng-model="selectedDate" data-start-week="{{startWeek}}" bs-datepicker>'
    },
    'options-startDate': {
      scope: {startDate: '02/03/04'},
      element: '<input type="text" ng-model="selectedDate" data-start-date="{{startDate}}" bs-datepicker>'
    },
    'options-autoclose': {
      element: '<input type="text" ng-model="selectedDate" data-autoclose="1" bs-datepicker>'
    },
    'options-useNative': {
      element: '<input type="text" ng-model="selectedDate" data-use-native="1" bs-datepicker>'
    },
    'options-modelDateFormat': {
      scope: {selectedDate: '2014-12-01' },
      element: '<input type="text" ng-model="selectedDate" data-date-format="dd/MM/yyyy" data-model-date-format="yyyy-MM-dd" data-date-type="string" bs-datepicker>'
    },
    'options-modelDateFormat-longDate': {
      scope: {selectedDate: 'December 1, 2014' },
      element: '<input type="text" ng-model="selectedDate" data-date-format="shortDate" data-model-date-format="longDate" data-date-type="string" bs-datepicker>'
    },
    'options-daysOfWeekDisabled': {
      scope: {selectedDate: new Date(2014, 6, 27)},
      element: '<input type="text" ng-model="selectedDate" data-days-of-week-disabled="{{daysOfWeekDisabled}}" bs-datepicker>'
    },
    'options-daysOfWeekDisabled-bis': {
      scope: {selectedDate: new Date(2014, 6, 27), daysOfWeekDisabled: '0246'},
      element: '<input type="text" ng-model="selectedDate" data-days-of-week-disabled="{{daysOfWeekDisabled}}" bs-datepicker>'
    },
    'options-disabledDates': {
      scope: {selectedDate: new Date(2014, 6, 27)},
      element: '<input type="text" ng-model="selectedDate" data-disabled-dates="disabledDates" bs-datepicker>'
    },
    'options-disabledDates-minmax': {
      scope: {selectedDate: new Date(2014, 6, 27), minDate: new Date(2014, 6, 21), maxDate: new Date(2014, 6, 25)},
      element: '<input type="text" ng-model="selectedDate" data-disabled-dates="disabledDates" data-min-date="{{minDate}}" data-max-date="{{maxDate}}" bs-datepicker>'
    },
    'options-disabledDates-daysOfWeek': {
      scope: {selectedDate: new Date(2014, 6, 27), daysOfWeekDisabled: '0'},
      element: '<input type="text" ng-model="selectedDate" data-disabled-dates="disabledDates" data-days-of-week-disabled="{{daysOfWeekDisabled}}" bs-datepicker>'
    },
    'bsShow-attr': {
      scope: {selectedDate: new Date()},
      element: '<input type="text" ng-model="selectedDate" bs-datepicker bs-show="true">'
    },
    'bsShow-binding': {
      scope: {isVisible: false, selectedDate: new Date()},
      element: '<input type="text" ng-model="selectedDate" bs-datepicker bs-show="isVisible">'
    }
  };

  function compileDirective(template, locals) {
    template = templates[template];
    angular.extend(scope, angular.copy(template.scope || templates['default'].scope), locals);
    var element = $(template.element).appendTo(sandboxEl);
    element = $compile(element)(scope);
    scope.$digest();
    return jQuery(element[0]);
  }

  // Tests

  describe('with default template', function() {

    it('should open on focus', function() {
      var elm = compileDirective('default');
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
      angular.element(elm[0]).triggerHandler('focus');
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
    });

    it('should close on blur', function() {
      var elm = compileDirective('default');
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
      angular.element(elm[0]).triggerHandler('focus');
      angular.element(elm[0]).triggerHandler('blur');
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
    });

    it('should correctly compile inner content', function() {
      var elm = compileDirective('default');
      angular.element(elm[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody td').length).toBe(7 * 6);
      expect(sandboxEl.find('.dropdown-menu tbody td .btn').length).toBe(7 * 6);
      expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(today, 'MMMM yyyy'));
      var todayDate = today.getDate();
      var firstDate = sandboxEl.find('.dropdown-menu tbody .btn:eq(0)').text() * 1;
      expect(new Date(today.getFullYear(), today.getMonth() - (firstDate !== 1 ? 1 : 0), firstDate).getDay()).toBe($datepicker.defaults.startWeek);
    });

    it('should correctly display active date', function() {
      var elm = compileDirective('default');
      angular.element(elm[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody td .btn-primary').text().trim() * 1).toBe(today.getDate());
      expect(elm.val()).toBe((today.getMonth() + 1) + '/' + today.getDate() + '/' + (today.getFullYear() + '').substr(2));
    });

    it('should correctly select a new date', function() {
      var elm = compileDirective('default');
      angular.element(elm[0]).triggerHandler('focus');
      angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(15)')[0]).triggerHandler('click');
      expect(elm.val()).toBe((today.getMonth() + 1) + '/15/' + (today.getFullYear() + '').substr(2));
    });

    it('should correctly set the model with manually typed value', function() {
      var elm = compileDirective('default', { selectedDate: new Date(2014, 1, 10)});
      angular.element(elm[0]).triggerHandler('focus');
      elm.val('11/30/14');
      angular.element(elm[0]).triggerHandler('change');
      scope.$digest();
      expect(scope.selectedDate).toEqual(new Date(2014, 10, 30));
      expect(angular.element(elm[0]).hasClass('ng-valid')).toBeTruthy();
    });

    it('should invalidate input with non-existing manually typed value', function() {
      var elm = compileDirective('default', { selectedDate: new Date(2014, 1, 10)});
      angular.element(elm[0]).triggerHandler('focus');
      elm.val('02/31/14');
      angular.element(elm[0]).triggerHandler('change');
      scope.$digest();
      expect(scope.selectedDate).toBeUndefined();
      expect(angular.element(elm[0]).hasClass('ng-invalid')).toBeTruthy();
    });

    it('should correctly be cleared when model is cleared', function() {
      var elm = compileDirective('default');
      scope.selectedDate = null;
      scope.$digest();
      expect(elm.val()).toBe('');
      scope.selectedDate = new Date(1986, 1, 22);
      scope.$digest();
      expect(elm.val()).toBe('2/22/86');
    });

    it('should correctly change view month when selecting next month button', function() {
      var elm = compileDirective('default');
      // set date to last day of January
      scope.selectedDate = new Date(2014, 0, 31);
      scope.$digest();
      angular.element(elm[0]).triggerHandler('focus');

      for (var nextMonth = 1; nextMonth < 12; nextMonth++) {
        // should show next month view when selecting next month button
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(2)')[0]).triggerHandler('click');
        expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(new Date(2014, nextMonth, 1), 'MMMM yyyy'));
      }
    });

    it('should correctly change view month when selecting previous month button', function() {
      var elm = compileDirective('default');
      // set date to last day of December
      scope.selectedDate = new Date(2014, 11, 31);
      scope.$digest();
      angular.element(elm[0]).triggerHandler('focus');

      for (var previousMonth = 10; previousMonth > -1; previousMonth--) {
        // should show previous month view when selecting previous month button
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(0)')[0]).triggerHandler('click');
        expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(new Date(2014, previousMonth, 1), 'MMMM yyyy'));
      }
    });

    it('should correctly navigate to upper month view', function() {
      var elm = compileDirective('default');
      var date = today.getDate(), month = today.getMonth();
      angular.element(elm[0]).triggerHandler('focus');
      expect(scope.$$childHead.$mode).toBe(0);
      angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
      expect(scope.$$childHead.$mode).toBe(1);
    });

    describe('once in month view', function() {

      it('should correctly compile inner content', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
        expect(sandboxEl.find('.dropdown-menu tbody td').length).toBe(4 * 3);
        expect(sandboxEl.find('.dropdown-menu tbody .btn').length).toBe(4 * 3);
        expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(today, 'yyyy'));
      });

      it('should correctly display active date', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
        expect(sandboxEl.find('.dropdown-menu tbody td .btn-primary').text()).toBe(dateFilter(today, 'MMM'));
      });

    });

    it('should correctly navigate to upper year view', function() {
      var elm = compileDirective('default');
      var date = today.getDate(), month = today.getMonth();
      angular.element(elm[0]).triggerHandler('focus');
      expect(scope.$$childHead.$mode).toBe(0);
      angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
      angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
      expect(scope.$$childHead.$mode).toBe(2);
    });

    describe('once in year view', function() {

      it('should correctly compile inner content', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
        expect(sandboxEl.find('.dropdown-menu tbody td').length).toBe(4 * 3);
        expect(sandboxEl.find('.dropdown-menu tbody .btn').length).toBe(4 * 3);
        // expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(today, 'yyyy'));
      });

      it('should correctly display active date', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(1)')[0]).triggerHandler('click');
        expect(sandboxEl.find('.dropdown-menu tbody td .btn-primary').text()).toBe(dateFilter(today, 'yyyy'));
      });

    });

    it('should correctly support null values', function() {
      var elm = compileDirective('default', {selectedDate: null});
      angular.element(elm[0]).triggerHandler('focus');
      expect(elm.val()).toBe('');
      expect(sandboxEl.find('.dropdown-menu tbody td').length).toBe(7 * 6);
      expect(sandboxEl.find('.dropdown-menu tbody .btn').length).toBe(7 * 6);
      elm.val('0');
      angular.element(elm[0]).triggerHandler('change');
    });

    it('should correctly support undefined values', function() {
      var elm = compileDirective('default', {selectedDate: undefined});
      angular.element(elm[0]).triggerHandler('focus');
      expect(elm.val()).toBe('');
      expect(sandboxEl.find('.dropdown-menu tbody td').length).toBe(7 * 6);
      expect(sandboxEl.find('.dropdown-menu tbody .btn').length).toBe(7 * 6);
      elm.val('0');
      angular.element(elm[0]).triggerHandler('change');
    });

    it('should correctly support invalid values', function() {
      var elm = compileDirective('default');
      elm.val('invalid');
      angular.element(elm[0]).triggerHandler('change');
      angular.element(elm[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody td .btn-primary').text().trim() * 1).toBe(today.getDate());
      angular.element(sandboxEl.find('.dropdown-menu tbody td .btn-primary')[0]).triggerHandler('click');
    });

    it('should handle empty values', function() {
      var elm = compileDirective('default');
      elm.val('');
      angular.element(elm[0]).triggerHandler('change');
      expect(scope.selectedDate).toBeNull();
    });

    it('should support ngRepeat markup', function() {
      var elm = compileDirective('markup-ngRepeat');
      angular.element(elm.find('[bs-datepicker]:eq(0)')).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody td').length).toBe(7 * 6);
      expect(sandboxEl.find('.dropdown-menu tbody .btn').length).toBe(7 * 6);
    });

    it('should support ngChange markup', function() {
      var elm = compileDirective('markup-ngChange');
      angular.element(elm[0]).triggerHandler('focus');
      var spy = spyOn(scope, 'onChange').and.callThrough();
      angular.element(sandboxEl.find('.dropdown-menu tbody .btn:eq(1)')[0]).triggerHandler('click');
      expect(spy).toHaveBeenCalled();
    });

    it('should support ngRequired markup', function() {
      var elm = compileDirective('markup-ngRequired');
      var testDate = new Date(2010, 1, 22);

      expect(elm.val()).not.toBe('');
      expect(scope.selectedDate).toBeDefined();
      expect(scope.selectedDate).toEqual(testDate);

      angular.element(elm[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody td .btn-primary').text().trim() * 1).toBe(testDate.getDate());
      expect(elm.val()).toBe((testDate.getMonth() + 1) + '/' + testDate.getDate() + '/' + (testDate.getFullYear() + '').substr(2));
    });

    it('should consider empty value valid-date with ngRequired markup', function() {
      var elm = compileDirective('markup-ngRequired');

      // we don't check ng-valid-parse because AngularJs 1.2
      // doesn't use that class

      expect(elm.hasClass('ng-valid')).toBe(true);
      expect(elm.hasClass('ng-valid-required')).toBe(true);

      angular.element(elm[0]).triggerHandler('focus');
      elm.val('');
      angular.element(elm[0]).triggerHandler('change');

      // if input is empty, consider valid-date and let
      // ngRequired invalidate the value
      expect(elm.hasClass('ng-valid-date')).toBe(true);
      expect(elm.hasClass('ng-invalid')).toBe(true);
      expect(elm.hasClass('ng-invalid-required')).toBe(true);
    });

    it('should consider empty value valid-parse without ngRequired markup', function() {
      var elm = compileDirective('default');

      // we don't check ng-valid-parse because AngularJs 1.2
      // doesn't use that class

      expect(elm.hasClass('ng-valid')).toBe(true);

      angular.element(elm[0]).triggerHandler('focus');
      elm.val('');
      angular.element(elm[0]).triggerHandler('change');

      // if input is empty, consider valid-date and let
      // other validators run
      expect(elm.hasClass('ng-valid-date')).toBe(true);
      expect(elm.hasClass('ng-valid')).toBe(true);
    });

    // iit('should only build the datepicker once', function() {
    //   var elm = compileDirective('value-past');
    //   angular.element(elm[0]).triggerHandler('focus');
    // });

    describe('for each month of the year', function() {
      var elm;
      var firstDay, previousDay;
      var monthToCheck = 0;

      beforeEach(function() {
        jasmine.addMatchers({
          toBeNextDayOrFirstDay: function(util, customEqualityTesters) {
            return {
              compare: function(actual, expected) {
                var result = {};
                var previousDay = expected;
                result.pass = actual === (previousDay + 1) || actual === 1;
                result.message = "Expected " + actual + " to be either " + (previousDay + 1) + " or 1";
                return result;
              }
            };
          }
        });

        elm = compileDirective('default', { selectedDate: new Date(2012, monthToCheck, 1) });
        angular.element(elm[0]).triggerHandler('focus');
        firstDay = sandboxEl.find('.dropdown-menu tbody .btn:eq(0)').text() * 1;
        previousDay = firstDay - 1;
      });

      afterEach(function() {
        monthToCheck++;
      });

      for (var month = 0; month < 12; month++) {
        it('should correctly order month days in inner content', function() {
          // 6 rows (weeks) * 7 columns (days)
          for(var index = 0; index < 7 * 6; index++) {
            var indexDay = sandboxEl.find('.dropdown-menu tbody td .btn:eq(' + index + ')').text() * 1;
            expect(indexDay).toBeNextDayOrFirstDay(previousDay);
            previousDay = indexDay;
          }
        });
      }

    });

  });

  describe('resource allocation', function() {
    it('should not create additional scopes after first show', function() {
      var elm = compileDirective('default');
      angular.element(elm[0]).triggerHandler('focus');
      $animate.triggerCallbacks();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
      angular.element(elm[0]).triggerHandler('blur');
      $animate.triggerCallbacks();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);

      var scopeCount = countScopes(scope, 0);

      for (var i = 0; i < 10; i++) {
        angular.element(elm[0]).triggerHandler('focus');
        $animate.triggerCallbacks();
        angular.element(elm[0]).triggerHandler('blur');
        $animate.triggerCallbacks();
      }

      expect(countScopes(scope, 0)).toBe(scopeCount);
    });

    it('should not create additional scopes when changing months', function() {
      var elm = compileDirective('default');
      angular.element(elm[0]).triggerHandler('focus');
      $animate.triggerCallbacks();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);

      var scopeCount = countScopes(scope, 0);

      for (var i = 0; i < 10; i++) {
        angular.element(sandboxEl.find('.dropdown-menu thead button:eq(2)')[0]).triggerHandler('click');
        scope.$digest();
      }

      expect(countScopes(scope, 0)).toBe(scopeCount);
    });

    it('should destroy scopes when destroying directive scope', function() {
      var scopeCount = countScopes(scope, 0);
      var originalScope = scope;
      scope = scope.$new();
      var elm = compileDirective('default');

      for (var i = 0; i < 10; i++) {
        angular.element(elm[0]).triggerHandler('focus');
        $animate.triggerCallbacks();
        angular.element(elm[0]).triggerHandler('blur');
        $animate.triggerCallbacks();
      }

      scope.$destroy();
      scope = originalScope;
      expect(countScopes(scope, 0)).toBe(scopeCount);
    });
  });

  describe('bsShow attribute', function() {
    it('should support setting to a boolean value', function() {
      var elm = compileDirective('bsShow-attr');
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
    });

    it('should support binding', function() {
      var elm = compileDirective('bsShow-binding');
      expect(scope.isVisible).toBeFalsy();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
      scope.isVisible = true;
      scope.$digest();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
      scope.isVisible = false;
      scope.$digest();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
    });

    it('should support initial value false', function() {
      var elm = compileDirective('bsShow-binding');
      expect(scope.isVisible).toBeFalsy();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
    });

    it('should support initial value true', function() {
      var elm = compileDirective('bsShow-binding', {isVisible: true});
      expect(scope.isVisible).toBeTruthy();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
    });

    it('should support undefined value', function() {
      var elm = compileDirective('bsShow-binding', {isVisible: undefined});
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
    });

    it('should support string value', function() {
      var elm = compileDirective('bsShow-binding', {isVisible: 'a string value'});
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
      scope.isVisible = 'TRUE';
      scope.$digest();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
      scope.isVisible = 'dropdown';
      scope.$digest();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
      scope.isVisible = 'datepicker,tooltip';
      scope.$digest();
      expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(1);
    });
  });

  // describe('using service', function() {

  //   it('should correctly open on next digest', function() {
  //     var myModal = $modal(templates['default'].scope.modal);
  //     scope.$digest();
  //     expect(bodyEl.children('.modal').length).toBe(1);
  //     myModal.hide();
  //     expect(bodyEl.children('.modal').length).toBe(0);
  //   });

  //   it('should correctly be destroyed', function() {
  //     var myModal = $modal(angular.extend(templates['default'].scope.modal));
  //     scope.$digest();
  //     expect(bodyEl.children('.modal').length).toBe(1);
  //     myModal.destroy();
  //     expect(bodyEl.children('.modal').length).toBe(0);
  //     expect(bodyEl.children().length).toBe(1);
  //   });

  //   it('should correctly work with ngClick', function() {
  //     var elm = compileDirective('markup-ngClick-service');
  //     var myModal = $modal(angular.extend({show: false}, templates['default'].scope.modal));
  //     scope.showModal = function() {
  //       myModal.$promise.then(myModal.show);
  //     };
  //     expect(bodyEl.children('.modal').length).toBe(0);
  //     angular.element(elm[0]).triggerHandler('click');
  //     expect(bodyEl.children('.modal').length).toBe(1);
  //   });

  // });

  describe('options', function() {

    describe('animation', function() {

      it('should default to `am-fade` animation', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.children('.dropdown-menu').hasClass('am-fade')).toBeTruthy();
      });

      it('should support custom animation', function() {
        var elm = compileDirective('options-animation');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.children('.dropdown-menu').hasClass('am-flip-x')).toBeTruthy();
      });

    });

    describe('autoclose', function() {

      it('should close on select', function() {
        var elm = compileDirective('options-autoclose');
        expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu tbody .btn:first')).triggerHandler('click');
        $timeout.flush();
        expect(sandboxEl.children('.dropdown-menu.datepicker').length).toBe(0);
      });

    });

    describe('placement', function() {
      var $$rAF;
      beforeEach(inject(function (_$$rAF_) {
        $$rAF = _$$rAF_
      }));

      it('should default to `bottom-left` placement', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('focus');
        $$rAF.flush();
        expect(sandboxEl.children('.dropdown-menu').hasClass('bottom-left')).toBeTruthy();
      });

      it('should support placement', function() {
        var elm = compileDirective('options-placement');
        angular.element(elm[0]).triggerHandler('focus');
        $$rAF.flush();
        expect(sandboxEl.children('.dropdown-menu').hasClass('bottom')).toBeTruthy();
      });

      it('should support exotic-placement', function() {
        var elm = compileDirective('options-placement-exotic');
        angular.element(elm[0]).triggerHandler('focus');
        $$rAF.flush();
        expect(sandboxEl.children('.dropdown-menu').hasClass('bottom-right')).toBeTruthy();
      });

    });

    describe('trigger', function() {

      it('should support an alternative trigger', function() {
        var elm = compileDirective('options-trigger');
        expect(sandboxEl.children('.dropdown-menu').length).toBe(0);
        angular.element(elm[0]).triggerHandler('mouseenter');
        expect(sandboxEl.children('.dropdown-menu').length).toBe(1);
        angular.element(elm[0]).triggerHandler('mouseleave');
        expect(sandboxEl.children('.dropdown-menu').length).toBe(0);
      });

    });

    describe('template', function() {

      it('should support custom template', function() {
        $templateCache.put('custom', '

foo: {{selectedDate}}

');
        var elm = compileDirective('options-template');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-inner').text()).toBe('foo: "' + scope.selectedDate.toISOString() + '"');
      });

      it('should support template with ngRepeat', function() {
        $templateCache.put('custom', '

{{i}}

');
        var elm = compileDirective('options-template');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-inner').text()).toBe('123');
        // Consecutive toggles
        angular.element(elm[0]).triggerHandler('blur');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-inner').text()).toBe('123');
      });

      it('should support template with ngClick', function() {
        $templateCache.put('custom', '

click me

');
        var elm = compileDirective('options-template');
        scope.dropdown = {counter: 0};
        angular.element(elm[0]).triggerHandler('focus');
        expect(angular.element(sandboxEl.find('.dropdown-inner > .btn')[0]).triggerHandler('click'));
        expect(scope.dropdown.counter).toBe(1);
        // Consecutive toggles
        angular.element(elm[0]).triggerHandler('blur');
        angular.element(elm[0]).triggerHandler('focus');
        expect(angular.element(sandboxEl.find('.dropdown-inner > .btn')[0]).triggerHandler('click'));
        expect(scope.dropdown.counter).toBe(2);
      });

    });

    describe('type', function() {

      it('should support string type with a dateFormat', function() {
        var elm = compileDirective('options-typeStringDateFormat');
        expect(elm.val()).toBe('22/02/1986');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(16)')).triggerHandler('click');
        expect(elm.val()).toBe('16/02/1986');
      });

      it('should support string type with an alternative dateFormat', function() {
        var elm = compileDirective('options-typeStringDateFormatAlternative');
        expect(elm.val()).toBe('2014-04-11');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(16)')).triggerHandler('click');
        expect(elm.val()).toBe('2014-04-16');
      });

    });

    describe('dateFormat', function() {

      it('should support a custom dateFormat', function() {
        var elm = compileDirective('options-dateFormat');
        expect(elm.val()).toBe('1986-02-22');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(24)')).triggerHandler('click');
        expect(elm.val()).toBe('1986-02-24');
      });

      it('should support an alternative custom dateFormat', function() {
        var elm = compileDirective('options-dateFormat-alt');
        expect(elm.val()).toBe('Saturday February 22, 1986');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(24)')).triggerHandler('click');
        expect(elm.val()).toBe('Monday February 24, 1986');
      });

      it('should support a custom named dateFormat', function() {
        var elm = compileDirective('options-named-dateFormat');
        expect(elm.val()).toBe('Feb 22, 1986');
        angular.element(elm[0]).triggerHandler('focus');
        angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(24)')).triggerHandler('click');
        expect(elm.val()).toBe('Feb 24, 1986');
      });

    });

    describe('strictFormat', function () {

      it('should support strict format date parse', function () {
        var elm = compileDirective('options-strictFormat');
        expect(elm.val()).toBe('1986-2-4');
        elm.val('1996-4-7');
        angular.element(elm[0]).triggerHandler('change');
        expect(elm.val()).toBe('1996-4-7');
        expect(elm.hasClass('ng-valid')).toBe(true);
      });

    });

    describe('minDate', function() {

      it('should support a dynamic minDate', function() {
        var elm = compileDirective('options-minDate');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(19)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
        scope.minDate = '02/12/86';
        scope.$digest();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(11)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(12)').is(':disabled')).toBeFalsy();
      });

      it('should support today as minDate', function() {
        var elm = compileDirective('options-minDate-today');
        angular.element(elm[0]).triggerHandler('focus');
        var todayDate = today.getDate();
        expect(sandboxEl.find('.dropdown-menu tbody button[disabled]').length > 0).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(' + todayDate + ').btn-primary').length).toBe(1);
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(' + todayDate + ').btn-primary').is(':disabled')).toBeFalsy();
      });

      it('should support number as minDate', function() {
        var elm = compileDirective('options-minDate-number');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(19)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      });

      it('should support Date object as minDate', function() {
        var elm = compileDirective('options-minDate-date');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(19)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      });

      it('should trigger validation when minDate changes', function() {
        var elm = compileDirective('options-minDate-date');
        expect(elm.hasClass('ng-valid')).toBe(true);
        scope.minDate = new Date(1986, 1, 25);
        scope.$digest();
        expect(elm.hasClass('ng-valid')).toBe(false);
        scope.minDate = new Date(1986, 1, 18);
        scope.$digest();
        expect(elm.hasClass('ng-valid')).toBe(true);
      });

      it('should reset minDate to -Infinity when set empty string', function() {
        var elm = compileDirective('options-minDate');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(19)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
        scope.minDate = '';
        scope.$digest();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(19)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      });

    });

    describe('maxDate', function() {

      it('should support a dynamic maxDate', function() {
        var elm = compileDirective('options-maxDate');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeTruthy();
        scope.maxDate = '02/12/86';
        scope.$digest();
        // @TODO fixme
        // expect(sandboxEl.find('.dropdown-menu tbody button:contains(12)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(13)').is(':disabled')).toBeTruthy();
      });

      it('should support today as maxDate', function() {
        var elm = compileDirective('options-maxDate-today');
        angular.element(elm[0]).triggerHandler('focus');
        var todayDate = today.getDate();
        expect(sandboxEl.find('.dropdown-menu tbody button[disabled]').length > 0).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(' + todayDate + ').btn-primary').length).toBe(1);
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(' + todayDate + ').btn-primary').is(':disabled')).toBeFalsy();
      });

      it('should support number as maxDate', function() {
        var elm = compileDirective('options-maxDate-number');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeTruthy();
      });

      it('should support Date object as maxDate', function() {
        var elm = compileDirective('options-maxDate-date');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeTruthy();
      });

      it('should trigger validation when maxDate changes', function() {
        var elm = compileDirective('options-maxDate-date');
        expect(elm.hasClass('ng-valid')).toBe(true);
        scope.maxDate = new Date(1986, 1, 20);
        scope.$digest();
        expect(elm.hasClass('ng-valid')).toBe(false);
        scope.maxDate = new Date(1986, 1, 26);
        scope.$digest();
        expect(elm.hasClass('ng-valid')).toBe(true);
      });

      it('should reset maxDate to +Infinity when set empty string', function() {
        var elm = compileDirective('options-maxDate');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeTruthy();
        scope.maxDate = '';
        scope.$digest();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
      });

    });

    describe('startWeek', function() {

      it('should support a dynamic startWeek', function() {
        var elm = compileDirective('options-startWeek');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu thead tr:eq(1) th:eq(0)').text()).toBe('Mon');
        expect(sandboxEl.find('.dropdown-menu tbody button:eq(0)').text()).toBe('27');
      });

      it('should support a negative gap induced by startWeek', function() {
        var elm = compileDirective('options-startWeek-bis');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu thead tr:eq(1) th:eq(0)').text()).toBe('Sat');
        expect(sandboxEl.find('.dropdown-menu tbody button:eq(0)').text()).toBe('28');
      });

    });

    describe('startDate', function() {

      it('should support a dynamic startDate', function() {
        var elm = compileDirective('options-startDate');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(new Date(scope.startDate), 'MMMM yyyy'));
      });

      it('should support a dynamic startDate from date object', function() {
        var elm = compileDirective('options-startDate', {startDate: new Date(2014, 2, 2)});
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu thead button:eq(1)').text()).toBe(dateFilter(scope.startDate, 'MMMM yyyy'));
      });

    });

    describe('useNative', function() {

      it('should correctly compile template according to useNative', function() {
        var elm = compileDirective('options-useNative');
        angular.element(elm[0]).triggerHandler('focus');
        // @TODO ?
      });

    });

  });

  describe('dateModelFormat', function() {

    it('should support a custom modelDateFormat', function() {
      var elm = compileDirective('options-modelDateFormat');

      // Should have the predefined value
      expect(elm.val()).toBe('01/12/2014');

      // Should correctly set the model value if set via the datepicker
      angular.element(elm[0]).triggerHandler('focus');
      angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(24)')).triggerHandler('click');
      expect(elm.val()).toBe('24/12/2014');
      expect(scope.selectedDate).toBe('2014-12-24');

      // Should correctly set the model if the date is manually typed into the input
      elm.val('20/11/2014');
      angular.element(elm[0]).triggerHandler('change');
      scope.$digest();
      expect(scope.selectedDate).toBe('2014-11-20');
    });

    it('should support longDate modelDateFormat', function() {
      var elm = compileDirective('options-modelDateFormat-longDate');

      // Should have the predefined value
      expect(elm.val()).toBe('12/1/14');

      // Should correctly set the model value if set via the datepicker
      angular.element(elm[0]).triggerHandler('focus');
      angular.element(sandboxEl.find('.dropdown-menu tbody .btn:contains(24)')).triggerHandler('click');
      expect(elm.val()).toBe('12/24/14');
      expect(scope.selectedDate).toBe('December 24, 2014');

      // Should correctly set the model if the date is manually typed into the input
      elm.val('11/20/14');
      angular.element(elm[0]).triggerHandler('change');
      scope.$digest();
      expect(scope.selectedDate).toBe('November 20, 2014');
    });

  });

  describe('daysOfWeekDisabled', function() {

      it('should enable all days of the week by default', function() {
        var elm = compileDirective('options-daysOfWeekDisabled');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeFalsy();
      });

      it('should allow disabling some days of the week', function() {
        var elm = compileDirective('options-daysOfWeekDisabled-bis');
        angular.element(elm[0]).triggerHandler('focus');
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeTruthy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
        expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeTruthy();
      });

    });

  describe('disabledDates', function() {

    it('should not disable any dates by default', function() {
      var disabledScopeProperty = {
        disabledDates: []
      };
      var elem = compileDirective('options-disabledDates', disabledScopeProperty);
      angular.element(elem[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeFalsy();
    });

    it('should disable a single date range', function() {
      var disabledScopeProperty = {
        disabledDates: [
          { start: new Date(2014, 6, 22), end: new Date(2014, 6, 25)}
        ]
      };
      var elem = compileDirective('options-disabledDates', disabledScopeProperty);
      angular.element(elem[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeFalsy();
    });

    it('should disable multiple sorted date ranges', function() {
      var disabledScopeProperty = {
        disabledDates: [
          { start: new Date(2014, 6, 21), end: new Date(2014, 6, 22) },
          { start: new Date(2014, 6, 24), end: new Date(2014, 6, 24) }
        ]
      };
      var elem = compileDirective('options-disabledDates', disabledScopeProperty);
      angular.element(elem[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeFalsy();
    });

    it('should disable multiple sorted date ranges out of order', function() {
      var disabledScopeProperty = {
        disabledDates: [
          { start: new Date(2014, 6, 24), end: new Date(2014, 6, 24) },
          { start: new Date(2014, 6, 21), end: new Date(2014, 6, 22) }
        ]
      };
      var elem = compileDirective('options-disabledDates', disabledScopeProperty);
      angular.element(elem[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeFalsy();
    });

    it('should work combined with minDate/maxDate', function() {
      var disabledScopeProperty = {
        disabledDates: [
          { start: new Date(2014, 6, 23), end: new Date(2014, 6, 24) }
        ]
      };
      var elem = compileDirective('options-disabledDates-minmax', disabledScopeProperty);
      angular.element(elem[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeTruthy();
    });

    it('should work combined with daysOfWeekDisabled', function() {
      var disabledScopeProperty = {
        disabledDates: [
          { start: new Date(2014, 6, 22), end: new Date(2014, 6, 22) }
        ]
      };
      var elem = compileDirective('options-disabledDates-daysOfWeek', disabledScopeProperty);
      angular.element(elem[0]).triggerHandler('focus');
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(20)').is(':disabled')).toBeTruthy(); // July 25, 2014 is a Sunday, disabled
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(21)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(22)').is(':disabled')).toBeTruthy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(23)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(24)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(25)').is(':disabled')).toBeFalsy();
      expect(sandboxEl.find('.dropdown-menu tbody button:contains(26)').is(':disabled')).toBeFalsy();
    });

  });

  describe('datepickerViews', function () {
    var picker;

    beforeEach(inject(function () {
      picker = {
        select: function (date, keep) {},
        $options: {
          startWeek: 0,
          daysOfWeekDisabled: '',
          dateFormat: 'shortDate'
        },
        $date: null
      };

      spyOn(picker, 'select');
    }));

    it('should change the day when navigating with the keyboard in the day view', inject(function (_datepickerViews_) {
      var datepickerViews = _datepickerViews_(picker);

      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[0].onKeyDown({ keyCode: 37 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2014, 0, 5), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[0].onKeyDown({ keyCode: 38 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2013, 11, 30), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[0].onKeyDown({ keyCode: 39 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2014, 0, 7), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[0].onKeyDown({ keyCode: 40 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2014, 0, 13), true);

      picker.select.calls.reset();
      picker.$date = null;
      datepickerViews.views[0].onKeyDown({ keyCode: 40 });
      expect(picker.select).not.toHaveBeenCalled();
    }));

    it('should change the month when navigating with the keyboard in the month view', inject(function (_datepickerViews_) {
      var datepickerViews = _datepickerViews_(picker);

      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[1].onKeyDown({ keyCode: 37 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2013, 11, 6), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[1].onKeyDown({ keyCode: 38 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2013, 8, 6), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[1].onKeyDown({ keyCode: 39 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2014, 1, 6), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[1].onKeyDown({ keyCode: 40 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2014, 4, 6), true);

      picker.select.calls.reset();
      picker.$date = null;
      datepickerViews.views[1].onKeyDown({ keyCode: 40 });
      expect(picker.select).not.toHaveBeenCalled();
    }));

    it('should change the year when navigating with the keyboard in the year view', inject(function (_datepickerViews_) {
      var datepickerViews = _datepickerViews_(picker);

      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[2].onKeyDown({ keyCode: 37 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2013, 0, 6), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[2].onKeyDown({ keyCode: 38 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2010, 0, 6), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[2].onKeyDown({ keyCode: 39 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2015, 0, 6), true);

      picker.select.calls.reset();
      picker.$date = new Date(2014, 0, 6);
      datepickerViews.views[2].onKeyDown({ keyCode: 40 });
      expect(picker.select).toHaveBeenCalledWith(new Date(2018, 0, 6), true);

      picker.select.calls.reset();
      picker.$date = null;
      datepickerViews.views[2].onKeyDown({ keyCode: 40 });
      expect(picker.select).not.toHaveBeenCalled();
    }));
  });
});


text:
package net.jsunit.action;

import net.jsunit.model.BrowserResult;

public interface BrowserResultAware {

    public void setBrowserResult(BrowserResult result);

}


text:
if(WIN32)
# DLL should be in binary folder
install(TARGETS FAST
	DESTINATION fast/bin
	COMPONENT fast
)
else()
install(TARGETS FAST
	DESTINATION fast/lib
	COMPONENT fast
)
endif()

if(FAST_BUILD_TESTS)
    # Install test executable
    install(TARGETS testFAST
        DESTINATION fast/bin
		COMPONENT fast
    )
endif()

# Examples are installed in the macro fast_add_example

# Install dependency libraries
install(FILES ${PROJECT_BINARY_DIR}/FASTExport.hpp
    DESTINATION fast/include
	COMPONENT fast
)
install(FILES ${PROJECT_BINARY_DIR}/FASTVersion.hpp
	DESTINATION fast/include
	COMPONENT fast
)
if(WIN32)
	install(DIRECTORY ${PROJECT_BINARY_DIR}/bin/
			DESTINATION fast/bin/
			COMPONENT fast
			FILES_MATCHING PATTERN "*.dll")
	install(DIRECTORY ${PROJECT_BINARY_DIR}/lib/
			DESTINATION fast/lib/
			COMPONENT fast
			FILES_MATCHING PATTERN "*.lib")
elseif(APPLE)
	install(DIRECTORY ${PROJECT_BINARY_DIR}/lib/
			DESTINATION fast/lib/
			COMPONENT fast
			FILES_MATCHING PATTERN "*.dylib*")
	install(DIRECTORY ${PROJECT_BINARY_DIR}/lib/
			DESTINATION fast/lib/
			COMPONENT fast
			FILES_MATCHING PATTERN "*.so*")
	install(SCRIPT cmake/FixRPaths.cmake COMPONENT fast)
	if(FAST_SIGN_CODE)
		install(CODE "
    file(GLOB installedSOs
            \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/lib/*.dylib*\"
            \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/lib/*.so*\"
            \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/bin/*\"
	)

    foreach(SO $\{installedSOs\})
    	message(\"-- Signing $\{SO\}\")
		execute_process(COMMAND codesign --force --options runtime,library -s \"Developer ID Application: Erik Smistad (85JK2HDMY2)\" --timestamp --signature-size=12000 $\{SO\} RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE err)
		if (NOT res EQUAL 0)
			message(\"Unable to sign $\{SO\} - $\{err\}\")
		endif ()
	endforeach()
    message(\"Binaries signed\")
		" COMPONENT fast)
	endif()
else()
	install(DIRECTORY ${PROJECT_BINARY_DIR}/lib/
			DESTINATION fast/lib/
			COMPONENT fast
			FILES_MATCHING PATTERN "*.so*")
	# Fix RPaths on install
    install(SCRIPT cmake/FixRPaths.cmake COMPONENT fast)
endif()

# Install Qt plugins
if(FAST_MODULE_Visualization)
install(DIRECTORY ${PROJECT_BINARY_DIR}/plugins/
    DESTINATION fast/plugins/
		COMPONENT fast
)

# Install qt moc
install(FILES ${PROJECT_BINARY_DIR}/bin/moc${CMAKE_EXECUTABLE_SUFFIX}
    PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
    DESTINATION fast/bin
	COMPONENT fast
)
if(WIN32)
		# Install qt idc https://doc.qt.io/qt-5/activeqt-idc.html
		install(FILES ${PROJECT_BINARY_DIR}/bin/idc.exe
		    PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
		    DESTINATION fast/bin
		)
endif()
endif()

# Install headers
install(DIRECTORY ${FAST_SOURCE_DIR}
	DESTINATION fast/include/FAST/
	COMPONENT fast
	FILES_MATCHING PATTERN "*.hpp"
)
install(DIRECTORY ${FAST_SOURCE_DIR}
	DESTINATION fast/include/FAST/
	COMPONENT fast
	FILES_MATCHING PATTERN "*.h"
)

# External include files needed
set(INCLUDE_FOLDERS
    eigen3
	  CL
    QtAccessibilitySupport
    QtConcurrent
    QtCore
    QtDBus
    QtDeviceDiscoverySupport
    QtEventDispatcherSupport
    QtFbSupport
    QtFontDatabaseSupport
    QtGui
    QtMultimedia
    QtMultimediaWidgets
    QtNetwork
    QtOpenGL
    QtOpenGLExtensions
    QtPlatformCompositorSupport
    QtPlatformHeaders
    QtPrintSupport
    QtSerialPort
    QtSql
    QtSvg
    QtTest
    QtThemeSupport
    QtWidgets
    QtXml
    QtZlib)
if(FAST_MODULE_Plotting)
    list(APPEND INCLUDE_FOLDERS jkqtplotter jkqtcommon jkqtfastplotter jkqtmathtext)
endif()
if(WIN32)
    list(APPEND INCLUDE_FOLDERS
        ActiveQt
    )
elseif(APPLE)
else()
    list(APPEND INCLUDE_FOLDERS
        QtGlxSupport
        QtServiceSupport
        QtInputSupport
    )
endif()
foreach(INCLUDE_FOLDER ${INCLUDE_FOLDERS})
    install(DIRECTORY ${PROJECT_BINARY_DIR}/include/${INCLUDE_FOLDER}/
        DESTINATION fast/include/${INCLUDE_FOLDER}/
				OPTIONAL
		COMPONENT fast
        FILES_MATCHING PATTERN "*.h"
    )
    install(DIRECTORY ${PROJECT_BINARY_DIR}/include/${INCLUDE_FOLDER}/
        DESTINATION fast/include/${INCLUDE_FOLDER}/
				OPTIONAL
		COMPONENT fast
        FILES_MATCHING PATTERN "*.hpp"
    )
    install(DIRECTORY ${PROJECT_BINARY_DIR}/include/${INCLUDE_FOLDER}/
        DESTINATION fast/include/${INCLUDE_FOLDER}/
				OPTIONAL
		COMPONENT fast
        FILES_MATCHING REGEX "/[^.]+$" # Files with no extension
    )
endforeach()

# Install created headers
install(FILES ${PROJECT_BINARY_DIR}/ProcessObjectList.hpp
    DESTINATION fast/include/FAST/
	COMPONENT fast
)

# Install OpenCL kernels
install(DIRECTORY ${FAST_SOURCE_DIR}
	DESTINATION fast/kernels/
	COMPONENT fast
	FILES_MATCHING PATTERN "*.cl"
)

# Install GL shaders
install(DIRECTORY ${FAST_SOURCE_DIR}
	DESTINATION fast/kernels/
	COMPONENT fast
	FILES_MATCHING PATTERN "*.vert"
)
install(DIRECTORY ${FAST_SOURCE_DIR}
	DESTINATION fast/kernels/
	COMPONENT fast
	FILES_MATCHING PATTERN "*.frag"
)
install(DIRECTORY ${FAST_SOURCE_DIR}
	DESTINATION fast/kernels/
	COMPONENT fast
	FILES_MATCHING PATTERN "*.geom"
)

# Install CMake files
install(FILES ${PROJECT_BINARY_DIR}/FASTConfig.cmake ${PROJECT_BINARY_DIR}/FASTUse.cmake
    DESTINATION fast/cmake
	COMPONENT fast
)
install(FILES ${PROJECT_SOURCE_DIR}/cmake/FindOpenCL.cmake
    DESTINATION fast/cmake
	COMPONENT fast
)

# Install fonts and icons/logo
install(DIRECTORY ${PROJECT_SOURCE_DIR}/doc/fonts/
    DESTINATION fast/doc/fonts/
	COMPONENT fast
)
install(FILES
			${PROJECT_SOURCE_DIR}/doc/images/fast_icon.ico
			${PROJECT_SOURCE_DIR}/doc/images/fast_icon.png
			${PROJECT_SOURCE_DIR}/doc/images/FAST_logo_square.png
		DESTINATION fast/doc/images/
		COMPONENT fast
)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/doc/
		DESTINATION fast/doc/
		COMPONENT fast
		FILES_MATCHING PATTERN "*.ini"
)

# Install pipelines
install(DIRECTORY ${PROJECT_SOURCE_DIR}/pipelines/
    DESTINATION fast/pipelines/
	COMPONENT fast
)

# Copy configuration file
# Create new configuration file for install

set(CONFIG_KERNEL_SOURCE_PATH "KernelSourcePath = @ROOT@/kernels/")
set(CONFIG_KERNEL_BINARY_PATH "KernelBinaryPath = @ROOT@/kernel_binaries/")
set(CONFIG_DOCUMENTATION_PATH "DocumentationPath = @ROOT@/doc/")
set(CONFIG_PIPELINE_PATH "PipelinePath = @ROOT@/pipelines/")
set(CONFIG_TEST_DATA_PATH "TestDataPath = @ROOT@/data/")
if(WIN32)
		set(CONFIG_LIBRARY_PATH "LibraryPath = @ROOT@/bin/")
else()
		set(CONFIG_LIBRARY_PATH "LibraryPath = @ROOT@/lib/")
endif()

set(CONFIG_QT_PLUGINS_PATH "QtPluginsPath = @ROOT@/plugins/")
configure_file(
    "${PROJECT_SOURCE_DIR}/source/fast_configuration.txt.in"
    "${PROJECT_BINARY_DIR}/fast_configuration_install.txt"
)
install(FILES ${PROJECT_BINARY_DIR}/fast_configuration_install.txt
    RENAME fast_configuration.txt
    DESTINATION fast/bin/
	COMPONENT fast
)

# Install FAST license file
install(FILES ${PROJECT_SOURCE_DIR}/LICENSE
    DESTINATION fast/licenses/fast/
	COMPONENT fast
)
# Install README
install(FILES ${PROJECT_SOURCE_DIR}/cmake/InstallFiles/README_default.md
    DESTINATION fast/
    RENAME README.md
	COMPONENT fast
)

# Install license files for depedencies
# Eigen
install(DIRECTORY ${FAST_EXTERNAL_BUILD_DIR}/eigen/src/eigen/
		DESTINATION fast/licenses/eigen/
		COMPONENT fast
		FILES_MATCHING PATTERN "COPYING.*")

# NumPy (numpy.i file)
install(FILES ${PROJECT_SOURCE_DIR}/cmake/InstallFiles/NumPy_LICENSE.txt
		DESTINATION fast/licenses/numpy/
		COMPONENT fast
)
# Eigen SWIG interface (eigen.i file)
install(FILES ${PROJECT_SOURCE_DIR}/cmake/InstallFiles/Eigen_SWIG_interface_LICENSE.txt
		DESTINATION fast/licenses/eigen-swig/
		COMPONENT fast
)
# Semaphore implementation
install(FILES ${PROJECT_SOURCE_DIR}/cmake/InstallFiles/Semaphore_LICENSE.txt
		DESTINATION fast/licenses/semaphore/
		COMPONENT fast
)
# Install licenses
install(DIRECTORY ${PROJECT_BINARY_DIR}/licenses/
	OPTIONAL
	DESTINATION fast/licenses
	COMPONENT fast
)
install(DIRECTORY ${PROJECT_BINARY_DIR}/licences/
	OPTIONAL
	DESTINATION fast/licenses
	COMPONENT fast
)
if(FAST_MODULE_OpenVINO)
	if(WIN32)
		install(FILES ${PROJECT_BINARY_DIR}/bin/plugins.xml ${PROJECT_BINARY_DIR}/bin/cache.json
		  DESTINATION fast/bin/
			COMPONENT fast
	  )
	else()
		install(FILES ${PROJECT_BINARY_DIR}/lib/plugins.xml ${PROJECT_BINARY_DIR}/lib/cache.json
			DESTINATION fast/lib/
			COMPONENT fast
			OPTIONAL
		)
	endif()
endif()

if(FAST_MODULE_Clarius)
	install(FILES
		${FAST_EXTERNAL_BUILD_DIR}/clarius/src/clarius_headers/LICENSE
		DESTINATION fast/licenses/clarius/
		COMPONENT fast
	)
endif()


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudbuild.v1.model;

/**
 * BuildApproval describes a build's approval configuration, state, and result.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Build API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class BuildApproval extends com.google.api.client.json.GenericJson {

  /**
   * Output only. Configuration for manual approval of this build.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ApprovalConfig config;

  /**
   * Output only. Result of manual approval for this Build.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ApprovalResult result;

  /**
   * Output only. The state of this build's approval.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String state;

  /**
   * Output only. Configuration for manual approval of this build.
   * @return value or {@code null} for none
   */
  public ApprovalConfig getConfig() {
    return config;
  }

  /**
   * Output only. Configuration for manual approval of this build.
   * @param config config or {@code null} for none
   */
  public BuildApproval setConfig(ApprovalConfig config) {
    this.config = config;
    return this;
  }

  /**
   * Output only. Result of manual approval for this Build.
   * @return value or {@code null} for none
   */
  public ApprovalResult getResult() {
    return result;
  }

  /**
   * Output only. Result of manual approval for this Build.
   * @param result result or {@code null} for none
   */
  public BuildApproval setResult(ApprovalResult result) {
    this.result = result;
    return this;
  }

  /**
   * Output only. The state of this build's approval.
   * @return value or {@code null} for none
   */
  public java.lang.String getState() {
    return state;
  }

  /**
   * Output only. The state of this build's approval.
   * @param state state or {@code null} for none
   */
  public BuildApproval setState(java.lang.String state) {
    this.state = state;
    return this;
  }

  @Override
  public BuildApproval set(String fieldName, Object value) {
    return (BuildApproval) super.set(fieldName, value);
  }

  @Override
  public BuildApproval clone() {
    return (BuildApproval) super.clone();
  }

}


text:
/****************************************************************************
 * mm/umm_heap/umm_malloc.c
 *
 *   Copyright (C) 2007, 2009, 2013-2014  Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <tinyara/config.h>
#include <stdlib.h>
#include <unistd.h>
#include <debug.h>
#include <tinyara/mm/mm.h>

/****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/****************************************************************************
 * Type Definitions
 ****************************************************************************/

/****************************************************************************
 * Private Data
 ****************************************************************************/

/****************************************************************************
 * Public Data
 ****************************************************************************/

/****************************************************************************
 * Private Functions
 ****************************************************************************/

/****************************************************************************
 * Public Functions
 ****************************************************************************/

/************************************************************************
 * Name: malloc_at
 *
 * Description:
 *   Allocate memory to the specific heap.
 *   malloc_at tries to allocate memory for a specific heap which passed by api argument.
 *   If there is no enough space to allocate, it will return NULL.
 *
 * Parameters:
 *   heap_index - Index of specific heap.
 *   size - Size (in bytes) of the memory region to be allocated.
 *
 * Return Value:
 *   The address of the allocated memory (NULL on failure to allocate)
 *
 ************************************************************************/

#if CONFIG_KMM_NHEAPS > 1
void *malloc_at(int heap_index, size_t size)
{
	void *ret;
#ifdef CONFIG_DEBUG_MM_HEAPINFO
	size_t caller_retaddr = 0;
	ARCH_GET_RET_ADDRESS(caller_retaddr)
#endif
	if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) {
		mdbg("malloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX);
		return NULL;
	}

	if (size == 0) {
		return NULL;
	}
#ifdef CONFIG_DEBUG_MM_HEAPINFO
	ret = mm_malloc(&BASE_HEAP[heap_index], size, caller_retaddr);
#else
	ret = mm_malloc(&BASE_HEAP[heap_index], size);
#endif
	if (ret == NULL) {
		mm_manage_alloc_fail(&BASE_HEAP[heap_index], heap_index, heap_index, size, USER_HEAP);
	}
	return ret;
}
#endif

#ifndef CONFIG_BUILD_KERNEL
/************************************************************************
 * Name: heap_malloc
 *
 * Description:
 *   Traverse the user heap arrays by index, and try to alloc memory.
 *
 * Parameters:
 *   size - Size (in bytes) of the memory region to be allocated.
 *   s     - Start index
 *   e     - End index
 *   caller_retaddr - caller function return address, used only for DEBUG_MM_HEAPINFO
 * Return Value:
 *   The address of the allocated memory (NULL on failure to allocate)
 *
 ************************************************************************/
static void *heap_malloc(size_t size, int s, int e, size_t caller_retaddr)
{
	int heap_idx;
	void *ret;

	for (heap_idx = s; heap_idx <= e; heap_idx++) {
#ifdef CONFIG_DEBUG_MM_HEAPINFO
		ret = mm_malloc(&BASE_HEAP[heap_idx], size, caller_retaddr);
#else
		ret = mm_malloc(&BASE_HEAP[heap_idx], size);
#endif
		if (ret != NULL) {
			return ret;
		}
	}

	mm_manage_alloc_fail(BASE_HEAP, s, e, size, USER_HEAP);
	return NULL;
}
#endif

/************************************************************************
 * Name: malloc
 *
 * Description:
 *   Allocate memory from the user heap.
 *
 * Parameters:
 *   size - Size (in bytes) of the memory region to be allocated.
 *
 * Return Value:
 *   The address of the allocated memory (NULL on failure to allocate)
 *
 ************************************************************************/

FAR void *malloc(size_t size)
{
#ifdef CONFIG_BUILD_KERNEL
	FAR void *brkaddr;
	FAR void *mem;

	/* Loop until we successfully allocate the memory or until an error
	 * occurs. If we fail to allocate memory on the first pass, then call
	 * sbrk to extend the heap by one page.  This may require several
	 * passes if more the size of the allocation is more than one page.
	 *
	 * An alternative would be to increase the size of the heap by the
	 * full requested allocation in sbrk().  Then the loop should never
	 * execute more than twice (but more memory than we need may be
	 * allocated).
	 */

	do {
		mem = mm_malloc(BASE_HEAP, size);
		if (!mem) {
			brkaddr = sbrk(size);
			if (brkaddr == (FAR void *)-1) {
				return NULL;
			}
		}
	} while (mem == NULL);

	return mem;
#else /* CONFIG_BUILD_KERNEL */

	int heap_idx = HEAP_START_IDX;
	void *ret = NULL;
	size_t caller_retaddr = 0;

	if (size == 0) {
		return NULL;
	}

#ifdef CONFIG_DEBUG_MM_HEAPINFO
	ARCH_GET_RET_ADDRESS(caller_retaddr)
#endif

#ifdef CONFIG_RAM_MALLOC_PRIOR_INDEX
	heap_idx = CONFIG_RAM_MALLOC_PRIOR_INDEX;
#endif

	ret = heap_malloc(size, heap_idx, HEAP_END_IDX, caller_retaddr);
	if (ret != NULL) {
		return ret;
	}

#if (defined(CONFIG_RAM_MALLOC_PRIOR_INDEX) && CONFIG_RAM_MALLOC_PRIOR_INDEX > 0)
	/* Try to mm_calloc to other heaps */
	ret = heap_malloc(size, HEAP_START_IDX, CONFIG_RAM_MALLOC_PRIOR_INDEX - 1, caller_retaddr);
#endif

	return ret;
#endif /* CONFIG_BUILD_KERNEL */
}


text:
package org.apache.kylin.common.restclient;

import java.io.IOException;

import org.junit.Test;

public class RestClientTest {

    @SuppressWarnings("unused")
    @Test
    public void basicTests() throws IOException {
        RestClient a = new RestClient("prod01:80");
        //a.wipeCache("metadata", "a", "a");
        //String aa = a.getKylinProperties();
        //System.out.println(aa);
        RestClient b = new RestClient("sandbox.hortonworks.com:7070");
        //b.wipeCache("metadata", "a", "a");
        //String bb = b.getKylinProperties();
        //System.out.println(bb);

    }

}