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

/**
 *
 * @author mahdi
 */
public class BalancedTree {

    public static void main(String[] args) {
        // Create balanced tree
        int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        TreeNode root = TreeNode.createMinimalBST(array);
        System.out.println("Root? " + root.data);
        System.out.println("Is balanced? " + isBalanced(root));

        // Could be balanced, actually, but it's very unlikely...
        TreeNode unbalanced = new TreeNode(13);
        unbalanced.data = 10;
        unbalanced.setRightChild(new TreeNode(20));
        TreeNode pointer = unbalanced;
        for (int i = 4; i >= 0; i--) {
            TreeNode treeNode = new TreeNode(i);
            pointer.setLeftChild(treeNode);
            pointer = treeNode;

        }

        System.out.println("Root? " + unbalanced.data);
        System.out.println("Is balanced? " + isBalanced(unbalanced));

    }

    public static int checkHeight(TreeNode root) {
        if (root == null) {
            return 0;

        }

        int leftHeight = checkHeight(root.left);
        if (leftHeight == -1) {
            return -1;
        }

        int rightHeight = checkHeight(root.right);
        if (rightHeight == -1) {
            return -1;
        }

        int heightDiff = leftHeight - rightHeight;
        if (Math.abs(heightDiff) > 1) {
            return -1;
        } else {
            return Math.max(leftHeight, rightHeight) + 1;
        }
    }

    public static boolean isBalanced(TreeNode root) {
        if (checkHeight(root) == -1) {
            return false;
        } else {
            return true;
        }
    }

}


text:
=head1 NAME

LedgerSMB::Report::Invoices::Transactions - AR/AP Transactions Reports for
LedgerSMB

=head1 SYNOPSIS

  my $report = LedgerSMB::Report::Invoices::Transactions(%$request);
  $report->render($request);

=cut

package LedgerSMB::Report::Invoices::Transactions;
use Moose;
extends 'LedgerSMB::Report';
with 'LedgerSMB::Report::Dates';

=head1 DESCRIPTION

The AR/AP transaction reports provide basic search capabilities for AR and AP
transactions and invoices.

=head1 CRITERIA PROPERTIES

=over

=item entity_class int

1 for vendor, 2 for customer

=cut

has entity_class => (is => 'ro', isa => 'Int', required => 1);

=item account_id

This is the account id of the AR or AP account

=cut

has account_id => (is => 'ro', isa => 'Int', required => 0);

=item entity_name text

Full text search of entity name

=cut

has entity_name => (is => 'ro', isa => 'Str', required => 0);

=item meta_number

Prefix search on entity_credit_account.meta_number

=cut

has meta_number => (is => 'ro', isa => 'Str', required => 0);

=item employee_id int

The id of the employee entity

=cut

has employee_id => (is => 'ro', isa => 'Int', required => 0);

=item manager_id

entity id of the manager

=cut

has manager_id => (is => 'ro', isa => 'Int', required => 0);

=item invnumber string

Prefix search on invoice number

=cut

has invnumber => (is => 'ro', isa => 'Str', required => 0);

=item ordnumber string

Prefix search on noted order number

=cut

has ornumber => (is => 'ro', isa => 'Str', required => 0);

=item ponumber string

Prefix search on PO number

=cut

has ponumber => (is => 'ro', isa => 'Str', required => 0);

=item partnumber string

If set only include invoices including the relevant part number (prefix search)

=cut

has partnumber => (is => 'ro', isa => 'Str', required => 0);

=item parts_id int

