text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Product\Model;

use Doctrine\Common\Collections\Collection;
use Sylius\Component\Attribute\Model\AttributeSubjectInterface;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Model\SlugAwareInterface;
use Sylius\Component\Resource\Model\TimestampableInterface;
use Sylius\Component\Resource\Model\ToggleableInterface;
use Sylius\Component\Resource\Model\TranslatableInterface;

/**
 * @author Paweł Jędrzejewski <pawel@sylius.org>
 * @author Gonzalo Vilaseca <gvilaseca@reiss.co.uk>
 */
interface ProductInterface extends
    AttributeSubjectInterface,
    CodeAwareInterface,
    ResourceInterface,
    SlugAwareInterface,
    TimestampableInterface,
    ToggleableInterface,
    TranslatableInterface
{
    /**
     * @return string|null
     */
    public function getName(): ?string;

    /**
     * @param string|null $name
     */
    public function setName(?string $name): void;

    /**
     * @return string|null
     */
    public function getDescription(): ?string;

    /**
     * @param string|null $description
     */
    public function setDescription(?string $description): void;

    /**
     * @return string|null
     */
    public function getMetaKeywords(): ?string;

    /**
     * @param string|null $metaKeywords
     */
    public function setMetaKeywords(?string $metaKeywords): void;

    /**
     * @return string|null
     */
    public function getMetaDescription(): ?string;

    /**
     * @param string|null $metaDescription
     */
    public function setMetaDescription(?string $metaDescription): void;

    /**
     * @return bool
     */
    public function hasVariants(): bool;

    /**
     * @return Collection|ProductVariantInterface[]
     */
    public function getVariants(): Collection;

    /**
     * @param ProductVariantInterface $variant
     */
    public function addVariant(ProductVariantInterface $variant): void;

    /**
     * @param ProductVariantInterface $variant
     */
    public function removeVariant(ProductVariantInterface $variant): void;

    /**
     * @param ProductVariantInterface $variant
     *
     * @return bool
     */
    public function hasVariant(ProductVariantInterface $variant): bool;

    /**
     * @return bool
     */
    public function hasOptions(): bool;

    /**
     * @return Collection|ProductOptionInterface[]
     */
    public function getOptions(): Collection;

    /**
     * @param ProductOptionInterface $option
     */
    public function addOption(ProductOptionInterface $option): void;

    /**
     * @param ProductOptionInterface $option
     */
    public function removeOption(ProductOptionInterface $option): void;

    /**
     * @param ProductOptionInterface $option
     *
     * @return bool
     */
    public function hasOption(ProductOptionInterface $option): bool;

    /**
     * @return Collection|ProductAssociationInterface[]
     */
    public function getAssociations(): Collection;

    /**
     * @param ProductAssociationInterface $association
     */
    public function addAssociation(ProductAssociationInterface $association): void;

    /**
     * @param ProductAssociationInterface $association
     */
    public function removeAssociation(ProductAssociationInterface $association): void;

    /**
     * @return bool
     */
    public function isSimple(): bool;

    /**
     * @return bool
     */
    public function isConfigurable(): bool;
}


text:
// Libraries
#include <iostream>
#include "ContactManifold.h"

using namespace reactphysics3d;

// Constructor
ContactManifold::ContactManifold(ProxyShape* shape1, ProxyShape* shape2,
                                 MemoryAllocator& memoryAllocator, short normalDirectionId)
                : mShape1(shape1), mShape2(shape2), mNormalDirectionId(normalDirectionId),
                  mNbContactPoints(0), mFrictionImpulse1(0.0), mFrictionImpulse2(0.0),
                  mFrictionTwistImpulse(0.0), mIsAlreadyInIsland(false),
                  mMemoryAllocator(memoryAllocator) {

}

// Destructor
ContactManifold::~ContactManifold() {
    clear();
}

// Add a contact point in the manifold
void ContactManifold::addContactPoint(ContactPoint* contact) {

    // For contact already in the manifold
    for (uint i=0; i<mNbContactPoints; i++) {

		// Check if the new point point does not correspond to a same contact point
        // already in the manifold.
        decimal distance = (mContactPoints[i]->getWorldPointOnBody1() -
                            contact->getWorldPointOnBody1()).lengthSquare();
        if (distance <= PERSISTENT_CONTACT_DIST_THRESHOLD*PERSISTENT_CONTACT_DIST_THRESHOLD) {

            // Delete the new contact
            contact->~ContactPoint();
            mMemoryAllocator.release(contact, sizeof(ContactPoint));

            assert(mNbContactPoints > 0);

            return;
		}
	}

    // If the contact manifold is full
    if (mNbContactPoints == MAX_CONTACT_POINTS_IN_MANIFOLD) {
        int indexMaxPenetration = getIndexOfDeepestPenetration(contact);
        int indexToRemove = getIndexToRemove(indexMaxPenetration, contact->getLocalPointOnBody1());
        removeContactPoint(indexToRemove);
    }

    // Add the new contact point in the manifold
    mContactPoints[mNbContactPoints] = contact;
    mNbContactPoints++;

    assert(mNbContactPoints > 0);
}

// Remove a contact point from the manifold
void ContactManifold::removeContactPoint(uint index) {
    assert(index < mNbContactPoints);
    assert(mNbContactPoints > 0);

    // Call the destructor explicitly and tell the memory allocator that
	// the corresponding memory block is now free
    mContactPoints[index]->~ContactPoint();
    mMemoryAllocator.release(mContactPoints[index], sizeof(ContactPoint));

    // If we don't remove the last index
    if (index < mNbContactPoints - 1) {
        mContactPoints[index] = mContactPoints[mNbContactPoints - 1];
    }

    mNbContactPoints--;
}

// Update the contact manifold
/// First the world space coordinates of the current contacts in the manifold are recomputed from
/// the corresponding transforms of the bodies because they have moved. Then we remove the contacts
/// with a negative penetration depth (meaning that the bodies are not penetrating anymore) and also
/// the contacts with a too large distance between the contact points in the plane orthogonal to the
/// contact normal.
void ContactManifold::update(const Transform& transform1, const Transform& transform2) {

    if (mNbContactPoints == 0) return;

    // Update the world coordinates and penetration depth of the contact points in the manifold
    for (uint i=0; i<mNbContactPoints; i++) {
        mContactPoints[i]->setWorldPointOnBody1(transform1 *
                                                mContactPoints[i]->getLocalPointOnBody1());
        mContactPoints[i]->setWorldPointOnBody2(transform2 *
                                                mContactPoints[i]->getLocalPointOnBody2());
        mContactPoints[i]->setPenetrationDepth((mContactPoints[i]->getWorldPointOnBody1() -
                  mContactPoints[i]->getWorldPointOnBody2()).dot(mContactPoints[i]->getNormal()));
    }

    const decimal squarePersistentContactThreshold = PERSISTENT_CONTACT_DIST_THRESHOLD *
                                                     PERSISTENT_CONTACT_DIST_THRESHOLD;

    // Remove the contact points that don't represent very well the contact manifold
    for (int i=static_cast<int>(mNbContactPoints)-1; i>=0; i--) {
        assert(i < static_cast<int>(mNbContactPoints));

        // Compute the distance between contact points in the normal direction
        decimal distanceNormal = -mContactPoints[i]->getPenetrationDepth();

        // If the contacts points are too far from each other in the normal direction
        if (distanceNormal > squarePersistentContactThreshold) {
            removeContactPoint(i);
        }
        else {
            // Compute the distance of the two contact points in the plane
            // orthogonal to the contact normal
            Vector3 projOfPoint1 = mContactPoints[i]->getWorldPointOnBody1() +
                                   mContactPoints[i]->getNormal() * distanceNormal;
            Vector3 projDifference = mContactPoints[i]->getWorldPointOnBody2() - projOfPoint1;

            // If the orthogonal distance is larger than the valid distance
            // threshold, we remove the contact
            if (projDifference.lengthSquare() > squarePersistentContactThreshold) {
                removeContactPoint(i);
            }
        }
    }
}

// Return the index of the contact point with the larger penetration depth.
/// This corresponding contact will be kept in the cache. The method returns -1 is
/// the new contact is the deepest.
int ContactManifold::getIndexOfDeepestPenetration(ContactPoint* newContact) const {
    assert(mNbContactPoints == MAX_CONTACT_POINTS_IN_MANIFOLD);
    int indexMaxPenetrationDepth = -1;
    decimal maxPenetrationDepth = newContact->getPenetrationDepth();

    // For each contact in the cache
    for (uint i=0; i<mNbContactPoints; i++) {

        // If the current contact has a larger penetration depth
        if (mContactPoints[i]->getPenetrationDepth() > maxPenetrationDepth) {
            maxPenetrationDepth = mContactPoints[i]->getPenetrationDepth();
            indexMaxPenetrationDepth = i;
        }
    }

    // Return the index of largest penetration depth
    return indexMaxPenetrationDepth;
}

// Return the index that will be removed.
/// The index of the contact point with the larger penetration
/// depth is given as a parameter. This contact won't be removed. Given this contact, we compute
/// the different area and we want to keep the contacts with the largest area. The new point is also
/// kept. In order to compute the area of a quadrilateral, we use the formula :
/// Area = 0.5 * | AC x BD | where AC and BD form the diagonals of the quadrilateral. Note that
/// when we compute this area, we do not calculate it exactly but we
/// only estimate it because we do not compute the actual diagonals of the quadrialteral. Therefore,
/// this is only a guess that is faster to compute. This idea comes from the Bullet Physics library
/// by Erwin Coumans (http://wwww.bulletphysics.org).
int ContactManifold::getIndexToRemove(int indexMaxPenetration, const Vector3& newPoint) const {

    assert(mNbContactPoints == MAX_CONTACT_POINTS_IN_MANIFOLD);

    decimal area0 = 0.0;       // Area with contact 1,2,3 and newPoint
    decimal area1 = 0.0;       // Area with contact 0,2,3 and newPoint
    decimal area2 = 0.0;       // Area with contact 0,1,3 and newPoint
    decimal area3 = 0.0;       // Area with contact 0,1,2 and newPoint

    if (indexMaxPenetration != 0) {
        // Compute the area
        Vector3 vector1 = newPoint - mContactPoints[1]->getLocalPointOnBody1();
        Vector3 vector2 = mContactPoints[3]->getLocalPointOnBody1() -
                          mContactPoints[2]->getLocalPointOnBody1();
        Vector3 crossProduct = vector1.cross(vector2);
        area0 = crossProduct.lengthSquare();
    }
    if (indexMaxPenetration != 1) {
        // Compute the area
        Vector3 vector1 = newPoint - mContactPoints[0]->getLocalPointOnBody1();
        Vector3 vector2 = mContactPoints[3]->getLocalPointOnBody1() -
                          mContactPoints[2]->getLocalPointOnBody1();
        Vector3 crossProduct = vector1.cross(vector2);
        area1 = crossProduct.lengthSquare();
    }
    if (indexMaxPenetration != 2) {
        // Compute the area
        Vector3 vector1 = newPoint - mContactPoints[0]->getLocalPointOnBody1();
        Vector3 vector2 = mContactPoints[3]->getLocalPointOnBody1() -
                          mContactPoints[1]->getLocalPointOnBody1();
        Vector3 crossProduct = vector1.cross(vector2);
        area2 = crossProduct.lengthSquare();
    }
    if (indexMaxPenetration != 3) {
        // Compute the area
        Vector3 vector1 = newPoint - mContactPoints[0]->getLocalPointOnBody1();
        Vector3 vector2 = mContactPoints[2]->getLocalPointOnBody1() -
                          mContactPoints[1]->getLocalPointOnBody1();
        Vector3 crossProduct = vector1.cross(vector2);
        area3 = crossProduct.lengthSquare();
    }

    // Return the index of the contact to remove
    return getMaxArea(area0, area1, area2, area3);
}

