text:
package org.vaadin.viritinv7;

import com.vaadin.annotations.Theme;
import com.vaadin.ui.Component;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.beanutils.BeanComparator;

import org.vaadin.addonhelpers.AbstractTest;
import org.vaadin.viritinv7.fields.MTable;
import org.vaadin.viritin.testdomain.Person;
import org.vaadin.viritin.testdomain.Service;

/**
 *
 * @author Matti Tahvonen
 */
@Theme("valo")
public class SortingWithCollections extends AbstractTest {

    @Override
    public Component getTestComponent() {
        final List<Person> listOfPersons = Service.getListOfPersons(100);

        final MTable<Person> table = new MTable(listOfPersons);

        // If the underlaying "property" is not sortable by default, you can
        // explicitly make it sortable via UI
        // table.setSortableProperties("foo", "bar",...);

        table.addSortListener(new MTable.SortListener() {

            @Override
            public void onSort(final MTable.SortEvent event) {
                // Skip default Vaadin proprietary container level sorting
                event.preventContainerSort();
                // Use std JDK API, alternatively you could fetch a new sorted
                // list from your backend here and replace content
                Collections.sort(listOfPersons, new Comparator<Person>(){

                    @Override
                    public int compare(Person o1, Person o2) {
                        String sortProperty = event.getSortProperty();
                        /**
                         * You could do anything you want here. Here just
                         * use BeanComparator from commons-beanutils
                         */
                        BeanComparator<Person> beanComparator = new BeanComparator<>();
                        beanComparator.setProperty(sortProperty);
                        if(event.isSortAscending()) {
                            return beanComparator.compare(o1, o2);
                        } else {
                            return - beanComparator.compare(o1, o2);
                        }
                    }
                });
                // Notify Table that its content has changed
                table.refreshRowCache();
            }
        });

        return table;
    }

}


text:
@import "../../../vars.css";

:root {
  --playlist-filter-input-height: 36px;
}

.PlaylistMediaFilter {
  display: flex;
}

.PlaylistMediaFilter-input {
  width: 180px;
  border-radius: 2px;
  background: #252727;
  border: 1px solid #252727;
  color: var(--text-color);
  font-size: 12pt;
  padding: 0 8px;
  height: var(--playlist-filter-input-height);
  display: none;
  margin-top: calc((54px - var(--playlist-filter-input-height)) / 2);

  &:focus {
    outline: none;
    border: 1px solid var(--highlight-color);
  }

  &.is-open {
    display: block;
  }
}

redpajama_set_name: RedPajamaGithub


text:
const antlr4 = require("antlr4/index");
const Lexer = require("./PythonLexer");
const Parser = require("./PythonParser");
const ASTBuilder = require('./ASTBuilder');
const libraryFunctions = require('./LibraryFunctions');

global.tracer = function(sourceCode, destStatement) {
    const chars = new antlr4.InputStream(sourceCode + '\n' + destStatement + '\n');
    const lexer = new Lexer.PythonLexer(chars);
    const tokens  = new antlr4.CommonTokenStream(lexer);
    const parser = new Parser.PythonParser(tokens);
    const builder = new ASTBuilder();

    try {
        const program = builder.buildProgram(parser.file_input());

        Object.keys(libraryFunctions).forEach(
            name => program.include(name, libraryFunctions[name])
        );

        return program.reduce();
    } catch (error) {
        alert('Ошибка интерпретации исходного текста программы. Возможно, в исходном тексте имеются неподдериваемые конструкции.');
        console.log(error);
    }
};


text:
Cookmarklet
==============
Easily, view, edit and add cookies or local storage items with this bookmarklet.

## Features
Below are existing and planned features for the cookies bookmarklet.

### Existing
- View Cookies
- Edit Cookies
- Remove Cookies
- Works on SSL Pages

### Planned
- Add Cookies
- Edit, Add, View & Remove Local Storage Items
- Tabs on the left that switch between showing cookies or localstorage


text:
"""
Snipped to download current IKEA ZLL OTA files into ~/otau
compatible with python 3.
"""

import os
import json
try:
	from urllib.request import urlopen, urlretrieve
except ImportError:
	from urllib2 import urlopen
	from urllib import urlretrieve

f = urlopen("http://fw.ota.homesmart.ikea.net/feed/version_info.json")
data = f.read()

arr = json.loads(data.decode('utf-8'))

otapath = '%s/otau' % os.path.expanduser('~')

if not os.path.exists(otapath):
	os.makedirs(otapath)

for i in arr:
	if 'fw_binary_url' in i:
		url = i['fw_binary_url']
		ls = url.split('/')
		fname = ls[len(ls) - 1]
		path = '%s/%s' % (otapath, fname)

		if not os.path.isfile(path):
			urlretrieve(url, path)
			print(path)
		else:
		    print('%s already exists' % fname)


text:
import React from 'react';
import { storiesOf } from '@storybook/react';
import VideoWithRichPoster from './VideoWithRichPoster';

storiesOf('VideoWithRichPoster', module)
  .add('Default', () => (
    <VideoWithRichPoster
      posterSrc={ [
        <source
          src="https://s3-eu-west-1.amazonaws.com/appearhere/assets/bloom/example-video-rich-poster.mp4"
          type="video/mp4"
        />,
        <source
          src="https://s3-eu-west-1.amazonaws.com/appearhere/assets/bloom/example-video-rich-poster.webm"
          type="video/webm"
        />
      ] }
      videoSrc={ [
        <source
          src="https://s3-eu-west-1.amazonaws.com/appearhere/assets/bloom/example-video.mp4"
          type="video/mp4"
        />,
        <source
          src="https://s3-eu-west-1.amazonaws.com/appearhere/assets/bloom/example-video.webm"
          type="video/webm"
        />
      ] }
    />
  ));


text:
package org.opensmartgridplatform.adapter.domain.smartmetering.application.services;

import static org.assertj.core.api.Assertions.assertThat;

import java.math.BigDecimal;
import java.util.Date;

import org.junit.Before;
import org.junit.Test;
import org.opensmartgridplatform.adapter.domain.smartmetering.application.mapping.MonitoringMapper;
import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActiveEnergyValues;
import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.MeterReads;
import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.OsgpMeterValue;
import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.OsgpUnit;
import org.opensmartgridplatform.dto.valueobjects.smartmetering.ActiveEnergyValuesDto;
import org.opensmartgridplatform.dto.valueobjects.smartmetering.DlmsMeterValueDto;
import org.opensmartgridplatform.dto.valueobjects.smartmetering.DlmsUnitTypeDto;
import org.opensmartgridplatform.dto.valueobjects.smartmetering.MeterReadsResponseDto;

import ma.glasnost.orika.impl.DefaultMapperFactory;

public class MonitoringMapperTest {
    private MonitoringMapper mapper;

    @Before
    public void setUp() throws Exception {
        this.mapper = new MonitoringMapper();
        this.mapper.configure(new DefaultMapperFactory.Builder().build());
    }

    @Test
    public void convertsMeterReadsResponseDtoToMeterReads() {
        final Date logTime = new Date(123L * 24 * 60 * 60 * 1000);
        final ActiveEnergyValuesDto activeEnergyValuesDto = new ActiveEnergyValuesDto(
                new DlmsMeterValueDto(new BigDecimal("12.34"), DlmsUnitTypeDto.M3),
                new DlmsMeterValueDto(new BigDecimal("12.35"), DlmsUnitTypeDto.M3),
                new DlmsMeterValueDto(new BigDecimal("12.36"), DlmsUnitTypeDto.M3),
                new DlmsMeterValueDto(new BigDecimal("12.37"), DlmsUnitTypeDto.M3),
                new DlmsMeterValueDto(new BigDecimal("12.38"), DlmsUnitTypeDto.M3),
                new DlmsMeterValueDto(new BigDecimal("12.39"), DlmsUnitTypeDto.M3));
        final MeterReadsResponseDto source = new MeterReadsResponseDto(logTime, activeEnergyValuesDto);

        final MeterReads result = this.mapper.map(source, MeterReads.class);

        final ActiveEnergyValues activeEnergyValues = new ActiveEnergyValues(
                new OsgpMeterValue(new BigDecimal("12.340"), OsgpUnit.M3),
                new OsgpMeterValue(new BigDecimal("12.350"), OsgpUnit.M3),
                new OsgpMeterValue(new BigDecimal("12.360"), OsgpUnit.M3),
                new OsgpMeterValue(new BigDecimal("12.370"), OsgpUnit.M3),
                new OsgpMeterValue(new BigDecimal("12.380"), OsgpUnit.M3),
                new OsgpMeterValue(new BigDecimal("12.390"), OsgpUnit.M3));
        final MeterReads expected = new MeterReads(logTime, activeEnergyValues);
        assertThat(result).isEqualToComparingFieldByFieldRecursively(expected);
    }
}


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

