text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<geo:GeodesyML xsi:schemaLocation="urn:xml-gov-au:icsm:egeodesy:0.3" xmlns:geo="urn:xml-gov-au:icsm:egeodesy:0.3" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ns9="http://www.w3.org/1999/xlink" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:om="http://www.opengis.net/om/2.0" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gml:id="GeodesyMLType_67">
   <geo:siteLog gml:id="SiteLogType_67">
      <geo:formInformation>
         <geo:preparedBy>Qu Feng</geo:preparedBy>
         <geo:datePrepared>2010-12-09T13:00:00Z</geo:datePrepared>
         <geo:reportType>UPDATE</geo:reportType>
      </geo:formInformation>
      <geo:siteIdentification>
         <geo:siteName>Beijing Fangshan / China</geo:siteName>
         <geo:fourCharacterID>BJFS</geo:fourCharacterID>
         <geo:monumentInscription>Pillar 2</geo:monumentInscription>
         <geo:iersDOMESNumber>21601M001</geo:iersDOMESNumber>
         <geo:cdpNumber></geo:cdpNumber>
         <geo:monumentDescription>Steel Mark on Concrete Pillar</geo:monumentDescription>
         <geo:heightOfTheMonument>0.3</geo:heightOfTheMonument>
         <geo:monumentFoundation>Concrete</geo:monumentFoundation>
         <geo:dateInstalled>1995-09-19T14:00:00Z</geo:dateInstalled>
         <geo:geologicCharacteristic>Bedrock</geo:geologicCharacteristic>
         <geo:bedrockType>Sedimentary</geo:bedrockType>
         <geo:bedrockCondition>Weathered</geo:bedrockCondition>
         <geo:fractureSpacing>11-50 cm</geo:fractureSpacing>
         <geo:faultZonesNearby>No</geo:faultZonesNearby>
      </geo:siteIdentification>
      <geo:siteLocation>
         <geo:city>Fangshan</geo:city>
         <geo:state>Beijing</geo:state>
         <geo:countryCodeISO>CHN</geo:countryCodeISO>
         <geo:tectonicPlate codeSpace="">Eurasian</geo:tectonicPlate>
         <geo:approximatePositionITRF>
            <geo:xCoordinateInMeters>-2148743.808</geo:xCoordinateInMeters>
            <geo:yCoordinateInMeters>4426641.281</geo:yCoordinateInMeters>
            <geo:zCoordinateInMeters>4044655.993</geo:zCoordinateInMeters>
            <geo:latitude-North>39.60862499999999641886461176909506320953369140625</geo:latitude-North>
            <geo:longitude-East>115.892461111111146010443917475640773773193359375</geo:longitude-East>
            <geo:elevation-m_ellips.>87.413</geo:elevation-m_ellips.>
         </geo:approximatePositionITRF>
      </geo:siteLocation>
      <geo:gnssReceivers>
         <geo:gnssReceiver gml:id="GnssReceiverType_246">
            <geo:manufacturerSerialNumber>4922K35365</geo:manufacturerSerialNumber>
            <geo:receiverType codeList="codelist" codeListValue="codeListValue" codeSpace="DummyCodeSpace">TRIMBLE NETR8</geo:receiverType>
            <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
            <geo:serialNumber>4922K35365</geo:serialNumber>
            <geo:firmwareVersion>4.17</geo:firmwareVersion>
            <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
            <geo:dateInstalled>2010-08-06T00:00:00Z</geo:dateInstalled>
            <geo:dateRemoved></geo:dateRemoved>
         </geo:gnssReceiver>
         <geo:dateInserted>2010-08-06T00:00:00Z</geo:dateInserted>
      </geo:gnssReceivers>
      <geo:gnssReceivers>
         <geo:gnssReceiver gml:id="GnssReceiverType_247">
            <geo:manufacturerSerialNumber>4922K35365</geo:manufacturerSerialNumber>
            <geo:receiverType codeList="codelist" codeListValue="codeListValue" codeSpace="DummyCodeSpace">TRIMBLE NETR8</geo:receiverType>
            <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
            <geo:serialNumber>4922K35365</geo:serialNumber>
            <geo:firmwareVersion>4.01</geo:firmwareVersion>
            <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
            <geo:dateInstalled>2010-05-22T00:00:00Z</geo:dateInstalled>
            <geo:dateRemoved>2010-08-05T23:59:00Z</geo:dateRemoved>
         </geo:gnssReceiver>
         <geo:dateInserted>2010-05-22T00:00:00Z</geo:dateInserted>
      </geo:gnssReceivers>
      <geo:gnssReceivers>
         <geo:gnssReceiver gml:id="GnssReceiverType_248">
            <geo:manufacturerSerialNumber>LP3332</geo:manufacturerSerialNumber>
            <geo:receiverType codeList="codelist" codeListValue="codeListValue" codeSpace="DummyCodeSpace">ASHTECH Z-XII3</geo:receiverType>
            <geo:satelliteSystem>GPS</geo:satelliteSystem>
            <geo:serialNumber>LP3332</geo:serialNumber>
            <geo:firmwareVersion>CD00-1D02</geo:firmwareVersion>
            <geo:elevationCutoffSetting>10.0</geo:elevationCutoffSetting>
            <geo:dateInstalled>1995-09-20T00:00:00Z</geo:dateInstalled>
            <geo:dateRemoved>2010-05-13T00:00:00Z</geo:dateRemoved>
            <geo:temperatureStabilization>2.0</geo:temperatureStabilization>
         </geo:gnssReceiver>
         <geo:dateInserted>1995-09-20T00:00:00Z</geo:dateInserted>
      </geo:gnssReceivers>
      <geo:gnssAntennas>
         <geo:gnssAntenna gml:id="GnssAntennaType_132">
            <geo:manufacturerSerialNumber>1126</geo:manufacturerSerialNumber>
            <geo:antennaType codeList="codelist" codeListValue="codeListValue" codeSpace="codespace">ASH700936B_M    SNOW</geo:antennaType>
            <geo:serialNumber>1126</geo:serialNumber>
            <geo:antennaReferencePoint codeSpace="">BPA</geo:antennaReferencePoint>
            <geo:marker-arpUpEcc.>0.046</geo:marker-arpUpEcc.>
            <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
            <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
            <geo:alignmentFromTrueNorth>0.0</geo:alignmentFromTrueNorth>
            <geo:antennaRadomeType codeSpace="CodeSpaceAttr">SNOW</geo:antennaRadomeType>
            <geo:radomeSerialNumber>700936(1)</geo:radomeSerialNumber>
            <geo:antennaCableType>RG-8</geo:antennaCableType>
            <geo:antennaCableLength>45.0</geo:antennaCableLength>
            <geo:dateInstalled>1995-09-20T00:00:00Z</geo:dateInstalled>
            <geo:dateRemoved>2010-05-13T00:00:00Z</geo:dateRemoved>
         </geo:gnssAntenna>
         <geo:dateInserted>1995-09-20T00:00:00Z</geo:dateInserted>
      </geo:gnssAntennas>
      <geo:gnssAntennas>
         <geo:gnssAntenna gml:id="GnssAntennaType_133">
            <geo:manufacturerSerialNumber>4921353141</geo:manufacturerSerialNumber>
            <geo:antennaType codeList="codelist" codeListValue="codeListValue" codeSpace="codespace">TRM59800.00     SCIS</geo:antennaType>
            <geo:serialNumber>4921353141</geo:serialNumber>
            <geo:antennaReferencePoint codeSpace="">BPA</geo:antennaReferencePoint>
            <geo:marker-arpUpEcc.>0.0465</geo:marker-arpUpEcc.>
            <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
            <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
            <geo:alignmentFromTrueNorth>0.0</geo:alignmentFromTrueNorth>
            <geo:antennaRadomeType codeSpace="CodeSpaceAttr">SCIS</geo:antennaRadomeType>
            <geo:radomeSerialNumber></geo:radomeSerialNumber>
            <geo:antennaCableType></geo:antennaCableType>
            <geo:antennaCableLength>30.0</geo:antennaCableLength>
            <geo:dateInstalled>2010-05-22T00:00:00Z</geo:dateInstalled>
            <geo:dateRemoved></geo:dateRemoved>
         </geo:gnssAntenna>
         <geo:dateInserted>2010-05-22T00:00:00Z</geo:dateInserted>
      </geo:gnssAntennas>
      <geo:surveyedLocalTies>
         <geo:surveyedLocalTies gml:id="SurveyedLocalTiesType_25">
            <geo:tiedMarkerName>Beijing SLR</geo:tiedMarkerName>
            <geo:tiedMarkerUsage>SLR</geo:tiedMarkerUsage>
            <geo:tiedMarkerCDPNumber>7249</geo:tiedMarkerCDPNumber>
            <geo:tiedMarkerDOMESNumber>21601S004</geo:tiedMarkerDOMESNumber>
            <geo:differentialComponentsGNSSMarkerToTiedMonumentITRS>
               <geo:dx>-16.517</geo:dx>
               <geo:dy>118.317</geo:dy>
               <geo:dz>-146.279</geo:dz>
            </geo:differentialComponentsGNSSMarkerToTiedMonumentITRS>
            <geo:localSiteTiesAccuracy>3.0</geo:localSiteTiesAccuracy>
            <geo:surveyMethod>GPS CAMPAIGN</geo:surveyMethod>
            <geo:dateMeasured>2003-06-19T14:00:00Z</geo:dateMeasured>
         </geo:surveyedLocalTies>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:surveyedLocalTies>
      <geo:collocationInformations>
         <geo:collocationInformation gml:id="CollocationInformationType_12">
            <geo:instrumentationType codeSpace=""></geo:instrumentationType>
            <geo:status codeSpace="">PERMANENT</geo:status>
            <gml:validTime>
               <gml:TimeInstant gml:id="TimeInstantType_93">
                  <gml:timePosition>1970-01-22T13:00:00Z</gml:timePosition>
               </gml:TimeInstant>
            </gml:validTime>
         </geo:collocationInformation>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:collocationInformations>
      <geo:humiditySensors>
         <geo:humiditySensor gml:id="HumiditySensorType_26">
            <geo:type codeSpace="">WUSH-PTU</geo:type>
            <geo:manufacturer></geo:manufacturer>
            <geo:serialNumber>PQY9.008</geo:serialNumber>
            <geo:heightDiffToAntenna>-0.3</geo:heightDiffToAntenna>
            <geo:calibrationDate></geo:calibrationDate>
            <gml:validTime nilReason="">
               <gml:TimePeriod gml:id="TimePeriodType_154">
                  <gml:beginPosition>2010-05-22T00:00:00Z</gml:beginPosition>
                  <gml:endPosition></gml:endPosition>
               </gml:TimePeriod>
            </gml:validTime>
            <geo:dataSamplingInterval>30.0</geo:dataSamplingInterval>
            <geo:accuracy-percentRelativeHumidity>1.0</geo:accuracy-percentRelativeHumidity>
            <geo:aspiration>NATURAL</geo:aspiration>
         </geo:humiditySensor>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:humiditySensors>
      <geo:humiditySensors>
         <geo:humiditySensor gml:id="HumiditySensorType_27">
            <geo:type codeSpace="">Humidity Temperature Transmitter HMP 230</geo:type>
            <geo:manufacturer>VAISALA</geo:manufacturer>
            <geo:serialNumber>P2240005</geo:serialNumber>
            <geo:heightDiffToAntenna>-0.3</geo:heightDiffToAntenna>
            <geo:calibrationDate></geo:calibrationDate>
            <gml:validTime nilReason="">
               <gml:TimePeriod gml:id="TimePeriodType_155">
                  <gml:beginPosition>1995-09-20T00:00:00Z</gml:beginPosition>
                  <gml:endPosition>2010-05-13T00:00:00Z</gml:endPosition>
               </gml:TimePeriod>
            </gml:validTime>
            <geo:dataSamplingInterval>900.0</geo:dataSamplingInterval>
            <geo:accuracy-percentRelativeHumidity>1.0</geo:accuracy-percentRelativeHumidity>
            <geo:aspiration>NATURAL</geo:aspiration>
         </geo:humiditySensor>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:humiditySensors>
      <geo:pressureSensors>
         <geo:pressureSensor gml:id="PressureSensorType_26">
            <geo:type codeSpace="">Digital barrometer PTB 200</geo:type>
            <geo:manufacturer>VAISALA</geo:manufacturer>
            <geo:serialNumber>P2340004</geo:serialNumber>
            <geo:heightDiffToAntenna>-5.7</geo:heightDiffToAntenna>
            <geo:calibrationDate></geo:calibrationDate>
            <gml:validTime nilReason="">
               <gml:TimePeriod gml:id="TimePeriodType_156">
                  <gml:beginPosition>1995-09-20T00:00:00Z</gml:beginPosition>
                  <gml:endPosition></gml:endPosition>
               </gml:TimePeriod>
            </gml:validTime>
            <geo:dataSamplingInterval>900.0</geo:dataSamplingInterval>
            <geo:accuracy-hPa>0.2</geo:accuracy-hPa>
         </geo:pressureSensor>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:pressureSensors>
      <geo:pressureSensors>
         <geo:pressureSensor gml:id="PressureSensorType_27">
            <geo:type codeSpace="">WUSH-PTU</geo:type>
            <geo:manufacturer></geo:manufacturer>
            <geo:serialNumber>PQY9.008</geo:serialNumber>
            <geo:heightDiffToAntenna>-5.7</geo:heightDiffToAntenna>
            <geo:calibrationDate></geo:calibrationDate>
            <gml:validTime nilReason="">
               <gml:TimePeriod gml:id="TimePeriodType_157">
                  <gml:beginPosition>2010-05-22T00:00:00Z</gml:beginPosition>
                  <gml:endPosition></gml:endPosition>
               </gml:TimePeriod>
            </gml:validTime>
            <geo:dataSamplingInterval>30.0</geo:dataSamplingInterval>
            <geo:accuracy-hPa>0.1</geo:accuracy-hPa>
         </geo:pressureSensor>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:pressureSensors>
      <geo:temperatureSensors>
         <geo:temperatureSensor gml:id="TemperatureSensorType_26">
            <geo:type codeSpace="">Humidity Temperature Transmitter HMP 230</geo:type>
            <geo:manufacturer>VAISALA</geo:manufacturer>
            <geo:serialNumber>P2240005</geo:serialNumber>
            <geo:heightDiffToAntenna>-0.3</geo:heightDiffToAntenna>
            <geo:calibrationDate></geo:calibrationDate>
            <gml:validTime nilReason="">
               <gml:TimePeriod gml:id="TimePeriodType_158">
                  <gml:beginPosition>1995-09-20T00:00:00Z</gml:beginPosition>
                  <gml:endPosition></gml:endPosition>
               </gml:TimePeriod>
            </gml:validTime>
            <geo:dataSamplingInterval>900.0</geo:dataSamplingInterval>
            <geo:accuracy-degreesCelcius>0.1</geo:accuracy-degreesCelcius>
            <geo:aspiration>NATURAL</geo:aspiration>
         </geo:temperatureSensor>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:temperatureSensors>
      <geo:temperatureSensors>
         <geo:temperatureSensor gml:id="TemperatureSensorType_27">
            <geo:type codeSpace="">WUSH-PTU</geo:type>
            <geo:manufacturer></geo:manufacturer>
            <geo:serialNumber>PQY9.008</geo:serialNumber>
            <geo:heightDiffToAntenna>-0.3</geo:heightDiffToAntenna>
            <geo:calibrationDate></geo:calibrationDate>
            <gml:validTime nilReason="">
               <gml:TimePeriod gml:id="TimePeriodType_159">
                  <gml:beginPosition>2010-05-22T00:00:00Z</gml:beginPosition>
                  <gml:endPosition></gml:endPosition>
               </gml:TimePeriod>
            </gml:validTime>
            <geo:dataSamplingInterval>30.0</geo:dataSamplingInterval>
            <geo:accuracy-degreesCelcius>0.1</geo:accuracy-degreesCelcius>
            <geo:aspiration>NATURAL</geo:aspiration>
         </geo:temperatureSensor>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:temperatureSensors>
      <geo:otherInstrumentations>
         <geo:otherInstrumentation gml:id="OtherInstrumentationType_12">
            <geo:instrumentation></geo:instrumentation>
            <gml:validTime>
               <gml:TimeInstant gml:id="TimeInstantType_94">
                  <gml:timePosition>1970-01-22T13:00:00Z</gml:timePosition>
               </gml:TimeInstant>
            </gml:validTime>
         </geo:otherInstrumentation>
         <geo:dateInserted>2016-04-14T00:03:07Z</geo:dateInserted>
      </geo:otherInstrumentations>
      <geo:siteContact gml:id="AgencyPropertyType_134">
         <gmd:MD_SecurityConstraints id="MDSecurityConstraintsType_134">
            <gmd:classification>
               <gmd:MD_ClassificationCode codeList="codelist" codeListValue="codeListValue"/>
            </gmd:classification>
         </gmd:MD_SecurityConstraints>
         <gmd:CI_ResponsibleParty id="CIResponsiblePartyType_134">
            <gmd:individualName>
               <gco:CharacterString>Qu Feng</gco:CharacterString>
            </gmd:individualName>
            <gmd:organisationName>
               <gco:CharacterString>Chinese Academy of Surveying & Mapping</gco:CharacterString>
            </gmd:organisationName>
            <gmd:contactInfo>
               <gmd:CI_Contact id="CIContactType_134">
                  <gmd:phone>
                     <gmd:CI_Telephone id="CITelephoneType_44">
                        <gmd:voice>
                           <gco:CharacterString>86-10-88217725</gco:CharacterString>
                        </gmd:voice>
                        <gmd:facsimile>
                           <gco:CharacterString>86-10-88217725</gco:CharacterString>
                        </gmd:facsimile>
                     </gmd:CI_Telephone>
                  </gmd:phone>
                  <gmd:address>
                     <gmd:CI_Address id="CIAddressType_134">
                        <gmd:deliveryPoint>
                           <gco:CharacterString>16 Beitaiping Rd.</gco:CharacterString>
                        </gmd:deliveryPoint>
                        <gmd:electronicMailAddress>
                           <gco:CharacterString>qufeng@casm.ac.cn</gco:CharacterString>
                        </gmd:electronicMailAddress>
                     </gmd:CI_Address>
                  </gmd:address>
               </gmd:CI_Contact>
            </gmd:contactInfo>
            <gmd:role>
               <gmd:CI_RoleCode codeList="codelist" codeListValue="codeListValue"/>
            </gmd:role>
         </gmd:CI_ResponsibleParty>
      </geo:siteContact>
      <geo:siteMetadataCustodian gml:id="AgencyPropertyType_135">
         <gmd:MD_SecurityConstraints id="MDSecurityConstraintsType_135">
            <gmd:classification>
               <gmd:MD_ClassificationCode codeList="codelist" codeListValue="codeListValue"/>
            </gmd:classification>
         </gmd:MD_SecurityConstraints>
         <gmd:CI_ResponsibleParty id="CIResponsiblePartyType_135">
            <gmd:organisationName>
               <gco:CharacterString>China Geo-informatics Center</gco:CharacterString>
            </gmd:organisationName>
            <gmd:contactInfo>
               <gmd:CI_Contact id="CIContactType_135">
                  <gmd:address>
                     <gmd:CI_Address id="CIAddressType_135"/>
                  </gmd:address>
               </gmd:CI_Contact>
            </gmd:contactInfo>
            <gmd:role>
               <gmd:CI_RoleCode codeList="codelist" codeListValue="codeListValue"/>
            </gmd:role>
         </gmd:CI_ResponsibleParty>
      </geo:siteMetadataCustodian>
      <geo:moreInformation>
         <geo:dataCenter></geo:dataCenter>
         <geo:urlForMoreInformation></geo:urlForMoreInformation>
         <geo:siteMap>Y</geo:siteMap>
         <geo:siteDiagram>Y</geo:siteDiagram>
         <geo:horizonMask>Y</geo:horizonMask>
         <geo:monumentDescription></geo:monumentDescription>
         <geo:sitePictures>Y</geo:sitePictures>
         <geo:antennaGraphicsWithDimensions></geo:antennaGraphicsWithDimensions>
         <geo:insertTextGraphicFromAntenna></geo:insertTextGraphicFromAntenna>
         <geo:DOI codeSpace="CodeSpaceTODO">CodeTypeTODO</geo:DOI>
      </geo:moreInformation>
   </geo:siteLog>