// Return the index of maximum area
int ContactManifold::getMaxArea(decimal area0, decimal area1, decimal area2, decimal area3) const {
    if (area0 < area1) {
        if (area1 < area2) {
            if (area2 < area3) return 3;
            else return 2;
        }
        else {
            if (area1 < area3) return 3;
            else return 1;
        }
    }
    else {
        if (area0 < area2) {
            if (area2 < area3) return 3;
            else return 2;
        }
        else {
            if (area0 < area3) return 3;
            else return 0;
        }
    }
}

// Clear the contact manifold
void ContactManifold::clear() {
    for (uint i=0; i<mNbContactPoints; i++) {

        // Call the destructor explicitly and tell the memory allocator that
		// the corresponding memory block is now free
        mContactPoints[i]->~ContactPoint();
        mMemoryAllocator.release(mContactPoints[i], sizeof(ContactPoint));
    }
    mNbContactPoints = 0;
}

redpajama_set_name: RedPajamaGithub


text:
@interface iBStaticsViewController : UIViewController

@end


text:
import copy

from django.forms import ModelForm
from django import forms

from crispy_forms.layout import Layout, HTML, Fieldset
from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import Field

from hs_core.forms import BaseFormHelper, MetaDataElementDeleteForm, Helper, get_crispy_form_fields
from hs_app_netCDF.models import Variable

# Define form for original coverage
class OriginalCoverageFormHelper(BaseFormHelper):
    def __init__(self, allow_edit=True, res_short_id=None, element_id=None, element_name=None,
                 *args, **kwargs):

        # The layout below orders how each filed from the Form will be displayed in the frontend
        file_type = kwargs.pop('file_type', False)
        form_field_names = ['projection', 'datum', 'projection_string_type',
                            'projection_string_text', 'units', 'northlimit', 'eastlimit',
                            'southlimit', 'westlimit']
        crispy_form_fields = get_crispy_form_fields(form_field_names, file_type=file_type)
        layout = Layout(*crispy_form_fields)

        super(OriginalCoverageFormHelper, self).__init__(allow_edit, res_short_id, element_id,
                                                         element_name, layout,
                                                         element_name_label='Spatial Reference',
                                                         *args, **kwargs)

class OriginalCoverageForm(forms.Form):
    PRO_STR_TYPES = (
        ('', '---------'),
        ('WKT String', 'WKT String'),
        ('Proj4 String', 'Proj4 String')
    )

    projection = forms.CharField(max_length=100, required=False,
                                 label='Coordinate Reference System')
    northlimit = forms.DecimalField(label='North Extent', widget=forms.TextInput())
    eastlimit = forms.DecimalField(label='East Extent', widget=forms.TextInput())
    southlimit = forms.DecimalField(label='South Extent', widget=forms.TextInput())
    westlimit = forms.DecimalField(label='West Extent', widget=forms.TextInput())
    units = forms.CharField(max_length=100, label='Extent Unit')
    projection_string_type = forms.ChoiceField(choices=PRO_STR_TYPES,
                                               label='Coordinate String Type', required=False)
    projection_string_text = forms.CharField(max_length=1000, label='Coordinate String',
                                             required=False, widget=forms.Textarea())
    datum = forms.CharField(max_length=300, label='Datum', required=False, widget=forms.TextInput())

    def __init__(self, allow_edit=True, res_short_id=None, element_id=None, *args, **kwargs):
        file_type = kwargs.pop('file_type', False)
        super(OriginalCoverageForm, self).__init__(*args, **kwargs)
        self.helper = OriginalCoverageFormHelper(allow_edit, res_short_id, element_id,
                                                 element_name='originalcoverage',
                                                 file_type=file_type)
        self.delete_modal_form = None
        self.number = 0
        self.allow_edit = allow_edit
        self.fields['projection'].widget.attrs['readonly'] = True
        self.fields['datum'].widget.attrs['readonly'] = True
        self.fields['projection_string_type'].widget.attrs['readonly'] = True
        self.fields['projection_string_text'].widget.attrs['readonly'] = True

    @property
    def form_id(self):
        form_id = 'id_original_coverage_%s' % self.number
        return form_id

    @property
    def form_id_button(self):
        form_id = 'id_original_coverage_%s' % self.number
        return "'" + form_id + "'"

    def clean(self):
        super(OriginalCoverageForm, self).clean()
        temp_cleaned_data = copy.deepcopy(self.cleaned_data)
        is_form_errors = False

        # check required element info
        for key in ('northlimit', 'eastlimit', 'southlimit', 'westlimit', 'units'):
            value = temp_cleaned_data.get(key, None)
            if not value:
                self._errors[key] = ["Info for %s is missing" % key]
                is_form_errors = True
                del self.cleaned_data[key]

        if is_form_errors:
            return self.cleaned_data

        # if required elements info is provided then write the bounding box info
        # as 'value' dict and assign to self.clean_data
        temp_cleaned_data['northlimit'] = str(temp_cleaned_data['northlimit'])
        temp_cleaned_data['eastlimit'] = str(temp_cleaned_data['eastlimit'])
        temp_cleaned_data['southlimit'] = str(temp_cleaned_data['southlimit'])
        temp_cleaned_data['westlimit'] = str(temp_cleaned_data['westlimit'])
        temp_cleaned_data['units'] = temp_cleaned_data['units']

        if 'projection' in temp_cleaned_data:
            if len(temp_cleaned_data['projection']) == 0:
                del temp_cleaned_data['projection']

        if 'projection_string_type' in temp_cleaned_data:
            del temp_cleaned_data['projection_string_type']

        if 'projection_string_text' in temp_cleaned_data:
            del temp_cleaned_data['projection_string_text']

        self.cleaned_data['value'] = copy.deepcopy(temp_cleaned_data)

        if 'northlimit' in self.cleaned_data:
                del self.cleaned_data['northlimit']
        if 'eastlimit' in self.cleaned_data:
                del self.cleaned_data['eastlimit']
        if 'southlimit' in self.cleaned_data:
            del self.cleaned_data['southlimit']
        if 'westlimit' in self.cleaned_data:
            del self.cleaned_data['westlimit']
        if 'units' in self.cleaned_data:
            del self.cleaned_data['units']
        if 'projection' in self.cleaned_data:
            del self.cleaned_data['projection']

        return self.cleaned_data

class OriginalCoverageValidationForm(forms.Form):
    PRO_STR_TYPES = (
        ('', '---------'),
        ('WKT String', 'WKT String'),
        ('Proj4 String', 'Proj4 String')
    )

    projection = forms.CharField(max_length=100, required=False)
    northlimit = forms.DecimalField()
    eastlimit = forms.DecimalField()
    southlimit = forms.DecimalField()
    westlimit = forms.DecimalField()
    units = forms.CharField(max_length=100)
    projection_string_type = forms.ChoiceField(choices=PRO_STR_TYPES, required=False)
    projection_string_text = forms.CharField(max_length=1000, required=False)
    datum = forms.CharField(max_length=300, required=False)

class OriginalCoverageMetaDelete(MetaDataElementDeleteForm):
    def __init__(self, res_short_id, element_name, element_id, *args, **kwargs):
        super(OriginalCoverageMetaDelete, self).__init__(res_short_id, element_name,
                                                         element_id, *args, **kwargs)
        self.helper.layout[0] = HTML("""

        """)

# The following 3 classes need to have the "field" same as the fields defined in
# "Variable" table in models.py
class VariableFormHelper(FormHelper):
    def __init__(self, *args, **kwargs):
        super(VariableFormHelper, self).__init__(*args, **kwargs)
        field_width = 'form-control input-sm'
        self.form_tag = False
        self.form_show_errors = True
        self.error_text_inline = True
        self.html5_required = True
        # change the fields name here
        self.layout = Layout(
            Fieldset('Variable',
                     Field('name', css_class=field_width),
                     Field('unit', css_class=field_width),
                     Field('type', css_class=field_width),
                     Field('shape', css_class=field_width),
                     Field('descriptive_name', css_class=field_width),
                     Field('method', css_class=field_width),
                     Field('missing_value', css_class=field_width)
                     ),
            )

class VariableForm(ModelForm):
    def __init__(self, allow_edit=True, res_short_id=None,  *args, **kwargs):
        super(VariableForm, self).__init__(*args, **kwargs)
        self.helper = VariableFormHelper()
        self.delete_modal_form = None
        self.number = 0
        self.allow_edit = allow_edit
        if res_short_id:
            self.action = "/hydroshare/hsapi/_internal/%s/variable/add-metadata/" % res_short_id
        else:
            self.action = ""
        self.fields['name'].widget.attrs['readonly'] = True
        self.fields['shape'].widget.attrs['readonly'] = True
        self.fields['type'].widget.attrs['readonly'] = True

    @property
    def form_id(self):
        form_id = 'id_variable_%s' % self.number
        return form_id

    @property
    def form_id_button(self):
        form_id = 'id_variable_%s' % self.number
        return "'" + form_id + "'"

    class Meta:
        model = Variable
        # change the fields same here
        fields = ['name', 'unit', 'type', 'shape', 'descriptive_name', 'method', 'missing_value']
        exclude = ['content_object']

class VariableValidationForm(forms.Form):
    name = forms.CharField(max_length=1000)
    unit = forms.CharField(max_length=1000)
    type = forms.CharField(max_length=1000)
    shape = forms.CharField(max_length=1000)
    descriptive_name = forms.CharField(max_length=1000, required=False)
    method = forms.CharField(max_length=10000, required=False)
    missing_value = forms.CharField(max_length=1000, required=False)

ModalDialogLayoutAddVariable = Helper.get_element_add_modal_form('Variable',
                                                                 'add_variable_modal_form')

