text:
package net.sf.mmm.search.engine.api;

import net.sf.mmm.search.api.SearchEntry;

/**
 * This is the interface for a single hit of a {@link SearchResult search}. It represents any content
 * (web-page, document, etc.) that is represented by a single {@link #getUri() URI}.

 * ATTENTION: Depending on the implementation it might be expensive to call methods multiple times.
 *
 * @author Joerg Hohwiller (hohwille at users.sourceforge.net)
 */
public interface SearchHit extends SearchEntry {

  /** @see #getHighlightedText() */
  String HIGHLIGHT_START_TAG = "";

  /** @see #getHighlightedText() */
  String HIGHLIGHT_END_TAG = "";

  /** @see #getHighlightedText() */
  String HIGHLIGHT_CUT_TEXT = "...";

  /** An emtpy SearchHit array. */
  SearchHit[] NO_HITS = new SearchHit[0];

  /**
   * This method gets the ID of this hit in the search index. It can be used to
   * {@link SearchEngine#getEntry(String) retrieve} the entry again. It is explicitly unspecified and may vary
   * in implementations if this is the same as {@link #getId()}.
   *
   * @return the ID of this hit.
   */
  String getEntryId();

  /**
   * This method gets the score of this hit. It is a positive value in the range from 0 to
   * 1, where 1 represents a perfect hit and 0 represents a hit that
   * has nothing in common with the search query. A hit will typically NOT have a {@link #getScore() score} of
   * 0 but the score may be close to 0.
   *
   * @return the score of this hit.
   */
  double getScore();

  /**
   * This method gets the score of this hit as an integer value in the range from 0 to
   * maximum. The higher the score the better the hit. This method is useful to view the score as
   * a percentage value (with a maximum of 100) or a number of stars (e.g. with a
   * maximum of 5).
   *
   * @see #getScore()
   *
   * @param maximum is the maximum score
   * @return the score of this hit.
   */
  int getScore(int maximum);

  /**
   * This method gets an excerpt of the plain text of the content that contains terms of the search query as a
   * highlighted html fragment.

   * The highlighted terms should be surrounded by {@link #HIGHLIGHT_START_TAG} and {@link #HIGHLIGHT_END_TAG}
   * and parts of the text that have been cut out should be replaced with {@link #HIGHLIGHT_CUT_TEXT}. An
   * implementing search-engine component may allow to override these defaults for custom needs.
   *
   * @see #getText()
   *
   * @return the highlighted text of this hit.
   */
  String getHighlightedText();

}


text:
var validate = require('validate.js');

module.exports = function (value, options, key, attributes, settings) {

  var message = options.message || 'already exists';
  var errorMsg = options.error || 'unable to verify';
  var invalidMsg = options.invalid || 'invalid validator config';

  //
  //  Mongoose Adapter
  //
  function mongoose() {
    return new validate.Promise(function (resolve, reject) {

      //  Check for Mongoose Model
      if (!options.Model) {
        return resolve(invalidMsg);
      }

      var where = {};
      where[key] = value;

      /*
      //
      //  @todo Determine if it is faster to query for 1 document
      //  @todo Handle errors better
      //
      options.model.count(where, function (err, count) {
        if (err) {
          return resolve(errorMsg);
        }

        if (count > 0) {
          resolve(message);
        }
        else {
          resolve();
        }
      });
      */

      //
      //  @todo Handle errors better
      //
      options.Model.findOne(where, function (err, model) {
        if (err) {
          return resolve(errorMsg);
        }

        if (model) {
          return resolve(message);
        }

        resolve();
      });

    });
  }

  //
  //  Adapter Selector
  //
  switch (options.adapter) {
    case 'mongoose':
      return mongoose();
      break;

    case 'mysql':
    default:
      return options.adapter ? 'Unsupported validator adapter' : 'Validator adapter not specified';
      break;
  }
};

redpajama_set_name: RedPajamaGithub


