text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

Ext.define('sisprod.view.WorkRequest.UpdateWorkRequest', {
    extend: 'sisprod.view.base.BaseDataWindow',

    alias: 'widget.updateWorkRequest',

    require: [
        'sisprod.view.base.BaseDataWindow',
        'sisprod.view.base.SensitiveComboBox'
    ],

    messages: {
        validation: {
            alertTitle: 'Message',
            firstSelectWorkCategoryText: 'Please, first select work category...'
        },
        formTitle: 'Request Data',
        lotLabel: 'Lot',
        requestDateLabel: 'Date',
        workCategoryLabel: 'Work Category',
        workCategoryDetailLabel: 'Work Type',
        workCategoryDetailEmptyText: 'Type work type name',
        workCategoryEmptyText: 'Type work category',
        workRequestSourceLabel: 'Work Request Source',
        workRequestFullNumberLabel: 'Request Number',
        equipmentTypeLabel: 'Equipment Type',
        equipmentLabel: 'Equipment',
        equipmentEmptyText: 'Type an equipment name...',
        locationLabel: 'Location',
        locationEmptyText: 'Type a location name',
        applicantLabel: 'Applicant',
        applicantEmptyText: 'Type an employee name',
        recipientLabel: 'Recipient',
        recipientEmptyText: 'Type an employee name',
        workDetailsLabel: 'Type work detail to perform',
        firstSelectAlertText: 'Select equipment type before perform search!',
        firstSelectWorkCategoryAlertText: 'Select work category before perform search!',
        isSubstandardConditionLabel: 'Condition SubStandard',
        detectionDateLabel: 'Detencion Date',
        subStandardLabel: 'SubStandard',
        subStandardConditionActionLabel: 'SubStandard Condition Action',
        hsseSupervisorLabel: 'Supervisor',
        hsseSupervisorEmptyText: 'Hsse Supervisor',
        subStandardTitle: 'SubStandard'
    },

    title: 'Update Work Request',
    modal: true,
    width: 750,
    layout: 'fit',

    initComponent: function(){
        var me = this;

        me.formOptions = {
            region: 'center',
            bodyStyle: 'padding:5px 5px 0',
            items: [
                {
                    xtype: 'hiddenfield',
                    name: 'idWorkRequest',
                    id: 'idWorkRequest'
                },
                {
                    xtype:'fieldset',
                    title: me.messages.formTitle,
                    defaultType: 'textfield',
                    defaults: {anchor: '100%', labelWidth: 120},
                    layout: 'anchor',
                    items: [
                        {
                            xtype: 'textfield',
                            name: 'workRequestFullNumber',
                            id: 'workRequestFullNumber',
                            anchor: '45%',
                            fieldLabel: me.messages.workRequestFullNumberLabel,
                            labelWidth: 120,
                            readOnly: true
                        },
                        {
                            xtype: 'fieldcontainer',
                            layout: 'hbox',
                            anchor: '100%',
                            items: [
                                {
                                    xtype: 'combofieldcontainer',
                                    flex: 5,
                                    showButtons: false,
                                    comboBoxOptions: {
                                        name: 'idLot',
                                        id: 'idWorkRequestLot',
                                        labelWidth: 120,
                                        store: Ext.create('sisprod.store.LotAll', {autoLoad: true}),
                                        fieldLabel: me.messages.lotLabel,
                                        displayField: 'lotName',
                                        valueField: 'idLot',
                                        emptyText: 'Seleccione',
                                        forceSelection: true,
                                        allowBlank: false
                                    }
                                },
                                {
                                    xtype: 'datefield',
                                    id: 'requestDate',
                                    name: 'requestDate',
                                    fieldLabel: me.messages.requestDateLabel,
                                    flex: 2,
                                    startDateField: 'detectionDate',
                                    value: new Date(),
                                    readOnly: true
                                }
                            ]
                        },
                        {
                            xtype: 'combofieldcontainer',
                            comboBoxOptions: {
                                name: 'idWorkRequestSource',
                                id: 'idWorkRequestSource',
                                store: Ext.create('sisprod.store.WorkRequestSourceAll', {autoLoad: true}),
                                fieldLabel: me.messages.workRequestSourceLabel,
                                labelWidth: 120,
                                displayField: 'workRequestSourceName',
                                valueField: 'idWorkRequestSource',
                                emptyText: 'Seleccione',
                                forceSelection: true,
                                allowBlank: false,
                                width: 400
                            }
                        },
                        {
                            xtype: 'sensitivecombocontainer',
                            anchor: '100%',
                            showAddButton: false,
                            sensitiveComboBoxOptions: {
                                hideTrigger: false,
                                name: 'idWorkCategory',
                                id: 'idWorkCategory',
                                labelWidth: 120,
                                store: Ext.create('sisprod.store.WorkCategoryByNameStore'),
                                fieldLabel: me.messages.workCategoryLabel,
                                emptyText: me.messages.workCategoryEmptyText,
                                displayTpl: Ext.create('Ext.XTemplate',
                                    '<tpl for=".">','{workCategoryName}','</tpl>'),
                                valueField: 'idWorkCategory',
                                listConfig: {
                                    getInnerTpl: function() {
                                        return "{workCategoryName}";
                                    }
                                },
                                forceSelection: true,
                                allowBlank: false
                            }
                        },
                        {
                            xtype: 'sensitivecombocontainer',
                            anchor: '100%',
                            showAddButton: false,
                            sensitiveComboBoxOptions:{
                                hideTrigger: false,
                                name: 'idWorkCategoryDetail',
                                id: 'idWorkCategoryDetail',
                                fieldLabel: me.messages.workCategoryDetailLabel,
                                labelWidth: 120,
//                                store: Ext.create('sisprod.store.WorkCategoryDetailByCategory'),
                                store: Ext.create('sisprod.store.WorkCategoryDetailByCategory',{
                                    listeners: {
                                        beforeload: function(store, operation, options){
                                            var idWorkCategory = me.down('#idWorkCategory').getValue();
                                            if(Ext.isDefined(idWorkCategory) && idWorkCategory!==null){
                                                if(Ext.isDefined(operation.params) && operation.params!==null)
                                                    operation.params.idWorkCategory = idWorkCategory;
                                                else operation.params = {query: '', idWorkCategory: idWorkCategory};
                                            }
                                            else{
                                                Ext.Msg.alert(me.messages.validation.alertTitle, me.messages.validation.firstSelectWorkCategoryText);
                                                return false;
                                            }
                                        }
                                    }
                                }),
                                emptyText: me.messages.workCategoryDetailEmptyText,
                                forceSelection : true,
                                allowBlank: false,
                                displayTpl: Ext.create('Ext.XTemplate',
                                    '<tpl for=".">','{workCategoryDetailName}','</tpl>'),
                                valueField: 'idWorkCategoryDetail',
                                listConfig: {
                                    getInnerTpl: function() {
                                        return "{workCategoryDetailName}";
                                    }
                                }
                            }
                        },
//                        {
//                            xtype: 'combobox',
//                            name: 'idWorkCategory',
//                            id: 'idWorkCategory',
//                            anchor: '65%',
//                            labelWidth: 120,
//                            store: Ext.create('sisprod.store.WorkCategoryAll'),
//                            fieldLabel: me.messages.workCategoryLabel,
//                            displayField: 'workCategoryName',
//                            valueField: 'idWorkCategory',
//                            forceSelection: true,
//                            allowBlank: false
//                        },
//                        {
//                            xtype: 'sensitivecombocontainer',
//                            anchor: '70%',
//                            showAddButton: false,
//                            sensitiveComboBoxOptions:{
//                                name: 'idWorkCategoryDetail',
//                                id: 'idWorkCategoryDetail',
//                                fieldLabel: me.messages.workCategoryDetailLabel,
//                                labelWidth: 120,
//                                store: Ext.create('sisprod.store.WorkCategoryDetailByCategory',{
//                                    listeners: {
//                                        beforeload: function(store, operation, options){
//                                            var form = me.down('form');
//                                            var workCategoryInput = form.queryById('idWorkCategory');
//                                            var selectedWorkCategory = workCategoryInput.getValue();
//                                            if(Ext.isDefined(selectedWorkCategory) && selectedWorkCategory!==null)
//                                                operation.params.idWorkCategory = selectedWorkCategory;
//                                            else{
//                                                Ext.Msg.alert(me.messages.formTitle, me.messages.firstSelectWorkCategoryAlertText);
//                                                return false;
//                                            }
//                                        }
//                                    }
//                                }),
//                                emptyText: me.messages.workCategoryDetailEmptyText,
//                                forceSelection : true,
//                                allowBlank: false,
//                                displayTpl: Ext.create('Ext.XTemplate',
//                                    '<tpl for=".">','{workCategoryDetailName}','</tpl>'),
//                                valueField: 'idWorkCategoryDetail',
//                                listConfig: {
//                                    getInnerTpl: function() {
//                                        return "{workCategoryDetailName}";
//                                    }
//                                }
//                            }
//                        },
                        {
                            xtype: 'combobox',
                            anchor: '50%',
                            fieldLabel : me.messages.equipmentTypeLabel,
                            labelWidth: 120,
                            store : Ext.create('sisprod.store.EquipmentTypeAll', {autoLoad: true}),
                            displayField: 'equipmentTypeName',
                            valueField: 'idEquipmentType',
                            name:'idSelectEquipmentType',
                            id:'idSelectEquipmentType',
                            emptyText: 'Seleccione',
                            allowBlank:false,
                            forceSelection : true
                        },
                        {
                            xtype: 'sensitivecombocontainer',
                            anchor: '90%',
                            sensitiveComboBoxOptions:{
                                name: 'idEquipment',
                                id: 'idEquipment',
                                fieldLabel: me.messages.equipmentLabel,
                                labelWidth: 120,
                                store: Ext.create('sisprod.store.EquipmentAllByTypeAndLot',{
                                    listeners: {
                                        beforeload: function(store, operation, options){
                                            var form = me.down('form');
                                            var equipmentTypeInput = form.queryById('idSelectEquipmentType');
                                            var lotInput = form.queryById('idWorkRequestLot');
                                            var selectedEquipmentType = equipmentTypeInput.getValue();
                                            var selectedLot = lotInput.getValue();
                                            if(Ext.isDefined(selectedEquipmentType) && selectedEquipmentType!==null){
                                                if(Ext.isDefined(selectedLot) && selectedLot!==null){
                                                    if(Ext.isDefined(operation.params) && operation.params!==null) {
                                                        operation.params.idEquipmenType = selectedEquipmentType;
                                                        operation.params.idLot = selectedLot;
                                                    }
                                                    else operation.params = {
                                                        query: '',
                                                        idEquipmenType: selectedEquipmentType,
                                                        idLot: selectedLot
                                                    };
                                                }
                                                else{
                                                    Ext.Msg.alert(me.messages.formTitle, me.messages.validation.firstSelectLotAlertText);
                                                    return false;
                                                }
                                            }
                                            else{
//                                                Ext.Msg.alert(me.messages.formTitle, me.messages.firstSelectAlertText);
                                                return false;
                                            }
                                        }
                                    }
                                }),
                                emptyText: me.messages.equipmentEmptyText,
                                forceSelection : true,
                                hideTrigger: false,
                                allowBlank: false,
                                displayTpl: Ext.create('Ext.XTemplate',
                                    '<tpl for=".">','{equipmentName} - {equipmentCode} ({locationName})','</tpl>'),
                                valueField: 'idEquipment',
                                listConfig: {
                                    getInnerTpl: function() {
                                        return "{equipmentName} - {equipmentCode} ({locationName})";
                                    }
                                }
                            }
                        },
//                        {
//                            xtype: 'sensitivecombocontainer',
//                            anchor: '70%',
//                            sensitiveComboBoxOptions:{
//                                name: 'idWorkRequestLocation',
//                                id: 'idWorkRequestLocation',
//                                fieldLabel: me.messages.locationLabel,
//                                labelWidth: 120,
//                                store: Ext.create('sisprod.store.LocationTemplate'),
//                                emptyText: me.messages.locationEmptyText,
//                                forceSelection : true,
//                                displayTpl: Ext.create('Ext.XTemplate',
//                                    '<tpl for=".">','{locationName}','</tpl>'),
//                                valueField: 'idLocation',
//                                allowBlank: false,
//                                listConfig: {
//                                    getInnerTpl: function() {
//                                        return "{locationName}";
//                                    }
//                                }
//                            }
//                        },
                        {
                            xtype: 'sensitivecombocontainer',
                            showAddButton: false,
                            anchor: '80%',
                            sensitiveComboBoxOptions:{
                                name: 'idApplicant',
                                fieldLabel: me.messages.applicantLabel,
                                labelWidth: 120,
                                store: Ext.create('sisprod.store.EmployeeFromGMP'),
                                emptyText: me.messages.applicantEmptyText,
                                id: 'idApplicant',
                                forceSelection : true,
                                hideTrigger: false,
                                allowBlank: false,
                                displayTpl: Ext.create('Ext.XTemplate',
                                    '<tpl for=".">','{personFullName} ({fullDocumentNumber})','</tpl>'),
                                valueField: 'idEmployee',
                                listConfig: {
                                    getInnerTpl: function() {
                                        return '{personFullName} ({fullDocumentNumber})';
                                    }
                                }
                            }
                        },
                        {
                            xtype: 'checkbox',
                            name: 'isSubstandardCondition',
                            id: 'isSubstandardCondition',
                            anchor: '50%',
//                                    fieldLabel: 'is Substandard Condition',
                            labelWidth: '50%',
                            fieldLabel: me.messages.isSubstandardConditionLabel,
                            inputValue: true
                        }
                    ]
                },
                {
                    xtype: 'fieldset',
                    title: me.messages.subStandardTitle,
                    layout: 'anchor',
                    id: 'ipPanelSubstandard',
                    hidden: true,
                    bodyPadding: 2,
//                    defaults: {anchor: '100%', labelWidth: '120'},
                    items: [
//                        {
//                            xtype: 'sensitivecombocontainer',
//                            showAddButton: false,
//                            anchor: '100%',
//
//                            sensitiveComboBoxOptions:{
//                                name: 'idHsseSupervisor',
//                                hideTrigger: false,
//                                labelWidth:100,
//                                fieldLabel: me.messages.hsseSupervisorLabel,
//                                store: Ext.create('sisprod.store.HsseSupervisorTemplate'),
//                                emptyText: me.messages.applicantEmptyText,
//                                id: 'idHsseSupervisor',
//                                forceSelection : true,
//                                displayTpl: Ext.create('Ext.XTemplate',
//                                    '<tpl for=".">','{personFullName} ({fullDocumentNumber})','</tpl>'),
//                                valueField: 'idHsseSupervisor',
//                                listConfig: {
//                                    getInnerTpl: function() {
//                                        return '{personFullName} ({fullDocumentNumber})';
//                                    }
//                                }
//                            }
//
//                        },
                        {
                            xtype: 'fieldcontainer',
                            anchor:'100%',
                            layout: {
                                type: 'hbox',
                                padding: '0 0 0 0'
                            },
                            items: [
                                {
                                    xtype: 'combobox',
//                                    anchor: '50%',
//                                    margin: '0 10 0 0',
                                    flex:1,
                                    labelWidth:100,
                                    id: 'idSubstandard',
                                    fieldLabel : me.messages.subStandardLabel,
                                    store : Ext.create('sisprod.store.SubstandardAll').load(),
                                    displayField : 'substandardName',
                                    valueField : 'idSubstandard',
                                    name:'idSubstandard',
                                    emptyText: ' ',
                                    forceSelection : true,
                                    editable : false
                                },
//                                {
//                                    xtype: 'combobox',
////                                    anchor: '50%',
//                                    flex:1,
//                                    labelWidth:100,
//                                    fieldLabel : me.messages.subStandardConditionActionLabel,
//                                    margin: '0 0 0 10',
//                                    store : Ext.create('sisprod.store.SubstandardConditionActionAll').load(),
//                                    displayField : 'description',
//                                    valueField : 'idSubstandardConditionAction',
//                                    name:'idSubstandardConditionAction',
//                                    id:'idSubstandardConditionAction',
//                                    emptyText: ' ',
//                                    forceSelection : true,
//                                    editable : false
//                                }
                                  {
                                        xtype: 'datefield',
                                        name: 'detectionDate',
                                        id: 'detectionDate',
                                        margin: '0 0 0 10',
                                        maxValue:me.record.raw.requestDate,
                                        labelWidth:100,
                                        anchor: '50%',
//                                        value : new Date(),
                                        fieldLabel: me.messages.detectionDateLabel
                                   }
                            ]
                        },

                    ]
                },
                {
                    xtype:'fieldset',
                    columnWidth: 0.5,
                    title: me.messages.workDetailsLabel,
                    defaultType: 'textfield',
                    defaults: {anchor: '100%'},
                    layout: 'anchor',
                    items: [
                        {
                            xtype: 'textareafield',
                            anchor: '100%',
                            name: 'description',
                            id: 'description',
                            maxLength: 5000,
                            allowBlank: false
                        }
                    ]
                }
            ]
        };

        me.callParent(arguments);
    }
});