VariableLayoutEdit = Layout(
    HTML(
        """
        {% load crispy_forms_tags %}
            {% if variable_formset.forms %}

             {% for form in variable_formset.forms %}

                 <form id={{form.form_id}} action="{{ form.action }}"
                 method="POST" enctype="multipart/form-data">
                 {% crispy form %}

                        <button type="button" class="btn btn-primary btn-form-submit">
                        Save Changes</button>

                {% crispy form.delete_modal_form %}
                </form>

             {% endfor %}

             {% endif %}
        """
        ))


text:
version_info = (6, 0, 0, "alpha", 0)

release_level_ids = {"alpha": 0xA0,
                     "beta": 0xB0,
                     "final": 0xF0}

# Examples:
# 0x060102A3 for 6.1.2 beta 3
# 0x060203F0 for 6.2.3
hex_version = version_info[0] << 24
hex_version += version_info[1] << 16
hex_version += version_info[2] << 8
hex_version += release_level_ids[version_info[3]] + version_info[4]

version_format = "{0}.{1}.{2}"
if version_info[3] == "alpha" and version_info[4] == 0:
    version_format += " pre-alpha"
elif version_info[3] != "final":
    version_format += " {3} {4}"

version = version_format.format(*version_info)

from slot.requirements import requires
from slot.events import EventManager, subscription
from slot.bot import Bot
from slot.message import Conversation, IncomingMessage
import slot.protocols as protocols


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace ClickOnceDMAdmin.Preview {

    public partial class Default {
    }
}


text:
class Node;
class PhantNode;

class Link : public QGraphicsLineItem
{
public:
    Link(Node* fromNode, Node* toNode);
    ~Link();

    Node *fromNode() const;
    Node *toNode() const;

    void setColor(const QColor &color);
    QColor color() const;

    void trackNodes();

private:
    Node *myFromNode;
    Node *myToNode;
};

#endif


text:
"use strict";

 define(['jquery', 'ncc', 'NccLayout'], function($, ncc, NccLayout) {
 	return $.extend(true, {}, NccLayout, {
 		name: 'landing',
 		url: 'index.html',
		template: 'rv!layout/landing',
		local: {
			initialWaitTime: 600,
			closingGateTime: 1000,
			scrollHeader: 'active.scrollHeader',
			nisCheckingInterval: 3000
		},
		initEverytime: function() {
			ncc.set('active.gateClosed', false);
			ncc.set('active.overlayIn', false);
			ncc.set('active.hexagon', false);
			ncc.set('active.landingRegion', '');
			ncc.set(this.local.scrollHeader, false);
		},
		setupOnce: function() {
            ncc.openWallet = function(walletData) {
            	ncc.set('wallet', ncc.processWallet(walletData));
            	ncc.set('activeAccount', ncc.processAccount(walletData.primaryAccount));
                ncc.loadPage('dashboard', null, null, false, {
                	wallet: walletData.name,
                	account: walletData.primaryAccount.address
                });
	        };
		},
		setupEverytime: function() {
			var local = this.local;
			local.$html = $('html');
			local.$body = $('body');
			local.$doc = $(document);
	 		local.$leftForm = $('.left.region .form');
			local.$rightForm = $('.right.region .form');
			local.$staticHeader = $('#static-header');
			local.$createWalletNameInput = $('.left.region .custom-input').first().find('input');
			local.headerBottom = local.$staticHeader.offset().top + local.$staticHeader.outerHeight();
			local.$bgSlideshow = $('#bg-slideshow');
			local.bgSlideshowTop = local.$bgSlideshow.offset().top;

			local.$html.addClass('landing');

			// Intro
			$(function() {
				setTimeout(function() {
					ncc.set('active.gateClosed', true);
					setTimeout(function() {
						ncc.set('active.overlayIn', true);
						ncc.set('active.hexagon', true);
					}, local.closingGateTime);
				}, local.initialWaitTime);
			});

			ncc.set('status.listingWallets', true);
			ncc.getRequest('wallet/list',
				function(data) {
					ncc.set('wallets', data.wallets);
				},
				{
					complete: function() {
						ncc.set('status.listingWallets', false);
					}
				}
			);

			require(['tinycarousel'], function() {
				$('#tips-carousel .container').tinycarousel({
			        interval: true,
			        intervalTime: 5000,
			        animationTime: 1000
			    });
			});

			$(window).on('scroll.landing', function(event) {
				var scrollTop = local.$doc.scrollTop();

				// scroll header
				if (!ncc.get(local.scrollHeader) && scrollTop >= local.headerBottom) {
					ncc.set(local.scrollHeader, true);
				} else if (ncc.get(local.scrollHeader) && scrollTop < local.headerBottom) {
					ncc.set(local.scrollHeader, false);
				}

				// floating background
				var shifted = (scrollTop - local.bgSlideshowTop) * .8;
				local.$bgSlideshow.css('background-position', '50% calc(50% + ' + shifted + 'px)');
			});

			require(['expand'], function() {
				local.listeners.push(ncc.on({
					'switchLeft': function() {
						if (ncc.get('active.landingRegion') === 'right') {
							local.$rightForm.collapse();
						}
						ncc.set('active.landingRegion', 'left');
						ncc.set('active.hexagon', false);
						local.$leftForm.expand();
						local.$createWalletNameInput.focus();
					},
					'switchRight': function() {
						if (ncc.get('active.landingRegion') === 'left') {
							local.$leftForm.collapse();
						}
						ncc.set('active.landingRegion', 'right');
						ncc.set('active.hexagon', false);
						local.$rightForm.expand();
					}
				}));
			});

			local.listeners.push(ncc.on({
				openWallet: function(e, wallet) {
			    	var requestData = {
						wallet: wallet,
						password: ncc.get('inputPassword')[wallet]
					};
					ncc.set('status.openingWallet', true);
			    	ncc.postRequest('wallet/open', requestData,
			    		function(data) {
			    			// clear typed passwords before redirecting
							ncc.set('inputPassword', undefined);
			        		ncc.openWallet(data);
			        	},
						{
							complete: function() {
								ncc.set('status.openingWallet', false);
							}
						}
			    	);
			    },
				createWallet: function() {
					ncc.set('status.creatingWallet', true);
					var requestData = ncc.get('createdWallet');
			    	ncc.postRequest('wallet/create', requestData, function(data) {
		    			ncc.postRequest('wallet/open', requestData,
				    		function(data) {
				    			// clear form before redirecting
				    			ncc.set('createdWallet', {});
				        		ncc.openWallet(data);
				        	}
				    	);
		    		},
		    		{
		    			complete: function() {
		    				ncc.set('status.creatingWallet', false);
		    			}
		    		});
			    },
			    scrollTo: function(e, selector) {
			    	var $el = $(selector);
			    	if ($el[0]) {
			    		var offsetTop = $el.offset().top;
				        local.$html.add(local.$body).stop().animate({ // Chrome scrolls body, Firefox and IE scrolls html
				            scrollTop: offsetTop
				        }, 400);
			    	}
			    },
			    createWalletKeypress: function(e) {
			    	if (e.original.keyCode === 13) {
			    		ncc.fire('createWallet');
			    	}
			    },
			    passwordKeypress: function(e, wallet) {
			    	if (e.original.keyCode === 13) {
			    		ncc.fire('openWallet', {}, wallet);
			    	}
			    },
			    fileToImportSelected: function(e) {
			    	ncc.set('fileToImport.import_path', e.node.value);
			    },
			    importWallet: function() {
			    	var requestData = ncc.get('fileToImport');
			    	ncc.postRequest('wallet/import', requestData, function(data) {
			    		ncc.showMessage(ncc.get('texts.modals.common.success'), ncc.get('texts.landing.importSuccess'));
			    		ncc.set('fileToImport', {});
			    	});
			    },
			    importKeypress: function(e) {
			    	if (e.original.keyCode === 13) {
			    		ncc.fire('importWallet');
			    	}
			    },
			    walletSelected: function(e) {
			    	$(e.node).siblings('.password-prompt').find('input[type="password"]').focus();
			    }
			}));

			//local.nisChecking =
		},
		leave: [function() {
			//clearInterval(this.local.nisChecking);
			$(window).off('scroll.landing');
			this.local.$html.removeClass('landing');
		}]
 	});
});


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

<title>org.hibernate.loader.entity.plan (Hibernate JavaDocs)</title>
<meta name="date" content="2014-03-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.hibernate.loader.entity.plan

Classes

AbstractBatchingEntityLoaderBuilder

AbstractLoadPlanBasedEntityLoader

BatchingEntityLoader

EntityLoader

EntityLoader.Builder

LegacyBatchingEntityLoaderBuilder

LegacyBatchingEntityLoaderBuilder.LegacyBatchingEntityLoader


text:
var args = arguments[0] || {};

$.login.open();

$.loginbox.btn_login.addEventListener('click', function(e) {
	var url = 'http://www.pm-solution.dk/audiometry-project/data.php';
	var payload = {
		command: 'patientLogin',
		cpr: $.loginbox.tf_username.value,
		password: $.loginbox.tf_password.value
	};

	//alert('logging in');
	var xhr = Ti.Network.createHTTPClient({
		onload: function(){
			//do something on load
			//parsing responstext
			var json = JSON.parse(this.responseText);
			//get user array
			var userdata = json[0];
			// saving userdata in App.Properties
			Ti.App.Properties.setString('userid',userdata[0]) ;
			Ti.App.Properties.setString('user_first_name',userdata[1]) ;
			Ti.App.Properties.setString('user_last_name',userdata[2]) ;
			//open testinfo page
			var test1win = Alloy.createController('test_1_info');
			//closing login
			$.login.close();
			//alert('success \n userid: '+ userdata[0] +'\n firstname: '+userdata[1]+'\n lastname: '+userdata[2]);

		},
		onerror: function(e){
			//do something if error
			alert('Kan ikke logge ind\n'+e.error);
		}
	});

	//opens the connection
	xhr.open('POST',url);

	//sending request with our connection
	xhr.send(payload);

});

$.loginbox.btn_cancel.addEventListener('click', function(e) {
	//alert('Cancelling');
	$.login.close();
});


text:
#include "QmitkBasePropertyView.h"

QmitkBasePropertyView::QmitkBasePropertyView( const mitk::BaseProperty* property, QWidget* parent)
: QLabel( parent ),
  PropertyView( property )
{
  PropertyChanged();
}

QmitkBasePropertyView::~QmitkBasePropertyView()
{
}

void QmitkBasePropertyView::PropertyChanged()
{
  if ( m_Property )
    setText( m_Property->GetValueAsString().c_str() );
}

void QmitkBasePropertyView::PropertyRemoved()
{
  m_Property = NULL;
  setText("n/a");
}