<TITLE>
HemfPlusHeader (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.hemf.hemfplus.record

Class HemfPlusHeader

java.lang.Object
  org.apache.poi.hemf.hemfplus.record.HemfPlusHeader

All Implemented Interfaces:
HemfPlusRecord

@Internal
public class HemfPlusHeader
extends java.lang.Object
implements HemfPlusRecord

Constructor Summary

HemfPlusHeader()

Method Summary

 long
getEmfPlusFlags()

 int
getFlags()

 long
getLogicalDpiX()

 long
getLogicalDpiY()

 HemfPlusRecordType
getRecordType()

 long
getVersion()

 void
init(byte[] dataBytes,
     int recordId,
     int flags)

 java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HemfPlusHeader

public HemfPlusHeader()

Method Detail

getRecordType

public HemfPlusRecordType getRecordType()

Specified by:
getRecordType in interface HemfPlusRecord

getFlags

public int getFlags()

Specified by:
getFlags in interface HemfPlusRecord

init

public void init(byte[] dataBytes,
                 int recordId,
                 int flags)
          throws java.io.IOException

Specified by:
init in interface HemfPlusRecord

Parameters:
dataBytes - these are the bytes that start after the id, flags, record size
                    and go to the end of the record; they do not include any required padding
                    at the end.
recordId - record type id
flags - flags

Throws:

java.io.IOException

getVersion

public long getVersion()

getEmfPlusFlags

public long getEmfPlusFlags()

getLogicalDpiX

public long getLogicalDpiX()

getLogicalDpiY

public long getLogicalDpiY()

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2017 The Apache Software Foundation or
        its licensors, as applicable.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cocos2D;

namespace tests
{
    public class LabelTTFMultiline : AtlasDemo
    {
        public LabelTTFMultiline()
        {
            CCSize s = CCDirector.SharedDirector.WinSize;

            // CCLabelBMFont
            CCLabelTTF center = new CCLabelTTF("word wrap \"testing\" (bla0) bla1 'bla2' [bla3] (bla4) {bla5} {bla6} [bla7] (bla8) [bla9] 'bla0' \"bla1\"",
                "Paint Boy", 32,
                new CCSize(s.Width / 2, 200),
                CCTextAlignment.Center);
            center.Position = new CCPoint(s.Width / 2, 150);

            AddChild(center);
        }

        public override string title()
        {
            return "Testing CCLabelTTF Word Wrap";
        }

        public override string subtitle()
        {
            return "Word wrap using CCLabelTTF";
        }
    }
}


text:
/// <reference types="node" />

import * as HTMLMinifier from 'html-minifier';

declare namespace htmlmin {
}

declare function htmlmin(options?: HTMLMinifier.Options): NodeJS.ReadWriteStream;

export = htmlmin;


text:
#ifndef SETTINGSDLG_H
#define SETTINGSDLG_H

#include <QLabel>
#include <QWidget>
#include <QCheckBox>
#include <QLineEdit>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QTextStream>
#include <QScrollArea>
#include <QPushButton>
#include <QGridLayout>
#include <QMessageBox>
#include <QRadioButton>

class dlgsettings : public QWidget
{
	Q_OBJECT

signals:
	void printcursettings(double sigma, float k, int min_size);

public:
	dlgsettings()
	{
	}
	dlgsettings(double sigma, float k, int min_size);
	void savesettings(void)
	{
		emit printcursettings(sigma, k, min_size);
	}

private slots:
	void accept(void);

private:
	// Control Variables
	double sigma;
	float k;
	int min_size;

	QGroupBox *segmentationgroup;
	QVBoxLayout *segmentationbox;
	QLabel *labelsegmentationSigma;
	QLabel *labelsegmentationK;
	QLabel *labelsegmentationMin_size;
	QLineEdit *editsegmentationSigma;
	QLineEdit *editsegmentationK;
	QLineEdit *editsegmentationMin_size;
};
#endif


text:
/**
 * 从https://github.com/trending获取数据
 * 项目地址:https://github.com/crazycodeboy/GitHubTrending
 * 博客地址:http://www.devio.org
 * @flow
 */
import React, {Component} from 'react';
import {View,Text,StyleSheet,TouchableHighlight} from 'react-native';

import GitHubTrending from './GitHubTrending'

export default class ZWGitTrending extends Component{
  // constructor(props){
  //   super(props);
  //   {
  //    let a = 1;
  //    var b = 2;
  //   }
  //   alert(a);  // Can not find Variable:a
  //   alert(b);     // 2

  // }
  request(){
    new GitHubTrending().fetchTrending('https://github.com/trending');
  }
  render(){
    return(
      <TouchableHighlight style={{height:40,}} onPress={()=>this.request()}>
        <Text>从trending获取数据</Text>
      </TouchableHighlight>
    );
  }
}


text:
using System;

namespace Krs.Ats.IBNet
{
    /// <summary>
    /// Receive Financial Advisor Event Arguments
    /// </summary>
    [Serializable()]
    public class ReceiveFAEventArgs : EventArgs
    {
        private FADataType faDataType;

        private string xml;

        /// <summary>
        /// Full Constructor
        /// </summary>
        /// <param name="faDataType">Specifies the type of Financial Advisor configuration data being received from TWS.</param>
        /// <param name="xml">The XML string containing the previously requested FA configuration information.</param>
        public ReceiveFAEventArgs(FADataType faDataType, string xml)
        {
            this.faDataType = faDataType;
            this.xml = xml;
        }

        /// <summary>
        /// Uninitialized Constructor for Serialization
        /// </summary>
        public ReceiveFAEventArgs()
        {

        }

        /// <summary>
        /// Specifies the type of Financial Advisor configuration data being received from TWS.
        /// </summary>
        /// <remarks>Valid values include:
        /// 1 = GROUPS
        /// 2 = PROFILE
        /// 3 = ACCOUNT ALIASES
        /// </remarks>
        public FADataType FADataType
        {
            get { return faDataType; }
			set { faDataType = value; }
		}

        /// <summary>
        /// The XML string containing the previously requested FA configuration information.
        /// </summary>
        public string Xml
        {
            get { return xml; }
			set { xml = value; }
		}
    }
}


text:
from drf_hal_json.pagination import HalPageNumberPagination
from rest_framework.response import Response
from rest_framework.settings import api_settings
from drf_hal_json import LINKS_FIELD_NAME, EMBEDDED_FIELD_NAME

class OsdiPagination(HalPageNumberPagination):

    max_page_size = 100 # something sane
    page_query_param = 'page'
    page_size_query_param = 'per_page'
    osdi_schema = None # e.g. 'osdi:events'

    def get_paginated_response(self, data):
        if self.osdi_schema:
            data = {self.osdi_schema: data}
        response = super(OsdiPagination, self).get_paginated_response(data)
        result = response.data
        result['total_pages'] = int(result['count'] / result['page_size']) + 1
        result['page'] =  self.request.query_params.get(self.page_query_param, 1)
        result['total_records'] = result.get('count')
        response.data = result
        return response


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>Impact of Scaffolding Characteristics and Study Quality on Learner Outcomes in STEM Education: A Meta-analysis</AwardTitle>
    <AwardEffectiveDate>09/15/2013</AwardEffectiveDate>
    <AwardExpirationDate>08/31/2017</AwardExpirationDate>
    <AwardAmount>309809</AwardAmount>
    <AwardInstrument>
      <Value>Standard Grant</Value>
    </AwardInstrument>
    <Organization>
      11090000
      <Directorate>
        <LongName>Direct For Education and Human Resources</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Research On Learning</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Gregg E. Solomon</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>This two-year synthesis project, led by researchers at Utah State University, focuses on the use of scaffolding in STEM learning in formal and informal settings. Scaffolding is support that helps students engage in and gain skill at tasks that are beyond their unassisted capabilities. The project uses meta-analysis to determine the influence of scaffold characteristics, study and assessment instrument quality, and assessment type on cognitive outcomes in K-Adult STEM education. <br/><br/>Preparing all students to address fundamental STEM problems is central to preparing effective citizens for the 21st century. Combined with scaffolding, inquiry-based approaches in STEM education can lead to this goal. A current lack of a comprehensive assessment of scaffolding characteristics hinders (a) scaffolding adoption by STEM instructors and administrators and (b) scaffolding design by instructional designers.</AbstractNarration>
    <MinAmdLetterDate>09/11/2013</MinAmdLetterDate>
    <MaxAmdLetterDate>11/21/2014</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>1251782</AwardID>
    <Investigator>
      <FirstName>Brian</FirstName>
      <LastName>Belland</LastName>
      <EmailAddress>brian.belland@usu.edu</EmailAddress>
      <StartDate>09/11/2013</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Andrew</FirstName>
      <LastName>Walker</LastName>
      <EmailAddress>andy.walker@usu.edu</EmailAddress>
      <StartDate>09/11/2013</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Utah State University</Name>
      <CityName>Logan</CityName>
      <ZipCode>843221415</ZipCode>
      <PhoneNumber>4357971226</PhoneNumber>
      <StreetAddress>Sponsored Programs Office</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Utah</StateName>
      <StateCode>UT</StateCode>
    </Institution>
    <ProgramElement>
      7625
      <Text>REAL</Text>
    </ProgramElement>
    <ProgramElement>
      7980
      <Text>Core R&D Programs</Text>
    </ProgramElement>
    <ProgramReference>
      9150
      <Text>EXP PROG TO STIM COMP RES</Text>
    </ProgramReference>
    <ProgramReference>
      9177
      <Text>ELEMENTARY/SECONDARY EDUCATION</Text>
    </ProgramReference>
    <ProgramReference>
      9251
      <Text>RES EXPER FOR UNDERGRAD-SUPPLT</Text>
    </ProgramReference>
    <ProgramReference>
      SMET
      <Text>SCIENCE, MATH, ENG & TECH EDUCATION</Text>
    </ProgramReference>
  </Award>
</rootTag>


text:
import datetime
import iso8601

from conveyor.tests.unit import fake_constants as fake

DEFAULT_PLAN_NAME = "displayname"
DEFAULT_PLAN_DESCRIPTION = "displaydesc"
DEFAULT_PLAN_TYPE = "clone"
DEFAULT_PLAN_STATUS = "available"
DEFAULT_PLAN_ID = fake.PLAN_ID
DEFAULT_AZ = "fakeaz"

def create_fake_plan(id, **kwargs):
    plan = {
        'id': id,
        'user_id': fake.USER_ID,
        'project_id': fake.PROJECT_ID,
        'availability_zone': DEFAULT_AZ,
        'plan_status': DEFAULT_PLAN_STATUS,
        'name': 'plan_test',
        'display_name': DEFAULT_PLAN_NAME,
        'display_description': DEFAULT_PLAN_DESCRIPTION,
        'updated_at': datetime.datetime(1900, 1, 1, 1, 1, 1,
                                        tzinfo=iso8601.iso8601.Utc()),
        'created_at': datetime.datetime(1900, 1, 1, 1, 1, 1,
                                        tzinfo=iso8601.iso8601.Utc()),
        'plan_type': 'clone',
        'original_resource': '',
        'update_resources': ''
    }

    if kwargs.get('original_resource', None):
        plan['original_resource'] = kwargs.get('original_resource')
    if kwargs.get('update_resources', None):
        plan['update_resources'] = kwargs.get('update_resources')
    if kwargs.get('plan_status', None):
        plan['plan_status'] = kwargs.get('plan_status')
    return plan

def fake_clone_template():
    template = {'template':
                {'heat_template_version': '2013-05-23',
                 'description': 'clone template',
                 'plan_type': 'clone',
                 'parameters': {},
                 'resources': {'volume_0': {'type': 'OS::Cinder::Volume',
                               'properties': {'size': 1,
                                              'availability_zone': 'az01',
                                              'name': 'test-vol-8',
                                              'metadata': {'region': 'az01'}},
                               'extra_properties': {'status': 'in-use',
                                                    'is_deacidized': True,
                                                    'sys_dev_name': 'fake',
                                                    'id': 'fake'}}}}}
    return template

def fake_plan_api_get(self, context, id, **kwargs):
    plan = create_fake_plan(id, **kwargs)
    return plan


text:
<?php

namespace yii\web;

use yii\base\Component;

/**
 * HtmlResponseFormatter formats the given data into an HTML response content.
 *
 * It is used by [[Response]] to format response data.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class HtmlResponseFormatter extends Component implements ResponseFormatterInterface
{
    /**
     * @var string the Content-Type header for the response
     */
    public $contentType = 'text/html';

    /**
     * Formats the specified response.
     * @param Response $response the response to be formatted.
     */
    public function format($response)
    {
        if (stripos($this->contentType, 'charset') === false) {
            $this->contentType .= '; charset=' . $response->charset;
        }
        $response->getHeaders()->set('Content-Type', $this->contentType);
        if ($response->data !== null) {
            $response->content = $response->data;
        }
    }
}