text:
package boa.test.datagen;

import java.io.IOException;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/*
 * @author sfarheen
 * @author rdyer
 */
public class TestDefaultMethods extends Java8BaseTest {
	@Test
	public void defaultMethod() throws IOException {
		assertEquals(
			load("test/datagen/boa/default-method.boa").trim(),
			parseJava(load("test/datagen/java/default-method.java")).trim()
		);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.tyrfing.games.tyrlib3.util;

public interface IErrorHandler {
	public void onError();
}


text:
{% extends "registration/registration_base.html" %}
{% load i18n %}

{% block content %}

{% trans "Please set your new password" %}

<form method="post" action=".">{% csrf_token %}

       {{form.old_password.errors}}

Old password: <input type="password" name="old_password" id="id_old_password" />

       {{form.new_password1.errors}}

New password: <input type="password" name="new_password1" id="id_new_password1" />

       {{form.new_password2.errors}}

New password confirmation: <input type="password" name="new_password2" id="id_new_password2" />

            <input type="submit" class="btn" value="{% trans 'Change' %}" />

</form>
{% endblock %}


text:
<?php

namespace Bistro\Session;

/**
 * Storage engine for native php sessions.
 *
 * @package  Bistro
 */
class Native extends \Bistro\Hash implements \Bistro\Session\Session
{
	/**
	 * @var boolean  Is the session started yet?
	 */
	private $started = false;

	/**
	 * You can override php.ini session options in the constructor.
	 *
	 * Option                  | Default
	 * ------------------------|----------
	 * save_path               | ""
	 * name                    | "PHPSESSID"
	 * save_handler            | "files"
	 * auto_start              | "0"
	 * gc_probability          | "1"
	 * gc_divisor              | "100"
	 * gc_maxlifetime          | "1440"
	 * serialize_handler       | "php"
	 * cookie_lifetime 	       | "0"
	 * cookie_path             | "/"
	 * cookie_domain           | ""
	 * cookie_secure           | ""
	 * cookie_httponly         | ""
	 * use_cookies             | "1"
	 * use_only_cookies        | "1"
	 * referer_check           | ""
	 * entropy_file            | ""
	 * entropy_length          | "0"
	 * cache_limiter           | "nocache"
	 * cache_expire            | "180"
	 * use_trans_sid           | "0"
	 * hash_function           | "0"
	 * hash_bits_per_character | "4"
	 * url_rewriter.tags       | "a=href,area=href,frame=src,form=,fieldset="
	 *
	 * @see   http://php.net/session.configuration
	 * @param array $data      Initial Session data
	 * @param array $options   Session options
	 */
	public function __construct(array $data = null, array $options = array())
	{
		\register_shutdown_function(array($this, 'close'));

		$this->setOptions($options);
		$this->read($data);
	}

	/**
	 * Sets session options.
	 *
	 * @param array $options Options array
	 */
	protected function setOptions(array $options)
	{
		$whitelist = array('save_path', 'name', 'save_handler', 'auto_start',
			'gc_probability', 'gc_divisor', 'gc_maxlifetime', 'serialize_handler',
			'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure',
			'cookie_httponly', 'use_cookies', 'use_only_cookies', 'referer_check',
			'entropy_file', 'entropy_length', 'cache_limiter', 'cache_expire',
			'use_trans_sid ', 'hash_function', 'hash_bits_per_character');

		foreach ($options as $key => $value)
		{
			if (\in_array($key, $whitelist))
			{
				\ini_set("session.{$key}", $value);
			}
		}

		if (\array_key_exists('url_rewriter.tags', $options))
		{
			\ini_set('url_rewriter.tags', $options['url_rewriter.tags']);
		}
	}

/** =========================
    \Bistro\Session\Session
    ========================= */
	/**
	 * {@inheritDoc}
	 */
	public function isStarted()
	{
		return $this->started;
	}

	/**
	 * {@inheritDoc}
	 */
	public function getId()
	{
		return \session_id();
	}

	/**
	 * {@inheritDoc}
	 */
	public function setId($id)
	{
		\session_id($id);
		return $this;
	}

	/**
	 * {@inheritDoc}
	 */
	public function getOnce($key, $default = null)
	{
		$value = $this->get($key, $default);
		$this->delete($key);
		return $value;
	}

	/**
	 * {@inheritDoc}
	 */
	public function regenerate()
	{
		return \session_regenerate_id();
	}

	/**
	 * {@inheritDoc}
	 */
	public function restart()
	{
		$this->read($this->toArray());
		return true;
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see http://www.php.net/manual/en/function.session-destroy.php#example-4597
	 */
	public function destroy()
	{
		$this->clear();

		if (\ini_get('session.use_cookies'))
		{
			$params = \session_get_cookie_params();
			\setcookie(
				\ini_get('session.name'), '', time() - 4200,
				$params['path'], $params['domain'],
				$params['secure'], $params['httponly']
			);
		}

		$this->started = false;
		return \session_destroy();
	}

	/**
	 * {@inheritDoc}
	 */
	public function read(array $data = null)
	{
		if ( ! $this->started)
		{
			\session_start();
			$this->started = true;
		}

		if ($data === null)
		{
			$data = $_SESSION;
		}

		$this->replace($data);
		return $this;
	}

	/**
	 * {@inheritDoc}
	 */
	public function write()
	{
		$_SESSION = $this->toArray();
		return $this;
	}

	/**
	 * {@inheritDoc}
	 */
	public function close()
	{
		$this->started = false;
		$this->write();

		\session_write_close();
		return $this;
	}

}


text:
package org.gradoop.flink.representation;

import com.google.common.collect.Sets;
import org.gradoop.common.model.impl.id.GradoopId;
import org.gradoop.common.model.impl.id.GradoopIdSet;
import org.gradoop.common.model.impl.pojo.Edge;
import org.gradoop.common.model.impl.pojo.GraphHead;
import org.gradoop.common.model.impl.pojo.Vertex;
import org.gradoop.common.model.impl.properties.Properties;
import org.gradoop.flink.model.GradoopFlinkTestBase;
import org.gradoop.flink.model.impl.GradoopFlinkTestUtils;
import org.gradoop.flink.model.impl.functions.epgm.Id;
import org.gradoop.flink.representation.transactional.RepresentationConverters;
import org.gradoop.flink.representation.transactional.AdjacencyList;
import org.gradoop.flink.model.impl.layouts.transactional.tuples.GraphTransaction;
import org.junit.Test;

import java.util.Set;

public class RepresentationConverterTest extends GradoopFlinkTestBase {

  @Test
  public void testGraphTransactionAdjacencyList() throws Exception {

    GraphTransaction transaction = getGraphTransaction();

    AdjacencyList<GradoopId, String, GradoopId, GradoopId> adjacencyList =
      RepresentationConverters.getAdjacencyList(transaction, new Id<>(), new Id<>());

    GraphTransaction convertedTransaction =
      RepresentationConverters.getGraphTransaction(adjacencyList);

    AdjacencyList<GradoopId, String, GradoopId, GradoopId> convertedAdjacencyList =
      RepresentationConverters
        .getAdjacencyList(convertedTransaction, new Id<>(), new Id<>());

    GradoopFlinkTestUtils.assertEquals(transaction, convertedTransaction);
    GradoopFlinkTestUtils.assertEquals(adjacencyList, convertedAdjacencyList);
  }

  private GraphTransaction getGraphTransaction() {
    GraphHead graphHead = new GraphHead(GradoopId.get(), "Test", null);

    GradoopIdSet graphIds = GradoopIdSet.fromExisting(graphHead.getId());
    Set<Vertex> vertices = Sets.newHashSet();
    Set<Edge> edges = Sets.newHashSet();

    Properties aProperties = new Properties();
    aProperties.set("x", 1);
    Vertex v1 = new Vertex(GradoopId.get(), "A", aProperties, graphIds);
    Vertex v2 = new Vertex(GradoopId.get(), "B", null, graphIds);

    vertices.add(v1);
    vertices.add(v2);

    Properties loopProperties = new Properties();

    edges.add(new Edge(GradoopId.get(), "loop", v1.getId(), v1.getId(), loopProperties, graphIds));
    edges.add(new Edge(GradoopId.get(), "m", v1.getId(), v2.getId(), null, graphIds));
    edges.add(new Edge(GradoopId.get(), "m", v1.getId(), v2.getId(), null, graphIds));
    edges.add(new Edge(GradoopId.get(), "m", v2.getId(), v1.getId(), null, graphIds));

    return new GraphTransaction(graphHead, vertices, edges);
  }
}


text:
int main() {
    using namespace boost::typeindex;
    ctti_type_index::type_info_t t = ctti_type_index::type_id<int>().type_info();
    (void)t;
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model backend\models\Category */
/* @var $form yii\widgets\ActiveForm */
/* @var $attributes \backend\models\Attribute[] */
/* @var $selectedAttributeIds array */

$urlManager = Yii::$app->urlManager;
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'parent_id')->dropDownList(
        ArrayHelper::map(\backend\models\Category::getSelectableParents($model), 'id', 'name'),
        [
            'id' => 'cmb-parent-id'
        ]
    ) ?>

        Category Attributes
        <?= Html::checkboxList(
            'attribute_ids',
            $selectedAttributeIds,
            ArrayHelper::map($attributes, 'id', 'name'),
            [
                'style' => 'display: block;',
                'id'    => 'attribute-list',
            ]
        ) ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
    	<title>New Post</title>
    	 <link rel="stylesheet" href="js/jquery-ui.css">
    	 <link rel="stylesheet" href="js/noty.css">
    	 <link rel="stylesheet" href="js/noty_theme_default.css">
    	 <link rel="stylesheet" href="css/main.css">

		<meta name="viewport" content="initial-scale=1.0, width=device-width, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no" />

    <form id="post_form">

    	<input type="hidden" name="o_id" id="o_id" value="">

Customer Name

Mobile

Send Date

<input class="text-input" name="senddate" readonly type="text" id="datepicker">

Location

<input type="text" value="" name="location" class="text-input" placeholder="Enter Location">

Area

Area

Remark

Product

					<input type="number" value="" min="1" name="quantity_form" id="quantity" placeholder="Enter Quantity"  class="small" />
					<input type="number" value="" min="1" name="price_form" id="price" placeholder="Enter Price" class="small" style="margin-left:3px" />

Name	Qty	Price	Total

										Total

0

0.00

    </form>

Populating data...


text:
package com.intellij.codeInsight.daemon;

import com.intellij.codeInsight.TargetElementUtil;
import com.intellij.codeInsight.hint.ImplementationViewComponent;
import com.intellij.codeInsight.navigation.ClassImplementationsSearch;
import com.intellij.codeInsight.navigation.MethodImplementationsSearch;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.search.searches.OverridingMethodsSearch;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.intellij.util.CommonProcessors;
import org.junit.Assert;

import java.util.*;

/**
 * User: anna
 */
public class ImplementationsViewTest extends LightCodeInsightFixtureTestCase {
  public void testFromCompletion() {
    myFixture.configureByText("a.java", "public class Foo {\n" +
                                        "    private final String text;\n" +
                                        "\n" +
                                        "    public Foo(String text) {\n" +
                                        "//        this.text = text;\n" +
                                        "    }\n" +
                                        "\n" +
                                        "    public Foo(int i) {\n" +
                                        "    }\n" +
                                        "\n" +
                                        "    public static void main(String[] args) {\n" +
                                        "        final Foo foo = new Foo(\"\");\n" +
                                        "        foo.to<caret>\n" +
                                        "    }\n" +
                                        "\n" +
                                        "    @Override\n" +
                                        "    public String toString() {\n" +
                                        "        return \"text\";\n" +
                                        "    }\n" +
                                        "    public void totttt(){}" +
                                        "}");
    myFixture.completeBasic();

    PsiElement element =
      TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert element != null;
    final String newText = ImplementationViewComponent.getNewText(element);

    assertEquals("    @Override\n" +
                 "    public String toString() {\n" +
                 "        return \"text\";\n" +
                 "    }", newText);
  }

  public void testFromEditor() {
    myFixture.configureByText("a.java", "public class Foo {\n" +
                                        "    private final String text;\n" +
                                        "\n" +
                                        "    public Foo(String text) {\n" +
                                        "//        this.text = text;\n" +
                                        "    }\n" +
                                        "\n" +
                                        "    public Foo(int i) {\n" +
                                        "    }\n" +
                                        "\n" +
                                        "    @Override\n" +
                                        "    public String to<caret>String() {\n" +
                                        "        return \"text\";\n" +
                                        "    }\n" +
                                        "}");
    PsiElement element =
      TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert element != null;
    final String newText = ImplementationViewComponent.getNewText(element);

    assertEquals("    @Override\n" +
                 "    public String toString() {\n" +
                 "        return \"text\";\n" +
                 "    }", newText);
  }

  private static Collection<PsiElement> getClassImplementations(final PsiClass psiClass) {
    CommonProcessors.CollectProcessor<PsiElement> processor = new CommonProcessors.CollectProcessor<PsiElement>();
    ClassImplementationsSearch.processImplementations(psiClass, processor, psiClass.getUseScope());

    return processor.getResults();
  }

  private static Collection<PsiElement> getMethodImplementations(final PsiMethod psiMethod) {
    CommonProcessors.CollectProcessor<PsiElement> processor = new CommonProcessors.CollectProcessor<PsiElement>();
    MethodImplementationsSearch.processImplementations( psiMethod, processor, psiMethod.getUseScope());

    return processor.getResults();
  }

  public void testInnerClasses() {
    myFixture.configureByText("a.java", "abstract class AF<caret>oo{\n" +
                                        "    abstract boolean aaa();\n" +
                                        "    static class AFoo1 extends AFoo {\n" +
                                        "        @Override\n" +
                                        "        boolean aaa() {\n" +
                                        "            return false;\n" +
                                        "        }\n" +
                                        "    }\n" +
                                        "    static class AFoo3 extends AFoo {\n" +
                                        "        @Override\n" +
                                        "        boolean aaa() {\n" +
                                        "            return false;\n" +
                                        "        }\n" +
                                        "    }\n" +
                                        "    static class AFoo2 extends AFoo {\n" +
                                        "        @Override\n" +
                                        "        boolean aaa() {\n" +
                                        "            return false;\n" +
                                        "        }\n" +
                                        "    }\n" +
                                        "    \n" +
                                        "}");
    PsiClass psiClass =
      (PsiClass)TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert psiClass != null;
    final Collection<PsiElement> classes = getClassImplementations(psiClass);
    List<PsiElement> all = new ArrayList<PsiElement>();
    all.add(psiClass);
    all.addAll(classes);
    final ImplementationViewComponent component =
      new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0);
    try {
      final String[] visibleFiles = component.getVisibleFiles();
      assertTrue(visibleFiles.length > 0);
      assertEquals(visibleFiles[0], "a.java (AFoo)");
      Arrays.sort(visibleFiles);
      Assert.assertArrayEquals(Arrays.toString(visibleFiles),
                               new String[]{"a.java (AFoo)", "a.java (AFoo1 in AFoo)", "a.java (AFoo2 in AFoo)", "a.java (AFoo3 in AFoo)"}, visibleFiles);
    }
    finally {
      component.removeNotify();
    }
  }

  public void testFunctionalInterface() {
    myFixture.configureByText("a.java", "interface AF<caret>oo{\n" +
                                        "    boolean aaa();\n" +
                                        "}\n" +
                                        "class AFooImpl {\n" +
                                        "        {\n" +
                                        "             AFoo a = () -> {return false;};\n" +
                                        "        }\n" +
                                        "}");
    PsiClass psiClass =
      (PsiClass)TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert psiClass != null;
    final Collection<PsiElement> classes = getClassImplementations(psiClass);
    List<PsiElement> all = new ArrayList<PsiElement>();
    all.add(psiClass);
    all.addAll(classes);
    final ImplementationViewComponent component = new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0);
    assertContent(component, new String[]{"a.java (AFoo)", "a.java"});
  }

  public void testInterfaceMethodOfFunctionalInterface() {
    myFixture.configureByText("a.java", "interface AFoo{\n" +
                                        "    boolean a<caret>aa();\n" +
                                        "}\n" +
                                        "class AFooImpl {\n" +
                                        "        {\n" +
                                        "             AFoo a = () -> {return false;};\n" +
                                        "        }\n" +
                                        "}");
    PsiMethod psiMethod =
      (PsiMethod)TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert psiMethod != null;
    final Collection<PsiElement> methods = getMethodImplementations(psiMethod);
    List<PsiElement> all = new ArrayList<PsiElement>();
    all.add(psiMethod);
    all.addAll(methods);
    final ImplementationViewComponent component = new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0);
    assertContent(component, new String[]{"a.java (AFoo)", "a.java"});
  }