text:
import tl = require('vsts-task-lib/task');
import { AzureAppService } from 'azure-arm-rest/azure-arm-app-service';
import webClient = require('azure-arm-rest/webClient');
var parseString = require('xml2js').parseString;
import Q = require('q');
import { Kudu } from 'azure-arm-rest/azure-arm-app-service-kudu';

export class AzureAppServiceUtility {
    private _appService: AzureAppService;
    constructor(appService: AzureAppService) {
        this._appService = appService;
    }

    public async updateScmTypeAndConfigurationDetails() : Promise<void>{
            try {
            var configDetails = await this._appService.getConfiguration();
            var scmType: string = configDetails.properties.scmType;
            if (scmType && scmType.toLowerCase() === "none") {
                configDetails.properties.scmType = 'VSTSRM';
                tl.debug('updating SCM Type to VSTS-RM');
                await this._appService.updateConfiguration(configDetails);
                tl.debug('updated SCM Type to VSTS-RM');
                tl.debug('Updating metadata with latest release details');
                await this._appService.patchMetadata(this._getNewMetadata());
                tl.debug('Updated metadata with latest release details');
                console.log(tl.loc("SuccessfullyUpdatedAzureRMWebAppConfigDetails"));
            }
            else {
                tl.debug(`Skipped updating the SCM value. Value: ${scmType}`);
            }
        }
        catch(error) {
            tl.warning(tl.loc("FailedToUpdateAzureRMWebAppConfigDetails", error));
        }
    }

    public async getWebDeployPublishingProfile(): Promise<any> {
        var publishingProfile = await this._appService.getPublishingProfileWithSecrets();
        var defer = Q.defer<any>();
        parseString(publishingProfile, (error, result) => {
            if(!!error) {
                defer.reject(error);
            }
            var publishProfile = result && result.publishData && result.publishData.publishProfile ? result.publishData.publishProfile : null;
            if(publishProfile) {
                for (var index in publishProfile) {
                    if (publishProfile[index].$ && publishProfile[index].$.publishMethod === "MSDeploy") {
                        defer.resolve(result.publishData.publishProfile[index].$);
                    }
                }
            }

            defer.reject(tl.loc('ErrorNoSuchDeployingMethodExists'));
        });

        return defer.promise;
    }

    public async getApplicationURL(virtualApplication?: string): Promise<string> {
        let webDeployProfile: any =  await this.getWebDeployPublishingProfile();
        return await webDeployProfile.destinationAppUrl + ( virtualApplication ? "/" + virtualApplication : "" );
    }

    public async pingApplication(): Promise<void> {
        try {
            var applicationUrl: string = await this.getApplicationURL();

            if(!applicationUrl) {
                tl.debug("Application Url not found.");
                return;
            }
            await AzureAppServiceUtility.pingApplication(applicationUrl);
        } catch(error) {
            tl.debug("Unable to ping App Service. Error: ${error}");
        }
    }

    public static async pingApplication(applicationUrl: string) {
        if(!applicationUrl) {
            tl.debug('Application Url empty.');
            return;
        }
        try {
            var webRequest = new webClient.WebRequest();
            webRequest.method = 'GET';
            webRequest.uri = applicationUrl;
            let webRequestOptions: webClient.WebRequestOptions = {retriableErrorCodes: [], retriableStatusCodes: [], retryCount: 1, retryIntervalInSeconds: 5, retryRequestTimedout: true};
            var response = await webClient.sendRequest(webRequest, webRequestOptions);
            tl.debug(`App Service status Code: '${response.statusCode}'. Status Message: '${response.statusMessage}'`);
        }
        catch(error) {
            tl.debug(`Unable to ping App Service. Error: ${error}`);
        }
    }

    public async getKuduService(): Promise<Kudu> {
        var publishingCredentials = await this._appService.getPublishingCredentials();
        if(publishingCredentials.properties["scmUri"]) {
            tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
            return new Kudu(publishingCredentials.properties["scmUri"], publishingCredentials.properties["publishingUserName"], publishingCredentials.properties["publishingPassword"]);
        }

        throw Error(tl.loc('KuduSCMDetailsAreEmpty'));
    }

    public async getPhysicalPath(virtualApplication: string): Promise<string> {

        if(!virtualApplication) {
            return '/site/wwwroot';
        }

        virtualApplication = (virtualApplication.startsWith("/")) ? virtualApplication.substr(1) : virtualApplication;

        var physicalToVirtualPathMap = await this._getPhysicalToVirtualPathMap(virtualApplication);

        if(!physicalToVirtualPathMap) {
            throw Error(tl.loc("VirtualApplicationDoesNotExist", virtualApplication));
        }

        tl.debug(`Virtual Application Map: Physical path: '${physicalToVirtualPathMap.physicalPath}'. Virtual path: '${physicalToVirtualPathMap.virtualPath}'.`);
        return physicalToVirtualPathMap.physicalPath;
    }

    public async updateConfigurationSettings(properties: any) : Promise<void> {
        for(var property in properties) {
            if(!!properties[property] && properties[property].value !== undefined) {
                properties[property] = properties[property].value;
            }
        }

        console.log(tl.loc('UpdatingAppServiceConfigurationSettings', JSON.stringify(properties)));
        await this._appService.patchConfiguration({'properties': properties});
        console.log(tl.loc('UpdatedAppServiceConfigurationSettings'));
    }

    public async updateAndMonitorAppSettings(addProperties: any, deleteProperties?: any): Promise<boolean> {
        for(var property in addProperties) {
            if(!!addProperties[property] && addProperties[property].value !== undefined) {
                addProperties[property] = addProperties[property].value;
            }
        }

        console.log(tl.loc('UpdatingAppServiceApplicationSettings', JSON.stringify(addProperties)));
        var isNewValueUpdated: boolean = await this._appService.patchApplicationSettings(addProperties, deleteProperties);

        if(!isNewValueUpdated) {
            console.log(tl.loc('UpdatedAppServiceApplicationSettings'));
            return isNewValueUpdated;
        }

        var kuduService = await this.getKuduService();
        var noOftimesToIterate: number = 12;
        tl.debug('retrieving values from Kudu service to check if new values are updated');
        while(noOftimesToIterate > 0) {
            var kuduServiceAppSettings = await kuduService.getAppSettings();
            var propertiesChanged: boolean = true;
            for(var property in addProperties) {
                if(kuduServiceAppSettings[property] != addProperties[property]) {
                    tl.debug('New properties are not updated in Kudu service :(');
                    propertiesChanged = false;
                    break;
                }
            }
            for(var property in deleteProperties) {
                if(kuduServiceAppSettings[property]) {
                    tl.debug('Deleted properties are not reflected in Kudu service :(');
                    propertiesChanged = false;
                    break;
                }
            }

            if(propertiesChanged) {
                tl.debug('New properties are updated in Kudu service.');
                console.log(tl.loc('UpdatedAppServiceApplicationSettings'));
                return isNewValueUpdated;
            }

            noOftimesToIterate -= 1;
            await webClient.sleepFor(5);
        }

        tl.debug('Timing out from app settings check');
        return isNewValueUpdated;
    }

    public async enableRenameLockedFiles(): Promise<void> {
        try {
            var webAppSettings = await this._appService.getApplicationSettings();
            if(webAppSettings && webAppSettings.properties) {
                if(webAppSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES !== '1') {
                    tl.debug(`Rename locked files value found to be ${webAppSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES}. Updating the value to 1`);
                    await this.updateAndMonitorAppSettings({ 'MSDEPLOY_RENAME_LOCKED_FILES' : '1' });
                    console.log(tl.loc('RenameLockedFilesEnabled'));
                }
                else {
                    tl.debug('Rename locked files is already enabled in App Service');
                }
            }
        }
        catch(error) {
            throw new Error(tl.loc('FailedToEnableRenameLockedFiles', error));
        }
    }

    public async updateStartupCommandAndRuntimeStack(runtimeStack: string, startupCommand?: string): Promise<void> {
        var configDetails = await this._appService.getConfiguration();
        startupCommand = (!!startupCommand) ? startupCommand  : "";
        var linuxFxVersion: string = configDetails.properties.linuxFxVersion;
        var appCommandLine: string = configDetails.properties.appCommandLine;
        runtimeStack = (!!runtimeStack) ? runtimeStack : linuxFxVersion;

        if (appCommandLine != startupCommand || runtimeStack != linuxFxVersion) {
            await this.updateConfigurationSettings({linuxFxVersion: runtimeStack, appCommandLine: startupCommand});
        }
        else {
            tl.debug(`Skipped updating the values. linuxFxVersion: ${linuxFxVersion} : appCommandLine: ${appCommandLine}`)
        }
    }

    private async _getPhysicalToVirtualPathMap(virtualApplication: string): Promise<any> {
        // construct URL depending on virtualApplication or root of webapplication
        var physicalPath = null;
        var virtualPath = "/" + virtualApplication;
        var appConfigSettings = await this._appService.getConfiguration();
        var virtualApplicationMappings = appConfigSettings.properties && appConfigSettings.properties.virtualApplications;

        if(virtualApplicationMappings) {
            for( var mapping of virtualApplicationMappings ) {
                if(mapping.virtualPath.toLowerCase() == virtualPath.toLowerCase()) {
                    physicalPath = mapping.physicalPath;
                    break;
                }
            }
        }

        return physicalPath ? {
            'virtualPath': virtualPath,
            'physicalPath': physicalPath
        }: null;
    }

    private _getNewMetadata(): any {
        var collectionUri = tl.getVariable("system.teamfoundationCollectionUri");
        var projectId = tl.getVariable("system.teamprojectId");
        var buildDefintionId = tl.getVariable("build.definitionId")
        var releaseDefinitionId = tl.getVariable("release.definitionId");

        let newProperties = {
            VSTSRM_BuildDefinitionId: buildDefintionId,
            VSTSRM_ReleaseDefinitionId: releaseDefinitionId,
            VSTSRM_ProjectId: projectId,
            VSTSRM_AccountId: tl.getVariable("system.collectionId"),
            VSTSRM_BuildDefinitionWebAccessUrl: collectionUri + projectId + "/_build?_a=simple-process&definitionId=" + buildDefintionId,
            VSTSRM_ConfiguredCDEndPoint: collectionUri + projectId + "/_apps/hub/ms.vss-releaseManagement-web.hub-explorer?definitionId=" + releaseDefinitionId
        }

        return newProperties;
    }

}


text:
"""Tests for ``_extras`` module."""
import pytest

from rstcheck import _compat, _extras