text:
package org.reveno.atp.api.domain;

import java.util.Map;
import java.util.Optional;
import java.util.Set;

public interface Repository {

    /**
     * Retrieves entity from repository. If current model is Mutable, then
     * this entity also marked as dirty, which means that after current transaction execution
     * view mapping for that entity will happen.
     *
     * @param entityType entity type to be retrieved
     * @param id         identificator of an entity
     * @return entity
     */
    <T> T get(Class<T> entityType, long id);

    default <T> Optional<T> getO(Class<T> entityType, long id) {
        return Optional.ofNullable(get(entityType, id));
    }

    <T> boolean has(Class<T> entityType, long id);

    default <T> T getOrDefault(Class<T> entityType, long id, T defaultValue) {
        T t;
        return ((t = get(entityType, id)) != null) ? t : defaultValue;
    }

    /**
     * Gets entity from repository without marking it as dirty,
     * hence no view mapping will happen after transaction, in which this method is invoked.
     * <p>
     * Please note, that above logic is actual only for Mutable Models.
     *
     * @param entityType entity type to be retrieved
     * @param id         identificator of an entity
     * @return entity
     */
    <T> T getClean(Class<T> entityType, long id);

    /**
     * Snapshot all data from the repository.
     *
     * @return
     */
    RepositoryData getData();

    Map<Long, Object> getEntities(Class<?> entityType);

    Map<Long, Object> getEntitiesClean(Class<?> entityType);

    /**
     * All entity types registered in that repository.
     *
     * @return
     */
    Set<Class<?>> getEntityTypes();

}


text:
create index ZSTG_PIDTITY_TYPE_lwr on ZSTG_PID_PHYSICALENTITY(lower(TYPE)) PARALLEL NOLOGGING tablespace CABIO_MAP_FUT;

--EXIT;


text:
namespace base {
class DictionaryValue;
}

namespace net {
class URLFetcher;
}

namespace history {

// Provides an API for querying Google servers for a signed-in user's
// synced history visits. It is roughly analogous to HistoryService, and
// supports a similar API.
class WebHistoryService : public ProfileKeyedService {
 public:
  // Handles all the work of making an API request. This class encapsulates
  // the entire state of the request. When an instance is destroyed, all
  // aspects of the request are cancelled.
  class Request {
   public:
    virtual ~Request();

   protected:
    Request();
  };

  // Callback with the result of a call to QueryHistory(). Currently, the
  // DictionaryValue is just the parsed JSON response from the server.
  // TODO(dubroy): Extract the DictionaryValue into a structured results object.
  typedef base::Callback<void(Request*, const base::DictionaryValue*)>
      QueryWebHistoryCallback;

  typedef base::Callback<void(Request*, bool success)>
      ExpireWebHistoryCallback;

  explicit WebHistoryService(Profile* profile);
  virtual ~WebHistoryService();

  // Searches synced history for visits matching |text_query|. The timeframe to
  // search, along with other options, is specified in |options|. If
  // |text_query| is empty, all visits in the timeframe will be returned.
  // This method is the equivalent of HistoryService::QueryHistory.
  // The caller takes ownership of the returned Request. If it is destroyed, the
  // request is cancelled.
  scoped_ptr<Request> QueryHistory(
      const string16& text_query,
      const QueryOptions& options,
      const QueryWebHistoryCallback& callback);

  // Deletes all visits to the given set of URLs between |begin_time| and
  // |end_time|.
  scoped_ptr<Request> ExpireHistoryBetween(
      const std::set<GURL>& restrict_urls,
      base::Time begin_time,
      base::Time end_time,
      const ExpireWebHistoryCallback& callback);

 private:
  Profile* profile_;

  DISALLOW_COPY_AND_ASSIGN(WebHistoryService);
};

}  // namespace history

#endif  // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_


text:
#ifndef PARSER_H
#define PARSER_H

#include "tree.h"

#if defined __cplusplus
extern "C" {
#endif

/* Syntax for specifying a fanout tree.
   The input consists of a single tree specification.
   White-space (blank, tab, newline) has no semantic meaning and may be used
   in any quantity to enhance the readability. The same holds for comments
   that start with the hash character '#' and extend to the end of the line.

        Input         : Tree .
        Tree          : Leaf
                      | "(" Id Wire_Length Tree Tree ")" .
        Leaf          : "<" Id Wire_Length Required_Time Load ">" .
        Wired_Length  : Float_Number .
        Required_Time : Float_Number .
        Load          : Float_Number .
        Id            : Identifier .

   Note: Float_Numbers are C language floating point numbers; Identifier
         denotes any text starting with a non-blank character till the next
	 blank character or end-of-file.
*/

/* Reads a fanout tree from stdin and constructs a tree data structure
   using the functions and macros defined in the file `tree.h'.
   The accepted input format is defined above.
   Aborts (with exit(1)) whenever a syntax error occurs.

   The top-level production rule is:

        Input : Tree .
*/
Tree parse(void);

#ifdef __cplusplus
}
#endif