text:
Before installing the Google Analytics Extension plugin, make sure your project already has the  [RainLab Google Analytics](http://octobercms.com/plugin/rainlab-googleanalytics) plugin installed and configured. Once this is done, you're ready to start creating your perfect dashboard. Here are some examples to get you started...

### Bar Charts
Bar charts are great for comparing values against each other. In this example, we'll create a bar chart to show how many users are visiting our site in the 10 most common cities.

| Row                | Value      |
| :----------------- | :--------- |
| Widget Title       | Top Cities |
| Dimension          | ga:city    |
| Metric             | ga:users   |
| Results to display | 10         |

### Pie Charts
Pie charts are useful for displaying the make up of data as a whole. Here we'll create a pie chart comparing the number of returning visitors to first time visitors.

| Row                | Value         |
| :----------------- | :------------ |
| Widget Title       | Visitor Types |
| Dimension          | ga:userType   |
| Metric             | ga:sessions   |

### Percentage Charts
Percentage charts will display the make up of data as a percentage of it's total. In this final example, we'll create a percentage chart to display how much of our website's traffic is coming from various device categories.

| Row                | Value             |
| :----------------- | :---------------- |
| Widget Title       | Device Overview   |
| Dimension          | ga:deviceCategory |
| Metric             | ga:visits         |
| Dimension Label    | Device            |
| Metric Label       | Visits            |

### Google Analytics Documentation
[Click here](https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=user,session,traffic_sources,adwords,goal_conversions,platform_or_device,geo_network,system,social_activities,page_tracking,content_grouping,internal_search,site_speed,app_tracking,event_tracking,ecommerce,social_interactions,user_timings,exceptions,content_experiments,custom_variables_or_columns,time,doubleclick_campaign_manager,audience,adsense,channel_grouping,related_products) for a complete list of dimension / metric combinations that may be used with your dashboard widgets.


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 repositorio;

import java.util.ArrayList;
import model.Funcionario;

/**
 *
 * @author alunofavip
 */
public class RepositorioFuncionario {
    private ArrayList<Funcionario> listaFun = new ArrayList<>();

    public void addFunc(Funcionario f){
        this.listaFun.add(f);
    }

    public void removeFunc(Funcionario f){
          for (Funcionario funcAtual : listaFun) {
               if (funcAtual.equals(f)){
                   this.listaFun.remove(f);
                   break;
               }
        }
    }

    public int quantFunc(){
        return this.listaFun.size();
    }

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Willdenowia Beiheft 8:98. 1975

#### Original name
null

### Remarks
null


text:
<!DOCTYPE html>

  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>Ember.js Workshop 101</title>

  <link rel="stylesheet" type="text/css" href="vendor/semantic/semantic.css">
  <link rel="stylesheet" type="text/css" href="styles/app.css">

      Home

      List Page

      Cart Page

      Checkout Page

      Elements

List Page

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

               Add to Cart

Awesome Product Title

          View

        $35.99

Cart Page

Cart

Review your items

Checkout

Proceed with Payment

Confirmation

Track your order

Shopping Cart

                  Awesome Product Title

                    Category

                    A description which may flow for several lines and give context to the content.

$35,99

                      or remove

                      1

                  Awesome Product Title

                    Category

                    A description which may flow for several lines and give context to the content.

$35,99

                      or remove

                        1

                  Awesome Product Title

                    Category

                    A description which may flow for several lines and give context to the content.

$35,99

                      or remove

                        1

              Your order qualifies for FREE Shipping Choose this option at checkout.

                Subtotal (2 items): $103.74

                Proceed to checkout

Estimate your shipping and taxes

Checkout Page

Cart

Review your items

Checkout

Proceed with Payment

Confirmation

Track your order

Payment Information

Shopping Cart

                  Awesome Product Title

                    Category

                    A description which may flow for several lines and give context to the content.

$35,99

                      or remove

                      1

                  Awesome Product Title

                    Category

                    A description which may flow for several lines and give context to the content.

$35,99

                      or remove

                        1

                  Awesome Product Title

                    Category

                    A description which may flow for several lines and give context to the content.

$35,99

                      or remove

                        1

              Your order qualifies for FREE Shipping Choose this option at checkout.

                Subtotal (2 items): $103.74

                Proceed to checkout

Estimate your shipping and taxes

Elements


text:
layout: default
---
{% if site.posts.size > 0 %}

	  {% for post in site.posts %}

{{ post.title }}

		{{ post.excerpt }}

	      Read More

	  {% endfor %}

{% else %}

            {% if site.author.workHistory %}

Work History

                    {% for work in site.author.workHistory %}

                            {% if work.started %}

{{ work.started }}

                            {% endif %}

                                    {% if work.title %}

{{ work.title }}

                                    {% endif %}

                                            {% if work.company %}
                                                {{ work.company }}
                                            {% endif %}

                                            {% if work.duration %}
                                                 {{ work.duration }} |
                                            {% endif %}
                                            {% if work.location %}
                                                  {{ work.location }}
                                            {% endif %}

                                    {% if work.description %}

{{ work.description }}

                                    {% endif %}

                    {% endfor %}

            {% endif %}
            {% if site.author.educationHistory %}

Education History

                    {% for education in site.author.educationHistory %}

                            {% if education.started %}

{{ education.started }}

                            {% endif %}

                                    {% if education.organization %}

{{ education.organization }}

                                    {% endif %}

                                            {% if education.degree %}
                                                {{ education.degree }}
                                            {% endif %}
                                            {% if education.major %}
                                                , {{ education.major }}
                                            {% endif %}

                                    {% if education.duration %}

                                             {{ education.duration }}

                                    {% endif %}

                                    {% if education.description %}

{{ education.description }}

                                    {% endif %}

                    {% endfor %}

            {% endif %}

            {% if site.author.programmingSkills %}

Trained Neural Networks

                        {% for programmingSkill in site.author.programmingSkills %}

                                {% if programmingSkill.name %}
                                    {{ programmingSkill.name }}
                                {% endif %}
                                {% if programmingSkill.percentage %}

                                            {{ programmingSkill.percentage }}

                                {% endif %}

                        {% endfor %}

            {% endif %}

{% endif %}


text:
if Kernel.respond_to?(:require)
  require "cura/application"

  require "cura/error/invalid_application"
end

module Cura
  module Attributes
    # Allows an object to belong to a Cura::Application.
    module HasApplication
      # Get the application of this object.
      #
      # @return [Application]
      attr_reader :application

      # Set the application of this object.
      #
      # @param [Application] value
      # @return [Application]
      def application=(value)
        raise Error::InvalidApplication unless value.nil? || value.is_a?(Cura::Application)

        @application = value
      end
    end
  end
end


text:
#region License

#endregion

#region Imports

using System;
using System.Collections.Generic;

#endregion

namespace BitCoinSharp.Collections.Generic
{
    ///
    /// This class provides skeletal implementations for some of <see cref="IQueue{T}"/>
    /// operations.
    ///
    /// <remarks>
    /// <para>
    /// The methods <see cref="Add"/>, <see cref="Remove"/>, and
    /// <see cref="Element()"/> are based on the <see cref="Offer"/>,
    /// <see cref="Poll"/>, and <see cref="Peek"/> methods respectively but
    /// throw exceptions instead of indicating failure via
    /// <see langword="false"/> returns.
    /// </para>
    /// </remarks>
    /// <author>Doug Lea</author>
    /// <author>Griffin Caprio (.NET)</author>
    /// <author>Kenneth Xu</author>
    [Serializable]
    internal abstract class AbstractQueue<T> : AbstractCollection<T>, IQueue<T> //JDK_1_6
    {
        ///
        /// Returns the remaining capacity of this queue.
        ///
        public abstract int RemainingCapacity { get; }

        #region IQueue<T> Members

        ///
        /// Inserts the specified element into this queue if it is possible to
        /// do so immediately without violating capacity restrictions.
        ///
        /// <remarks>
        /// When using a capacity-restricted queue, this method is generally
        /// preferable to <see cref="Add"/>, which can fail to
        /// insert an element only by throwing an exception.
        /// </remarks>
        /// <param name="element">The element to add.</param>
        /// <returns>
        /// <c>true</c> if the element was added to this queue. Otherwise
        /// <c>false</c>.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="element"/> is <c>null</c> and the queue
        /// implementation doesn't allow <c>null</c>.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// If some property of the supplied <paramref name="element"/>
        /// prevents it from being added to this queue.
        /// </exception>
        public abstract bool Offer(T element);

        ///
        /// Retrieves, but does not remove, the head of this queue.
        ///
        /// <remarks>
        /// <para>
        /// This method differs from <see cref="Peek(out T)"/> in that it throws an
        /// exception if this queue is empty.
        /// </para>
        /// <para>
        /// this implementation returns the result of <see cref="Peek"/>
        /// unless the queue is empty.
        /// </para>
        /// </remarks>
        /// <returns>The head of this queue.</returns>
        /// <exception cref="InvalidOperationException">
        /// If this queue is empty.
        /// </exception>
        public virtual T Element()
        {
            T element;
            if (Peek(out element))
            {
                return element;
            }
            else
            {
                throw new InvalidOperationException("Queue is empty.");
            }
        }

        ///
        /// Retrieves, but does not remove, the head of this queue into out
        /// parameter <paramref name="element"/>.
        ///
        /// <param name="element">
        /// The head of this queue. <c>default(T)</c> if queue is empty.
        /// </param>
        /// <returns>
        /// <c>false</c> is the queue is empty. Otherwise <c>true</c>.
        /// </returns>
        public abstract bool Peek(out T element);

        ///
        /// Retrieves and removes the head of this queue.
        ///
        /// <returns>The head of this queue</returns>
        /// <exception cref="InvalidOperationException">
        /// If this queue is empty.
        /// </exception>
        public virtual T Remove()
        {
            T element;
            if (Poll(out element))
            {
                return element;
            }
            else
            {
                throw new InvalidOperationException("Queue is empty.");
            }
        }

        ///
        /// Retrieves and removes the head of this queue into out parameter
        /// <paramref name="element"/>.
        ///
        /// <param name="element">
        /// Set to the head of this queue. <c>default(T)</c> if queue is empty.
        /// </param>
        /// <returns>
        /// <c>false</c> if the queue is empty. Otherwise <c>true</c>.
        /// </returns>
        public abstract bool Poll(out T element);

        #endregion

        #region ICollection<T> Members

        ///
        /// Inserts the specified <paramref name="element"/> into this queue
        /// if it is possible to do so immediately without violating capacity
        /// restrictions. Throws an <see cref="InvalidOperationException"/>
        /// if no space is currently available.
        ///
        /// <param name="element">The element to add.</param>
        /// <exception cref="InvalidOperationException">
        /// If the <paramref name="element"/> cannot be added at this time due
        /// to capacity restrictions.
        /// </exception>
        public override void Add(T element)
        {
            if (!Offer(element))
            {
                throw new InvalidOperationException("Queue full.");
            }
        }

        ///
        /// Removes all items from the queue.
        ///
        /// <remarks>
        /// This implementation repeatedly calls the <see cref="Poll"/> moethod
        /// until it returns <c>false</c>.
        /// </remarks>
        public override void Clear()
        {
            T element;
            while (Poll(out element))
            {
            }
        }

        #endregion

        #region IQueue Members

        ///
        /// Returns <see langword="true"/> if there are no elements in the
        /// <see cref="IQueue{T}"/>, <see langword="false"/> otherwise.
        ///
        public virtual bool IsEmpty
        {
            get { return Count == 0; }
        }

        ///
        /// Returns the current capacity of this queue.
        ///
        public abstract int Capacity { get; }

        ///
        /// Gets a value indicating whether the <see cref="ICollection{T}"/> is read-only.
        /// This implementation always return true;
        ///
        ///
        /// <returns>
        /// true if the <see cref="ICollection{T}"/> is read-only; otherwise, false.
        /// This implementation always return false as typically a queue should not
        /// be read only.
        /// </returns>
        ///
        public override bool IsReadOnly
        {
            get { return false; }
        }

        #endregion

        ///
        /// Removes all available elements from this queue and invoke the given
        /// <paramref name="action"/> on each element in order.
        ///
        /// <remarks>
        /// This operation may be more efficient than repeatedly polling this
        /// queue. A failure encountered while attempting to invoke the
        /// <paramref name="action"/> on the elements may result in elements
        /// being neither, either or both in the queue or processed when the
        /// associated exception is thrown.
        /// <example> Drain to a non-generic list.
        ///
        /// IList c = ...;
        /// int count = Drain(delegate(T e) {c.Add(e);});
        ///
        /// </example>
        /// </remarks>
        /// <param name="action">The action to performe on each element.</param>
        /// <returns>The number of elements processed.</returns>
        /// <exception cref="System.InvalidOperationException">
        /// If the queue cannot be drained at this time.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// If the specified action is <see langword="null"/>.
        /// </exception>
        /// <seealso cref="IQueue{T}.Drain(Action{T}, int)"/>
        public virtual int Drain(Action<T> action)
        {
            return Drain(action, null);
        }

        ///
        /// Removes all elements that pass the given <paramref name="criteria"/>
        /// from this queue and invoke the given <paramref name="action"/> on
        /// each element in order.
        ///
        /// <remarks>
        /// This operation may be more efficient than repeatedly polling this
        /// queue. A failure encountered while attempting to invoke the
        /// <paramref name="action"/> on the elements may result in elements
        /// being neither, either or both in the queue or processed when the
        /// associated exception is thrown.
        /// <example> Drain to a non-generic list.
        ///
        /// IList c = ...;
        /// int count = Drain(delegate(T e) {c.Add(e);});
        ///
        /// </example>
        /// </remarks>
        /// <param name="action">The action to performe on each element.</param>
        /// <param name="criteria">
        /// The criteria to select the elements. <c>null</c> selects any element.
        /// </param>
        /// <returns>The number of elements processed.</returns>
        /// <exception cref="System.InvalidOperationException">
        /// If the queue cannot be drained at this time.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// If the specified action is <see langword="null"/>.
        /// </exception>
        /// <seealso cref="IQueue{T}.Drain(Action{T}, int)"/>
        public virtual int Drain(Action<T> action, Predicate<T> criteria)
        {
            if (action == null) throw new ArgumentNullException("action");
            return DoDrain(action, criteria);
        }

        ///
        /// Removes at most the given number of available elements from this
        /// queue and invoke the given <paramref name="action"/> on each
        /// element in order.
        ///
        /// <remarks>
        /// This operation may be more efficient than repeatedly polling this
        /// queue. A failure encountered while attempting to invoke the
        /// <paramref name="action"/> on the elements may result in elements
        /// being neither, either or both in the queue or processed when the
        /// associated exception is thrown.
        /// </remarks>
        /// <param name="action">The action to performe on each element.</param>
        /// <param name="maxElements">the maximum number of elements to transfer</param>
        /// <returns>The number of elements processed.</returns>
        /// <exception cref="System.InvalidOperationException">
        /// If the queue cannot be drained at this time.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// If the specified action is <see langword="null"/>.
        /// </exception>
        /// <seealso cref="IQueue{T}.Drain(System.Action{T})"/>
        public virtual int Drain(Action<T> action, int maxElements)
        {
            return Drain(action, maxElements, null);
        }

        ///
        /// Removes at most the given number of elements that pass the given
        /// <paramref name="criteria"/>from this queue and invoke the given
        /// <paramref name="action"/> on each element in order.
        ///
        /// <remarks>
        /// This operation may be more efficient than repeatedly polling this
        /// queue. A failure encountered while attempting to invoke the
        /// <paramref name="action"/> on the elements may result in elements
        /// being neither, either or both in the queue or processed when the
        /// associated exception is thrown.
        /// </remarks>
        /// <param name="action">The action to performe on each element.</param>
        /// <param name="maxElements">the maximum number of elements to transfer</param>
        /// <param name="criteria">
        /// The criteria to select the elements. <c>null</c> selects any element.
        /// </param>
        /// <returns>The number of elements processed.</returns>
        /// <exception cref="System.InvalidOperationException">
        /// If the queue cannot be drained at this time.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// If the specified action is <see langword="null"/>.
        /// </exception>
        /// <seealso cref="IQueue{T}.Drain(System.Action{T})"/>
        public virtual int Drain(Action<T> action, int maxElements, Predicate<T> criteria)
        {
            if (action == null) throw new ArgumentNullException("action");
            if (maxElements <= 0) return 0;
            return DoDrain(action, maxElements, criteria);
        }

        ///
        /// Does the real work for all drain methods. Caller must
        /// guarantee the <paramref name="action"/> is not <c>null</c> and
        /// <paramref name="maxElements"/> is greater then zero (0).
        ///
        /// <seealso cref="IQueue{T}.Drain(System.Action{T})"/>
        /// <seealso cref="IQueue{T}.Drain(System.Action{T}, int)"/>
        /// <seealso cref="IQueue{T}.Drain(System.Action{T}, Predicate{T})"/>
        /// <seealso cref="IQueue{T}.Drain(System.Action{T}, int, Predicate{T})"/>
        protected internal abstract int DoDrain(Action<T> action, int maxElements, Predicate<T> criteria);

        ///
        /// Does the real work for the <see cref="AbstractQueue{T}.Drain(System.Action{T})"/>
        /// and <see cref="AbstractQueue{T}.Drain(System.Action{T},Predicate{T})"/>.
        ///
        protected internal virtual int DoDrain(Action<T> action, Predicate<T> criteria)
        {
            return DoDrain(action, int.MaxValue, criteria);
        }
    }
}


text:
/* SYNTAX TEST "Packages/CSS3/CSS3.sublime-syntax" */

/* TEST C PROPERTIES */
foo {
	/* caret-color:; TBD. Waiting on spec to be updated */

	caret-shape: underscore;

    /* caret:; TBD. No examples in the spec*/

	chains: * a b c;
	chains: top-half bottom-half;
	chains: a b;
	chains: @ a b c d e, f g h i j k;
	chains: * a b c d e f g;
	chains: a b c d e f;
	chains: none;

	clear: none;
	clear: left;
	clear: right;
	clear: both;
	clear: inline-start;
	clear: inline-end;
	clear: inherit;

    clip-path: none;
    clip-path: fill-box;
    clip-path: stroke-box;
    clip-path: view-box;
    clip-path: url("resources.svg#c1");
    clip-path: inset(100px 50px);
    clip-path: circle(50px at 0 100px);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    clip-path: inherit;
    clip-path: initial;
    clip-path: unset;
    clip-path: polygon(15px 99px, 30px 87px, 65px 99px, 85px 55px,122px 57px, 184px 73px, 198px 105px, 199px 150px,
					   145px 159px, 155px 139px, 126px 120px, 112px 138px,
					   80px 128px, 39px 126px, 24px 104px);
    clip-path: url("#clip1");
	clip-path: inset(10px 20px 30px 40px);
	clip-path: url("#c1");
	clip-path: url("path.svg#c1");
	clip-path: polygon(5% 5%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
	clip-path: circle(30px at 35px 35px);
	clip-path: ellipse(65px 30px at 125px 40px);
	clip-path: inset(10% 10% 10% 10% round 20%, 20%);

    clip-rule: nonzero;
    clip-rule: evenodd;
    clip-rule: inherit;
    clip-rule: revert;

    color: red;
    color: orange;
    color: antiquewhite;
    color: #0f0;
    color: #00ff00;
    color: rgba( 34, 12, 64, 0.3);
    color: currentcolor;
    color: inherit;
    color: initial;
    color: unset;

    color-interpolation-filters:auto;
    color-interpolation-filters: sRGB;
    color-interpolation-filters: linearRGB;
    color-interpolation-filters: inherit;
    color-interpolation-filters: initial;
    color-interpolation-filters: unset;

    columns: 1em;
    columns: 1;
    columns: auto;
    columns: 1 auto;
    columns: auto 12em;
    columns: auto auto;

    column-count: 3;
    column-count: auto;
    column-count: inherit;
    column-count: initial;
    column-count: unset;

    column-fill: auto;
    column-fill: balance;
    column-fill: inherit;
    column-fill: initial;
    column-fill: unset;

    column-gap: normal;
    column-gap: 3px;
    column-gap: 2.5em;
    column-gap: inherit;
    column-gap: initial;
    column-gap: unset;

	column-rule: dotted;
	column-rule: solid blue;
	column-rule: solid 8px;
	column-rule: thick inset blue;
	column-rule: inherit;
	column-rule: initial;
	column-rule: unset;

    column-rule-color: red;
	column-rule-color: rgb(192, 56, 78);
	column-rule-color: transparent;
	column-rule-color: hsla(0, 100%, 50%, 0.6);
	column-rule-color: inherit;
	column-rule-color: initial;
	column-rule-color: unset;

    column-rule-style: none;
	column-rule-style: hidden;
	column-rule-style: dotted;
	column-rule-style: dashed;
	column-rule-style: solid;
	column-rule-style: double;
	column-rule-style: groove;
	column-rule-style: ridge;
	column-rule-style: inset;
	column-rule-style: outset;
	column-rule-style: inherit;
	column-rule-style: initial;
	column-rule-style: unset;

    column-rule-width: thin;
    column-rule-width: medium;
    column-rule-width: thick;
    column-rule-width: 1px;
    column-rule-width: 2.5em;
    column-rule-width: inherit;
    column-rule-width: initial;
    column-rule-width: unset;

    column-span: none;
	column-span: all;
	column-span: inherit;
	column-span: initial;
	column-span: unset;

    column-width: auto;
    column-width: 6px;
    column-width: 25em;
    column-width: 0.3vw;
    column-width: inherit;
    column-width: initial;
    column-width: unset;

    content: normal;
    content: none;
    content: 'prefix';
    content: url('http://www.example.com/test.png');
    content: attr(value string);
    content: open-quote;
    content: close-quote;
    content: no-open-quote;
    content: no-close-quote;
    content: inherit;
    content: initial;
    content: unset;
    content: "Email address: ";
    content:  "\2713 ";
    content: attr(title) ": ";
    content: attr(title);
    content: "Name: ";
    content: counter(my-counter);
    content: url("image.jpg");
    content: attr(data-visual-label) ": ";
	content: attr(size px, auto);
	content: attr(size px, inset);

    continue: fragments;
    continue: paginate ;
    continue: discard ;
    continue: inherit;
    continue: unset;
    continue: revert;

    counter-set: list-item attr(value integer, 1);

    counter-reset: counter-name;
    counter-reset: counter-name -1;
    counter-reset: counter1 1 counter2 4;
    counter-reset: none;
    counter-reset: inherit;
    counter-reset: initial;
    counter-reset: unset;

    counter-increment: list-item -1;
	counter-increment: none;
	counter-increment: counter;
	counter-increment: note-counter;
	counter-increment: chapter;
	counter-increment: section;
	counter-increment: item;
	counter-increment: count2;
	counter-increment: list-item;

    cue-before: url("../audio/ping.wav");
    cue-before: url("/audio/bell.aiff") -3dB;
    cue-before: url("../clips-1/pop.au") +6dB;
    cue-before: url("./audio/caution.wav") +8dB;

    cue-after: url("pop.au");
    cue-after: url("dong.wav");
    cue-after: url("../clips-2/pop.au") 6dB;

    cue: url("pop.au");
    cue: inherit;
    cue: initial;
    cue: unset;
    cue: revert;

    cursor: pointer;
    cursor: auto;
    cursor:  url("cursor1.png") 4 12, auto;
    cursor:  url("cursor2.png") 2 2, pointer;
    cursor: inherit;
    cursor: initial;
    cursor: unset;
}


text:
pushd %~dp0%
if exist windows\release rd /s /q windows\release
if exist Linux32bit\release rd /s /q Linux32bit\release
if exist Linux64bit\release rd /s /q Linux64bit\release
if exist Mac\release rd /s /q Mac\release
popd
pause


text:
<head>
    <title>Check that space is a valid separator.</title>
    <meta name="viewport" content="width=100 initial-scale=1">
</head>
<body></body>


text:
from dataclasses import dataclass
from typing import Optional
from typing import Tuple

from joblib import delayed
from joblib import Parallel
import numpy as np
import pytest
from sklearn.base import ClassifierMixin
from sklearn.base import clone
from sklearn.base import is_classifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression

from obp.dataset import linear_behavior_policy
from obp.dataset import logistic_reward_function
from obp.dataset import SyntheticBanditDataset
from obp.policy import IPWLearner
from obp.policy import NNPolicyLearner
from obp.policy import QLearner
from obp.policy.base import BaseOfflinePolicyLearner

# hyperparameters of the regression model used in model dependent OPE estimators
hyperparams = {
    "lightgbm": {
        "n_estimators": 100,
        "learning_rate": 0.005,
        "max_depth": 5,
        "min_samples_leaf": 10,
        "random_state": 12345,
    },
    "logistic_regression": {
        "max_iter": 10000,
        "C": 1000,
        "random_state": 12345,
    },
    "random_forest": {
        "n_estimators": 500,
        "max_depth": 5,
        "min_samples_leaf": 10,
        "random_state": 12345,
    },
}

base_model_dict = dict(
    logistic_regression=LogisticRegression,
    lightgbm=GradientBoostingClassifier,
    random_forest=RandomForestClassifier,
)

# n_rounds, n_actions, dim_context, base_model_for_evaluation_policy, base_model_for_reg_model
offline_experiment_configurations = [
    (
        600,
        10,
        5,
        "logistic_regression",
        "logistic_regression",
    ),
    (
        450,
        3,
        2,
        "lightgbm",
        "lightgbm",
    ),
    (
        500,
        5,
        3,
        "random_forest",
        "random_forest",
    ),
    (
        500,
        3,
        5,
        "logistic_regression",
        "random_forest",
    ),
    (
        800,
        10,
        10,
        "lightgbm",
        "logistic_regression",
    ),
]

@dataclass
class RandomPolicy(BaseOfflinePolicyLearner):
    def __post_init__(self) -> None:
        super().__post_init__()

    def fit(self):
        raise NotImplementedError

    def predict(self, context: np.ndarray) -> np.ndarray:

        n_rounds = context.shape[0]
        action_dist = np.random.rand(n_rounds, self.n_actions, self.len_list)
        return action_dist

@dataclass
class UniformSampleWeightLearner(BaseOfflinePolicyLearner):

    base_classifier: Optional[ClassifierMixin] = None

    def __post_init__(self) -> None:
        super().__post_init__()
        if self.base_classifier is None:
            self.base_classifier = LogisticRegression(random_state=12345)
        else:
            if not is_classifier(self.base_classifier):
                raise ValueError("`base_classifier` must be a classifier")
        self.base_classifier_list = [
            clone(self.base_classifier) for _ in np.arange(self.len_list)
        ]

    def _create_train_data_for_opl(
        self,
        context: np.ndarray,
        action: np.ndarray,
        reward: np.ndarray,
        pscore: np.ndarray,
        **kwargs,
    ) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:

        return context, (reward / pscore), action

    def fit(
        self,
        context: np.ndarray,
        action: np.ndarray,
        reward: np.ndarray,
        pscore: Optional[np.ndarray] = None,
        position: Optional[np.ndarray] = None,
    ) -> None:

        if pscore is None:
            n_actions = np.int32(action.max() + 1)
            pscore = np.ones_like(action) / n_actions
        if position is None or self.len_list == 1:
            position = np.zeros_like(action, dtype=int)

        for pos_ in np.arange(self.len_list):
            X, sample_weight, y = self._create_train_data_for_opl(
                context=context[position == pos_],
                action=action[position == pos_],
                reward=reward[position == pos_],
                pscore=pscore[position == pos_],
            )
            self.base_classifier_list[pos_].fit(X=X, y=y)

    def predict(self, context: np.ndarray) -> np.ndarray:

        n_rounds = context.shape[0]
        action_dist = np.zeros((n_rounds, self.n_actions, self.len_list))
        for pos_ in np.arange(self.len_list):
            predicted_actions_at_position = self.base_classifier_list[pos_].predict(
                context
            )
            action_dist[
                np.arange(n_rounds),
                predicted_actions_at_position,
                np.ones(n_rounds, dtype=int) * pos_,
            ] += 1
        return action_dist

@pytest.mark.parametrize(
    "n_rounds, n_actions, dim_context, base_model_for_evaluation_policy, base_model_for_reg_model",
    offline_experiment_configurations,
)
def test_offline_policy_learner_performance(
    n_rounds: int,
    n_actions: int,
    dim_context: int,
    base_model_for_evaluation_policy: str,
    base_model_for_reg_model: str,
) -> None:
    def process(i: int):
        # synthetic data generator
        dataset = SyntheticBanditDataset(
            n_actions=n_actions,
            dim_context=dim_context,
            reward_function=logistic_reward_function,
            behavior_policy_function=linear_behavior_policy,
            random_state=i,
        )
        # sample new training and test sets of synthetic logged bandit data
        bandit_feedback_train = dataset.obtain_batch_bandit_feedback(n_rounds=n_rounds)
        bandit_feedback_test = dataset.obtain_batch_bandit_feedback(n_rounds=n_rounds)

        # defining policy learners
        ipw_policy = IPWLearner(
            n_actions=dataset.n_actions,
            base_classifier=base_model_dict[base_model_for_evaluation_policy](
                **hyperparams[base_model_for_evaluation_policy]
            ),
        )
        q_policy = QLearner(
            n_actions=dataset.n_actions,
            base_model=base_model_dict[base_model_for_evaluation_policy](
                **hyperparams[base_model_for_evaluation_policy]
            ),
        )
        nn_policy = NNPolicyLearner(
            n_actions=dataset.n_actions,
            dim_context=dim_context,
            off_policy_objective="ipw",
        )
        # baseline method 1. RandomPolicy
        random_policy = RandomPolicy(n_actions=dataset.n_actions)
        # baseline method 2. UniformSampleWeightLearner
        uniform_sample_weight_policy = UniformSampleWeightLearner(
            n_actions=dataset.n_actions,
            base_classifier=base_model_dict[base_model_for_evaluation_policy](
                **hyperparams[base_model_for_evaluation_policy]
            ),
        )

        # policy training
        ipw_policy.fit(
            context=bandit_feedback_train["context"],
            action=bandit_feedback_train["action"],
            reward=bandit_feedback_train["reward"],
            pscore=bandit_feedback_train["pscore"],
        )
        q_policy.fit(
            context=bandit_feedback_train["context"],
            action=bandit_feedback_train["action"],
            reward=bandit_feedback_train["reward"],
            pscore=bandit_feedback_train["pscore"],
        )
        nn_policy.fit(
            context=bandit_feedback_train["context"],
            action=bandit_feedback_train["action"],
            reward=bandit_feedback_train["reward"],
            pscore=bandit_feedback_train["pscore"],
        )
        uniform_sample_weight_policy.fit(
            context=bandit_feedback_train["context"],
            action=bandit_feedback_train["action"],
            reward=bandit_feedback_train["reward"],
            pscore=bandit_feedback_train["pscore"],
        )

        # prediction/making decisions
        ipw_action_dist = ipw_policy.predict(
            context=bandit_feedback_test["context"],
        )
        q_action_dist = q_policy.predict(
            context=bandit_feedback_test["context"],
        )
        nn_action_dist = nn_policy.predict(
            context=bandit_feedback_test["context"],
        )
        random_action_dist = random_policy.predict(
            context=bandit_feedback_test["context"],
        )
        uniform_sample_weight_action_dist = uniform_sample_weight_policy.predict(
            context=bandit_feedback_test["context"],
        )

        # evaluation
        gt_ipw_learner = dataset.calc_ground_truth_policy_value(
            expected_reward=bandit_feedback_test["expected_reward"],
            action_dist=ipw_action_dist,
        )
        gt_q_learner = dataset.calc_ground_truth_policy_value(
            expected_reward=bandit_feedback_test["expected_reward"],
            action_dist=q_action_dist,
        )
        gt_nn_learner = dataset.calc_ground_truth_policy_value(
            expected_reward=bandit_feedback_test["expected_reward"],
            action_dist=nn_action_dist,
        )
        gt_random_policy = dataset.calc_ground_truth_policy_value(
            expected_reward=bandit_feedback_test["expected_reward"],
            action_dist=random_action_dist,
        )
        gt_uniform_sample_weight_learner = dataset.calc_ground_truth_policy_value(
            expected_reward=bandit_feedback_test["expected_reward"],
            action_dist=uniform_sample_weight_action_dist,
        )

        return (
            gt_ipw_learner,
            gt_q_learner,
            gt_nn_learner,
            gt_random_policy,
            gt_uniform_sample_weight_learner,
        )

    n_runs = 10
    processed = Parallel(
        n_jobs=-1,
        verbose=0,
    )([delayed(process)(i) for i in np.arange(n_runs)])
    list_gt_ipw = list()
    list_gt_q = list()
    list_gt_nn = list()
    list_gt_random = list()
    list_gt_unif_ipw = list()
    for i, gt_policy_values in enumerate(processed):
        gt_ipw, gt_q, gt_nn, gt_random, gt_unif_ipw = gt_policy_values
        list_gt_ipw.append(gt_ipw)
        list_gt_q.append(gt_q)
        list_gt_nn.append(gt_nn)
        list_gt_random.append(gt_random)
        list_gt_unif_ipw.append(gt_unif_ipw)

    # baseline learner performance
    print(f"Performance of Random is {np.mean(list_gt_random)}")
    print(
        f"Performance of IPWLearner with Uniform Weight is {np.mean(list_gt_unif_ipw)}"
    )
    # ipw learner performance
    print(f"Performance of IPWLearner is {np.mean(list_gt_ipw)}")
    assert np.mean(list_gt_ipw) > np.mean(list_gt_random)
    assert np.mean(list_gt_ipw) > np.mean(list_gt_unif_ipw)
    # q learner performance
    print(f"Performance of QLearner is {np.mean(list_gt_q)}")
    assert np.mean(list_gt_q) > np.mean(list_gt_random)
    assert np.mean(list_gt_q) > np.mean(list_gt_unif_ipw)
    # nn policy learner performance
    print(f"Performance of NNPolicyLearner is {np.mean(list_gt_nn)}")
    assert np.mean(list_gt_nn) > np.mean(list_gt_random)
    assert np.mean(list_gt_nn) > np.mean(list_gt_unif_ipw)


text:
layout: article
title: "Warum Zugänglichkeit wichtig ist"
description: "Zugänglichkeit ist keine Funktion."
introduction: "Zugänglichkeit ist keine Funktion. Nutzer, die nicht hören oder sehen können, sind nicht in der Lage, sich ein Video ohne Untertitel oder Beschreibungen anzusehen. Der Zeitaufwand für das Hinzufügen solcher Untertitel oder Beschreibungen steht in keinem Verhältnis zu der schlechten Erfahrung, die Sie Ihren Nutzern bieten, wenn Sie darauf verzichten. Für alle Nutzer sollte zumindest ein Grundmaß an Nutzerfreundlichkeit gegeben sein."
article:
  written_on: 2014-04-16
  updated_on: 2014-04-29
  order: 4
collection: videos
authors:
  - samdutton
key-takeaways:
  add-a-video:
    - Verwenden Sie das Videoelement zum Laden, Decodieren und Abspielen von Videos auf Ihrer Website.
    - Erstellen Sie die Videoinhalte in verschiedenen Formaten, um eine Reihe mobiler Plattformen abzudecken.
    - Achten Sie auf die richtige Größe der Videos, damit diese nicht ihre Container sprengen.
    - Achten Sie auf Zugänglichkeit. Fügen Sie das Track-Element hinzu und ordnen Sie es dem Videoelement unter.
remember:
  media-fragments:
    - Die Media Fragments-API wird auf den meisten Plattformen mit Ausnahme von iOS unterstützt.
    - Vergewissern Sie sich, dass Ihr Server Bereichsanforderungen unterstützt. Bereichsanforderungen sind auf den meisten Servern standardmäßig aktiviert, einige Hostingdienste können diese jedoch deaktivieren.
  dont-overflow:
    - Erzwingen Sie keine Größenanpassung von Elementen, wenn das daraus resultierende Seitenverhältnis vom Originalvideo abweicht. Ein gestauchtes oder gestrecktes Bild sieht nicht schön aus.
  accessibility-matters:
    - Das Track-Element wird in Chrome für Android, iOS Safari sowie allen aktuellen Desktop-Browsern mit Ausnahme von Firefox (siehe caniuse.com/track) unterstützt. Darüber hinaus sind auch mehrere Polyfiller verfügbar. Wir empfehlen Playr oder Captionator.
  construct-video-streams:
    - MSE wird von Chrome und Opera unter Android sowie in Internet Explorer 11 und Chrome für Desktopgeräte unterstützt. Auch Firefox soll in Zukunft unterstützt werden.
  optimize:
    - Bilder
    - Inhaltseffizienz optimieren
---

{% wrap content%}

{% include modules/toc.liquid %}

##Untertitel für eine bessere Zugänglichkeit hinzufügen

Um Medien auf Mobilgeräten besser zugänglich zu machen, fügen Sie Untertitel oder Beschreibungen mithilfe des Track-Elements hinzu.

{% include modules/remember.liquid title="Remember" list=page.remember.accessibility-matters %}

Bei Verwendung des Track-Elements sehen die Untertitel wie folgt aus:

## Track-Element hinzufügen

Es ist ganz einfach, Ihr Video mit Untertiteln zu versehen - Sie müssen lediglich ein Track-Element hinzufügen, das dem Videoelement untergeordnet ist:

{% include_code _code/track.html track html %}

Das Attribut `src` des Track-Elements enthält den Speicherort der Track-Datei.

## Untertitel in Track-Datei definieren

Eine Track-Datei besteht aus zeitlich festgelegten Cues im WebVTT-Format:

    WEBVTT

    00:00.000 --> 00:04.000
    Mann sitzt mit seinem Laptop auf einem Ast.

    00:05.000 --> 00:08.000
    Der Ast bricht und der Mann fällt herunter.

    ...

{% include modules/nextarticle.liquid %}

{% endwrap %}


text:
package org.apache.ibatis.reflection.property;

import java.util.Iterator;

/**
 * @author Clinton Begin
 */
public class PropertyTokenizer implements Iterator<PropertyTokenizer> {
  private String name;
  private final String indexedName;
  private String index;
  private final String children;

    /**
     * 对属性表达式进行解析
     * @param fullname fullname
     */
  public PropertyTokenizer(String fullname) {

      //假设待处理的表达式是item[0].order[0].data
    int delim = fullname.indexOf('.'); // 首先判断是否有".",  如果没有"."
      // 比如像theName, theName[1], theName['abc'], 这类形式
      // 则name=fullname, children = 0.
      // 如果有., 则第一个点之前的为name, 如本例name='item[0]', children = 'order[0].data'.
    if (delim > -1) {
      name = fullname.substring(0, delim);
      children = fullname.substring(delim + 1); //如果children不等于NULL, 则hasNext()为true
        //也就是说,只要有".", 那么就有next.
    } else {
      name = fullname;
      children = null;
    }

    indexedName = name; // indexedName, 表示未处理[]之前的
      // 比如本例中,它就应该是'item[0]'.

    delim = name.indexOf('['); // 判断是否有[]
    if (delim > -1) {
        // 这个是假设在正常情况下,[]是成对出现的,且]为name的最后一个字符, 正常情况下也应该是这样.
        // 那么这样处理之后, index 相当于是[]中间的部分'0', 当然也可能是一个其它的字符串
        // 而name 则是去掉[]之后的值, 为'item'.
      index = name.substring(delim + 1, name.length() - 1);
      name = name.substring(0, delim);
    }
  }

  public String getName() {
    return name;
  }

  public String getIndex() {
    return index;
  }

  public String getIndexedName() {
    return indexedName;
  }

  public String getChildren() {
    return children;
  }

  @Override
  public boolean hasNext() {
    return children != null;
  }

  @Override
  public PropertyTokenizer next() {
      // 在使用之前一定要判断hasNext(), 要不然如果children是null, 就出问题了.
    return new PropertyTokenizer(children); // 继续处理childeren.
  }

  @Override
  public void remove() {
    throw new UnsupportedOperationException("Remove is not supported, as it has no meaning in the context of properties.");
  }
}


text:
using namespace cylbot_mcl;

TEST(ConstructorTests, noInitialPosition)
{
	RobotModel model;
	PoseCloud2D pose_cloud(model);

	ASSERT_EQ(pose_cloud.getPoses().poses.size(), 0);
}

TEST(ConstructorTests, initialPosition)
{
	RobotModel model;
	geometry_msgs::PoseWithCovarianceStamped initial_pose;
	initial_pose.pose.pose.orientation.w = 1.0;
	initial_pose.pose.covariance[0] = initial_pose.pose.covariance[7] = initial_pose.pose.covariance[35] = 1.0;
	PoseCloud2D pose_cloud(model, initial_pose);

	ASSERT_EQ(pose_cloud.getPoses().poses.size(), 1000);
}

TEST(ResetCloud, resetCloud)
{
	RobotModel model;
	PoseCloud2D pose_cloud(model);

	ASSERT_EQ(pose_cloud.getPoses().poses.size(), 0);

	geometry_msgs::PoseWithCovarianceStamped initial_pose;
	initial_pose.pose.pose.orientation.w = 1.0;
	initial_pose.pose.covariance[0] = initial_pose.pose.covariance[7] = initial_pose.pose.covariance[35] = 1.0;

	pose_cloud.resetCloud(initial_pose);

	ASSERT_EQ(pose_cloud.getPoses().poses.size(), 1000);
}

int main(int argc, char** argv)
{
	testing::InitGoogleTest(&argc, argv);
	return RUN_ALL_TESTS();
}


text:
This design explains how SQLFlow calls [XGBoost](https://xgboost.ai/) for training models and prediction.

## Usage

To explain the benefit of integrating XGBoost with SQLFlow, let us start with an example.  The following SQLFlow code snippet shows how users can train an XGBoost tree model named `my_xgb_model`.

``` sql
SELECT * FROM train_table
TO TRAIN xgboost.gbtree
WITH
    objective=multi:softmax,
    train.num_boost_round=2,
    max_depth=2,
    eta=1
LABEL class
INTO my_xgb_model;
```

The following example shows how to predict using the model `my_xgb_model`.

``` sql
SELECT * FROM test_table
TO PREDICT pred_table.result
USING my_xgb_model;
```

The the above examples,
- `my_xgb_model` names the trained model.
- `xgboost.gbtree` is the model name, to use a different model provided by XGBoost, use `xgboost.gblinear` or `xgboost.dart`, see: [here](https://xgboost.readthedocs.io/en/latest/parameter.html#general-parameters) for details.
- In the `WITH` clause,
  - objective names an [XGBoost learning task](https://xgboost.readthedocs.io/en/latest/parameter.html#learning-task-parameters)
  - keys with the prefix `train.` identifies parameters of XGBoost API [`xgboost.train`](https://xgboost.readthedocs.io/en/latest/python/python_api.html#xgboost.train), and
  - keys without any prefix identifies [XGBoost Parameters](https://xgboost.readthedocs.io/en/latest/parameter.html) except the `objective` parameter, which was specified by the identifier after the keyword `TO TRAIN`, as explained above.

## The Code Generator

The code generator `codegen_xgboost.go` outputs an XGBoost program in Python. It contains the following features:
1. It tells the SQL engine to run the SELECT statement and retrieve the training/test data. It saves the data into a text file, which could be loaded by XGBoost using the DMatrix interface.
1. Parse and resolve the WITH clause to fill the `xgboost.train` arguments and the XGBoost Parameters.
1. Save the trained model on disk.
1. For the TO PREDICT clause, it loads the trained model and test data and then outputs the prediction result to a SQL engine.


text:
<template name="IntegrationImportFunctions">
  {{setPageTitle 'Journalist - Admin Import Functions' }}

Admin Home

Import Functions

Import Functions

        {{#if Template.subscriptionsReady }}

              Title
              Integration Type
              Item Types
              Description
              Modified By
              Modified

            {{#each importFunctions}}

                {{> EditableTextField dataKey="title" value=title emptyText="Title" }}
                {{> EditableEnumSelector dataKey="integrationType" value=integrationType enum=IntegrationTypes emptyText="Integration Type"}}
                {{> EditableEnumChecklist dataKey="itemTypes" value=itemTypes enum=ItemTypes emptyText="Item Types"}}
                {{> EditableTextArea dataKey="description" value=description emptyText="Enter description" }}
                {{userName modifiedBy}}
                {{dateFormat dateModified}}

            {{/each}}

          <button class="btn btn-xs btn-primary btn-add-import-function">

            Add Import Function
          </button>
        {{else}}
          {{> RobaSpinner rainbow=true }}
        {{/if}}

</template>


text:
require 'spec_helper'
require 'yaml'
require 'puppet/provider/netapp'
require 'puppet/util/network_device/netapp/device'

describe Puppet::Type.type(:netapp_lun).provider(:netapp_lun) do

  #Load the URL file
  device_conf_yml =  YAML.load_file(my_fixture('device_conf.yml'))
  url_node = device_conf_yml['DeviceURL']

  before :each do
    Facter.stubs(:value).with(:url).returns(url_node['url'])
    described_class.stubs(:suitable?).returns true
    Puppet::Type.type(:netapp_lun).stubs(:defaultprovider).returns described_class
  end

  #Load Create LUN file
  create_lun_yml =  YAML.load_file(my_fixture('create_lun.yml'))

  create_node = create_lun_yml['CreateLUN1']

  let :create_lun do
    Puppet::Type.type(:netapp_lun).new(
    :name     			=> create_node['name'],
    :ensure				=> create_node['ensure'],
    :size_bytes			=> create_node['size_bytes'],
    :ostype				=> create_node['ostype'],
    :space_res_enabled	=> create_node['space_res_enabled']
    )
  end

  #Load Delete LUN file
  delete_lun_yml =  YAML.load_file(my_fixture('delete_lun.yml'))

  delete_node = delete_lun_yml['DeleteLUN1']
  let :delete_lun do
    Puppet::Type.type(:netapp_lun).new(
    :name     			=> delete_node['name'],
    :ensure				=> delete_node['ensure'],
    :force				=> delete_node['force']
    )
  end

  let :provider do
    described_class.new( )
  end

  describe "when not exists?" do
    it ":should return true if lun is not present" do
      delete_lun.provider.should_not be_exists
    end
  end

  describe "create a new lun" do
    it ":should be able to create a lun" do
      create_lun.provider.create
    end
  end

  describe "when exists?" do
    it ":should return true if lun is present" do
      create_lun.provider.should be_exists
    end
  end

  describe "remove the lun" do
    it ":should be able to remove the lun" do
      delete_lun.provider.destroy
    end
  end

end


text:
using ONIT.VismaNetApi.Models;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ONIT.VismaNetApi.Lib.Data
{
    public class JournalTransactionData : BasePaginatedCrudDataClass<JournalTransaction>
    {
        public JournalTransactionData(VismaNetAuthorization auth) : base(auth)
        {
            ApiControllerUri = VismaNetControllers.JournalTransactionV2;
        }

        /// <summary>
        /// Gets all entities by splitting it into totalCount / pageSize tasks and fetching them in parallel.
        /// </summary>
        /// <returns></returns>
        /// <remarks>The order of the entities will be by the entity identificator. If the order matters to you, use OrderBy.</remarks>
        public override async Task<List<JournalTransaction>> All() => PostProcessJournalTransactions(await VismaNetApiHelper.GetAllWithPagination<JournalTransaction>(ApiControllerUri, Authorization));

        /// <summary>
        ///     Retrieves all entities from Visma.Net.
        /// </summary>
        /// <returns>List of all entities</returns>
        public override async Task<List<JournalTransaction>> Find(NameValueCollection parameters) => PostProcessJournalTransactions(await VismaNetApiHelper.GetAllWithPagination<JournalTransaction>(ApiControllerUri, Authorization, parameters));

        public async Task<string> AddAttachmentToJournalTransaction(string batchNumber, string content, string fileName, JournalTransactionModule module = JournalTransactionModule.ModuleGL)
        {
            return await AddAttachmentToJournalTransaction(batchNumber, Encoding.UTF8.GetBytes(content), fileName, module);
        }

        public async Task<string> AddAttachmentToJournalTransaction(string batchNumber, byte[] byteArray, string fileName, JournalTransactionModule module = JournalTransactionModule.ModuleGL)
        {
            if (byteArray == default(byte[]))
                throw new ArgumentNullException(nameof(byteArray), "ByteArray is missing");
            if (string.IsNullOrEmpty(fileName) || string.IsNullOrEmpty(Path.GetExtension(fileName)))
                throw new ArgumentNullException(nameof(fileName), "File name must be provided and have an extention");
            return await VismaNetApiHelper.AddAttachmentToJournalTransaction(Authorization, batchNumber, byteArray, fileName, module);
        }

        public async Task<VismaActionResult> Release(JournalTransaction transaction)
        {
            return await VismaNetApiHelper.Action(Authorization, ApiControllerUri, transaction.GetIdentificator(), "release");
        }

        public async Task<VismaActionResult> Release(string transactionNumber)
        {
            return await VismaNetApiHelper.Action(Authorization, ApiControllerUri, transactionNumber, "release");
        }
        private static List<JournalTransaction> PostProcessJournalTransactions(List<JournalTransaction> source)
        {
            var dict = new Dictionary<string, JournalTransaction>();
            foreach (var invoice in source)
            {
                if (dict.ContainsKey(invoice.batchNumber))
                {
                    dict[invoice.batchNumber].journalTransactionLines.AddRange(invoice.journalTransactionLines);
                }
                else
                {
                    dict[invoice.batchNumber] = invoice;
                }
            }
            return dict.Values.ToList();
        }
    }
}


text:
[CmdletBinding()]
param(
    [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve)
)

$ErrorActionPreference = 'stop'
Set-StrictMode -Version latest

$RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path
$Global:CurrentSharePointStubModule = $SharePointCmdletModule

$ModuleName = "MSFT_SPUserProfileSyncService"
Import-Module (Join-Path $RepoRoot "Modules\SharePointDsc\DSCResources\$ModuleName\$ModuleName.psm1") -Force

Describe "SPUserProfileSyncService - SharePoint Build $((Get-Item $SharePointCmdletModule).Directory.BaseName)" {
    InModuleScope $ModuleName {
        $testParams = @{
            UserProfileServiceAppName = "User Profile Service Service App"
            FarmAccount = New-Object System.Management.Automation.PSCredential ("username", (ConvertTo-SecureString "password" -AsPlainText -Force))
            Ensure = "Present"
        }
        Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\SharePointDsc")

        Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue
        $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName
        $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf("."))
        Mock Get-SPDSCInstalledProductVersion { return @{ FileMajorPart = $majorBuildNumber } }

        Mock Invoke-SPDSCCommand {
            return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope
        }

        Remove-Module -Name "Microsoft.SharePoint.PowerShell" -Force -ErrorAction SilentlyContinue
        Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue

        Mock Get-SPFarm { return @{
            DefaultServiceAccount = @{ Name = $testParams.FarmAccount.Username }
        }}
        Mock Start-SPServiceInstance { }
        Mock Stop-SPServiceInstance { }
        Mock Restart-Service { }
        Mock Add-SPDSCUserToLocalAdmin { }
        Mock Test-SPDSCUserIsLocalAdmin { return $false }
        Mock Remove-SPDSCUserToLocalAdmin { }
        Mock New-PSSession { return $null } -ModuleName "SharePointDsc.Util"
        Mock Start-Sleep { }

        switch ($majorBuildNumber) {
            15 {
                Context "User profile sync service is not found locally" {
                    Mock Get-SPServiceInstance { return $null }

                    It "returns absent from the get method" {
                        $Global:SPDSCUPACheck = $false
                        (Get-TargetResource @testParams).Ensure | Should Be "Absent"
                    }
                }

                Context "User profile sync service is not running and should be" {
                    Mock Get-SPServiceInstance { if ($Global:SPDSCUPACheck -eq $false) {
                            $Global:SPDSCUPACheck = $true
                            return @( @{
                                Status = "Disabled"
                                ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")
                                UserProfileApplicationGuid = [Guid]::Empty
                                TypeName = "User Profile Synchronization Service"
                            })
                        } else {
                            return @( @{
                                Status = "Online"
                                ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")
                                UserProfileApplicationGuid = [Guid]::NewGuid()
                                TypeName = "User Profile Synchronization Service"
                            })
                        }
                    }
                    Mock Get-SPServiceApplication { return @(
                        New-Object Object |
                            Add-Member NoteProperty ID ([Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")) -PassThru |
                            Add-Member NoteProperty TypeName "User Profile Service Application" -PassThru |
                            Add-Member ScriptMethod SetSynchronizationMachine {
                                param($computerName, $syncServiceID, $FarmUserName, $FarmPassword)
                            } -PassThru
                    )}

                    It "returns absent from the get method" {
                        $Global:SPDSCUPACheck = $false
                        (Get-TargetResource @testParams).Ensure | Should Be "Absent"
                    }

                    It "returns false from the test method" {
                        $Global:SPDSCUPACheck = $false
                        Test-TargetResource @testParams | Should Be $false
                    }

                    It "calls the start service cmdlet from the set method" {
                        $Global:SPDSCUPACheck = $false
                        Set-TargetResource @testParams

                        Assert-MockCalled Start-SPServiceInstance
                    }

                    Mock Get-SPFarm { return @{
                        DefaultServiceAccount = @{ Name = "WRONG\account" }
                    }}

                    It "returns values from the get method where the farm account doesn't match" {
                        Get-TargetResource @testParams | Should Not BeNullOrEmpty
                    }

                    $Global:SPDSCUPACheck = $false
                    Mock Get-SPServiceApplication { return $null }
                    It "throws in the set method if the user profile service app can't be found" {
                        { Set-TargetResource @testParams } | Should Throw
                    }
                }

                Context "User profile sync service is running and should be" {
                    Mock Get-SPServiceInstance { return @( @{
                                Status = "Online"
                                ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")
                                UserProfileApplicationGuid = [Guid]::NewGuid()
                                TypeName = "User Profile Synchronization Service"
                            })
                    }

                    It "returns present from the get method" {
                        (Get-TargetResource @testParams).Ensure | Should Be "Present"
                    }

                    It "returns true from the test method" {
                        Test-TargetResource @testParams | Should Be $true
                    }
                }

                $testParams.Ensure = "Absent"

                Context "User profile sync service is running and shouldn't be" {
                    Mock Get-SPServiceInstance { if ($Global:SPDSCUPACheck -eq $false) {
                            $Global:SPDSCUPACheck = $true
                            return @( @{
                                Status = "Online"
                                ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")
                                UserProfileApplicationGuid = [Guid]::NewGuid()
                                TypeName = "User Profile Synchronization Service"
                            })
                        } else {
                            return @( @{
                                Status = "Disabled"
                                ID = [Guid]::Empty
                                UserProfileApplicationGuid = [Guid]::Empty
                                TypeName = "User Profile Synchronization Service"
                            })
                        }
                    }

                    It "returns present from the get method" {
                        $Global:SPDSCUPACheck = $false
                        (Get-TargetResource @testParams).Ensure | Should Be "Present"
                    }

                    It "returns false from the test method" {
                        $Global:SPDSCUPACheck = $false
                        Test-TargetResource @testParams | Should Be $false
                    }

                    It "calls the start service cmdlet from the set method" {
                        $Global:SPDSCUPACheck = $false
                        Set-TargetResource @testParams

                        Assert-MockCalled Stop-SPServiceInstance
                    }
                }

                Context "User profile sync service is not running and shouldn't be" {
                    Mock Get-SPServiceInstance { return @( @{
                                Status = "Disabled"
                                ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")
                                UserProfileApplicationGuid = [Guid]::Empty
                                TypeName = "User Profile Synchronization Service"
                            })
                    }

                    It "returns absent from the get method" {
                        (Get-TargetResource @testParams).Ensure | Should Be "Absent"
                    }

                    It "returns true from the test method" {
                        Test-TargetResource @testParams | Should Be $true
                    }
                }
            }
            16 {
                Context "All methods throw exceptions as user profile sync doesn't exist in 2016" {
                    It "throws on the get method" {
                        { Get-TargetResource @testParams } | Should Throw
                    }

                    It "throws on the test method" {
                        { Test-TargetResource @testParams } | Should Throw
                    }

                    It "throws on the set method" {
                        { Set-TargetResource @testParams } | Should Throw
                    }
                }
            }
        }

    }
}


text:
function requireLogin(req,res,next) {
	if(!req.session.user){
		res.redirect('/login');
	}else{
		next();
	}
}

module.exports = requireLogin;


text:
package com.univ.helsinki.app.sensor;

import java.util.ArrayList;
import java.util.List;

import android.text.format.DateFormat;

public class SensorStream {
	private List<SensorUnit> sensors;
	private StreamSource sensorDevice;
	private String timestamp = "";

	public SensorStream() {
		// TODO should read from string.xml file
		final String dateFormat = "dd-MM-yyyy hh:mm:ss";

		setTimestamp((DateFormat.format(dateFormat, new java.util.Date())
				.toString()));
		setSensorDevice(new StreamSource());
		setSensors(new ArrayList<SensorUnit>());
	}

	public List<SensorUnit> getSensors() {
		return sensors;
	}

	public void setSensors(List<SensorUnit> sensors) {
		this.sensors = sensors;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public StreamSource getSensorDevice() {
		return sensorDevice;
	}

	public void setSensorDevice(StreamSource sensorDevice) {
		this.sensorDevice = sensorDevice;
	}
}
/**
 * {"sensorDevice":{"brand":"samsung","device":"crater","id":"JDQ39",
 * "manufacturer":"samsung","model":"GT-I9152","osRelease":"4.2.2","osVersion":
 * "3.0.31-1128812"
 * ,"product":"craterxx"},"sensors":[{"name":"Sensor.TYPE_LOCATION"
 * ,"vendor":"","typeValue"
 * :"-111","values":[{"longitude":24.900528,"latitude":60.230667
 * }],"status":true}
 * ,{"name":"Sensor.TYPE_ACCELEROMETER","vendor":"","typeValue":
 * "1","values":[{"accelerometer_z"
 * :9.876082,"accelerometer_y":0.6907272,"accelerometer_x"
 * :-0.29568392}],"status"
 * :true},{"name":"Sensor.TYPE_ACCELEROMETER","vendor":"",
 * "typeValue":"1","values"
 * :[{"accelerometer_z":9.85214,"accelerometer_y":0.6619968
 * ,"accelerometer_x":-0.29209262
 * }],"status":true}],"timestamp":"26-04-2014 01:25:08"}
 */


text:
package edu.isi.wubble.jgn.superroom;

import static com.jme.input.InputHandler.AXIS_NONE;
import static com.jme.input.InputHandler.BUTTON_ALL;
import static com.jme.input.InputHandler.DEVICE_MOUSE;

import static com.jme.util.resource.ResourceLocatorTool.TYPE_MODEL;

import java.net.URL;
import java.util.HashMap;
import java.util.List;

import com.jme.input.ChaseCamera;
import com.jme.input.InputHandler;
import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput;
import com.jme.input.action.InputActionEvent;
import com.jme.input.action.KeyInputAction;
import com.jme.input.thirdperson.ThirdPersonMouseLook;
import com.jme.light.PointLight;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Node;
import com.jme.scene.Spatial;
import com.jme.scene.shape.Box;
import com.jme.scene.state.CullState;
import com.jme.scene.state.LightState;
import com.jme.scene.state.MaterialState;
import com.jme.system.DisplaySystem;
import com.jme.util.export.binary.BinaryImporter;
import com.jme.util.resource.ResourceLocatorTool;
import com.jmex.physics.StaticPhysicsNode;

import edu.isi.wubble.gamestates.PhysicsGameState;
import edu.isi.wubble.physics.TimeManager;
import edu.isi.wubble.physics.entity.AutoStaticEntity;
import edu.isi.wubble.physics.entity.AutonomousEntity;
import edu.isi.wubble.physics.entity.DynamicEntity;
import edu.isi.wubble.physics.entity.Entity;
import edu.isi.wubble.physics.entity.EntityManager;
import edu.isi.wubble.physics.entity.PhysicsEntity;
import edu.isi.wubble.physics.state.StateDatabase;
import edu.isi.wubble.physics.state.Tag;
import edu.isi.wubble.util.Globals;
import edu.isi.wubble.util.Highlighter;
import edu.isi.wubble.util.PickerI;
import edu.isi.wubble.util.PickerInputAction;
import edu.isi.wubble.util.Swift;

public class SuperRoomState extends PhysicsGameState implements PickerI {
	protected ChaseCamera      _chaseCamera;

	protected KeyInputAction   _switchAction;
	protected LightState       _lightState;

	protected StaticPhysicsNode  _roomNode;
//	protected ClientWubbleEntity _wubble;
	protected AutonomousEntity   _auto;

	protected boolean           _requestInput;
	protected EntityManager     _entityManager;

	public SuperRoomState() {
		super();

		init();
	}

	protected void init() {
		Globals.LOG_DYNAMIC = true;
		Globals.USE_DATABASE = true;
		Globals.SHANE_PRINTING = false;

		DisplaySystem.getDisplaySystem().getRenderer().getQueue().setTwoPassTransparency(false);

		_showBounding = false;
		_drawPhysics = false;
		_renderStatistics = true;
		_physics.setAutoRestThreshold(0.01f);
		_entityManager = new EntityManager(_physics, _input, _rootNode);

		// create a session now, because objects will be adding themselves
		// into the mix as they are created.  The entity_table will be populated
		// with objects and their names.
		StateDatabase.inst().createSession();
		StateDatabase.inst().beginTransaction();

		initLights();
		initRoom();
		initChaseCamera();

        _rootNode.updateWorldVectors();
		_rootNode.updateGeometricState(0, true);
		_rootNode.updateRenderState();

		_timer.reset();

		// now that all of the objects are created we can be guaranteed
		// that they all of have the correct meshes set up as well as
		// all the other good stuff.  We now set up the SWIFT package
		// used for tracking distances between objects.
		Swift.inst();

		for (Entity e : _entityManager.getAllEntities()) {
			e.addInitialProperties();
		}
		for (Entity e : _entityManager.getAllEntities()) {
			Swift.inst().addObject(e);
		}

		StateDatabase.inst().endTransaction();
	}

	protected void initRoom() {
//        _wubble = ClientWubbleEntity.create(_entityManager, "wubble");
//		_wubble.setPosition(new Vector3f(7.5f, 3.0f, 7.5f));
//        _rootNode.attachChild(_wubble.getNode());

        _auto = new AutonomousEntity(_entityManager, "auto", false, true);
        _auto.setPosition(new Vector3f(6.0f, 3.0f, 6.0f));

        new AutoStaticEntity(_entityManager, "floor", new Box("floor", new Vector3f(6,-0.1f,6), 6, 0.1f, 6), false);
        new AutoStaticEntity(_entityManager, "ceiling", new Box("ceiling", new Vector3f(6,12.1f,6), 6, 0.1f, 6), false);
        new AutoStaticEntity(_entityManager, "wall1", new Box("wall1", new Vector3f(-0.1f,6,6), 0.1f, 6, 6), false);
        new AutoStaticEntity(_entityManager, "wall2", new Box("wall2", new Vector3f(12.1f,6,6), 0.1f, 6, 6), false);
        new AutoStaticEntity(_entityManager, "wall3", new Box("wall3", new Vector3f(6,6,-0.1f), 6, 6, 0.1f), false);
        new AutoStaticEntity(_entityManager, "wall4", new Box("wall4", new Vector3f(6,6,12.1f), 6, 6, 0.1f), false);

		try {
			URL url = ResourceLocatorTool.locateResource(TYPE_MODEL, "room-tmp.jme");
			Node n = (Node) BinaryImporter.getInstance().load(url);

			List<Spatial> children = n.getChildren();

	        CullState cs = DisplaySystem.getDisplaySystem().getRenderer().createCullState();
	        cs.setCullMode(CullState.CS_BACK);

	        while (children.size() > 0) {
				Spatial s = children.remove(0);
				s.setRenderState(cs);
				s.updateRenderState();
//				AutoStaticEntity e = new AutoStaticEntity(_entityManager, s.getName(), s, false);
				_rootNode.attachChild(s);
	        }
		} catch (Exception e) {
			e.printStackTrace();
		}

		initRoomObjects();
	}

    protected float getRandomSize(int min, int max) {
		return ((float) 1 + (Globals.random.nextInt(max-min)+min)) / 10.0f;
	}

    /*
	 * For each of the false axis values, a random value is chosen.
	 * To have a cube object, set x,y,z to all true
	 * @param x
	 * @param y
	 * @param z
	 * @param min
	 * 		the minimum size (1-25)
	 * @param max
	 * 		the maximum size (1-25)
	 */
	public Vector3f getSize(boolean x, boolean y, boolean z, int min, int max) {
		float size = getRandomSize(min, max);

		Vector3f vec = new Vector3f(size,size,size);
		if (x)
			vec.setX(getRandomSize(min, max));

		if (y)
			vec.setY(size);

		if (z)
			vec.setZ(size);

		return vec;
	}

	protected void initRoomObjects() {
		createGroup("group0", 0, new Vector3f(6,1,6), 1, 1, getSize(true,true,true,1,5));
		createGroup("group1", 0, new Vector3f(9,1,3), 1, 1, getSize(true,true,true,1,5));
		createGroup("group2", 0, new Vector3f(3,1,3), 1, 1, getSize(true,true,true,1,5));
		createGroup("group3", 0, new Vector3f(9,1,9), 1, 1, getSize(true,true,true,1,5));
		createGroup("group4", 0, new Vector3f(3,1,9), 1, 1, getSize(true,true,true,1,5));
	}

	protected void initInput() {
		super.initInput();
		_input = new InputHandler();

        PickerInputAction pia = new PickerInputAction(this, 'L', true);
        _input.addAction(pia, DEVICE_MOUSE, BUTTON_ALL, AXIS_NONE, false);

        final Tag jumpOverTag = new Tag("jump over");
        KeyBindingManager.getKeyBindingManager().set("tagJumpOver", KeyInput.KEY_O);
        KeyInputAction jumpOver = new KeyInputAction() {
        	public void performAction(InputActionEvent evt) {
        		if (jumpOverTag.isOpen()) {
        			jumpOverTag.closeDB();
        		} else {
        			jumpOverTag.openDB();
        		}
        	}
        };
        _input.addAction(jumpOver, "tagJumpOver", false);

        final Tag jumpOnTag = new Tag("jump on");
        KeyBindingManager.getKeyBindingManager().set("tagJumpOn", KeyInput.KEY_P);
        KeyInputAction jumpOn = new KeyInputAction() {
        	public void performAction(InputActionEvent evt) {
        		if (jumpOnTag.isOpen())
        			jumpOnTag.closeDB();
        		else
        			jumpOnTag.openDB();
        	}
        };
        _input.addAction(jumpOn, "tagJumpOn", false);

//        KeyBindingManager.getKeyBindingManager().set("jumpCorrector", KeyInput.KEY_NUMPAD2);
//        KeyInputAction jumpTo = new KeyInputAction() {
//        	public void performAction(InputActionEvent evt) {
//        		_wubble.jumpTo(new Vector3f(6,3,6), false);
//        	}
//        };
//        _input.addAction(jumpTo, "jumpCorrector", false);

//        KeyBindingManager.getKeyBindingManager().set("corrector", KeyInput.KEY_NUMPAD3);
//        KeyInputAction moveTo = new KeyInputAction() {
//        	public void performAction(InputActionEvent evt) {
//        		_wubble.moveTo(new Vector3f(6,0.12f,6), false);
//        	}
//        };
//        _input.addAction(moveTo, "corrector", false);
	}

	/**
	 * overrides the VisualGameState initCamera in order
	 * to set the frustum far clipping pane a long ways away.
	 */
	protected void initCamera() {
		super.initCamera();
		_camera.setLocation(new Vector3f(6f, 7.5f, -7));
		_camera.lookAt(new Vector3f(6.0f, 0.0f, 6.0f), new Vector3f(0,1,0));
		_camera.update();
		_camera.setFrustumFar(10000);
	}

	protected void initChaseCamera() {

		Vector3f targetOffset = new Vector3f(0,1.0f,0);
        HashMap<String,Object> props = new HashMap<String,Object>();
        props.put(ChaseCamera.PROP_TARGETOFFSET, targetOffset);
        props.put(ChaseCamera.PROP_STAYBEHINDTARGET, true);
        props.put(ChaseCamera.PROP_MINDISTANCE, "0.1");
        props.put(ChaseCamera.PROP_MAXDISTANCE, "11");

//        _chaseCamera = new ChaseCamera(_camera, _wubble.getVisualNode(), props);
        _chaseCamera = new ChaseCamera(_camera, _auto.getNode(), props);
        _chaseCamera.setActionSpeed(3.0f);

        props = new HashMap<String,Object>();
        props.put(ThirdPersonMouseLook.PROP_MOUSEBUTTON_FOR_LOOKING, 1);
        props.put(ThirdPersonMouseLook.PROP_INVERTEDY, true);
        props.put(ThirdPersonMouseLook.PROP_MINROLLOUT, 0.1f);
        props.put(ThirdPersonMouseLook.PROP_MAXROLLOUT, 11f);
        props.put(ThirdPersonMouseLook.PROP_MOUSEROLLMULT, 1.5f);
        props.put(ThirdPersonMouseLook.PROP_MOUSEXMULT, 2);
        props.put(ThirdPersonMouseLook.PROP_MOUSEYMULT, 2);

        _chaseCamera.getMouseLook().updateProperties(props);

        float speed = _chaseCamera.getMouseLook().getSpeed();
        _chaseCamera.getMouseLook().setSpeed(speed / 2.0f);
	}

	/**
	 * add 2 default lights to the scene.
	 *
	 */
	protected void initLights() {
	    _lightState = DisplaySystem.getDisplaySystem().getRenderer().createLightState();
	    _lightState.setEnabled( true );

	    PointLight light = new PointLight();
	    light.setDiffuse( new ColorRGBA( 1.0f, 1.0f, 1.0f, 1.0f ) );
	    light.setAmbient( new ColorRGBA( 0.5f, 0.5f, 0.5f, 0.2f ) );
	    light.setLocation( new Vector3f( 6.0f, 3, 3.0f ) );
	    light.setShadowCaster(true);
	    light.setEnabled( true );
	    _lightState.attach(light);

	    light = new PointLight();
	    light.setDiffuse( new ColorRGBA( 0.75f, 0.75f, 0.75f, 0.75f ) );
	    light.setAmbient( new ColorRGBA( 0.5f, 0.5f, 0.5f, 0.2f ) );
	    light.setLocation( new Vector3f( 6.0f, 2, 9.0f ) );
	    light.setShadowCaster(true);
	    light.setEnabled( true );
	    _lightState.attach(light);

        //_lightState.setGlobalAmbient(new ColorRGBA(0.6f, 0.6f, 0.6f, 1.0f));

	    /** Attach the light to a lightState and the lightState to rootNode. */
	    _rootNode.setRenderState(_lightState);
		_rootNode.updateRenderState();
	}

	public void setInputEnabled(boolean enabled) {
		super.setInputEnabled(enabled);
		//_wubble.setInputEnabled(enabled);
		if (enabled)
			_input.addAction(_switchAction, "gotoChat", false);
	}

	public void update(float tpf) {
//		System.out.println("Update: " + TimeManager.inst().getLogicalTime());
		StateDatabase.inst().beginTransaction();
		Swift.inst().preUpdate();
		_entityManager.preUpdate();

		super.update(tpf);

		// explicit update for Wubble and other objects that need to
		// fix stuff during the update cycle and can't be controlled
		// with a controller
		_entityManager.updateEntities(tpf);

		// prepare the camera for its updates
		_rootNode.updateWorldData(tpf);
		// why do we have to do this twice... some dependency that I don't understand
//		_wubble.getNode().updateWorldData(tpf);
		_auto.getNode().updateWorldData(tpf);
		_chaseCamera.update(tpf);

		Highlighter.update(tpf);
		Swift.inst().update();

		// delayed update is used for recording purposes.  We need
		// to delay these calls until all objects have finished
		// local updates (movement and the like)
		// Entity A may update a fluent for Entity B, so we can't
		// close any fluents until this is completed.
		for (DynamicEntity de : _entityManager.getAllDynamicEntities())
			de.delayedUpdate();

		// postUpdate will handle controllers that must wait until
		// all of the other wubbles have updated before running
		// their test functions... a good example is approaching.
		// This will optimize the number of checks we do to keep
		// them minimal and allow us to do things like gjk
		for (DynamicEntity de : _entityManager.getAllDynamicEntities())
			de.postUpdate();

		_entityManager.getWorldDelta();

		StateDatabase.inst().endTransaction();

		// now that the state has become fairly consistent
		// we can allow the wubble to think about their next move
		// alternatively, the wubble can think first, but
		// it's 6 of one half a dozen of the other.
//		_wubble.think();
		_auto.think();
	}

	public boolean isClickable(String name) {
		Entity e = _entityManager.getEntity(name);
		if (e != null && e.isPickable())
			return true;
		return false;
	}

	/**
	 * The spatial that the user clicked on or null if they
	 * didn't click on anything.
	 * @param s
	 */
	public void picked(Spatial s) {
		if (s == null) {
			return;
		}
		if (_requestInput) {
			Entity e = _entityManager.getEntity(s.getName());
			if (e == null || !e.isPickable())
				return;

		}
	}

	public Node getPickNode() {
		return _rootNode;
	}

//	public void sendInitialMsg() {
//		StringBuffer msg = new StringBuffer("(");
//		for (Entity e : _entityManager.getAllEntities()) {
//			if (e.isPickable())
//				e.lispInitMessage(msg);
//		}
//		_wubble.lispInitMessage(msg);
//		msg.append(")");
//	}

	public void logUpdates() {
		// for now logging will be taken care of here
		// I would like something more clever than this
		// but I'm tired right now.

		StringBuffer msg = new StringBuffer("<update time=\"" + TimeManager.inst().getElapsedTime() +
				"\" logicalTime=\"" + TimeManager.inst().getLogicalTime() + "\">");
		//boolean actuallySend = false;
		for (DynamicEntity de : _entityManager.getAllDynamicEntities()) {
			StringBuffer xml = de.xmlUpdateMessage();
			if (xml.length() > 0) {
				msg.append(xml);
		//		actuallySend = true;
			}
		}
		msg.append("</update>");

	}

	public void cleanup() {

		for (Entity e : _entityManager.getAllEntities()) {
			e.remove();
		}
		StateDatabase.inst().closeSession();
		StateDatabase.inst().endTransaction();
		Swift.inst().cleanup();

		Globals.USE_DATABASE = false;
		Globals.LOG_DYNAMIC = false;
	}

	public void giveColor(Spatial s, ColorRGBA color) {
        MaterialState ms = DisplaySystem.getDisplaySystem().getRenderer().createMaterialState();
        ms.setDiffuse(color);
        ms.setAmbient(ColorRGBA.black);
        ms.setEmissive(ColorRGBA.black);
        s.setRenderState(ms);
        s.updateRenderState();
	}

	protected void createGroup(String name, int type, Vector3f origin, int rows, int columns, Vector3f size) {
		float x = origin.x;
		float y = (size.y / 2.0f) + 2;
		float z = origin.z;

		int count = 0;
		for (int i = 0; i < columns; ++i) {
			z = origin.z;
			for (int j = 0; j < rows; ++j) {
				PhysicsEntity de = null;
				switch (type) {
				case 0:  // box
					de = _entityManager.createDynamicBox(name+count, size);
					break;
				case 1:  // cylinder
					de = _entityManager.createDynamicCylinder(name+count, size.x, size.y);
					break;
				case 2:  // sphere
					de = _entityManager.createDynamicSphere(name+count, size.x);
					break;
				case 3:  // cone
					de = _entityManager.createDynamicCone(name+count, size.x, size.y);
				}

				de.setColor(ColorRGBA.randomColor());
				de.setPosition(new Vector3f(x,y,z));

				_rootNode.attachChild(de.getNode());

				z -= (size.z + 0.05f);
				++count;
			}
			x += (size.x + 0.2f);
		}
	}

	@Override
	public float getPctDone() {
		// TODO Auto-generated method stub
		return 0;
	}

}


text:
namespace Telegram4Net.SchemaTools
{
    public class Constants
    {
        public const string SolutionFolderName = "TL4Net";
        public const string DomainNameProject = "Telegram4Net.Domain";
        public const string FullDomainNameFolder = "Telegram4Net.Domain.TL";
        public const string DomainNameFolder = "TL";
        public const char DotChar = '.';
        public const string DotString = ".";
        public const char QuestionmarkChar = '?';
        public const string QuestionmarkString = "?";
        public const char EmptyChar = ' ';
        public const string EmptyString = " ";
        public const string CSharpFileExtension = ".cs";

        public const string NamespaceSection = "/*NAMESPACE*/";
        public const string NameSection = "/*NAME*/";
        public const string ParentSection = "/*PARENT*/";
        public const string ConstructorSection = "/*CONSTRUCTOR*/";
        public const string ParamsSection = "/*PARAMS*/";
        public const string ComputeSection = "/*COMPUTE*/";
        public const string DeserializeSection = "/*DESERIALIZE*/";
        public const string SerializeSection = "/*SERIALIZE*/";
    }
}


text:
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

from compas.geometry.primitives import Primitive
from compas.geometry.primitives import Plane

class Ellipse(Primitive):
    """A ellipse is defined by a plane and a major and minor axis.

    Parameters
    ----------
    plane : [point, vector] | :class:`~compas.geometry.Plane`
        The plane of the ellipse.
    major : float
        The major of the ellipse.
    minor : float
        The minor of the ellipse.

    Attributes
    ----------
    plane : :class:`~compas.geometry.Plane`
        The plane of the ellipse.
    major : float
        The major of the ellipse.
    minor : float
        The minor of the ellipse.
    normal : :class:`~compas.geometry.Vector`, read-only
        The normal of the ellipse.
    center : :class:`~compas.geometry.Point`, read-only
        The center of the ellipse.
    area : float, read-only
        The area of the ellipse.
    circumference : float, read-only
        The circumference of the ellipse.

    Examples
    --------
    >>> from compas.geometry import Plane
    >>> from compas.geometry import Ellipse
    >>> plane = Plane([0, 0, 0], [0, 0, 1])
    >>> ellipse = Ellipse(plane, 2, 1)

    """

    __slots__ = ["_plane", "_major", "_minor"]

    def __init__(self, plane, major, minor, **kwargs):
        super(Ellipse, self).__init__(**kwargs)
        self._plane = None
        self._major = None
        self._minor = None
        self.plane = plane
        self.major = major
        self.minor = minor

    # ==========================================================================
    # data
    # ==========================================================================

    @property
    def DATASCHEMA(self):
        """:class:`schema.Schema` : Schema of the data representation."""
        import schema

        return schema.Schema(
            {
                "plane": Plane.DATASCHEMA.fget(None),
                "major": schema.And(float, lambda x: x > 0),
                "minor": schema.And(float, lambda x: x > 0),
            }
        )

    @property
    def JSONSCHEMANAME(self):
        """str : Name of the schema of the data representation in JSON format."""
        return "ellipse"

    @property
    def data(self):
        """dict : The data dictionary that represents the ellipse."""
        return {"plane": self.plane.data, "major": self.major, "minor": self.minor}

    @data.setter
    def data(self, data):
        self.plane = Plane.from_data(data["plane"])
        self.major = data["major"]
        self.minor = data["minor"]

    @classmethod
    def from_data(cls, data):
        """Construct a ellipse from its data representation.

        Parameters
        ----------
        data : dict
            The data dictionary.

        Returns
        -------
        :class:`~compas.geometry.Ellipse`
            The constructed ellipse.

        Examples
        --------
        >>> from compas.geometry import Ellipse
        >>> data = {'plane': {'point': [0.0, 0.0, 0.0], 'normal': [0.0, 0.0, 1.0]}, 'major': 2.0, 'minor': 1.0}
        >>> ellipse = Ellipse.from_data(data)

        """
        return cls(Plane.from_data(data["plane"]), data["minor"], data["minor"])

    # ==========================================================================
    # properties
    # ==========================================================================

    @property
    def plane(self):
        return self._plane

    @plane.setter
    def plane(self, plane):
        self._plane = Plane(*plane)

    @property
    def major(self):
        return self._major

    @major.setter
    def major(self, major):
        self._major = float(major)

    @property
    def minor(self):
        return self._minor

    @minor.setter
    def minor(self, minor):
        self._minor = float(minor)

    @property
    def normal(self):
        return self.plane.normal

    @property
    def center(self):
        return self.plane.point

    @center.setter
    def center(self, point):
        self.plane.point = point

    @property
    def area(self):
        raise NotImplementedError

    @property
    def circumference(self):
        raise NotImplementedError

    # ==========================================================================
    # customization
    # ==========================================================================

    def __repr__(self):
        return "Ellipse({0!r}, {1!r}, {2!r})".format(self.plane, self.major, self.minor)

    def __len__(self):
        return 3

    def __getitem__(self, key):
        if key == 0:
            return self.plane
        elif key == 1:
            return self.major
        elif key == 2:
            return self.minor
        else:
            raise KeyError

    def __setitem__(self, key, value):
        if key == 0:
            self.plane = value
        elif key == 1:
            self.major = value
        elif key == 2:
            self.minor = value
        else:
            raise KeyError

    def __iter__(self):
        return iter([self.plane, self.major, self.minor])

    # ==========================================================================
    # constructors
    # ==========================================================================

    # ==========================================================================
    # transformations
    # ==========================================================================

    def transform(self, T):
        """Transform the ellipse.

        Parameters
        ----------
        T : :class:`~compas.geometry.Transformation` | list[list[float]]
            The transformation.

        Returns
        -------
        None

        Examples
        --------
        >>> from compas.geometry import Frame
        >>> from compas.geometry import Transformation
        >>> from compas.geometry import Plane
        >>> from compas.geometry import Ellipse
        >>> ellipse = Ellipse(Plane.worldXY(), 8, 5)
        >>> frame = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15])
        >>> T = Transformation.from_frame(frame)
        >>> ellipse.transform(T)

        """
        self.plane.transform(T)


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

<title>Demande</title>
<meta name="date" content="2016-03-20">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

outils

Class Demande

java.lang.Object

outils.Demande

public class Demande
extends java.lang.Object

Constructor Summary

Constructors

Constructor and Description

Demande()

Constructeur qui crée une demande par default
 Initialise le palier ou se trouve la cabine par défaut à 0 et le sens de la cabine à Sens.INDEFINI

Demande(int p,
       Sens s)

Constructeur de la demande prend en paramètre un étage et un sens

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
changeSens(Sens s)

changer le sens de la demande

boolean
enDescente()

retourne si la demande est pour descendre

boolean
enMontee()

retourne si la demande est pour monter

boolean
equals(java.lang.Object obj)

boolean
estIndefini()

Retourne true si le sens de l'ascenseur est indefini

int
etage()

retourne le palier de la demande

int
hashCode()

void
passeEtageSuivant()

passer au etage suivant selon le sens de la demande

Sens
sens()

retourne le sens de la demande

java.lang.String
toString()

Affiche le le palier et le sens de la demande

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

Demande

public Demande(int p,
               Sens s)

Constructeur de la demande prend en paramètre un étage et un sens

Parameters:

p - correspond au palier demandé

s - correspond au sens d'avancement de la cabine

Demande

public Demande()

Constructeur qui crée une demande par default
 Initialise le palier ou se trouve la cabine par défaut à 0 et le sens de la cabine à Sens.INDEFINI

Method Detail

estIndefini

public boolean estIndefini()

Retourne true si le sens de l'ascenseur est indefini

Returns:

boolean sens

etage

public int etage()

retourne le palier de la demande

Returns:

int palier

enMontee

public boolean enMontee()

retourne si la demande est pour monter

Returns:

boolean Sens.MONTEE

enDescente

public boolean enDescente()

retourne si la demande est pour descendre

Returns:

boolean Sens.DENSCENTE

passeEtageSuivant

public void passeEtageSuivant()
                       throws ExceptionCabineArretee

passer au etage suivant selon le sens de la demande

Throws:

ExceptionCabineArretee

sens

public Sens sens()

retourne le sens de la demande

Returns:

Sens sens

changeSens

public void changeSens(Sens s)

changer le sens de la demande

Parameters:

s - Sens

toString

public java.lang.String toString()

Affiche le le palier et le sens de la demande

Overrides:

toString in class java.lang.Object

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:

equals in class java.lang.Object

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method