  public void testDefaultMethodOfFunctionalInterface() {
    myFixture.configureByText("a.java", "interface AFoo{\n" +
                                        "    default boolean a<caret>aa(){}\n" +
                                        "    boolean bbb();" +
                                        "}\n" +
                                        "class AFooImpl {\n" +
                                        "        {\n" +
                                        "             AFoo a = () -> {return false;};\n" +
                                        "        }\n" +
                                        "}");
    PsiMethod psiMethod =
      (PsiMethod)TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert psiMethod != null;
    final Collection<PsiElement> methods = getMethodImplementations(psiMethod);
    List<PsiElement> all = new ArrayList<PsiElement>();
    all.add(psiMethod);
    all.addAll(methods);
    final ImplementationViewComponent component = new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0);
    assertContent(component, new String[]{"a.java (AFoo)"});
  }

  public void testMethodsInInnerClasses() {
      myFixture.configureByText("a.java", "abstract class AFoo{\n" +
                                          "    abstract boolean a<caret>aa();\n" +
                                          "    static class AFoo1 extends AFoo {\n" +
                                          "        @Override\n" +
                                          "        boolean aaa() {\n" +
                                          "            return false;\n" +
                                          "        }\n" +
                                          "    }\n" +
                                          "    static class AFoo3 extends AFoo {\n" +
                                          "        @Override\n" +
                                          "        boolean aaa() {\n" +
                                          "            return false;\n" +
                                          "        }\n" +
                                          "    }\n" +
                                          "    static class AFoo2 extends AFoo {\n" +
                                          "        @Override\n" +
                                          "        boolean aaa() {\n" +
                                          "            return false;\n" +
                                          "        }\n" +
                                          "    }\n" +
                                          "    \n" +
                                          "}");
      PsiMethod psiMethod =
        (PsiMethod)TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted());

    assert psiMethod != null;
    final Collection<PsiMethod> methods = OverridingMethodsSearch.search(psiMethod).findAll();
    List<PsiMethod> all = new ArrayList<PsiMethod>();
    all.add(psiMethod);
    all.addAll(methods);

    //make sure they are in predefined order
    Collections.sort(all, new Comparator<PsiMethod>() {
      @Override
      public int compare(PsiMethod o1, PsiMethod o2) {
        return o1.getContainingClass().getQualifiedName()
          .compareTo(o2.getContainingClass().getQualifiedName());
      }
    });
    final ImplementationViewComponent component =
      new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0);
    assertContent(component, new String[]{"a.java (AFoo)", "a.java (AFoo1 in AFoo)", "a.java (AFoo2 in AFoo)", "a.java (AFoo3 in AFoo)"});
  }

  public static void assertContent(ImplementationViewComponent component, String[] expects) {
    try {
      final String[] visibleFiles = component.getVisibleFiles();
      Assert.assertArrayEquals(Arrays.toString(visibleFiles), expects, visibleFiles);
    }
    finally {
      component.removeNotify();
    }
  }
}