#endif /* PARSER_H */


text:
<?php
//Définition des variable de travail
$adresse = substr($_SERVER["HTTP_REFERER"], 0, strpos($_SERVER["HTTP_REFERER"], '//')).'//'.$_SERVER["SERVER_NAME"].substr($_SERVER["PHP_SELF"], 0, strpos($_SERVER["PHP_SELF"], 'app/vendor'));
$lesProj = array();
$prefixe = "";
while (!file_exists($prefixe."config.app.php")) {
	$prefixe .= "../";
}
$Config = require $prefixe."config.app.php";

//Vérification de sécurité vraiment minimale
if ($Config['database']['driver'] == 'mysql') {
	//Connexion à la base de données
	$db = mysqli_connect($Config['database']['host'],$Config['database']['username'],$Config['database']['password'],$Config['database']['database']);

	//Fonction de traitement des informations en base de données
	////Récupération du contenu des champs d'une sélection
	function Fetche ($resultat) {
		return mysqli_fetch_assoc ($resultat);
	}
	////Récupération du nombre de résultats obtenus
	function Nombre ($base) {
		return mysqli_num_rows($base);
	}
	////Obtention des résultats cherchés.
	function Requis($requete, $db) {
		$result = mysqli_query ($db, $requete);
		return $result;
	}
}
?>


text:
using NLog.Config;

namespace NLog.UnitTests.Config
{
    using System;
    using Time;
    using Xunit;

    public class TimeConfigurationTests : NLogTestBase, IDisposable
    {
        public void Dispose()
        {
            TimeSource.Current = new FastLocalTimeSource();
        }

        [Fact]
        public void DefaultTimeSourceTest()
        {
            Assert.IsType<FastLocalTimeSource>(TimeSource.Current);
            XmlLoggingConfiguration.CreateFromXmlString("<nlog />");
            Assert.IsType<FastLocalTimeSource>(TimeSource.Current);
        }

        [Fact]
        public void AccurateLocalTest()
        {
            TestTimeSourceConfiguration<AccurateLocalTimeSource>("AccurateLocal");
        }

        [Fact]
        public void AccurateUtcTest()
        {
            TestTimeSourceConfiguration<AccurateUtcTimeSource>("AccurateUTC");
        }

        [Fact]
        public void FastLocalTest()
        {
            TestTimeSourceConfiguration<FastLocalTimeSource>("FastLocal");
        }

        [Fact]
        public void FastUtcTest()
        {
            TestTimeSourceConfiguration<FastUtcTimeSource>("FastUTC");
        }

        void TestTimeSourceConfiguration<T>(string type)
            where T : TimeSource
        {
            Assert.IsType<FastLocalTimeSource>(TimeSource.Current);
            XmlLoggingConfiguration.CreateFromXmlString(@"
                <nlog>
                    <time type='" + type + @"' />
                </nlog>");
            Assert.IsType<T>(TimeSource.Current);
        }
    }
}


text:
package com.checkout.api.services.token.request;

public class VisaCheckoutTokenCreate {
	public String callId;
	public boolean includeBinData;
}


text:
# CPAlertViewController

A way to create a custom alert view with animation. Easy custom any other alert view based on CPAlertVC.swift and xib.

# Usage

- Default alert

```swift

let alertVC = CPAlertVC(title: "Normal Alert", message: "Normal alert will have only one button.")
alertVC.show(into: self)

```
- Alert with action

```swift

let alertVC = CPAlertVC(title: "Action Alert", message: "You can add your action to two buttons below. By default: Cancel button will dismiss alert.")

alertVC.addAction(CPAlertAction(title: "OK", type: .normal, handler: {
    print("Tapped OK button")
}))

alertVC.addAction(CPAlertAction(title: "CANCEL", type: .cancel, handler: {
    print("Tapped Cancel button")
}))

alertVC.show(into: self)

```
- Alert with other animation

```swift

/** Animation Type

  .scale
  .rotate
  .bounceUp
  .bounceDown

  Just added animationType in config() function

*/

let alertVC = CPAlertVC(title: "Rotate Animation", message: "Rotate ~90 degrees = 1.5 rad (1 rad = 57 degrees), you can change it in CPAlertVC.swift.", animationType: .rotate)
alertVC.show(into: self)

```

```swift

/** Customize style
     ________________________________
    |                    |           |
    | Properties         |  Default  |
    |____________________|___________|
    |                    |           |
    | backgroundOpacity  |    0.5    |
    | backgroundColor    |    black  |
    | animateDuration    |    0.5    |
    |                    |           |
    | scaleX             |    0.3    |
    | scaleY             |    1.5    |
    |                    |           |
    | rotateRadian       |    1.5    |
    | springWithDamping  |    0.7    |
    | delay              |    0      |
     --------------------------------
*/

let alertVC = CPAlertVC(title: "Bounce Up Animation", message: "Animating alert from bottom view to top view", animationType: .bounceUp)
alertVC.springWithDamping = 0.75
alertVC.animateDuration = 0.5
alertVC.show(into: self)

```

# Contact

- ctphong94@gmail.com

# License

`CPAlertViewController` is available under the MIT license. See the LICENSE file for more info.


text:
(function ($) {

    function raiseEvents(arr, eventArgs, setValue) {
        var triggerEvents = !!eventArgs;
        if (triggerEvents) {
            var ret,
            event = $.Event("arrayChanging");
            $.event.trigger(event, [eventArgs], arr);
            if (!event.isDefaultPrevented()) {
                ret = setValue();
                $.event.trigger("arrayChange", [eventArgs], arr);
            }
            return ret;
        } else {
            return setValue();
        }
    }

    $.each("pop push reverse shift sort splice unshift".split(" "), function (i, name) {
        $[name] = function (arr) {
            var args = $.makeArray(arguments);
            args.splice(0, 1);
            return raiseEvents(arr, createEventArguments(name, arr, args), function () {
                arr[name].apply(arr, args);
            });
        }
    });

    var eventArgCreators = {
        pop: function (arr, args) {
            if (arr.length > 0) {
                return { change: "remove", oldIndex: arr.length - 1, oldItems: [ arr[arr.length - 1] ] };
            }
        },
        push: function (arr, args) {
            return { change: "add", newIndex: arr.length, newItems: [ args[0] ] };
        },
        reverse: function (arr, args) {
            if (arr.length > 0) {
                return { change: "reset" };
            }
        },
        shift: function (arr, args) {
            if (arr.length > 0) {
                return { change: "remove", oldIndex: 0, oldItems: [ arr[0] ] };
            }
        },
        sort: function (arr, args) {
            if (arr.length > 0) {
                return { change: "reset" };
            }
        },
        splice: function (arr, args) {
            var index = args[0];
            var numToRemove = args[1];
            var elementsToAdd = args.slice(2);
            if (numToRemove <= 0) {
                if (elementsToAdd.length > 0) {
                    return { change: "add", newIndex: index, newItems: elementsToAdd };
                }
            } else {
                var elementsToRemove = arr.slice(index, index + numToRemove);
                if (elementsToAdd.length > 0) {
                    var move = elementsToAdd.length === elementsToRemove.length &&
                        $.grep(elementsToAdd, function (elementToAdd, index) {
                            return elementToAdd !== elementsToRemove[index];
                        }).length === 0;
                    if (move) {
                        return { change: "move", oldIndex: index, oldItems: elementsToRemove, newIndex: index, newItems: elementsToAdd };
                    } else {
                        return { change: "replace", oldIndex: index, oldItems: elementsToRemove, newIndex: index, newItems: elementsToAdd };
                    }
                } else {
                    return { change: "remove", oldIndex: index, oldItems: elementsToRemove };
                }
            }
        },
        unshift: function (arr, args) {
            return { change: "add", newIndex: 0, newItems: [ args[0] ] };
        },
        move: function (arr, args) {
            var numToMove = arguments[1];
            if (numToMove > 0) {
                var fromIndex = arguments[0];
                var toIndex = arguments[2];
                var elementsToMove = arr.splice(fromIndex, numToMove);
                return { change: "move", oldIndex: fromIndex, oldItems: elementsToMove, newIndex: toIndex, newItems: elementsToMove };
            }
        }
    };

    function createEventArguments (operation, arr, args) {
        return eventArgCreators[operation](arr, args);
    }

    $.move = function (arr) {
        var args = $.makeArray(arguments);
        args.splice(0, 1);
        return raiseEvents(arr, createEventArguments("move", arr, args), function () {
            var fromIndex = args[0];
            var numToMove = args[1];
            var toIndex = args[2];
            var removed = arr.splice(fromIndex, numToMove);
            arr.splice(toIndex, 0, removed);
        });
    };

    var special = $.event.special;

    $.fn.triggerHandler = function( type, data ) {
        if ( this[0] ) {
            var event = jQuery.Event( type );
            if (this.nodeType) {
                // TODO -- I want default processing for data/setField in order to defer
                // event handling in our DataSources.
                event.preventDefault();
            }
            event.stopPropagation();
            jQuery.event.trigger( event, data, this[0] );
            return event.result;
        }
    };

    special.changeData = {
        _default: function (event) {
            var events = ((this.__events__ || {}).events || {}).changeData;
            if (events) {
                var eventsToCallback = events.slice();
                // slice() since handlers might be unbound during callbacks below.
                $.each(eventsToCallback, function (index, handler) {
                    if ($.inArray(handler, events) >= 0 && handler.data && handler.data.eventDefault) {
                        handler.data.eventDefault(event);
                    }
                });
            }
            return false;
        }
    };

    $.each("arrayChanging arrayChange".split(' '), function (i, name) {
        $.fn[name] = function (filter, fn) {
            if (arguments.length === 1) {
                fn = filter;
                filter = null;
            }
            return fn ? this.bind(name, filter, fn) : this.trigger(name);
        }

        special[name] = {
            setup: function () {
                this.__events__.events[name].push = function () {
                    Array.prototype.push.apply(this, arguments);
                    this.sort(function (handler) {
                        return handler.data && handler.data.first ? 1 : 0;
                    });
                }
                return false;
            },
            _default: function (event) {
                var events = ((this.__events__ || {}).events || {})[name];
                if (events) {
                    var eventsToCallback = events.slice();
                    // slice() since handlers might be unbound during callbacks below.
                    $.each(eventsToCallback, function (index, handler) {
                        if ($.inArray(handler, events) >= 0 && handler.data && handler.data.eventDefault) {
                            handler.data.eventDefault(event);
                        }
                    });
                }
                return false;
            }
        }
    });

})(jQuery);


text:
package org.apache.activemq.artemis.spi.core.security;

import javax.security.cert.X509Certificate;
import java.util.Set;

import org.apache.activemq.artemis.core.security.CheckType;
import org.apache.activemq.artemis.core.security.Role;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;

/**
 * Used to validate whether a user is authorized to connect to the
 * server and perform certain functions on certain destinations.
 *
 * This is an evolution of {@link ActiveMQSecurityManager} that adds
 * the ability to perform authorization taking the destination address
 * into account.
 */
public interface ActiveMQSecurityManager2 extends ActiveMQSecurityManager {

