text:
package org.arquillian.cube.docker.impl.client.utils;

import org.junit.Before;
import org.junit.Test;

import java.util.Locale;

import static org.arquillian.cube.docker.impl.client.utils.NumberConversion.convertToLong;
import static org.arquillian.cube.docker.impl.client.utils.NumberConversion.humanReadableByteCount;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class NumberConversionTest {

    @Before
    public void set_locale(){
        Locale.setDefault(Locale.ENGLISH);
    }

    private static final Long TEN_MEGABYTES = 9999800L;

    private static final Long ONE_KIKIBYTE = 1024L;

    private static final Long NEGATIVE_ONE_KIKIBYTE = -1024L;

    private static final Long ONE_TERABYTES = 1000000000000L;

    private static final Long HUNDRED_GIGABYTES = 100000000000L;

    private static final Long ONE_EXBIBYTE =  1152921504606846976L;

    private static final Long ONE_PEBIBYTE = 1125899906842624L;

    @Test
    public void should_be_convert_byte_to_long(){
        assertThat(convertToLong((byte)127), is(127L));
    }

    @Test
    public void should_be_convert_short_to_long(){
        assertThat(convertToLong((short) 32767), is(32767L));
    }

    @Test
    public void should_be_convert_integer_to_long(){
        assertThat(convertToLong(2147483647), is(2147483647L));
    }

    @Test
    public void should_be_convert_hex_to_long(){
        assertThat(convertToLong(0x10), is(16L));
    }

    @Test
    public void  should_be_return_zero_to_null(){
        assertThat(convertToLong(null), is(0L));
    }

    @Test
    public void should_be_possible_to_show_null_as_zero_bytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(null, true), is("0 B"));
    }

    @Test
    public void should_be_possible_to_show_megabytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(TEN_MEGABYTES, true), is("10.00 MB"));
    }

    @Test
    public void should_be_possible_to_show_gigabytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(HUNDRED_GIGABYTES, true), is("100.00 GB"));
    }

    @Test
    public void should_be_possible_to_show_terabytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(ONE_TERABYTES, true), is("1.00 TB"));
    }

    @Test
    public void should_be_possible_to_show_kikibytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(ONE_KIKIBYTE, false), is("1.00 KiB"));
    }

    @Test
    public void should_be_possible_to_show_pebibytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(ONE_PEBIBYTE, false), is("1.00 PiB"));
    }

    @Test
    public void should_be_possible_to_show_exabytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(ONE_EXBIBYTE, false), is("1.00 EiB"));
    }

    @Test
    public void should_be_possible_to_show_negative_kikibytes_in_human_readable_form(){
        assertThat(humanReadableByteCount(NEGATIVE_ONE_KIKIBYTE, false), is("- 1.00 KiB"));
    }
}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syll. fung. (Abellini) 1: 706 (1882)

#### Original name
Sphaeria rubi-fruticosi P. Crouan & H. Crouan

### Remarks
null


text:
from flask_assets import Bundle

common_css = Bundle(
	'css/vendor/bootstrap.min.css',
	'css/vendor/helper.css',
	'css/main.css',
	filters='cssmin',
	output='public/css/common.css'
)

common_js = Bundle(
	'js/vendor/jquery.min.js',
	'js/vendor/bootstrap.min.js',

	'js/vendor/highcharts.src.js',
	'js/vendor/highcharts-more.src.js',
	'js/vendor/heatmap.src.js',
	'js/vendor/exporting.js',
	'js/vendor/offline-exporting.js',

	Bundle(
		'js/main.js',
		filters='jsmin'
	),
	output='public/js/common.js'
)


text:
import unittest
from pathlib import Path
import enum

from vint.ast.parsing import Parser
from vint.ast.node_type import NodeType
from vint.ast.traversing import traverse
from vint.ast.plugin.scope_plugin.call_node_parser import (
    CallNodeParser,
    get_lambda_string_expr_content,
    FUNCTION_REFERENCE_STRING_EXPR_CONTENT,
)
from vint.linting.lint_target import LintTargetFile

FIXTURE_BASE_PATH = Path('test', 'fixture', 'ast', 'scope_plugin')

class Fixtures(enum.Enum):
    MAP_AND_FILTER_VARIABLE = Path(FIXTURE_BASE_PATH, 'fixture_to_scope_plugin_map_and_filter.vim')
    ISSUE_256 = Path(FIXTURE_BASE_PATH, 'fixture_to_scope_plugin_issue_256.vim')
    NESTED = Path(FIXTURE_BASE_PATH, 'fixture_to_scope_plugin_nested_map_and_filter.vim')
    ISSUE_274_CALL = Path(FIXTURE_BASE_PATH, 'fixture_to_scope_plugin_issue_274_call.vim')
    ISSUE_274_FUNCTION = Path(FIXTURE_BASE_PATH, 'fixture_to_scope_plugin_issue_274_function.vim')