text:
package recorder

import (
	"context"
	"io"
	"net/http"
	"net/http/httptest"
	"net/url"
	"strconv"
	"strings"
	"testing"
	"time"

	"github.com/golang/protobuf/proto"
	"google.golang.org/genproto/googleapis/bytestream"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"

	"go.chromium.org/luci/common/tsmon"
	"go.chromium.org/luci/server/router"

	"go.chromium.org/luci/resultdb/internal/invocations"
	"go.chromium.org/luci/resultdb/internal/spanutil"
	"go.chromium.org/luci/resultdb/internal/testutil"
	"go.chromium.org/luci/resultdb/internal/testutil/insert"
	pb "go.chromium.org/luci/resultdb/proto/v1"

	. "github.com/smartystreets/goconvey/convey"
)

type fakeWriter struct {
	grpc.ClientStream // implements the rest of ByteStream_WriteClient.

	requestsToAccept int
	requests         []*bytestream.WriteRequest

	res    *bytestream.WriteResponse
	resErr error
}

func (*fakeWriter) CloseSend() error {
	return nil
}

func (w *fakeWriter) CloseAndRecv() (*bytestream.WriteResponse, error) {
	if w.res != nil || w.resErr != nil {
		return w.res, w.resErr
	}

	res := &bytestream.WriteResponse{}
	for _, req := range w.requests {
		res.CommittedSize += int64(len(req.Data))
	}
	return res, nil
}

func (w *fakeWriter) Send(req *bytestream.WriteRequest) error {
	w.requests = append(w.requests, proto.Clone(req).(*bytestream.WriteRequest))
	if len(w.requests) >= w.requestsToAccept {
		return io.EOF
	}
	return nil
}