   /**
    * is this a valid user.
    *
    * This method is called instead of
    * {@link ActiveMQSecurityManager#validateUser(String, String)}.
    *
    * @param user     the user
    * @param password the users password
    * @return true if a valid user
    */
   boolean validateUser(String user, String password, X509Certificate[] certificates);

   /**
    * Determine whether the given user is valid and whether they have
    * the correct role for the given destination address.
    *
    * This method is called instead of
    * {@link ActiveMQSecurityManager#validateUserAndRole(String, String, Set, CheckType)}.
    *
    * @param user      the user
    * @param password  the user's password
    * @param roles     the user's roles
    * @param checkType which permission to validate
    * @param address   the address for which to perform authorization
    * @param connection   the user's connection
    * @return true if the user is valid and they have the correct roles for the given destination address
    */
   boolean validateUserAndRole(String user, String password, Set<Role> roles, CheckType checkType, String address, RemotingConnection connection);
}


text:
define("dojox/charting/Chart2D", ["dojo/_base/kernel", "dojox", "./Chart",
	"./axis2d/Default", "./axis2d/Invisible", "./plot2d/Default", "./plot2d/Lines", "./plot2d/Areas",
	"./plot2d/Markers", "./plot2d/MarkersOnly", "./plot2d/Scatter", "./plot2d/Stacked", "./plot2d/StackedLines",
	"./plot2d/StackedAreas", "./plot2d/Columns", "./plot2d/StackedColumns", "./plot2d/ClusteredColumns",
	"./plot2d/Bars", "./plot2d/StackedBars", "./plot2d/ClusteredBars", "./plot2d/Grid", "./plot2d/Pie",
	"./plot2d/Bubble", "./plot2d/Candlesticks", "./plot2d/OHLC", "./plot2d/Spider"],
	  function(dojo, dojox, Chart){
	dojo.deprecated("dojox.charting.Chart2D", "Use dojo.charting.Chart instead and require all other components explicitly", "2.0");
	// module:
	//		dojox/charting/Chart2D
	// summary:
	//		This is a compatibility module which loads all charting modules that used to be automatically
	//		loaded in versions prior to 1.6.  It is highly recommended for performance reasons that
	//		this module no longer be referenced by applications.  Instead, use dojox/charting/Chart.
	return dojox.charting.Chart2D = Chart;
});


text:
package com.alibaba.dubbo.rpc.protocol.dubbo;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.bytecode.Wrapper;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.alibaba.dubbo.common.utils.ConcurrentHashSet;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.dubbo.remoting.Channel;
import com.alibaba.dubbo.remoting.RemotingException;
import com.alibaba.dubbo.rpc.Exporter;
import com.alibaba.dubbo.rpc.Invocation;
import com.alibaba.dubbo.rpc.Invoker;
import com.alibaba.dubbo.rpc.ProxyFactory;
import com.alibaba.dubbo.rpc.RpcInvocation;

/**
 * callback 服务帮助类.
 * @author chao.liuc
 *
 */
class CallbackServiceCodec {
    private static final Logger     logger             = LoggerFactory.getLogger(CallbackServiceCodec.class);

    private static final ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
    private static final DubboProtocol protocol = DubboProtocol.getDubboProtocol();
    private static final byte CALLBACK_NONE = 0x0;
    private static final byte CALLBACK_CREATE = 0x1;
    private static final byte CALLBACK_DESTROY = 0x2;
    private static final String INV_ATT_CALLBACK_KEY  = "sys_callback_arg-";
    /**
     * 判断是否有某个方法某个参数的回调方法
     * @param url
     * @param methodName
     * @param argIndex
     * @return
     */
    private static byte isCallBack(URL url, String methodName ,int argIndex){
        //参数callback的规则是 方法名称.参数index(0开始).callback
        byte isCallback = CALLBACK_NONE;
        if (url != null ) {
            String callback = url.getParameter(methodName+"."+argIndex+".callback");
            if(callback !=  null) {
                if (callback.equalsIgnoreCase("true")) {
                    isCallback = CALLBACK_CREATE;
                }else if(callback.equalsIgnoreCase("false")){
                    isCallback = CALLBACK_DESTROY;
                }
            }
        }
        return isCallback;
    }