class TestInstallChecker:
    """Test ``is_installed_with_supported_version``."""

    @staticmethod
    @pytest.mark.skipif(_extras.SPHINX_INSTALLED, reason="Test without sphinx extra.")
    def test_false_on_missing_sphinx_package() -> None:
        """Test install-checker returns ``False`` when ``sphinx`` is missing."""
        result = _extras.is_installed_with_supported_version("sphinx")

        assert result is False

    @staticmethod
    @pytest.mark.skipif(not _extras.SPHINX_INSTALLED, reason="Depends on sphinx extra.")
    def test_true_on_installed_sphinx_package() -> None:
        """Test install-checker returns ``True`` when ``sphinx`` is installed with good version."""
        result = _extras.is_installed_with_supported_version("sphinx")

        assert result is True

    @staticmethod
    @pytest.mark.skipif(not _extras.SPHINX_INSTALLED, reason="Depends on sphinx extra.")
    def test_false_on_installed_sphinx_package_too_old(monkeypatch: pytest.MonkeyPatch) -> None:
        """Test install-checker returns ``False`` when ``sphinx`` is installed with bad version."""
        monkeypatch.setattr(_compat, "version", lambda _: "0.0")

        result = _extras.is_installed_with_supported_version("sphinx")

        assert result is False

class TestInstallGuard:
    """Test ``install_guard``."""

    @staticmethod
    @pytest.mark.skipif(_extras.SPHINX_INSTALLED, reason="Test without sphinx extra.")
    def test_false_on_missing_sphinx_package() -> None:
        """Test install-guard raises exception when ``sphinx`` is missing."""
        with pytest.raises(ModuleNotFoundError):
            _extras.install_guard("sphinx")  # act

    @staticmethod
    @pytest.mark.skipif(not _extras.SPHINX_INSTALLED, reason="Depends on sphinx extra.")
    def test_true_on_installed_sphinx_package() -> None:
        """Test install-guard doesn't raise when ``sphinx`` is installed."""
        _extras.install_guard("sphinx")  # act


text:
//
//  PNLineChart.h
//  PNChartDemo
//
//  Created by kevin on 11/7/13.
//  Copyright (c) 2013年 kevinzhow. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "PNChartDelegate.h"
#import "PNGenericChart.h"

@interface PNLineChart : PNGenericChart

/**
 * Draws the chart in an animated fashion.
 */
- (void)strokeChart;

@property (nonatomic, weak) id<PNChartDelegate> delegate;

@property (nonatomic) NSArray *xLabels;
@property (nonatomic) NSArray *yLabels;

/**
 * Array of `LineChartData` objects, one for each line.
 */
@property (nonatomic) NSArray *chartData;

@property (nonatomic) NSMutableArray *pathPoints;
@property (nonatomic) NSMutableArray *xChartLabels;
@property (nonatomic) NSMutableArray *yChartLabels;

@property (nonatomic) CGFloat xLabelWidth;
@property (nonatomic) UIFont *xLabelFont;
@property (nonatomic) UIColor *xLabelColor;
@property (nonatomic) CGFloat yValueMax;
@property (nonatomic) CGFloat yFixedValueMax;
@property (nonatomic) CGFloat yFixedValueMin;
@property (nonatomic) CGFloat yValueMin;
@property (nonatomic) NSInteger yLabelNum;
@property (nonatomic) CGFloat yLabelHeight;
@property (nonatomic) UIFont *yLabelFont;
@property (nonatomic) UIColor *yLabelColor;
@property (nonatomic) CGFloat chartCavanHeight;
@property (nonatomic) CGFloat chartCavanWidth;
@property (nonatomic) CGFloat chartMargin;
@property (nonatomic) BOOL showLabel;

/**
 * Controls whether to show the coordinate axis. Default is NO.
 */
@property (nonatomic, getter = isShowCoordinateAxis) BOOL showCoordinateAxis;
@property (nonatomic) UIColor *axisColor;
@property (nonatomic) CGFloat axisWidth;

@property (nonatomic, strong) NSString *xUnit;
@property (nonatomic, strong) NSString *yUnit;

/**
 * String formatter for float values in y-axis labels. If not set, defaults to @"%1.f"
 */
@property (nonatomic, strong) NSString *yLabelFormat;

- (void)setXLabels:(NSArray *)xLabels withWidth:(CGFloat)width;

/**
 * Update Chart Value
 */

- (void)updateChartData:(NSArray *)data;

/**
 *  returns the Legend View, or nil if no chart data is present.
 *  The origin of the legend frame is 0,0 but you can set it with setFrame:(CGRect)
 *
 *  @param mWidth Maximum width of legend. Height will depend on this and font size
 *
 *  @return UIView of Legend
 */
- (UIView*) getLegendWithMaxWidth:(CGFloat)mWidth;

+ (CGSize)sizeOfString:(NSString *)text withWidth:(float)width font:(UIFont *)font;
@end


text:
require 'test/unit'
require 'kayako_client'

class TestDepartment < Test::Unit::TestCase

    def test_staff_readonly
        test = KayakoClient::Staff.new(
            :id         => 1,
            :user_name  => 'test',
            :first_name => 'Test',
            :last_name  => 'Test'
        )

        assert_raise NoMethodError do
            test.id = 2
        end

        assert_raise NoMethodError do
            test.fullname = 'Test Test'
        end
    end

    def test_staff_assign
        test = KayakoClient::Staff.new

        group = KayakoClient::StaffGroup.new(
            :id    => 1,
            :title => 'Test'
        )
        test.staff_group_id = group
        assert_equal test.staff_group_id, 1

        test.is_enabled = true
        assert test.is_enabled

        test.is_enabled = 0
        assert test.is_enabled == false
    end

    def test_staff_required
        test = KayakoClient::Staff.new(
            :id         => 1,
            :user_name  => 'test',
            :first_name => 'Test',
            :last_name  => 'Test'
        )
        assert_raise ArgumentError do
            test.put
        end

        test = KayakoClient::Staff.new(
            :user_name      => 'test',
            :first_name     => 'Test',
            :last_name      => 'Test',
            :email          => 'test@test.com',
            :staff_group_id => 1
        )
        assert_raise ArgumentError do
            test.post
        end
    end

end


text:
package com.amazonaws.services.ec2.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateTagsRequestMarshaller;

/**
 *

 * Contains the parameters for CreateTags.
 *

 */
public class CreateTagsRequest extends AmazonWebServiceRequest implements
        Serializable, Cloneable, DryRunSupportedRequest<CreateTagsRequest> {

    /**
     *

     * The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> resources;
    /**
     *

     * One or more tags. The value parameter is required, but if
     * you don't want the tag to have a value, specify the parameter with no
     * value, and we set the value to an empty string.
     *

     */
    private com.amazonaws.internal.SdkInternalList<Tag> tags;

    /**
     * Default constructor for CreateTagsRequest object. Callers should use the
     * setter or fluent setter (with...) methods to initialize the object after
     * creating it.
     */
    public CreateTagsRequest() {
    }

    /**
     * Constructs a new CreateTagsRequest object. Callers should use the setter
     * or fluent setter (with...) methods to initialize any additional object
     * members.
     *
     * @param resources
     *        The IDs of one or more resources to tag. For example,
     *        ami-1a2b3c4d.
     * @param tags
     *        One or more tags. The value parameter is required,
     *        but if you don't want the tag to have a value, specify the
     *        parameter with no value, and we set the value to an empty string.
     */
    public CreateTagsRequest(java.util.List<String> resources,
            java.util.List<Tag> tags) {
        setResources(resources);
        setTags(tags);
    }

    /**
     *

     * The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
     *

     *
     * @return The IDs of one or more resources to tag. For example,
     *         ami-1a2b3c4d.
     */

    public java.util.List<String> getResources() {
        if (resources == null) {
            resources = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return resources;
    }

    /**
     *

     * The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
     *

     *
     * @param resources
     *        The IDs of one or more resources to tag. For example,
     *        ami-1a2b3c4d.
     */

    public void setResources(java.util.Collection<String> resources) {
        if (resources == null) {
            this.resources = null;
            return;
        }

        this.resources = new com.amazonaws.internal.SdkInternalList<String>(
                resources);
    }

    /**
     *

     * The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
     *

     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setResources(java.util.Collection)} or
     * {@link #withResources(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param resources
     *        The IDs of one or more resources to tag. For example,
     *        ami-1a2b3c4d.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateTagsRequest withResources(String... resources) {
        if (this.resources == null) {
            setResources(new com.amazonaws.internal.SdkInternalList<String>(
                    resources.length));
        }
        for (String ele : resources) {
            this.resources.add(ele);
        }
        return this;
    }

    /**
     *

     * The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
     *

     *
     * @param resources
     *        The IDs of one or more resources to tag. For example,
     *        ami-1a2b3c4d.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateTagsRequest withResources(
            java.util.Collection<String> resources) {
        setResources(resources);
        return this;
    }

    /**
     *

     * One or more tags. The value parameter is required, but if
     * you don't want the tag to have a value, specify the parameter with no
     * value, and we set the value to an empty string.
     *

     *
     * @return One or more tags. The value parameter is required,
     *         but if you don't want the tag to have a value, specify the
     *         parameter with no value, and we set the value to an empty string.
     */

    public java.util.List<Tag> getTags() {
        if (tags == null) {
            tags = new com.amazonaws.internal.SdkInternalList<Tag>();
        }
        return tags;
    }

    /**
     *

     * One or more tags. The value parameter is required, but if
     * you don't want the tag to have a value, specify the parameter with no
     * value, and we set the value to an empty string.
     *

     *
     * @param tags
     *        One or more tags. The value parameter is required,
     *        but if you don't want the tag to have a value, specify the
     *        parameter with no value, and we set the value to an empty string.
     */

    public void setTags(java.util.Collection<Tag> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new com.amazonaws.internal.SdkInternalList<Tag>(tags);
    }

    /**
     *

     * One or more tags. The value parameter is required, but if
     * you don't want the tag to have a value, specify the parameter with no
     * value, and we set the value to an empty string.
     *

     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setTags(java.util.Collection)} or
     * {@link #withTags(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param tags
     *        One or more tags. The value parameter is required,
     *        but if you don't want the tag to have a value, specify the
     *        parameter with no value, and we set the value to an empty string.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateTagsRequest withTags(Tag... tags) {
        if (this.tags == null) {
            setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length));
        }
        for (Tag ele : tags) {
            this.tags.add(ele);
        }
        return this;
    }

    /**
     *

     * One or more tags. The value parameter is required, but if
     * you don't want the tag to have a value, specify the parameter with no
     * value, and we set the value to an empty string.
     *

     *
     * @param tags
     *        One or more tags. The value parameter is required,
     *        but if you don't want the tag to have a value, specify the
     *        parameter with no value, and we set the value to an empty string.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateTagsRequest withTags(java.util.Collection<Tag> tags) {
        setTags(tags);
        return this;
    }

    /**
     * This method is intended for internal use only. Returns the marshaled
     * request configured with additional parameters to enable operation
     * dry-run.
     */
    @Override
    public Request<CreateTagsRequest> getDryRunRequest() {
        Request<CreateTagsRequest> request = new CreateTagsRequestMarshaller()
                .marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getResources() != null)
            sb.append("Resources: " + getResources() + ",");
        if (getTags() != null)
            sb.append("Tags: " + getTags());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CreateTagsRequest == false)
            return false;
        CreateTagsRequest other = (CreateTagsRequest) obj;
        if (other.getResources() == null ^ this.getResources() == null)
            return false;
        if (other.getResources() != null
                && other.getResources().equals(this.getResources()) == false)
            return false;
        if (other.getTags() == null ^ this.getTags() == null)
            return false;
        if (other.getTags() != null
                && other.getTags().equals(this.getTags()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getResources() == null) ? 0 : getResources().hashCode());
        hashCode = prime * hashCode
                + ((getTags() == null) ? 0 : getTags().hashCode());
        return hashCode;
    }

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