func TestCreateArtifact(t *testing.T) {
	// metric field values for Artifact table
	artMFVs := []interface{}{string(spanutil.Artifacts), string(spanutil.Inserted), insert.TestRealm}

	Convey(`CreateArtifact`, t, func() {
		ctx := testutil.SpannerTestContext(t)
		ctx, _ = tsmon.WithDummyInMemory(ctx)
		store := tsmon.Store(ctx)

		w := &fakeWriter{}
		writerCreated := false
		ach := &artifactCreationHandler{
			RBEInstance: "projects/example/instances/artifacts",
			NewCASWriter: func(context.Context) (bytestream.ByteStream_WriteClient, error) {
				So(writerCreated, ShouldBeFalse)
				writerCreated = true
				return w, nil
			},
			MaxArtifactContentStreamLength: 1024,
		}

		art := "invocations/inv/artifacts/a"
		tok, err := invocationTokenKind.Generate(ctx, []byte("inv"), nil, time.Hour)
		So(err, ShouldBeNil)

		send := func(artifact, hash string, size int64, updateToken, content, contentType string) *httptest.ResponseRecorder {
			rec := httptest.NewRecorder()

			// Create a URL whose EscapePath() returns `artifact`.
			u := &url.URL{RawPath: "/" + artifact}
			var err error
			u.Path, err = url.PathUnescape(artifact)
			So(err, ShouldBeNil)

			c := &router.Context{
				Context: ctx,
				Request: &http.Request{
					Header: http.Header{},
					URL:    u,
					Body:   io.NopCloser(strings.NewReader(content)),
				},
				Writer: rec,
			}
			if hash != "" {
				c.Request.Header.Set(artifactContentHashHeaderKey, hash)
			}
			if size != -1 {
				c.Request.Header.Set(artifactContentSizeHeaderKey, strconv.FormatInt(size, 10))
			}
			if updateToken != "" {
				c.Request.Header.Set(updateTokenHeaderKey, updateToken)
			}
			if contentType != "" {
				c.Request.Header.Set(artifactContentTypeHeaderKey, contentType)
			}
			ach.Handle(c)
			return rec
		}

		Convey(`Verify request`, func() {
			Convey(`Artifact name is malformed`, func() {
				rec := send("artifact", "", 0, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "bad artifact name: does not match")
			})

			Convey(`Hash is missing`, func() {
				rec := send(art, "", 0, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "Content-Hash header is missing")
			})

			Convey(`Hash is malformed`, func() {
				rec := send(art, "a", 0, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "Content-Hash header value does not match")
			})

			Convey(`Size is missing`, func() {
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", -1, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "Content-Length header is missing")
			})

			Convey(`Size is negative`, func() {
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", -100, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "Content-Length header must be a value between 0 and 1024")
			})

			Convey(`Size is too large`, func() {
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 1<<30, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "Content-Length header must be a value between 0 and 1024")
			})

			Convey(`Update token is missing`, func() {
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 0, "", "", "")
				So(rec.Code, ShouldEqual, http.StatusUnauthorized)
				So(rec.Body.String(), ShouldContainSubstring, "Update-Token header is missing")
			})

			Convey(`Update token is invalid`, func() {
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 0, "x", "", "")
				So(rec.Code, ShouldEqual, http.StatusForbidden)
				So(rec.Body.String(), ShouldContainSubstring, "invalid Update-Token header value")
			})

			// RowCount metric should have no changes from any of the above Convey()s.
			So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldBeNil)
		})

		Convey(`Verify state`, func() {
			Convey(`Invocation does not exist`, func() {
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 0, tok, "", "")
				So(rec.Code, ShouldEqual, http.StatusNotFound)
				So(rec.Body.String(), ShouldContainSubstring, "invocations/inv not found")
			})

			Convey(`Invocation is finalized`, func() {
				testutil.MustApply(ctx, insert.Invocation("inv", pb.Invocation_FINALIZED, nil))
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 0, tok, "", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldContainSubstring, "invocations/inv is not active")
			})

			Convey(`Same artifact exists`, func() {
				testutil.MustApply(ctx,
					insert.Invocation("inv", pb.Invocation_ACTIVE, nil),
					spanutil.InsertMap("Artifacts", map[string]interface{}{
						"InvocationId": invocations.ID("inv"),
						"ParentId":     "",
						"ArtifactId":   "a",
						"RBECASHash":   "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
						"Size":         0,
					}),
				)
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 0, tok, "", "")
				So(rec.Code, ShouldEqual, http.StatusNoContent)
			})

			Convey(`Different artifact exists`, func() {
				testutil.MustApply(ctx,
					insert.Invocation("inv", pb.Invocation_ACTIVE, nil),
					spanutil.InsertMap("Artifacts", map[string]interface{}{
						"InvocationId": invocations.ID("inv"),
						"ParentId":     "",
						"ArtifactId":   "a",
						"RBECASHash":   "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b851",
						"Size":         1,
					}),
				)
				rec := send(art, "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 0, tok, "", "")
				So(rec.Code, ShouldEqual, http.StatusConflict)
			})

			// RowCount metric should have no changes from any of the above Convey()s.
			So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldBeNil)
		})

		Convey(`Write to CAS`, func() {
			testutil.MustApply(ctx, insert.Invocation("inv", pb.Invocation_ACTIVE, nil))
			w.requestsToAccept = 1

			casSend := func() *httptest.ResponseRecorder {
				return send(art, "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", 5, tok, "hello", "")
			}

			// Skip due to https://crbug.com/1110755
			SkipConvey(`Single request`, func() {
				rec := casSend()
				So(rec.Code, ShouldEqual, http.StatusNoContent)
				So(w.requests, ShouldHaveLength, 1)
				So(w.requests[0].ResourceName, ShouldEqual, "projects/example/instances/artifacts/uploads/0194fdc2-fa2f-fcc0-41d3-ff12045b73c8/blobs/2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824/5")
				So(string(w.requests[0].Data), ShouldEqual, "hello")
			})

			Convey(`Chunked`, func() {
				w.requestsToAccept = 2
				ach.bufSize = 3
				rec := casSend()
				So(rec.Code, ShouldEqual, http.StatusNoContent)
				So(w.requests, ShouldHaveLength, 2)
				So(string(w.requests[0].Data), ShouldEqual, "hel")
				So(string(w.requests[1].Data), ShouldEqual, "lo")
				So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldEqual, 1)
			})

			Convey(`Invalid digest`, func() {
				w.resErr = status.Errorf(codes.InvalidArgument, "wrong hash")
				rec := casSend()
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldEqual, "Content-Hash and/or Content-Length do not match the request body\n")
				So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldBeNil)
			})

			Convey(`RBE-CAS stops request early`, func() {
				w.requestsToAccept = 1
				w.res = &bytestream.WriteResponse{CommittedSize: 5} // blob already exists
				ach.bufSize = 1
				rec := casSend()
				So(rec.Code, ShouldEqual, http.StatusNoContent)
				// Must not continue requests after receiving io.EOF in the first
				// request.
				So(w.requests, ShouldHaveLength, 1)
				So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldEqual, 1)
			})

		})

		Convey(`Verify digest`, func() {
			testutil.MustApply(ctx, insert.Invocation("inv", pb.Invocation_ACTIVE, nil))
			w.requestsToAccept = 1

			Convey(`Hash`, func() {
				rec := send(art, "sha256:baaaaada5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", 5, tok, "hello", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(
					rec.Body.String(),
					ShouldEqual,
					`Content-Hash header value "sha256:baaaaada5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" `+
						`does not match the hash of the request body, "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"`+
						"\n")
			})

			Convey(`Size`, func() {
				// Satisfy the RBE-level verification.
				w.res = &bytestream.WriteResponse{CommittedSize: 100}

				rec := send(art, "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", 100, tok, "hello", "")
				So(rec.Code, ShouldEqual, http.StatusBadRequest)
				So(rec.Body.String(), ShouldEqual, "Content-Length header value 100 does not match the length of the request body, 5\n")
			})

			// RowCount metric should have no changes from any of the above Convey()s.
			So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldBeNil)
		})

		Convey(`e2e`, func() {
			testutil.MustApply(ctx, insert.Invocation("inv", pb.Invocation_ACTIVE, nil))

			res := send(art, "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", 5, tok, "hello", "text/plain")
			So(res.Code, ShouldEqual, http.StatusNoContent)

			var actualSize int64
			var actualHash string
			var actualContentType string
			testutil.MustReadRow(ctx, "Artifacts", invocations.ID("inv").Key("", "a"), map[string]interface{}{
				"Size":        &actualSize,
				"RBECASHash":  &actualHash,
				"ContentType": &actualContentType,
			})
			So(actualSize, ShouldEqual, 5)
			So(actualHash, ShouldEqual, "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824")
			So(actualContentType, ShouldEqual, "text/plain")
			So(store.Get(ctx, spanutil.RowCounter, time.Time{}, artMFVs), ShouldEqual, 1)
		})
	})
}


text: "use strict";module.exports=require("./components/chips/Chips");


text:
import React from 'react';
import { renderToString } from 'react-dom/server';
import Errors from '../../common/constants/Errors';
import nodemailerAPI from '../api/nodemailer';
import VerifyEmailMail from '../components/VerifyEmailMail';
import ResetPasswordMail from '../components/ResetPasswordMail';

export default {
  sendVerification(req, res) {
    let { user } = req;
    let token = user.toVerifyEmailToken();

    nodemailerAPI()
      .sendMail({
        ...(
          process.env.NODE_ENV === 'production' ?
          { to: user.email.value } :
          {}
        ),
        subject: 'Email Verification',
        html: renderToString(
          <VerifyEmailMail token={token} />
        ),
      })
      .catch((err) => {
        res.errors([Errors.SEND_EMAIL_FAIL]);
        throw err;
      })
      .then((info) => {
        res.json({
          user: user,
          email: info && info.envelope,
        });
      });
  },

  sendResetPasswordLink(req, res) {
    let { user } = req;
    let token = user.toResetPasswordToken();

    nodemailerAPI()
      .sendMail({
        ...(
          process.env.NODE_ENV === 'production' ?
          { to: user.email.value } :
          {}
        ),
        subject: 'Reset Password Request',
        html: renderToString(
          <ResetPasswordMail
            requestedAt={new Date()}
            token={token}
          />
        ),
      })
      .catch((err) => {
        res.errors([Errors.SEND_EMAIL_FAIL]);
        throw err;
      })
      .then((info) => {
        res.json({
          email: info.envelope,
        });
      });
  },
};


text:
/* eslint-disable class-methods-use-this */

let $form = $('.js-form');
let parsleyLoaded = false;

export default class FormValidation {
  /**
   * Initialize form validation for form elements on the page
   * @return {void}
   */
  constructor() {
    if ($form.length) {
      this.loadParsley(() => {
        this.createFormValidation();
        this.createFormTracking();
      });
    }

    // Reinitialize form validation for newly added forms
    $(document).on('form:reinit', () => {
      $form = $('.js-form');

      this.loadParsley(() => {
        this.createFormValidation();
      });
    });
  }

  /**
   * Asynchronously load Parsley, if it's already loaded it will callback immediately
   * @param {function} cb - Callback for when Parsley is loaded
   * @return {void}
   */
  loadParsley(cb) {
    if (parsleyLoaded) {
      cb.call(this);
      return;
    }

    require.ensure([], (require) => {
      require('../formValidation');
      parsleyLoaded = true;
      cb.call(this);
    });
  }

  /**
   * Create form validation
   * @return {void}
   */
  createFormValidation() {
    $form.each((i, form) => {
      $(form).parsley({
        classHandler(el) {
          // Add classes to the form-group
          return el.$element.closest('.form-group');
        },
      });
    });
  }

  /**
   * Get the name of a form or fallback to page path
   * @param {object} e Event object from Parsley callbacks
   * @return {string} Name of the form (or location)
   */
  getFormName(e) {
    return e.$element.data('name') || `Form on: ${window.location.pathname}`;
  }

  /**
   * Track forms for success and errors
   * @return {void}
   */
  createFormTracking() {
    // Remove all callbacks to prevent multiple callbacks
    window.Parsley.off('form:error');
    window.Parsley.off('form:success');

    // Listen for form success events
    window.Parsley.on('form:success', (e) => {
      window.App.tracking.shootEvent('Form', 'Submit', this.getFormName(e));
    });

    // Listen for form error events
    window.Parsley.on('form:error', (e) => {
      window.App.tracking.shootEvent('Form', 'Error', this.getFormName(e));
    });
  }
}