    /**
     * client 端export callback service
     * @param channel
     * @param clazz
     * @param inst
     * @param export
     * @param out
     * @throws IOException
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    private static String exportOrunexportCallbackService(Channel channel, URL url, Class clazz, Object inst, Boolean export) throws IOException{
        int instid = System.identityHashCode(inst);//内存地址生成的hasecode

        Map<String,String> params = new HashMap<String,String>(3);
        //不需要在重新new client
        params.put(Constants.IS_SERVER_KEY, Boolean.FALSE.toString());
        //标识callback 变于排查问题
        params.put(Constants.IS_CALLBACK_SERVICE, Boolean.TRUE.toString());
        String group = url.getParameter(Constants.GROUP_KEY);
        if (group != null && group.length() > 0){
            params.put(Constants.GROUP_KEY,group);
        }
        //增加方法,变于方法检查,自动降级(见dubbo protocol)
        params.put(Constants.METHODS_KEY, StringUtils.join(Wrapper.getWrapper(clazz).getDeclaredMethodNames(), ","));

        Map<String, String> tmpmap = new HashMap<String, String>(url.getParameters());
        tmpmap.putAll(params);
        tmpmap.remove(Constants.VERSION_KEY);//callback不需要区分version
        tmpmap.put(Constants.INTERFACE_KEY, clazz.getName());
        URL exporturl = new URL(DubboProtocol.NAME, channel.getLocalAddress().getAddress().getHostAddress(), channel.getLocalAddress().getPort(), clazz.getName()+"."+instid, tmpmap);

        //同一个jvm不需要对不同的channel产生多个exporter cache key不会碰撞
        String cacheKey = getClientSideCallbackServiceCacheKey(instid);
        String countkey = getClientSideCountKey(clazz.getName());
        if(export){//正常回调
            //同一个channel 可以有多个callback instance. 不同的instance不重新export
            if( ! channel.hasAttribute(cacheKey)){
                if (!isInstancesOverLimit(channel, url, clazz.getName(), instid, false)) {
                    Invoker<?> invoker = proxyFactory.getInvoker(inst, clazz, exporturl);
                    //资源销毁?
                    Exporter<?> exporter = protocol.export(invoker);
                    //这个用来记录instid是否发布过服务
                    channel.setAttribute(cacheKey, exporter);
                    logger.info("export a callback service :"+exporturl +", on "+channel + ", url is: " + url);
                    increaseInstanceCount(channel, countkey);
                }
            }
        }else {//失效的回调
            if(channel.hasAttribute(cacheKey)){
                Exporter<?> exporter = (Exporter<?>) channel.getAttribute(cacheKey);
                exporter.unexport();
                channel.removeAttribute(cacheKey);
                decreaseInstanceCount(channel, countkey);
            }
        }
        return String.valueOf(instid);
    }

    /**
     * server端 应用一个callbackservice
     * @param url
     */
    @SuppressWarnings("unchecked")
    private static Object referOrdestroyCallbackService(Channel channel, URL url, Class<?> clazz ,Invocation inv ,int instid, boolean isRefer){
        Object proxy = null;
        String invokerCacheKey = getServerSideCallbackInvokerCacheKey(channel, clazz.getName(), instid);
        String proxyCacheKey = getServerSideCallbackServiceCacheKey(channel, clazz.getName(), instid);
        proxy = channel.getAttribute(proxyCacheKey) ;
        String countkey = getServerSideCountKey(channel, clazz.getName());
        if (isRefer){
            if( proxy == null ){
            	URL referurl = URL.valueOf("callback://" + url.getAddress() + "/" + clazz.getName() + "?" + Constants.INTERFACE_KEY + "=" + clazz.getName());
            	referurl = referurl.addParametersIfAbsent(url.getParameters()).removeParameter(Constants.METHODS_KEY);
            	if (!isInstancesOverLimit(channel, referurl, clazz.getName(), instid, true)){
                    @SuppressWarnings("rawtypes")
                    Invoker<?> invoker = new ChannelWrappedInvoker(clazz, channel, referurl, String.valueOf(instid));
                    proxy = proxyFactory.getProxy(invoker);
                    channel.setAttribute(proxyCacheKey, proxy);
                    channel.setAttribute(invokerCacheKey, invoker);
                    increaseInstanceCount(channel, countkey);

                    //convert error fail fast .
                    //ignore concurrent problem.
                    Set<Invoker<?>> callbackInvokers = (Set<Invoker<?>>)channel.getAttribute(Constants.CHANNEL_CALLBACK_KEY);
                    if (callbackInvokers == null){
                        callbackInvokers = new ConcurrentHashSet<Invoker<?>>(1);
                        callbackInvokers.add(invoker);
                        channel.setAttribute(Constants.CHANNEL_CALLBACK_KEY, callbackInvokers);
                    }
                    logger.info ("method "+inv.getMethodName()+" include a callback service :"+invoker.getUrl() +", a proxy :"+invoker +" has been created.") ;
                }
            }
        } else {
            if(proxy != null){
                Invoker<?> invoker = (Invoker<?>)channel.getAttribute(invokerCacheKey);
                try{
                    Set<Invoker<?>> callbackInvokers = (Set<Invoker<?>>)channel.getAttribute(Constants.CHANNEL_CALLBACK_KEY);
                    if (callbackInvokers != null ) {
                        callbackInvokers.remove(invoker);
                    }
                    invoker.destroy();
                }catch (Exception e) {
                    logger.error(e.getMessage(), e);
                }
                //取消refer 直接在map中去除,
                channel.removeAttribute(proxyCacheKey);
                channel.removeAttribute(invokerCacheKey);
                decreaseInstanceCount(channel,countkey);
            }
        }
        return proxy;
    }

    private static String getClientSideCallbackServiceCacheKey(int instid){
        return Constants.CALLBACK_SERVICE_KEY+"."+instid;
    }
    private static String getServerSideCallbackServiceCacheKey(Channel channel, String interfaceClass, int instid){
        return Constants.CALLBACK_SERVICE_PROXY_KEY+"."+System.identityHashCode(channel)+"."+ interfaceClass +"."+instid;
    }
    private static String getServerSideCallbackInvokerCacheKey(Channel channel, String interfaceClass, int instid){
        return getServerSideCallbackServiceCacheKey(channel, interfaceClass, instid) + "." + "invoker";
    }

