text:
namespace ranges
{
    inline namespace v3
    {
        /// \cond
        template<typename Rng>
        struct stride_view;

        namespace detail
        {
            template<typename Rng>
            using stride_view_adaptor = view_adaptor<stride_view<Rng>, Rng,
                is_finite<Rng>::value ? finite : range_cardinality<Rng>::value>;

            // Bidirectional stride views need to remember the distance between
            // the penultimate iterator and the end iterator - which may be less
            // than the stride - so that decrementing an end iterator properly
            // produces the penultimate iterator. stride_view_base specializes on
            // that distinction so that only Bidirectional stride views have the
            // data member "offset_".
            template<typename Rng, bool = BidirectionalRange<Rng>()>
            struct stride_view_base
              : stride_view_adaptor<Rng>
            {
                stride_view_base() = default;
                RANGES_CXX14_CONSTEXPR
                stride_view_base(Rng &&rng, range_difference_type_t<Rng> const stride)
                  : stride_view_adaptor<Rng>{std::move(rng)},
                    stride_{(RANGES_EXPECT(0 < stride), stride)},
                    offset_{calc_offset(SizedRange<Rng>())}
                {}
            protected:
                RANGES_CXX14_CONSTEXPR
                void set_offset(range_difference_type_t<Rng> const delta) noexcept
                {
                    RANGES_EXPECT(0 <= delta && delta < stride_);
                    if(0 > offset_) offset_ = delta;
                    else RANGES_EXPECT(offset_ == delta);
                }
                RANGES_CXX14_CONSTEXPR
                void set_offset(range_difference_type_t<Rng> const) const noexcept
                {}
                RANGES_CXX14_CONSTEXPR
                range_difference_type_t<Rng> get_offset(bool check = true) const noexcept
                {
                    RANGES_EXPECT(!check || 0 <= offset_);
                    return offset_;
                }

                range_difference_type_t<Rng> stride_;
                range_difference_type_t<Rng> offset_ = -1;
            private:
                RANGES_CXX14_CONSTEXPR
                range_difference_type_t<Rng> calc_offset(std::true_type)
                {
                    if(auto const rem = ranges::distance(this->base()) % stride_)
                        return stride_ - rem;
                    else
                        return 0;
                }
                RANGES_CXX14_CONSTEXPR
                range_difference_type_t<Rng> calc_offset(std::false_type) const noexcept
                {
                    return -1;
                }
            };

            template<typename Rng>
            struct stride_view_base<Rng, false>
              : stride_view_adaptor<Rng>
            {
                stride_view_base() = default;
                constexpr stride_view_base(Rng &&rng, range_difference_type_t<Rng> const stride)
                  : stride_view_adaptor<Rng>{std::move(rng)},
                    stride_{(RANGES_EXPECT(0 < stride), stride)}
                {}
            protected:
                RANGES_CXX14_CONSTEXPR
                void set_offset(range_difference_type_t<Rng> const) const noexcept
                {}
                RANGES_CXX14_CONSTEXPR
                range_difference_type_t<Rng> get_offset(bool = true) const noexcept
                {
                    return 0;
                }

                range_difference_type_t<Rng> stride_;
            };
        }
        /// \endcond

        /// \addtogroup group-views
        /// @{
        template<typename Rng>
        struct stride_view
          : detail::stride_view_base<Rng>
        {
        private:
            friend range_access;

            // stride_view const models Range if Rng const models Range, and
            // either (1) Rng is sized, so we can pre-calculate offset_, or (2)
            // Rng is not Bidirectional, so it does not need offset_.
            static constexpr bool const_iterable() noexcept
            {
                return Range<Rng const>() &&
                    (SizedRange<Rng const>() || !BidirectionalRange<Rng const>());
            }

            // If the underlying range doesn't model BoundedRange, then we can't
            // decrement the end and there's no reason to adapt the sentinel. Strictly
            // speaking, we don't have to adapt the end iterator of Input and Forward
            // Ranges, but in the interests of making the resulting stride view model
            // BoundedView, adapt it anyway.
            template<bool Const>
            static constexpr bool can_bound() noexcept
            {
                using CRng = meta::const_if_c<Const, Rng>;
                return BoundedRange<CRng>()
                    && (SizedRange<CRng>() || !BidirectionalRange<CRng>());
            }

            template<bool Const>
            struct adaptor : adaptor_base
            {
            private:
                using CRng = meta::const_if_c<Const, Rng>;
                using stride_view_t = meta::const_if_c<Const, stride_view>;
                stride_view_t *rng_;
            public:
                adaptor() = default;
                constexpr adaptor(stride_view_t &rng) noexcept
                  : rng_(&rng)
                {}
                template<bool Other,
                    CONCEPT_REQUIRES_(Const && !Other)>
                adaptor(adaptor<Other> that)
                  : rng_(that.rng_)
                {}
                RANGES_CXX14_CONSTEXPR void next(iterator_t<CRng> &it)
                {
                    auto const last = ranges::end(rng_->base());
                    RANGES_EXPECT(it != last);
                    auto const delta = ranges::advance(it, rng_->stride_, last);
                    if(it == last)
                    {
                        rng_->set_offset(delta);
                    }
                }
                CONCEPT_REQUIRES(BidirectionalRange<CRng>())
                RANGES_CXX14_CONSTEXPR void prev(iterator_t<CRng> &it)
                {
                    RANGES_EXPECT(it != ranges::begin(rng_->base()));
                    auto delta = -rng_->stride_;
                    if(it == ranges::end(rng_->base()))
                    {
                        RANGES_EXPECT(rng_->get_offset() >= 0);
                        delta += rng_->get_offset();
                    }
                    ranges::advance(it, delta);
                }
                template<class Other,
                    CONCEPT_REQUIRES_(SizedSentinel<Other, iterator_t<CRng>>())>
                RANGES_CXX14_CONSTEXPR range_difference_type_t<Rng> distance_to(
                    iterator_t<CRng> const &here, Other const &there) const
                {
                    range_difference_type_t<Rng> delta = there - here;
                    if(delta < 0)
                        delta -= rng_->stride_ - 1;
                    else
                        delta += rng_->stride_ - 1;
                    return delta / rng_->stride_;
                }
                CONCEPT_REQUIRES(RandomAccessRange<CRng>())
                RANGES_CXX14_CONSTEXPR void advance(
                    iterator_t<CRng> &it, range_difference_type_t<Rng> n)
                {
                    if(0 == n)
                        return;
                    n *= rng_->stride_;
                    auto const last = ranges::end(rng_->base());
                    if(it == last)
                    {
                        RANGES_EXPECT(n < 0);
                        RANGES_EXPECT(rng_->get_offset() >= 0);
                        n += rng_->get_offset();
                    }
                    if(0 < n)
                    {
                        auto delta = ranges::advance(it, n, last);
                        if(it == last)
                        {
                            // advance hit the end of the base range.
                            rng_->set_offset(delta % rng_->stride_);
                        }
                    }
                    else if(0 > n)
                    {
#ifdef NDEBUG
                        ranges::advance(it, n);
#else
                        auto const first = ranges::begin(rng_->base());
                        auto const delta = ranges::advance(it, n, first);
                        RANGES_EXPECT(delta == 0);
#endif
                    }
                }
            };
            RANGES_CXX14_CONSTEXPR adaptor<false> begin_adaptor()
            {
                return adaptor<false>{*this};
            }
            CONCEPT_REQUIRES(const_iterable())
            constexpr adaptor<true> begin_adaptor() const
            {
                return adaptor<true>{*this};
            }

            RANGES_CXX14_CONSTEXPR
            meta::if_c<can_bound<false>(), adaptor<false>, adaptor_base> end_adaptor()
            {
                return {*this};
            }
            CONCEPT_REQUIRES(const_iterable())
            constexpr
            meta::if_c<can_bound<true>(), adaptor<true>, adaptor_base> end_adaptor() const
            {
                return {*this};
            }

            constexpr range_size_type_t<Rng> size_(range_size_type_t<Rng> const n) const noexcept
            {
                return (n + static_cast<range_size_type_t<Rng>>(this->stride_) - 1) /
                    static_cast<range_size_type_t<Rng>>(this->stride_);
            }
        public:
            stride_view() = default;
            constexpr stride_view(Rng rng, range_difference_type_t<Rng> const stride)
              : detail::stride_view_base<Rng>{std::move(rng), stride}
            {}
            CONCEPT_REQUIRES(SizedRange<Rng>())
            RANGES_CXX14_CONSTEXPR range_size_type_t<Rng> size()
            {
                return size_(ranges::size(this->base()));
            }
            CONCEPT_REQUIRES(SizedRange<Rng const>())
            constexpr range_size_type_t<Rng> size() const
            {
                return size_(ranges::size(this->base()));
            }
        };

        namespace view
        {
            struct stride_fn
            {
            private:
                friend view_access;
                template<typename Difference, CONCEPT_REQUIRES_(Integral<Difference>())>
                RANGES_CXX14_CONSTEXPR
                static auto bind(stride_fn stride, Difference step)
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    make_pipeable(std::bind(stride, std::placeholders::_1, std::move(step)))
                )
            public:
                template<typename Rng, CONCEPT_REQUIRES_(InputRange<Rng>())>
                constexpr auto operator()(Rng &&rng, range_difference_type_t<Rng> step) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    stride_view<all_t<Rng>>{all(static_cast<Rng &&>(rng)), step}
                )

                // For the purpose of better error messages:
            #ifndef RANGES_DOXYGEN_INVOKED
            private:
                template<typename Difference, CONCEPT_REQUIRES_(!Integral<Difference>())>
                static detail::null_pipe bind(stride_fn, const Difference &)
                {
                    CONCEPT_ASSERT_MSG(Integral<Difference>(),
                        "The value to be used as the step in a call to view::stride must be a "
                        "model of the Integral concept that is convertible to the range's "
                        "difference type.");
                    return {};
                }
            public:
                template<typename Rng, typename T,
                    CONCEPT_REQUIRES_(!InputRange<Rng>())>
                void operator()(Rng &&, T &&) const
                {
                    CONCEPT_ASSERT_MSG(InputRange<Rng>(),
                        "The object to be operated on by view::stride should be a model of the "
                        "InputRange concept.");
                    CONCEPT_ASSERT_MSG(Integral<T>(),
                        "The value to be used as the step in a call to view::stride must be a "
                        "model of the Integral concept that is convertible to the range's "
                        "difference type.");
                }
            #endif
            };