text:
title: "Understanding the CLI cache behavior"
sub_link: "cli/cache"
meta_title: "A guide to understanding how Polyaxon CLI cache information - Core Concepts"
meta_description: "Polyaxon CLI creates a cache context to improve the user experience and avoid passing arguments for static information like owner, project, and last run."
visibility: public
status: published
tags:
  - cli
  - reference
  - polyaxon
  - concepts
  - tutorials
sidebar: "core"
---

Polyaxon CLI creates a cache context to improve the user experience and avoid passing arguments for static information like owner, project, and last run.

## Caching

When using Polyaxon CLI to run a command requiring a project or a run,
you can always specify the values for these options, for example:

 * `polyaxon project get --project=user_1/project_10`
 * `polyaxon ops get --project=user_1/project_10 --uid=UUID`

Polyaxon CLI allows also you to omit these options for projects and runs, the CLI does the following:

 1. When an owner (username or an organization) is missing, the owner is inferred based on the logged-in user, if no user/owner is found the default owner is used.
 2. When a project name is missing, the name of the currently initialized project is used.
 3. When a run is missing, the last value is used.
 4. If no values are found, the CLI will show an error.

All commands and sub-command of `project` and `ops` support this caching mechanism:

 * `polyaxon project ls`
 * `polyaxon project get`
 * `polyaxon ops ls`
 * `polyaxon ops get`
 * `polyaxon ops logs`
 * ...

## Updating the cached configuration

Every time you create a project or start a run, Polyaxon will save the response of that entity to the cache. For example:

`polyaxon project create --name test` will create a new project and will automatically cache the value of that project.
In all subsequent commands, if the user does not provide a project `--project`, Polyaxon CLI will use this project that was created.

`polyaxon run ...` will create a new run and will automatically cache the value.
In all subsequent commands, if the user does not provide a project `--project/-p` and a run uuid `--uid/-uid`, Polyaxon CLI will use the last cached project and run.

By creating new runs, Polyaxon will keep updating the cache detail to the latest created run.

You can also influence the run cache by getting a specific run, e.g. `polyaxon ops get -uid UUID`
will fetch the information about that specific run and persist the result to the cache so that you can run further commands
without the need to pass the `-uid UUID`, e.g. `polyaxon ops logs` will use the same `UUID`.

## Caching visibility

By default, Polyaxon will cache all information on Polyaxon's global path, if you want to enable caching on local project folder(s), you can use the init command:

```bash
polyaxon init -p PROJECT_NAME
```

This will create a local cache folder for the project and its runs.

Anytime you use the cli, it will look first locally, then defaults to the global path.

## Switching context

Users don't have to change to a new project to access information about that project, and its ops.

All commands allow changing the project context by providing `-p project` or `--project=project`.

You can as well check other users/organizations projects without initializing the projects, `-p owner/project` or `--project=owner/project`.

Here are some examples:

 * Getting other projects experiments:

    * `polyaxon project ops -p mnist -s "-created_at"`
    * `polyaxon project ops --project=acme/mnist -q "status: failed"`

 * Getting services named `tensorboard` for some projects:

    * `polyaxon ops ls --project=mnist --query="name: tensorboard" --sort="-created_at"`
    * `polyaxon tensorboards ls -p acme/mnist --query="name: tensorboard, status: running"`

 * Getting information about a specific experiment:

    * `polyaxon ops get -p mnist -uid UUID`
    * `polyaxon ops get -p acme/mnist --uid=UUID`


text:
package org.neo4j.ogm.domain.entityMapping;

import org.neo4j.ogm.annotation.Relationship;

/**
 * One incoming and one outgoing relationship of the same type. Methods annotated, fields not annotated.
 *
 * @author Luanne Misquitta
 */
public class UserV10 extends Entity {

    @Relationship(type = "LIKES")
    private UserV10 likes;

    @Relationship(type = "LIKES", direction = Relationship.Direction.INCOMING)
    private UserV10 likedBy;

    public UserV10() {
    }

    public UserV10 getLikes() {
        return likes;
    }

    public void setLikes(UserV10 likes) {
        this.likes = likes;
    }

    public UserV10 getLikedBy() {
        return likedBy;
    }

    public void setLikedBy(UserV10 likedBy) {
        this.likedBy = likedBy;
    }
}


text: export Info from './Info';


text:
/**
 * Spring Data JPA repositories.
 */
package fr.beitz.buildchaindemo.repository;


text:
Game::Game(sf::RenderWindow *_window) {
  _window->setFramerateLimit(15);
  this->window = _window;
  this->food.randomPosition();
  this->snake.setFood(&food);
  this->run();
}

void Game::run() {
  int _break = 0;

  while(window->isOpen()) {
    sf::Event event;

    while(window->pollEvent(event)) {
      if(event.type == sf::Event::Closed)
	window->close();
    }

    // Logic
    _break = snake.update();
    // draw
    window->clear();
    //snake.draw();
    snake.draw(window);
    food.draw(window);

    window->display();

    if(_break == 0) {
      break;
    }
  }

}


text:
<resources>

    <string name="app_name">Authentication</string>
    <string name="message.desc">desc</string>

    <!-- Login Strings -->
    <string name="prompt.email">Email</string>
    <string name="prompt.password">Password</string>
    <string name="message.register">No account yet? Register</string>
    <string name="action.login">Login</string>

    <!-- Registration Strings -->
    <string name="prompt.first.name">First Name</string>
    <string name="prompt.last.name">Last Name</string>
    <string name="message.login">Already registered? Login</string>
    <string name="action.register">Register</string>

    <!-- Error Strings -->
    <string name="error.required">The field is required</string>
    <string name="error.email">The email is invalid</string>
    <string name="error.password">The password is invalid</string>

</resources>


text:
package org.apache.hadoop.hive.ql.optimizer.calcite.functions;

import java.util.List;

import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.sql.SqlAggFunction;
import org.apache.calcite.sql.SqlFunctionCategory;
import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.SqlSplittableAggFunction;
import org.apache.calcite.sql.type.SqlOperandTypeChecker;
import org.apache.calcite.sql.type.SqlOperandTypeInference;
import org.apache.calcite.sql.type.SqlReturnTypeInference;
import org.apache.calcite.sql.type.SqlTypeName;

import com.google.common.collect.ImmutableList;

/**
 * Sum0 is an aggregator which returns the sum of the values which
 * go into it like Sum. It differs in that when no non null values
 * are applied zero is returned instead of null. Can be used along with
 * Count to implement Sum.
 */
public class HiveSqlSumEmptyIsZeroAggFunction extends SqlAggFunction {
  //~ Constructors -----------------------------------------------------------

  public HiveSqlSumEmptyIsZeroAggFunction(boolean isDistinct, SqlReturnTypeInference returnTypeInference,
          SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker) {
    super("$SUM0",
        null,
        SqlKind.SUM0,
        returnTypeInference,
        operandTypeInference,
        operandTypeChecker,
        SqlFunctionCategory.NUMERIC,
        false,
        false);
  }

  //~ Methods ----------------------------------------------------------------

  public List<RelDataType> getParameterTypes(RelDataTypeFactory typeFactory) {
    return ImmutableList.of(
        typeFactory.createTypeWithNullability(
            typeFactory.createSqlType(SqlTypeName.ANY), true));
  }

  public RelDataType getReturnType(RelDataTypeFactory typeFactory) {
    return typeFactory.createTypeWithNullability(
        typeFactory.createSqlType(SqlTypeName.ANY), true);
  }

  @Override public <T> T unwrap(Class<T> clazz) {
    if (clazz == SqlSplittableAggFunction.class) {
      return clazz.cast(SqlSplittableAggFunction.SumSplitter.INSTANCE);
    }
    return super.unwrap(clazz);
  }
}


text:
//INSTANT C# NOTE: Formerly VB project-level imports:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Linq;
using System.Xml.Linq;
using System.Threading.Tasks;
using System.Threading;
using System.IO;
using System.Reflection;

namespace LordofFaillingsLPToolkit
{
    public partial class startseite
    {
        internal startseite()
        {
            InitializeComponent();
        }

        private void startseite_Load(object sender, EventArgs e)
        {
            EinstellungenToolStripMenuItem.Enabled = false;
        }

        private void SchließenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.Environment.Exit(1);
        }

        private void EinstellungenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Coming Soon", "Not available");
            //einstellung.DefaultInstance.Show();

        }

        private void beschr_button_Click(object sender, EventArgs e)
        {
            frmGenerator gnr = new frmGenerator();
            gnr.Show();
        }

        private void lpt_button_Click(object sender, EventArgs e)
        {
            letsplaytimer lpt = new letsplaytimer();
            lpt.Show();
        }

        private static startseite _DefaultInstance;
        public static startseite DefaultInstance
        {
            get
            {
                if (_DefaultInstance == null)
                    _DefaultInstance = new startseite();

                return _DefaultInstance;
            }
        }

        private void copyrightsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Copyright © by ShowCast \nCopyright © by LordOfFailling \n", "Copyrights");
        }
    }
}


text:
<?php
namespace TijsVerkoyen\DocDataPayments\Types;

use TijsVerkoyen\DocDataPayments\Base\RequestSuccess;

/**
 * DocDataPayments StatusRequest class
 *
 * @author		Tijs Verkoyen <php-docdatapayments@verkoyen.eu>
 */
class StatusSuccess extends RequestSuccess
{
    /**
     * @var \TijsVerkoyen\DocDataPayments\Types\Report
     */
    protected $report;

    /**
     * @param \TijsVerkoyen\DocDataPayments\Types\Report $report
     */
    public function setReport($report)
    {
        $this->report = $report;
    }

    /**
     * @return \TijsVerkoyen\DocDataPayments\Types\Report
     */
    public function getReport()
    {
        return $this->report;
    }
}


text:
package lang

import (
	"github.com/Aptomi/aptomi/pkg/runtime"
)