class TestCallNodeParser(unittest.TestCase):
    def create_ast(self, file_path):
        parser = Parser()
        ast = parser.parse(LintTargetFile(file_path.value))
        return ast

    def test_process_with_map_function(self):
        ast = self.create_ast(Fixtures.MAP_AND_FILTER_VARIABLE)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        string_expr_nodes = get_lambda_string_expr_content(got_ast['body'][0]['left']['rlist'][1])
        self.assertEqual('v:val', string_expr_nodes[0]['left'].get('value'))

    def test_process_with_filter_function(self):
        ast = self.create_ast(Fixtures.MAP_AND_FILTER_VARIABLE)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        string_expr_nodes = get_lambda_string_expr_content(got_ast['body'][1]['left']['rlist'][1])
        self.assertEqual('v:key', string_expr_nodes[0]['left'].get('value'))

    def test_traverse(self):
        ast = self.create_ast(Fixtures.MAP_AND_FILTER_VARIABLE)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        is_map_and_filter_content_visited = {
            'v:val': False,
            'v:key': False,
        }

        def enter_handler(node):
            if NodeType(node['type']) is not NodeType.IDENTIFIER:
                return

            is_map_and_filter_content_visited[node['value']] = True

        traverse(got_ast, on_enter=enter_handler)

        self.assertTrue(all(is_map_and_filter_content_visited.values()))

    def test_issue_256(self):
        ast = self.create_ast(Fixtures.ISSUE_256)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        self.assertIsNotNone(got_ast)

    def test_nested_map(self):
        ast = self.create_ast(Fixtures.NESTED)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        nested_map_ast = get_lambda_string_expr_content(got_ast['body'][0]['left']['rlist'][1])[0]
        self.assertIsNotNone(get_lambda_string_expr_content(nested_map_ast['rlist'][1]))

    def test_nested_filter(self):
        ast = self.create_ast(Fixtures.NESTED)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        nested_filter_ast = get_lambda_string_expr_content(got_ast['body'][1]['left']['rlist'][1])[0]
        self.assertIsNotNone(get_lambda_string_expr_content(nested_filter_ast['rlist'][1]))

    def test_issue_274_call(self):
        ast = self.create_ast(Fixtures.ISSUE_274_CALL)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        call_node = got_ast['body'][0]['left']['rlist'][0]
        self.assertTrue(FUNCTION_REFERENCE_STRING_EXPR_CONTENT in call_node)
        self.assertEqual(len(call_node[FUNCTION_REFERENCE_STRING_EXPR_CONTENT]), 1)

    def test_issue_274_function(self):
        ast = self.create_ast(Fixtures.ISSUE_274_FUNCTION)
        parser = CallNodeParser()
        got_ast = parser.process(ast)

        call_node = got_ast['body'][0]['left']['rlist'][0]
        self.assertTrue(FUNCTION_REFERENCE_STRING_EXPR_CONTENT in call_node)
        self.assertEqual(len(call_node[FUNCTION_REFERENCE_STRING_EXPR_CONTENT]), 1)

if __name__ == '__main__':
    unittest.main()