            /// \relates stride_fn
            /// \ingroup group-views
            RANGES_INLINE_VARIABLE(view<stride_fn>, stride)
        }
        /// @}
    }
}

RANGES_SATISFY_BOOST_RANGE(::ranges::v3::stride_view)

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="cn.studyjams.s1.sj64.liuyang.Currency">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <LinearLayout
            android:id="@+id/convert_panel"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:baselineAligned="false"
            android:orientation="horizontal"
            android:paddingBottom="16dp">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/current_type"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:labelFor="@+id/current_value_edit_text"
                    android:textSize="20sp"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/current_value_edit_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text"
                    android:textAlignment="center"
                    android:textAllCaps="true"
                    android:textSize="24sp"
                    android:textStyle="bold" />

                <cn.studyjams.s1.sj64.liuyang.WheelView
                    android:id="@+id/wv_left"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

            </LinearLayout>

            <Button
                android:id="@+id/change_btn"
                style="@style/Widget.AppCompat.Button.Colored"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:layout_marginBottom="@dimen/activity_vertical_margin"
                android:layout_marginTop="@dimen/activity_vertical_margin"
                android:background="@drawable/round_btn"
                android:text="@string/change"
                android:textColor="@android:color/white"
                android:textSize="20sp"
                android:textStyle="bold" />

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/convert_type"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:labelFor="@+id/convert_value_edit_text"
                    android:textSize="20sp"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/convert_value_edit_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text"
                    android:textAlignment="center"
                    android:textAllCaps="true"
                    android:textSize="24sp"
                    android:textStyle="bold" />

                <cn.studyjams.s1.sj64.liuyang.WheelView
                    android:id="@+id/wv_right"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </LinearLayout>
        </LinearLayout>

        <View
            android:id="@+id/cut_line"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@android:color/darker_gray">

        </View>

        <TextView
            android:id="@+id/detail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:background="@color/lightGray"
            android:padding="16dp"
            android:textSize="16sp" />
    </LinearLayout>
</android.support.design.widget.CoordinatorLayout>

redpajama_set_name: RedPajamaGithub


text:
package de.hshannover.f4.trust.visitmeta.input.gui;

import javax.swing.JComponent;
import javax.swing.JLayeredPane;

/**
 * A {@link JLayeredPane} that encapsulates the rendering panel and a
 * {@link MotionInformationPanel} in such a way, that the latter is rendered
 * "above" the rendering panel.
 *
 * This allows to display information about the motion control device on top
 * of the actual graph representation.
 *
 * @author Bastian Hellmann
 * @author Oleg Wetzler
 *
 */
public class MotionInformationPane extends JLayeredPane {

	private static final long serialVersionUID = 1L;
	private JComponent component;
	private MotionInformationPanel motionInformationPanel;

	/**
	 * Creates a new {@link MotionInformationPane} that renders
	 *
	 * @param component the {@link JComponent}, that will be rendered
	 * "at the bottom", with a {@link MotionInformationPanel} "on top".
	 */
	public MotionInformationPane(JComponent component) {
		this.component = component;
		this.motionInformationPanel = new MotionInformationPanel();

		this.add(motionInformationPanel, 101);
		this.add(component, 100);
		motionInformationPanel.setVisible(false);
		repaint();
	}

	/**
	 * Sets the cursor position, un-hide the {@link MotionInformationPanel} and
	 * repaints the {@link JLayeredPane}.
	 *
	 * @param x x coordinate of the cursor
	 * @param y y coordinate of the cursor
	 * @param z z coordinate of the cursor
	 */
	public void setCursorPosition(double x, double y, double z) {
		motionInformationPanel.setCursorPosition(x, y, z);
		motionInformationPanel.setVisible(true);
		repaint();
	}

	/**
	 * Hides the {@link MotionInformationPanel}.
	 */
	public void hideMotionInformationPanel() {
		motionInformationPanel.setVisible(false);
	}

	/* (non-Javadoc)
	 * @see java.awt.Component#repaint()
	 */
	@Override
	public void repaint() {
		super.repaint();
		motionInformationPanel.setBounds(0, 0, getWidth(), getHeight());
		component.setBounds(0, 0, getWidth(), getHeight());
	}
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.11.22 at 01:45:09 PM EST
//

package uk.org.siri.siri_2;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;

/**
 * Type for GM Coordinates.
 *
 *
Java class for CoordinatesStructure complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CoordinatesStructure">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>NMTOKENS" default="2.0">
 *     </extension>
 *   </simpleContent>
 * </complexType>
 *

 *
 *
 */

//
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CoordinatesStructure", propOrder = {
    "value"
})
public class CoordinatesStructure {

    @XmlValue
    @XmlSchemaType(name = "NMTOKENS")
    protected List<String> value;

    /**
     * Gets the value of the value property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the value property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getValue().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getValue() {
        if (value == null) {
            value = new ArrayList<String>();
        }
        return this.value;
    }

}


text:
module Database
  def setup_database(db_name, db_config)
    setup_pg(db_name, db_config) if RUBY_PLATFORM == 'ruby'
    setup_jdbc(db_name, db_config) if RUBY_PLATFORM == 'java'
  end

  def setup_pg(db_name, db_config)
    begin
      ActiveRecord::Base.establish_connection(db_name)
      ActiveRecord::Base.connection
    rescue PG::ConnectionBad
      ActiveRecord::Base.establish_connection db_config.merge('database' => nil)
      ActiveRecord::Base.connection.create_database db_config['database']
      ActiveRecord::Base.establish_connection db_config
    end
  end

  def setup_jdbc(db_name, db_config)
    begin
      ActiveRecord::Base.establish_connection(db_name)
      ActiveRecord::Base.connection
    rescue ActiveRecord::JDBCError
      ActiveRecord::Base.establish_connection db_config.merge('database' => nil)
      ActiveRecord::Base.connection.create_database db_config['database']
      ActiveRecord::Base.establish_connection db_config
    end
  end
end


text:
{% extends "account/base.html" %}

{% load url from future %}
{% load i18n %}

{% block head_title %}{% trans "Signup" %}{% endblock %}

{% block title %}{{ block.super }}Signup{% endblock %}

{% block content %}

{% trans "Sign Up" %}

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}

<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
  {% csrf_token %}
  {{ form.as_p }}
  {% if redirect_field_value %}
  <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
  {% endif %}
  <button class="btn btn-success btn-large" type="submit">{% trans "Sign Up" %} »</button>
</form>

{% endblock %}


text:
package fr.liglab.adele.cream.it.functional.extension.test;

import fr.liglab.adele.cream.testing.helpers.ContextBaseTest;

import java.util.Arrays;
import java.util.List;

/**
 * Created by aygalinc on 26/08/16.
 */
public abstract class FunctionalExtensionBaseCommonConfig extends ContextBaseTest {

    @Override
    protected List<String> getExtraExports() {
        return Arrays.asList(
                "fr.liglab.adele.cream.it.functional.extension.injection",
                "fr.liglab.adele.cream.it.functional.extension.synchronisation",
                "fr.liglab.adele.cream.it.functional.extension.changeOn",
                "fr.liglab.adele.cream.it.functional.extension.multiple",
                "fr.liglab.adele.cream.it.functional.extension.invalid",
                "fr.liglab.adele.cream.it.functional.extension.contextSource"
        );
    }

    @Override
    public boolean deployTestBundle() {
        return true;
    }
}


text:
module ApiV2
  class UserSummaryRepresenter < ApiV2::BaseRepresenter

    alias_method :login_name, :represented

    link :doc do
      'https://api.gocd.org/#users'
    end

    link :current_user do |opts|
      opts[:url_builder].apiv1_current_user_url
    end

    link :self do |opts|
      opts[:url_builder].apiv1_user_url(login_name: login_name)
    end

    link :find do |opts|
      opts[:url_builder].apiv1_user_url(login_name: '__login_name__').gsub(/__login_name__/, ':login_name')
    end

    property :login_name, exec_context: :decorator

  end
end


text:
package org.languagetool.rules.fr;

import org.junit.Test;
import org.languagetool.Languages;
import org.languagetool.TestTools;
import org.languagetool.rules.ngrams.FakeLanguageModel;

public class FrenchConfusionProbabilityRuleTest {

  @SuppressWarnings("ResultOfObjectAllocationIgnored")
  @Test
  public void testConstructor() {
    new FrenchConfusionProbabilityRule(TestTools.getEnglishMessages(), new FakeLanguageModel(), Languages.getLanguageForShortCode("fr"));
  }

}


text:
import socket
import sys
import os
import json
import time
import serial
import availablePorts
import argparse

DATA_AMOUNT = 1024
MAXLINE = 40

def getArgs():
    parser = argparse.ArgumentParser(prog=sys.argv[0])