</geo:GeodesyML>


text:
import Spinner from "spin.js";

interface SpinnerScope extends ng.IScope {
    spinner: Spinner;
}

interface SpinnerAttributes extends ng.IAttributes {
    spinner: any;
}

export const spinnerName = "spinner";

spinner.$inject = [];
export function spinner() {
    // Description:
    //  Creates a new Spinner and sets its options
    // Usage:
    //

    const directive = {
        link: link,
        restrict: "A"
    };
    return directive;

    function link(scope: SpinnerScope, element: ng.IAugmentedJQuery, attrs: SpinnerAttributes) {
        scope.spinner = null;
        scope.$watch(attrs.spinner, function (options) {
            if (scope.spinner) {
                scope.spinner.stop();
            }
            scope.spinner = new Spinner(options);
            scope.spinner.spin(element[0]);
        }, true);
    }
}

redpajama_set_name: RedPajamaGithub


text:
using namespace std;
//---------------------------------------------------------------------------------------------------------------------

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    Scene &scene  = Scene::instance();
    scene.init();

    return app.exec();
}
//---------------------------------------------------------------------------------------------------------------------


text:
<?php
namespace Application\Bundle\SliderBundle\Admin;

use Application\Bundle\SliderBundle\Entity\Slide;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;

/**
 * Class SlidesAdmin
 */
class SlidesAdmin extends Admin
{
    /**
     * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
     *
     * @return void
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('slider', 'entity', array('class' => 'Application\Bundle\SliderBundle\Entity\Slider', 'empty_value' => 'Choose slider'))
            ->add('image', 'file', array('required' => false, 'data_class' => 'Symfony\Component\HttpFoundation\File\File'))
            ->add('content', 'textarea', array(
                'required' => false,
                'attr' => array('class' => 'tinymce', 'data-theme' => 'advanced')
            ));
    }

    /**
     * @param \Sonata\AdminBundle\Datagrid\ListMapper $listMapper
     *
     * @return void
     */
    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('image', 'string', array('template' => 'ApplicationSliderBundle:SlideAdmin:list_image.html.twig'))
            ->add('slider')
            ->add('_action', 'actions', array(
                'actions' => array(
                    'edit' => array(),
                    'delete' => array(),
                )
            ));
    }

    /**
     * @param \Sonata\AdminBundle\Datagrid\DatagridMapper $datagridMapper
     *
     * @return void
     */
    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper->add('slider');
    }

    /**
     * @param slide $slide
     *
     * @return mixed|void
     */
    public function preUpdate($slide)
    {
        $slide->setUpdated(new \DateTime());
    }
}


text:
package gli

import (
	"fmt"
	"reflect"
)

type Mesh struct {
	typ   reflect.Type
	attrs []meshAttribute

	drawMode  iDrawMode
	indexConv meshConverter
}

type meshAttribute struct {
	name   string
	buffer int
	conv   meshConverter
	format FullFormat
}