text:
/*
 * Do not modify this file. This file is generated from the rds-2014-10-31.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.RDS.Model
{
    ///
    /// This data type is used as a response element in the action DescribeDBEngineVersions.
    ///
    public partial class CharacterSet
    {
        private string _characterSetDescription;
        private string _characterSetName;

        ///
        /// Gets and sets the property CharacterSetDescription.
        /// <para>
        ///  The description of the character set.
        /// </para>
        ///
        public string CharacterSetDescription
        {
            get { return this._characterSetDescription; }
            set { this._characterSetDescription = value; }
        }

        // Check to see if CharacterSetDescription property is set
        internal bool IsSetCharacterSetDescription()
        {
            return this._characterSetDescription != null;
        }

        ///
        /// Gets and sets the property CharacterSetName.
        /// <para>
        ///  The name of the character set.
        /// </para>
        ///
        public string CharacterSetName
        {
            get { return this._characterSetName; }
            set { this._characterSetName = value; }
        }

        // Check to see if CharacterSetName property is set
        internal bool IsSetCharacterSetName()
        {
            return this._characterSetName != null;
        }

    }
}


text:
<?php
namespace BJD\Events\Service;

use BuJitsuDo\Authentication\Service\MailerService;
use BuJitsuDo\Authentication\Service\ProfileService;
use Nieuwenhuizen\CR\Domain\Repository\NodeWriteRepository;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Persistence\Doctrine\PersistenceManager;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;

class EventService
{
    /**
     * @Flow\Inject
     *
     * @var ProfileService
     */
    protected $profileService;

    /**
     * @Flow\Inject
     *
     * @var NodeWriteRepository
     */
    protected $nodeWriteRepository;

    /**
     * @Flow\Inject
     *
     * @var PersistenceManager
     */
    protected $persistenceManager;

    /**
     * @Flow\Inject
     *
     * @var MailerService
     */
    protected $mailerService;

    /**
     * @Flow\Inject(setting="notifications.mail", package="BJD.Events")
     *
     * @var array
     */
    protected $eventMailSettings;

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     *
     * @throws \Exception
     *
     * @return void
     */
    public function addAttendeeToEvent(NodeInterface $event, NodeInterface $person)
    {
        $personAndEventData = $this->getEventsAndPersonData($event, $person);

        if (!in_array($person->getIdentifier(), $personAndEventData['attendeeIdentifiers'], true)) {
            $personAndEventData['attendees'][] = $person;
        } else {
            throw new \Exception('User is already set in attendees', 1289312397);
        }

        if (!(in_array($event->getIdentifier(), $personAndEventData['personEventsIdentifiers'], true))) {
            $personAndEventData['personEvents'][] = $event;
        } else {
            throw new \Exception('Event is already registered for user', 19786757512);
        }

        $this->nodeWriteRepository->updateNode($person, ['events' => $personAndEventData['personEvents']]);
        $this->nodeWriteRepository->updateNode($event, ['attendees' => $personAndEventData['attendees']]);
        $this->persistenceManager->persistAll();
        $this->emitAttendeeAdded($event, $person);
    }

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     */
    public function removeAttendeeFromEvent(NodeInterface $event, NodeInterface $person)
    {
        $personAndEventData = $this->getEventsAndPersonData($event, $person);

        $this->removeEventFromUser($person, $personAndEventData, 'attendeeIdentifiers', 'attendees', 'User is not set in attendees');
        $this->removeEventFromUser($event, $personAndEventData, 'personEventsIdentifiers', 'personEvents', 'Event is not registered for user');

        $this->nodeWriteRepository->updateNode($person, ['events' => $personAndEventData['personEvents']]);
        $this->nodeWriteRepository->updateNode($event, ['attendees' => $personAndEventData['attendees']]);
        $this->persistenceManager->persistAll();
        $this->emitAttendeeRemoved($event, $person);
    }

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     *
     * @return void
     */
    public function sendNewAttendeeEmail(NodeInterface $event, NodeInterface $person)
    {
        $personName = $person->getLabel();
        $eventName = $event->getLabel();
        $plainTextMessage = $personName . ' heeft zicht aangemeld voor ' . $eventName . '. Met vriendelijke groet Bu jitsu do';
        $this->mailerService->sendEmail(
            $this->eventMailSettings,
            'Nieuwe aanmelding voor ' . $event->getLabel(),
            $this->eventMailSettings['templates']['newAttendee'],
            [
                'person' => $person,
                'event'  => $event,
            ],
            $plainTextMessage
        );
    }

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     *
     * @return void
     */
    public function sendAttendeeRemovedEmail(NodeInterface $event, NodeInterface $person)
    {
        $personName = $person->getLabel();
        $eventName = $event->getLabel();
        $plainTextMessage = $personName . ' heeft zicht afgemeld voor ' . $eventName . '. Met vriendelijke groet Bu jitsu do';
        $this->mailerService->sendEmail(
            $this->eventMailSettings,
            'Afmelding voor ' . $event->getLabel(),
            $this->eventMailSettings['templates']['removedAttendee'],
            [
                'person' => $person,
                'event'  => $event,
            ],
            $plainTextMessage
        );
    }

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     *
     * @throws \Exception
     *
     * @return array
     */
    protected function getEventsAndPersonData(NodeInterface $event, NodeInterface $person)
    {
        if ($event->getNodeType()->getName() !== 'BJD.Events:Event' && $person->getNodeType()->getName() !== 'BuJitsuDo.Authentication:Person') {
            throw new \Exception('Not an event and/or person given', 12389172498);
        }
        if (!empty($person->getProperty('events'))) {
            $personEvents = $person->getProperty('events');
        } else {
            $personEvents = [];
        }
        $eventIdentifiers = [];

        if (!empty($event->getProperty('attendees'))) {
            $attendees = $event->getProperty('attendees');
        } else {
            $attendees = [];
        }
        $attendeeIdentifiers = [];

        foreach ($attendees as $attendee) {
            /* @var NodeInterface $attendee */
            $attendeeIdentifiers[] = $attendee->getIdentifier();
        }
        foreach ($personEvents as $personEvent) {
            /* @var NodeInterface $personEvent */
            $eventIdentifiers[] = $personEvent->getIdentifier();
        }

        return [
            'personEvents'            => $personEvents,
            'personEventsIdentifiers' => $eventIdentifiers,
            'attendees'               => $attendees,
            'attendeeIdentifiers'     => $attendeeIdentifiers,
        ];
    }

    /**
     * @param NodeInterface $node
     * @param array $data
     * @param string $identifiersToCheck
     * @param string $dataToClear
     * @param string $exceptionMessage
     *
     * @throws \Exception
     */
    protected function removeEventFromUser(NodeInterface $node, array &$data, $identifiersToCheck = 'personEventsIdentifiers', $dataToClear = 'personEvents', $exceptionMessage = '')
    {
        if (in_array($node->getIdentifier(), $data[$identifiersToCheck], true)) {
            $keyToRemove = [];
            foreach ($data[$dataToClear] as $key => $personEvent) {
                /** @var NodeInterface $personEvent */
                if ($personEvent->getIdentifier() === $node->getIdentifier()) {
                    $keyToRemove[] = $key;
                } else {
                    continue;
                }
            }
            if ($keyToRemove !== []) {
                foreach ($keyToRemove as $key) {
                    unset($data[$dataToClear][$key]);
                }
            }
        } else {
            throw new \Exception($exceptionMessage, 12415423123);
        }
    }

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     * @Flow\Signal
     *
     * @return void
     */
    protected function emitAttendeeAdded(NodeInterface $event, NodeInterface $person)
    {
    }

    /**
     * @param NodeInterface $event
     * @param NodeInterface $person
     * @Flow\Signal
     *
     * @return void
     */
    protected function emitAttendeeRemoved(NodeInterface $event, NodeInterface $person)
    {
    }
}