    parser.add_argument('-p','--port',type=int,default=10000,dest='port',help="the socket port, defaults to 10000")
    parser.add_argument('serial_port',default=None,nargs='?',help="the serial port, e.g., '/dev/tty.wchusbserial1410'")
    return vars(parser.parse_args())

def sendBytes(ser, bytesToSend):
    try:
        ser.write(bytesToSend.encode())
        response = ""
        while True:
            response += ser.read(10).decode('utf-8')
            #print("resp:"+response)
            if len(response) > 0 and response[-1] == '\4':
                response = response[:-1] # remove 0x04
                print("response:"+response)
                break
            time.sleep(0.1)
    except KeyboardInterrupt:
        pass
    except Exception as ex:
        print("Exception in sendBytes.")
        template = "An exception of type {0} occurred. Arguments:\n{1!r}"
        message = template.format(type(ex).__name__, ex.args)
        print(message)
    return response

def moveCursor(ser, horizontal, vertical):
    print("Moving cursor %d microspaces horizontally and %d microspaces vertically" % (horizontal, vertical))
    # The horizontal and vertical microspaces are capped at +-32767
    # If either value is negative, we will convert it to two's complement
    # which will be easy to read on the Arduino
    #
    # We will convert each value to a 2-byte value in little endian
    # format to transfer

    if horizontal < 0:
        horizontal += 65535 + 1 # two's complement conversion
    hb0 = horizontal & 0xff # little byte
    hb1 = (horizontal >> 8) & 0xff # big byte

    if vertical < 0:
        vertical += 65535 + 1 # two's complement conversion
    vb0 = vertical & 0xff # little byte
    vb1 = (vertical >> 8) & 0xff # big byte

    bytesToSend = chr(0x05) + chr(hb0) + chr(hb1) + chr(vb0) + chr(vb1)

    response = sendBytes(ser, bytesToSend)
    return response

def resetTypewriter(ser):
    print("Resetting typewriter...")
    bytesToSend = chr(0x04)
    response = sendBytes(ser, bytesToSend)

    #response = "Typewriter reset."
    print(response)
    return response

def returnCursor(ser,vertical):
    print("Returning cursor...")
    if vertical < 0:
        vertical += 65535 + 1 # two's complement conversion
    vb0 = vertical & 0xff # little byte
    vb1 = (vertical >> 8) & 0xff # big byte

    bytesToSend = chr(0x06) + chr(vb0) + chr(vb1)
    response = sendBytes(ser, bytesToSend)

    #response="Returned cursor to beginning of line."
    print(response)
    return response

def getMicrospaces(ser):
    print("Getting microspace count...")
    bytesToSend = chr(0x08)
    response = sendBytes(ser, bytesToSend)

    #response="Returned cursor to beginning of line."
    print(response)
    return response

def sendCharacters(ser, stringToPrint, spacing):
    print('Sending "%s" with spacing %d...' % (stringToPrint,spacing))
    # get the text length
    textLen = len(stringToPrint)

    # first two bytes are the file length (max: 65K)
    # sent in little-endian format
    stringHeader = chr(0x00) + chr(textLen & 0xff) + chr(textLen >> 8) + chr(spacing)

    try:
        # read MAXLINE characters at a time and send
        while len(stringToPrint) > 0:
            chars = stringToPrint[:MAXLINE]
            stringToPrint = stringToPrint[MAXLINE:]
            if chars == '':
                break
            ser.write(bytearray(stringHeader + chars,'utf-8'))
            stringHeader = ''  # not needed any more
            if len(stringToPrint) > 0:
                #print("sleeping")
                #print("to print: " + stringToPrint)
                time.sleep(3) # wait for characters to print
            #sys.stdout.write(chars)
            #sys.stdout.flush()
        response = ""
        while True:
            response += ser.read(10).decode('utf-8')
            # print("resp:"+response)
            if len(response) > 0 and response[-1] == '\4':
                response = response[:-1] # remove '\4'
                break
            time.sleep(0.1)
    except KeyboardInterrupt:
        pass

    print("response: ")
    print(response)
    return response

def runServer(ser,port):
    # Create a TCP/IP socket
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    # Bind the socket to the port
    server_address = ('localhost', port)
    print('starting up on %s port %s' % server_address)
    sock.bind(server_address)

    # Listen for incoming connections
    sock.listen(1)

    while True:
        # Wait for a connection
        print('Ready to receive commands!')
        print('Waiting for a connection')
        connection, client_address = sock.accept()
        fullData = ''
        try:
            print('connection from %s port %s' % client_address)

            # Receive the data in small chunks and retransmit it
            while True:
                data = connection.recv(DATA_AMOUNT).decode('utf-8')
                if data:
                    # print('received "%s"' % data)
                    fullData += data
                else:
                    print('no more data from %s port %s' % client_address)
                    args = json.loads(fullData)
                    if args['command'] == 'movecursor':
                        reply = moveCursor(ser, args['horizontal'],args['vertical'])
                    elif args['command'] == 'reset':
                        reply = resetTypewriter(ser)
                    elif args['command'] == 'return':
                        reply = returnCursor(ser,args['vertical'])
                    elif args['command'] == 'characters':
                        st = args['string_to_print']
                        if len(st) > 0:
                            reply = sendCharacters(ser, st,args['spacing'])
                        else:
                            reply = "Empty string, no characters sent."
                    elif args['command'] == 'microspaces':
                        reply = getMicrospaces(ser)
                    else:
                        reply = "not a known command"
                    print("about to sendall")
                    connection.sendall(reply.encode())
                    print("finished sendall")
                    # print('sending "%s" to typewriter' % args)
                    print("about to sendall again")
                    connection.sendall('\0'.encode())
                    print("finished sendall again")
                    break
        except Exception as ex:
            print("Exception in runServer.")
            template = "An exception of type {0} occurred. Arguments:\n{1!r}"
            message = template.format(type(ex).__name__, ex.args)
            print(message)
        finally:
            # Clean up the connection
            connection.close()
            print

def setupSerial(portChoice):
    print("Setting up...")
    # if HARDCODED_PORT is '', then the user will get a choice
    #HARDCODED_PORT = '/dev/tty.wchusbserial1410'
    HARDCODED_PORT = ''

    # choose port
    if portChoice == None:
        portChoiceInt = 0
        if HARDCODED_PORT == '':
            ports = availablePorts.serial_ports()

            if len(ports) == 1:
                # just choose the first
                print("Choosing: " + ports[0])
                portChoice = ports[0]
            else:
                if portChoiceInt == 0:
                    print("Please choose a port:")
                    for idx,p in enumerate(ports):
                        print("\t"+str(idx+1)+") "+p)
                    portChoiceInt = int(input())
                portChoice = ports[portChoiceInt-1]
        else:
            portChoice = HARDCODED_PORT

    # set up serial port
    ser = serial.Serial(portChoice, 115200, timeout=0.1)
    # wait a bit
    time.sleep(2)
    return ser

if __name__ == '__main__':
    args = getArgs()
    try:
        ser = setupSerial(args['serial_port'])
        runServer(ser,args['port'])
    except Exception as ex:
         template = "An exception of type {0} occurred. Arguments:\n{1!r}"
         message = template.format(type(ex).__name__, ex.args)
         print(message)
    finally:
        print("Closing serial connection.")
        ser.close()


text:
using System;

namespace UnityInjectionTypes
{
    public interface IOperationFactory
    {
        IOperation Create(string token);
    }

    public class OperationFactory : IOperationFactory
    {
        // TODO: Initialize field using constructor injection
        private IOperationMinus _minus;

        // TODO: Initialize field using property injection
        private IOperationPlus _plus;

        // TODO: Initialize field using injection method
        private IOperationDiv _div;

        public IOperation Create(string token)
        {
            switch (token)
            {
                case "-":
                    return _minus;
                case "+":
                    return _plus;
                case "/":
                    return _div;
                default:
                    throw new NotImplementedException();
            }
        }
    }
}


text:
package org.keycloak.testsuite.console.events;

import org.jboss.arquillian.graphene.page.Page;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.testsuite.console.AbstractConsoleTest;
import org.keycloak.testsuite.console.page.events.Config;

import static org.junit.Assert.*;

/**
 * @author mhajas
 */
public class ConfigTest extends AbstractConsoleTest {

    @Page
    private Config configPage;

    @Before
    public void beforeConfigTest() {
        configPage.navigateTo();
    }

    @Test
    public void configLoginEventsTest() {
        configPage.form().setSaveEvents(true);
        // IE webdriver has problem with clicking not visible (scrolling is needed) items in the menu,
        // so we need to select some type from the beginning of the menu
        configPage.form().addSaveType("CLIENT_INFO");
        //after removeSavedType method stay input focused -> in phantomjs drop menu doesn't appear after first click
        configPage.form().removeSaveType("LOGIN");
        configPage.form().setExpiration("50", "Days");
        configPage.form().save();
        assertAlertSuccess();

        RealmRepresentation realm = testRealmResource().toRepresentation();
        assertTrue(realm.isEventsEnabled());
        assertFalse(realm.getEnabledEventTypes().contains("LOGIN"));
        assertTrue(realm.getEnabledEventTypes().contains("CLIENT_INFO"));
        assertEquals(4320000L, realm.getEventsExpiration().longValue());
    }