func (mb *meshBuilder) Build() (*Mesh, error) {
	if mb.err != nil {
		return nil, mb.err
	}
	ic, err := indexConvert(mb.indexType)
	if err != nil {
		return nil, err
	}
	mesh := &Mesh{
		typ:       mb.typ,
		drawMode:  mb.drawMode,
		indexConv: ic,
	}
	for bufnum, buffer := range mb.buffers {
		for _, name := range buffer {
			attr, ok := mb.attrs[name]
			if !ok {
				return nil, fmt.Errorf("MeshBuilder: Attempted to add the attribute '%s' which was not defined", name)
			}
			conv, err := fieldConvert(mb.typ, attr.idx, attr.format)
			if err != nil {
				return nil, err
			}
			mesh.attrs = append(mesh.attrs, meshAttribute{
				name:   attr.name,
				buffer: bufnum,
				conv:   conv,
				format: attr.format,
			})
		}
	}
	return mesh, nil
}

type meshBuilder struct {
	typ       reflect.Type
	attrs     map[string]*meshBuilderAttribute
	buffers   [][]string
	indexType iIndexType
	drawMode  iDrawMode
	err       error
}

type meshBuilderAttribute struct {
	name   string
	idx    []int
	typ    reflect.Type
	format FullFormat
	conv   meshConverter
}

func NewMeshBuilder(iface interface{}) *meshBuilder {
	typ := reflect.TypeOf(iface)
	if typ.Kind() == reflect.Ptr {
		typ = typ.Elem()
	}
	mb := &meshBuilder{
		typ:      typ,
		attrs:    make(map[string]*meshBuilderAttribute),
		drawMode: DrawPoints,
	}

	if typ.Kind() != reflect.Struct {
		mb.err = fmt.Errorf("MeshBuilder: Expected the provided type to be a struct or a pointer to a struct")
		return mb
	}

	err := mb.seedFields(typ)
	if err != nil {
		mb.err = err
		return nil
	}
	return mb
}

func (mb *meshBuilder) seedFields(typ reflect.Type) error {
	if typ.Kind() == reflect.Ptr {
		typ = typ.Elem()
	}
	if typ.Kind() != reflect.Struct {
		return fmt.Errorf("MeshBuilder: Anonymous fields are only allowed to be structs or pointers to struct")
	}

	var buffers []string
	numfield := typ.NumField()
	for i := 0; i < numfield; i++ {
		field := typ.Field(i)
		if field.PkgPath != "" {
			continue
		}
		if field.Anonymous {
			mb.seedFields(field.Type)
			continue
		}
		name := field.Tag.Get("meshattr")
		if name == "" {
			name = field.Name
		}
		if name == "-" {
			continue
		}
		_, ok := mb.attrs[name]
		if ok {
			return fmt.Errorf("MeshBuilder: Multiple attributes named '%s'", name)
		}
		format, err := defaultFormat(field.Type)
		if err != nil {
			return err
		}
		mb.attrs[name] = &meshBuilderAttribute{
			name:   name,
			idx:    field.Index,
			typ:    field.Type,
			format: format,
		}
		buffers = append(buffers, name)
	}
	mb.buffers = append(mb.buffers, buffers)
	return nil
}

func (mb *meshBuilder) Format(name string, format FullFormat) *meshBuilder {
	if mb.err != nil {
		return mb
	}
	attr, ok := mb.attrs[name]
	if !ok {
		mb.err = fmt.Errorf("MeshBuilder: Invalid attribute name '%s' supplied to MeshBuilder.Format", name)
		return mb
	}
	attr.format = format
	return mb
}

func (mb *meshBuilder) Interleave(names ...string) *meshBuilder {
	if mb.err != nil {
		return mb
	}

	nmap := make(map[string]struct{})
	for _, name := range names {
		nmap[name] = struct{}{}
	}

	var lastlist []string
	var newlists [][]string
	for _, buflist := range mb.buffers {
		var newlist []string
		for _, bufname := range buflist {
			_, selected := nmap[bufname]
			if selected {
				lastlist = append(lastlist, bufname)
				delete(nmap, bufname)
			} else {
				newlist = append(newlist, bufname)
			}
		}
		if len(newlist) > 0 {
			newlists = append(newlists, newlist)
		}
	}
	if len(lastlist) > 0 {
		newlists = append(newlists, lastlist)
	}

	for name := range nmap {
		mb.err = fmt.Errorf("MeshBuilder: Unknown attribute name '%s' in Interleave", name)
	}

	mb.buffers = newlists

	return mb
}

func (mb *meshBuilder) Index(indextype iIndexType) *meshBuilder {
	if mb.err == nil {
		mb.indexType = indextype
	}
	return mb
}

func (mb *meshBuilder) Mode(drawmode iDrawMode) *meshBuilder {
	if mb.err == nil {
		mb.drawMode = drawmode
	}
	return mb
}