text:
// The MIT License (MIT)
//
// Copyright (c) 2017 Timothy D. Jones
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package io.github.jonestimd.swing.component;

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.ItemEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.text.Format;

import javax.swing.text.JTextComponent;

import io.github.jonestimd.swing.validation.Validator;

/**
 * An editable combo box that keeps the popup menu visible and updates the menu items when the input text changes.
 * Handles the the following keyboard input:
 *

 *
any key except escape and enter will show the popup menu

 *
ctrl-space clears the selection and moves the cursor to the end of the input text

 *

 */
public class SuggestField<T> extends BeanListComboBox<T> {
    public SuggestField(Format format, Validator<String> validator, SuggestModel<T> model) {
        this(format, format, validator, model);
    }

    public SuggestField(Format format, Format itemFormat, Validator<String> validator, SuggestModel<T> model) {
        super(format, itemFormat, validator, model);
        getEditorComponent().addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent event) {
                SuggestField.this.processEditorKeyEvent(event);
            }
        });
        getEditorComponent().addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent e) {
                setPopupVisible(true);
            }

            @Override
            public void focusLost(FocusEvent e) {
                moveToEnd();
            }
        });
        addItemListener(event -> {
            if (event.getStateChange() == ItemEvent.SELECTED && event.getItem() != null) getModel().updateSuggestions(getEditorText());
        });
    }

    private void moveToEnd() {
        JTextComponent editorComponent = getEditorComponent();
        int length = editorComponent.getText().length();
        editorComponent.setSelectionStart(length);
        editorComponent.setSelectionEnd(length);
    }

    protected void processEditorKeyEvent(KeyEvent event) {
        int position = getEditorComponent().getCaretPosition();
        int selectionStart = getEditorComponent().getSelectionStart();
        int selectionEnd = getEditorComponent().getSelectionEnd();
        setSelectedItem(getModel().updateSuggestions(getEditorText()));
        if (event.getKeyChar() != KeyEvent.CHAR_UNDEFINED) {
            int length = getEditorText().length();
            getEditorComponent().setCaretPosition(Math.min(position, length));
            getEditorComponent().setSelectionStart(Math.min(selectionStart, length));
            getEditorComponent().setSelectionEnd(Math.min(selectionEnd, length));
        }

        int keyCode = event.getKeyCode();
        if (keyCode == KeyEvent.VK_SPACE && event.getModifiersEx() == KeyEvent.CTRL_DOWN_MASK) moveToEnd();
        else if (keyCode != KeyEvent.VK_ENTER && keyCode != KeyEvent.VK_ESCAPE && !isPopupVisible()) setPopupVisible(true);
    }

    @Override
    public SuggestModel<T> getModel() {
        return (SuggestModel<T>) super.getModel();
    }
}


text:
package com.webstersmalley.fees.service;

import com.webstersmalley.fees.domain.Resident;
import com.webstersmalley.fees.domain.Room;
import com.webstersmalley.fees.domain.RoomBooking;
import com.webstersmalley.fees.repository.RoomBookingRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created: 30/03/2014
 */
@Service
public class RoomBookingService {
    @Resource
    private RoomBookingRepository roomBookingRepository;

    public RoomBooking save(RoomBooking roomBooking) {
        return roomBookingRepository.save(roomBooking);
    }

    public List<RoomBooking> findAllByRoom(Room room) {
        return roomBookingRepository.findAllByRoom(room);
    }