    @Test
    public void configAdminEventsTest() {
        configPage.form().setSaveAdminEvents(true);
        configPage.form().setIncludeRepresentation(true);
        configPage.form().save();
        assertAlertSuccess();

        RealmRepresentation realm = testRealmResource().toRepresentation();
        assertTrue(realm.isAdminEventsEnabled());
        assertTrue(realm.isAdminEventsDetailsEnabled());
    }
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.DocAsCode.Dfm.Tests
{
    using System;
    using System.Collections.Generic;

    using Xunit;

    using Microsoft.DocAsCode.MarkdownLite;

    public class CustomizedRendererCreatorTest
    {
        [Fact]
        [Trait("Related", "dfm")]
        public void TestRendererCreator()
        {
            var p = new TestDfmRendererPartProvider();
            var renderer = CustomizedRendererCreator.CreateRenderer(
                new DfmRenderer(),
                new[] { p },
                null);
            var engine = DocfxFlavoredMarked
                .CreateBuilder(".")
                .CreateDfmEngine(renderer);
            var result = engine.Markup(@"```cs
public void TestRendererCreator()
```
```cs-x
public void TestRendererCreator()
```", "a.md");
            Assert.Equal(@"
public void TestRendererCreator()

public void TestRendererCreator()

".Replace("\r\n", "\n"), result);
            (renderer as IDisposable).Dispose();
            Assert.True(p.CodeRendererPartInstance.Disposed);
        }

        private sealed class TestDfmRendererPartProvider : IDfmCustomizedRendererPartProvider
        {
            public CodeRendererPart CodeRendererPartInstance = new CodeRendererPart();

            public IEnumerable<IDfmCustomizedRendererPart> CreateParts(IReadOnlyDictionary<string, object> parameters)
            {
                yield return CodeRendererPartInstance;
            }

            public sealed class CodeRendererPart : DfmCustomizedRendererPartBase<IMarkdownRenderer, MarkdownCodeBlockToken, MarkdownBlockContext>, IDisposable
            {
                public bool Disposed { get; private set; }

                public override string Name => nameof(CodeRendererPart);

                public void Dispose()
                {
                    Disposed = true;
                }

                public override bool Match(IMarkdownRenderer renderer, MarkdownCodeBlockToken token, MarkdownBlockContext context)
                {
                    return token.Lang.EndsWith("-x");
                }

                public override StringBuffer Render(IMarkdownRenderer renderer, MarkdownCodeBlockToken token, MarkdownBlockContext context)
                {
                    StringBuffer result = "
";
                    result += token.Code;
                    result += "\n
";
                    return result;
                }
            }
        }
    }
}


text:
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
 *  Main authors:
 *     Christian Schulte <schulte@gecode.org>
 *
 *  Copyright:
 *     Christian Schulte, 2004
 *
 *  Last modified:
 *     $Date$ by $Author$
 *     $Revision$
 *
 *  This file is part of Gecode, the generic constraint
 *  development environment:
 *     http://www.gecode.org
 *
 *  Permission is hereby granted, free of charge, to any person obtaining
 *  a copy of this software and associated documentation files (the
 *  "Software"), to deal in the Software without restriction, including
 *  without limitation the rights to use, copy, modify, merge, publish,
 *  distribute, sublicense, and/or sell copies of the Software, and to
 *  permit persons to whom the Software is furnished to do so, subject to
 *  the following conditions:
 *
 *  The above copyright notice and this permission notice shall be
 *  included in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

namespace Gecode { namespace Int { namespace Dom {

  template<class View, ReifyMode rm>
  forceinline
  ReIntSet<View,rm>::ReIntSet
  (Home home, View x, const IntSet& s, BoolView b)
    : ReUnaryPropagator<View,PC_INT_DOM,BoolView>(home,x,b), is(s) {
    home.notice(*this,AP_DISPOSE);
  }

  template<class View, ReifyMode rm>
  forceinline size_t
  ReIntSet<View,rm>::dispose(Space& home) {
    home.ignore(*this,AP_DISPOSE);
    is.~IntSet();
    (void) ReUnaryPropagator<View,PC_INT_DOM,BoolView>::dispose(home);
    return sizeof(*this);
  }

  template<class View, ReifyMode rm>
  ExecStatus
  ReIntSet<View,rm>::post(Home home, View x, const IntSet& s, BoolView b) {
    if (s.ranges() == 0) {
      if (rm == RM_PMI)
        return ES_OK;
      GECODE_ME_CHECK(b.zero(home));
    } else if (s.ranges() == 1) {
      return ReRange<View,rm>::post(home,x,s.min(),s.max(),b);
    } else if (b.one()) {
      if (rm == RM_PMI)
        return ES_OK;
      IntSetRanges i_is(s);
      GECODE_ME_CHECK(x.inter_r(home,i_is,false));
    } else if (b.zero()) {
      if (rm == RM_IMP)
        return ES_OK;
      IntSetRanges i_is(s);
      GECODE_ME_CHECK(x.minus_r(home,i_is,false));
    } else {
      (void) new (home) ReIntSet<View,rm>(home,x,s,b);
    }
    return ES_OK;
  }

  template<class View, ReifyMode rm>
  forceinline
  ReIntSet<View,rm>::ReIntSet(Space& home, bool share, ReIntSet& p)
    : ReUnaryPropagator<View,PC_INT_DOM,BoolView>(home,share,p) {
    is.update(home,share,p.is);
  }

  template<class View, ReifyMode rm>
  Actor*
  ReIntSet<View,rm>::copy(Space& home, bool share) {
    return new (home) ReIntSet(home,share,*this);
  }

  template<class View, ReifyMode rm>
  ExecStatus
  ReIntSet<View,rm>::propagate(Space& home, const ModEventDelta&) {
    IntSetRanges i_is(is);
    if (b.one()) {
      if (rm != RM_PMI)
        GECODE_ME_CHECK(x0.inter_r(home,i_is,false));
      return home.ES_SUBSUMED(*this);
    }
    if (b.zero()) {
      if (rm != RM_IMP)
        GECODE_ME_CHECK(x0.minus_r(home,i_is,false));
      return home.ES_SUBSUMED(*this);
    }

    {
      ViewRanges<View> i_x(x0);

      switch (Iter::Ranges::compare(i_x,i_is)) {
      case Iter::Ranges::CS_SUBSET:
        if (rm != RM_IMP)
          GECODE_ME_CHECK(b.one_none(home));
        return home.ES_SUBSUMED(*this);
      case Iter::Ranges::CS_DISJOINT:
        if (rm != RM_PMI)
          GECODE_ME_CHECK(b.zero_none(home));
        return home.ES_SUBSUMED(*this);
      case Iter::Ranges::CS_NONE:
        break;
      default: GECODE_NEVER;
      }
    }
    return ES_FIX;
  }

}}}

// STATISTICS: int-prop


text:
namespace learning_lda {

// The PLDAPLUSSampler is simply a modified version of LDASampler.
// Since the pd processer does not store the distribution data in
// the local memory, and sampling is based on word order instead
// of document order, we rewrote the DoIteration and
// SampleNewTopicForDocument methods.
class PLDAPLUSSampler : public LDASampler {
 public:
  PLDAPLUSSampler(double alpha,
              double beta,
              PLDAPLUSModelForPd* model,
              LDAAccumulativeModel* accum_model);
  ~PLDAPLUSSampler();

  // Each time do sampling for all occurrences of a word in the local
  // corpus, and distributions are fed by arguments.
  void SampleNewTopicForWordInDocumentWithDistributions(
      int word_index_in_document,
      LDADocument* document_ptr,
      bool update_model,
      int64* topic_word,
      int64* global_topic,
      int64* delta_topic);

  // Fetch distributions from pw processors before sampling
  // and update distributions on pw processors after sampling.
  void DoIteration(PLDAPLUSCorpus* pldaplus_corpus,
                   bool training_model,
                   bool burn_in);
 private:
  int64*  alloc_buf_;
  PLDAPLUSModelForPd* model_pd_;
};

} // namespace learning_lda

#endif // _PLDAPLUS_SAMPLER_H_


text:
/*
 * $Id: ContourLine.java,v 1.2 2006/01/19 14:45:49 luca Exp $
 *
 * This software is provided by NOAA for full, free and open release.  It is
 * understood by the recipient/user that NOAA assumes no liability for any
 * errors contained in the code.  Although this software is released without
 * conditions or restrictions in its use, it is expected that appropriate
 * credit be given to its author and to the National Oceanic and Atmospheric
 * Administration should the software be included by the recipient as an
 * element in other product development.
 */

package gov.noaa.pmel.sgt.contour;

import java.util.Vector;
import java.util.Enumeration;

import java.awt.Graphics;
import java.awt.Color;

import gov.noaa.pmel.sgt.ContourLineAttribute;
import gov.noaa.pmel.sgt.DefaultContourLineAttribute;
import gov.noaa.pmel.sgt.SGLabel;
import gov.noaa.pmel.sgt.LayerNotFoundException;
import gov.noaa.pmel.sgt.CartesianGraph;
import gov.noaa.pmel.sgt.JPane;
import gov.noaa.pmel.sgt.LineAttribute;
import gov.noaa.pmel.sgt.StrokeDrawer;

import gov.noaa.pmel.util.Point2D;
import gov.noaa.pmel.util.GeoDate;
import it.unitn.ing.rista.util.Misc;

/**
 * ContourLine contains a single closed or open contour
 * and a list of its labels.
 * The level, closedness, and path are properties.
 * The path is stored as a Vector of Point2D
 * user coordinate values. ContourLine objects are
 * created by Contour and drawn by
 * GridCartesianRenderer.  Time coordinates are stored in
 * the Point2D objects releative to a reference time.
 *
 * @author D. W. Denbo
 * @version $Revision: 1.2 $, $Date: 2006/01/19 14:45:49 $
 * @since 2.0
 * @see Contour
 * @see ContourLineAttribute
 * @see DefaultContourLineAttribute
 * @see gov.noaa.pmel.sgt.GridCartesianRenderer
 */
public class ContourLine extends Vector {
  private StrokeDrawer stroke_ = null;

  private boolean closed_ = false;
  private double level_;
  private GeoDate timeRef_ = null;
  private boolean xTime_ = false;
  private boolean yTime_ = false;
  private int kmax_;

  /**
   * @label attr
   */
  private ContourLineAttribute attr_ = null;
  private DefaultContourLineAttribute defaultAttr_ = null;
  private Vector conLabels_;

  /**
   * @supplierCardinality *
   * @link aggregationByValue
   */
  private ContourLabel lnkContourLabel;

  private CartesianGraph cg_;
  /**
   * Default constructor.
   */
  public ContourLine() {
    super();
    conLabels_ = new Vector();
    stroke_ = JPane.getStrokeDrawer();
  }
  /**
   * Constructor setting initial size and extend values of coordinate
   * Vector.
   */
  public ContourLine(int size, int extend) {
    super(size, extend);
    conLabels_ = new Vector();
    stroke_ = JPane.getStrokeDrawer();
  }
  /**
   * Constructor setting initial size of coordinate Vector.
   */
  public ContourLine(int size) {
    super(size);
    conLabels_ = new Vector();
    stroke_ = JPane.getStrokeDrawer();
  }
  /**
   * Set the parent CartesianGraph.  Used internally by
   * sgt.
   */
  public void setCartesianGraph(CartesianGraph cg) {
    cg_ = cg;
  }
  /**
   * Set the attributes for the contour line.
   */
  public void setAttributes(DefaultContourLineAttribute def, ContourLineAttribute attr) {
    defaultAttr_ = def;
    attr_ = attr;
  }
  /**
   * Set the ContourLineAttribute
   */
  public void setContourLineAttribute(ContourLineAttribute attr) {
    attr_ = attr;
  }

  /**
   * Get the ContourLineAttribute
   */
  public ContourLineAttribute getContourLineAttribute() {
    return attr_;
  }
  /**
   * Set the DefaultContourLineAttribute
   */
  public void setDefaultContourLineAttribute(DefaultContourLineAttribute def) {
        defaultAttr_ = def;
  }
  /**
   * Get the DefaultContourLineAttribute
   */
  public DefaultContourLineAttribute getDefaultContourLineAttribute() {
        return defaultAttr_;
  }

  void setClosed(boolean closed){
    closed_ = closed;
  }
  /**
   * Is the contour line closed?
   */
  public boolean isClosed() {
    return closed_;
  }
  /**
   * The level value of the contour line.
   */
  public double getLevel(){
    return level_;
  }

  void setLevel(double level){
    level_ = level;
  }

  void addPoint(double x, double y) {
    addElement(new Point2D.Double(x, y));
  }

  void addPoint(Point2D.Double point) {
    addElement(point);
  }

  void setKmax(int kmax) {
    kmax_ = kmax;
  }
  /**
   * Get the number of points in the contour line.
   */
  public int getKmax() {
    return kmax_;
  }

  void setTime(GeoDate tref, boolean xtime, boolean ytime) {
    timeRef_ = tref;
    xTime_ = xtime;
    yTime_ = ytime;
  }

  void setReferenceTime(GeoDate tref) {
    timeRef_ = tref;
  }
  /**
   * Get reference time for the time point of the Point2D object.
   */
  public GeoDate getReferenceTime() {
    return timeRef_;
  }

  void setXTime(boolean time) {
    xTime_ = time;
  }
  /**
   * Is the x coordinate time?
   */
  public boolean isXTime() {
    return xTime_;
  }

  void setYTime(boolean time) {
    yTime_ = time;
  }
  /**
   * Is the y coordinate time?
   */
  public boolean isYTime() {
    return yTime_;
  }

  void reverseElements(int k) {
    /* k is reversal length */
    Point2D.Double point;
    int kkr;
    int kh = 1 + k/2;
    for(int kk=1; kk < kh; kk++) {
      kkr = k+1-kk;
      point = (Point2D.Double)elementAt(kk);
      setElementAt(elementAt(kkr), kk);
      setElementAt(point, kkr);
    }
  }
  /**
   * Add a label to the contour line.
   */
  public void addLabel(int point, SGLabel lab, double hgt, double wid) {
    ContourLabel clab = new ContourLabel(point, lab, hgt, wid);
    conLabels_.addElement(clab);
  }
  /**
   * Remove all labels.
   */
  public void removeAllLabels() {
    conLabels_.removeAllElements();
  }
  /**
   * Used internally by sgt.
   */
  public void draw(Graphics g) {
    int k, kk, loc, kp1;
    double[] x = new double[kmax_+1];
    double[] y = new double[kmax_+1];
    ContourLabel clab;
    double width, hhgt;
    double dxx, dyy, space;
    double xa, xb, ya, yb, aa, bb, cc, zxy;
    double xendl, yendl, angle;
    double xlab, ylab;
    SGLabel label;
    GeoDate time;
    defaultAttr_.setContourLineAttribute(attr_);
    Color lineColor = defaultAttr_.getColor();
    //
    // convert ContourLine to physical units
    //
    x = getXArrayP();
    y = getYArrayP();
    //
    // loop through labels
    //
    k=1;
    Enumeration cenum = conLabels_.elements();
    while(cenum.hasMoreElements()) {
      clab = (ContourLabel)cenum.nextElement();
      loc = clab.getIndex();
      width = clab.getWidth();
      hhgt = clab.getHeight()*0.5;
      label = clab.getLabel();
      //
      g.setColor(lineColor);
      drawLine(g, x, y, k, loc);
      //
      k = loc;
      kp1 = k + 1;
      for(kk=kp1; kk <= kmax_; kk++) {
        dxx = x[kk] - x[k];
        dyy = y[kk] - y[k];
        space = Math.sqrt(dxx*dxx+dyy*dyy);
        if(space >= width) break;
      }
      xa = x[kk-1] - x[k];
      xb = x[kk] - x[kk-1];
      ya = y[kk-1] - y[k];
      yb = y[kk] - y[kk-1];
      aa = xb*xb + yb*yb;
      bb = xa*xb + ya*yb;
      cc = xa*xa + ya*ya - width*width;
      zxy = (-bb + Math.sqrt(bb*bb - aa*cc))/aa;
      dxx = xa + xb*zxy;
      dyy = ya + yb*zxy;
      xendl = x[k] + dxx;
      yendl = y[k] + dyy;
      //
      // compute label angle
      //
      angle = 90.0;
      if(dyy < 0.0) angle = -90.0;
      if(dxx != 0.0) {
        angle = Math.atan(dyy/dxx)*180.0/Math.PI;
      }
      //
      // compute label position
      //
      if(dxx >= 0) {
        xlab = x[k] + hhgt*(0.5*dxx + dyy)/width;
        ylab = y[k] + hhgt*(0.5*dyy - dxx)/width;
      } else {
        xlab = xendl - hhgt*(0.5*dxx + dyy)/width;
        ylab = yendl - hhgt*(0.5*dyy - dxx)/width;
      }
      label.setAngle(angle);
      label.setLocationP(new Point2D.Double(xlab, ylab));
      try {
        label.draw(g);
      } catch (LayerNotFoundException e) {
        System.out.println(e);
      }
      g.setColor(lineColor);
      drawLineSegment(g, xendl, yendl, x[kk], y[kk]);
      k=kk;
    }
    if(k < kmax_) {
      g.setColor(lineColor);
      drawLine(g, x, y, k, kmax_);
    }
  }

  private void drawLine(Graphics g, double[] x, double[] y,
                        int kstart, int kend) {
    int size = kend-kstart+1;
    int[] xp = new int[size];
    int[] yp = new int[size];
    int i, k;
    for(i=0, k=kstart; k <= kend; k++, i++) {
      xp[i] = cg_.getLayer().getXPtoD(x[k]);
      yp[i] = cg_.getLayer().getYPtoD(y[k]);
    }
    switch(defaultAttr_.getStyle()) {
    case LineAttribute.HIGHLIGHT:
      stroke_.drawHighlight(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    case LineAttribute.HEAVY:
      stroke_.drawHeavy(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    case LineAttribute.DASHED:
      stroke_.drawDashed(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    case LineAttribute.STROKE:
      stroke_.drawStroke(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    default:
    case LineAttribute.MARK:
    case LineAttribute.MARK_LINE:
    case LineAttribute.SOLID:
      g.drawPolyline(xp, yp, size);
    }
  }

  private void drawLineSegment(Graphics g, double x0, double y0,
                               double x1, double y1) {
    int[] xp, yp;
    int size = 2;
    xp = new int[2];
    yp = new int[2];
    xp[0] = cg_.getLayer().getXPtoD(x0);
    yp[0] = cg_.getLayer().getYPtoD(y0);
    xp[1] = cg_.getLayer().getXPtoD(x1);
    yp[1] = cg_.getLayer().getYPtoD(y1);
    switch(defaultAttr_.getStyle()) {
    case LineAttribute.HIGHLIGHT:
      stroke_.drawHighlight(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    case LineAttribute.HEAVY:
      stroke_.drawHeavy(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    case LineAttribute.DASHED:
      stroke_.drawDashed(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    case LineAttribute.STROKE:
      stroke_.drawStroke(g, xp, yp, size, (LineAttribute)defaultAttr_);
      break;
    default:
    case LineAttribute.MARK:
    case LineAttribute.MARK_LINE:
    case LineAttribute.SOLID:
      g.drawPolyline(xp, yp, size);
    }
  }
  /**
   * Get x physical coordinates of the contour line.
   */
  public double[] getXArrayP() {
    double[] xp = null;
    Point2D.Double pt;
    GeoDate time;
    if(cg_ != null) {
      xp = new double[kmax_+1];
      for(int k=0; k <= kmax_; k++) {
        pt = (Point2D.Double)elementAt(k);
        if(isXTime()) {
          time = (new GeoDate(timeRef_)).increment(pt.x, GeoDate.DAYS);
          xp[k] = cg_.getXUtoP(time);
        } else {
          xp[k] = cg_.getXUtoP(pt.x);
        }
      }
    }
    return xp;
  }
  /**
   * Get y physical coordinates of the contour line.
   */
  public double[] getYArrayP() {
    double[] yp = null;
    Point2D.Double pt;
    GeoDate time;
    if(cg_ != null) {
      yp = new double[kmax_+1];
      for(int k=0; k <= kmax_; k++) {
        pt = (Point2D.Double)elementAt(k);
        if(isYTime()) {
          time = (new GeoDate(timeRef_)).increment(pt.x, GeoDate.DAYS);
          yp[k] = cg_.getYUtoP(time);
        } else {
          yp[k] = cg_.getYUtoP(pt.y);
        }
      }
    }
    return yp;
  }
}


text:
// Copyright (c) Dapplo and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Dapplo.Windows.Desktop;

namespace Dapplo.Windows.Tests.Benchmarks;

[MinColumn, MaxColumn, MemoryDiagnoser]
public class EnumerateWindowsBenchmark
{
    [Benchmark, STAThread]
    public void EnumerateAll()
    {
        var result = WindowsEnumerator.EnumerateWindows().All(window => window != null);
        if (!result)
        {
            throw new ArgumentNullException();
        }
    }

    [Benchmark, STAThread]
    public async Task EnumerateAll_Async()
    {
        var result = await WindowsEnumerator.EnumerateWindowsAsync().All(window => window != null).ToTask();
        if (!result)
        {
            throw new ArgumentNullException();
        }
    }

    [Benchmark, STAThread]
    public async Task Enumerate_Take10_Async()
    {
        var result = await WindowsEnumerator.EnumerateWindowsAsync().Take(10).Count(window => window != null);
        if (result != 10)
        {
            throw new Exception($"Expected 10, actual {result}");
        }
    }

    [Benchmark, STAThread]
    public void Enumerate_Take10()
    {
        var result = WindowsEnumerator.EnumerateWindows().Take(10).Count(window => window != null);
        if (result != 10)
        {
            throw new Exception($"Expected 10, actual {result}");
        }
    }

    [Benchmark, STAThread]
    public void Enumerate_LimitFunc()
    {
        var result = WindowsEnumerator.EnumerateWindows(null, null, (window, i) => i < 10).Count(window => window != null);
        if (result != 10)
        {
            throw new Exception($"Expected 10, actual {result}");
        }
    }

    [Benchmark, STAThread]
    public async Task EnumerateHandlesAll_Select_Async()
    {
        var result = await WindowsEnumerator.EnumerateWindowHandlesAsync().Select(InteropWindowFactory.CreateFor).All(window => window != null).ToTask();
        if (!result)
        {
            throw new ArgumentNullException();
        }
    }

    [Benchmark, STAThread]
    public async Task EnumerateHandles_HandlesOnly_Async()
    {
        var result = await WindowsEnumerator.EnumerateWindowHandlesAsync().All(window => window != IntPtr.Zero).ToTask();
        if (!result)
        {
            throw new ArgumentNullException();
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;

namespace XYZShopping.Concrete
{
    public class EFDbContext : DbContext
    {
        //public DbSet<ProductModel> Products { get; set; }
    }
}


text:
<!DOCTYPE html>

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

  <title>Doesn't she just pander to the lgbt community? | Hillary Myths</title>

  <meta name="description" content="Q: doesn't she just pander to the LGBT community?">
  <link rel="shortcut icon" href="/favicon.ico">

  <link rel="manifest" href="/manifest.json">

  <meta name="theme-color" content="#0057B8">

  <meta name="mobile-web-app-capable" content="yes">
  <meta name="application-name" content="">

  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="apple-mobile-web-app-title" content="">

  <link rel="apple-touch-icon" href="/img/favicon-48.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/img/favicon-72.png">
  <link rel="apple-touch-icon" sizes="96x96" href="/img/favicon-96.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/img/favicon-144.png">
  <link rel="apple-touch-icon" sizes="192x192" href="/img/favicon-192.png">

  <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">

  <link rel="stylesheet" href="/css/main.css">

  <link rel="canonical" href="https://hillarymyths.org/issues/hillary-lgbt/">
  <link rel="alternate" type="application/rss+xml" title="I'd vote for Hillary, but... | Hillary Myths" href="https://hillarymyths.org/feed.xml" />

  <meta property="fb:app_id"        content="585977871590212" />
  <meta property="og:site_name"     content="I'd vote for Hillary, but... | Hillary Myths" />
  <meta property="og:url"           content="https://hillarymyths.org/issues/hillary-lgbt/" />
  <meta property="og:type"          content="article" />
  <meta property="og:title"         content="Doesn't she just pander to the lgbt community? | Hillary Myths" />
  <meta property="og:description"   content="Q: doesn't she just pander to the LGBT community?" />

  <meta name="twitter:title"        content="Doesn't she just pander to the lgbt community? | Hillary Myths" />
  <meta name="twitter:card"         content="Q: doesn't she just pander to the LGBT community?" />
  <meta name="twitter:description"  content="“I'd vote for Hillary, but...” is a site designed to refute myths and misconceptions about Hillary Clinton. Please pick your concern from the following list!
" />
  <meta name="twitter:url"          content="https://hillarymyths.org/issues/hillary-lgbt/" />

  <meta property="og:image"  content="https://hillarymyths.org/img/ivhb.png" />
  <meta name="twitter:image" content="https://hillarymyths.org/img/ivhb.png" />

      Myth:
      “doesn't she just pander to the LGBT community?”

doesn't she just pander to the LGBT community?

Q: doesn't she just pander to the LGBT community?

A: Not at all. Consider these facts:

Hillary supports the Equality Act, which would provide protection against discrimination based on sexual orientation and gender identity.

As Secretary of State, Hillary implemented several LGBT-friendly policies at the State Department. These policies include: modifying the equal employment opportunity policy to "explicitly protect against discriminatory treatment of employees and job applicants based on gender identity", providing equal benefits to same-sex partners of diplomats, ending the old policy that denied same-sex couples and families "the same rights and privileges" of straight diplomats, and working with USAID to create an LGBT-specific brochure to recruit applicants.

In 2011, Hillary delivered a speech in Geneva, Switzerland in recognition of International Human Rights Day. In this speech, she called for protections and recognition of the LGBT community around the world, stating "gay rights are human rights, and human rights are gay rights!"

Hillary was the first First Lady and first major party Presidential nominee to march in a Gay Pride parade.

Hillary has been endorsed by several LGBT organizations, and enjoys the wide support of the LGBT community.

Q: But she flip-flopped on same-sex marriage, right?

A: Like many people, Hillary's views on same-sex marriage have evolved over time. In 2013, Hillary released a video expressing full support for same-sex marriage "personally and as a matter of policy and law." As Matt Baume at LGBTQ Nation put it:

Hillary has changed her position over the last 40 years — which is another way of saying she's improved her position.

Check out the video for yourself:

      Pledge to Vote
      Donate

I'm still not convinced

    <form id="feedback" hidden action="https://docs.google.com/forms/d/e/1FAIpQLSf7ugj0I_HBLkIhJrrAlRYf-ddQsT8awOMYFPWKG0rERrDovQ/formResponse" class="veiled" target="feedback-target" method="POST">
      <textarea name="entry.955832435" placeholder="Tell us more..." aria-label="Tell us more"></textarea>
      <input type="hidden" name="entry.620619372" value="/issues/hillary-lgbt/">
      <button type="submit">Send</button>

    </form>

Thank you for your submission!

Tweet

      Built by DevProgress. Find out more.


text:
Articles

        {{article.name}}
        {{article.name}}

     Nothing Found

Related Components

              Name
              Type

                  {{comp.name}}

              {{getType(comp.attributes)}}

        Nothing Found


text:
<?php
namespace Concrete\Core\Http;

use Concrete\Core\Foundation\Service\Provider as ServiceProvider;
use Concrete\Core\Http\Middleware\DelegateInterface;
use Concrete\Core\Http\Middleware\MiddlewareDelegate;
use Concrete\Core\Http\Middleware\MiddlewareStack;
use Concrete\Core\Http\Middleware\StackInterface;
use Zend\Http\Client\Adapter\Curl as CurlHttpAdapter;
use Zend\Http\Client\Adapter\Proxy as SocketHttpAdapter;

class HttpServiceProvider extends ServiceProvider
{
    public function register()
    {
        $singletons = [
            'helper/ajax' => '\Concrete\Core\Http\Service\Ajax',
            'helper/json' => '\Concrete\Core\Http\Service\Json',
        ];

        foreach ($singletons as $key => $value) {
            $this->app->singleton($key, $value);
        }

        $this->app->bind('Concrete\Core\Http\Request', function ($app) {
            return Request::getInstance();
        });

        $this->app->bind(StackInterface::class, MiddlewareStack::class);
        $this->app->bind(DelegateInterface::class, MiddlewareDelegate::class);
        $this->app->bind(DispatcherInterface::class, DefaultDispatcher::class);
        $this->app->singleton(ServerInterface::class, function ($app) {
            $server = $app->build(DefaultServer::class);

            $config = $app['config'];
            foreach ($config->get('app.middleware') as $middleware) {
                if (is_array($middleware)) {
                    $server->addMiddleware($app->make($middleware['class']), $middleware['priority']);
                } else {
                    $server->addMiddleware($app->make($middleware));
                }
            }

            return $server;
        });

        // Response Factory
        $this->app->bind(ResponseFactoryInterface::class, ResponseFactory::class);

        // HTTP Client
        $this->app->singleton(Client\Factory::class);

        $this->app->bind(Client\Client::class, function ($app) {
            $factory = $app->make(Client\Factory::class);

            return $factory->createFromConfig($app->make('config'));
        });
        $this->app->alias(Client\Client::class, 'http/client');

        $this->app->bind('http/client/curl', function ($app) {
            $factory = $app->make(Client\Factory::class);

            return $factory->createFromConfig($app->make('config'), CurlHttpAdapter::class);
        });

        $this->app->bind('http/client/socket', function ($app) {
            $factory = $app->make(Client\Factory::class);

            return $factory->createFromConfig($app->make('config'), SocketHttpAdapter::class);
        });
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!-- invalid because the tumor contains an unknown data item -->

<NaaccrData baseDictionaryUri="http://naaccr.org/naaccrxml/naaccr-dictionary-210.xml" userDictionaryUri="whatever" recordType="A" specificationVersion="1.4" timeGenerated="2015-03-13T12:09:19.0Z" xmlns="http://naaccr.org/naaccrxml">
    <Item naaccrId="registryId">0000000001</Item>
    <Patient>
        <Item naaccrId="patientIdNumber">00000001</Item>
        <Tumor>
            <Item naaccrId="unknown">XXX</Item>
        </Tumor>
    </Patient>
</NaaccrData>


text:
/* The original from which this derives bore the following: */

/*

   Derby - Class org.apache.derby.impl.sql.compile.TableElementList

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to you under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

 */

package com.akiban.sql.parser;

/**
 * A TableElementList represents the list of columns and other table elements
 * such as constraints in a CREATE TABLE or ALTER TABLE statement.
 *
 */

public class TableElementList extends QueryTreeNodeList<TableElementNode>
{
    /**
     * Add a TableElementNode to this TableElementList
     *
     * @param tableElement The TableElementNode to add to this list
     */

    public void addTableElement(TableElementNode tableElement) {
        add(tableElement);
    }

}


text:
package a.org.fakereplace.integration.wildfly.hibernate5.basic.addentity;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * @author Stuart Douglas
 */
@Stateless
public class EmployeeEjb1 implements RemoteEmployee {

    @PersistenceContext
    private EntityManager entityManager;

    public void saveEntity(int id) {
        final Employee1 employee = new Employee1();
        employee.setId(id);
        employee.setName("name");
        employee.setAddress("address");

        AddedEntity added = new AddedEntity();
        added.setId(id);
        added.setName("ADDED");
        employee.setAddedEntity(added);
        entityManager.persist(employee);
    }

    @Override
    public String getEntityDesc(final int id) {
        return entityManager.find(Employee.class, id).toString();
    }
}


text:
package org.smartpony.provider.kinesis.actor

import akka.actor.SupervisorStrategy.{Restart, Stop}
import akka.actor._
import akka.routing.RoundRobinPool
import com.amazonaws.auth.{AWSCredentialsProvider, DefaultAWSCredentialsProviderChain}
import com.amazonaws.regions.{Region, RegionUtils}
import com.amazonaws.services.kinesis.{AmazonKinesis, AmazonKinesisClient}
import com.amazonaws.{AmazonClientException, ClientConfiguration}
import org.smartpony.common.message.Event
import org.smartpony.core.actor.EventFilteredActor
import org.smartpony.core.config.{ProviderConfig, ProviderConfigExtension}
import org.smartpony.provider.kinesis.actor.KinesisStream.{KinesisStreamPut, AwsClientError, ThroughPutExceeded}

import scala.concurrent.duration._
import scala.language.postfixOps

class KinesisProvider(override val providerName: String) extends EventFilteredActor {

  private var kinesisClient: Option[AmazonKinesis] = None
  private var workerPool: Option[ActorRef] = None
  private var errorMessage: Option[String] = None
  private var streamName: Option[String] = None
  private var sendDelay: Option[FiniteDuration] = None
  private val maxAttemptsPerMessage = 3

  //This strategy is applied to router failures. Kill the current pool and re-create a new one with a clean client instance.
  override val supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 3, withinTimeRange = 1 minute) {
    case _: Exception =>
      initWorkers(3)
      Stop
  }

  override def handle: Receive = {
    case e @ Event(_, _, _) => send(e, 1)
    case Terminated(r) => initWorkers(2) //The router will stop itself if all it routees have terminated so re-start.
    case ThroughPutExceeded(event, failedStream, attempt) =>
      log.error(String.format(s"Throughput exceeded for Kinesis stream $failedStream. Re-trying send."))
      retry(event, attempt, 2 seconds)
    case AwsClientError(event, failedStream, ex, attempt) =>
      log.error(String.format(s"Kinesis client error for stream $failedStream ${ex.getMessage}. Re-trying send."))
      retry(event, attempt, 6 seconds)
  }

  private def retry(event: Event, attempt: Int, delay: FiniteDuration): Unit = {
    setDelay(delay)
    if (canRetry(attempt)) send(event, attempt + 1)
    else log.error(s"Gave up after $attempt attempts to deliver: " + event)  //TODO: consider persisting failed events if they are marked as 'reliable'
  }

  private def setDelay(delay: FiniteDuration) = {
    if (delay.toSeconds > 0 ) sendDelay = Some(delay)
    else sendDelay = None
  }

  private def canRetry(attempts: Int): Boolean = attempts < maxAttemptsPerMessage

  private def send(e: Event, attempt: Int): Unit = {
    kinesisClient.fold(reportConfigError(e)){ client =>
      workerPool.fold(reportPoolError(e)){ w =>
        streamName.fold(reportConfigError(e)){str =>
          sendDelay.fold(w ! KinesisStreamPut(e, client, str, attempt)) { delay =>
            log.debug(s"Attempt $attempt to send message: " + e)
            val from = self
            context.system.scheduler.
              scheduleOnce(delay, w, KinesisStreamPut(e, client, str, attempt))(context.system.dispatcher, from)
            setDelay((sendDelay.get.toSeconds / 2) seconds)
          }
        }
      }
    }
  }

  override def preStart() = initWorkers(1)

  private def initWorkers(source: Int): Unit = {
    log.info(s"Initialising workers for $providerName ($source)")
    initClient()
    initWorkerPool()
  }

  /**
   * Create the actual stream workers
   */
  private def initWorkerPool() = {
    //TODO: Expose the worker pool size in INternal config - if it's a general concept across providers.
    val routerStrategy = OneForOneStrategy() { case _: Exception => Restart }
    val router = context.actorOf(RoundRobinPool(5, supervisorStrategy = routerStrategy).props(routeeProps = Props[KinesisStream]))
    context.watch(router)
    workerPool = Some(router)
  }

  /**
   * Creates the Kinesis client used by worker actors to send messages to the configured Kinesis stream.
   * Once configured, the AmazonKinesisClient is thread safe.
   */
  private def initClient(): Unit = {

    val config = readKeys()

    reportErrors(config)

    kinesisClient = config.right.map { case (region, _, credentialsProvider) =>
      val configuration = new ClientConfiguration
      configuration.setMaxErrorRetry(0) //Control all re-trying through the actors
      val client: AmazonKinesis = new AmazonKinesisClient(credentialsProvider, configuration)
      client.setRegion(region)
      client
    }.right.toOption

    streamName = config.right.map{ case (_, stream, _) =>  stream}.right.toOption

  }

  private def reportErrors(cfg: Either[String, _]) = {
    errorMessage = cfg.left.toOption
    errorMessage.foreach(log.error)
  }

  private def readKeys() = {
    //TODO: Cause the configuration to be re-loaded and the actor re-configured when the cached config times out.
    val cfg = ProviderConfigExtension(context.system).configFor(providerName)
    for {
      region <- loadRegion(cfg).right
      stream <- loadStreamName(cfg).right
      provider <- createAwsCredentialsProvider().right
    } yield (region, stream, provider)
  }

  //TODO: consider persisting failed events if they are marked as 'reliable'
  private def reportConfigError(e: Event) = log.error("Dropping message because of previous config error: " + errorMessage + " " + e)
  private def reportPoolError(e: Event) = log.error("Dropping message because of empty pool: " + errorMessage.getOrElse("") + " " + e)

  private def loadRegion(pc: ProviderConfig): Either[String, Region] = {
    val regionKey = "region"
    lazy val configError: Either[String, Region] = Left(s"No valid region name found for key $regionKey in the " +
                                                          s"config for provider $providerName")
    pc.valueFor(regionKey).fold(configError) { regionName =>
      Option(RegionUtils.getRegion(regionName)).fold(configError)(Right.apply)
    }
  }

  private def loadStreamName(pc: ProviderConfig): Either[String, String] = {
    val streamKey = "stream"
    lazy val configError: Either[String, String] = Left(s"No valid stream name found for key $streamKey in the " +
                                                          s"config for provider $providerName")
    pc.valueFor(streamKey).fold(configError)(Right.apply)
  }

  private def createAwsCredentialsProvider(): Either[String, AWSCredentialsProvider] = {
    try {
      val credentialsProvider: AWSCredentialsProvider = new DefaultAWSCredentialsProviderChain
      credentialsProvider.getCredentials //Preempt any credentials load errors (the successful provider will be cached internally so no overhead).
      Right(credentialsProvider)
    } catch {
      case x: AmazonClientException => Left(x.getMessage)
    }
  }
}


text:
var Counter, debug,
  __hasProp = {}.hasOwnProperty,
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

debug = require("debug")("prometheus-client:gauge");

module.exports = Counter = (function(_super) {
  __extends(Counter, _super);

  function Counter(opts) {
    debug("Creating new gauge", opts);
    Counter.__super__.constructor.call(this, opts);
    this._value = 0;
    debug("New gauge's full name is " + this._full_name);
  }

  Counter.prototype.type = function() {
    return "gauge";
  };

  Counter.prototype["default"] = function() {
    return 0;
  };

  Counter.prototype.set = function(labels, value) {
    var label_hash;
    if (labels == null) {
      labels = {};
    }
    if (value == null) {
      value = null;
    }
    label_hash = this.label_hash_for(labels);
    return this._values[label_hash] = value;
  };

  return Counter;

})(require("./base_metric"));

//# sourceMappingURL=gauge.js.map


text:
namespace Liquid.NET.Symbols
{
    /// <summary>
    /// The root node in an AST document
    /// </summary>
    public class RootDocumentNode : IASTNode
    {
        public void Accept(IASTVisitor visitor)
        {
            visitor.Visit(this);
        }
    }
}


text:
namespace IoerContentBusinessEntities
{
    using System;
    using System.Collections.Generic;

    public partial class Codes_ResourceFormat
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public Nullable<bool> IsIsleCode { get; set; }
        public Nullable<bool> IsActive { get; set; }
        public Nullable<int> WarehouseTotal { get; set; }
        public string OrigTitle { get; set; }
    }
}


text:
layout: page
title: Roy Software Seminar
date: 2016-05-24
author: Philip Cooper
tags: weekly links, java
status: published
summary: Curabitur volutpat vehicula ipsum, et laoreet lacus elementum sit.
banner: images/banner/wedding.jpg
booking:
  startDate: 06/08/2016
  endDate: 06/10/2016
  ctyhocn: QUIFLHX
  groupCode: RSS
published: true
---
Curabitur ut velit non diam rhoncus ornare. Mauris vulputate pretium pulvinar. Donec scelerisque non odio et convallis. Nam luctus aliquam rutrum. Nunc venenatis hendrerit est, elementum efficitur elit volutpat at. Curabitur mi libero, gravida eu dolor vel, pharetra feugiat purus. Suspendisse malesuada ullamcorper mi vitae tempor.

1 Nunc efficitur neque molestie, dapibus quam vulputate, auctor augue
1 Aliquam quis ipsum pulvinar, cursus elit eget, ultricies nisi
1 Pellentesque at massa eu sapien finibus mattis
1 Ut blandit libero vel nunc ullamcorper porttitor.

Suspendisse augue risus, posuere vitae mauris nec, gravida lacinia orci. Etiam ac placerat nulla. Mauris laoreet congue nisi vel mollis. Mauris consectetur sed eros vel euismod. Proin feugiat ornare lorem nec eleifend. In ac rutrum tellus. Curabitur faucibus velit at imperdiet pellentesque.


text:
using System;

namespace ShipStationAccess.V2.Exceptions
{
	public class ShipStationUnrecoverableException : Exception
	{
		public ShipStationUnrecoverableException() { }
		public ShipStationUnrecoverableException( string message ) : base( message ) { }
		public ShipStationUnrecoverableException( string message, Exception innerException ) : base( message, innerException) { }
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>Python: class Engine</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

larv.Engine = class Engine(builtins.object)

<tt>   </tt>
<tt>The engine is the glue that puts everything together.

It holds:

    - an instance of a systems list (PriorityList): self.systems

    - an instance of an entity manager:  self.entity_manager

    - an instance of a group manager:    self.group_manager

    - an instance of an entity_factory:  self.entity_factory

When updating the game, one should only do a Engine.update()

call, as the Engine will be responsable for updating every

single system in the right order (given that we insert

the systems in the right priority).
 </tt>

Methods defined here:

__init__(self, entity_factory)

addSystem(self, system, priority)

<tt>Adds the given system to the priority list using the given priority and

also binds the managers and the factory to it.

Priority works as the lower priority value will update first.

@system: instance of larv.System.System

@priority: value used for deciding systems updating order.</tt>

changeSystemPriority(self, system, priority)

<tt>Changes the given system's priority when updating.

@system: larv.System.System instance.

@priority: value used for deciding systems updating order.</tt>

delete(self)

<tt>Empties the Engine, setting every container to None.</tt>

removeSystem(self, system)

<tt>Removes the given system of the priority list.</tt>

update(self)

<tt>Iterates over every System and calls their update method.</tt>

Data descriptors defined here:

__dict__

<tt>dictionary for instance variables (if defined)</tt>

__weakref__

<tt>list of weak references to the object (if defined)</tt>


text:
namespace NuPattern.VisualStudio.Solution.Templates
{
    /// <summary>
    /// Custom template parameter
    /// </summary>
    public interface IVsTemplateCustomParameter
    {
        /// <summary>
        /// Gets the name of the parameter
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Gets the value of thee parameter
        /// </summary>
        string Value { get; }
    }
}


text:
module Hyrax
  module Actors
    ##
    # When adding member {FileSetBehavior}s to a {WorkBehavior}, {Hyrax} saves
    # and reloads the work for each new member FileSet. This can significantly
    # slow down ingest for Works with many member FileSets. The saving and
    # reloading happens in {FileSetActor#attach_to_work}.
    #
    # This is a 'swappable' alternative approach. It will be of most value to
    # Hyrax applications dealing with works with many filesets. Anecdotally, a
    # 600 FileSet work can be processed in ~15 mins versus >3 hours with the
    # standard approach.
    #
    # The tradeoff is that the ordered members are now added in a single step
    # after the creation of all the FileSets, thus introducing a slight risk of
    # orphan filesets if the upload fails before the addition of the ordered members.
    # This has not been observed in practice.
    #
    # Swapping out the actors can be achieved thus:
    #
    # In +config/initializers/hyrax.rb+:
    #
    #   Hyrax::CurationConcern.actor_factory.swap(Hyrax::Actors::CreateWithFilesActor,
    #     Hyrax::Actors::CreateWithFilesOrderedMembersActor)
    #
    # Alternatively, in +config/application.rb+:
    #
    #   config.to_prepare
    #     Hyrax::CurationConcern.actor_factory.swap(Hyrax::Actors::CreateWithFilesActor,
    #       Hyrax::Actors::CreateWithFilesOrderedMembersActor)
    #   end
    #
    # Creates a work and attaches files to the work
    class CreateWithFilesOrderedMembersActor < CreateWithFilesActor
      # @return [TrueClass]
      def attach_files(files, curation_concern, attributes)
        return true if files.blank?

        AttachFilesToWorkWithOrderedMembersJob
          .perform_later(curation_concern, files, attributes.to_h.symbolize_keys)
        true
      end
    end
  end
end


text:
<?php
/**
 *
 * Part of the QCubed PHP framework.
 *
 * @license MIT
 *
 */

namespace QCubed\Jqui\Action;

use QCubed\Control\ControlBase;

/**
 * Class Toggle
 *
 * Toggle visibility of a control, using additional visual effects
 *
 * @package QCubed\Jqui\Action
 * @was QJQToggleAction
 */
class Toggle extends ActionBase
{
    /**
     * Toggle constructor.
     * @param ControlBase $objControl
     * @param string $strMethod
     */
    public function __construct(ControlBase $objControl, $strMethod = "slow")
    {
        parent::__construct($objControl, $strMethod);
    }

    /**
     * @param ControlBase $objControl
     * @return string
     */
    public function renderScript(ControlBase $objControl)
    {
        return sprintf('$j("#%s").toggle("%s");', $this->strControlId, $this->strMethod);
    }
}


text:
package com.devnatres.dashproject.agentsystem;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.devnatres.dashproject.dnagdx.DnaAnimation;
import com.devnatres.dashproject.gameconstants.Time;
import com.devnatres.dashproject.space.Volume;

/**
 * An agent is a basic independent entity in the game.

 * It needs an animation. If a texture is passed it's created an one-frame animation.

 *

 * Areas involved:

 *

 * - Graphic area

 *   Actor's getWidth(), getHeight(), getX(), getY().
  *

 * - Volume area

 *   Agent's getCenter(), getVolumeRectangle(), etc.
 *

 * This implementation create both areas as the same from the first frame of the original animation.
 * Graphic area can be modified but physic area remains the same and centered on the graphic area.
 *

 * Created by DevNatres on 04/12/2014.
 */
public class Agent extends Actor {

    private static final float DEFAULT_FRAME_DURATION = 1f;
    private static final float DEFAULT_PARENT_ALPHA = 1f;
    private static final float DEFAULT_SPEED = 1f;

    private final Volume volume;
    private DnaAnimation animation;
    private float speed;

    /**
     * "visible" means "visible by the system", i.e., for act() and draw() methods.
     * "displayable" is considered only by the draw() method.
     */
    private boolean displayable = true;

    public Agent(DnaAnimation animation) {
        TextureRegion textureRegion = animation.getKeyFrame(0);

        volume = new Volume(0f, 0f, textureRegion.getRegionWidth(), textureRegion.getRegionHeight());

        this.animation = animation;
        setSize(textureRegion.getRegionWidth(), textureRegion.getRegionHeight());
        setPosition(0f, 0f);

        speed = DEFAULT_SPEED;
    }

    public Agent(Texture texture) {
        this(new DnaAnimation(DEFAULT_FRAME_DURATION, new TextureRegion(texture)));
    }

    public void setCenter(float x, float y) {
        setPosition(x - getWidth() / 2, y - getHeight() / 2);
    }

    public void setCenter(Vector2 center) {
        setCenter(center.x, center.y);
    }

    @Override
    public void positionChanged() {
        volume.setCenter(getX() + getWidth() / 2, getY() + getHeight() / 2);
    }

    public Vector2 getVolumePosition() {
        return volume.getPosition();
    }

    public void setAnimation(DnaAnimation animation) {
        if (animation != null) {
            this.animation = animation;

            TextureRegion textureRegion = animation.getKeyFrame(0);
            setSize(textureRegion.getRegionWidth(), textureRegion.getRegionHeight());
            setCenter(getCenter());

            animation.resetAnimation();
        }
    }

    public DnaAnimation getAnimation() {
        return animation;
    }

    @Override
    public void act(float delta) {
        if (isVisible()) {
            animation.updateStateTime();
            super.act(delta);
        }
    }

    @Override
    public void draw(Batch batch, float parentAlpha) {
        if (isVisible() && displayable) {
            batch.draw(animation.getCurrentKeyFrame(), getX(), getY());
        }
    }

    public void draw(Batch batch) {
        draw(batch, DEFAULT_PARENT_ALPHA);
    }

    public void render(Batch batch) {
        act(Time.FPS_TIME);
        draw(batch);
    }

    public float getSpeed() {
        return speed;
    }

    public Vector2 getCenter() {
        return volume.getCenter();
    }

    public float getCenterX() {
        return volume.getCenterX();
    }

    public float getCenterY() {
        return volume.getCenterY();
    }

    public Vector2 getPosition() {
        return volume.getPosition();
    }

    public float getVolumeX() {
        return volume.getX();
    }

    public float getVolumeY() {
        return volume.getY();
    }

    public float getVolumeWidth() {
        return volume.getWidth();
    }

    public float getVolumeHeight() {
        return volume.getHeight();
    }

    public Rectangle getVolumeRectangle() {
        return volume.getRectangle();
    }

    public void setDisplayable(boolean displayable) {
        this.displayable = displayable;
    }

}