    private static String getClientSideCountKey(String interfaceClass){
        return Constants.CALLBACK_SERVICE_KEY+"."+interfaceClass+".COUNT";
    }
    private static String getServerSideCountKey(Channel channel, String interfaceClass){
        return Constants.CALLBACK_SERVICE_PROXY_KEY+"."+System.identityHashCode(channel)+"."+interfaceClass+".COUNT";
    }
    private static boolean isInstancesOverLimit(Channel channel, URL url ,String interfaceClass, int instid, boolean isServer){
        Integer count = (Integer)channel.getAttribute(isServer ? getServerSideCountKey(channel,interfaceClass) : getClientSideCountKey(interfaceClass));
        int limit = url.getParameter(Constants.CALLBACK_INSTANCES_LIMIT_KEY, Constants.DEFAULT_CALLBACK_INSTANCES);
        if (count != null && count >= limit){
            //client side error
            throw new IllegalStateException("interface " + interfaceClass +" `s callback instances num exceed providers limit :"+ limit
                    +" ,current num: "+(count+1)+". The new callback service will not work !!! you can cancle the callback service which exported before. channel :"+ channel);
        }else {
            return false;
        }
    }
    /**
     * 实例计数加1
     * @param channel
     * @param countkey
     */
    private static void increaseInstanceCount(Channel channel, String countkey){
        try{
            //ignore cuncurrent problem?
            Integer count = (Integer)channel.getAttribute(countkey);
            if (count == null ){
                count = 1;
            }else {
                count ++ ;
            }
            channel.setAttribute(countkey, count);
        }catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
    /**
     * 实例技术减1
     * @param channel
     * @param countkey
     */
    private static void decreaseInstanceCount(Channel channel, String countkey){
        try{
            Integer count = (Integer)channel.getAttribute(countkey);
            if (count == null || count <= 0){
                return;
            }else {
                count -- ;
            }
            channel.setAttribute(countkey, count);
        }catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
    /**
     *
     * @param channel
     * @param inv
     * @param paraIndex 方法参数的位置
     * @return
     * @throws IOException
     */
    public static Object encodeInvocationArgument(Channel channel, RpcInvocation inv, int paraIndex) throws IOException{
        //encode时可直接获取url
        URL url = inv.getInvoker() == null ? null : inv.getInvoker().getUrl();
        byte callbackstatus = isCallBack(url, inv.getMethodName(), paraIndex);
        Object[] args = inv.getArguments();
        Class<?>[] pts = inv.getParameterTypes();
        switch (callbackstatus) {
            case CallbackServiceCodec.CALLBACK_NONE:
                return args[paraIndex];
            case CallbackServiceCodec.CALLBACK_CREATE:
                inv.setAttachment(INV_ATT_CALLBACK_KEY + paraIndex , exportOrunexportCallbackService(channel, url, pts[paraIndex], args[paraIndex], true));
                return null;
            case CallbackServiceCodec.CALLBACK_DESTROY:
                inv.setAttachment(INV_ATT_CALLBACK_KEY + paraIndex, exportOrunexportCallbackService(channel, url, pts[paraIndex], args[paraIndex], false));
                return null;
            default:
                return args[paraIndex];
        }
    }
    public static Object decodeInvocationArgument(Channel channel, RpcInvocation inv, Class<?>[] pts, int paraIndex, Object inObject) throws IOException{
        //如果是callback,则创建proxy到客户端,方法的执行可通过channel调用到client端的callback接口
        //decode时需要根据channel及env获取url
        URL url = null ;
        try {
            url = DubboProtocol.getDubboProtocol().getInvoker(channel, inv).getUrl();
        } catch (RemotingException e) {
            if (logger.isInfoEnabled()) {
                logger.info(e.getMessage(), e);
            }
            return inObject;
        }
        byte callbackstatus = isCallBack(url, inv.getMethodName(), paraIndex);
        switch (callbackstatus) {
            case CallbackServiceCodec.CALLBACK_NONE:
                return inObject;
            case CallbackServiceCodec.CALLBACK_CREATE:
                try{
                    return referOrdestroyCallbackService(channel, url, pts[paraIndex], inv, Integer.parseInt(inv.getAttachment(INV_ATT_CALLBACK_KEY + paraIndex)), true);
                }catch (Exception e) {
                    logger.error(e.getMessage(), e);
                    throw new IOException(StringUtils.toString(e));
                }
            case CallbackServiceCodec.CALLBACK_DESTROY:
                try{
                    return referOrdestroyCallbackService(channel, url, pts[paraIndex], inv, Integer.parseInt(inv.getAttachment(INV_ATT_CALLBACK_KEY + paraIndex)), false);
                }catch (Exception e) {
                    throw new IOException(StringUtils.toString(e));
                }
            default:
                return inObject ;
        }
    }
}


text:
/*
 * hash.h - simple in-memory hashing routines
 *
 * 11/04/02 (seiwald) - const-ing for string literals
 */

typedef struct hashdata HASHDATA;

struct hash *	hashinit( int datalen, const char *name );
int 		hashitem( struct hash *hp, HASHDATA **data, int enter );
void 		hashdone( struct hash *hp );

# define	hashenter( hp, data ) !hashitem( hp, data, !0 )
# define	hashcheck( hp, data ) hashitem( hp, data, 0 )


text:
var conf = require('../conf')

module.exports = function () {
  return `Usage: ${conf.name} start-daemon

  Start the seeder daemon process that will be managed by PM2. If you would like to view the
  daemon's logs, first install PM2 globally, then use its CLI tool to tail the logs:
  1) \`npm install pm2 -g\`
  2) \`pm2 logs ${conf.name}\`

  `
}


text:
% SVM classify
function pre_label = svm_pre(svm_model,test_data)

assert(size(test_data,2)==128);
[pre_label,score] = predict(svm_model,test_data);


text:
drmaa2
======

DRMAA2 Go (#golang) API for job submission, job workflow management, and HPC cluster monitoring.

This Go API is a wrapper around the DRMAA2 C APIs. It is not yet finished. Improvements, bug reports, and pull requests are welcome. DRMAA2 Go API is not yet standardized but a draft (based on this implementation) is available here: http://redmine.ogf.org/projects/drmaav2-go-binding/repository

## Installation

1. Download / Install Univa Grid Engine (see http://www.univa.com)
   Univa Grid Engine is currently the only cluster scheduler which supports
   the DRMAA2 standard. A quick guide to get it installed you can find in
   my blog article:
   http://www.gridengine.eu/index.php/grid-engine-internals/209-installing-a-univa-grid-engine-demo-cluster-with-one-command-2014-07-13

   Note that Univa Grid Engine is commercial.

2. Be sure that you have Grid Engine in your path (i.e. $SGE_ROOT is set)

   You can test this by calling qhost / qstat / .....
   Usually this is done by calling
    source /path/where/grid/engine/is/installed/default/common/settings.sh

   Note that "default" is the CELL directory which can be different to "default".

3. Clone the project with *git* tools in your go source path (github.com/dgruber/drmaa2).

4. Call
    build.sh

## Usage

Please check out a detailed example which exploits the monitoring session and creates a
webserver hosting the cluster status information.

https://github.com/dgruber/drmaa2_web_app

## Documentation

https://godoc.org/github.com/dgruber/drmaa2


text:
class AddDirectToFriendships < ActiveRecord::Migration[5.0]
  def change
    add_column :friendships, :direct_add, :boolean, default: false
  end
end


text:
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*  Monkey HTTP Server
 *  ==================
 *  Copyright 2001-2016 Monkey Software LLC <eduardo@monkey.io>
 *
 *  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.
 */

#include <monkey/mk_core.h>
#include <monkey/mk_net.h>
#include <monkey/mk_scheduler.h>
#include <monkey/mk_plugin.h>
#include <monkey/mk_thread.h>

#include <netinet/tcp.h>
#include <sys/socket.h>

/* Connect to a TCP socket server */
static int mk_net_fd_connect(int fd, char *host, unsigned long port)
{
    int ret;
    struct addrinfo hints;
    struct addrinfo *res;
    char _port[6];

    memset(&hints, 0, sizeof hints);
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;

    snprintf(_port, sizeof(_port), "%lu", port);
    ret = getaddrinfo(host, _port, &hints, &res);
    if (ret != 0) {
        return -1;
    }

    ret = connect(fd, res->ai_addr, res->ai_addrlen);
    freeaddrinfo(res);

    return ret;
}

struct mk_net_connection *mk_net_conn_create(char *addr, int port)
{
    int fd;
    int ret;
    int error = 0;
    socklen_t len = sizeof(error);
    struct mk_sched_worker *sched;
    struct mk_net_connection *conn;

    /* Allocate connection context */
    conn = mk_mem_alloc(sizeof(struct mk_net_connection));
    if (!conn) {
        return NULL;
    }

    /* Create socket */
    fd = mk_socket_create(AF_INET, SOCK_STREAM, 0);
    if (fd == -1) {
        mk_mem_free(conn);
        return NULL;
    }

    /* Make socket async */
    mk_socket_set_nonblocking(fd);
    conn->fd = fd;

    ret = mk_net_fd_connect(conn->fd, addr, port);
    if (ret == -1) {
        if (errno != EINPROGRESS) {
            close(fd);
            mk_mem_free(conn);
            return NULL;
        }

        MK_EVENT_NEW(&conn->event);

        sched = mk_sched_get_thread_conf();
        // FIXME: not including the thread
        //conn->thread = mk_thread_get();
        ret = mk_event_add(sched->loop, conn->fd, MK_EVENT_THREAD,
                           MK_EVENT_WRITE, &conn->event);
        if (ret == -1) {
            close(fd);
            mk_mem_free(conn);
            return NULL;
        }

        /*
         * Return the control to the parent caller, we need to wait for
         * the event loop to get back to us.
         */
        mk_thread_yield(conn->thread);

        /* We got a notification, remove the event registered */
        ret = mk_event_del(sched->loop, &conn->event);

        /* Check the connection status */
        if (conn->event.mask & MK_EVENT_WRITE) {
            ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len);
            if (ret == -1) {
                close(fd);
                mk_mem_free(conn);
                return NULL;
            }

            if (error != 0) {
                /* Connection is broken, not much to do here */
                fprintf(stderr, "Async connection failed %s:%i\n",
                        conn->host, conn->port);
                close(fd);
                mk_mem_free(conn);
                return NULL;
            }
            MK_EVENT_NEW(&conn->event);
            return conn;
        }
        else {
            close(fd);
            mk_mem_free(conn);
            return NULL;
        }
    }

    return NULL;
}

int mk_net_conn_write(struct mk_channel *channel,
                      void *data, size_t len)
{
    int ret = 0;
    int error;
    ssize_t bytes;
    size_t total = 0;
    size_t send;
    socklen_t slen = sizeof(error);
    struct mk_thread *th = pthread_getspecific(mk_thread_key);
    struct mk_sched_worker *sched;

    sched = mk_sched_get_thread_conf();
    if (!sched) {
        return -1;
    }

 retry:
    error = 0;

    if (len - total > 524288) {
        send = 524288;
    }
    else {
        send = (len - total);
    }

    send = len - total;
    bytes = channel->io->write(channel->fd, data + total, send);
    if (bytes == -1) {
        if (errno == EAGAIN) {
            MK_EVENT_NEW(channel->event);
            channel->thread = th;
            ret = mk_event_add(sched->loop,
                               channel->fd,
                               MK_EVENT_THREAD,
                               MK_EVENT_WRITE, channel->event);
            if (ret == -1) {
                /*
                 * If we failed here there no much that we can do, just
                 * let the caller we failed
                 */
                return -1;
            }

            /*
             * Return the control to the parent caller, we need to wait for
             * the event loop to get back to us.
             */
            mk_thread_yield(th);

            /* We got a notification, remove the event registered */
            ret = mk_event_del(sched->loop, channel->event);
            if (ret == -1) {
                return -1;
            }

            /* Check the connection status */
            if (channel->event->mask & MK_EVENT_WRITE) {
                ret = getsockopt(channel->fd, SOL_SOCKET, SO_ERROR, &error, &slen);
                if (ret == -1) {
                    fprintf(stderr, "[io] could not validate socket status");
                    return -1;
                }

                if (error != 0) {
                    return -1;
                }

                MK_EVENT_NEW(channel->event);
                goto retry;
            }
            else {
                return -1;
            }

        }
        else {
            return -1;
        }
    }

    /* Update counters */
    total += bytes;
    if (total < len) {
        channel->thread = th;
        ret = mk_event_add(sched->loop,
                           channel->fd,
                           MK_EVENT_THREAD,
                           MK_EVENT_WRITE, channel->event);
        if (ret == -1) {
            /*
             * If we failed here there no much that we can do, just
             * let the caller we failed
             */
            return -1;
        }

        mk_thread_yield(th);
        goto retry;
    }

    if (channel->event->status & MK_EVENT_REGISTERED) {
        /* We got a notification, remove the event registered */
        ret = mk_event_del(sched->loop, channel->event);
    }

    return total;
}


text:
package executor

import (
	"context"
	"github.com/avast/retry-go"
	"github.com/pkg/errors"
	"time"
)

type RetryableExecuteFunc func() error
type ConditionMet func() bool

type ExecuteAndWaitForCondition struct {
	RetryableExecuteFunc RetryableExecuteFunc
	ConditionMetFunc     ConditionMet
	Tick                 time.Duration
	Timeout              time.Duration
}

func (e ExecuteAndWaitForCondition) Do() error {

	err := retry.Do(func() error {
		return e.RetryableExecuteFunc()
	})

	if err != nil {
		return err
	}
	ctx, cancel := context.WithTimeout(context.Background(), e.Timeout)
	defer cancel()

	ticker := time.NewTicker(e.Tick)

	for {
		select {
		case <-ticker.C:
			{
				res := e.ConditionMetFunc()

				if res {
					ticker.Stop()
					return nil
				}

			}
		case <-ctx.Done():
			{
				ticker.Stop()
				return errors.New("Condition not met")
			}
		}
	}
}


text:
<?php

require_once dirname(__FILE__) . '/../AbstractTest.php';

require_once 'PHP/PMD/Rule/UnusedFormalParameter.php';

/**
 * Test case for the unused formal parameter rule.
 *
 * @category   PHP
 * @package    PHP_PMD
 * @subpackage Rule
 * @author     Manuel Pichler <mapi@phpmd.org>
 * @copyright  2008-2012 Manuel Pichler. All rights reserved.
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       http://phpmd.org
 *
 * @covers PHP_PMD_Rule_UnusedFormalParameter
 * @covers PHP_PMD_Rule_AbstractLocalVariable
 * @group phpmd
 * @group phpmd::rule
 * @group unittest
 */
class PHP_PMD_Rule_UnusedFormalParameterTest extends PHP_PMD_AbstractTest
{
    /**
     * testRuleAppliesToFunctionUnusedFormalParameter
     *
     * @return void
     */
    public function testRuleAppliesToFunctionUnusedFormalParameter()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(1));
        $rule->apply($this->getFunction());
    }

    /**
     * testRuleAppliesToMultipleFunctionUnusedFormalParameter
     *
     * @return void
     */
    public function testRuleAppliesToMultipleFunctionUnusedFormalParameter()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(3));
        $rule->apply($this->getFunction());
    }