text:
"""Base utilities for loading datasets."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import collections
import csv
import os
from os import path
import tempfile
import numpy as np

from six.moves import urllib

from tensorflow.python.platform import gfile

Dataset = collections.namedtuple('Dataset', ['data', 'target'])
Datasets = collections.namedtuple('Datasets', ['train', 'validation', 'test'])

def load_csv(filename):

	try:
		open(filename)
	except:
		print("File not found!!\n Check path or spelling for %s" % filename)
		exit()

	print("Converting file %s" % filename)

	id = np.array([])
	with open(filename) as csvfile:

		contents = csv.reader(csvfile,delimiter="\t")
		r=1 #row number
		for row in contents:

			length = len(row)
			i=1 #val number in row
			for val in row:
				if(i==1):
					row_vals = np.array([float(val)])
				elif(i<length):
					row_vals = np.append(row_vals,[float(val)],axis=0)
				else:
					finished_row = [row_vals]
					if r==1:
						data = finished_row
					else:
						data = np.append(data,finished_row,axis=0)
					id = np.concatenate((id,[float(val)]),axis=0)
				i+=1

			r+=1

	return data, id

def load_iris(data_path=None):
  """Load Iris dataset.

  Args:
      data_path: string, path to iris dataset (optional)

  Returns:
    Dataset object containing data in-memory.
  """
  if data_path is None:
    module_path = path.dirname(__file__)
    data_path = path.join(module_path, 'data', 'iris.csv')
  return load_csv_with_header(
      data_path,
      target_dtype=np.int,
      features_dtype=np.float)

def load_boston(data_path=None):
  """Load Boston housing dataset.

  Args:
      data_path: string, path to boston dataset (optional)

  Returns:
    Dataset object containing data in-memory.
  """
  if data_path is None:
    module_path = path.dirname(__file__)
    data_path = path.join(module_path, 'data', 'boston_house_prices.csv')
  return load_csv_with_header(
      data_path,
      target_dtype=np.float,
      features_dtype=np.float)

def maybe_download(filename, work_directory, source_url):
  """Download the data from source url, unless it's already here.

  Args:
      filename: string, name of the file in the directory.
      work_directory: string, path to working directory.
      source_url: url to download from if file doesn't exist.

  Returns:
      Path to resulting file.
  """
  if not gfile.Exists(work_directory):
    gfile.MakeDirs(work_directory)
  filepath = os.path.join(work_directory, filename)
  if not gfile.Exists(filepath):
    with tempfile.NamedTemporaryFile() as tmpfile:
      temp_file_name = tmpfile.name
      urllib.request.urlretrieve(source_url, temp_file_name)
      gfile.Copy(temp_file_name, filepath)
      with gfile.GFile(filepath) as f:
        size = f.Size()
      print('Successfully downloaded', filename, size, 'bytes.')
  return filepath


text:
package org.mockito.internal.junit;

import org.mockito.internal.util.MockitoLogger;
import org.mockito.invocation.Invocation;

import java.util.*;

/**
 * Contains stubbing arg mismatches, knows how to format them
 */
class StubbingArgMismatches {

    final Map<Invocation, Set<Invocation>> mismatches = new LinkedHashMap<Invocation, Set<Invocation>>();

    public void add(Invocation invocation, Invocation stubbing) {
        Set<Invocation> matchingInvocations = mismatches.get(stubbing);
        if (matchingInvocations == null) {
            matchingInvocations = new LinkedHashSet<Invocation>();
            mismatches.put(stubbing, matchingInvocations);
        }
        matchingInvocations.add(invocation);
    }

    public void format(String testName, MockitoLogger logger) {
        if (mismatches.isEmpty()) {
            return;
        }

        StubbingHint hint = new StubbingHint(testName);
        int x = 1;
        for (Map.Entry<Invocation, Set<Invocation>> m : mismatches.entrySet()) {
            hint.appendLine(x++, ". Unused... ", m.getKey().getLocation());
            for (Invocation invocation : m.getValue()) {
                hint.appendLine(" ...args ok? ", invocation.getLocation());
            }
        }

        logger.log(hint.toString());
    }

    public int size() {
        return mismatches.size();
    }

    public String toString() {
        return "" + mismatches;
    }
}


text:
package ru.stqa.selenium;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;

public class TestZ16 {

    public static final String USERNAME = "anna711";
    public static final String AUTOMATE_KEY = "GZ4DzsqwMVWxvg72YPV8";
    public static final String URL = "https://" + USERNAME + ":" + AUTOMATE_KEY + "@hub-cloud.browserstack.com/wd/hub";
    public WebDriver driver;
    @Before
    public void start() throws MalformedURLException {

        DesiredCapabilities caps = new DesiredCapabilities();
        // caps.setCapability("browserName", "internet explorer");
        //caps.setCapability("platform", "WINDOWS");
        caps.setCapability("browserName", "chrome");
        caps.setCapability("platform", "WIN8");
        caps.setCapability("version", "54");
        caps.setCapability("browserstack.debug", "true");
        driver = new RemoteWebDriver(new URL(URL), caps);

    }

    @After
    public void stop(){
        driver.quit();
        driver=null;
        }

    @Test
    public void myTest(){

        driver.get("https://www.yandex.ru/");
        driver.get("https://www.google.com/");
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Trans. Mycol. Soc. Japan 16(2): 138 (1975)

#### Original name
Beverwykella Tubaki

### Remarks
null


text:
import React from 'react'
import {Formik, Form, Field} from 'formik'

import {useLocation} from '../hooks'
import {Button, Icon} from '../ui'
import {select} from '../events'

const LABEL_STYLE = 'db pointer mb2'
const WRAPPER_STYLE = 'flex items-bottom h2'
const INPUT_STYLE =
  'w-100 mh2 bb bt-0 br-0 bl-0 b--near-black code f6 tc bg-transparent'
const BUTTON_STYLE = 'flex-none nr4 brand'

const INPUT_ID = 'load-files_url-input'

const defaultUrl = (loc: Location | null): string =>
  loc ? `${loc.origin}${loc.pathname}arduino-uno.zip` : ''

export type UrlInputProps = {
  children?: React.ReactNode
  handleUrl: (url: string) => unknown
}

export default function UrlInput(props: UrlInputProps): JSX.Element {
  const {children, handleUrl} = props
  const location = useLocation()

  return (
    <Formik
      initialValues={{url: defaultUrl(location)}}
      onSubmit={values => handleUrl(values.url)}
      enableReinitialize
    >
      {formProps => (
        <Form>
          <label htmlFor={INPUT_ID} className={LABEL_STYLE}>
            {children}
          </label>
          <div className={WRAPPER_STYLE}>
            <Field
              id={INPUT_ID}
              name="url"
              type="text"
              className={INPUT_STYLE}
              onClick={select}
            />
            <Button
              type="submit"
              className={BUTTON_STYLE}
              disabled={!formProps.values.url}
            >
              <Icon name="check" />
            </Button>
          </div>
        </Form>
      )}
    </Formik>
  )
}


text:
package oss

import (
	"fmt"
	"os"
	"time"

	. "gopkg.in/check.v1"
)

type OssCopySuite struct {
	client *Client
	bucket *Bucket
}

var _ = Suite(&OssCopySuite{})

// Run once when the suite starts running
func (s *OssCopySuite) SetUpSuite(c *C) {
	client, err := New(endpoint, accessID, accessKey)
	c.Assert(err, IsNil)
	s.client = client

	s.client.CreateBucket(bucketName)
	time.Sleep(5 * time.Second)

	bucket, err := s.client.Bucket(bucketName)
	c.Assert(err, IsNil)
	s.bucket = bucket

	testLogger.Println("test copy started")
}

// Run before each test or benchmark starts running
func (s *OssCopySuite) TearDownSuite(c *C) {
	// Delete Part
	lmur, err := s.bucket.ListMultipartUploads()
	c.Assert(err, IsNil)

	for _, upload := range lmur.Uploads {
		var imur = InitiateMultipartUploadResult{Bucket: bucketName,
			Key: upload.Key, UploadID: upload.UploadID}
		err = s.bucket.AbortMultipartUpload(imur)
		c.Assert(err, IsNil)
	}

	//Delete Objects
	lor, err := s.bucket.ListObjects()
	c.Assert(err, IsNil)

	for _, object := range lor.Objects {
		err = s.bucket.DeleteObject(object.Key)
		c.Assert(err, IsNil)
	}

	testLogger.Println("test copy completed")
}

// Run after each test or benchmark runs
func (s *OssCopySuite) SetUpTest(c *C) {
	err := removeTempFiles("../oss", ".jpg")
	c.Assert(err, IsNil)
}

// Run once after all tests or benchmarks have finished running
func (s *OssCopySuite) TearDownTest(c *C) {
	err := removeTempFiles("../oss", ".jpg")
	c.Assert(err, IsNil)
}

// TestCopyRoutineWithoutRecovery 多线程无断点恢复的复制
func (s *OssCopySuite) TestCopyRoutineWithoutRecovery(c *C) {
	srcObjectName := objectNamePrefix + "tcrwr"
	destObjectName := srcObjectName + "-copy"
	fileName := "../sample/BingWallpaper-2015-11-07.jpg"
	newFile := "copy-new-file.jpg"

	// 上传源文件
	err := s.bucket.UploadFile(srcObjectName, fileName, 100*1024, Routines(3))
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 不指定Routines,默认单线程
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024)
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err := compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 指定线程数1
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(1))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 指定线程数3,小于分片数5
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(3))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 指定线程数5,等于分片数
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(5))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 指定线程数10,大于分片数5
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(10))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 线程值无效自动变成1
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(-1))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// option
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(3), Meta("myprop", "mypropval"))

	meta, err := s.bucket.GetObjectDetailedMeta(destObjectName)
	c.Assert(err, IsNil)
	c.Assert(meta.Get("X-Oss-Meta-Myprop"), Equals, "mypropval")

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	err = s.bucket.DeleteObject(srcObjectName)
	c.Assert(err, IsNil)
}

// CopyErrorHooker CopyPart请求Hook
func CopyErrorHooker(part copyPart) error {
	if part.Number == 5 {
		time.Sleep(time.Second)
		return fmt.Errorf("ErrorHooker")
	}
	return nil
}

// TestCopyRoutineWithoutRecoveryNegative 多线程无断点恢复的复制
func (s *OssCopySuite) TestCopyRoutineWithoutRecoveryNegative(c *C) {
	srcObjectName := objectNamePrefix + "tcrwrn"
	destObjectName := srcObjectName + "-copy"
	fileName := "../sample/BingWallpaper-2015-11-07.jpg"

	// 上传源文件
	err := s.bucket.UploadFile(srcObjectName, fileName, 100*1024, Routines(3))
	c.Assert(err, IsNil)

	copyPartHooker = CopyErrorHooker
	// worker线程错误
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 100*1024, Routines(2))

	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "ErrorHooker")
	copyPartHooker = defaultCopyPartHook

	// 源Bucket不存在
	err = s.bucket.CopyFile("NotExist", srcObjectName, destObjectName, 100*1024, Routines(2))
	c.Assert(err, NotNil)

	// 源Object不存在
	err = s.bucket.CopyFile(bucketName, "NotExist", destObjectName, 100*1024, Routines(2))

	// 指定的分片大小无效
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024, Routines(2))
	c.Assert(err, NotNil)

	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*1024*1024*100, Routines(2))
	c.Assert(err, NotNil)

	// 删除源文件
	err = s.bucket.DeleteObject(srcObjectName)
	c.Assert(err, IsNil)
}

// TestCopyRoutineWithRecovery 多线程且有断点恢复的复制
func (s *OssCopySuite) TestCopyRoutineWithRecovery(c *C) {
	srcObjectName := objectNamePrefix + "tcrtr"
	destObjectName := srcObjectName + "-copy"
	fileName := "../sample/BingWallpaper-2015-11-07.jpg"
	newFile := "copy-new-file.jpg"

	// 上传源文件
	err := s.bucket.UploadFile(srcObjectName, fileName, 100*1024, Routines(3))
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// Routines默认值,CP开启默认路径是destObjectName+.cp
	// 第一次上传,上传4片
	copyPartHooker = CopyErrorHooker
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Checkpoint(true, ""))
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "ErrorHooker")
	copyPartHooker = defaultCopyPartHook

	// check cp
	ccp := copyCheckpoint{}
	err = ccp.load(destObjectName + ".cp")
	c.Assert(err, IsNil)
	c.Assert(ccp.Magic, Equals, copyCpMagic)
	c.Assert(len(ccp.MD5), Equals, len("LC34jZU5xK4hlxi3Qn3XGQ=="))
	c.Assert(ccp.SrcBucketName, Equals, bucketName)
	c.Assert(ccp.SrcObjectKey, Equals, srcObjectName)
	c.Assert(ccp.DestBucketName, Equals, bucketName)
	c.Assert(ccp.DestObjectKey, Equals, destObjectName)
	c.Assert(len(ccp.CopyID), Equals, len("3F79722737D1469980DACEDCA325BB52"))
	c.Assert(ccp.ObjStat.Size, Equals, int64(482048))
	c.Assert(len(ccp.ObjStat.LastModified), Equals, len("2015-12-17 18:43:03 +0800 CST"))
	c.Assert(ccp.ObjStat.Etag, Equals, "\"2351E662233817A7AE974D8C5B0876DD-5\"")
	c.Assert(len(ccp.Parts), Equals, 5)
	c.Assert(len(ccp.todoParts()), Equals, 1)
	c.Assert(ccp.PartStat[4], Equals, false)

	// 第二次上传,完成剩余的一片
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Checkpoint(true, ""))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err := compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	err = ccp.load(fileName + ".cp")
	c.Assert(err, NotNil)

	// Routines指定,CP指定
	copyPartHooker = CopyErrorHooker
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(2), Checkpoint(true, srcObjectName+".cp"))
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "ErrorHooker")
	copyPartHooker = defaultCopyPartHook

	// check cp
	ccp = copyCheckpoint{}
	err = ccp.load(srcObjectName + ".cp")
	c.Assert(err, IsNil)
	c.Assert(ccp.Magic, Equals, copyCpMagic)
	c.Assert(len(ccp.MD5), Equals, len("LC34jZU5xK4hlxi3Qn3XGQ=="))
	c.Assert(ccp.SrcBucketName, Equals, bucketName)
	c.Assert(ccp.SrcObjectKey, Equals, srcObjectName)
	c.Assert(ccp.DestBucketName, Equals, bucketName)
	c.Assert(ccp.DestObjectKey, Equals, destObjectName)
	c.Assert(len(ccp.CopyID), Equals, len("3F79722737D1469980DACEDCA325BB52"))
	c.Assert(ccp.ObjStat.Size, Equals, int64(482048))
	c.Assert(len(ccp.ObjStat.LastModified), Equals, len("2015-12-17 18:43:03 +0800 CST"))
	c.Assert(ccp.ObjStat.Etag, Equals, "\"2351E662233817A7AE974D8C5B0876DD-5\"")
	c.Assert(len(ccp.Parts), Equals, 5)
	c.Assert(len(ccp.todoParts()), Equals, 1)
	c.Assert(ccp.PartStat[4], Equals, false)

	// 第二次上传,完成剩余的一片
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(2), Checkpoint(true, srcObjectName+".cp"))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	err = ccp.load(srcObjectName + ".cp")
	c.Assert(err, NotNil)

	// 一次完成上传,中间没有错误
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(3), Checkpoint(true, ""))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 用多协程下载,中间没有错误
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(10), Checkpoint(true, ""))
	c.Assert(err, IsNil)

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// option
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(5), Checkpoint(true, ""), Meta("myprop", "mypropval"))
	c.Assert(err, IsNil)

	meta, err := s.bucket.GetObjectDetailedMeta(destObjectName)
	c.Assert(err, IsNil)
	c.Assert(meta.Get("X-Oss-Meta-Myprop"), Equals, "mypropval")

	err = s.bucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = s.bucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 删除源文件
	err = s.bucket.DeleteObject(srcObjectName)
	c.Assert(err, IsNil)
}

// TestCopyRoutineWithRecoveryNegative 多线程无断点恢复的复制
func (s *OssCopySuite) TestCopyRoutineWithRecoveryNegative(c *C) {
	srcObjectName := objectNamePrefix + "tcrwrn"
	destObjectName := srcObjectName + "-copy"

	// 源Bucket不存在
	err := s.bucket.CopyFile("NotExist", srcObjectName, destObjectName, 100*1024, Checkpoint(true, ""))
	c.Assert(err, NotNil)
	c.Assert(err, NotNil)

	// 源Object不存在
	err = s.bucket.CopyFile(bucketName, "NotExist", destObjectName, 100*1024, Routines(2), Checkpoint(true, ""))
	c.Assert(err, NotNil)

	// 指定的分片大小无效
	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024, Checkpoint(true, ""))
	c.Assert(err, NotNil)

	err = s.bucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*1024*1024*100, Routines(2), Checkpoint(true, ""))
	c.Assert(err, NotNil)
}

// TestCopyFileCrossBucket 跨Bucket直接的复制
func (s *OssCopySuite) TestCopyFileCrossBucket(c *C) {
	destBucketName := bucketName + "-cfcb-desc"
	srcObjectName := objectNamePrefix + "tcrtr"
	destObjectName := srcObjectName + "-copy"
	fileName := "../sample/BingWallpaper-2015-11-07.jpg"
	newFile := "copy-new-file.jpg"

	destBucket, err := s.client.Bucket(destBucketName)
	c.Assert(err, IsNil)

	// 创建目标Bucket
	err = s.client.CreateBucket(destBucketName)

	// 上传源文件
	err = s.bucket.UploadFile(srcObjectName, fileName, 100*1024, Routines(3))
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 复制文件
	err = destBucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(5), Checkpoint(true, ""))
	c.Assert(err, IsNil)

	err = destBucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err := compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = destBucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 带option的复制
	err = destBucket.CopyFile(bucketName, srcObjectName, destObjectName, 1024*100, Routines(10), Checkpoint(true, "copy.cp"), Meta("myprop", "mypropval"))
	c.Assert(err, IsNil)

	err = destBucket.GetObjectToFile(destObjectName, newFile)
	c.Assert(err, IsNil)

	eq, err = compareFiles(fileName, newFile)
	c.Assert(err, IsNil)
	c.Assert(eq, Equals, true)

	err = destBucket.DeleteObject(destObjectName)
	c.Assert(err, IsNil)
	os.Remove(newFile)

	// 删除目标Bucket
	err = s.client.DeleteBucket(destBucketName)
	c.Assert(err, IsNil)
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Torso.Mixins.pollingMixin - backbone-torso</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">

            API Docs for: 0.6.9

APIs

Classes

Modules

                            <input type="search" id="api-filter" placeholder="Type to filter APIs">

Behavior

Cell

Collection

Events

FormModel

FormView

history

ListView

Model

NestedModel

Router

ServiceCell

Torso

Torso.Mixins.cacheMixin

Torso.Mixins.cellMixin

Torso.Mixins.loadingMixin

Torso.Mixins.pollingMixin

Torso.Utils.handlebarsUtils

Torso.Utils.stickitUtils

Torso.Utils.templateRenderer

Torso.validation

View

Torso

                    Show:

                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited

                        <input type="checkbox" id="api-show-protected">
                        Protected

                        <input type="checkbox" id="api-show-private">
                        Private

                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated

Torso.Mixins.pollingMixin Class

            Defined in: modules/mixins/pollingMixin.js:12

            Module: Torso

Periodic Polling Object to be mixed into Backbone Collections and Models.

The polling functionality should only be used for collections and for models that are not
part of any collections. It should not be used for a model that is a part of a collection.

Index

Methods

Properties

Item Index

Methods

                                __poll

                                isPolling

                                polledFetch

                                startPolling

                                stopPolling

Properties

                                pollTimeoutId  The id from when setTimeout was called to start polling.

Methods

__poll

        ()

        private

                Defined in
        modules/mixins/pollingMixin.js:82

Private function to recursively call itself and poll for db updates.

isPolling

        ()

                Defined in
        modules/mixins/pollingMixin.js:30

Returns true if the poll is active

polledFetch

        ()

                Defined in
        modules/mixins/pollingMixin.js:71

By default, the polled fetching operation is routed directly
to backbone's fetch all.

startPolling

            (

                        pollInterval

)

                Defined in
        modules/mixins/pollingMixin.js:38

Starts polling Model/Collection by calling fetch every pollInterval.
Note: Each Model/Collection will only allow a singleton of polling to occur so
as not to have duplicate threads updating Model/Collection.

Parameters:

                        pollInterval
                        Integer

interval between each poll in ms.

stopPolling

        ()

                Defined in
        modules/mixins/pollingMixin.js:62

Stops polling Model and clears all Timeouts.

Properties

pollTimeoutId  The id from when setTimeout was called to start polling.

    Number

                Defined in
        modules/mixins/pollingMixin.js:23


text:
module Data.Generics.Bifixplate
       ( module Data.Generics.Bifixplate.Base
       )
       where

import Data.Generics.Bifixplate.Base


text:
<?php

namespace Inject\RouterGenerator\DestinationHandler;

use \Inject\RouterGenerator\Mapping;
use \Inject\RouterGenerator\Tokenizer;
use \Inject\RouterGenerator\Redirection;
use \Inject\RouterGenerator\DestinationHandler;
use \Inject\RouterGenerator\VariableNameContainerInterface;

/**
 * Destination handler which will redirect the user to a specific URL or a
 * relative URI.
 */
class Redirect extends DestinationHandler
{
	/**
	 * Matches on a Redirection object.
	 *
	 * @param  mixed
	 * @param  \Inject\RouterGenerator\Mapping
	 * @param  mixed
	 * @return DestinationHandlerInterface|false
	 */
	public static function parseTo($new, Mapping $mapping, $old)
	{
		if(is_object($new) && $new instanceof Redirection)
		{
			$ret = new Redirect($mapping);
			$ret->setRedirect($new);

			return $ret;
		}
		else
		{
			return false;
		}
	}

	/**
	 * Redirect data object.
	 *
	 * @var \Inject\RouterGenerator\Redirection
	 */
	protected $redirect;

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

	/**
	 * Sets the redirection object to use.
	 *
	 * @param  \Inject\RouterGenerator\Redirection
	 * @return void
	 */
	public function setRedirect($value)
	{
		$this->redirect = $value;
	}

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

	public function validate(array $validation_params)
	{
		// Validate that we have all the needed parameters to be able to create the URL/URI
		// All required parameters from the redirect must be either captured by the
		// path pattern or contained in the options array (default data for the path pattern captures)
		$diff = array_diff($this->redirect->getRequiredCaptures(), array_merge($this->tokenizer->getRequiredCaptures(), array_keys($this->options)));

		if( ! empty($diff))
		{
			throw new \Exception(sprintf('The route %s does not contain the required capture :%s which is required by the redirect destination.', $this->mapping->getPathPattern(), current($diff)));
		}
	}

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

	public function getCallCode(VariableNameContainerInterface $vars, $matches_var)
	{
		$path = array();
		foreach($this->redirect->getTokens() as $tok)
		{
			switch($tok[0])
			{
				case Tokenizer::CAPTURE:
					// PATH_INFO is not urlencoded, so no need to encode
					$path[] = $matches_var.'['.var_export($tok[1], true).']';
					break;
				case Tokenizer::LITERAL:
					$path[] = var_export($tok[1], true);
			}
		}

		return 'return array('.$this->redirect->getRedirectCode().', array(\'Location\' => '.implode('.', $path).'), \'\');';
	}
}

/* End of file Callback.php */
/* Location: src/php/Inject/Web/Router/Generator/Destination */


text:
using System;
using System.Web;
using System.Xml;
using System.Xml.Serialization;
using System.Net;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;

namespace WebsitePanel.Ecommerce.EnterpriseServer
{
	/// <summary>
	/// Payment provider for the PayPal Gateway
	/// </summary>
	public class PayPalProProvider : SystemPluginBase, IPaymentGatewayProvider
	{
		public const string DEMO_SERVICE_URL = "https://api-aa.sandbox.paypal.com/2.0/";
		public const string LIVE_SERVICE_URL = "https://api-aa-3t.paypal.com/2.0/";
		public const string PROCESSOR_VERSION = "2.0";

		public override string[] SecureSettings
		{
			get
			{
				return new string[] { PayPalProSettings.SIGNATURE, PayPalProSettings.PASSWORD };
			}
		}

		/// <summary>
		/// Gets whether plug-in running in live mode
		/// </summary>
		public bool LiveMode
		{
			get
			{
				return Convert.ToBoolean(PluginSettings[PayPalProSettings.LIVE_MODE]);
			}
		}
		/// <summary>
		/// Gets service username
		/// </summary>
		public string Username
		{
			get { return PluginSettings[PayPalProSettings.USERNAME]; }
		}
		/// <summary>
		/// Gets service password
		/// </summary>
		public string Password
		{
			get { return PluginSettings[PayPalProSettings.PASSWORD]; }
		}
		/// <summary>
		/// Gets service signature
		/// </summary>
		public string Signature
		{
			get { return PluginSettings[PayPalProSettings.SIGNATURE]; }
		}
		/// <summary>
		/// Gets service url
		/// </summary>
		public string ServiceUrl
		{
			get
			{
				if (LiveMode)
					return LIVE_SERVICE_URL;

				return DEMO_SERVICE_URL;
			}
		}

		#region IPaymentGatewayProvider Members

		public TransactionResult SubmitPaymentTransaction(CheckoutDetails details)
		{
			//init result structure
			TransactionResult ret = new TransactionResult();

			//set up Request
			//instantiate DoDirectPaymentRequestType and RequestDetails objects
			DoDirectPaymentRequestType request = new DoDirectPaymentRequestType();
			request.Version = PROCESSOR_VERSION;
			DoDirectPaymentRequestDetailsType requestDetails = new DoDirectPaymentRequestDetailsType();
			request.DoDirectPaymentRequestDetails = requestDetails;

			//set payment action
			requestDetails.PaymentAction = PaymentActionCodeType.Sale;

			//set IP
			//requestDetails.IPAddress = Request.UserHostAddress;
			requestDetails.IPAddress = details[CheckoutKeys.IPAddress];

			//set CreditCard info
			CreditCardDetailsType creditCardDetails = new CreditCardDetailsType();
			requestDetails.CreditCard = creditCardDetails;
			creditCardDetails.CreditCardNumber = details[CheckoutKeys.CardNumber];
			creditCardDetails.CreditCardType = (CreditCardTypeType)Enum.Parse(typeof(CreditCardTypeType), details[CheckoutKeys.CardType], true);
			creditCardDetails.CVV2 = details[CheckoutKeys.VerificationCode];
			creditCardDetails.ExpMonth = Int32.Parse(details[CheckoutKeys.ExpireMonth]);
			creditCardDetails.ExpYear = Int32.Parse(details[CheckoutKeys.ExpireYear]);
			// Switch/Solo
			if (creditCardDetails.CreditCardType == CreditCardTypeType.Solo ||
				creditCardDetails.CreditCardType == CreditCardTypeType.Switch)
			{
				creditCardDetails.StartMonth = Int32.Parse(details[CheckoutKeys.StartMonth]);
				creditCardDetails.StartYear = Int32.Parse(details[CheckoutKeys.StartYear]);
				creditCardDetails.IssueNumber = details[CheckoutKeys.IssueNumber];
			}

			//set billing address
			PayerInfoType cardOwner = new PayerInfoType();
			creditCardDetails.CardOwner = cardOwner;
			cardOwner.PayerName = new PersonNameType();
			cardOwner.PayerName.FirstName = details[CheckoutKeys.FirstName];
			cardOwner.PayerName.LastName = details[CheckoutKeys.LastName];

			cardOwner.Address = new AddressType();
			cardOwner.Address.Street1 = details[CheckoutKeys.Address];
			//??? cardOwner.Address.Street2 = "";
			cardOwner.Address.CityName = details[CheckoutKeys.City];
			cardOwner.Address.StateOrProvince = details[CheckoutKeys.State];
			cardOwner.Address.PostalCode = details[CheckoutKeys.Zip];
			cardOwner.Address.CountrySpecified = true;
			cardOwner.Address.Country = (CountryCodeType)Enum.Parse(typeof(CountryCodeType), details[CheckoutKeys.Country], true);

			//set payment Details
			PaymentDetailsType paymentDetails = new PaymentDetailsType();
			requestDetails.PaymentDetails = paymentDetails;
			paymentDetails.OrderTotal = new BasicAmountType();
			//TODO: Add currency support
			paymentDetails.OrderTotal.currencyID = (CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), details[CheckoutKeys.Currency]);
			//paymentDetails.OrderTotal.currencyID = CurrencyCodeType.USD;
			//No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,)
			paymentDetails.OrderTotal.Value = details[CheckoutKeys.Amount];

			DoDirectPaymentReq paymentRequest = new DoDirectPaymentReq();
			paymentRequest.DoDirectPaymentRequest = request;

			//FINISH set up req
			//setup request Header, API credentials
			PayPalAPIAASoapBinding paypalInterface = new PayPalAPIAASoapBinding();
			UserIdPasswordType user = new UserIdPasswordType();

			//set api credentials - username, password, signature
			user.Username = Username;
			user.Password = Password;
			user.Signature = Signature;
			// setup service url
			paypalInterface.Url = ServiceUrl;
			paypalInterface.RequesterCredentials = new CustomSecurityHeaderType();
			paypalInterface.RequesterCredentials.Credentials = user;

			//make call return response
			DoDirectPaymentResponseType paymentResponse = new DoDirectPaymentResponseType();
			paymentResponse = paypalInterface.DoDirectPayment(paymentRequest);
			//write response xml to the ret object
			ret.RawResponse = SerializeObject(paymentResponse);

			switch (paymentResponse.Ack)
			{
				case AckCodeType.Success:
				case AckCodeType.SuccessWithWarning:
					ret.Succeed = true;
					ret.TransactionId = paymentResponse.TransactionID;
					ret.TransactionStatus = TransactionStatus.Approved;
					break;
				default: // show errors if Ack is NOT Success
					ret.Succeed = false;
					ret.TransactionStatus = TransactionStatus.Declined;
					if (paymentResponse.Errors != null &&
						paymentResponse.Errors.Length > 0)
					{
						ret.StatusCode = PayPalProKeys.ErrorPrefix + paymentResponse.Errors[0].ErrorCode;
					}
					break;
			}
			return ret;
		}
		#endregion

		private string UTF8ByteArrayToString(byte[] characters)
		{
			UTF8Encoding encoding = new UTF8Encoding();
			string ret = encoding.GetString(characters);
			return ret;
		}

		private string SerializeObject(object obj)
		{
			string ret = null;
			if (obj == null)
			{
				return ret;
			}

			XmlTextWriter xmlTextWriter = null;
			try
			{
				XmlSerializer xmlSerializer = new XmlSerializer(obj.GetType());
				xmlTextWriter = new XmlTextWriter(new MemoryStream(), Encoding.UTF8);
				xmlSerializer.Serialize(xmlTextWriter, obj);
				MemoryStream memoryStream = (MemoryStream)xmlTextWriter.BaseStream;
				ret = UTF8ByteArrayToString(memoryStream.ToArray());
				return ret;
			}
			catch (Exception)
			{
				//write to log
				return ret;
			}
			finally
			{
				if (xmlTextWriter != null)
				{
					xmlTextWriter.Close();
				}
			}
		}
	}
}


text:
using Starcounter;

namespace Content.Database
{
    [Database]
    public class SystemUserGroupMember
    {
        public SystemUser SystemUser { get; set; }
        public SystemUserGroup SystemUserGroup { get; set; }
    }
}


text:
'use strict';

var passport = require('passport');
var mongoose = require('mongoose');

module.exports = function () {
  var User = mongoose.model('User');

  passport.serializeUser(function (user, done) {
    done(null, user.id);
  });

  passport.deserializeUser(function (id, done) {
    User.findOne({
      _id: id
    }, '-password -salt', function (err, user) {
      done(err, user);
    });
  });

  require('./strategies/local')();
  require('./strategies/twitter')();
  require('./strategies/facebook')();
  require('./strategies/google')();
};


text:
module Dynflow
  module Testing
    class ManagedClock

      attr_reader :pending_pings

      include Algebrick::Types
      Timer = Algebrick.type do
        fields! who:   Object, # to ping back
                when:  type { variants Time, Numeric }, # to deliver
                what:  Maybe[Object], # to send
                where: Symbol # it should be delivered, which method
      end

      module Timer
        include Clock::Timer
      end

      def initialize
        @pending_pings = []
      end

      def ping(who, time, with_what = nil, where = :<<)
        with = with_what.nil? ? None : Some[Object][with_what]
        @pending_pings << Timer[who, time, with, where]
      end

      def progress
        copy = @pending_pings.dup
        clear
        copy.each { |ping| ping.apply }
      end

      def clear
        @pending_pings.clear
      end
    end
  end
end


text:
class DailyDigestWorker
  include Sidekiq::Worker
  include Sidetiq::Schedulable

  recurrence { daily(1) }

  def perform
    User.send_daily_digest
  end
end


text:
package com.example;

import com.google.api.client.repackaged.com.google.common.base.Preconditions;
import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.gson.Gson;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;

public class NotificationSender {
  // [START send_notification_asdk]
  final class Notification {

    private final String title;

    Notification(String title) {
      this.title = title;
    }

    String getTitle() {
      return title;
    }
  }

  final class Target {

    private final String userId;
    private final String intent;

    Target(String userId, String intent) {
      this.userId = userId;
      this.intent = intent;
    }

    String getUserId() {
      return userId;
    }

    String getIntent() {
      return intent;
    }
  }

  final class PushMessage {

    private final Notification userNotification;
    private final Target target;

    PushMessage(Notification userNotification, Target target) {
      this.userNotification = userNotification;
      this.target = target;
    }

    Notification getUserNotification() {
      return userNotification;
    }

    Target getTarget() {
      return target;
    }
  }

  final class PushNotification {

    private final PushMessage customPushMessage;
    private boolean isInSandbox;

    PushNotification(PushMessage customPushMessage, boolean isInSandbox) {
      this.customPushMessage = customPushMessage;
      this.isInSandbox = isInSandbox;
    }

    PushMessage getCustomPushMessage() {
      return customPushMessage;
    }

    boolean getIsInSandbox() {
      return isInSandbox;
    }
  }

  private PushNotification createNotification(String title, String userId, String intent) {
    Notification notification = new Notification(title);
    Target target = new Target(userId, intent);
    PushMessage message = new PushMessage(notification, target);
    boolean isInSandbox = true;
    return new PushNotification(message, isInSandbox);
  }

  private ServiceAccountCredentials loadCredentials() throws IOException {
    String actionsApiServiceAccountFile =
        this.getClass().getClassLoader().getResource("service-account.json").getFile();
    InputStream actionsApiServiceAccount = new FileInputStream(actionsApiServiceAccountFile);
    ServiceAccountCredentials serviceAccountCredentials =
        ServiceAccountCredentials.fromStream(actionsApiServiceAccount);
    return (ServiceAccountCredentials)
        serviceAccountCredentials.createScoped(
            Collections.singleton(
                "https://www.googleapis.com/auth/actions.fulfillment.conversation"));
  }

  private String getAccessToken() throws IOException {
    AccessToken token = loadCredentials().refreshAccessToken();
    return token.getTokenValue();
  }

  public void sendNotification(String title, String userId, String intent) throws IOException {
    Preconditions.checkNotNull(title, "title cannot be null.");
    Preconditions.checkNotNull(userId, "userId cannot be null.");
    Preconditions.checkNotNull(intent, "intent cannot be null.");
    PushNotification notification = createNotification(title, userId, intent);

    HttpPost request = new HttpPost("https://actions.googleapis.com/v2/conversations:send");

    String token = getAccessToken();

    request.setHeader("Content-type", "application/json");
    request.setHeader("Authorization", "Bearer " + token);

    StringEntity entity = new StringEntity(new Gson().toJson(notification));
    entity.setContentType(ContentType.APPLICATION_JSON.getMimeType());
    request.setEntity(entity);
    HttpClient httpClient = HttpClientBuilder.create().build();
    httpClient.execute(request);
  }
  // [END send_notification_asdk]

  public static void main(String[] args) throws IOException {
    NotificationSender notificationSender = new NotificationSender();
    notificationSender.sendNotification("Push Notification Title", "<UPDATES_USER_ID>", "Notification Intent");
  }

}


text:
// Copyright 2007 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.opengse.configuration.impl;

import com.google.opengse.configuration.WebAppInitParam;

/**
 * A mutable implementation of WebAppInitParam.
*
* @author Mike Jennings
*/

public final class MutableWebAppInitParam extends HasDescription
    implements WebAppInitParam {
  private String paramName;
  private String paramValue;

  private MutableWebAppInitParam() {
    super();
  }

  public static MutableWebAppInitParam create() {
    return new MutableWebAppInitParam();
  }

  public String getParamName() {
    return paramName;
  }

  public void setParamName(final String paramName) {
    this.paramName = paramName;
  }

  public String getParamValue() {
    return paramValue;
  }

  public void setParamValue(final String paramValue) {
    this.paramValue = paramValue;
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Treenumerable.Tests.TreeBuilder;
using Xunit;
using Xunit.Extensions;

namespace Treenumerable.Tests.TreeWalkerExtensionsTests
{
    public class GetDescendantsByPredicateTests
    {
        [Fact]
        public void GetDescendants_NullWalker_ArgumentNullExceptionThrown()
        {
            // Get a valid tree.
            var tree = TestTreeFactory.GetSimpleTree();

            // Create a null ITreeWalker.
            NodeWalker<int> walker = null;

            // Assert that 'GetDescendants' throws an 'ArgumentNullException' when the tree
            // walker is null.
            Assert.Throws<ArgumentNullException>(
                "walker",
                () => walker.GetDescendants(new Node<int>[] { tree }, (n, i) => true).ToArray());
            Assert.Throws<ArgumentNullException>(
                "walker",
                () => walker.GetDescendants(new Node<int>[] { tree }, (n) => true).ToArray());
            Assert.Throws<ArgumentNullException>(
                "walker",
                () => walker.GetDescendants(tree, (n, i) => true).ToArray());
            Assert.Throws<ArgumentNullException>(
                "walker",
                () => walker.GetDescendants(tree, (n) => true).ToArray());
        }

        [Fact]
        public void GetDescendants_NullNode_ArgumentNullExceptionThrown()
        {
            // Create a valid ITreeWalker.
            NodeWalker<int> walker = new NodeWalker<int>();

            // Assert that 'GetDescendants' throws an 'ArgumentNullException' when the node is
            // null.
            Assert.Throws<ArgumentNullException>(
                "nodes",
                () => walker.GetDescendants((IEnumerable<Node<int>>)null, (n, i) => true).ToArray());
            Assert.Throws<ArgumentNullException>(
                "nodes",
                () => walker.GetDescendants((IEnumerable<Node<int>>)null, (n) => true).ToArray());
            Assert.Throws<ArgumentNullException>(
                "node",
                () => walker.GetDescendants((Node<int>)null, (n, i) => true).ToArray());
            Assert.Throws<ArgumentNullException>(
                "node",
                () => walker.GetDescendants((Node<int>)null, (n) => true).ToArray());
        }

        [Fact]
        public void GetDescendants_NullPredicate_ArgumentNullExceptionThrown()
        {
            // Get a valid tree.
            var tree = TestTreeFactory.GetSimpleTree();

            // Create a valid ITreeWalker.
            NodeWalker<int> walker = new NodeWalker<int>();

            // Assert that 'GetDescendants' throws an 'ArgumentNullException' when the predicate
            // is null.
            Assert.Throws<ArgumentNullException>(
                "predicate",
                () => walker.GetDescendants(new Node<int>[] { tree }, (Func<Node<int>, int, bool>)null).ToArray());
            Assert.Throws<ArgumentNullException>(
                "predicate",
                () => walker.GetDescendants(new Node<int>[] { tree }, (Func<Node<int>, bool>)null).ToArray());
            Assert.Throws<ArgumentNullException>(
                "predicate",
                () => walker.GetDescendants(tree, (Func<Node<int>, int, bool>)null).ToArray());
            Assert.Throws<ArgumentNullException>(
                "predicate",
                () => walker.GetDescendants(tree, (Func<Node<int>, bool>)null).ToArray());
        }

        [Theory]
        [MemberData("ValuePredicateTestData")]
        public void GetDescendants_ValuePredicateTests(
            Func<Node<int>, bool> predicate,
            int[] expectedResult)
        {
            // Get a valid tree.
            var tree = TestTreeFactory.GetSimpleTree();

            // Create a valid ITreeWalker.
            NodeWalker<int> walker = new NodeWalker<int>();

            // Assert that 'GetDescendants' returns the expected results for each predicate.
            Assert.Equal(
                expectedResult,
                walker
                    .GetDescendants(tree, predicate)
                    .Select(x => x.Value));
            Assert.Equal(
                expectedResult,
                walker
                    .GetDescendants(new Node<int>[] { tree }, predicate)
                    .Select(x => x.Value));
        }

        public static IEnumerable<object[]> ValuePredicateTestData
        {
            get
            {
                return new []
                {
                    new object[] {
                        new Func<Node<int>, bool>(i => i.Value % 2 == 0),
                        new int[] { 2, 4 }},
                    new object[] {
                        new Func<Node<int>, bool>(i => i.Value % 2 == 1),
                        new int[] { 1, 5 }},
                    new object[] {
                        new Func<Node<int>, bool>(i => i.Value >= 2 && i.Value != 4),
                        new int[] { 2, 3, 5 }}
                };
            }
        }

        [Theory]
        [MemberData("DepthPredicateTestData")]
        public void GetDescendants_DepthPredicateTests(
            Func<Node<int>, int, bool> predicate,
            int[] expectedResult)
        {
            // Get a valid tree.
            var tree = TestTreeFactory.GetSimpleTree();

            // Create a valid ITreeWalker.
            NodeWalker<int> walker = new NodeWalker<int>();

            // Assert that 'GetDescendants' returns the expected results for each predicate.
            Assert.Equal(
                expectedResult,
                walker
                    .GetDescendants(tree, predicate)
                    .Select(x => x.Value));
            Assert.Equal(
                expectedResult,
                walker
                    .GetDescendants(new Node<int>[] { tree }, predicate)
                    .Select(x => x.Value));
        }

        public static IEnumerable<object[]> DepthPredicateTestData
        {
            get
            {
                return new[]
                {
                    new object[] {
                        new Func<Node<int>, int, bool>((i, d) => i.Value % 2 == 0),
                        new int[] { 2, 4 }},
                    new object[] {
                        new Func<Node<int>, int, bool>((i, d) => i.Value % 2 == 1),
                        new int[] { 1, 5 }},
                    new object[] {
                        new Func<Node<int>, int, bool>((i, d) => i.Value >= 2 && i.Value != 4),
                        new int[] { 2, 3, 5 }},
                    new object[] {
                        new Func<Node<int>, int, bool>((i, d) => d == 1),
                        new int[] { 1, 4 }},
                    new object[] {
                        new Func<Node<int>, int, bool>((i, d) => d == 2),
                        new int[] { 2, 3, 5 }},
                    new object[] {
                        new Func<Node<int>, int, bool>((i, d) => d == 3),
                        new int[] { 6 }}
                };
            }
        }

    }
}


text:
'use strict';

describe('controllers', function(){
  var scope;

  beforeEach(module('ALTGC'));

  beforeEach(inject(function($rootScope) {
    scope = $rootScope.$new();
  }));

  it('should define more than 5 awesome things', inject(function($controller) {
    expect(scope.stackComponents).toBeUndefined();

    $controller('DeveloperFeaturesController', {
      $scope: scope
    });

    expect(angular.isArray(scope.stackComponents)).toBeTruthy();
    expect(scope.stackComponents.length > 5).toBeTruthy();
  }));
});


text:
export DEBIAN_FRONTEND=noninteractive

# Install GLLVM / OCCAM dependencies
sudo apt-get update
sudo -E apt-get install -y clang-10 clang-format-10 cmake git golang-go
sudo -E apt-get install -y libboost-dev libgmp-dev libprotobuf-dev llvm-10
sudo -E apt-get install -y protobuf-compiler python3-pip python-protobuf
sudo -E apt-get install -y software-properties-common wget
pip3 install setuptools --upgrade
pip3 install wheel
pip3 install protobuf
pip3 install lit

# Download OCCAM
git clone --recurse-submodules https://github.com/SRI-CSL/OCCAM.git occam

# Set environment variables
cp occam/vagrants/18.04/basic/bash_profile $HOME/.bash_profile
. .bash_profile

# Install GLLVM
mkdir "$GOPATH"
cd "$GOPATH"
go get github.com/SRI-CSL/gllvm/cmd/...

# Build OCCAM
cd $OCCAM_HOME
make -j16
make install
make test

# Get OCCAM benchmarks (and depepndencies)
cd $HOME
git clone https://github.com/SRI-CSL/OCCAM-Benchmarks.git runbench
. runbench/dependencies.sh


text:
using System;
using Valle.GtkUtilidades;
using Valle.ToolsTpv;
using Gdk;

namespace Valle.TpvFinal
{
	public partial class ImfTicket : FormularioBase
	{
		public ImfTicket ()
		{
			this.Init ();
			this.LblTituloBase = this.lblTitulo;
		    scrooltactil1.wScroll =	this.GtkScrolledWindow;
		}

		public void MostrarInformacion(Mesa mesa){

		}

		protected override bool OnExposeEvent (EventExpose evnt)
		{
			Titulo = "Informacion de ticket";
			return base.OnExposeEvent (evnt);
		}
	}
}


text:
<template name="all">

			{{#each course in coursesall}}

{{course.title}}

{{course.description}}

								进入课程

			{{/each}}

</template>


text:
package main

import (
	"fmt"
	"log"
	"net"
	"time"

	"github.com/carlescere/goback"
)

// Creates a function that will fail 6 times before connecting
func faultyTCPGenerator() func(string, string, string) (net.Listener, error) {
	var failedAttempts = 6
	return func(protocol, address, port string) (net.Listener, error) {
		if failedAttempts > 0 {
			failedAttempts--
			return nil, fmt.Errorf("Haha!") // :)
		}
		l, err := net.Listen(protocol, fmt.Sprintf("%s:%s", address, port))
		return l, err
	}
}

func main() {
	tcpConnect := faultyTCPGenerator()
	// Duplicates the time each time from a minimum of 100ms to a maximum of 1 min.
	b := &goback.SimpleBackoff{
		Min:    100 * time.Millisecond,
		Max:    60 * time.Second,
		Factor: 2,
	}
	for {
		l, err := tcpConnect("tcp", "localhost", "5000")
		if err != nil { // fail to connect
			log.Printf("Error connecting: %v", err)
			goback.Wait(b) // Exponential backoff
			continue
		}
		defer l.Close()
		// connected
		log.Printf("Connected!")
		b.Reset() // Reset number of attempts. Brings backoff time to the minimum
		break     // Here be dragons
	}
}


text:
"""
Created on Thu Aug 13 22:19:12 2015