// Metadata is an object metadata implementation (Namespace, Kind, Name, Generation) which works for all standard objects.
// Namespace defines in which namespace the object is defined. An object always gets placed in only one namespace.
// Kind describes type of the object (e.g. Bundle, Service, Cluster, etc)
// Name is a user-provided string identifier of an object. Names are usually human readable and must be unique across
// objects within the same namespace and the same object kind.
type Metadata struct {
	Namespace  string             `yaml:",omitempty" validate:"identifier"`
	Name       string             `yaml:",omitempty" validate:"identifier"`
	Generation runtime.Generation `yaml:",omitempty"`
	Deleted    bool               `yaml:",omitempty"`
}

// GetNamespace returns object namespace
func (meta *Metadata) GetNamespace() string {
	return meta.Namespace
}

// GetName returns object name
func (meta *Metadata) GetName() string {
	return meta.Name
}

// GetGeneration returns object generation
func (meta *Metadata) GetGeneration() runtime.Generation {
	return meta.Generation
}

// SetGeneration sets object generation
func (meta *Metadata) SetGeneration(generation runtime.Generation) {
	meta.Generation = generation
}

// IsDeleted returns if object deleted or not
func (meta *Metadata) IsDeleted() bool {
	return meta.Deleted
}

// SetDeleted sets object deleted flag
func (meta *Metadata) SetDeleted(deleted bool) {
	meta.Deleted = deleted
}


text:
package com.gymLocator;

import android.view.View;

// Referenced classes of package com.gymLocator:
//            MainActivity, GoogleDirection

class this._cls0
    implements android.view.tener
{

    final MainActivity this$0;

    public void onClick(View view)
    {
        view.setVisibility(8);
        gd.animateDirection(mGoogleMap, gd.getDirection(mDoc), 2, true, false, true, false, null, false, true, null);
    }

    ()
    {
        this$0 = MainActivity.this;
        super();
    }
}


text:
<!DOCTYPE html>

KickAssEngineers repo

GOOD MORNING KickAssEngineers on our repo GitHub site.

I am here!


text:
class TabContents;

namespace gfx {
class Rect;
}

// |InstantController| calls these methods on its delegate (usually |Browser|)
// to ask for the Instant preview to be shown, hidden, etc. In the following
// methods, if a |TabContents| argument is explicitly supplied, the delegate
// MUST use it. Otherwise, the preview TabContents can be gotten by calling
// |InstantController::GetPreviewContents| (note that it may return NULL).
class InstantControllerDelegate {
 public:
  // Show the preview.
  virtual void ShowInstant(TabContents* preview_contents) = 0;

  // Hide any preview currently being shown.
  virtual void HideInstant() = 0;

  // Commit the preview by merging it into the active tab. Delegate takes
  // ownership of |preview_contents|.
  virtual void CommitInstant(TabContents* preview_contents) = 0;

  // Autocomplete the Instant suggested |text| into the omnibox, using the
  // specified |behavior| (see instant_types.h for details).
  virtual void SetSuggestedText(const string16& text,
                                InstantCompleteBehavior behavior) = 0;

  // Return the bounds that the preview is placed at, in screen coordinates.
  virtual gfx::Rect GetInstantBounds() = 0;

  // Notification that the preview gained focus, usually due to the user
  // clicking on it.
  virtual void InstantPreviewFocused() = 0;

  // Return the currently active tab, over which any preview would be shown.
  virtual TabContents* GetInstantHostTabContents() const = 0;

 protected:
  virtual ~InstantControllerDelegate() {}
};

#endif  // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_


text:
import { SecurityGroupWriter } from './SecurityGroupWriter';
import { TaskExecutor } from '../task';

describe('SecurityGroupWriter', () => {
  it('copies the security group name on upsert', () => {
    const spy = spyOn(TaskExecutor, 'executeTask');
    SecurityGroupWriter.upsertSecurityGroup({ name: 'mySecurityGroupName' }, null, 'myDescription', {});

    expect(spy).toHaveBeenCalled();
    const job = spy.calls.mostRecent().args[0].job[0];
    expect(job).toEqual(jasmine.objectContaining({ securityGroupName: 'mySecurityGroupName' }));
  });
});


text:
package org.ovirt.engine.ui.common.uicommon;

import org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel;
import org.ovirt.engine.ui.uicommonweb.models.vms.IRdpNative;

/**
 * Class for generating an RDP descriptor and invoking native RDP client.
 * This method of console invocation doesn't support automatic login.
 *
 */
public class RdpNativeImpl extends AbstractRdp implements IRdpNative {

    private static final String BASE_CONFIG_FILE =
        "session bpp:i:32\n" + //$NON-NLS-1$
        "winposstr:s:0,3,0,0,800,600\n" + //$NON-NLS-1$
        "compression:i:1\n" + //$NON-NLS-1$
        "keyboardhook:i:2\n" + //$NON-NLS-1$
        "audiocapturemode:i:0\n" + //$NON-NLS-1$
        "videoplaybackmode:i:1\n" + //$NON-NLS-1$
        "connection type:i:2\n" + //$NON-NLS-1$
        "displayconnectionbar:i:1\n" + //$NON-NLS-1$
        "disable wallpaper:i:1\n" + //$NON-NLS-1$
        "allow font smoothing:i:0\n" + //$NON-NLS-1$
        "allow desktop composition:i:0\n" + //$NON-NLS-1$
        "disable full window drag:i:1\n" + //$NON-NLS-1$
        "disable menu anims:i:1\n" + //$NON-NLS-1$
        "disable themes:i:0\n" + //$NON-NLS-1$
        "disable cursor setting:i:0\n" + //$NON-NLS-1$
        "bitmapcachepersistenable:i:1\n" + //$NON-NLS-1$
        "audiomode:i:0\n" + //$NON-NLS-1$
        "redirectcomports:i:0\n" + //$NON-NLS-1$
        "redirectposdevices:i:0\n" + //$NON-NLS-1$
        "redirectdirectx:i:1\n" + //$NON-NLS-1$
        "autoreconnection enabled:i:1\n" + //$NON-NLS-1$
        "prompt for credentials:i:1\n" + //$NON-NLS-1$
        "negotiate security layer:i:1\n" + //$NON-NLS-1$
        "remoteapplicationmode:i:0\n" + //$NON-NLS-1$
        "alternate shell:s:\n" + //$NON-NLS-1$
        "shell working directory:s:\n" + //$NON-NLS-1$
        "gatewayhostname:s:\n" + //$NON-NLS-1$
        "gatewayusagemethod:i:4\n" + //$NON-NLS-1$
        "gatewaycredentialssource:i:4\n" + //$NON-NLS-1$
        "gatewayprofileusagemethod:i:0\n" + //$NON-NLS-1$
        "promptcredentialonce:i:1\n" + //$NON-NLS-1$
        "use redirection server name:i:0";//$NON-NLS-1$

    private int getScreenMode() {
        if (getFullScreen()) {
            return 2;
        }

        return 1;
    }

    //falsy value to 0; 1 otherwise
    private int booleanToInt(Boolean b) {
        if (b == null || Boolean.FALSE.equals(b)) {
            return 0;
        }

        return 1;
    }

    private String getredirectDrivesLines() {
        if (getUseLocalDrives()) {
            return "\ndrivestoredirect:s:*"; //$NON-NLS-1$
        } else {
            return "\ndrivestoredirect:s:";  //$NON-NLS-1$
        }
    }

    @Override
    public void connect() {
        StringBuilder configBuilder = new StringBuilder(BASE_CONFIG_FILE); //$NON-NLS-1$
        configBuilder.append("\nscreen mode id:i:").append(getScreenMode()); //$NON-NLS-1$
        configBuilder.append("\ndesktopwidth:i:").append(getWidth()); //$NON-NLS-1$
        configBuilder.append("\ndesktopheight:i:").append(getHeight()); //$NON-NLS-1$
        configBuilder.append("\nauthentication level:i:").append(getAuthenticationLevel()); //$NON-NLS-1$
        configBuilder.append("\nfull address:s:").append(getAddress()); //$NON-NLS-1$
        configBuilder.append("\nenablecredsspsupport:i:").append(booleanToInt(getEnableCredSspSupport())); //$NON-NLS-1$
        configBuilder.append(getredirectDrivesLines());
        configBuilder.append("\nredirectprinters:i:").append(booleanToInt(getRedirectPrinters()));//$NON-NLS-1$
        configBuilder.append("\nredirectsmartcards:i:").append(booleanToInt(getRedirectSmartCards()));//$NON-NLS-1$
        configBuilder.append("\nredirectclipboard:i:").append(booleanToInt(getRedirectClipboard()));//$NON-NLS-1$
        configBuilder.append("\nusername:s:").append(getUserNameAndDomain());//$NON-NLS-1$

        ConsoleModel.makeConsoleConfigRequest("console.rdp", "application/rdp; charset=UTF-8", configBuilder.toString());//$NON-NLS-1$$NON-NLS-2$
    }

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

}


text:
@interface ABI43_0_0RNSFullWindowOverlayManager : ABI43_0_0RCTViewManager

@end

@interface ABI43_0_0RNSFullWindowOverlayContainer : UIView

@end

@interface ABI43_0_0RNSFullWindowOverlay : ABI43_0_0RCTView <ABI43_0_0RCTInvalidating>

@end


text:
<?php

namespace Drupal\Tests\forum\Unit\Breadcrumb;

use Drupal\Core\Cache\Cache;
use Drupal\Core\Link;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\DependencyInjection\Container;

/**
 * @coversDefaultClass \Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder
 * @group forum
 */