    /**
     * testRuleAppliesToMethodUnusedFormalParameter
     *
     * @return void
     */
    public function testRuleAppliesToMethodUnusedFormalParameter()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(1));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleAppliesToMultipleMethodUnusedFormalParameter
     *
     * @return void
     */
    public function testRuleAppliesToMultipleMethodUnusedFormalParameter()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(2));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleAppliesToFormalParameterWhenSimilarStaticMemberIsAccessed
     *
     *
     * class Foo {
     *     public static $bar = null;
     *     public function baz($bar) {
     *         self::$bar = 'fooBar';
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleAppliesToFormalParameterWhenSimilarStaticMemberIsAccessed()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(1));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleNotAppliesToFormalParameterUsedInPropertyCompoundVariable
     *
     *
     * class Foo {
     *     public function baz($bar) {
     *         self::${$bar} = 'fooBar';
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleNotAppliesToFormalParameterUsedInPropertyCompoundVariable()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleNotAppliesToFormalParameterUsedInMethodCompoundVariable
     *
     *
     * class Foo {
     *     public function baz($bar) {
     *         self::${$bar}();
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleNotAppliesToFormalParameterUsedInMethodCompoundVariable()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToAbstractMethodFormalParameter
     *
     * @return void
     */
    public function testRuleDoesNotApplyToAbstractMethodFormalParameter()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToInterfaceMethodFormalParameter
     *
     * @return void
     */
    public function testRuleDoesNotApplyToInterfaceMethodFormalParameter()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToInnerFunctionDeclaration
     *
     * @return void
     */
    public function testRuleDoesNotApplyToInnerFunctionDeclaration()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getFunction());
    }

    /**
     * testRuleDoesNotApplyToFormalParameterUsedInCompoundExpression
     *
     *
     * class Foo {
     *     public static $bar;
     *     public function baz($bar) {
     *         self::${$bar} = 42;
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleDoesNotApplyToFormalParameterUsedInCompoundExpression()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToMethodArgument
     *
     *
     * class Foo {
     *     function bar($baz) {
     *         $this->foo($baz);
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleDoesNotApplyToMethodArgument()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToMethodArgumentUsedAsArrayIndex
     *
     * @return void
     */
    public function testRuleDoesNotApplyToMethodArgumentUsedAsArrayIndex()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToParameterUsedAsArrayIndex
     *
     *
     * class Foo {
     *     function bar($baz) {
     *         self::$values[$baz];
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleDoesNotApplyToParameterUsedAsArrayIndex()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToParameterUsedAsStringIndex
     *
     *
     * class Foo {
     *     function bar($baz) {
     *         self::$string{$baz};
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleDoesNotApplyToParameterUsedAsStringIndex()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToMethodWithFuncGetArgs
     *
     * If func_get_args() is called then all parameters are
     * automatically referenced without needing them to be referenced
     * explicitly
     *
     *
     * class Foo {
     *     function bar($baz) {
     *         print_r(func_get_args());
     *     }
     * }
     *
     *
     * @return void
     */
    public function testRuleDoesNotApplyToMethodWithFuncGetArgs()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToInheritMethod
     *
     * @return void
     * @since 1.2.1
     */
    public function testRuleDoesNotApplyToInheritMethod()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToImplementedAbstractMethod
     *
     * @return void
     * @since 1.2.1
     */
    public function testRuleDoesNotApplyToImplementedAbstractMethod()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToImplementedInterfaceMethod
     *
     * @return void
     * @since 1.2.1
     */
    public function testRuleDoesNotApplyToImplementedInterfaceMethod()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }

    /**
     * testRuleDoesNotApplyToMethodWithInheritdocAnnotation
     */
    public function testRuleDoesNotApplyToMethodWithInheritdocAnnotation()
    {
        $rule = new PHP_PMD_Rule_UnusedFormalParameter();
        $rule->setReport($this->getReportMock(0));
        $rule->apply($this->getMethod());
    }
}


text:
package org.cipango.kaleo.xcap;

public class BasicXcapServletTest extends AbstractXcapServletTest {

	public void testGetXpointer() throws Exception {
		setContent(XPOINTER_PRES_RULES_URI);
		request.setRequestURI(XPOINTER_PRES_RULES_URI);
		request.setupAddParameter("xmlns(cp", "urn:ietf:params:xml:ns:common-policy)");
		doGet();

		assertEquals(200, response.getStatusCode());
		assertEquals(XcapServiceTest.EXPECTED_RESULT, response.getOutputStreamContent());
		assertEquals("application/xcap-el+xml", response.getContentType());

	}

	public void testMulitpleXpointer() throws Exception {
		setContent(MULTIPLE_XPOINTER_URI);
		request.setRequestURI(MULTIPLE_XPOINTER_URI);
		request.setupAddParameter("xmlns(cp", "urn:ietf:params:xml:ns:common-policy) " +
				"xmlns(pp=urn:ietf:params:xml:ns:pres-rules)");
		doGet();

		assertEquals(200, response.getStatusCode());
		assertEquals("application/xcap-el+xml", response.getContentType());

	}

	public void testGetNoPrefix() throws Exception {
		setContent(NO_PREFIX_PRES_RULES_URI);
		request.setRequestURI(NO_PREFIX_PRES_RULES_URI);
		request.setupAddParameter("xmlns(cp", "urn:ietf:params:xml:ns:common-policy)");
		doGet();

		assertEquals(200, response.getStatusCode());
		assertEquals(XcapServiceTest.EXPECTED_RESULT, response.getOutputStreamContent());
		assertEquals("application/xcap-el+xml", response.getContentType());
	}

	public void testGetNotAFile() throws Exception {
		request.setRequestURI("xcap-caps/global");
		doGet();
		assertEquals(404, response.getStatusCode());
	}

	/* FIXME
	public void testGetNamespace() throws Exception {
		request.setRequestURI(XcapServiceTest.GET_NAMESPACE_BINDINGS);
		doGet();

		assertEquals(200, response.getStatusCode());
		assertEquals("<ruleset xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" " +
				"xmlns:cr=\"urn:ietf:params:xml:ns:common-policy\" " +
				"xmlns:pr=\"urn:ietf:params:xml:ns:pres-rules\" " +
				"xmlns=\"urn:ietf:params:xml:ns:pres-rules\"/>",
				response.getOutputStreamContent());
		assertEquals("application/xcap-ns+xml", response.getContentType());
	}
	*/

	public static final String XPOINTER_PRES_RULES_URI =
		"/pres-rules/users/thomas@cipango.org/index/~~/cp:ruleset/cp:rule%5b@id=%22a%22%5d/cp:conditions";

	public static final String MULTIPLE_XPOINTER_URI =
		"/pres-rules/users/thomas@cipango.org/index/~~/cp:ruleset/cp:rule[@id=\"a\"]/cp:actions/pp:sub-handling";

	public static final String NO_PREFIX_PRES_RULES_URI =
		"/pres-rules/users/thomas@cipango.org/index/~~/ruleset/rule%5b@id=%22a%22%5d/conditions";

}


text:
<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class UpdateAddressRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'country_id'    =>  'integer|exists:countries,id',
            'street'        =>  'max:255',
            'zipcode'       =>  'max:255',
            'city'          =>  'max:255',
        ];
    }
}