@author: rc, alex
"""

from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D
from keras.layers.recurrent import GRU, LSTM
from keras.layers.normalization import BatchNormalization
from keras.layers.advanced_activations import PReLU
from keras.optimizers import SGD, Adam
from keras.regularizers import l2

def buildNN(architecture,training_params,input_dim):
    """Lay out a Neural Network as described in the YAML file."""
    current_units = input_dim

    model = Sequential()

    for layer in architecture:
        layer_name = layer.keys()[0]
        layer_params = layer[layer_name]
        if layer_name == 'Activation':
            model.add(Activation(layer_params['type']))
        if layer_name == 'PReLU':
            model.add(PReLU(current_units))
        if layer_name == 'Dropout':
            model.add(Dropout(layer_params['p']))
        if layer_name == 'Dense':
            model.add(Dense(current_units, layer_params['num_units'], init='glorot_uniform'))
            current_units = layer_params['num_units']
        if layer_name == 'Conv':
            # a filter covers all predictions for a single time sample
            # strides are made between time samples
            model.add(Convolution2D(layer_params['nb_filters'], 1, current_units, 1,
                                    subsample=(current_units,1),
                                    init='glorot_uniform'))
            current_units = layer_params['nb_filters']*training_params['num_strides']
        if layer_name == 'GRU':
            model.add(GRU(current_units,layer_params['num_units'], return_sequences=layer_params['next_GRU']))
            current_units = layer_params['num_units']
        if layer_name == 'LSTM':
            model.add(LSTM(current_units,layer_params['num_units'], return_sequences=layer_params['next_GRU']))
            current_units = layer_params['num_units']
        if layer_name == 'BatchNormalization':
            model.add(BatchNormalization((current_units,)))
        if layer_name == 'Flatten':
            model.add(Flatten())
        if layer_name == 'Output':
            model.add(Dense(current_units, 6, init='glorot_uniform'))
            model.add(Activation('sigmoid'))
    if not training_params.has_key('optim') or training_params['optim'] == 'sgd':
        optim = SGD(lr=training_params['lr'], decay=float(training_params['decay']), momentum=training_params['momentum'], nesterov=True)
    elif training_params['optim'] == 'adam':
        optim = Adam(lr=training_params['lr'])

    model.compile(loss='binary_crossentropy', optimizer=optim)

    return model


text:
struct taxicab_distance
{
    template <typename P1, typename P2>
    static inline typename bg::coordinate_type<P1>::type apply(
                    P1 const& p1, P2 const& p2)
    {
        using bg::get;
        using bg::math::abs;
        return abs(get<0>(p1) - get<1>(p2))
            + abs(get<1>(p1) - get<1>(p2));
    }
};

namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services
{

template <>
struct tag<taxicab_distance>
{
    typedef strategy_tag_distance_point_point type;
};

template <typename P1, typename P2>
struct return_type<taxicab_distance, P1, P2>
{
    typedef typename coordinate_type<P1>::type type;
};

template <>
struct comparable_type<taxicab_distance>
{
    typedef taxicab_distance type;
};

template <>
struct get_comparable<taxicab_distance>
{
    static inline taxicab_distance apply(taxicab_distance const& input)
    {
        return input;
    }
};

template <typename P1, typename P2>
struct result_from_distance<taxicab_distance, P1, P2>
{
    template <typename T>
    static inline typename coordinate_type<P1>::type apply(taxicab_distance const& , T const& value)
    {
        return value;
    }
};

}}}}} // namespace bg::strategy::distance::services

template <typename Geometry1, typename Geometry2>
void test_distance(Geometry1 const& geometry1,
            Geometry2 const& geometry2,
            long double expected_distance)
{
    typename bg::default_distance_result<Geometry1>::type distance = bg::distance(geometry1, geometry2);

#ifdef GEOMETRY_TEST_DEBUG
    std::ostringstream out;
    out << typeid(typename bg::coordinate_type<Geometry1>::type).name()
        << std::endl
        << typeid(typename bg::default_distance_result<Geometry1>::type).name()
        << std::endl
        << "distance : " << bg::distance(geometry1, geometry2)
        << std::endl;
    std::cout << out.str();
#endif

    BOOST_CHECK_CLOSE(distance, expected_distance, 0.0001);
}

template <typename Geometry1, typename Geometry2>
void test_geometry(std::string const& wkt1, std::string const& wkt2, double expected_distance)
{
    Geometry1 geometry1;
    bg::read_wkt(wkt1, geometry1);
    Geometry2 geometry2;
    bg::read_wkt(wkt2, geometry2);

    test_distance(geometry1, geometry2, expected_distance);
}

template <typename Geometry1, typename Geometry2>
void test_empty_input(Geometry1 const& geometry1, Geometry2 const& geometry2)
{
    try
    {
        bg::distance(geometry1, geometry2);
    }
    catch(bg::empty_input_exception const& )
    {
        return;
    }
    BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" );
}

#endif


text:
var test = require('tape'),
    TimeSeries = require(__dirname + '/..'),
    fs = require('fs'),
    geojsonhint = require('geojsonhint');

var taxiData = JSON.parse(fs.readFileSync(__dirname + '/../data/taxis.geojson', 'utf8')),
    popData = JSON.parse(fs.readFileSync(__dirname + '/../data/population.geojson', 'utf8'));

test('returns expected output', function(t) {

  var taxiTimeSeries = new TimeSeries({ data: taxiData, dateFormat: 'hour_%H' }),
      popTimeSeries = new TimeSeries({ data: popData, dateFormat: '%Y' });

  var taxiErrors = geojsonhint.hint(taxiTimeSeries.getGeoJSON()),
      popErrors = geojsonhint.hint(popTimeSeries.getGeoJSON());

  t.ok(taxiErrors.length === 0 && popErrors.length === 0, 'valid GeoJSON returned');

  t.end();

});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
	<class name="ubic.gemma.model.analysis.expression.coexpression.GeneCoexpressedGenes" table="GENE_COEX_GENES"
    >
		<cache usage="read-write" />
		<id access="field" name="geneId" type="java.lang.Long" unsaved-value="null">
			<column name="ID" sql-type="BIGINT" />
			<generator class="assigned" />
		</id>
		<property name="bytes" type="byte[]">
			<column name="BYTES" not-null="true" unique="false" sql-type="MEDIUMBLOB" />
		</property>
	</class>

</hibernate-mapping>


text:
namespace NWFWMDLabFileImporter
{
    public class ObservationV2
    {
        public string ObservationID { get; set; }
        public string LocationID { get; set; }
        public string ObservedPropertyID { get; set; }
        public string ObservedDateTime { get; set; }
        public string AnalyzedDateTime { get; set; }
        public string Depth { get; set; }
        public string DepthUnit { get; set; }
        public string DataClassification { get; set; }
        public string ResultValue { get; set; }
        public string ResultUnit { get; set; }
        public string ResultStatus { get; set; }
        public string ResultGrade { get; set; }
        public string Medium { get; set; }
        public string ActivityID { get; set; }
        public string ActivityName { get; set; }
        public string CollectionMethod { get; set; }
        public string FieldDeviceID { get; set; }
        public string FieldDeviceType { get; set; }
        public string FieldComment { get; set; }
        public string LabSpecimenName { get; set; }
        public string LabAnalysisMethod { get; set; }
        public string LabDetectionCondition { get; set; }
        public string LabLimitType { get; set; }
        public string LabMDL { get; set; }
        public string LabMRL { get; set; }
        public string LabQualityFlag { get; set; }
        public string LabReceivedDateTime { get; set; }
        public string LabPreparedDateTime { get; set; }
        public string LabSampleFraction { get; set; }
        public string LabFromLaboratory { get; set; }
        public string LabSampleID { get; set; }
        public string LabDilutionFactor { get; set; }
        public string LabComment { get; set; }
        public string QCType { get; set; }
        public string QCSourceSampleID { get; set; }
        public string EARequestID { get; set; }
        public string EASampler { get; set; }
        public string EACollectionAgency { get; set; }
    }
}


text:
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Roy-T.AStar.Tests")]


text:
/**
 * Created by gucheng on 1/28/16.
 */
import { Directive, ElementRef, Input, Output, HostListener } from "@angular/core";
import { EventEmitter } from "@angular/core";
import { OnChanges } from "@angular/core";

@Directive({
  selector: '[contenteditableModel]'
})
export class ContenteditableModel implements OnChanges {
  @Input('contenteditableModel') model: string;
  @Output('contenteditableModelChange') update = new EventEmitter();

  private lastViewModel: any;

  constructor(private elRef: ElementRef) {
  }

  ngOnChanges(changes) {
    if (changes.model) {
      let { currentValue, previousValue } = changes.model;
      if (currentValue !== previousValue) {
        this.lastViewModel = this.model;
        this.refreshView();
      }
    }
  }

  @HostListener('blur') onBlur() {
    var value = this.elRef.nativeElement.innerText;
    this.lastViewModel = value;
    this.update.emit(value);
  }

  private refreshView() {
    this.elRef.nativeElement.innerText = this.model
  }
}


text:
<?php

date_default_timezone_set('UTC');

function dataUri($file) {
  return file_exists($file) ? 'data:image/png;base64,' . base64_encode(file_get_contents($file)) : null;
}

function template($data) {

  $custom   = __DIR__ . '/../config/template.php';
  $default  = __DIR__ . '/template.php';
  $file     = file_exists($custom) ? $custom : $default;

  ob_start();
  extract($data);
  require($file);
  $template = ob_get_contents();
  ob_end_clean();

  return $template;

}

// define all the stuff we need to load
$config    = __DIR__ . '/../config/config.php';
$theme     = __DIR__ . '/../config/styles.css';
$signature = __DIR__ . '/../config/signature.png';

// load all options
$data = array_replace_recursive(require(__DIR__ . '/defaults.php'), file_exists($config) ? require($config) : []);

// set current locale
setlocale (LC_ALL, $data['locale']);

// set the current date as default date
$data['date'] = strftime($data['dateFormat']);

// make it nice
$styles  = file_get_contents(__DIR__ . '/defaults.css');
$styles .= file_exists($theme) ? PHP_EOL . file_get_contents($theme) : null;

// load the signature if it exists
$data['signature'] = dataUri($signature);

// load the favicon as data uri
$favicon = dataUri(__DIR__ . '/favicon.png');

// set the browser title
$title = $data['title'];

// load the template
$template = template($data);


text:
@class Conversation;
@class User;

@interface Message : NSObject

@property (strong) User *author;
@property (strong) NSString *content;
@property (strong) NSDate *createdAt;

- (NSDictionary *)asJSON;

+ (Message *)messageWithAuthor:(User *)author content:(NSString *)content createdAt:(NSDate *)createdAt;
+ (Message *)messageFromDict:(NSDictionary *)dict;
+ (NSArray *)messagesFromArrayOfDicts:(NSArray *)dicts;
+ (NSArray *)messagesFromArrayOfDicts:(NSArray *)dicts withConversation:(Conversation *)conversation;

@end


text:
package io.particle.android.sdk.di;

import android.support.annotation.RestrictTo;

import dagger.Subcomponent;
import io.particle.android.sdk.accountsetup.LoginActivity;
import io.particle.android.sdk.accountsetup.PasswordResetActivity;
import io.particle.android.sdk.accountsetup.TwoFactorActivity;
import io.particle.android.sdk.devicesetup.ui.ConnectToApFragment;
import io.particle.android.sdk.devicesetup.ui.ConnectingActivity;
import io.particle.android.sdk.devicesetup.ui.ConnectingProcessWorkerTask;
import io.particle.android.sdk.devicesetup.ui.DiscoverDeviceActivity;
import io.particle.android.sdk.devicesetup.ui.GetReadyActivity;
import io.particle.android.sdk.devicesetup.ui.ManualNetworkEntryActivity;
import io.particle.android.sdk.devicesetup.ui.PasswordEntryActivity;
import io.particle.android.sdk.devicesetup.ui.SelectNetworkActivity;
import io.particle.android.sdk.devicesetup.ui.SuccessActivity;

@PerActivity
@Subcomponent(modules = {ApModule.class})
@RestrictTo({RestrictTo.Scope.LIBRARY})
public interface ActivityInjectorComponent {
    void inject(GetReadyActivity activity);

    void inject(LoginActivity loginActivity);

    void inject(PasswordResetActivity passwordResetActivity);

    void inject(SuccessActivity successActivity);

    void inject(DiscoverDeviceActivity discoverDeviceActivity);

    void inject(ConnectingActivity connectingActivity);

    void inject(PasswordEntryActivity passwordEntryActivity);

    void inject(ManualNetworkEntryActivity manualNetworkEntryActivity);

    void inject(SelectNetworkActivity selectNetworkActivity);

    void inject(ConnectToApFragment connectToApFragment);

    void inject(ConnectingProcessWorkerTask connectingProcessWorkerTask);

    void inject(TwoFactorActivity twoFactorActivity);

    @Subcomponent.Builder
    interface Builder {
        Builder apModule(ApModule module);

        ActivityInjectorComponent build();
    }

}


text:
version="1.7.2"
arch=`uname -m`

if [ "${arch}" = "x86_64" ]; then
    arch="64bit"
else
    arch="32bit"
fi

if [ -f VeriCoin-Qt.app/Contents/MacOS/VeriCoin-Qt ] && [ -f vericoin.conf ] && [ -f README ]; then
    echo "Building VeriCoin_${version}_${arch}.pkg ...\n"
    cp vericoin.conf VeriCoin-Qt.app/Contents/MacOS/
    cp README VeriCoin-Qt.app/Contents/MacOS/

    # Remove the old archive
    if [ -f VeriCoin_${version}_${arch}.pkg ]; then
        rm -f VeriCoin_${version}_${arch}.pkg
    fi

    # Deploy the app, create the plist, then build the package.
    macdeployqt ./VeriCoin-Qt.app -always-overwrite
    pkgbuild --analyze --root ./VeriCoin-Qt.app share/qt/VeriCoin-Qt.plist
    pkgbuild --root ./VeriCoin-Qt.app --component-plist share/qt/VeriCoin-Qt.plist --identifier org.vericoin.VeriCoin-Qt --install-location /Applications/VeriCoin-Qt.app VeriCoin_${version}_${arch}.pkg
    echo "Package created in: $PWD/VeriCoin_${version}_${arch}.pkg\n"
else
    echo "Error: Missing files!\n"
    echo "Run this script from the folder containing VeriCoin-Qt.app, vericoin.conf and README.\n"
fi


text:
package paavohuh.sourcream.emulation;

import java.util.Optional;

/**
 * Provides the ability to load a screen buffer from a string.
 */
public class ScreenBufferLoader {

    private static final char ZERO = '0';
    private static final char ONE = '1';
    private static final char DELIMITER = '\n';

    /**
     * Attempts to load a screen buffer from a string. Returns a None if it
     * fails.
     *
     * @param str A string describing the screen buffer. Consists of ones,
     * zeroes, and newlines.
     * @return A screen buffer, if the load succeeds.
     */
    public static Optional<ScreenBuffer> tryLoad(String str) {
        String[] rows
                = str.replace("\r", "")
                .split(Character.toString(DELIMITER));

        boolean[][] buffer = new boolean[rows.length][rows[0].length()];

        int rowLength = rows[0].length();

        for (int y = 0; y < rows.length; y++) {
            if (rows[y].length() != rowLength) {
                return Optional.empty();
            }

            rowLength = rows[y].length();

            for (int x = 0; x < rowLength; x++) {
                char c = rows[y].charAt(x);

                if (c == ZERO) {
                    buffer[y][x] = false;
                } else if (c == ONE) {
                    buffer[y][x] = true;
                } else {
                    return Optional.empty();
                }
            }
        }

        return Optional.of(new ScreenBuffer(buffer, false, false));
    }

    /**
     * This is a utility class - it shouldn't be instantianed.
     */
    private ScreenBufferLoader() {
    }
}


text:
<!--
   This file is part of the X12Parser library that provides tools to
   manipulate X12 messages using Ruby native syntax.

   http://x12parser.rubyforge.org

   Copyright (C) 2009 APP Design, Inc.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

   $Id: B3B.xml 78 2009-05-12 22:27:26Z ikk $
-->

<Segment name="B3B" comment="To transmit identifying numbers, dates, and other basic data relating to the transaction set">
  <Field name="InvoiceNumber" min="1" max="22" comment="Identifying number assigned by issuer"/>
  <Field name="ShipmentMethodOfPayment" min="2" max="2" validation="T146" comment="Code identifying payment terms for transportation charges"/>
  <Field name="Date1" min="8" max="8" comment="Date expressed as CCYYMMDD where CC represents the first two digits of the calendar year"/>
  <Field name="NetAmountDue" type="double" min="1" max="12" comment="Total charges to be paid by the receiver of this transaction set expressed in the standard monetary denomination for the currency specified"/>
  <Field name="Date2" required="y" min="8" max="8" comment="Date expressed as CCYYMMDD where CC represents the first two digits of the calendar year"/>
  <Field name="StandardCarrierAlphaCode" min="2" max="4" comment="Standard Carrier Alpha Code"/>
  <Field name="TransportationMethodTypeCode" min="1" max="2" validation="T91" comment="Code specifying the method or type of transportation for the shipment"/>
  <Field name="ShipmentIdentificationNumber" required="y" min="1" max="30" comment="Identification number assigned to the shipment by the shipper that uniquely identifies the shipment from origin to ultimate destination and is not subject to modification; (Does not contain blanks or special characters)"/>
  <Field name="WeightUnitCode" required="y" min="1" max="1" validation="T188" comment="Code specifying the weight unit"/>
  <Field name="CorrectionIndicator" required="y" min="2" max="2" validation="T202" comment="Code used to indicate that the transaction set contains information which corrects previous information"/>
  <Field name="CurrencyCode" required="y" min="3" max="3" comment="Code (Standard ISO) for country in whose currency the charges are specified"/>
</Segment>


text: Fork from [RecordWAVToAMRDemo](https://github.com/justinjing/RecordWAVToAMRDemo);


text:
import dockerfile from "highlight.js/lib/languages/dockerfile";
export default dockerfile;