text:
var LocalStrategy = require('passport-local').Strategy
// load up the user model
var User = require('../app/models/user')
var dateFormat = require('dateformat')

// load the auth variables
module.exports = function(passport) {

	// =========================================================================
	// passport session setup ==================================================
	// =========================================================================
	// required for persistent login sessions
	// passport needs ability to serialize and unserialize users out of session

	// used to serialize the user for the session
	passport.serializeUser(function(user, done) {
		done(null, user.id)
	})

	// used to deserialize the user
	passport.deserializeUser(function(id, done) {
		User.findById(id, function(err, user) {
			done(err, user)
		})
	})

	// =========================================================================
	// LOCAL LOGIN =============================================================
	// =========================================================================
	passport.use('local-login', new LocalStrategy({
		// by default, local strategy uses username and password, we will override with email
		usernameField: 'email',
		passwordField: 'password',
		passReqToCallback: true // allows us to pass in the req from our route (lets us check if a user is logged in or not)
	},
	function(req, email, password, done) {
		// asynchronous
		process.nextTick(function() {
			User.findOne({ 'email': email }, function(err, user) {
				// if there are any errors, return the error
				if (err)
					return done(err)

				// if no user is found, return the message
				if (!user)
					return done(null, false, req.flash('loginMessage', 'No user found.'))

				if (!user.validPassword(password))
					return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.'))

				// all is well, return user
				else {
					var now = new Date()
					user.lastLogin = dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT')
					user.save()
					return done(null, user)

				}
			})
		})

	}))

	// =========================================================================
	// LOCAL SIGNUP ============================================================
	// =========================================================================
	passport.use('local-signup', new LocalStrategy({
		// by default, local strategy uses username and password, we will override with email
		usernameField: 'email',
		passwordField: 'password',
		passReqToCallback: true // allows us to pass in the req from our route (lets us check if a user is logged in or not)
	},
	function(req, email, password, done) {
		process.nextTick(function() {
			User.findOne({ 'email': email }, function(err, user) {
				// if there are any errors, return the error
				if (err)
					return done(err)
				// check to see if theres already a user with that email
				if (user) {
					return done(null, false, req.flash('signupMessage', 'That email is already taken.'))
				} else {
					var newUser = new User()
					newUser.email = email
					newUser.name=req.body.name
					newUser.password = newUser.generateHash(password)
					var isadmin = req.body.isadmin == 'on'
					newUser.isadmin = isadmin
					var now = new Date()
					newUser.creationDate = dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT')
					newUser.lastLogin = dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT')

					newUser.save(function(err) {
						if (err)
							return done(err)

						return done(null, newUser)
					})
				}

			})

		})

	}))

}


text:
using AutoMapper;

namespace BeyondEarthApp.Common.TypeMapping
{
    public interface IAutoMapper
    {
        T Map<T>(object objectToMap);

        IMappingExpression<TSource, TDestination> CreateMap<TSource, TDestination>();

        void AssertConfigurationIsValid();
    }
}


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

//
// This source code was auto-generated by xsd, Version=4.0.30319.1.
//

using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml;
using System.Xml.Serialization;