    public List<RoomBooking> findAllByResident(Resident resident) {
        return roomBookingRepository.findAllByResident(resident);
    }
}


text:
package org.apache.pdfbox.cos;

import java.util.Collections;

/**
 * An unmodifiable COSDictionary.
 *
 * @author John Hewson
 */
final class UnmodifiableCOSDictionary extends COSDictionary
{
    /**
     * {@inheritDoc}
     */
    UnmodifiableCOSDictionary(COSDictionary dict)
    {
        super();
        items = Collections.unmodifiableMap(dict.items);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setNeedToBeUpdated(boolean flag)
    {
        throw new UnsupportedOperationException();
    }
}


text:
import * as React from 'react';

class TalentReviewGridItem
{
    constructor(editItem: TalentReviewGridEditItem) {
        this.firstName = editItem["firstName"].value;
        this.lastName = editItem["lastName"].value;
        this.userName = editItem["userName"].value;
        this.email = editItem["email"].value;
        this.endDate = editItem["endDate"].value;
        this.managerEmail = editItem["managerEmail"].value;
        this.localHrEmail = editItem["localHrEmail"].value;
    }

    public firstName: string;
    public lastName: string;
    public userName: string;
    public email: string;
    public endDate: string;
    public managerEmail: string;
    public localHrEmail: string;
}
class TalentReviewGridEditItem
{
    constructor(gridItem : TalentReviewGridItem) {
        this.firstName = new TalentReviewGridEditProp();
        this.lastName = new TalentReviewGridEditProp();
        this.userName = new TalentReviewGridEditProp();
        this.email = new TalentReviewGridEditProp();
        this.endDate = new TalentReviewGridEditProp();
        this.managerEmail = new TalentReviewGridEditProp();
        this.localHrEmail = new TalentReviewGridEditProp();

        this.firstName.value = gridItem.firstName;
        this.lastName.value = gridItem.lastName;
        this.userName.value = gridItem.userName;
        this.email.value = gridItem.email;
        this.endDate.value = gridItem.endDate;
        this.managerEmail.value = gridItem.managerEmail;
        this.localHrEmail.value = gridItem.localHrEmail;
    }

    public firstName: TalentReviewGridEditProp;
    public lastName: TalentReviewGridEditProp;
    public userName: TalentReviewGridEditProp;
    public email: TalentReviewGridEditProp;
    public endDate: TalentReviewGridEditProp;
    public managerEmail: TalentReviewGridEditProp;
    public localHrEmail: TalentReviewGridEditProp;
}

class TalentReviewGridEditProp
{
    constructor()
    {
        this.value = "";
        this.valid = true;
        this.class = "";
    }

    public value: string;
    public valid: boolean;
    public class: string;
}

class TalentReviewGridProps
{
    public editRow: number;
    public rowAdded: boolean;
    public editing: TalentReviewGridEditItem;
    public items: TalentReviewGridItem[];
}

export default class TalentReviewGrid extends React.Component<TalentReviewGridProps, any>
{

    constructor(props) {
        super(props);
        this.state = {
            editRow: undefined,
            editing: undefined,
            rowAdded: false,
            items: props.items
        };
        this.onAdd = this.onAdd.bind(this);
        this.onEdit = this.onEdit.bind(this);
        this.onSave = this.onSave.bind(this);
        this.onCancel = this.onCancel.bind(this);
        this.saveAll = this.saveAll.bind(this);
    }

    clone(source) {
        var d = {};
        for (var p in source) if (source.hasOwnProperty(p)) d[p] = source[p];
        return d;
    };

    onAdd() {
        var tempState = this.state;
        var newItem = {
            firstName: '',
            lastName: '',
            userName: '',
            email: '',
            endDate: '',
            managerEmail: '',
            localHrEmail: ''
        }

        var items = [...tempState.items];
        items.splice(0, 0, newItem);

        tempState.rowAdded = true;
        tempState.items = items;
        tempState.editRow = 0;
        tempState.editing = new TalentReviewGridEditItem(newItem);

        this.setState(tempState);
    }

    onEdit(rowId) {
        var tempState = this.state;

        if (tempState.editRow !== undefined)
        {
            this.onCancel();
        }

        tempState.editRow = rowId;
        tempState.editing = new TalentReviewGridEditItem(this.state.items[rowId]);
        tempState.rowAdded = false;

        console.log(tempState.editing);

        this.setState(tempState);
    }

    onSave() {
        var tempState = this.state;

        if (tempState.editing === undefined || this.validateRow(tempState.editing))
        {
            if (tempState.editing !== undefined)
                tempState.items[tempState.editRow] = new TalentReviewGridItem(tempState.editing);

            tempState.editing = undefined;
            tempState.editRow = undefined;
            tempState.rowAdded = false;

            this.setState(tempState);
        }
    }