If set only include invoices including the specified part (exact match_

=cut

has parts_id => (is => 'ro', isa => 'Int', required => 0);

=item source string

Prefix string on source number

=cut

has source => (is => 'ro', isa => 'Str', required => 0);

=item description string

Full text search on transaction description

=cut

has description => (is => 'ro', isa => 'Str', required => 0);

=item notes

Full text search on notes field

=cut

has notes => (is => 'ro', isa => 'Str', required => 0);

=item ship_via

Full text search on shipvia column

=cut

has ship_via => (is => 'ro', isa => 'Str', required => 0);

=item on_hold bool

1 matches on-hold, 0 matches active, undef matches all.

=cut

has on_hold => (is => 'ro', isa => 'Bool', required => 0);

=item taxable bool

1 matches sales with taxes (of specified account), 0 matches non-taxable, and
undef matches all.

=cut

has taxable => (is => 'ro', isa => 'Bool', required => 0);

=item tax_account_id int

If taxable is set this filters only transactions of a specific tax account.

=cut

has tax_account_id => (is => 'ro', isa => 'Int', required => 0);

=item open bool

If true, show open invoices

=item closed bool

If true, show closed invoices.  Naturally if neither open or closed is set, no
invoices will be shown.

=cut

has open => (is => 'ro', isa => 'Bool', required => 0);
has closed => (is => 'ro', isa => 'Bool', required => 0);

=back

=head1 INTERNLS

=head2 columns

=over

=item id int

=item transdate date

=item meta_number text

This is the customer or vendor account number

=item entity_name text

This is the customer or vendor name

=item invnumber text

=item amount numeric

=item tax numeric

=item netamount numeric

=item paid numeric

=item due numeric

=item last_payment date

=item due_date date

=item notes text

=item till text

=item salesperson text

=item manager text

=item shpping_point text

=item ship_via text

=back

=cut

sub columns {
    my $self = shift;
    my $meta_number_label;
    my $entity_name_label;
    if ($self->entity_class == 1){
       $meta_number_label = LedgerSMB::Report::text('Vendor Account');
       $entity_name_label = LedgerSMB::Report::text('Vendor');
    } elsif ($self->entity_class == 2){
       $meta_number_label = LedgerSMB::Report::text('Customer Account');
       $entity_name_label = LedgerSMB::Report::text('Customer');
    }

    return [
       { col_id => 'id',
           name => LedgerSMB::Report::text('ID'),
           type => 'text'},
       { col_id => 'transdate',
           name => LedgerSMB::Report::text('Date'),
           type => 'text'},
       { col_id => 'meta_number',
           name => $meta_number_label,
           type => 'text'},
       { col_id => 'entity_name',
           name => $entity_name_label,
       href_base =>"contact.pl?action=get&entity_class=".$self->entity_class,
           type => 'href', },
       { col_id => 'invnumber',
           name => LedgerSMB::Report::text('Invoice'),
           type => 'href'},
       { col_id => 'netamount',
           name => LedgerSMB::Report::text('Amount'),
           type => 'text'},
       { col_id => 'tax',
           name => LedgerSMB::Report::text('Tax'),
           type => 'text'},
       { col_id => 'amount',
           name => LedgerSMB::Report::text('Total'),
           type => 'text'},
       { col_id => 'paid',
           name => LedgerSMB::Report::text('Paid'),
           type => 'text'},
       { col_id => 'due',
           name => LedgerSMB::Report::text('Due'),
           type => 'text'},
       { col_id => 'last_payment',
           name => LedgerSMB::Report::text('Date Paid'),
           type => 'text'},
       { col_id => 'due_date',
           name => LedgerSMB::Report::text('Due Date'),
           type => 'text'},
       { col_id => 'notes',
           name => LedgerSMB::Report::text('Notes'),
           type => 'text'},
       { col_id => 'till',
           name => LedgerSMB::Report::text('Till'),
           type => 'text'},
       { col_id => 'salesperson',
           name => LedgerSMB::Report::text('Salesperson'),
           type => 'text'},
       { col_id => 'manager',
           name => LedgerSMB::Report::text('Manager'),
           type => 'text'},
       { col_id => 'shipping_point',
           name => LedgerSMB::Report::text('Shipping Point'),
           type => 'text'},
       { col_id => 'ship_via',
           name => LedgerSMB::Report::text('Ship Via'),
           type => 'text'},
    ];
}

=head2 header_lines

# TODO

=cut

sub header_lines {
    return [];
}

=head2 name

'Search AR' or 'Search AP' depending on entity_class

=cut

sub name {
    my $self = shift;
    return LedgerSMB::Report::text('Search AP') if $self->entity_class == 1;
    return LedgerSMB::Report::text('Search AR') if $self->entity_class == 2;
}

=head1 METHODS

=head2 run_report

This runs the report and sets the $report->rows.

=cut

sub run_report {
    my $self = shift;
    $ENV{LSMB_ALWAYS_MONEY} = 1;
    my @rows = $self->call_dbmethod(funcname => 'report__aa_transactions');
    for my $r(@rows){
        my $script;
        if ($self->entity_class == 2) {
             $script = ($r->{invoice}) ? 'is.pl' : 'ar.pl';
        } else {
             $script = ($r->{invoice}) ? 'ir.pl' : 'ap.pl';
        }
        $r->{entity_name_href_suffix} =
               "&entity_id=$r->{entity_id}&meta_number=$r->{meta_number}";
        $r->{invnumber_href_suffix} = "$script?action=edit&id=$r->{id}";
    }
    $self->rows(\@rows);
}

=head1 COPYRIGHT

COPYRIGHT (C) 2012 The LedgerSMB Core Team.  This file may be re-used following
the terms of the GNU General Public License version 2 or at your option any
later version.  Please see included LICENSE.TXT for details.

=cut

__PACKAGE__->meta->make_immutable;

1;

redpajama_set_name: RedPajamaGithub


text:
anchor: Quran
title: Quran
image: img/portfolio/Quran.png
play_store: https://play.google.com/store/apps/details?id=com.fekracomputers.quran&hl=en&utm_source=github&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1
android_github_link: https://github.com/fekracomputers/QuranAndroid
website_github_link: https://github.com/fekracomputers/QuranWebsite
website_link: http://quran.islam-db.com/
---
[![Build Status](https://travis-ci.org/fekracomputers/QuranAndroid.svg?branch=master)](https://travis-ci.org/fekracomputers/QuranAndroid)

# QuranAndroid

The Quran is a free android application developed by Fekra Computers.

Application features:
- Sophisticated Index
- Recitations
- The ability to save the verse bookmark
- The ability to share verse or a link to it
- The ability to download a number of Tafsir, such as Tafsir Ibn Kathir and Al-Saadi
- highlight verse with recitation
- Search in the Qur'an and Tafsir
- Night mode
- Repeat the recitation
- High-quality Quran images

## Note:
This is **NOT** a fork of [Quran Android](https://github.com/quran/quran_android) however it is influnced by its UI design

## contribution
- originally develoed by [Mohamed Mo'men](https://github.com/mmoamenn) @ fekracomputers


text:
from alembic import op
import sqlalchemy as sa

def upgrade():
    # hyper-v
    op.create_table(
        'hyperv_vlan_allocations',
        sa.Column('physical_network', sa.String(length=64), nullable=False),
        sa.Column('vlan_id', sa.Integer(), autoincrement=False,
                  nullable=False),
        sa.Column('allocated', sa.Boolean(), nullable=False),
        sa.PrimaryKeyConstraint('physical_network', 'vlan_id'))

    op.create_table(
        'hyperv_network_bindings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('network_type', sa.String(length=32), nullable=False),
        sa.Column('physical_network', sa.String(length=64), nullable=True),
        sa.Column('segmentation_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id'))

    # metaplugin
    op.create_table(
        'networkflavors',
        sa.Column('flavor', sa.String(length=255), nullable=True),
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id'))

    op.create_table(
        'routerflavors',
        sa.Column('flavor', sa.String(length=255), nullable=True),
        sa.Column('router_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('router_id'))

    # big switch
    op.create_table(
        'routerrules',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('source', sa.String(length=64), nullable=False),
        sa.Column('destination', sa.String(length=64), nullable=False),
        sa.Column('action', sa.String(length=10), nullable=False),
        sa.Column('router_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id'))

    op.create_table(
        'nexthops',
        sa.Column('rule_id', sa.Integer(), nullable=False),
        sa.Column('nexthop', sa.String(length=64), nullable=False),
        sa.ForeignKeyConstraint(['rule_id'], ['routerrules.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('rule_id', 'nexthop'))

    op.create_table(
        'consistencyhashes',
        sa.Column('hash_id', sa.String(255), primary_key=True),
        sa.Column('hash', sa.String(255), nullable=False)
    )


text:
using System;

namespace SimpleService
{
    /// <summary>
    /// A handler entry.
    /// </summary>
    internal struct Handler
    {
        public Visibility Visibility;
        public string Service;
        public Delegate Action;
    }
}


text:
@interface YDFroidController : UICollectionViewController

@property (nonatomic, copy) NSString * category;
@end


text:
@interface UIView (Util)

- (NSString *)localizableString:(NSString *)string;

- (void)setTextWithLocalizableString:(NSString *)string;

- (void)acessibilityLabelEqualsText;
- (void)acessibilityLabelWithLocalizableString:(NSString *)string;

- (NSDictionary *)getContentFromPlist:(NSString *)pListName;

@end


text:
import * as React from 'react';
import { StandardProps } from '..';

export interface FormLabelProps extends StandardProps<
  React.LabelHTMLAttributes<HTMLLabelElement>,
  FormLabelClassKey
> {
  disabled?: boolean;
  error?: boolean;
  focused?: boolean;
  required?: boolean;
}

export type FormLabelClassKey =
  | 'root'
  | 'focused'
  | 'error'
  | 'disabled'
  ;

declare const FormLabel: React.ComponentType<FormLabelProps>;

export default FormLabel;


text:
var okcoin = require('../..');
var future = okcoin.PublicApi.future;
future.ticker('btc_usd', future.CONTRACT_TYPE.THIS_WEEK).then(console.log)


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

{% block headtitle %}

{% trans "Create course "%}

{% trans "Scope Management" %}

{% endblock %}

{% block content %}
{% include "organisation/navigation.html" %}

{% if lecturers.count = 0 %}

{% trans "Ooops" %}

{% blocktrans %}You need to create at least one lecturer in order to create a course.{% endblocktrans %}

{% else %}

{% trans "Basic information" %}

	<form method="post" action="{% url organisation-course-mgmt-create organisation.id %}">
	<fieldset>
		{% csrf_token %}
		{% trans "Name" %}:
		<input tabindex="1" id="name" name="name" type="text" maxlength="255" value="{{name}}" />

		{% trans "Category" %}:
		<select name="category" id="category">
			<option value=""></option>
			{% for cate in categories %}
				<option value="{{cate.pk}}"{%if cate.pk = category.pk %} selected{%endif%}>{{cate.name}}</option>
			{% endfor %}
		</select>

		{% trans "Lecturer" %}:
		<select name="lecturer" id="lecturer">
			<option value=""></option>
			{% for lec in lecturers %}
				<option value="{{lec.pk}}"{%if lec.pk = lecturer.pk %} selected{%endif%}>{{lec.name}}</option>
			{% endfor %}
		</select>

		{% trans "Semester" %}:
		<select name="semester" id="semester">
			<option value=""></option>
			{% for sem in semesters %}
				<option value="{{sem}}"{%if sem = semester%} selected{%endif%}>{%if sem == -1%}{% trans "All semesters "%}{% else %}{{sem}}{% endif %}</option>
			{% endfor %}
		</select>
		<input type="submit" value="{% trans "Create course" %}" />
	</fieldset>
	</form>

{% trans "Help" %}

{% blocktrans %}Scopes{% endblocktrans %}

{% blocktrans %}After you created the course, you are able to assign scopes to it.{% endblocktrans %}

{% endif %}

{% endblock %}


text:
#ifndef InputType_h
#define InputType_h

#include "HTMLTextFormControlElement.h"
#include "RenderPtr.h"
#include "StepRange.h"
#include <wtf/FastMalloc.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>

#if PLATFORM(IOS)
#include "DateComponents.h"
#endif

namespace WebCore {

class BeforeTextInsertedEvent;
class Chrome;
class DateComponents;
class DragData;
class Event;
class FileList;
class FormDataList;
class HTMLElement;
class HTMLFormElement;
class HTMLInputElement;
class Icon;
class KeyboardEvent;
class MouseEvent;
class Node;
class RenderStyle;
class TouchEvent;
class TextControlInnerTextElement;

struct InputElementClickState;

typedef int ExceptionCode;

// An InputType object represents the type-specific part of an HTMLInputElement.
// Do not expose instances of InputType and classes derived from it to classes
// other than HTMLInputElement.
class InputType {
    WTF_MAKE_NONCOPYABLE(InputType);
    WTF_MAKE_FAST_ALLOCATED;

public:
    static std::unique_ptr<InputType> create(HTMLInputElement&, const AtomicString&);
    static std::unique_ptr<InputType> createText(HTMLInputElement&);
    virtual ~InputType();

    static bool themeSupportsDataListUI(InputType*);

    virtual const AtomicString& formControlType() const = 0;
    virtual bool canChangeFromAnotherType() const;

    // Type query functions

    // Any time we are using one of these functions it's best to refactor
    // to add a virtual function to allow the input type object to do the
    // work instead, or at least make a query function that asks a higher
    // level question. These functions make the HTMLInputElement class
    // inflexible because it's harder to add new input types if there is
    // scattered code with special cases for various types.

    virtual bool isCheckbox() const;
    virtual bool isDateField() const;
    virtual bool isDateTimeField() const;
    virtual bool isDateTimeLocalField() const;
    virtual bool isEmailField() const;
    virtual bool isFileUpload() const;
    virtual bool isHiddenType() const;
    virtual bool isImageButton() const;
    virtual bool supportLabels() const;
    virtual bool isMonthField() const;
    virtual bool isNumberField() const;
    virtual bool isPasswordField() const;
    virtual bool isRadioButton() const;
    virtual bool isRangeControl() const;
    virtual bool isSearchField() const;
    virtual bool isSubmitButton() const;
    virtual bool isTelephoneField() const;
    virtual bool isTextButton() const;
    virtual bool isTextField() const;
    virtual bool isTextType() const;
    virtual bool isTimeField() const;
    virtual bool isURLField() const;
    virtual bool isWeekField() const;

#if ENABLE(INPUT_TYPE_COLOR)
    virtual bool isColorControl() const;
#endif

    // Form value functions

    virtual bool shouldSaveAndRestoreFormControlState() const;
    virtual FormControlState saveFormControlState() const;
    virtual void restoreFormControlState(const FormControlState&);
    virtual bool isFormDataAppendable() const;
    virtual bool appendFormData(FormDataList&, bool multipart) const;

    // DOM property functions

    virtual bool getTypeSpecificValue(String&); // Checked first, before internal storage or the value attribute.
    virtual String fallbackValue() const; // Checked last, if both internal storage and value attribute are missing.
    virtual String defaultValue() const; // Checked after even fallbackValue, only when the valueWithDefault function is called.
    virtual double valueAsDate() const;
    virtual void setValueAsDate(double, ExceptionCode&) const;
    virtual double valueAsDouble() const;
    virtual void setValueAsDouble(double, TextFieldEventBehavior, ExceptionCode&) const;
    virtual void setValueAsDecimal(const Decimal&, TextFieldEventBehavior, ExceptionCode&) const;

    // Validation functions
    virtual String validationMessage() const;
    virtual bool supportsValidation() const;
    virtual bool typeMismatchFor(const String&) const;
    // Type check for the current input value. We do nothing for some types
    // though typeMismatchFor() does something for them because of value
    // sanitization.
    virtual bool typeMismatch() const;
    virtual bool supportsRequired() const;
    virtual bool valueMissing(const String&) const;
    virtual bool hasBadInput() const;
    virtual bool patternMismatch(const String&) const;
    bool rangeUnderflow(const String&) const;
    bool rangeOverflow(const String&) const;
    bool isInRange(const String&) const;
    bool isOutOfRange(const String&) const;
    virtual Decimal defaultValueForStepUp() const;
    double minimum() const;
    double maximum() const;
    virtual bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const;
    virtual float decorationWidth() const;
    bool stepMismatch(const String&) const;
    virtual bool getAllowedValueStep(Decimal*) const;
    virtual StepRange createStepRange(AnyStepHandling) const;
    virtual void stepUp(int, ExceptionCode&);
    virtual void stepUpFromRenderer(int);
    virtual String badInputText() const;
    virtual String typeMismatchText() const;
    virtual String valueMissingText() const;
    virtual bool canSetStringValue() const;
    virtual String localizeValue(const String&) const;
    virtual String visibleValue() const;
    // Returing the null string means "use the default value."
    // This function must be called only by HTMLInputElement::sanitizeValue().
    virtual String sanitizeValue(const String&) const;

    // Event handlers

    virtual void handleClickEvent(MouseEvent*);
    virtual void handleMouseDownEvent(MouseEvent*);
    virtual void willDispatchClick(InputElementClickState&);
    virtual void didDispatchClick(Event*, const InputElementClickState&);
    virtual void handleDOMActivateEvent(Event*);
    virtual void handleKeydownEvent(KeyboardEvent*);
    virtual void handleKeypressEvent(KeyboardEvent*);
    virtual void handleKeyupEvent(KeyboardEvent*);
    virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*);
    virtual void forwardEvent(Event*);

#if ENABLE(TOUCH_EVENTS)
    virtual void handleTouchEvent(TouchEvent*);
#endif

    // Helpers for event handlers.
    virtual bool shouldSubmitImplicitly(Event*);
    virtual PassRefPtr<HTMLFormElement> formForSubmission() const;
    virtual bool hasCustomFocusLogic() const;
    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
    virtual bool isMouseFocusable() const;
    virtual bool shouldUseInputMethod() const;
    virtual void handleFocusEvent(Node* oldFocusedNode, FocusDirection);
    virtual void handleBlurEvent();
    virtual void accessKeyAction(bool sendMouseEvents);
    virtual bool canBeSuccessfulSubmitButton();
    virtual void subtreeHasChanged();

#if ENABLE(TOUCH_EVENTS)
    virtual bool hasTouchEventHandler() const;
#endif

    virtual void blur();

    // Shadow tree handling

    virtual void createShadowSubtree();
    virtual void destroyShadowSubtree();

    virtual HTMLElement* containerElement() const { return nullptr; }
    virtual HTMLElement* innerBlockElement() const { return nullptr; }
    virtual TextControlInnerTextElement* innerTextElement() const { return nullptr; }
    virtual HTMLElement* innerSpinButtonElement() const { return nullptr; }
    virtual HTMLElement* resultsButtonElement() const { return nullptr; }
    virtual HTMLElement* cancelButtonElement() const { return nullptr; }
    virtual HTMLElement* sliderThumbElement() const { return nullptr; }
    virtual HTMLElement* sliderTrackElement() const { return nullptr; }
    virtual HTMLElement* placeholderElement() const;

#if ENABLE(INPUT_SPEECH)
    virtual HTMLElement* speechButtonElement() const { return nullptr; }
#endif

    // Miscellaneous functions

    virtual bool rendererIsNeeded();
    virtual RenderPtr<RenderElement> createInputRenderer(PassRef<RenderStyle>);
    virtual void addSearchResult();
    virtual void attach();
    virtual void detach();
    virtual void minOrMaxAttributeChanged();
    virtual void stepAttributeChanged();
    virtual void altAttributeChanged();
    virtual void srcAttributeChanged();
    virtual bool shouldRespectAlignAttribute();
    virtual FileList* files();
    virtual void setFiles(PassRefPtr<FileList>);
#if ENABLE(DRAG_SUPPORT)
    // Should return true if the given DragData has more than one dropped files.
    virtual bool receiveDroppedFiles(const DragData&);
#endif
    virtual Icon* icon() const;
#if PLATFORM(IOS)
    virtual String displayString() const;
#endif

    // Should return true if the corresponding renderer for a type can display a suggested value.
    virtual bool canSetSuggestedValue();
    virtual bool shouldSendChangeEventAfterCheckedChanged();
    virtual bool canSetValue(const String&);
    virtual bool storesValueSeparateFromAttribute();
    virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior);
    virtual bool shouldResetOnDocumentActivation();
    virtual bool shouldRespectListAttribute();
    virtual bool shouldRespectSpeechAttribute();
    virtual bool isEnumeratable();
    virtual bool isCheckable();
    virtual bool isSteppable() const;
    virtual bool shouldRespectHeightAndWidthAttributes();
    virtual bool supportsPlaceholder() const;
    virtual bool supportsReadOnly() const;
    virtual void updateInnerTextValue();
    virtual void updatePlaceholderText();
    virtual void attributeChanged();
    virtual void multipleAttributeChanged();
    virtual void disabledAttributeChanged();
    virtual void readonlyAttributeChanged();
    virtual void requiredAttributeChanged();
    virtual void valueAttributeChanged();
    virtual String defaultToolTip() const;
    virtual void updateClearButtonVisibility();

#if ENABLE(DATALIST_ELEMENT)
    virtual void listAttributeTargetChanged();
    virtual Decimal findClosestTickMarkValue(const Decimal&);
#endif

    // Parses the specified string for the type, and return
    // the Decimal value for the parsing result if the parsing
    // succeeds; Returns defaultValue otherwise. This function can
    // return NaN or Infinity only if defaultValue is NaN or Infinity.
    virtual Decimal parseToNumber(const String&, const Decimal& defaultValue) const;

    // Parses the specified string for this InputType, and returns true if it
    // is successfully parsed. An instance pointed by the DateComponents*
    // parameter will have parsed values and be modified even if the parsing
    // fails. The DateComponents* parameter may be 0.
    virtual bool parseToDateComponents(const String&, DateComponents*) const;

    // Create a string representation of the specified Decimal value for the
    // input type. If NaN or Infinity is specified, this returns an empty
    // string. This should not be called for types without valueAsNumber.
    virtual String serialize(const Decimal&) const;

#if PLATFORM(IOS)
    virtual DateComponents::Type dateType() const;
#endif

    virtual bool supportsIndeterminateAppearance() const;

    virtual bool supportsSelectionAPI() const;

    // Gets width and height of the input element if the type of the
    // element is image. It returns 0 if the element is not image type.
    virtual unsigned height() const;
    virtual unsigned width() const;

    void dispatchSimulatedClickIfActive(KeyboardEvent*) const;

protected:
    explicit InputType(HTMLInputElement& element) : m_element(element) { }
    HTMLInputElement& element() const { return m_element; }
    Chrome* chrome() const;
    Decimal parseToNumberOrNaN(const String&) const;

private:
    // Helper for stepUp()/stepDown(). Adds step value * count to the current value.
    void applyStep(int count, AnyStepHandling, TextFieldEventBehavior, ExceptionCode&);

    // Raw pointer because the HTMLInputElement object owns this InputType object.
    HTMLInputElement& m_element;
};

} // namespace WebCore
#endif


text:
package granulej.gui.action;

import granulej.bean.MyTreeNode;
import granulej.bean.TreeNodeType;
import granulej.gui.MainFrame;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.tree.DefaultMutableTreeNode;

import config.GUIConfig;

public class NewInterfaceAction implements ActionListener {
	private MainFrame main;
	private GUIConfig config;

	public NewInterfaceAction(MainFrame main, GUIConfig config) {
		this.main = main;
		this.config = config;
	}

	public void actionPerformed(ActionEvent arg0) {
		// System.out.println(arg0.getActionCommand());
		main.setEnabled(false);

		// main.set
		final JFrame iframe = new JFrame("New Interface ");

		Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize();
		iframe.setSize(500, 250);
		iframe.setLocation((screensize.width - 350) / 2,
				(screensize.height - 250) / 2);
		iframe.setVisible(true);
		iframe.setResizable(false);

		iframe.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				main.setEnabled(true);
			}
		});

		GridBagLayout gridbag = new GridBagLayout();
		GridBagConstraints c = new GridBagConstraints();
		iframe.getContentPane().setLayout(gridbag);
		JLabel name = new JLabel("Project name:");
		addComponent(iframe, gridbag, c, name, 0, 0, 1, 1, 5, 5);
		final JTextField pname = new JTextField(35);
		pname.setEditable(false);
		pname.setText(config.getProjectName());
		addComponent(iframe, gridbag, c, pname, 0, 1, 1, 3, 5, 5);
		JLabel pkgName = new JLabel("Package name:");
		addComponent(iframe, gridbag, c, pkgName, 1, 0, 1, 1, 5, 5);
		final JTextField pkg = new JTextField(35);
		addComponent(iframe, gridbag, c, pkg, 1, 1, 1, 2, 5, 5);
		JLabel clsName = new JLabel("Interface name:");
		addComponent(iframe, gridbag, c, clsName, 2, 0, 1, 1, 5, 5);
		final JTextField cls = new JTextField(35);
		addComponent(iframe, gridbag, c, cls, 2, 1, 1, 2, 5, 5);

		JButton btnConfirm = new JButton("Finish");
		DefaultMutableTreeNode tnode = config.getSelect();
		MyTreeNode sel = tnode == null ? null : (MyTreeNode) tnode
				.getUserObject();
		if (sel != null && sel.getType() == TreeNodeType.PACKAGE) {
			pkg.setText(sel.getName());
		}
		pkg.setEditable(false);

		JLabel tname = new JLabel("  ");
		addComponent(iframe, gridbag, c, tname, 3, 0, 1, 1, 5, 5);

		btnConfirm.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				String name = cls.getText();
				if (name.endsWith(".java")) {
					name = name.substring(0, name.lastIndexOf(".java"));
				}

				String pkgText = pkg.getText().trim();
				String pnameText = pname.getText().trim();
				if (pnameText == null || pnameText.length() == 0) {
					JOptionPane.showMessageDialog(null, "Please create a project !","Error",JOptionPane.ERROR_MESSAGE);
					return;
				}
				if (pkgText == null || pkgText.length() == 0) {
					JOptionPane.showMessageDialog(null, "Please choose a package !","Error",JOptionPane.ERROR_MESSAGE);
					return;
				} else {
					Pattern p = Pattern.compile("(_|[a-zA-Z])+([a-zA-Z0-9_])*");
					Matcher m = p.matcher(name);
					if (!m.matches()) {
						JOptionPane.showMessageDialog(null, "The type name is not a valid identifier !","Error",JOptionPane.ERROR_MESSAGE);
						return;
					}
				}

				iframe.dispose();
				config.setProjectName(pnameText);
				main.setVisible(true);
				main.setEnabled(true);

				String temp = "";
				if (pkgText.equals("(default package)"))
					temp = config.getProjectSrcPath() + File.separator + name
							+ ".java";
				else
					temp = config.getProjectSrcPath() + File.separator
							+ pkgText.replace(".", File.separator)
							+ File.separator + name + ".java";
				File dir = new File(temp);

				try {
					if (!dir.createNewFile()) {
						JOptionPane.showMessageDialog(null, "Failed to create the interface file","Error",JOptionPane.ERROR_MESSAGE);
						return;
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
				config.fileAndPath.put(name + ".java", temp);
				main.getPackageTree().newClass(name + ".java");
			}
		});

		addComponent(iframe, gridbag, c, btnConfirm, 4, 1, 1, 1, 5, 5);
		JButton btnConcel = new JButton("Cancel");
		btnConcel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				iframe.dispose();
				main.setVisible(true);
				main.setEnabled(true);
				main.validate();
			}
		});
		addComponent(iframe, gridbag, c, btnConcel, 4, 2, 1, 1, 5, 5);
	}

	protected void addComponent(Container container, GridBagLayout layout,
			GridBagConstraints constraints, Component componentToAdd, int row,
			int column, int height, int width, int x, int y) {
		constraints.gridx = column; // 组件所在列
		constraints.gridy = row; // 组件所在行

		constraints.gridwidth = width; // 组件宽度
		constraints.gridheight = height; // 组件高度

		constraints.weightx = 0; // 组件在水平方向的拉伸能力
		constraints.weighty = 0; // 组件在垂直方向的拉伸能力

		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.anchor = GridBagConstraints.WEST;
		constraints.fill = GridBagConstraints.NONE;

		layout.setConstraints(componentToAdd, constraints); // 设置目标组件的约束
		container.add(componentToAdd); // 在容器中添加目标组件
	}
}


text:
namespace Gerenciador.Repository.EntityFramwork.Migrations
{
    using System.CodeDom.Compiler;
    using System.Data.Entity.Migrations;
    using System.Data.Entity.Migrations.Infrastructure;
    using System.Resources;

    [GeneratedCode("EntityFramework.Migrations", "6.1.1-30610")]
    public sealed partial class AddEventSnapshot : IMigrationMetadata
    {
        private readonly ResourceManager Resources = new ResourceManager(typeof(AddEventSnapshot));

        string IMigrationMetadata.Id
        {
            get { return "201410182226250_AddEventSnapshot"; }
        }

        string IMigrationMetadata.Source
        {
            get { return null; }
        }

        string IMigrationMetadata.Target
        {
            get { return Resources.GetString("Target"); }
        }
    }
}


text:
require "SimpleITK"

if #arg < 3 then
  print ( "Usage: SimpleGaussian <input> <sigma> <output>" )
  os.exit ( 1 )
end

reader = SimpleITK.ImageFileReader()
-- Remember that Lua arrays are 1-based, and that arg does not contain the application name!
reader:SetFileName ( arg[1] )
image = reader:Execute();

inputPixelType = image:GetPixelID()

gaussian = SimpleITK.SmoothingRecursiveGaussianImageFilter()
gaussian:SetSigma ( arg[2] )
image = gaussian:Execute ( image );

caster = SimpleITK.CastImageFilter();
caster:SetOutputPixelType( inputPixelType );
image = caster:Execute( image )

writer = SimpleITK.ImageFileWriter()
writer:SetFileName ( arg[3] )
writer:Execute ( image );


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package frame;
import alcollectors.MoCr_SettingsAL;
/**
 *
 * @author Jonas
 */
public class MoCr_Frame_Settings extends javax.swing.JFrame {

    MoCr_SettingsAL myAL;

    public MoCr_Frame_Settings(MoCr_Frame f) {
        initComponents();
        myAL = new MoCr_SettingsAL(f, this);
        MoCr_SettingsFrame_ResetButton.addActionListener(myAL);
        MoCr_SettingsFrame_Validation.addActionListener(myAL);
        MoCr_SettingsFrame_Colourbox.addActionListener(myAL);
    }

    public void renewalRoutine(String in) {
        MoCr_SettingsFrame_AlphabetField.setText(in);
        MoCr_SettingsFrame_ClearBox.setSelectedIndex(0);
    }

    public boolean isCheckboxSelected() {
        return MoCr_SettingsFrame_Checkbox.isSelected();
    }

    public String getAlphabetInput() {
        return MoCr_SettingsFrame_AlphabetField.getText();
    }

    public void setStandardAlphabet() {
        MoCr_SettingsFrame_AlphabetField.setText("abcdefghijklmnopqrstuvwxyz");
    }

    public int getClearBoxIndex() {
        return MoCr_SettingsFrame_ClearBox.getSelectedIndex();
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        MoCr_SettingsFrame_Heading1 = new javax.swing.JLabel();
        MoCr_SettingsFrame_AlphabetField = new javax.swing.JTextField();
        MoCr_SettingsFrame_Checkbox = new javax.swing.JCheckBox();
        MoCr_SettingsFrame_Validation = new javax.swing.JButton();
        MoCr_SettingsFrame_ResetButton = new javax.swing.JButton();
        MoCr_SettingsFrame_ClearBox = new javax.swing.JComboBox<>();
        MoCr_SettingsFrame_Colourbox = new javax.swing.JComboBox<>();
        jLabel1 = new javax.swing.JLabel();

        setTitle("Einstellungen");
        setResizable(false);
        setType(java.awt.Window.Type.UTILITY);

        MoCr_SettingsFrame_Heading1.setFont(new java.awt.Font("Constantia", 1, 18)); // NOI18N
        MoCr_SettingsFrame_Heading1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        MoCr_SettingsFrame_Heading1.setText("Alphabet ändern");

        MoCr_SettingsFrame_AlphabetField.setFont(new java.awt.Font("Liberation Sans", 0, 18)); // NOI18N
        MoCr_SettingsFrame_AlphabetField.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        MoCr_SettingsFrame_Checkbox.setFont(new java.awt.Font("Constantia", 0, 14)); // NOI18N
        MoCr_SettingsFrame_Checkbox.setText("Vergrößerbarkeit des Hauptfensters aktiviert");

        MoCr_SettingsFrame_Validation.setFont(new java.awt.Font("Constantia", 0, 14)); // NOI18N
        MoCr_SettingsFrame_Validation.setText("Änderungen speichern");

        MoCr_SettingsFrame_ResetButton.setFont(new java.awt.Font("Constantia", 0, 14)); // NOI18N
        MoCr_SettingsFrame_ResetButton.setText("Standardalphabet wiederherstellen");

        MoCr_SettingsFrame_ClearBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Kein Feld leeren", "Alle Felder leeren", "Lokale Felder leeren", "Alle Schlüsselfelder leeren", "Ein- und Ausgabefelder leeren" }));

        MoCr_SettingsFrame_Colourbox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Blau", "Grün", "Gelb", "Rosa" }));

        jLabel1.setFont(new java.awt.Font("Constantia", 1, 12)); // NOI18N
        jLabel1.setText("Fensterfarbe");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(MoCr_SettingsFrame_Heading1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(MoCr_SettingsFrame_AlphabetField)
                    .addComponent(MoCr_SettingsFrame_ResetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(MoCr_SettingsFrame_Checkbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(MoCr_SettingsFrame_Colourbox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(MoCr_SettingsFrame_ClearBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addComponent(MoCr_SettingsFrame_Validation, javax.swing.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(MoCr_SettingsFrame_Heading1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(MoCr_SettingsFrame_AlphabetField, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(MoCr_SettingsFrame_ResetButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(MoCr_SettingsFrame_Checkbox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(MoCr_SettingsFrame_Colourbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(MoCr_SettingsFrame_ClearBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(MoCr_SettingsFrame_Validation)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField MoCr_SettingsFrame_AlphabetField;
    private javax.swing.JCheckBox MoCr_SettingsFrame_Checkbox;
    private javax.swing.JComboBox<String> MoCr_SettingsFrame_ClearBox;
    public javax.swing.JComboBox<String> MoCr_SettingsFrame_Colourbox;
    private javax.swing.JLabel MoCr_SettingsFrame_Heading1;
    public javax.swing.JButton MoCr_SettingsFrame_ResetButton;
    public javax.swing.JButton MoCr_SettingsFrame_Validation;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}


text:
require 'spec_helper'

describe SlashCommands::InterpretService, services: true do
  let(:project) { create(:empty_project, :public) }
  let(:developer) { create(:user) }
  let(:issue) { create(:issue, project: project) }
  let(:milestone) { create(:milestone, project: project, title: '9.10') }
  let(:inprogress) { create(:label, project: project, title: 'In Progress') }
  let(:bug) { create(:label, project: project, title: 'Bug') }

  before do
    project.team << [developer, :developer]
  end

  describe '#execute' do
    let(:service) { described_class.new(project, developer) }
    let(:merge_request) { create(:merge_request, source_project: project) }

    shared_examples 'reopen command' do
      it 'returns state_event: "reopen" if content contains /reopen' do
        issuable.close!
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(state_event: 'reopen')
      end
    end

    shared_examples 'close command' do
      it 'returns state_event: "close" if content contains /close' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(state_event: 'close')
      end
    end

    shared_examples 'title command' do
      it 'populates title: "A brand new title" if content contains /title A brand new title' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(title: 'A brand new title')
      end
    end

    shared_examples 'assign command' do
      it 'fetches assignee and populates assignee_id if content contains /assign' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(assignee_id: developer.id)
      end
    end

    shared_examples 'unassign command' do
      it 'populates assignee_id: nil if content contains /unassign' do
        issuable.update(assignee_id: developer.id)
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(assignee_id: nil)
      end
    end

    shared_examples 'milestone command' do
      it 'fetches milestone and populates milestone_id if content contains /milestone' do
        milestone # populate the milestone
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(milestone_id: milestone.id)
      end
    end

    shared_examples 'remove_milestone command' do
      it 'populates milestone_id: nil if content contains /remove_milestone' do
        issuable.update(milestone_id: milestone.id)
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(milestone_id: nil)
      end
    end

    shared_examples 'label command' do
      it 'fetches label ids and populates add_label_ids if content contains /label' do
        bug # populate the label
        inprogress # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(add_label_ids: [bug.id, inprogress.id])
      end
    end

    shared_examples 'multiple label command' do
      it 'fetches label ids and populates add_label_ids if content contains multiple /label' do
        bug # populate the label
        inprogress # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(add_label_ids: [inprogress.id, bug.id])
      end
    end

    shared_examples 'multiple label with same argument' do
      it 'prevents duplicate label ids and populates add_label_ids if content contains multiple /label' do
        inprogress # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(add_label_ids: [inprogress.id])
      end
    end

    shared_examples 'unlabel command' do
      it 'fetches label ids and populates remove_label_ids if content contains /unlabel' do
        issuable.update(label_ids: [inprogress.id]) # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(remove_label_ids: [inprogress.id])
      end
    end

    shared_examples 'multiple unlabel command' do
      it 'fetches label ids and populates remove_label_ids if content contains  mutiple /unlabel' do
        issuable.update(label_ids: [inprogress.id, bug.id]) # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(remove_label_ids: [inprogress.id, bug.id])
      end
    end

    shared_examples 'unlabel command with no argument' do
      it 'populates label_ids: [] if content contains /unlabel with no arguments' do
        issuable.update(label_ids: [inprogress.id]) # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(label_ids: [])
      end
    end

    shared_examples 'relabel command' do
      it 'populates label_ids: [] if content contains /relabel' do
        issuable.update(label_ids: [bug.id]) # populate the label
        inprogress # populate the label
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(label_ids: [inprogress.id])
      end
    end

    shared_examples 'todo command' do
      it 'populates todo_event: "add" if content contains /todo' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(todo_event: 'add')
      end
    end

    shared_examples 'done command' do
      it 'populates todo_event: "done" if content contains /done' do
        TodoService.new.mark_todo(issuable, developer)
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(todo_event: 'done')
      end
    end

    shared_examples 'subscribe command' do
      it 'populates subscription_event: "subscribe" if content contains /subscribe' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(subscription_event: 'subscribe')
      end
    end

    shared_examples 'unsubscribe command' do
      it 'populates subscription_event: "unsubscribe" if content contains /unsubscribe' do
        issuable.subscribe(developer)
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(subscription_event: 'unsubscribe')
      end
    end

    shared_examples 'due command' do
      it 'populates due_date: Date.new(2016, 8, 28) if content contains /due 2016-08-28' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(due_date: defined?(expected_date) ? expected_date : Date.new(2016, 8, 28))
      end
    end

    shared_examples 'remove_due_date command' do
      it 'populates due_date: nil if content contains /remove_due_date' do
        issuable.update(due_date: Date.today)
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(due_date: nil)
      end
    end

    shared_examples 'wip command' do
      it 'returns wip_event: "wip" if content contains /wip' do
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(wip_event: 'wip')
      end
    end

    shared_examples 'unwip command' do
      it 'returns wip_event: "unwip" if content contains /wip' do
        issuable.update(title: issuable.wip_title)
        _, updates = service.execute(content, issuable)

        expect(updates).to eq(wip_event: 'unwip')
      end
    end

    shared_examples 'empty command' do
      it 'populates {} if content contains an unsupported command' do
        _, updates = service.execute(content, issuable)

        expect(updates).to be_empty
      end
    end

    it_behaves_like 'reopen command' do
      let(:content) { '/reopen' }
      let(:issuable) { issue }
    end

    it_behaves_like 'reopen command' do
      let(:content) { '/reopen' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'close command' do
      let(:content) { '/close' }
      let(:issuable) { issue }
    end

    it_behaves_like 'close command' do
      let(:content) { '/close' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'title command' do
      let(:content) { '/title A brand new title' }
      let(:issuable) { issue }
    end

    it_behaves_like 'title command' do
      let(:content) { '/title A brand new title' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'empty command' do
      let(:content) { '/title' }
      let(:issuable) { issue }
    end

    it_behaves_like 'assign command' do
      let(:content) { "/assign @#{developer.username}" }
      let(:issuable) { issue }
    end

    it_behaves_like 'assign command' do
      let(:content) { "/assign @#{developer.username}" }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'empty command' do
      let(:content) { '/assign @abcd1234' }
      let(:issuable) { issue }
    end

    it_behaves_like 'empty command' do
      let(:content) { '/assign' }
      let(:issuable) { issue }
    end

    it_behaves_like 'unassign command' do
      let(:content) { '/unassign' }
      let(:issuable) { issue }
    end

    it_behaves_like 'unassign command' do
      let(:content) { '/unassign' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'milestone command' do
      let(:content) { "/milestone %#{milestone.title}" }
      let(:issuable) { issue }
    end

    it_behaves_like 'milestone command' do
      let(:content) { "/milestone %#{milestone.title}" }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'remove_milestone command' do
      let(:content) { '/remove_milestone' }
      let(:issuable) { issue }
    end

    it_behaves_like 'remove_milestone command' do
      let(:content) { '/remove_milestone' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'label command' do
      let(:content) { %(/label ~"#{inprogress.title}" ~#{bug.title} ~unknown) }
      let(:issuable) { issue }
    end

    it_behaves_like 'label command' do
      let(:content) { %(/label ~"#{inprogress.title}" ~#{bug.title} ~unknown) }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'multiple label command' do
      let(:content) { %(/label ~"#{inprogress.title}" \n/label ~#{bug.title}) }
      let(:issuable) { issue }
    end

    it_behaves_like 'multiple label with same argument' do
      let(:content) { %(/label ~"#{inprogress.title}" \n/label ~#{inprogress.title}) }
      let(:issuable) { issue }
    end

    it_behaves_like 'unlabel command' do
      let(:content) { %(/unlabel ~"#{inprogress.title}") }
      let(:issuable) { issue }
    end

    it_behaves_like 'unlabel command' do
      let(:content) { %(/unlabel ~"#{inprogress.title}") }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'multiple unlabel command' do
      let(:content) { %(/unlabel ~"#{inprogress.title}" \n/unlabel ~#{bug.title}) }
      let(:issuable) { issue }
    end

    it_behaves_like 'unlabel command with no argument' do
      let(:content) { %(/unlabel) }
      let(:issuable) { issue }
    end

    it_behaves_like 'unlabel command with no argument' do
      let(:content) { %(/unlabel) }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'relabel command' do
      let(:content) { %(/relabel ~"#{inprogress.title}") }
      let(:issuable) { issue }
    end

    it_behaves_like 'relabel command' do
      let(:content) { %(/relabel ~"#{inprogress.title}") }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'todo command' do
      let(:content) { '/todo' }
      let(:issuable) { issue }
    end

    it_behaves_like 'todo command' do
      let(:content) { '/todo' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'done command' do
      let(:content) { '/done' }
      let(:issuable) { issue }
    end

    it_behaves_like 'done command' do
      let(:content) { '/done' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'subscribe command' do
      let(:content) { '/subscribe' }
      let(:issuable) { issue }
    end

    it_behaves_like 'subscribe command' do
      let(:content) { '/subscribe' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'unsubscribe command' do
      let(:content) { '/unsubscribe' }
      let(:issuable) { issue }
    end

    it_behaves_like 'unsubscribe command' do
      let(:content) { '/unsubscribe' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'due command' do
      let(:content) { '/due 2016-08-28' }
      let(:issuable) { issue }
    end

    it_behaves_like 'due command' do
      let(:content) { '/due tomorrow' }
      let(:issuable) { issue }
      let(:expected_date) { Date.tomorrow }
    end

    it_behaves_like 'due command' do
      let(:content) { '/due 5 days from now' }
      let(:issuable) { issue }
      let(:expected_date) { 5.days.from_now.to_date }
    end

    it_behaves_like 'due command' do
      let(:content) { '/due in 2 days' }
      let(:issuable) { issue }
      let(:expected_date) { 2.days.from_now.to_date }
    end

    it_behaves_like 'empty command' do
      let(:content) { '/due foo bar' }
      let(:issuable) { issue }
    end

    it_behaves_like 'empty command' do
      let(:content) { '/due 2016-08-28' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'remove_due_date command' do
      let(:content) { '/remove_due_date' }
      let(:issuable) { issue }
    end

    it_behaves_like 'wip command' do
      let(:content) { '/wip' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'unwip command' do
      let(:content) { '/wip' }
      let(:issuable) { merge_request }
    end

    it_behaves_like 'empty command' do
      let(:content) { '/remove_due_date' }
      let(:issuable) { merge_request }
    end

    context 'when current_user cannot :admin_issue' do
      let(:visitor) { create(:user) }
      let(:issue) { create(:issue, project: project, author: visitor) }
      let(:service) { described_class.new(project, visitor) }

      it_behaves_like 'empty command' do
        let(:content) { "/assign @#{developer.username}" }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { '/unassign' }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { "/milestone %#{milestone.title}" }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { '/remove_milestone' }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { %(/label ~"#{inprogress.title}" ~#{bug.title} ~unknown) }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { %(/unlabel ~"#{inprogress.title}") }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { %(/relabel ~"#{inprogress.title}") }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { '/due tomorrow' }
        let(:issuable) { issue }
      end

      it_behaves_like 'empty command' do
        let(:content) { '/remove_due_date' }
        let(:issuable) { issue }
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
	<color name="ns_accent">#65adf1</color>
</resources>


text:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="NH.Bencher.Model"
                   namespace="NH.Bencher.EntityClasses">

	<class name="Location" table="[Production].[Location]" optimistic-lock="none" >
		<id name="LocationId" column="[LocationID]" access="field.camelcase-underscore" >
			<generator class="identity"/>
		</id>
		<property name="Availability" column="[Availability]" access="field.camelcase-underscore" not-null="true"/>
		<property name="CostRate" column="[CostRate]" access="field.camelcase-underscore" not-null="true"/>
		<property name="ModifiedDate" column="[ModifiedDate]" access="field.camelcase-underscore" not-null="true"/>
		<property name="Name" column="[Name]" access="field.camelcase-underscore" not-null="true"/>
		<set name="ProductInventories" access="field.camelcase-underscore" cascade="all-delete-orphan" inverse="true" fetch="select">
			<key>
				<column name="[LocationID]"/>
			</key>
			<one-to-many class="ProductInventory"/>
		</set>
		<set name="WorkOrderRoutings" access="field.camelcase-underscore" cascade="all-delete-orphan" inverse="true" fetch="select">
			<key>
				<column name="[LocationID]"/>
			</key>
			<one-to-many class="WorkOrderRouting"/>
		</set>
	<!-- __LLBLGENPRO_USER_CODE_REGION_START EntityMappingCustomCode -->
	<!-- __LLBLGENPRO_USER_CODE_REGION_END -->
	</class>
</hibernate-mapping>


text:
package io.kaif.service.impl;

import static java.util.Arrays.asList;
import static org.junit.Assert.*;

import java.util.stream.IntStream;

import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import io.kaif.flake.FlakeId;
import io.kaif.model.account.Account;
import io.kaif.model.feed.FeedAsset;
import io.kaif.test.DbIntegrationTests;

public class FeedServiceImplTest extends DbIntegrationTests {
  @Autowired
  private FeedServiceImpl service;

  Account account;

  @Before
  public void setUp() throws Exception {
    account = savedAccountCitizen("userX");
  }

  @Test
  public void createReply() throws Exception {

    FlakeId debateId = nextFlakeId();
    FeedAsset asset = service.createReplyFeed(debateId, account.getAccountId());
    assertEquals(asList(asset), service.listFeeds(account, null));

    FeedAsset loaded = service.listFeeds(account, null).get(0);
    assertEquals(FeedAsset.AssetType.DEBATE_FROM_REPLY, loaded.getAssetType());
    assertEquals(debateId, loaded.getAssetId());
  }

  @Test
  public void acknowledge() throws Exception {
    FlakeId debateId = nextFlakeId();
    service.acknowledge(account, debateId);
    assertEquals("ack does nothing when no feed", 0, service.listFeeds(account, null).size());

    FeedAsset asset = service.createReplyFeed(debateId, account.getAccountId());
    assertFalse(asset.isAcked());
    service.acknowledge(account, asset.getAssetId());
    assertTrue(service.listFeeds(account, null).get(0).isAcked());
  }

  @Test
  public void countUnread() throws Exception {
    assertEquals(0, service.countUnread(account));
    FeedAsset a1 = service.createReplyFeed(nextFlakeId(), account.getAccountId());
    FeedAsset a2 = service.createReplyFeed(nextFlakeId(), account.getAccountId());
    assertEquals(2, service.countUnread(account));
    service.acknowledge(account, a1.getAssetId());
    assertEquals(1, service.countUnread(account));
    service.acknowledge(account, a2.getAssetId());
    assertEquals(0, service.countUnread(account));

    IntStream.range(0, 20)
        .forEach(i -> service.createReplyFeed(nextFlakeId(), account.getAccountId()));
    assertEquals(11, service.countUnread(account));
  }
}


text:
namespace ui {

bool MaterialDesignController::is_mode_initialized_ = false;

MaterialDesignController::Mode MaterialDesignController::mode_ =
    MaterialDesignController::MATERIAL_NORMAL;

bool MaterialDesignController::include_secondary_ui_ = false;

// static
void MaterialDesignController::Initialize() {
  TRACE_EVENT0("startup", "MaterialDesignController::InitializeMode");
  CHECK(!is_mode_initialized_);
  const std::string switch_value =
      base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
          switches::kTopChromeMD);

  if (switch_value == switches::kTopChromeMDMaterial) {
    SetMode(MATERIAL_NORMAL);
  } else if (switch_value == switches::kTopChromeMDMaterialHybrid) {
    SetMode(MATERIAL_HYBRID);
  } else {
    if (!switch_value.empty()) {
      LOG(ERROR) << "Invalid value='" << switch_value
                 << "' for command line switch '" << switches::kTopChromeMD
                 << "'.";
    }
    SetMode(DefaultMode());
  }

  include_secondary_ui_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
      switches::kExtendMdToSecondaryUi);
}

// static
MaterialDesignController::Mode MaterialDesignController::GetMode() {
  CHECK(is_mode_initialized_);
  return mode_;
}

// static
bool MaterialDesignController::IsSecondaryUiMaterial() {
  return include_secondary_ui_;
}

// static
MaterialDesignController::Mode MaterialDesignController::DefaultMode() {
#if defined(OS_CHROMEOS)
  // If a scan of available devices has already completed, use material-hybrid
  // if a touchscreen is present.
  if (DeviceDataManager::HasInstance() &&
      DeviceDataManager::GetInstance()->AreDeviceListsComplete()) {
    return GetTouchScreensAvailability() == TouchScreensAvailability::ENABLED
               ? MATERIAL_HYBRID
               : MATERIAL_NORMAL;
  }

#if defined(USE_OZONE)
  // Otherwise perform our own scan to determine the presence of a touchscreen.
  // Note this is a one-time call that occurs during device startup or restart.
  base::ThreadRestrictions::ScopedAllowIO allow_io;
  base::FileEnumerator file_enum(
      base::FilePath(FILE_PATH_LITERAL("/dev/input")), false,
      base::FileEnumerator::FILES, FILE_PATH_LITERAL("event*[0-9]"));
  for (base::FilePath path = file_enum.Next(); !path.empty();
       path = file_enum.Next()) {
    EventDeviceInfo devinfo;
    int fd = open(path.value().c_str(), O_RDWR | O_NONBLOCK | O_CLOEXEC);
    if (fd >= 0) {
      if (devinfo.Initialize(fd, path) && devinfo.HasTouchscreen()) {
        close(fd);
        return MATERIAL_HYBRID;
      }
      close(fd);
    }
  }
#endif  // defined(USE_OZONE)
#endif  // defined(OS_CHROMEOS)

  return MATERIAL_NORMAL;
}

// static
void MaterialDesignController::Uninitialize() {
  is_mode_initialized_ = false;
}

// static
void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) {
  mode_ = mode;
  is_mode_initialized_ = true;
}

}  // namespace ui


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!-- We need an extra FrameLayout around the menu for the background because it is a 9-patch and has
     extra padding automatically. The ListView's clipToPadding is false to avoid the items being cut
     off by the bottom padding. However, the FrameLayout's clipToPadding is true to keep the items
     in the menu boundaries. -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/context_menu_frame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/menu_bg_tinted"
    android:layout_marginHorizontal="@dimen/context_menu_lateral_margin"
    android:layout_marginVertical="@dimen/context_menu_vertical_margin"
    android:layout_gravity="center">

    <!-- Setting listSelector to transparent prevents the list items that have
         selectableItemBackground from having a double highlight effect. -->
    <org.chromium.chrome.browser.contextmenu.ContextMenuListView
        android:id="@+id/context_menu_list_view"
        android:layout_width="@dimen/context_menu_max_width"
        android:layout_height="wrap_content"
        android:paddingBottom="@dimen/context_menu_bottom_padding"
        android:fadeScrollbars="false"
        android:divider="@null"
        android:listSelector="@android:color/transparent"
        android:clipToPadding="false" />
</FrameLayout>


text:
declare type Comparator<T> = (element: T, index: number, array: T[]) => boolean;
declare type CompareFromArray<T> = (fromArray: T, item: T, index: number, array: T[]) => boolean;
declare type Sorter<T> = (rhs: T, lhs: T) => number;
declare type Accessor<T> = (item: T) => any;
declare type SortOptions<T> = {
    property?: string;
    accessor?: Accessor<T>;
    descending?: boolean;
    sorter?: Sorter<T>;
};
interface Array<T> {
    remove(comp: Comparator<T>, thisArg?: any): T | undefined;
    removeItem(item: T, thisArg?: any): T | undefined;
    find(comp: Comparator<T>, thisArg?: any): T | undefined;
    findIndex(comp: Comparator<T>, thisArg?: any): number | -1;
    first: T | undefined;
    last: T | undefined;
    sortBy(...propsOrOptionses: (string | SortOptions<T>)[]): T[];
    contains(comp: Comparator<T>, thisArg?: any): boolean;
    containsItem(item: T, thisArg?: any): boolean;
}
declare type MemoizeOptions = {
    excludedArguments?: number[];
    argumentsCount?: number;
    asynchronous?: boolean;
};
declare type MemoizeCache = {
    [key: string]: MemoizeCache | any;
    value?: any;
};
interface Function {
    curry(...args: any[]): any;
    memoize<T extends Function>(this: T, options?: MemoizeOptions): T;
    throttle<T extends Function>(this: T, wait?: number, immediate?: boolean): T;
    debounce<T extends Function>(this: T, wait?: number, immediate?: boolean): T;
}
declare type TopAndLeft = {
    top?: number;
    left?: number;
};
interface HTMLElement {
    readonly inDOM: boolean;
    readonly highestParent: HTMLElement | undefined;
    readonly isScrollable: boolean;
    readonly scrollableParent: HTMLElement | undefined;
    parentTop: number;
    absoluteTop: number;
    totalOffsetTop: number;
    parentLeft: number;
    absoluteLeft: number;
    totalOffsetLeft: number;
    animateScrollTo(topOrOptions: number | TopAndLeft, duration?: number, timing?: string): void;
    scrollIntoViewIfNeeded(duration?: number, padding?: number, timing?: string): void;
}
declare type Watcher = (newValue: any, oldValue: any, property: string) => void;
interface Object {
    merge<T extends Object>(this: T, ...others: T[]): T;
    override<T extends Object>(this: T, func: string, newFunc: Function): T;
    setWatcher<T extends Object>(this: T, property: string, didSet?: Watcher, willSet?: Watcher): T;
    addWatcher<T extends Object>(this: T, property: string, didSet?: Watcher, willSet?: Watcher): T;
    removeWatcher<T extends Object>(this: T, property?: string, didSet?: Watcher, willSet?: Watcher): T;
    getNestedProperty(...properties: string[]): any;
    valuesArray: any[];
}
interface String {
    contains(str: string, caseInsensitve?: boolean): boolean;
    toTitleCase(): string;
    toSnakeCase(): string;
    toCamelCase(): string;
    toRegExpEscaped(): string;
}


text:
import unittest

from django.contrib import admin as django_admin
from django.test import client

from .. import admin, forms, models

class PalestranteAdminTestCase(unittest.TestCase):

    def setUp(self):
        self.dados = {
            "nome": "Francisco Souza",
            "minicurriculo": "PMP (Professional Mario Player)",
            "foto": "anonymous.png",
            "twitter": "franciscosouza",
        }

        factory = client.RequestFactory()
        self.request = factory.post("/", self.dados)

    def test_model_Palestrante_deve_estar_registrado_no_site_do_admin(self):
        self.assertIn(models.Palestrante, django_admin.site._registry)

    def test_model_Palestrante_eh_registrado_com_classe_PalestranteAdmin(self):
        self.assertIsInstance(django_admin.site._registry[models.Palestrante],
                              admin.PalestranteAdmin)

    def test_PalestranteAdmin_deve_usar_PalestranteAdminForm(self):
        self.assertEqual(forms.PalestranteAdminForm,
                         admin.PalestranteAdmin.form)

    def test_nome_deve_estar_na_listagem(self):
        self.assertIn('nome', admin.PalestranteAdmin.list_display)

    def test_slug_deve_estar_na_listagem(self):
        self.assertIn('slug', admin.PalestranteAdmin.list_display)

    def test_deve_ser_possivel_buscar_pelo_nome(self):
        self.assertIn('nome', admin.PalestranteAdmin.search_fields)

    def test_deve_gravar_palestrante_com_slug(self):
        palestrante = models.Palestrante(**self.dados)
        adm = admin.PalestranteAdmin(palestrante, None)
        adm.save_model(self.request, palestrante, None, None)
        self.assertIsNotNone(palestrante.pk)
        self.assertEqual("francisco-souza", palestrante.slug)


text:
{{list.name || 'NEW_CLIENT' | translate | limitTo: 15 }}

{{ list.location }}

{{(list.phonenumber | phonenumber) || 'PHONENUMBER' | translate }}

{{ 'YOUR_PLACE_IS_NOW_CLEAN' | translate: 'uppercase' }}

{{list.cleaner.name}}

{{ list.cleaner.phonenumber | phonenumber }}

{{ list.date | date:'shortDate' }}

{{ 'VIEW_AGREEMENT' | translate: 'titlecase' }}

		{{ 'PRICE' | translate: 'uppercase' }}:
		${{list.price}}.00

{{ 'LEAVE_FEEDBACK' | translate: 'titlecase' }}

{{ 'FEEDBACK_PROMPT' | translate }}

{{ 'WHY' | translate }}

			<textarea ng-model="feedback.why"></textarea>

{{ 'NEXT_TIME' | translate }}...

			<textarea ng-model="feedback.request"></textarea>

{{error.message | translate }}

{{ 'SENDING' | translate: 'uppercase' }}...

				<button ng-show="!sending" ng-disabled="!(feedback.rating&&feedback.why)" ng-click="sendFeedback()" class='btn short'>{{ 'THANKS' | translate: 'titlecase' }}</button>


text:
package au.edu.uts.eng.remotelabs.rigclient.status.types;

import javax.xml.stream.XMLStreamReader;

import org.apache.axis2.databinding.ADBException;

/**
 * Extension mapper.
 */
public class ExtensionMapper
{

    public static Object getTypeObject(final String namespaceURI, final String typeName, final XMLStreamReader reader)
            throws Exception
    {
        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "RigType".equals(typeName))
        {
            return RigType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "CallbackRequestType".equals(typeName))
        {
            return CallbackRequestType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "UpdateRigType".equals(typeName))
        {
            return UpdateRigType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "ProviderResponse".equals(typeName))
        {
            return ProviderResponse.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "StatusType".equals(typeName))
        {
            return StatusType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "RemoveRigType".equals(typeName))
        {
            return RemoveRigType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "RegisterRigType".equals(typeName))
        {
            return RegisterRigType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "ErrorType".equals(typeName))
        {
            return ErrorType.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "SessionFile".equals(typeName))
        {
            return SessionFile.Factory.parse(reader);
        }

        if ("http://remotelabs.eng.uts.edu.au/schedserver/localrigprovider".equals(namespaceURI)
                && "SessionFiles".equals(typeName))
        {
            return SessionFiles.Factory.parse(reader);
        }

        throw new ADBException("Unsupported type " + namespaceURI + " " + typeName);
    }
}


text:
function Editor::getUndoManager(%this) {
	if ( !isObject( %this.undoManager ) ) {
		/// This is the global undo manager used by all
		/// of the mission editor sub-editors.
		%this.undoManager = new UndoManager( EUndoManager ) {
			numLevels = 200;
			internalName = "DefaultUndoManager";
		};
	}

	return %this.undoManager;
}

function Editor::setUndoManager(%this, %undoMgr) {
	%this.undoManager = %undoMgr;
}
//=============================================================================================
//    Undo reparenting.
//=============================================================================================

//---------------------------------------------------------------------------------------------

function UndoActionReparentObjects::create( %treeView ) {
	pushInstantGroup();
	%action = new UndoScriptAction() {
		class = "UndoActionReparentObjects";
		numObjects = 0;
		treeView = %treeView;
	};
	popInstantGroup();
	return %action;
}

//---------------------------------------------------------------------------------------------

function UndoActionReparentObjects::add( %this, %object, %oldParent, %newParent ) {
	%index = %this.numObjects;
	%this.objects[ %index ] = %object;
	%this.oldParents[ %index ] = %oldParent;
	%this.newParents[ %index ] = %newParent;
	%this.numObjects = %this.numObjects + 1;
}

//---------------------------------------------------------------------------------------------

function UndoActionReparentObjects::undo( %this ) {
	%numObjects = %this.numObjects;

	for( %i = 0; %i < %numObjects; %i ++ ) {
		%obj = %this.objects[ %i ];
		%group = %this.oldParents[ %i ];

		if( isObject( %obj ) && isObject( %group ) )
			%obj.parentGroup = %group;
	}

	if( isObject( %this.treeView ) )
		%this.treeView.update();
}

//---------------------------------------------------------------------------------------------

function UndoActionReparentObjects::redo( %this ) {
	%numObjects = %this.numObjects;

	for( %i = 0; %i < %numObjects; %i ++ ) {
		%obj = %this.objects[ %i ];
		%group = %this.newParents[ %i ];

		if( isObject( %obj ) && isObject( %group ) )
			%obj.parentGroup = %group;
	}

	if( isObject( %this.treeView ) )
		%this.treeView.update();
}


text:
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.

// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP
#define BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP

#include <memory>
#include <vector>

#include <boost/concept/requires.hpp>

#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/linestring_concept.hpp>

#ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
#endif

namespace boost { namespace geometry
{

namespace model
{

/*!
\brief multi_line, a collection of linestring
\details Multi-linestring can be used to group lines belonging to each other,
        e.g. a highway (with interruptions)
\ingroup geometries

\qbk{before.synopsis,
[heading Model of]
[link geometry.reference.concepts.concept_multi_linestring MultiLineString Concept]
}
*/
template
<
    typename LineString,
    template<typename, typename> class Container = std::vector,
    template<typename> class Allocator = std::allocator
>
class multi_linestring : public Container<LineString, Allocator<LineString> >
{
    BOOST_CONCEPT_ASSERT( (concept::Linestring<LineString>) );

#ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST

    typedef Container<LineString, Allocator<LineString> > base_type;

public:
    /// \constructor_default{multi_linestring}
    multi_linestring()
        : base_type()
    {}

#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST

    /// \constructor_initializer_list{multi_linestring}
    inline multi_linestring(std::initializer_list<LineString> l)
        : base_type(l.begin(), l.end())
    {}

// Commented out for now in order to support Boost.Assign
// Without this assignment operator first the object should be created
//   from initializer list, then it shoudl be moved.
//// Without this workaround in MSVC the assignment operator is ambiguous
//#ifndef BOOST_MSVC
//    /// \assignment_initializer_list{multi_linestring}
//    inline multi_linestring & operator=(std::initializer_list<LineString> l)
//    {
//        base_type::assign(l.begin(), l.end());
//        return *this;
//    }
//#endif

#endif
#endif
};

} // namespace model

#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{

template
<
    typename LineString,
    template<typename, typename> class Container,
    template<typename> class Allocator
>
struct tag< model::multi_linestring<LineString, Container, Allocator> >
{
    typedef multi_linestring_tag type;
};

} // namespace traits
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP


text:
<?xml version="1.0" encoding="UTF-8"?>
    <!-- EN-Revision: 19689 -->
    <!-- Reviewed: no -->
<sect2 id="zend.application.core-functionality.bootstrap-bootstrap">
    <title>Zend_Application_Bootstrap_Bootstrap</title>

    <para>
        <classname>Zend_Application_Bootstrap_Bootstrap</classname>
        es una implementación concreta
        de
        <link linkend="zend.application.core-functionality.bootstrap-bootstrapabstract">
        Zend_Application_Bootstrap_BootstrapAbstract
        </link>
        . Su principal característica es que
        registra el
        <link linkend="zend.application.available-resources.frontcontroller">recurso
            Front Controller</link>
        , y que el método
        <methodname>run()</methodname>
        primero
        comprueba esté definido un módulo por defecto y luego despacha el front controller.
    </para>

    <para>En muchos casos, usted quisiera extender esta clase por sus necesidades de bootstrapping,
        o simplemente utilizar esta clase y proporcionar una lista de los plugins de recursos a
        utilizar.</para>

    <sect3 id="zend.application.core-functionality.bootstrap-bootstrap.autoloading">
        <title>Enabling Application Autoloading</title>

        <para>
            Additionally, this bootstrap implementation provides the ability to specify the
            "namespace" or class prefix for resources located in its tree, which will enable
            autoloading of various application resources; essentially, it instantiates a
            <link linkend="zend.loader.autoloader-resource.module">
            Zend_Application_Module_Autoloader</link>
            object, providing the requested namespace and the bootstrap's directory as arguments.
            You may enable this functionality by providing a namespace to the "appnamespace"
            configuration option. As an
            <acronym>INI</acronym>
            Ejemplo:
        </para>

        <programlisting language="ini"><![CDATA[
appnamespace = "Application"
]]></programlisting>

        <para>
            O en
            <acronym>XML</acronym>
            :
        </para>

        <programlisting language="xml"><![CDATA[
<appnamespace>Application</appnamespace>
]]></programlisting>

        <para>
            By default,
            <classname>Zend_Tool</classname>
            will enable this option with the value
            "Application".
        </para>

        <para>
            Alternately, you can simply define the
            <varname>$_appNamespace</varname>
            property of your
            bootstrap class with the appropriate value:
        </para>

        <programlisting language="php"><![CDATA[
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected $_appNamespace = 'Application';
}
]]></programlisting>
    </sect3>
</sect2>


text:
NS_ASSUME_NONNULL_BEGIN

@interface LPDTableViewModel : NSObject <LPDTableViewModelProtocol>

@property (readonly, nonatomic, getter = getSections) NSArray *tableViewModelSections;

+ (instancetype) new NS_UNAVAILABLE;

@end

NS_ASSUME_NONNULL_END


text:
__author__ = "Pierre-Yves Langlois"
__copyright__ = "https://github.com/pylanglois/uwsa/blob/master/LICENCE"
__credits__ = ["Pierre-Yves Langlois"]
__license__ = "BSD"
__maintainer__ = "Pierre-Yves Langlois"

from uwsas.common import *
from uwsas.core import L
from uwsas.core import CONF_MAP
from uwsas.core import CONFIG

from uwsas.helpers import inputs

from uwsas.commands.command_manager import cmanager
from uwsas.commands.install import InstallCommand

from uwsas.commands.install_toptools import InstallTopToolsCommand
from uwsas.commands.install_ntp  import InstallNTPCommand
from uwsas.commands.install_fail2ban import InstallFail2BanCommand
from uwsas.commands.install_apache import InstallApacheCommand
from uwsas.commands.install_mysql import InstallMySQLCommand
from uwsas.commands.install_automysqlbackup import InstallAutoMySQLBackupCommand
from uwsas.commands.install_php import InstallPHPCommand
from uwsas.commands.install_ufw import InstallUFWCommand
from uwsas.commands.install_ssh import InstallSSHCommand
from uwsas.commands.install_munin_node import InstallMuninNodeCommand
from uwsas.commands.install_acl import InstallACLCommand
from uwsas.commands.install_awstats import InstallAWStatsCommand
from uwsas.commands.install_libpam_script import InstallLibPAMScriptCommand
from uwsas.commands.install_centrify import InstallCentrifyCommand
from uwsas.commands.install_grub_gfx import InstallGrubGFXCommand
from uwsas.commands.mysql_command import MySQLCommand

class InstallBaseCommand(InstallCommand):

    NAME = 'base'

    def __init__(self):
        InstallCommand.__init__(self)
        self.add_prerequisite(InstallNTPCommand.NAME, obj=InstallNTPCommand())
        self.add_prerequisite(InstallTopToolsCommand.NAME, obj=InstallTopToolsCommand())
        self.add_prerequisite(InstallFail2BanCommand.NAME, obj=InstallFail2BanCommand())
        self.add_prerequisite(InstallPHPCommand.NAME, obj=InstallPHPCommand())
        self.add_prerequisite(InstallApacheCommand.NAME, obj=InstallApacheCommand())
        self.add_prerequisite(InstallMySQLCommand.NAME, obj=InstallMySQLCommand())
        self.add_prerequisite(InstallAutoMySQLBackupCommand.NAME, obj=InstallAutoMySQLBackupCommand())
        self.add_prerequisite(InstallUFWCommand.NAME, obj=InstallUFWCommand())
        self.add_prerequisite(InstallSSHCommand.NAME, obj=InstallSSHCommand())
        self.add_prerequisite(InstallMuninNodeCommand.NAME, obj=InstallMuninNodeCommand())
        self.add_prerequisite(InstallACLCommand.NAME, obj=InstallACLCommand())
        self.add_prerequisite(InstallAWStatsCommand.NAME, obj=InstallAWStatsCommand())
        self.add_prerequisite(InstallLibPAMScriptCommand.NAME, obj=InstallLibPAMScriptCommand())
        self.add_prerequisite(InstallGrubGFXCommand.NAME, obj=InstallGrubGFXCommand())
        self.add_prerequisite(InstallCentrifyCommand.NAME, obj=InstallCentrifyCommand())

    def init_help(self):
        help = InstallCommand.init_help(self)
        help['command_detail'] = t("%s\n\t"
                                    "This command will install the almost perfect uwsa server." %
                                    help['command_detail'])

    def do(self, args=[]):
        completed = InstallCommand.do(self,args)
        if 'check' not in args and 'fix' not in args:
            MySQLCommand().do(['reset_root_pass'])
            admin_mail = inputs.get_input_string(t("What is the admin mail?"), CONF_MAP('mail','admin_mail'))
            smtp_server = inputs.get_input_string(t("What is the smtp server to use?"), CONF_MAP('mail','smtp_server'))
            CONFIG.mod('mail','admin_mail', admin_mail)
            CONFIG.mod('mail','smtp_server', smtp_server)
            CONFIG.save()

cmanager.get(InstallCommand.NAME).register(InstallBaseCommand.NAME, InstallBaseCommand())


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

// Test that setter accessors added to the prototype chain are called
// when setting properties.

// Test that accessors added to the prototype chain are called
// eventhough there are inline caches for setting the property

function F() {
  this.x = 42;
  this.y = 87;
}

// Force the inline caches to monomorphic state.
//new F(); new F();

// Add a setter for x to Object.prototype and make sure it gets
// called.
/*var result_x;
Object.prototype.__defineSetter__('x', function(value) { result_x = value; });
var f = new F();
assertEquals(42, result_x);
assertTrue(typeof f.x == 'undefined');*/

// Add a setter for y by changing the prototype of f and make sure
// that gets called too.
var result_y;
var proto = new Object();
proto.__defineSetter__('y', function (value) { result_y = value; });
var f = new F();
f.y = undefined;
f.__proto__ = proto;
F.call(f);
//assertEquals(87, result_y);
//assertTrue(typeof f.y == 'undefined');

// Test the same issue in the runtime system.  Make sure that
// accessors added to the prototype chain are called instead of
// following map transitions.
//
// Create two objects.

var result_z;
var o1 = new Object();
var o2 = new Object();
// Add a z property to o1 to create a map transition.
o1.z = 32;
// Add a z accessor in the prototype chain for o1 and o2.
Object.prototype.__defineSetter__('z', function(value) { result_z = value; });
// The accessor should be called for o2.
o2.z = 27;
assertEquals(27, result_z);
assertTrue(typeof o2.z == 'undefined');


text:
Please search existing issues first to make sure this is not a duplicate.
Every issue report has a cost for the developers required to field it; be
respectful of others' time and ensure your report isn't spurious prior to
submission. Additionally, please do us all a favor by adhering to the
principles of sound bug reporting laid out by Simon Tatham here:

http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

## Development ideology

Truths which we believe to be self-evident:

- **The answer is not more options.**  If you feel compelled to expose
   new preferences to the user it's very possible you've made a wrong
   turn somewhere.

- **There are no power users.** The idea that some users "understand"
   concepts better than others has proven to be, for the most part, false.
   If anything, "power users" are more dangerous than the rest, and we
   should avoid exposing dangerous functionality to them.

## Code style

Please ensure any submissions adhere to the PSR-2 code style standard:

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md