namespace BPMNET.Bpmn
{
    [GeneratedCode("xsd", "4.0.30319.1")]
    [Serializable()]
    [DebuggerStepThrough()]
    [DesignerCategory("code")]
    [XmlType(Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL")]
    [XmlRoot("signalEventDefinition", Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", IsNullable = false)]
    public partial class tSignalEventDefinition : tEventDefinition
    {

        private XmlQualifiedName signalRefField;

            [XmlAttribute()]
        public XmlQualifiedName signalRef
        {
            get
            {
                return signalRefField;
            }
            set
            {
                signalRefField = value;
            }
        }
    }
}


text:
package com.coolweather.android.gson;

/**
 * description:
 * author: GYY on 2017/5/15 18:27.
 * mail:gyy_Android@163.com
 */

public class AQI {
    public AQICity city;
    public class AQICity{
        public String aqi;
        public String pm25;
    }
}


text:
package org.extendedCLI.command;

import java.io.ByteArrayOutputStream;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.cli.Options;
import org.extendedCLI.argument.Arguments;
import org.extendedCLI.ioAdapters.InputAdapter;
import org.extendedCLI.ioAdapters.OutputAdapter;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertThat;
import static org.hamcrest.core.StringContains.containsString;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@SuppressWarnings("javadoc")
public class AbstractCommandTest {

	private ByteArrayOutputStream stdOut;
	private AbstractCommand command;
	private OutputAdapter outputAdapter;

	private AtomicBoolean isExecuteCalled;
	private AtomicBoolean isUndoCalled;

	@Before
	public void setUp() {
		isExecuteCalled = new AtomicBoolean(false);
		isUndoCalled = new AtomicBoolean(false);

		stdOut = new ByteArrayOutputStream();
		outputAdapter = OutputAdapter.fromOutputStream(stdOut);
	}

	public void setUp(final Arguments args) {
		command = new AbstractCommand(args) {
			@Override
			public void undo() {
				isUndoCalled.set(true);
			}

			@Override
			protected void execute(ExtendedCommandLine commandLine) {
				isExecuteCalled.set(true);
			}
		};
		command.setIoSuppliers(() -> InputAdapter.SYSTEM_IN, () -> outputAdapter);
	}

	@Test
	public void testExecuteIsCalledWhenCommandGiven() {
		Arguments args = mock(Arguments.class);
		ExtendedCommandLine extendedCli = mock(ExtendedCommandLine.class);
		when(args.validate(anyString())).thenReturn(extendedCli);

		setUp(args);
		command.execute("test");

		assertTrue(isExecuteCalled.get());
	}

	@Test
	public void testHelpIsCalledWhenCommandIsNull() {
		final String syntax = "syntax";
		final String description = "description";

		final Arguments args = mock(Arguments.class);
		when(args.validate(anyString())).thenReturn(null);
		when(args.getSyntax()).thenReturn(syntax);
		when(args.toOptions()).thenReturn(new Options());

		setUp(args);
		command.setDescription(description);
		command.execute("test");

		final String output = stdOut.toString();
		assertThat(output, containsString(syntax));
		assertThat(output, containsString(description));
	}

	@Test(expected = IllegalArgumentException.class)
	public void testNullInputAdapter() {
		mock(AbstractCommand.class, Mockito.CALLS_REAL_METHODS).setIoSuppliers(null, null);;
	}

}


text:
.container {
    width: 100%;
    /* background-color: rgba(0, 0, 0, 0.7); */
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.mask {
    padding: 100px 0;
    background-color: rgba(0, 0, 0, 0.6);
}
.nomask {
    padding: 100px 0;
}

.titleBase {
    text-align: center;
    font-size: 45px;
    font-weight: 900;
}

.titleImgBack {
    composes: titleBase;
    color: white;
}

.titleBlankBack {
    composes: titleBase;
    color: #000;
}

.subtitleBase {
    text-align: center;
    font-size: 14px;
    padding: 20px 15%;
}

.subtitleImgBack {
    composes: subtitleBase;
    color: white;
}

.subtitleBlankBack {
    composes: subtitleBase;
    color: #000;
}

.container .childrenImgBack {
    padding: 10px 5%;
    color: white;
}

.container .childrenBlankBack {
    padding: 10px 5%;
    color: #000;
}


text:
<META http-equiv="content-type" content="text/html;charset=iso-8859-9"/><meta name="viewport" content="width=device-width, initial-scale=1"><title>ac</title> <link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" />

ABDULLAH HAYDERÝ

Geri

Baðdâd'da yetiþen büyük velîlerden. Ubeydullah Hayderî diye de bilinir. Büyük velî Mevlânâ
Hâlid-i Baðdâdî hazretlerinin ilk hilâfet verdiði talebesidir. Doðum ve vefât târihleri kesin
olarak bilinememektedir. Baðdâd'da doðdu ve orada vefât etti. On dokuzuncu yüzyýlýn ilk
yarýsýnda vefat ettiði tahmin edilmektedir.

Küçük yaþtan îtibâren aklî ve naklî ilimleri tahsîl eden Abdullah Hayderî büyük âlim oldu.
Bütün ilimleri kendinde toplayýp, Ýslâmiyetin emir ve yasaklarýyla ilgili ince bilgileri elde
etti. Fesâhat, belâgat ve edebiyât konularýnda önceki ve sonraki âlimlerin üstünü idi. Arapça,
Farsça ve Türkçeye hâkim olup, "Zemahþerî" veya "Zamânýn Harîrî'si" diye þöhret buldu.
Ýlim ve edebiyâttaki bu yüksek derecesi sebebiyle Baðdâd'a Hanefî müftüsü olarak tâyin
edildi. Senelerce müslümanlarýn dînî sorularýna cevap verip Ýslâmiyetin emir ve yasaklarýný
anlattý.

Hindistan'a giderek Þah Gulâm-ý Ali Abdullah-ý Dehlevî hazretlerinin mânevî sofrasýndan
feyz alýp, insanlara Ýslâmiyetin emir ve yasaklarýný anlatarak onlarýn dünyâ ve âhirette
seâdete, kurtuluþa ermelerine vesîle olmak vazîfesiyle Baðdâd'a gelen Mevlânâ Hâlid-i
Baðdâdî hazretleri sohbetlerine Abdullah-ý Hayderî'yi de kabûl etti. Abdullah-ý Hayderî
yüksek ilmine raðmen Mevlânâ Hâlid-i Baðdâdî hazretlerinin önünde diz çöktü. Kýsa bir
müddet içinde Mevlânâ Hâlid-i Baðdâdî hazretlerinden istifâde ederek tasavvuf yolunda
ilerledi. Baðdâd müftülüðünden ayrýlarak hocasýnýn hizmetinden ve sohbetlerinden ayrýlmadý.
Mevlânâ Hâlid hazretleri ona:

"Abdullah su kýrbasýný yüklen. Baðdâd sokaklarýnda ve pazarlarda "Sebîl" diyerek insanlara
su daðýt." buyurdu.

Önceki makâm ve þöhretini düþünmeden hocasýnýn emrini yerine getiren Abdullah-ý Hayderî,
yirmi gün müddetle sýrtýna yüklendiði su kýrbasýyla sokak sokak dolaþarak insanlara su
daðýttý. Her þeyin görünüþüne bakan insanlar Abdullah-ý Hayderî'yi bu þekilde görünce
hayretle birbirlerine, onun hakkýnda ileri geri sözler sarf ettiler. Fakat dünyânýn makâmýna,
þöhretine önem vermeyen, insanlarýn dedikodularýna aldýrýþ etmeyen Abdullah Hayderî
kendisine verilen emri kusursuz olarak yerine getirmeye devâm etti. Sonra hocasýnýn
huzûruna geldi. Mevlânâ Hâlid-i Baðdâdî hazretleri bu sefer:

"Abdullah on gün de para ile su sat." buyurdu.

Bu emre de îtirazsýz uyan Abdullah-ý Hayderî, on gün müddetle su sattý. Böylece nefsinin
istediklerini yapmamak, istemediklerini yapmak sûretiyle nefsini kötülüðü emretmekten,
kalbini de kötü huy ve düþüncelerden temizledi. Abdullah-ý Hayderî'nin evliyâlýk yolunda
yüksek derecelere ulaþtýðýný gören Mevlânâ Hâlid-i Baðdâdî hazretleri, ona bütün talebeleri
arasýnda ilk olarak hilâfet verdi. Baðdâd'da bulunduðu sýrada Mevlânâ Hâlid-i Baðdâdî
hazretlerini çekemedikleri için karþý çýkanlara reddiye yazarak, tarîkatlarýn hak olduðunu
açýkladý. Kitap, sünnet ve tasavvuf kitaplarýndaki açýk delilleri gösterdi. Yazdýðý bu kitabý
bütün büyük âlimler beðendiler.

Abdullah-ý Hayderî devamlý hocasýnýn yanýnda bulundu. Mevlânâ Hâlid-i Baðdâdî
hazretlerinin Süleymâniyye ve Þam'a gittiði sýrada da yanýndan ve hizmetinden ayrýlmadý.

Mevlânâ Hâlid-i Baðdâdî hazretleri Abdullah Hayderî ve diðer halîfeleriyle ve talebeleriyle
birlikte Baðdâd'dan Þam'a gidiyorlardý. Þam hudutlarýna geldikleri zaman Þemmen
kabîlesinden Safvak bin Fâris diye meþhûr yol kesici, birçok yardýmcýlarýyla birlikte korkunç
þekilde gelip kâfileyi soymaya teþebbüs etti. Safvak bin Hâris'in anlattýðýna göre pekçok
yardýmcýlarýyla Mevlânâ Hâlid hazretlerinin kâfilesine hücûm ettikleri zaman, kâfileden
beyaz elbiseli, ata binmiþ çok heybetli bir zat göründü. O zat soyguncularýn gözleri önünde o
kadar büyüdü ki, sanki dað kadar oldu. Geçen kâfile ile soyguncular arasýnda bir engel teþkil
etti. Soyguncular kâfiledekileri göremez oldular. Semâya yükselen büyük bir dað misâli olan

o zâtý görünce, soygunculara bir korku, bir titreme geldi, mýzraklarý ellerinden kendileri de
hayvanlardan düþtü. Bu hâdiseden sonra kâfilede Allahü teâlânýn sevdiði velî kullarý
olduðunu anlayan soyguncular, hep bir aðýzdan; "Aman, aman! Affedin!" diye baðrýþtýlar.
Bunun üzerine kâfile eskisi gibi normal görünmeye baþladý. Soyguncular kâfilede Mevlânâ
Hâlid-i Baðdâdî hazretlerini görünce, hepsi kusurlarýnýn affýný istediler. El ve ayaklarýna
sarýlarak tövbe ve istigfâr ettiler.
Bu yolculuk esnâsýnda Abdullah-ý Hayderî hazretleri gördüðü bir hâdiseyi þöyle nakletti:

"Atlý bir Habeþînin kâfilemizi tâkib ettiðini gördüm. Habeþî bizi þiddetli baskýsýyla
korkutuyordu. Hemen þeyhim Mevlânâ Hâlid-i Baðdâdî'ye durumu bildirdim. Efendimiz
hemen yerden bir avuç toprak alýp onun yüzüne doðru attý. Habeþî artýk görünmez oldu. Fakat
bir müddet sonra, tekrar gözüktü. Piþman olmuþ, periþan bir hâlde velîlerin sultaný hocamýzýn
huzuruna gelerek boyun eðdi, diz çöküp af diledi ve tövbe etti.

Abdullah Hayderî hocasý ile birlikte tekrar Baðdâd'a döndü. Mevlânâ Hâlid hazretleri ona
mutlak hilâfet verdi, Baðdâd'da insanlara Ýslâmiyetin emirlerini ve yasaklarýný anlatarak
Allahü teâlânýn rýzâsýna kavuþturmakla vazîfelendirdi. Abdullah-ý Hayderî hazretleri baþta
arkadaþlarý olmak üzere bütün Baðdâd halkýna Ýslâmiyetin emir ve yasaklarýný anlattý. Pekçok
insan sohbetinde bulunarak feyzinden istifâde etti. Hattâ Mevlânâ Hâlid hazretlerinin
halîfelerinin çoðu evvelâ onun sohbetinde yetiþtikten sonra Mevlânâ Hâlid hazretlerinin
sohbetlerine kavuþtular.

Mevlânâ Hâlid hazretleri Baðdâd'dan Þam'a dönecekleri sýrada kendilerinin ve Abdullah
Hayderî hazretlerinin babasýnýn yakýnda vefât edeceklerini iþâret buyurarak Þam'a gittiler.
Mevlânâ Hâlid-i Baðdâdî hazretleri Þam'a döndükten bir müddet sonra vefât etti. Onun vefât

haberi Baðdâd'a ulaþýnca, bütün âlimler ve velîler ile halk çok üzüldü. Abdullah Hayderî
hazretlerinin babasýna Mevlânâ Hâlid hazretlerinin vefâtý haberini bildirmediler. Çünkü bu
acý haberden dolayý fenâlaþabilir ve hastalýðý fazlalaþabilirdi. Aradan üç ay geçince, o da
vefât etti.

Abdullah Hayderî Mevlânâ Hâlid hazretlerinin derece bakýmýndan Þeyh Osman et-Tavîl'den
sonra en yüksek halîfesiydi. Birçok kerâmetleri görüldü. Uzun seneler Baðdâd'da kalýp
insanlara seâdet yolunu gösterdikten sonra orada vefât etti.

1) Mecdi Tâlid Tercümesi; s.75
2) Þems-üþ-Þümûs Tercümesi; s. 45
3) Hadâik-ul-Verdiyye; s. 260
4) Ýslâm Meþhûrlarý Ansiklopedisi; c.1, s. 171


text:
"use strict";

var _ = window._,
  Backbone = window.Backbone,
  WordView = require('./Word');

module.exports = Backbone.View.extend({

  className: 'available-words well',

  initialize: function () {
    // maintain a collection of subviews so that we can remove them in our remove method
    this.wordViews = this.collection.map(function (m) {
      return new WordView({model: m});
    }, this);

    // new word generated from input
    this.listenTo(this.collection, 'add', function (m) {
      m.save();
      // create and append a new WordView
      var v = new WordView({model: m});
      this.wordViews.push(v);
      if (this.collection.length === 1) {
        this.$('.new').remove();
      }
      this.$el.append(v.render().el);
    });

  },

  render: function () {
    if (!this.collection.length) {
      this.addNewText();
    }

    _.each(this.wordViews, function (v) {
      this.$el.append(v.render().el);
    }, this);

    // memory leak; $.sortable seems to prevent this view from being GC'd regardless of options
    this.$el.sortable({
      update: _.bind(function () {
        if (!this.collection.length) {
          this.$('.new').remove();
        }
        // each time an update event is triggered in response to a sort or a word being dragged in or out,
        // destroy all words in the collection and create new ones
        _.each(this.collection.pluck('id'), function (id) {
          this.collection.get(id).destroy();
        }, this);
        _.each(this.$('.word'), function (el) {
          this.collection.create({
            label: el.innerText
          }, { silent: true });
        }, this);

        if (!this.$('.word').length) {
          this.addNewText();
        }
      }, this),
      connectWith: '.phrase'
    });
    return this;
  },

  remove: function () {
    _.each(this.wordViews, function (v) {
      v.remove();
    }, this);
    // the jquery-ui destroy method doesn't seem to work;
    // this view will not be GC'd (according to the Backbone Chrome dev tool extension)
    this.$el.sortable('destroy');
    Backbone.View.prototype.remove.apply(this, arguments);
  },

  addNewText: function () {
    this.$el.prepend('No available words. Create one above or drag words here.');
  }

});


text:
package com.alibaba.otter.shared.arbitrate.manage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jtester.annotations.SpringBeanByName;
import org.testng.annotations.Test;

import com.alibaba.otter.shared.arbitrate.ArbitrateViewService;
import com.alibaba.otter.shared.arbitrate.impl.ArbitrateConstants;
import com.alibaba.otter.shared.arbitrate.setl.BaseStageTest;
import com.alibaba.otter.shared.common.model.statistics.stage.ProcessStat;

/**
 * @author jianghang 2011-9-28 下午04:43:02
 * @version 4.0.0
 */
public class ArbitrateViewServiceTest extends BaseStageTest {

    @SpringBeanByName
    private ArbitrateViewService arbitrateViewService;