    onCancel() {
        var tempState = this.state;

        if (tempState.rowAdded)
        {
            tempState.items.splice(0,1);
        }

        tempState.editRow = undefined;
        tempState.editing = undefined;
        tempState.rowAdded = false;

        this.setState(tempState);
    }

    handleChangeEvt(event, fieldName, fieldType = "")
    {
        this.setValueAndValidate(event.target.value, fieldName, fieldType);
    }

    setValueAndValidate(value: string, fieldName, fieldType = "") {
        var tempState = this.state;
        tempState.editing[fieldName].value = value;
        var errorClasses = "ms-bgColor-error ms-fontColor-error";
        var valid = true;

        if (fieldType.length == 0)
        {
            if (fieldName.indexOf("email") > -1)
                fieldType = "email";

            if (fieldName.indexOf("date") > -1)
                fieldType = "date";
        }

        switch (fieldType) {
            case "email":
                valid = this.validateEmail(value);
                break;
            case "date":
                valid = this.validateDate(value);
                break;
            case "string":
            default:
                valid = value.length > 0;
                break;

        }

        tempState.editing[fieldName].valid = valid;

        if (!valid)
        {
            tempState.editing[fieldName].class = errorClasses;
        }
        else {
            tempState.editing[fieldName].class = "";
        }

        this.setState(tempState);
    }

    validateRow(row : TalentReviewGridEditItem) {
        var valid = true;

        for (var prop in row)
        {
            this.setValueAndValidate(row[prop].value, prop);
            valid = valid && row[prop].valid;
        }

        return valid;
    }

    validateEmail(email) {
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(email);
    }

    validateDate(date) {
        var re = /^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])$/;
        return re.test(date);
    }

    saveAll() {
        this.onSave();
        console.log(this.state.items);
    }

    render() {

        return (

                            First name
                            Last name
                            Username
                            E-mail
                            End date
                            Manager
                            Local HR

                            No rows have been added

                            {this.state.items.map((item, index) => {
                            if (index === this.state.editRow)
                            {
                                return (

                                                            <button className="ms-Button ms-Button--hero" onClick={(e) => { this.onSave() }} title="Save changes" style={{minWidth:30, padding: 0}}>

                                                            </button>

                                                            <button className="ms-Button ms-Button--hero" onClick={(e) => { this.onCancel() }} title="Discard changes" style={{minWidth:30, padding: 0}}>

                                                            </button>

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["firstName"].class}
                                                maxLength={50}
                                                onChange={(e) => this.handleChangeEvt(e, "firstName")}
                                                onBlur={(e) => this.handleChangeEvt(e, "firstName")}
                                                value={this.state.editing["firstName"].value} />

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["lastName"].class}
                                                maxLength={100}
                                                onChange={(e) => this.handleChangeEvt(e, "lastName")}
                                                onBlur={(e) => this.handleChangeEvt(e, "lastName")}
                                                value={this.state.editing["lastName"].value} />

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["userName"].class}
                                                maxLength={50}
                                                onChange={(e) => this.handleChangeEvt(e, "userName")}
                                                onBlur={(e) => this.handleChangeEvt(e, "userName")}
                                                value={this.state.editing["userName"].value} />

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["email"].class}
                                                maxLength={100}
                                                onChange={(e) => this.handleChangeEvt(e, "email", "email")}
                                                onBlur={(e) => this.handleChangeEvt(e, "email", "email")}
                                                value={this.state.editing["email"].value} />

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["endDate"].class}
                                                maxLength={100}
                                                onChange={(e) => this.handleChangeEvt(e, "endDate", "date")}
                                                onBlur={(e) => this.handleChangeEvt(e, "endDate", "date")}
                                                value={this.state.editing["endDate"].value}
                                                placeholder="yyyy-mm-dd" />

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["managerEmail"].class}
                                                maxLength={100}
                                                onChange={(e) => this.handleChangeEvt(e, "managerEmail", "email")}
                                                onBlur={(e) => this.handleChangeEvt(e, "managerEmail", "email")}
                                                value={this.state.editing["managerEmail"].value} />

                                            <input
                                                type="text"
                                                style={{width: 95 + "%"}}
                                                className={this.state.editing["localHrEmail"].class}
                                                maxLength={100}
                                                onChange={(e) => this.handleChangeEvt(e, "localHrEmail", "email")}
                                                onBlur={(e) => this.handleChangeEvt(e, "localHrEmail", "email")}
                                                value={this.state.editing["localHrEmail"].value} />

                                );
                            }
                            else {
                                return (

                                            <button
                                                className="ms-Button ms-Button--hero"
                                                onClick={(e) => { this.onEdit(index) }}
                                                title="Edit row"
                                                style={{minWidth:30, padding: 0}}
                                            >

                                            </button>

                                        {item.firstName}
                                        {item.lastName}
                                        {item.userName}
                                        {item.email}
                                        {item.endDate}
                                        {item.managerEmail}
                                        {item.localHrEmail}

                                );
                            }
                        })}

                <button className="ms-Button ms-Button--hero" onClick={this.onAdd} disabled={this.state.editing !== undefined}>
                     Add row
                </button>
                <button className="ms-Button ms-Button--hero" onClick={this.saveAll}>
                     Save changes and close
                </button>

        );
    };
}