class ForumNodeBreadcrumbBuilderTest extends UnitTestCase {

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();

    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
      ->disableOriginalConstructor()
      ->getMock();
    $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
    $container = new Container();
    $container->set('cache_contexts_manager', $cache_contexts_manager);
    \Drupal::setContainer($container);
  }

  /**
   * Tests ForumNodeBreadcrumbBuilder::applies().
   *
   * @param bool $expected
   *   ForumNodeBreadcrumbBuilder::applies() expected result.
   * @param string|null $route_name
   *   (optional) A route name.
   * @param array $parameter_map
   *   (optional) An array of parameter names and values.
   *
   * @dataProvider providerTestApplies
   * @covers ::applies
   */
  public function testApplies($expected, $route_name = NULL, $parameter_map = array()) {
    // Make some test doubles.
    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
    $config_factory = $this->getConfigFactoryStub(array());

    $forum_manager = $this->getMock('Drupal\forum\ForumManagerInterface');
    $forum_manager->expects($this->any())
      ->method('checkNodeType')
      ->will($this->returnValue(TRUE));

    // Make an object to test.
    $builder = $this->getMockBuilder('Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder')
      ->setConstructorArgs(
        array(
          $entity_manager,
          $config_factory,
          $forum_manager,
        )
      )
      ->setMethods(NULL)
      ->getMock();

    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
    $route_match->expects($this->once())
      ->method('getRouteName')
      ->will($this->returnValue($route_name));
    $route_match->expects($this->any())
      ->method('getParameter')
      ->will($this->returnValueMap($parameter_map));

    $this->assertEquals($expected, $builder->applies($route_match));
  }

  /**
   * Provides test data for testApplies().
   *
   * Note that this test is incomplete, because we can't mock NodeInterface.
   *
   * @return array
   *   Array of datasets for testApplies(). Structured as such:
   *   - ForumNodeBreadcrumbBuilder::applies() expected result.
   *   - ForumNodeBreadcrumbBuilder::applies() $attributes input array.
   */
  public function providerTestApplies() {
    // Send a Node mock, because NodeInterface cannot be mocked.
    $mock_node = $this->getMockBuilder('Drupal\node\Entity\Node')
      ->disableOriginalConstructor()
      ->getMock();

    return array(
      array(
        FALSE,
      ),
      array(
        FALSE,
        'NOT.entity.node.canonical',
      ),
      array(
        FALSE,
        'entity.node.canonical',
      ),
      array(
        FALSE,
        'entity.node.canonical',
        array(array('node', NULL)),
      ),
      array(
        TRUE,
        'entity.node.canonical',
        array(array('node', $mock_node)),
      ),
    );
  }

  /**
   * Tests ForumNodeBreadcrumbBuilder::build().
   *
   * @see \Drupal\forum\ForumNodeBreadcrumbBuilder::build()
   * @covers ::build
   */
  public function testBuild() {
    // Build all our dependencies, backwards.
    $prophecy = $this->prophesize('Drupal\taxonomy\Entity\Term');
    $prophecy->label()->willReturn('Something');
    $prophecy->id()->willReturn(1);
    $prophecy->getCacheTags()->willReturn(['taxonomy_term:1']);
    $prophecy->getCacheContexts()->willReturn([]);
    $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT);
    $term1 = $prophecy->reveal();

    $prophecy = $this->prophesize('Drupal\taxonomy\Entity\Term');
    $prophecy->label()->willReturn('Something else');
    $prophecy->id()->willReturn(2);
    $prophecy->getCacheTags()->willReturn(['taxonomy_term:2']);
    $prophecy->getCacheContexts()->willReturn([]);
    $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT);
    $term2 = $prophecy->reveal();

    $forum_manager = $this->getMockBuilder('Drupal\forum\ForumManagerInterface')
      ->disableOriginalConstructor()
      ->getMock();
    $forum_manager->expects($this->at(0))
      ->method('getParents')
      ->will($this->returnValue(array($term1)));
    $forum_manager->expects($this->at(1))
      ->method('getParents')
      ->will($this->returnValue(array($term1, $term2)));

    $prophecy = $this->prophesize('Drupal\taxonomy\VocabularyInterface');
    $prophecy->label()->willReturn('Forums');
    $prophecy->id()->willReturn(5);
    $prophecy->getCacheTags()->willReturn(['taxonomy_vocabulary:5']);
    $prophecy->getCacheContexts()->willReturn([]);
    $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT);
    $vocab_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
    $vocab_storage->expects($this->any())
      ->method('load')
      ->will($this->returnValueMap(array(
        array('forums', $prophecy->reveal()),
      )));

    $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManagerInterface')
      ->disableOriginalConstructor()
      ->getMock();
    $entity_manager->expects($this->any())
      ->method('getStorage')
      ->will($this->returnValueMap(array(
        array('taxonomy_vocabulary', $vocab_storage),
      )));

    $config_factory = $this->getConfigFactoryStub(
      array(
        'forum.settings' => array(
          'vocabulary' => 'forums',
        ),
      )
    );

    // Build a breadcrumb builder to test.
    $breadcrumb_builder = $this->getMock(
      'Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder', NULL, array(
        $entity_manager,
        $config_factory,
        $forum_manager,
      )
    );

    // Add a translation manager for t().
    $translation_manager = $this->getStringTranslationStub();
    $property = new \ReflectionProperty('Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder', 'stringTranslation');
    $property->setAccessible(TRUE);
    $property->setValue($breadcrumb_builder, $translation_manager);

    // The forum node we need a breadcrumb back from.
    $forum_node = $this->getMockBuilder('Drupal\node\Entity\Node')
      ->disableOriginalConstructor()
      ->getMock();

    // Our data set.
    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
    $route_match->expects($this->exactly(2))
      ->method('getParameter')
      ->with('node')
      ->will($this->returnValue($forum_node));

    // First test.
    $expected1 = array(
      Link::createFromRoute('Home', '<front>'),
      Link::createFromRoute('Forums', 'forum.index'),
      Link::createFromRoute('Something', 'forum.page', array('taxonomy_term' => 1)),
    );
    $breadcrumb = $breadcrumb_builder->build($route_match);
    $this->assertEquals($expected1, $breadcrumb->getLinks());
    $this->assertEquals(['route'], $breadcrumb->getCacheContexts());
    $this->assertEquals(['taxonomy_term:1', 'taxonomy_vocabulary:5'], $breadcrumb->getCacheTags());
    $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge());

    // Second test.
    $expected2 = array(
      Link::createFromRoute('Home', '<front>'),
      Link::createFromRoute('Forums', 'forum.index'),
      Link::createFromRoute('Something else', 'forum.page', array('taxonomy_term' => 2)),
      Link::createFromRoute('Something', 'forum.page', array('taxonomy_term' => 1)),
    );
    $breadcrumb = $breadcrumb_builder->build($route_match);
    $this->assertEquals($expected2, $breadcrumb->getLinks());
    $this->assertEquals(['route'], $breadcrumb->getCacheContexts());
    $this->assertEquals(['taxonomy_term:1', 'taxonomy_term:2', 'taxonomy_vocabulary:5'], $breadcrumb->getCacheTags());
    $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge());
  }

}


text:
package tools;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class GeneticMap {

	private int rate_sum;

	private List<Range> st_pos;
	private Map<Range, Double> gen_map;

	public GeneticMap() {

		this.rate_sum = 0;

		gen_map = new HashMap<Range, Double>();
		st_pos = new LinkedList<Range>();

	}

	/**
	 * For use in adding to the wrapped Map called GeneticMap. This wrapped Map
	 * is necessary because the key must be a range of positions (start and end)
	 * with the key being the recombination rate between those two positions.
	 *
	 * It is important to note that the Genetic Map values MUST be inputed in
	 * an order fashion, meaning, you can not randomly insert recombination
	 * rates but have to start from the smallest physical point to the largest
	 * physical point.
	 *
	 * @param st		Start position in base pair physical position (hg19)
	 * @param end		End position in base pair physical position (hg19)
	 * @param rate		Recombination rate in cM/Mb between the two positions
	 */
	public void put(int st, int end, double rate) {

		Range rng = new Range(st, end, st_pos.size());
		st_pos.add(new Range(st, end, st_pos.size()));
		gen_map.put(rng, new Double(rate));
		rate_sum += rate;
	}

	/**
	 * This finds the genetic map recombination rate between to positions by
	 * estimating a high-resolution genetic map
	 *
	 * Assumes that recombination rate changes uniformly between data points
	 * in order to estimate higher resolution
	 *
	 * @param Physical position of the start site
	 * @param Physical position of the target site
	 * @return The positive recombination rate between the two positions
	 */
	public double getRecombRate(int up_pos, int dwn_pos) {

		//Case 1: positions are equal and by definition no recombination
		if(up_pos == dwn_pos)
			return 0.0;

		//Case 1.5: positions cannot be found in map (invalid or beyond range)
		Range dwn_rng = getRange(dwn_pos);
		Range up_rng = null;
		Range last_rng = st_pos.get(st_pos.size() - 1);

		if(dwn_rng != null)
			up_rng = getRangeFromDwnRng(up_pos, dwn_rng);
		else if(dwn_rng == null && dwn_pos > 0 && up_pos > 0) {

			double avg_rate = (double) rate_sum / last_rng.getEnd();
			return avg_rate * (double) (up_pos - dwn_pos);
		}
		else {
			System.out.println("Fatal Error: down position " + dwn_pos + " is unacceptable. "
					+ "Check genetic map for irregularities and api for more info");
			System.exit(0);
		}

		if(up_rng == null && dwn_pos > 0 && up_pos > 0) {

			double avg_rate = (double) rate_sum / last_rng.getEnd();
			return avg_rate * (double) (up_pos - dwn_pos);
		}
		else if(up_rng == null) {
			System.out.println("Fatal Error: up position " + up_pos + " is unacceptable. "
					+ "Check genetic map for irregularities and api for more info");
			System.exit(0);
		}

		//Case 2: recombination rate can be estimated within single GenMap entry
		if(up_rng.equals(dwn_rng))
			return getLocalizedRecombRate(up_rng, up_pos, dwn_pos);

		double dwn_recomb_rate = getLocalizedRecombRate(dwn_rng, dwn_rng.getEnd(), dwn_pos);
		double up_recomb_rate = getLocalizedRecombRate(up_rng, up_pos, up_rng.getSt());

		//Case 3: recombination rate can be estimated with exactly 2 GenMap entries
		if(up_rng.getSt() == (dwn_rng.getEnd() + 1))
			return dwn_recomb_rate + up_recomb_rate;

		//Case 4: recombination rate is estimated with 2+ GenMap entries
		double tot_recomb_rate = up_recomb_rate + dwn_recomb_rate;
		int up_index = up_rng.getIndex();
		int dwn_index = dwn_rng.getIndex();

		for(int i = dwn_index + 1; i < up_index; i++) {

			Range r = st_pos.get(i);
			tot_recomb_rate += gen_map.get(r);
		}

		return tot_recomb_rate;
	}

	public double get(int pos) {

		Range key = getRange(pos);

		if(key == null)
			return 0.0;

		return gen_map.get(key);
	}

	public double get(Range r) {
		return gen_map.get(r);
	}

	public Set<Range> getRangeSet() {
		return gen_map.keySet();
	}

	public Range getRange(int pos) {

		//TODO: See if I can improve this process

		for(Range r : gen_map.keySet()) {
			if(r.getSt() <= pos && r.getEnd() >= pos)
				return r;
		}

		return null;
	}

	private Range getRangeFromDwnRng(int pos, Range rng) {

		for(int i = rng.getIndex(); i < st_pos.size(); i++) {

			Range r = st_pos.get(i);
			if(r.getSt() <= pos && r.getEnd() >= pos)
				return r;
		}

		return null;
	}

	private double getLocalizedRecombRate(Range rng, int up_pos, int dwn_pos) {

		int dist = up_pos - dwn_pos;
		double dist_ratio = (double) dist / (double) rng.getPhysRange();
		double local_recomb_rate = gen_map.get(rng) * dist_ratio;

		return local_recomb_rate;
	}
}