    @Test
    public void test_listProcesses() {
        final List<Long> initProcessIds = new ArrayList<Long>();
        final Map<Long, List<String>> stages = new HashMap<Long, List<String>>();
        try {
            Long p1 = initProcess();
            initStage(p1, ArbitrateConstants.NODE_SELECTED);
            initStage(p1, ArbitrateConstants.NODE_EXTRACTED);
            initStage(p1, ArbitrateConstants.NODE_TRANSFORMED);

            Long p2 = initProcess();
            initStage(p2, ArbitrateConstants.NODE_SELECTED);
            initStage(p2, ArbitrateConstants.NODE_EXTRACTED);

            Long p3 = initProcess();
            initStage(p3, ArbitrateConstants.NODE_SELECTED);

            Long p4 = initProcess();

            initProcessIds.add(p1);
            initProcessIds.add(p2);
            initProcessIds.add(p3);
            initProcessIds.add(p4);
            List<String> p1Stages = Arrays.asList(ArbitrateConstants.NODE_SELECTED, ArbitrateConstants.NODE_EXTRACTED,
                                                  ArbitrateConstants.NODE_TRANSFORMED);
            stages.put(p1, p1Stages);

            List<String> p2Stages = Arrays.asList(ArbitrateConstants.NODE_SELECTED, ArbitrateConstants.NODE_EXTRACTED);
            stages.put(p2, p2Stages);

            List<String> p3Stages = Arrays.asList(ArbitrateConstants.NODE_SELECTED);
            stages.put(p3, p3Stages);

            List<String> p4Stages = new ArrayList<String>();
            stages.put(p4, p4Stages);

            List<ProcessStat> processStat = arbitrateViewService.listProcesses(channelId, pipelineId);
            System.out.println(processStat);
        } finally {
            for (Long processId : initProcessIds) {
                List<String> ss = stages.get(processId);
                for (String stage : ss) {
                    destoryStage(processId, stage);
                }
                destoryProcess(processId);
            }
        }

    }
}


text:
<?php

namespace app\controllers;

use Yii;
use app\models\SACSAPDIMENSION;
use app\models\SACSAPDIMENSIONSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * SACSAPDIMENSIONController implements the CRUD actions for SACSAPDIMENSION model.
 */
class SACSAPDIMENSIONController extends Controller
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all SACSAPDIMENSION models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new SACSAPDIMENSIONSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single SACSAPDIMENSION model.
     * @param integer $DIM_ID
     * @param integer $SAC_ID
     * @return mixed
     */
    public function actionView($DIM_ID, $SAC_ID)
    {
        return $this->render('view', [
            'model' => $this->findModel($DIM_ID, $SAC_ID),
        ]);
    }

    /**
     * Creates a new SACSAPDIMENSION model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new SACSAPDIMENSION();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'DIM_ID' => $model->DIM_ID, 'SAC_ID' => $model->SAC_ID]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing SACSAPDIMENSION model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $DIM_ID
     * @param integer $SAC_ID
     * @return mixed
     */
    public function actionUpdate($DIM_ID, $SAC_ID)
    {
        $model = $this->findModel($DIM_ID, $SAC_ID);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'DIM_ID' => $model->DIM_ID, 'SAC_ID' => $model->SAC_ID]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing SACSAPDIMENSION model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $DIM_ID
     * @param integer $SAC_ID
     * @return mixed
     */
    public function actionDelete($DIM_ID, $SAC_ID)
    {
        $this->findModel($DIM_ID, $SAC_ID)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the SACSAPDIMENSION model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $DIM_ID
     * @param integer $SAC_ID
     * @return SACSAPDIMENSION the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($DIM_ID, $SAC_ID)
    {
        if (($model = SACSAPDIMENSION::findOne(['DIM_ID' => $DIM_ID, 'SAC_ID' => $SAC_ID])) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
using System;
using System.Diagnostics;
using System.Windows.Input;

namespace SonarLint.VisualStudio.Integration.WPF
{
    public abstract class RelayCommandBase : ICommand
    {
        private event EventHandler canExecuteChanged;

        public void RequeryCanExecute()
        {
            if (System.Windows.Application.Current != null)
            {
                Debug.Assert(Microsoft.VisualStudio.Shell.ThreadHelper.CheckAccess(), "RequeryCanExecute should be called from the UI thread");
            }

            this.canExecuteChanged?.Invoke(this, EventArgs.Empty);
        }

        protected abstract bool CanExecute(object parameter);

        protected abstract void Execute(object parameter);

        #region ICommand

        public event EventHandler CanExecuteChanged
        {
            add
            {
                this.canExecuteChanged += value;
                CommandManager.RequerySuggested += value;
            }
            remove
            {
                this.canExecuteChanged -= value;
                CommandManager.RequerySuggested -= value;
            }
        }

        bool ICommand.CanExecute(object parameter)
        {
            return this.CanExecute(parameter);
        }

        void ICommand.Execute(object parameter)
        {
            this.Execute(parameter);
        }

        #endregion
    }
}


text:
<?php // *** This is used in more than one place *** ?>
<?php // * Please keep it simple and don't add structural markup ?>
<?php // * The "ifs" here are carefully chosen to cover all of the possible ?>
<?php //   scenarios re: when to show the end date and when to show the times ?>
<?php // * The format_date helper automatically I18Ns in a reasonable fashion. ?>

<?php use_helper('Date') ?>
<?php
  // Compatible with sf_escaping_strategy: true
  $aEvent = isset($aEvent) ? $sf_data->getRaw('aEvent') : null;
?>

<?php // The -> syntax is compatible with both Doctrine objects and ?>
<?php // Zend Lucene results, I pass both to this partial. Please don't ?>
<?php // change to the [] syntax ?>

<?php echo format_date($aEvent->start_date, 'D') ?>
<?php // Use strlen rather than is_null to cope with legacy data ?>
<?php if (strlen($aEvent->start_time)): ?>
<?php echo (sfConfig::get('app_a_pretty_english_dates')) ? str_replace(' ', '', format_date($aEvent->start_time, 't')) : format_date($aEvent->start_time, 't') ?>
<?php endif ?>
<?php if (($aEvent->start_date !== $aEvent->end_date) || ($aEvent->start_time !== $aEvent->end_time)): ?>
<?php echo '–' ?>
<?php endif ?>
<?php if ($aEvent->start_date !== $aEvent->end_date): ?>
<?php echo format_date($aEvent->end_date, 'D') ?>
<?php endif ?>
<?php if (strlen($aEvent->end_time) && (($aEvent->start_date !== $aEvent->end_date) || ($aEvent->start_time !== $aEvent->end_time))): ?>
<?php echo (sfConfig::get('app_a_pretty_english_dates')) ? str_replace(' ', '', format_date($aEvent->end_time, 't')) : format_date($aEvent->end_time, 't') ?>
<?php endif ?>


text:
using Baseline;
using Marten.Schema;
using Marten.Services;
using Marten.Testing.Documents;
using Marten.Testing.Harness;
using Shouldly;
using Xunit;

namespace Marten.Testing.CoreFunctionality
{
    [Collection("duplicated")]
    public class duplicate_fields_in_table_and_upsert_Tests : OneOffConfigurationsContext
    {
        [Fact]
        public void end_to_end()
        {
            StoreOptions(opts =>
            {
                opts.Schema.For<User>().Duplicate(x => x.FirstName);
            });

            var user1 = new User { FirstName = "Byron", LastName = "Scott" };
            using (var session = theStore.OpenSession())
            {
                session.Store(user1);
                session.SaveChanges();
            }

            var runner = theStore.Tenancy.Default.OpenConnection();
            runner.QueryScalar<string>($"select first_name from duplicated.mt_doc_user where id = '{user1.Id}'")
                  .ShouldBe("Byron");
        }

        public duplicate_fields_in_table_and_upsert_Tests() : base("duplicated")
        {
        }
    }
}


text:
<?php

use Illuminate\Database\Seeder;
use ViKon\EveSDE\Models\Ram\AssemblyLineStation;
use ViKon\Utilities\ConsoleProgressbar;

class RamAssemblyLineStationsSeeder extends Seeder {
    use ConsoleProgressbar;

    protected $output;

    protected $structure = [
        0 => 'station_id',
        1 => 'assembly_line_type_id',
        2 => 'quantity',
        3 => 'station_type_id',
        4 => 'owner_id',
        5 => 'solar_system_id',
        6 => 'region_id',
    ];

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run() {
        DB::table('ram_assembly_line_stations')->delete();

        $this->output = $this->command->getOutput();

        $this->initProgressbar();
        $this->startProgress('<info>Inserting data:</info> ram_assembly_line_stations');
        $this->setProgressMax(4393);

        $data = include(__DIR__ . '/data/ram_assembly_line_stations_table_data.php');
        foreach ($data as $row) {
            $this->create($row);
        }
    }

    protected function create($values) {
        $data = [];
        foreach ($this->structure as $i => $key) {
            $data[$key] = $values[$i];
        }
        AssemblyLineStation::create($data);
        $this->progress();
    }

}


text:
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV JULIA_VERSION 1.8.3
ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.8/julia-1.8.3-win64.exe
ENV JULIA_SHA256 1e5cc98bf83028809f6e37d205df660e3fb27d35e95c88944c1106a6710cd909

RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \
	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \
	\
	Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \
	if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \
		Write-Host 'FAILED!'; \
		exit 1; \
	}; \
	\
	Write-Host 'Installing ...'; \
	Start-Process -Wait -NoNewWindow \
		-FilePath '.\julia.exe' \
		-ArgumentList @( \
			'/SILENT', \
			'/DIR=C:\julia' \
		); \
	\
	Write-Host 'Removing ...'; \
	Remove-Item julia.exe -Force; \
	\
	Write-Host 'Updating PATH ...'; \
	$env:PATH = 'C:\julia\bin;' + $env:PATH; \
	[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
	\
	Write-Host 'Verifying install ("julia --version") ...'; \
	julia --version; \
	\
	Write-Host 'Complete.'

CMD ["julia"]


text:
package jadx.tests.integration.variables;

import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;

public class TestVariables3 extends IntegrationTest {

	public static class TestCls {
		String test(Object s) {
			int i;
			if (s == null) {
				i = 2;
			} else {
				i = 3;
				s = null;
			}
			return s + " " + i;
		}
	}

	@Test
	public void test() {
		ClassNode cls = getClassNode(TestCls.class);
		String code = cls.getCode().toString();

		assertThat(code, containsString("int i;"));
		assertThat(code, containsString("i = 2;"));
		assertThat(code, containsString("i = 3;"));
		assertThat(code, containsString("s = null;"));
		assertThat(code, containsString("return s + \" \" + i;"));
	}
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.tanc.command</groupId>
    <artifactId>program-list-command</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>program-list-command</name>

    <parent>
        <groupId>org.demo</groupId>
        <artifactId>tanc-java-demo</artifactId>
        <version>${configure.maven.version}</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
    </dependencies>
</project>