text:
template< typename ... T > void foo( T ... args );
template<> void foo( ){}
template<> void foo(int,double){}
int main()
{
  foo( 0, 0.0 );
  return 55;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Uromyces transcaspicus Petr.

### Remarks
null


text:
<?php

namespace PragmaRX\Sdk\Services\Presenter\Exceptions;

class PresenterException extends \Exception {

}


text:
package se.lth.cs.docforia.exceptions;

/**
 * Query Exception signaling errors during query construction or execution
 */
public class QueryException extends RuntimeException {

    public QueryException() {
    }

    public QueryException(String message) {
        super(message);
    }

    public QueryException(String message, Throwable cause) {
        super(message, cause);
    }

    public QueryException(Throwable cause) {
        super(cause);
    }

    public QueryException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}


text:
var appendix =
[
    [ "Table of Contents", "appendix.html#appendix_toc", null ],
    [ "Design Rationale", "rationale.html", [
      [ "Why is it needed?", "rationale.html#rationale_why", null ],
      [ "Why use an ICU wrapper instead of ICU?", "rationale.html#why_icu", null ],
      [ "Why an ICU wrapper and not an implementation-from-scratch?", "rationale.html#why_icu_wrapper", null ],
      [ "Why is the ICU API not exposed to the user?", "rationale.html#why_icu_api_is_hidden", null ],
      [ "Why use GNU Gettext catalogs for message formatting?", "rationale.html#why_gnu_gettext", null ],
      [ "Why is a plain number used for the representation of a date-time, instead of a Boost.DateTime date or Boost.DateTime ptime?", "rationale.html#why_plain_number", null ],
      [ "Why are POSIX locale names used and not something like the BCP-47 IETF language tag?", "rationale.html#why_posix_names", null ],
      [ "Why most parts of Boost.Locale work only on linear/contiguous chunks of text", "rationale.html#why_linear_chunks", null ],
      [ "Why all Boost.Locale implementation is hidden behind abstract interfaces and does not use template metaprogramming?", "rationale.html#why_abstract_api", null ],
      [ "Why Boost.Locale does not provide char16_t/char32_t for non-C++0x platforms.", "rationale.html#why_no_special_character_type", null ]
    ] ],
    [ "Frequently Asked Questions", "faq.html", null ],
    [ "Default Encoding under Microsoft Windows", "default_encoding_under_windows.html", null ],
    [ "Running Examples under Microsoft Windows", "running_examples_under_windows.html", null ],
    [ "Using Gettext Tools on Windows", "gettext_for_windows.html", [
      [ "Getting gettext utilities from CppCMS project", "gettext_for_windows.html#gettext_for_windows_cppcms", null ],
      [ "Getting Gettext via MinGW project", "gettext_for_windows.html#gettext_for_windows_mingw", null ],
      [ "Building latest version on your own.", "gettext_for_windows.html#gettext_for_windows_build", null ],
      [ "Using Cygwin", "gettext_for_windows.html#gettext_for_windows_cygwin", null ]
    ] ],
    [ "Glossary", "glossary.html", null ],
    [ "Tested Compilers and Platforms", "tested_compilers_and_paltforms.html", [
      [ "Known Issues", "tested_compilers_and_paltforms.html#tested_compilers_and_paltforms_issues", null ]
    ] ],
    [ "Status of C++11 char16_t/char32_t support", "status_of_cpp0x_characters_support.html", [
      [ "GNU GCC 4.5/C++11 Status", "status_of_cpp0x_characters_support.html#status_of_cpp0x_characters_support_gnu", null ],
      [ "Visual Studio 2010 (MSVC10)/C++11 Status", "status_of_cpp0x_characters_support.html#status_of_cpp0x_characters_support_msvc", null ]
    ] ],
    [ "Special Thanks", "special_thanks.html", null ]
];


text:
package com.google.security.zynamics.zylib.disassembly;

import java.util.Date;

@SuppressWarnings("hiding")
public interface IViewListener<ViewType> {
  /**
   * Invoked when the description of a view is changed.
   *
   * @param view The view where the description is changed.
   * @param description The description which is the new view description.
   */
  void changedDescription(ViewType view, String description);

  /**
   * Invoked when the modification date of a view is changed.
   *
   * @param view The view whose modification date is changed.
   * @param modificationDate The new modification date.
   */
  void changedModificationDate(ViewType view, Date modificationDate);

  /**
   * Invoked if the name of a view has been changed.
   *
   * @param view The view whose name has been changed.
   * @param name The new name of the view.
   */
  void changedName(ViewType view, String name);

  /**
   * Invoked if the view is in the closing state.
   *
   * @return true = view can be closed.
   */
  boolean closingView(ViewType view);

  /**
   * Invoked if a view has been loaded.
   *
   * @param view The view that has just been loaded.
   */
  void loadedView(ViewType view);
}


text:
package edu.ucla.nesl.mca.feature;

import edu.ucla.nesl.mca.TypeManager;

public class MinFeature extends Feature {

    private static final String name = "Min";
    private static final int outputType = TypeManager.TYPE_DOUBLE;

    public MinFeature() {
        super(name, outputType);
    }

    @Override
    public boolean careSampleRate() {
        return false;
    }

    @Override
    public Object evaluate(Object[] input, int inputType, String config) {
        if (inputType == TypeManager.TYPE_DOUBLE) {

            double result = Double.MAX_VALUE;
            for (Object obj : input) {
                double value = (Double) obj;
                if (value < result)
                    result = value;
            }
            return result;
        } else {
            return null;
        }
    }

}


text:
<?php

/**
 * Template Functions, Furasta.Org
 *
 * Alows quick, shorthand access to the template class,
 * to be expanded on!
 *
 * @author     Conor Mac Aoidh <conormacaoidh@gmail.com>
 * @license    http://furasta.org/licence.txt The BSD License
 * @version    1.0
 * @package    admin_template
 */

/**
 * _e
 *
 * Echos using the template class, a shorthand
 * version of $Template->add( 'content', $content );
 * This function also echos using language files
 * which is a feature still being worked on
 *
 * @param string $message
 * @access public
 * @return void
 */
function _e( $content ){

	$Template = Template::getInstance( );

	// todo add language file processing

	$Template->add( 'content', $content );

}

?>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
    <title>Workshop NL</title>

    <!-- External lib: ExtJS -->
    <link rel="stylesheet" type="text/css"
          href="http://cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/ext-all.css"/>
    <script type="text/javascript"
            src="http://cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/ext-all.js"></script>

    <!-- External lib: Proj4JS (reproject lib) -->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.js"
            type="text/javascript"></script>

    <!-- External lib: OpenLayers   -->
    <link rel="stylesheet" type="text/css"
          href="http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/theme/default/style.css"/>
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.js"></script>

    <!-- External lib: GeoExt -->
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/geoext/1.1/script/GeoExt.js"></script>
    <script type="text/javascript" src="http://lib.heron-mc.org/geoext/1.1/lib/overrides/override-ext-ajax.js"></script>

    <!-- Script and css resources for printpreview ux (in Heron-ux.js) -->
    <!--<script type="text/javascript" src="http://lib.heron-mc.org/heron/latest/ux/printpreview/lib/GeoExt.ux/PrintPreview.js"></script>-->
    <link rel="stylesheet" type="text/css"
          href="http://lib.heron-mc.org/heron/latest/ux/printpreview/resources/css/printpreview.css"/>

    <!-- External lib: GXP (in Heron-ux.js) -->
    <link rel="stylesheet" type="text/css" href="http://lib.heron-mc.org/heron/latest/ux/gxp/git/src/theme/all.css"/>

    <!-- External lib: Editor (in Heron-ux.js) -->
    <!--<script type="text/javascript" src="http://lib.heron-mc.org/heron/latest/ux/oleditor/ole/client/lib/Editor/Lang/nl.js"></script>-->
    <!--<script type="text/javascript" src="http://lib.heron-mc.org/heron/latest/ux/oleditor/ole/ole.min.js"></script>-->

    <!-- External lib: Heron Mapping Client -->
    <link rel="stylesheet" type="text/css" href="http://lib.heron-mc.org/heron/latest/resources/css/default.css"/>
    <link rel="stylesheet" href="http://lib.heron-mc.org/heron/latest/ux/oleditor/ole/client/theme/geosilk/geosilk.css"
          type="text/css"/>
    <script type="text/javascript" src="http://lib.heron-mc.org/heron/latest/script/Heron-with-ux.js"></script>
    <script type="text/javascript"
            src="http://lib.heron-mc.org/heron/latest/ux/printpreview/lib/locale/PrintPreview-nl.js"></script>

    <!-- OpenLayers - System Settings -->
    <script type="text/javascript">
        Heron.globals.imagePath = 'http://lib.heron-mc.org/heron/latest/resources/images/';
    </script>
    <script type="text/javascript" src="Options.js"></script>
    <script type="text/javascript" src="Layout.js"></script>

</head>
<body>

</body>
</html>


text:
package com.qunadai.channel.content.adapter;

import android.view.View;

/**
 * Created by wayne on 2017/5/24.
 */

public interface OnCompatItemClickListener {
    void onItemClick(View view, int position);
}