text:
#ifndef __vtkSlicerAstroSmoothingLogic_h
#define __vtkSlicerAstroSmoothingLogic_h

// Slicer includes
#include "vtkSlicerModuleLogic.h"
class vtkMRMLVolumeNode;
class vtkSlicerAstroVolumeLogic;
// vtk includes
class vtkRenderWindow;
// AstroSmoothings includes
#include "vtkSlicerAstroSmoothingModuleLogicExport.h"
class vtkMRMLAstroSmoothingParametersNode;

/// \class vtkSlicerAstroSmoothingLogic
/// \brief AstroSmoothing module filters a Volume using several techniques.
/// The algorithms are optmized for Astronomical Neutral Hydrogen (HI) data.
///
/// The set of filters are: anisotropic box; anisotropic Gaussian; intensity-driven gradient.
/// These algorithms are available in SlicerAstro as parallelized implementations on both
/// CPU and GPU hardware, offering interactive performance when processing data-cubes
/// of dimensions up to 10^7 voxels and very fast performance (< 3.5 sec)
/// for larger ones (up to 10^8 voxels).

/// The intensity-driven gradient filter, due to its adaptive characteristics,
/// is the optimal choice for HI data. Therefore,
/// it is the default method when the automatic mode has been chosen.
/// This algorithm preserves the detailed structure of the signal with
/// high signal-to-noise ratio (> 3) at the highest resolution, while
/// smoothing only the faint part of the signal (signal-to-noise ratio < 3).
/// For more information regarding the filters and their performance,
/// default parameters, advantages and disadvantages, we refer
/// to 10.1016/j.ascom.2016.09.002.
///
/// \ingroup SlicerAstro_QtModules_AstroSmoothing
class VTK_SLICERASTRO_ASTROSMOOTHING_MODULE_LOGIC_EXPORT vtkSlicerAstroSmoothingLogic
  : public vtkSlicerModuleLogic
{
public:

  static vtkSlicerAstroSmoothingLogic *New();
  vtkTypeMacro(vtkSlicerAstroSmoothingLogic,vtkSlicerModuleLogic);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  /// Set AstroVolume module logic
  void SetAstroVolumeLogic(vtkSlicerAstroVolumeLogic* logic);

  /// Get AstroVolume module logic
  vtkSlicerAstroVolumeLogic* GetAstroVolumeLogic();

  /// Register MRML Node classes to Scene.
  /// Gets called automatically when the MRMLScene is attached to this logic class
  virtual void RegisterNodes() override;

  /// Run smoothing algorithm
  /// \param MRML parameter node
  /// \param vtkRenderWindow to init the GPU algorithm
  /// \return Success flag
  int Apply(vtkMRMLAstroSmoothingParametersNode *pnode, vtkRenderWindow *renderWindow);

protected:
  vtkSlicerAstroSmoothingLogic();
  virtual ~vtkSlicerAstroSmoothingLogic();

  /// Run anisotropic box filter algorithm on CPU
  /// \param MRML parameter node
  /// \return Success flag
  int AnisotropicBoxCPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode);

  /// Run isotropic box filter algorithm on CPU
  /// \param MRML parameter node
  /// \return Success flag
  int IsotropicBoxCPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode);

  /// Run box filter algorithm on GPU
  /// \param MRML parameter node
  /// \param vtkRenderWindow to init the GPU algorithm
  /// \return Success flag
  int BoxGPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode, vtkRenderWindow* renderWindow);

  /// Run anisotropic Gaussian filter algorithm on CPU
  /// \param MRML parameter node
  /// \return Success flag
  int AnisotropicGaussianCPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode);

  /// Run isotropic Gaussian filter algorithm on CPU
  /// \param MRML parameter node
  /// \return Success flag
  int IsotropicGaussianCPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode);

  /// Run Gaussian filter algorithm on GPU
  /// \param MRML parameter node
  /// \param vtkRenderWindow to init the GPU algorithm
  /// \return Success flag
  int GaussianGPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode, vtkRenderWindow* renderWindow);

  /// Run intensity-driven gradient filter algorithm on CPU
  /// \param MRML parameter node
  /// \return Success flag
  int GradientCPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode);

  /// Run intensity-driven gradient filter algorithm on GPU
  /// \param MRML parameter node
  /// \param vtkRenderWindow to init the GPU algorithm
  /// \return Success flag
  int GradientGPUFilter(vtkMRMLAstroSmoothingParametersNode *pnode, vtkRenderWindow* renderWindow);

private:
  vtkSlicerAstroSmoothingLogic(const vtkSlicerAstroSmoothingLogic&); // Not implemented
  void operator=(const vtkSlicerAstroSmoothingLogic&);           // Not implemented

  class vtkInternal;
  vtkInternal* Internal;
};

#endif


text:
# Digito de verficacion DIAN
Este modulo sireve para calcular el digito de verificación de un NIT o RUT de la entidad Tributaria __DIAN__ en __Colombia__.

### Ejemplo Básico
El siguiente ejemplo solo es de uso didáctico. Tomamos como ejemplo un NIT empresarial econtrado al azar. En este caso el de Cocacola FEMSA Colombia.

```javascript

/** ES2015: */
import modulo from 'modulo-11'

/** ES5: */
var modulo = require('modulo-11')

/* modulo.calc => 0 */
modulo.calc(nit) // Obtiene unicamente el digito de verificación

/** modulo.format => '${nit}-0' */
modulo.format(nit) //  '000000000-0' ;
```

Tener en cuenta que las funciones __modulo.calc()__ y __modulo.format()__ adminten tanto numeros enteros como strings.

## TODO
- Crear Pruebas Unitarias.
- Crear builds para browser.
- Publicar en algún cdn.

# Licencia
Copyright 2016 Hansel Morales

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.

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<Document>

	<sentence>

		<value>	Michael James Adams (May 5, 1930 – November 15, 1967) was an American aviator and USAF astronaut.	</value>

		<annotated-sentence>	[[Michael James Adams|Michael_James_Adams]] (May 5, 1930 – [[November|November]] 15, 1967) was an [[American|United_States]] [[aviator|The_Aviator_(1985_film)]] and USAF [[astronaut|Astronaut]].	</annotated-sentence>

		<pattern_crowdsource>	[[Michael James Adams|Michael_James_Adams]] (May 5, 1930 – November 15, 1967) was an [[American|United_States]] aviator and USAF [[astronaut|Astronaut]].	</pattern_crowdsource>

		<tree>
				nn(Adams/NNP-3,Michael/NNP-1)
				nn(Adams/NNP-3,James/NNP-2)
				nsubj(aviator/NN-18,Adams/NNP-3)
				dep(Adams/NNP-3,May/NNP-5)
				num(May/NNP-5,5/CD-6)
				num(May/NNP-5,1930/CD-8)
				dep(May/NNP-5,November/NNP-10)
				num(November/NNP-10,15/CD-11)
				num(November/NNP-10,1967/CD-13)
				cop(aviator/NN-18,was/VBD-15)
				det(aviator/NN-18,an/DT-16)
				amod(aviator/NN-18,American/JJ-17)
				nn(astronaut/NN-21,USAF/NN-20)
				conj_and(aviator/NN-18,astronaut/NN-21)

		</tree>

		<annotations>

			<annotation>
				<surface-form>Michael James Adams</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Michael_James_Adams</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>November</surface-form>
				<RDF-ID>http://dbpedia.org/resource/November</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>American</surface-form>
				<RDF-ID>http://dbpedia.org/resource/United_States</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>aviator</surface-form>
				<RDF-ID>http://dbpedia.org/resource/The_Aviator_(1985_film)</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>astronaut</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Astronaut</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/Michael_James_Adams http://dbpedia.org/ontology/wikiPageRedirects http://dbpedia.org/resource/Michael_J._Adams
			</triple>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/ontology/nationality http://dbpedia.org/resource/United_States
			</triple>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/ontology/Astronaut
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	He was the first American space mission fatality, according to the United States definition.	</value>

		<annotated-sentence>	He was the first [[American|United_States_Navy]] [[space mission|SpaceMission]] fatality, according to the [[United States|United_States]] [[definition|Definition]].	</annotated-sentence>

		<pattern_crowdsource>	He was the first American space mission fatality, according to the [[United States|United_States]] definition.	</pattern_crowdsource>

		<tree>
				nsubj(fatality/NN-8,He/PRP-1)
				cop(fatality/NN-8,was/VBD-2)
				det(fatality/NN-8,the/DT-3)
				amod(fatality/NN-8,first/JJ-4)
				amod(fatality/NN-8,American/JJ-5)
				nn(fatality/NN-8,space/NN-6)
				nn(fatality/NN-8,mission/NN-7)
				prepc_according_to(fatality/NN-8,to/TO-11)
				det(definition/NN-15,the/DT-12)
				nn(definition/NN-15,United/NNP-13)
				nn(definition/NN-15,States/NNPS-14)
				pobj(fatality/NN-8,definition/NN-15)

		</tree>

		<annotations>

			<annotation>
				<surface-form>American</surface-form>
				<RDF-ID>http://dbpedia.org/resource/United_States_Navy</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>space mission</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/SpaceMission</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>United States</surface-form>
				<RDF-ID>http://dbpedia.org/resource/United_States</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>definition</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Definition</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/ontology/nationality http://dbpedia.org/resource/United_States
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	Born in Sacramento, California, James graduated from Sacramento Junior College.	</value>

		<annotated-sentence>	Born in [[Sacramento , California|Sacramento,_California]] James graduated from [[Sacramento|Sacramento,_California]] [[Junior College|Junior_college]].	</annotated-sentence>

		<pattern_crowdsource>	Born in [[Sacramento|Sacramento,_California]], California, James graduated from [[Sacramento|Sacramento,_California]] Junior College.	</pattern_crowdsource>

		<tree>
				partmod(graduated/VBD-8,Born/VBN-1)
				nn(California/NNP-5,Sacramento/NNP-3)
				prep_in(Born/VBN-1,California/NNP-5)
				nsubj(graduated/VBD-8,James/NNP-7)
				nn(College/NNP-12,Sacramento/NNP-10)
				nn(College/NNP-12,Junior/NNP-11)
				prep_from(graduated/VBD-8,College/NNP-12)

		</tree>

		<annotations>

			<annotation>
				<surface-form>Sacramento , California</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Sacramento,_California</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Sacramento</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Sacramento,_California</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Junior College</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Junior_college</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/ontology/birthPlace http://dbpedia.org/resource/Sacramento,_California
			</triple>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/ontology/birthPlace http://dbpedia.org/resource/Sacramento,_California
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	He enlisted in the United States Air Force in 1950 and earned his pilot wings and commission in 1952 at Webb Air Force Base, Texas.	</value>

		<annotated-sentence>	He enlisted in [[the United States Air Force|United_States_Air_Force]] in [[1950|1950_(album)]] and earned his [[pilot wings|Pilot_wings]] and commission in [[1952|1952_(album)]] at [[Webb Air Force Base|Webb_Air_Force_Base]], [[Texas|Texas]].	</annotated-sentence>

		<pattern_crowdsource>	He enlisted in [[the United States Air Force|United_States_Air_Force]] in 1950 and earned his pilot wings and commission in 1952 at Webb Air Force Base, Texas.	</pattern_crowdsource>

		<tree>
				nsubj(enlisted/VBD-2,He/PRP-1)
				nsubj(earned/VBD-12,He/PRP-1)
				det(Force/NNP-8,the/DT-4)
				nn(Force/NNP-8,United/NNP-5)
				nn(Force/NNP-8,States/NNP-6)
				nn(Force/NNP-8,Air/NNP-7)
				prep_in(enlisted/VBD-2,Force/NNP-8)
				prep_in(enlisted/VBD-2,1950/CD-10)
				conj_and(enlisted/VBD-2,earned/VBD-12)
				poss(wings/NNS-15,his/PRP$-13)
				nn(wings/NNS-15,pilot/NN-14)
				dobj(earned/VBD-12,wings/NNS-15)
				dobj(earned/VBD-12,commission/NN-17)
				conj_and(wings/NNS-15,commission/NN-17)
				prep_in(earned/VBD-12,1952/CD-19)
				nn(Base/NNP-24,Webb/NNP-21)
				nn(Base/NNP-24,Air/NNP-22)
				nn(Base/NNP-24,Force/NNP-23)
				prep_at(earned/VBD-12,Base/NNP-24)
				appos(Base/NNP-24,Texas/NNP-26)

		</tree>

		<annotations>

			<annotation>
				<surface-form>the United States Air Force</surface-form>
				<RDF-ID>http://dbpedia.org/resource/United_States_Air_Force</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>1950</surface-form>
				<RDF-ID>http://dbpedia.org/resource/1950_(album)</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>pilot wings</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Pilot_wings</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>1952</surface-form>
				<RDF-ID>http://dbpedia.org/resource/1952_(album)</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Webb Air Force Base</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Webb_Air_Force_Base</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Texas</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Texas</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/property/rank http://dbpedia.org/resource/United_States_Air_Force
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	He served as a fighter-bomber pilot during the Korean War, followed by 30 months with the 813th Fighter-Bomber Squadron at England Air Force Base, Louisiana and six months rotational duty at Chaumont Air Base in France.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				nsubj(served/VBD-2,He/PRP-1)
				det(pilot/NN-6,a/DT-4)
				nn(pilot/NN-6,fighter-bomber/NN-5)
				prep_as(served/VBD-2,pilot/NN-6)
				det(War/NN-10,the/DT-8)
				amod(War/NN-10,Korean/JJ-9)
				prep_during(served/VBD-2,War/NN-10)
				prepc_followed_by(served/VBD-2,by/IN-13)
				num(months/NNS-15,30/CD-14)
				pobj(served/VBD-2,months/NNS-15)
				det(Squadron/NNP-20,the/DT-17)
				amod(Squadron/NNP-20,813th/JJ-18)
				nn(Squadron/NNP-20,Fighter-Bomber/NNP-19)
				prep_with(months/NNS-15,Squadron/NNP-20)
				nn(Base/NNP-25,England/NNP-22)
				nn(Base/NNP-25,Air/NNP-23)
				nn(Base/NNP-25,Force/NNP-24)
				prep_at(Squadron/NNP-20,Base/NNP-25)
				prep_at(Squadron/NNP-20,Louisiana/NNP-27)
				conj_and(Base/NNP-25,Louisiana/NNP-27)
				num(months/NNS-30,six/CD-29)
				tmod(rotational/JJ-31,months/NNS-30)
				amod(duty/NN-32,rotational/JJ-31)
				prep_at(Squadron/NNP-20,duty/NN-32)
				conj_and(Base/NNP-25,duty/NN-32)
				nn(Base/NNP-36,Chaumont/NNP-34)
				nn(Base/NNP-36,Air/NNP-35)
				prep_at(duty/NN-32,Base/NNP-36)
				prep_in(Base/NNP-36,France/NNP-38)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	During his military career he was awarded: Air Medal, Air Force Commendation Medal, Korean Service Medal, United Nations Service Medal, National Defense Service Medal with 1 Bronze Service Star, Air Force Longevity Service Award with 4 clusters, Air Force Good Conduct Medal and Honts Trophy.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				poss(career/NN-4,his/PRP$-2)
				amod(career/NN-4,military/JJ-3)
				prep_during(awarded/VBN-7,career/NN-4)
				nsubjpass(awarded/VBN-7,he/PRP-5)
				auxpass(awarded/VBN-7,was/VBD-6)
				nn(Medal/NN-10,Air/NNP-9)
				dep(Medal/NN-49,Medal/NN-10)
				nn(Medal/NN-15,Air/NNP-12)
				nn(Medal/NN-15,Force/NNP-13)
				nn(Medal/NN-15,Commendation/NNP-14)
				appos(Medal/NN-10,Medal/NN-15)
				nn(Medal/NN-19,Korean/NNP-17)
				nn(Medal/NN-19,Service/NNP-18)
				appos(Medal/NN-10,Medal/NN-19)
				nn(Medal/NN-24,United/NNP-21)
				nn(Medal/NN-24,Nations/NNP-22)
				nn(Medal/NN-24,Service/NNP-23)
				appos(Medal/NN-10,Medal/NN-24)
				nn(Medal/NN-29,National/NNP-26)
				nn(Medal/NN-29,Defense/NNP-27)
				nn(Medal/NN-29,Service/NNP-28)
				appos(Medal/NN-10,Medal/NN-29)
				num(Star/NNP-34,1/CD-31)
				nn(Star/NNP-34,Bronze/NN-32)
				nn(Star/NNP-34,Service/NNP-33)
				prep_with(Medal/NN-29,Star/NNP-34)
				nn(Award/NN-40,Air/NNP-36)
				nn(Award/NN-40,Force/NNP-37)
				nn(Award/NN-40,Longevity/NNP-38)
				nn(Award/NN-40,Service/NNP-39)
				appos(Medal/NN-29,Award/NN-40)
				num(clusters/NNS-43,4/CD-42)
				prep_with(Award/NN-40,clusters/NNS-43)
				nn(Force/NNP-46,Air/NNP-45)
				appos(Medal/NN-10,Force/NNP-46)
				amod(Conduct/NNP-48,Good/JJ-47)
				dep(Medal/NN-49,Conduct/NNP-48)
				dep(Trophy/NN-52,Medal/NN-49)
				conj_and(Medal/NN-49,Honts/NNP-51)
				dep(Trophy/NN-52,Honts/NNP-51)
				dep(awarded/VBN-7,Trophy/NN-52)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	In 1958, Adams received an aeronautical engineering degree from the University of Oklahoma and, after 18 months of astronautics study at Massachusetts Institute of Technology, was selected in 1962 for the Experimental Test Pilot School at Edwards Air Force Base, California.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				prep_in(received/VBD-5,1958/CD-2)
				nsubj(received/VBD-5,Adams/NNP-4)
				nsubjpass(selected/VBN-30,Adams/NNP-4)
				det(degree/NN-9,an/DT-6)
				amod(degree/NN-9,aeronautical/JJ-7)
				nn(degree/NN-9,engineering/NN-8)
				dobj(received/VBD-5,degree/NN-9)
				det(University/NNP-12,the/DT-11)
				prep_from(received/VBD-5,University/NNP-12)
				prep_of(University/NNP-12,Oklahoma/NNP-14)
				dep(received/VBD-5,after/IN-17)
				num(months/NNS-19,18/CD-18)
				pobj(after/IN-17,months/NNS-19)
				nn(study/NN-22,astronautics/NNS-21)
				prep_of(months/NNS-19,study/NN-22)
				nn(Institute/NNP-25,Massachusetts/NNP-24)
				prep_at(study/NN-22,Institute/NNP-25)
				prep_of(Institute/NNP-25,Technology/NNP-27)
				auxpass(selected/VBN-30,was/VBD-29)
				conj_and(received/VBD-5,selected/VBN-30)
				prep_in(selected/VBN-30,1962/CD-32)
				det(School/NN-38,the/DT-34)
				amod(School/NN-38,Experimental/JJ-35)
				nn(School/NN-38,Test/NN-36)
				nn(School/NN-38,Pilot/NN-37)
				prep_for(selected/VBN-30,School/NN-38)
				nn(Base/NNP-43,Edwards/NNP-40)
				nn(Base/NNP-43,Air/NNP-41)
				nn(Base/NNP-43,Force/NNP-42)
				prep_at(School/NN-38,Base/NNP-43)
				appos(Base/NNP-43,California/NNP-45)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	Here, he won the Honts Trophy as the best scholar and pilot in his class.	</value>

		<annotated-sentence>	Here, he won the Honts [[Trophy|Trophy]] as the best scholar and pilot in his class.	</annotated-sentence>

		<pattern_crowdsource>	Here, he won the Honts Trophy as the best scholar and pilot in his class.	</pattern_crowdsource>

		<tree>
				advmod(won/VBD-4,Here/RB-1)
				nsubj(won/VBD-4,he/PRP-3)
				det(Trophy/NN-7,the/DT-5)
				nn(Trophy/NN-7,Honts/NNP-6)
				dobj(won/VBD-4,Trophy/NN-7)
				det(scholar/NN-11,the/DT-9)
				amod(scholar/NN-11,best/JJS-10)
				prep_as(won/VBD-4,scholar/NN-11)
				prep_as(won/VBD-4,pilot/NN-13)
				conj_and(scholar/NN-11,pilot/NN-13)
				poss(class/NN-16,his/PRP$-15)
				prep_in(won/VBD-4,class/NN-16)

		</tree>

		<annotations>

			<annotation>
				<surface-form>Trophy</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Trophy</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	Adams subsequently attended the Aerospace Research Pilot School (ARPS), graduating with honors in December 1963.	</value>

		<annotated-sentence>	Adams subsequently attended [[the Aerospace Research Pilot School|U.S._Air_Force_Test_Pilot_School]] ([[ARPS|Arps]]), graduating with honors in [[December 1963|December_1963]].	</annotated-sentence>

		<pattern_crowdsource>	Adams subsequently attended the Aerospace Research Pilot School (ARPS), graduating with honors in December 1963.	</pattern_crowdsource>

		<tree>
				nsubj(attended/VBD-3,Adams/NNP-1)
				advmod(attended/VBD-3,subsequently/RB-2)
				det(School/NN-8,the/DT-4)
				nn(School/NN-8,Aerospace/NNP-5)
				nn(School/NN-8,Research/NNP-6)
				nn(School/NN-8,Pilot/NN-7)
				dobj(attended/VBD-3,School/NN-8)
				appos(School/NN-8,ARPS/NN-10)
				partmod(attended/VBD-3,graduating/VBG-13)
				prep_with(graduating/VBG-13,honors/NNS-15)
				prep_in(honors/NNS-15,December/NNP-17)
				num(December/NNP-17,1963/CD-18)

		</tree>

		<annotations>

			<annotation>
				<surface-form>the Aerospace Research Pilot School</surface-form>
				<RDF-ID>http://dbpedia.org/resource/U.S._Air_Force_Test_Pilot_School</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>ARPS</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Arps</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>December 1963</surface-form>
				<RDF-ID>http://dbpedia.org/resource/December_1963</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	He was one of four Edwards aerospace research pilots to participate in a five-month series of NASA moon landing practice tests at the Martin Company in Baltimore, Maryland.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				nsubj(one/CD-3,He/PRP-1)
				cop(one/CD-3,was/VBD-2)
				num(pilots/NNS-9,four/CD-5)
				nn(pilots/NNS-9,Edwards/NNP-6)
				nn(pilots/NNS-9,aerospace/NN-7)
				nn(pilots/NNS-9,research/NN-8)
				prep_of(one/CD-3,pilots/NNS-9)
				aux(participate/VB-11,to/TO-10)
				infmod(pilots/NNS-9,participate/VB-11)
				det(series/NN-15,a/DT-13)
				amod(series/NN-15,five-month/JJ-14)
				prep_in(participate/VB-11,series/NN-15)
				nn(tests/NNS-21,NASA/NNP-17)
				nn(tests/NNS-21,moon/NN-18)
				nn(tests/NNS-21,landing/NN-19)
				nn(tests/NNS-21,practice/NN-20)
				prep_of(series/NN-15,tests/NNS-21)
				det(Company/NNP-25,the/DT-23)
				nn(Company/NNP-25,Martin/NNP-24)
				prep_at(participate/VB-11,Company/NNP-25)
				nn(Maryland/NNP-29,Baltimore/NNP-27)
				prep_in(Company/NNP-25,Maryland/NNP-29)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	In November 1965 he was selected to be an astronaut in the United States Air Force Manned Orbiting Laboratory program.	</value>

		<annotated-sentence>	In [[November 1965|1965]] he was selected to be [[an astronaut|Astronaut]] in the [[United States Air Force|United_States_Air_Force]] [[Manned Orbiting Laboratory|Manned_Orbiting_Laboratory]] program.	</annotated-sentence>

		<pattern_crowdsource>	In November 1965 he was selected to be [[an astronaut|Astronaut]] in the [[United States Air Force|United_States_Air_Force]] Manned Orbiting Laboratory program.	</pattern_crowdsource>

		<tree>
				prep_in(selected/VBN-6,November/NNP-2)
				num(November/NNP-2,1965/CD-3)
				nsubjpass(selected/VBN-6,he/PRP-4)
				auxpass(selected/VBN-6,was/VBD-5)
				aux(astronaut/NN-10,to/TO-7)
				cop(astronaut/NN-10,be/VB-8)
				det(astronaut/NN-10,an/DT-9)
				xcomp(selected/VBN-6,astronaut/NN-10)
				det(program/NN-20,the/DT-12)
				nn(program/NN-20,United/NNP-13)
				nn(program/NN-20,States/NNP-14)
				nn(program/NN-20,Air/NNP-15)
				nn(program/NN-20,Force/NNP-16)
				nn(program/NN-20,Manned/NNP-17)
				nn(program/NN-20,Orbiting/NNP-18)
				nn(program/NN-20,Laboratory/NNP-19)
				prep_in(astronaut/NN-10,program/NN-20)

		</tree>

		<annotations>

			<annotation>
				<surface-form>November 1965</surface-form>
				<RDF-ID>http://dbpedia.org/resource/1965</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>an astronaut</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Astronaut</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>United States Air Force</surface-form>
				<RDF-ID>http://dbpedia.org/resource/United_States_Air_Force</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Manned Orbiting Laboratory</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Manned_Orbiting_Laboratory</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/ontology/Astronaut
			</triple>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/property/rank http://dbpedia.org/resource/United_States_Air_Force
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	In July 1966, Major Adams came to the North American X-15 program, a joint USAF/NASA project.	</value>

		<annotated-sentence>	In [[July|July]] [[1966|1966]], [[Major Adams|Wagon_Train]] came to the [[North American X-15|North_American_X-15]] program, a joint USAF/NASA [[project|Project]].	</annotated-sentence>

		<pattern_crowdsource>	In July 1966, Major Adams came to the North American X-15 program, a joint USAF/NASA project.	</pattern_crowdsource>

		<tree>
				prep_in(came/VBD-7,July/NNP-2)
				num(July/NNP-2,1966/CD-3)
				amod(Adams/NNP-6,Major/JJ-5)
				nsubj(came/VBD-7,Adams/NNP-6)
				det(program/NN-13,the/DT-9)
				amod(program/NN-13,North/JJ-10)
				amod(program/NN-13,American/JJ-11)
				nn(program/NN-13,X-15/NN-12)
				prep_to(came/VBD-7,program/NN-13)
				det(project/NN-18,a/DT-15)
				amod(project/NN-18,joint/JJ-16)
				nn(project/NN-18,USAF/NASA/NN-17)
				appos(program/NN-13,project/NN-18)

		</tree>

		<annotations>

			<annotation>
				<surface-form>July</surface-form>
				<RDF-ID>http://dbpedia.org/resource/July</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>1966</surface-form>
				<RDF-ID>http://dbpedia.org/resource/1966</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Major Adams</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Wagon_Train</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>North American X-15</surface-form>
				<RDF-ID>http://dbpedia.org/resource/North_American_X-15</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>project</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Project</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	He made his first X-15 flight on 6 October 1966.	</value>

		<annotated-sentence>	He made his first X-15 flight on 6 October [[1966|1966]].	</annotated-sentence>

		<pattern_crowdsource>	He made his first X-15 flight on 6 October 1966.	</pattern_crowdsource>

		<tree>
				nsubj(made/VBD-2,He/PRP-1)
				poss(flight/NN-6,his/PRP$-3)
				amod(flight/NN-6,first/JJ-4)
				nn(flight/NN-6,X-15/NN-5)
				dobj(made/VBD-2,flight/NN-6)
				prep_on(made/VBD-2,6/CD-8)
				tmod(made/VBD-2,October/NNP-9)
				num(October/NNP-9,1966/CD-10)

		</tree>

		<annotations>

			<annotation>
				<surface-form>1966</surface-form>
				<RDF-ID>http://dbpedia.org/resource/1966</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	Adams' seventh X-15 flight, Flight 3-65-97, took place on 15 November 1967.	</value>

		<annotated-sentence>	Adams' seventh X-15 [[flight|X-15_Flight_3-65-97]], [[Flight 3-65-97|X-15_Flight_3-65-97]], took [[place|Place]] on 15 [[November|November]] [[1967|1967]].	</annotated-sentence>

		<pattern_crowdsource>	Adams' seventh X-15 [[flight|X-15_Flight_3-65-97]], [[Flight 3-65-97|X-15_Flight_3-65-97]], took place on 15 November 1967.	</pattern_crowdsource>

		<tree>
				poss(flight/NN-5,Adams/NNP-1)
				amod(flight/NN-5,seventh/JJ-3)
				nn(flight/NN-5,X-15/NN-4)
				nsubj(took/VBD-10,flight/NN-5)
				appos(flight/NN-5,Flight/NNP-7)
				num(Flight/NNP-7,3-65-97/CD-8)
				dobj(took/VBD-10,place/NN-11)
				prep_on(took/VBD-10,15/CD-13)
				tmod(took/VBD-10,November/NNP-14)
				num(November/NNP-14,1967/CD-15)

		</tree>

		<annotations>

			<annotation>
				<surface-form>flight</surface-form>
				<RDF-ID>http://dbpedia.org/resource/X-15_Flight_3-65-97</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Flight 3-65-97</surface-form>
				<RDF-ID>http://dbpedia.org/resource/X-15_Flight_3-65-97</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>place</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Place</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>November</surface-form>
				<RDF-ID>http://dbpedia.org/resource/November</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>1967</surface-form>
				<RDF-ID>http://dbpedia.org/resource/1967</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/X-15_Flight_3-65-97 http://dbpedia.org/property/crewMembers http://dbpedia.org/resource/Michael_J._Adams
			</triple>

			<triple>
				http://dbpedia.org/resource/X-15_Flight_3-65-97 http://dbpedia.org/property/crewMembers http://dbpedia.org/resource/Michael_J._Adams
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	He reached a peak altitude of 266,000 feet (81 km); the nose of the aircraft was off heading by 15 degrees to the right.	</value>

		<annotated-sentence>	He reached a peak [[altitude|Altitude]] of 266,000 [[feet|Foot]] (81 km); [[the nose|Nose]] of [[the aircraft|Aircraft]] was off heading by 15 degrees to the right.	</annotated-sentence>

		<pattern_crowdsource>	He reached a peak altitude of 266,000 feet (81 km); the nose of the aircraft was off heading by 15 degrees to the right.	</pattern_crowdsource>

		<tree>
				nsubj(reached/VBD-2,He/PRP-1)
				det(altitude/NN-5,a/DT-3)
				amod(altitude/NN-5,peak/JJ-4)
				dobj(reached/VBD-2,altitude/NN-5)
				num(feet/NNS-8,266,000/CD-7)
				prep_of(altitude/NN-5,feet/NNS-8)
				num(km/NN-11,81/CD-10)
				appos(feet/NNS-8,km/NN-11)
				det(nose/NN-15,the/DT-14)
				nsubj(heading/VBG-21,nose/NN-15)
				det(aircraft/NN-18,the/DT-17)
				prep_of(nose/NN-15,aircraft/NN-18)
				aux(heading/VBG-21,was/VBD-19)
				advmod(heading/VBG-21,off/RB-20)
				parataxis(reached/VBD-2,heading/VBG-21)
				num(degrees/NNS-24,15/CD-23)
				prep_by(heading/VBG-21,degrees/NNS-24)
				det(right/NN-27,the/DT-26)
				prep_to(heading/VBG-21,right/NN-27)

		</tree>

		<annotations>

			<annotation>
				<surface-form>altitude</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Altitude</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>feet</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Foot</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>the nose</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Nose</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>the aircraft</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Aircraft</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	While descending, at 230,000 feet (70 km) the aircraft encountered rapidly increasing aerodynamic pressure which impinged on the airframe, causing the X-15 to enter a violent Mach 5 spin.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				mark(descending/VBG-2,While/IN-1)
				advcl(encountered/VBD-13,descending/VBG-2)
				quantmod(230,000/CD-5,at/IN-4)
				num(feet/NNS-6,230,000/CD-5)
				nsubj(encountered/VBD-13,feet/NNS-6)
				num(km/NN-9,70/CD-8)
				dep(encountered/VBD-13,km/NN-9)
				det(aircraft/NN-12,the/DT-11)
				nsubj(encountered/VBD-13,aircraft/NN-12)
				advmod(increasing/VBG-15,rapidly/RB-14)
				xcomp(encountered/VBD-13,increasing/VBG-15)
				amod(pressure/NN-17,aerodynamic/JJ-16)
				dobj(increasing/VBG-15,pressure/NN-17)
				nsubj(impinged/VBD-19,which/WDT-18)
				rcmod(pressure/NN-17,impinged/VBD-19)
				det(airframe/NN-22,the/DT-21)
				prep_on(impinged/VBD-19,airframe/NN-22)
				xcomp(impinged/VBD-19,causing/VBG-24)
				det(X-15/NN-26,the/DT-25)
				dobj(causing/VBG-24,X-15/NN-26)
				aux(enter/VB-28,to/TO-27)
				infmod(X-15/NN-26,enter/VB-28)
				det(spin/NN-33,a/DT-29)
				amod(spin/NN-33,violent/JJ-30)
				nn(spin/NN-33,Mach/NNP-31)
				num(spin/NN-33,5/CD-32)
				dobj(enter/VB-28,spin/NN-33)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	As the X-15 neared 65,000 feet (20 km), it was diving at Mach 3.93 and experiencing more than 15-g vertically (positive and negative), and 8-g laterally, which inevitably exceeded the design limits of the aircraft.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				mark(neared/VBD-4,As/IN-1)
				det(X-15/NN-3,the/DT-2)
				nsubj(neared/VBD-4,X-15/NN-3)
				advcl(diving/NN-14,neared/VBD-4)
				num(feet/NNS-6,65,000/CD-5)
				dobj(neared/VBD-4,feet/NNS-6)
				num(km/NN-9,20/CD-8)
				appos(feet/NNS-6,km/NN-9)
				nsubj(diving/NN-14,it/PRP-12)
				cop(diving/NN-14,was/VBD-13)
				prep(diving/NN-14,at/IN-15)
				pobj(at/IN-15,Mach/NNP-16)
				num(Mach/NNP-16,3.93/CD-17)
				prep(diving/NN-14,experiencing/VBG-19)
				conj_and(at/IN-15,experiencing/VBG-19)
				dep(than/IN-21,more/JJR-20)
				advmod(15-g/JJ-22,than/IN-21)
				acomp(experiencing/VBG-19,15-g/JJ-22)
				advmod(experiencing/VBG-19,vertically/RB-23)
				dep(diving/NN-14,positive/JJ-25)
				dep(diving/NN-14,negative/JJ-27)
				conj_and(positive/JJ-25,negative/JJ-27)
				conj_and(diving/NN-14,8-g/NN-31)
				advmod(8-g/NN-31,laterally/RB-32)
				nsubj(exceeded/VBD-36,which/WDT-34)
				advmod(exceeded/VBD-36,inevitably/RB-35)
				rcmod(8-g/NN-31,exceeded/VBD-36)
				det(limits/NNS-39,the/DT-37)
				nn(limits/NNS-39,design/NN-38)
				dobj(exceeded/VBD-36,limits/NNS-39)
				det(aircraft/NN-42,the/DT-41)
				prep_of(limits/NNS-39,aircraft/NN-42)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	The aircraft broke up 10 minutes and 35 seconds after launch, killing Adams.	</value>

		<annotated-sentence>	The [[aircraft|Aircraft]] broke up [[10 minutes|10_Minutes]] and 35 seconds after launch, killing Adams.	</annotated-sentence>

		<pattern_crowdsource>	The aircraft broke up 10 minutes and 35 seconds after launch, killing Adams.	</pattern_crowdsource>

		<tree>
				det(aircraft/NN-2,The/DT-1)
				nsubj(broke/VBD-3,aircraft/NN-2)
				prt(broke/VBD-3,up/RP-4)
				num(minutes/NNS-6,10/CD-5)
				dobj(broke/VBD-3,minutes/NNS-6)
				num(seconds/NNS-9,35/CD-8)
				dobj(broke/VBD-3,seconds/NNS-9)
				conj_and(minutes/NNS-6,seconds/NNS-9)
				prep_after(broke/VBD-3,launch/NN-11)
				partmod(broke/VBD-3,killing/VBG-13)
				dobj(killing/VBG-13,Adams/NNP-14)

		</tree>

		<annotations>

			<annotation>
				<surface-form>aircraft</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Aircraft</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>10 minutes</surface-form>
				<RDF-ID>http://dbpedia.org/resource/10_Minutes</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	The United States Air Force posthumously awarded him Astronaut Wings for his last flight.	</value>

		<annotated-sentence>	[[The United States Air Force|United_States_Air_Force]] posthumously awarded him [[Astronaut Wings|Astronaut_Badge]] for [[his last flight|Flight]].	</annotated-sentence>

		<pattern_crowdsource>	[[The United States Air Force|United_States_Air_Force]] posthumously awarded him Astronaut Wings for his last flight.	</pattern_crowdsource>

		<tree>
				det(Force/NNP-5,The/DT-1)
				nn(Force/NNP-5,United/NNP-2)
				nn(Force/NNP-5,States/NNP-3)
				nn(Force/NNP-5,Air/NNP-4)
				nsubj(awarded/VBD-7,Force/NNP-5)
				advmod(awarded/VBD-7,posthumously/RB-6)
				iobj(awarded/VBD-7,him/PRP-8)
				nn(Wings/NNP-10,Astronaut/NNP-9)
				dobj(awarded/VBD-7,Wings/NNP-10)
				poss(flight/NN-14,his/PRP$-12)
				amod(flight/NN-14,last/JJ-13)
				prep_for(Wings/NNP-10,flight/NN-14)

		</tree>

		<annotations>

			<annotation>
				<surface-form>The United States Air Force</surface-form>
				<RDF-ID>http://dbpedia.org/resource/United_States_Air_Force</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Astronaut Wings</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Astronaut_Badge</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>his last flight</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Flight</RDF-ID>
			</annotation>

		</annotations>

		<triples>

			<triple>
				http://dbpedia.org/resource/Michael_J._Adams http://dbpedia.org/property/rank http://dbpedia.org/resource/United_States_Air_Force
			</triple>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	An excerpt from NASA's biography page on Mike Adams discusses findings from the crash investigation: In 1991, Adams' name was added to the Space Mirror Memorial at the Kennedy Space Center in Florida.	</value>

		<annotated-sentence>	null	</annotated-sentence>

		<pattern_crowdsource>	null	</pattern_crowdsource>

		<tree>
				det(excerpt/NN-2,An/DT-1)
				nsubj(discusses/VBZ-11,excerpt/NN-2)
				poss(page/NN-7,NASA/NNP-4)
				nn(page/NN-7,biography/NN-6)
				prep_from(excerpt/NN-2,page/NN-7)
				nn(Adams/NNP-10,Mike/NNP-9)
				prep_on(page/NN-7,Adams/NNP-10)
				dobj(discusses/VBZ-11,findings/NNS-12)
				det(investigation/NN-16,the/DT-14)
				nn(investigation/NN-16,crash/NN-15)
				prep_from(discusses/VBZ-11,investigation/NN-16)
				prep_in(added/VBN-25,1991/CD-19)
				poss(name/NN-23,Adams/NNP-21)
				nsubjpass(added/VBN-25,name/NN-23)
				auxpass(added/VBN-25,was/VBD-24)
				parataxis(discusses/VBZ-11,added/VBN-25)
				det(Memorial/NNP-30,the/DT-27)
				nn(Memorial/NNP-30,Space/NN-28)
				nn(Memorial/NNP-30,Mirror/NNP-29)
				prep_to(added/VBN-25,Memorial/NNP-30)
				det(Center/NNP-35,the/DT-32)
				nn(Center/NNP-35,Kennedy/NNP-33)
				nn(Center/NNP-35,Space/NNP-34)
				prep_at(added/VBN-25,Center/NNP-35)
				prep_in(Center/NNP-35,Florida/NNP-37)

		</tree>

		<annotations>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

	<sentence>

		<value>	On June 8, 2004, a memorial monument to Adams was erected near the crash site, northwest of Randsburg, California	</value>

		<annotated-sentence>	On June 8, 2004, a [[memorial|National_Women's_Monument]] [[monument|Monument]] to Adams was erected near the crash site, northwest of [[Randsburg , California|Randsburg,_California]]	</annotated-sentence>

		<pattern_crowdsource>	On June 8, 2004, a memorial monument to Adams was erected near the crash site, northwest of Randsburg, California	</pattern_crowdsource>

		<tree>
				prep_on(erected/VBN-13,June/NNP-2)
				num(June/NNP-2,8/CD-3)
				num(June/NNP-2,2004/CD-5)
				det(monument/NN-9,a/DT-7)
				nn(monument/NN-9,memorial/NN-8)
				nsubjpass(erected/VBN-13,monument/NN-9)
				prep_to(monument/NN-9,Adams/NNP-11)
				auxpass(erected/VBN-13,was/VBD-12)
				det(site/NN-17,the/DT-15)
				nn(site/NN-17,crash/NN-16)
				prep_near(erected/VBN-13,site/NN-17)
				advmod(erected/VBN-13,northwest/RB-19)
				nn(California/NNP-23,Randsburg/NNP-21)
				prep_of(northwest/RB-19,California/NNP-23)

		</tree>

		<annotations>

			<annotation>
				<surface-form>memorial</surface-form>
				<RDF-ID>http://dbpedia.org/resource/National_Women's_Monument</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>monument</surface-form>
				<RDF-ID>http://dbpedia.org/ontology/Monument</RDF-ID>
			</annotation>

			<annotation>
				<surface-form>Randsburg , California</surface-form>
				<RDF-ID>http://dbpedia.org/resource/Randsburg,_California</RDF-ID>
			</annotation>

		</annotations>

		<triples>

		</triples>

		<pattern>

			null

		</pattern>

	</sentence>

</Document>


text:
package com.commonsware.android.pagerbar;

import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;

public class EditorFragment extends Fragment {
  private static final String KEY_POSITION="position";
  private int position=-1;

  static EditorFragment newInstance(int position) {
    EditorFragment frag=new EditorFragment();
    Bundle args=new Bundle();

    args.putInt(KEY_POSITION, position);
    frag.setArguments(args);

    return(frag);
  }

  static String getTitle(Context ctxt, int position) {
    return(String.format(ctxt.getString(R.string.hint), position + 1));
  }

  @Override
  public View onCreateView(LayoutInflater inflater,
                           ViewGroup container,
                           Bundle savedInstanceState) {
    View result=inflater.inflate(R.layout.editor, container, false);
    EditText editor=(EditText)result.findViewById(R.id.editor);

    position=getArguments().getInt(KEY_POSITION, -1);
    editor.setHint(getTitle(getActivity(), position));

    if ((position % 2)==0) {
      setHasOptionsMenu(true);
    }

    return(result);
  }

  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.actions, menu);

    super.onCreateOptionsMenu(menu, inflater);
  }
}


text:
package cn.tomoya.module.security.core;

import cn.tomoya.config.yml.SiteConfig;
import cn.tomoya.module.user.entity.User;
import cn.tomoya.module.user.service.UserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Calendar;
import java.util.Date;

@Component
public class ValidateCodeAuthenticationFilter extends UsernamePasswordAuthenticationFilter {

  private Logger log = Logger.getLogger(ValidateCodeAuthenticationFilter.class);

  @Autowired
  private SiteConfig siteConfig;
  @Autowired
  private UserService userService;

  @PostConstruct
  public void init() {
    String failureUrl = "/login?error";
    setAuthenticationFailureHandler(new SimpleUrlAuthenticationFailureHandler(failureUrl));
  }

  @Override
  public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
      throws AuthenticationException {
    AuthenticationManager authenticationManager = super.getAuthenticationManager();
    // 只接受POST方式传递的数据
    if (!"POST".equals(request.getMethod()))
      throw new AuthenticationServiceException("不支持非POST方式的请求!");
    // 验证码验证
    String requestCaptcha = request.getParameter("code");
    String genCaptcha = (String) request.getSession().getAttribute("index_code");
    if (StringUtils.isEmpty(requestCaptcha))
      throw new AuthenticationServiceException("验证码不能为空!");
    if (!genCaptcha.toLowerCase().equals(requestCaptcha.toLowerCase())) {
      throw new AuthenticationServiceException("验证码错误!");
    }

    // 判断登陆次数及上限时间
    String username = obtainUsername(request);
    User user = userService.findByUsername(username);
    if (user == null) {
      throw new AuthenticationServiceException("用户名或密码错误!");
    } else {
      if (user.getAttempts() >= siteConfig.getAttempts()) {
        Calendar dateOne = Calendar.getInstance(), dateTwo = Calendar.getInstance();
        dateOne.setTime(new Date());
        dateTwo.setTime(user.getAttemptsTime());
        long timeOne = dateOne.getTimeInMillis();
        long timeTwo = dateTwo.getTimeInMillis();
        long minute = (timeOne - timeTwo) / (1000 * 60);// 转化minute
        if (minute < siteConfig.getAttemptsWaitTime()) {
          throw new AuthenticationServiceException(
              "密码错误超过" + siteConfig.getAttempts() + "次,账号已被锁定" + siteConfig.getAttemptsWaitTime() + "分钟");
        } else {
          user.setAttempts(0);
        }
      }
    }
    // 验证密码是否正确
    if (new BCryptPasswordEncoder().matches(obtainPassword(request), user.getPassword())) {
      user.setAttempts(0);
      user.setAttemptsTime(new Date());
      userService.save(user);
    } else {
      if (user.getAttempts() < siteConfig.getAttempts()) {
        user.setAttempts(user.getAttempts() + 1);
      }
      user.setAttemptsTime(new Date());
      userService.save(user);
      throw new AuthenticationServiceException("用户名或密码错误");
    }
    return super.attemptAuthentication(request, response);
  }

  @Override
  @Autowired
  public void setAuthenticationManager(AuthenticationManager authenticationManager) {
    super.setAuthenticationManager(authenticationManager);
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Prof. Anna Frebel @ MIT</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/grayscale.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">

                </button>

                    Prof. Anna Frebel | MIT | NEW WEBSITE SOON!

                        New Book!

                        Contact

Professor Anna Frebel

Massachusetts Institute of Technology

                   Kavli Institute for Astrophysics & Space Research

                   77 Massachusetts Avenue Building 37, Room 535

                   Cambridge, MA 02139, USA

                         Follow

                         Contact

www.annafrebel.com
 Copyright © 2016


text:
package org.eclipse.jdt.internal.ui.javadocexport;

import java.net.URL;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;

import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;

import org.eclipse.jdt.ui.JavaUI;

import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport;
import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement;

public class JavadocLinkRef {
	private final IJavaProject fProject;
	private final IPath fContainerPath;
	private IClasspathEntry fClasspathEntry;

	public JavadocLinkRef(IPath containerPath, IClasspathEntry classpathEntry, IJavaProject project) {
		fContainerPath= containerPath;
		fProject= project;
		fClasspathEntry= classpathEntry;
	}

	public JavadocLinkRef(IJavaProject project) {
		this(null, null, project);
	}

	public boolean isProjectRef() {
		return fClasspathEntry == null;
	}

	public IPath getFullPath() {
		return isProjectRef() ? fProject.getPath() : fClasspathEntry.getPath();
	}

	public URL getURL() {
		if (isProjectRef()) {
			return JavaUI.getProjectJavadocLocation(fProject);
		} else {
			return JavaUI.getLibraryJavadocLocation(fClasspathEntry);
		}
	}

	public void setURL(URL url, IProgressMonitor monitor) throws CoreException {
		if (isProjectRef()) {
			JavaUI.setProjectJavadocLocation(fProject, url);
		} else {
			CPListElement element= CPListElement.createFromExisting(fClasspathEntry, fProject);
			String location= url != null ? url.toExternalForm() : null;
			element.setAttribute(CPListElement.JAVADOC, location);
			String[] changedAttributes= { CPListElement.JAVADOC };
			BuildPathSupport.modifyClasspathEntry(null, element.getClasspathEntry(), changedAttributes, fProject, fContainerPath, fClasspathEntry.getReferencingEntry() != null, monitor);
			fClasspathEntry= element.getClasspathEntry();
		}
	}

	@Override
	public boolean equals(Object obj) {
		if (obj != null && obj.getClass().equals(getClass())) {
			JavadocLinkRef other= (JavadocLinkRef) obj;
			if (!fProject.equals(other.fProject) || isProjectRef() != other.isProjectRef()) {
				return false;
			}
			if (!isProjectRef()) {
				return fClasspathEntry.equals(other.fClasspathEntry);
			} else {
				return true;
			}
		}
		return false;
	}

	@Override
	public int hashCode() {
		if (isProjectRef()) {
			return fProject.hashCode();
		} else {
			return fProject.hashCode() + fClasspathEntry.hashCode();
		}

	}
}


text:
namespace base {
class WaitableEvent;
};

namespace IPC {

class SyncMessage;
class ChannelFactory;

// This is similar to ChannelProxy, with the added feature of supporting sending
// synchronous messages.
//
// Overview of how the sync channel works
// --------------------------------------
// When the sending thread sends a synchronous message, we create a bunch
// of tracking info (created in Send, stored in the PendingSyncMsg
// structure) associated with the message that we identify by the unique
// "MessageId" on the SyncMessage. Among the things we save is the
// "Deserializer" which is provided by the sync message. This object is in
// charge of reading the parameters from the reply message and putting them in
// the output variables provided by its caller.
//
// The info gets stashed in a queue since we could have a nested stack of sync
// messages (each side could send sync messages in response to sync messages,
// so it works like calling a function). The message is sent to the I/O thread
// for dispatch and the original thread blocks waiting for the reply.
//
// SyncContext maintains the queue in a threadsafe way and listens for replies
// on the I/O thread. When a reply comes in that matches one of the messages
// it's looking for (using the unique message ID), it will execute the
// deserializer stashed from before, and unblock the original thread.
//
//
// Significant complexity results from the fact that messages are still coming
// in while the original thread is blocked. Normal async messages are queued
// and dispatched after the blocking call is complete. Sync messages must
// be dispatched in a reentrant manner to avoid deadlock.
//
//
// Note that care must be taken that the lifetime of the ipc_thread argument
// is more than this object.  If the message loop goes away while this object
// is running and it's used to send a message, then it will use the invalid
// message loop pointer to proxy it to the ipc thread.
class IPC_EXPORT SyncChannel : public ChannelProxy {
 public:
  enum RestrictDispatchGroup {
    kRestrictDispatchGroup_None = 0,
  };

  // Creates and initializes a sync channel. If create_pipe_now is specified,
  // the channel will be initialized synchronously.
  // The naming pattern follows IPC::Channel.
  static scoped_ptr<SyncChannel> Create(
      const IPC::ChannelHandle& channel_handle,
      IPC::Channel::Mode mode,
      Listener* listener,
      const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
      bool create_pipe_now,
      base::WaitableEvent* shutdown_event);

  static scoped_ptr<SyncChannel> Create(
      scoped_ptr<ChannelFactory> factory,
      Listener* listener,
      const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
      bool create_pipe_now,
      base::WaitableEvent* shutdown_event);

  // Creates an uninitialized sync channel. Call ChannelProxy::Init to
  // initialize the channel. This two-step setup allows message filters to be
  // added before any messages are sent or received.
  static scoped_ptr<SyncChannel> Create(
      Listener* listener,
      const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
      base::WaitableEvent* shutdown_event);

  ~SyncChannel() override;

  bool Send(Message* message) override;

  // Sets the dispatch group for this channel, to only allow re-entrant dispatch
  // of messages to other channels in the same group.
  //
  // Normally, any unblocking message coming from any channel can be dispatched
  // when any (possibly other) channel is blocked on sending a message. This is
  // needed in some cases to unblock certain loops (e.g. necessary when some
  // processes share a window hierarchy), but may cause re-entrancy issues in
  // some cases where such loops are not possible. This flags allows the tagging
  // of some particular channels to only re-enter in known correct cases.
  //
  // Incoming messages on channels belonging to a group that is not
  // kRestrictDispatchGroup_None will only be dispatched while a sync message is
  // being sent on a channel of the *same* group.
  // Incoming messages belonging to the kRestrictDispatchGroup_None group (the
  // default) will be dispatched in any case.
  void SetRestrictDispatchChannelGroup(int group);

  // Creates a new IPC::SyncMessageFilter and adds it to this SyncChannel.
  // This should be used instead of directly constructing a new
  // SyncMessageFilter.
  scoped_refptr<IPC::SyncMessageFilter> CreateSyncMessageFilter();

 protected:
  class ReceivedSyncMsgQueue;
  friend class ReceivedSyncMsgQueue;

  // SyncContext holds the per object data for SyncChannel, so that SyncChannel
  // can be deleted while it's being used in a different thread.  See
  // ChannelProxy::Context for more information.
  class SyncContext : public Context {
   public:
    SyncContext(
        Listener* listener,
        const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
        base::WaitableEvent* shutdown_event);

    // Adds information about an outgoing sync message to the context so that
    // we know how to deserialize the reply.
    void Push(SyncMessage* sync_msg);

    // Cleanly remove the top deserializer (and throw it away).  Returns the
    // result of the Send call for that message.
    bool Pop();

    // Returns an event that's set when the send is complete, timed out or the
    // process shut down.
    base::WaitableEvent* GetSendDoneEvent();

    // Returns an event that's set when an incoming message that's not the reply
    // needs to get dispatched (by calling SyncContext::DispatchMessages).
    base::WaitableEvent* GetDispatchEvent();

    void DispatchMessages();

    // Checks if the given message is blocking the listener thread because of a
    // synchronous send.  If it is, the thread is unblocked and true is
    // returned. Otherwise the function returns false.
    bool TryToUnblockListener(const Message* msg);

    // Called on the IPC thread when a sync send that runs a nested message loop
    // times out.
    void OnSendTimeout(int message_id);

    base::WaitableEvent* shutdown_event() { return shutdown_event_; }

    ReceivedSyncMsgQueue* received_sync_msgs() {
      return received_sync_msgs_.get();
    }

    void set_restrict_dispatch_group(int group) {
      restrict_dispatch_group_ = group;
    }

    int restrict_dispatch_group() const {
      return restrict_dispatch_group_;
    }

    base::WaitableEventWatcher::EventCallback MakeWaitableEventCallback();

   private:
    ~SyncContext() override;
    // ChannelProxy methods that we override.

    // Called on the listener thread.
    void Clear() override;

    // Called on the IPC thread.
    bool OnMessageReceived(const Message& msg) override;
    void OnChannelError() override;
    void OnChannelOpened() override;
    void OnChannelClosed() override;

    // Cancels all pending Send calls.
    void CancelPendingSends();

    void OnWaitableEventSignaled(base::WaitableEvent* event);

    typedef std::deque<PendingSyncMsg> PendingSyncMessageQueue;
    PendingSyncMessageQueue deserializers_;
    base::Lock deserializers_lock_;

    scoped_refptr<ReceivedSyncMsgQueue> received_sync_msgs_;

    base::WaitableEvent* shutdown_event_;
    base::WaitableEventWatcher shutdown_watcher_;
    base::WaitableEventWatcher::EventCallback shutdown_watcher_callback_;
    int restrict_dispatch_group_;
  };

 private:
  SyncChannel(
      Listener* listener,
      const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
      base::WaitableEvent* shutdown_event);

  void OnWaitableEventSignaled(base::WaitableEvent* arg);

  SyncContext* sync_context() {
    return reinterpret_cast<SyncContext*>(context());
  }

  // Both these functions wait for a reply, timeout or process shutdown.  The
  // latter one also runs a nested message loop in the meantime.
  static void WaitForReply(
      SyncContext* context, base::WaitableEvent* pump_messages_event);

  // Runs a nested message loop until a reply arrives, times out, or the process
  // shuts down.
  static void WaitForReplyWithNestedMessageLoop(SyncContext* context);

  // Starts the dispatch watcher.
  void StartWatching();

  // ChannelProxy overrides:
  void OnChannelInit() override;

  // Used to signal events between the IPC and listener threads.
  base::WaitableEventWatcher dispatch_watcher_;
  base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_;

  // Tracks SyncMessageFilters created before complete channel initialization.
  std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_;

  DISALLOW_COPY_AND_ASSIGN(SyncChannel);
};

}  // namespace IPC

#endif  // IPC_IPC_SYNC_CHANNEL_H_


text:
package co.edu.uniandes.csw.artwork.persistence;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import co.edu.uniandes.csw.artwork.entities.ArtworkEntity;
import co.edu.uniandes.csw.crud.spi.persistence.CrudPersistence;
import java.util.List;
import javax.persistence.TypedQuery;

/**
 * @generated
 */
@Stateless
public class ArtworkPersistence extends CrudPersistence<ArtworkEntity> {

    @PersistenceContext(unitName="ArtworkPU")
    protected EntityManager em;

    /**
     * @generated
     */
    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    /**
     * @generated
     */
    @Override
    protected Class<ArtworkEntity> getEntityClass() {
        return ArtworkEntity.class;
    }

    public ArtworkEntity find(Long artistid, Long artworkid) {
        TypedQuery<ArtworkEntity> q = em.createQuery("select p from ArtworkEntity p where (p.artist.id = :artistid) and (p.id = :artworkid)", ArtworkEntity.class);
        q.setParameter("artistid", artistid);
        q.setParameter("artworkid", artworkid);
        return q.getSingleResult();
    }

    public List<ArtworkEntity> findAll(Integer page, Integer maxRecords, Long artistid) {
        TypedQuery<ArtworkEntity> q = em.createQuery("select p from ArtworkEntity p where (p.artist.id = :artistid)", ArtworkEntity.class);
        q.setParameter("artistid", artistid);
        if (page != null && maxRecords != null) {
            q.setFirstResult((page - 1) * maxRecords);
            q.setMaxResults(maxRecords);
        }
        return q.getResultList();
    }

    public List<ArtworkEntity> getArtworkByCategory(Integer page, Integer maxRecords, Long categoryid) {
        TypedQuery<ArtworkEntity> q = em.createQuery("select p from ArtworkEntity p join  p.category i where (i.id = :categoryid)", ArtworkEntity.class);
        q.setParameter("categoryid", categoryid);
        if (page != null && maxRecords != null) {
            q.setFirstResult((page - 1) * maxRecords);
            q.setMaxResults(maxRecords);
        }
        return q.getResultList();
    }

    public List<ArtworkEntity> getArtworksFromArtist(String artist) {
        TypedQuery<ArtworkEntity> q = em.createQuery("select p from ArtworkEntity p where (p.artist.name like :artistName)", ArtworkEntity.class);
        q.setParameter("artistName", "%" + artist + "%");
        return q.getResultList();
    }

    public List<ArtworkEntity> getLatestArtworks() {
        TypedQuery<ArtworkEntity> q = em.createQuery("select p from ArtworkEntity p order by p.dateAdded DESC", ArtworkEntity.class);
        q.setFirstResult(0);
        q.setMaxResults(4);
        return q.getResultList();
    }

    public List<ArtworkEntity> getArtworksFromArtistUserName(String userName) {
        TypedQuery<ArtworkEntity> q = em.createQuery("select p from ArtworkEntity p where (p.artist.username like :userName)", ArtworkEntity.class);
        q.setParameter("userName", "%" + userName + "%");
        return q.getResultList();
    }
}


text:
package com.softserveinc.tender.dto;

public class RatingDto {

    private Integer id;
    private Integer communication;
    private Integer speed;
    private Integer logistic;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCommunication() {
        return communication;
    }

    public void setCommunication(Integer communication) {
        this.communication = communication;
    }

    public Integer getSpeed() {
        return speed;
    }

    public void setSpeed(Integer speed) {
        this.speed = speed;
    }

    public Integer getLogistic() {
        return logistic;
    }

    public void setLogistic(Integer logistic) {
        this.logistic = logistic;
    }
}


text:
#ifndef QQUICKDRAG_P_H
#define QQUICKDRAG_P_H

#include <QtQuick/qquickitem.h>

#include <private/qv8engine_p.h>
#include <private/qqmlguard_p.h>

#include <QtCore/qmimedata.h>
#include <QtCore/qstringlist.h>

#ifndef QT_NO_DRAGANDDROP

QT_BEGIN_NAMESPACE

class QQuickItem;
class QQuickDrag;
class QQuickDragPrivate;

class QQuickDragGrabber
{
    class Item : public QQmlGuard<QQuickItem>
    {
    public:
        Item(QQuickItem *item) : QQmlGuard<QQuickItem>(item) {}

        QIntrusiveListNode node;
    protected:
        void objectDestroyed(QQuickItem *) { delete this; }
    };

    typedef QIntrusiveList<Item, &Item::node> ItemList;

public:
    QQuickDragGrabber() : m_target(0) {}
    ~QQuickDragGrabber() { while (!m_items.isEmpty()) delete m_items.first(); }

    QObject *target() const
    {
        if (m_target)
            return m_target;
        else if (!m_items.isEmpty())
            return *m_items.first();
        else
            return 0;
    }
    void setTarget(QObject *target) { m_target = target; }
    void resetTarget() { m_target = 0; }

    bool isEmpty() const { return m_items.isEmpty(); }

    typedef ItemList::iterator iterator;
    iterator begin() { return m_items.begin(); }
    iterator end() { return m_items.end(); }

    void grab(QQuickItem *item) { m_items.insert(new Item(item)); }
    iterator release(iterator at) { Item *item = *at; at = at.erase(); delete item; return at; }

private:

    ItemList m_items;
    QObject *m_target;
};

class QQuickDropEventEx : public QDropEvent
{
public:
    void setProposedAction(Qt::DropAction action) { default_action = action; drop_action = action; }

    static void setProposedAction(QDropEvent *event, Qt::DropAction action) {
        static_cast<QQuickDropEventEx *>(event)->setProposedAction(action);
    }

    void copyActions(const QDropEvent &from) {
        default_action = from.proposedAction(); drop_action = from.dropAction(); }

    static void copyActions(QDropEvent *to, const QDropEvent &from) {
        static_cast<QQuickDropEventEx *>(to)->copyActions(from);
    }
};

class QQuickDragMimeData : public QMimeData
{
    Q_OBJECT
public:
    QQuickDragMimeData()
        : m_source(0)
    {
    }

    QStringList keys() const { return m_keys; }
    QObject *source() const { return m_source; }

private:
    QObject *m_source;
    Qt::DropActions m_supportedActions;
    QStringList m_keys;

    friend class QQuickDragAttached;
    friend class QQuickDragAttachedPrivate;
};

class QQmlV4Function;
class QQuickDragAttached;
class Q_AUTOTEST_EXPORT QQuickDrag : public QObject
{
    Q_OBJECT

    Q_ENUMS(Axis DragType)
    Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged RESET resetTarget)
    Q_PROPERTY(Axis axis READ axis WRITE setAxis NOTIFY axisChanged)
    Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin NOTIFY minimumXChanged)
    Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax NOTIFY maximumXChanged)
    Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged)
    Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
    Q_PROPERTY(bool active READ active NOTIFY activeChanged)
    Q_PROPERTY(bool filterChildren READ filterChildren WRITE setFilterChildren NOTIFY filterChildrenChanged)
    Q_PROPERTY(bool smoothed READ smoothed WRITE setSmoothed NOTIFY smoothedChanged)
    // Note, threshold was added in QtQuick 2.2 but REVISION is not supported (or needed) for grouped
    // properties See QTBUG-33179
    Q_PROPERTY(qreal threshold READ threshold WRITE setThreshold NOTIFY thresholdChanged RESET resetThreshold)
    //### consider drag and drop

public:
    QQuickDrag(QObject *parent=0);
    ~QQuickDrag();

    enum DragType { None, Automatic, Internal };

    QQuickItem *target() const;
    void setTarget(QQuickItem *target);
    void resetTarget();

    enum Axis { XAxis=0x01, YAxis=0x02, XAndYAxis=0x03, XandYAxis=XAndYAxis };
    Axis axis() const;
    void setAxis(Axis);

    qreal xmin() const;
    void setXmin(qreal);
    qreal xmax() const;
    void setXmax(qreal);
    qreal ymin() const;
    void setYmin(qreal);
    qreal ymax() const;
    void setYmax(qreal);

    bool smoothed() const;
    void setSmoothed(bool smooth);

    qreal threshold() const;
    void setThreshold(qreal);
    void resetThreshold();

    bool active() const;
    void setActive(bool);

    bool filterChildren() const;
    void setFilterChildren(bool);

    static QQuickDragAttached *qmlAttachedProperties(QObject *obj);

Q_SIGNALS:
    void targetChanged();
    void axisChanged();
    void minimumXChanged();
    void maximumXChanged();
    void minimumYChanged();
    void maximumYChanged();
    void activeChanged();
    void filterChildrenChanged();
    void smoothedChanged();
    void thresholdChanged();

private:
    QQuickItem *_target;
    Axis _axis;
    qreal _xmin;
    qreal _xmax;
    qreal _ymin;
    qreal _ymax;
    bool _active : 1;
    bool _filterChildren: 1;
    bool _smoothed : 1;
    qreal _threshold;
    Q_DISABLE_COPY(QQuickDrag)
};

class QQuickDragAttachedPrivate;
class QQuickDragAttached : public QObject
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(QQuickDragAttached)

    Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
    Q_PROPERTY(QObject *source READ source WRITE setSource NOTIFY sourceChanged RESET resetSource)
    Q_PROPERTY(QObject *target READ target NOTIFY targetChanged)
    Q_PROPERTY(QPointF hotSpot READ hotSpot WRITE setHotSpot NOTIFY hotSpotChanged)
    Q_PROPERTY(QStringList keys READ keys WRITE setKeys NOTIFY keysChanged)
    Q_PROPERTY(QVariantMap mimeData READ mimeData WRITE setMimeData NOTIFY mimeDataChanged)
    Q_PROPERTY(Qt::DropActions supportedActions READ supportedActions WRITE setSupportedActions NOTIFY supportedActionsChanged)
    Q_PROPERTY(Qt::DropAction proposedAction READ proposedAction WRITE setProposedAction NOTIFY proposedActionChanged)
    Q_PROPERTY(QQuickDrag::DragType dragType READ dragType WRITE setDragType NOTIFY dragTypeChanged)
public:
    QQuickDragAttached(QObject *parent);
    ~QQuickDragAttached();

    bool isActive() const;
    void setActive(bool active);

    QObject *source() const;
    void setSource(QObject *item);
    void resetSource();

    QObject *target() const;

    QPointF hotSpot() const;
    void setHotSpot(const QPointF &hotSpot);

    QStringList keys() const;
    void setKeys(const QStringList &keys);

    QVariantMap mimeData() const;
    void setMimeData(const QVariantMap &mimeData);

    Qt::DropActions supportedActions() const;
    void setSupportedActions(Qt::DropActions actions);

    Qt::DropAction proposedAction() const;
    void setProposedAction(Qt::DropAction action);

    QQuickDrag::DragType dragType() const;
    void setDragType(QQuickDrag::DragType dragType);

    Q_INVOKABLE int drop();

    bool event(QEvent *event);

public Q_SLOTS:
    void start(QQmlV4Function *);
    void startDrag(QQmlV4Function *);
    void cancel();

Q_SIGNALS:
    void dragStarted();
    void dragFinished(Qt::DropAction dropAction);

    void activeChanged();
    void sourceChanged();
    void targetChanged();
    void hotSpotChanged();
    void keysChanged();
    void mimeDataChanged();
    void supportedActionsChanged();
    void proposedActionChanged();
    void dragTypeChanged();
};

QT_END_NAMESPACE

QML_DECLARE_TYPE(QQuickDrag)
QML_DECLARE_TYPEINFO(QQuickDrag, QML_HAS_ATTACHED_PROPERTIES)

#endif // QT_NO_DRAGANDDROP

#endif


text:
var widgetIdsToRemove = [
// Put here the datafari official widgets IDs you don't want to display
// For example:
// "facet_source",
// "facet_language"
]


text:
package ublu.command;

import ublu.util.ArgArray;
import ublu.util.DataSink;

import com.ibm.as400.access.AS400SecurityException;
import com.ibm.as400.access.ErrorCompletingRequestException;
import com.ibm.as400.access.ObjectDoesNotExistException;
import com.ibm.as400.access.RequestNotSupportedException;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;

/**
 * Ask the user and get a response
 *
 * @author jwoehr
 */
public class CmdAsk extends Command {

    {
        setNameAndDescription("ask",
                "/0 [-to datasink] [-from datasink] [-nocons] [-say ~@{prompt string}]  : get input from user");
    }

    /**
     * Cmd action to ask user and get a response
     *
     * @param argArray arguments in interpreter buffer
     * @return what's left of arguments
     */
    public ArgArray cmdAsk(ArgArray argArray) {
        String prompt = null;
        boolean consoleOk = true;
        while (argArray.hasDashCommand()) {
            String dashCommand = argArray.parseDashCommand();
            switch (dashCommand) {
                case "-to":
                    setDataDestfromArgArray(argArray);
                    break;
                case "-from":
                    setDataSrcfromArgArray(argArray);
                    break;
                case "-say":
                    prompt = argArray.nextMaybeQuotationTuplePopString();
                    break;
                case "-nocons":
                    consoleOk = false;
                    break;
                default:
                    unknownDashCommand(dashCommand);
            }
        }
        if (havingUnknownDashCommand()) {
            setCommandResult(COMMANDRESULT.FAILURE);
        } else {
            String s;
            if (getDataSrc().getType().equals(DataSink.SINKTYPE.TUPLE)) {
                prompt = getTuple(getDataSrc().getName()).getValue().toString();
            } else if (getDataSrc().getType().equals(DataSink.SINKTYPE.FILE)) {
                try {
                    prompt = getPromptFromFile();
                } catch (FileNotFoundException ex) {
                    getLogger().log(Level.SEVERE, "Could not find file for prompt in " + getNameAndDescription(), ex);
                    setCommandResult(COMMANDRESULT.FAILURE);
                } catch (IOException ex) {
                    getLogger().log(Level.SEVERE, "Could not read file for prompt in " + getNameAndDescription(), ex);
                    setCommandResult(COMMANDRESULT.FAILURE);
                }
            }
            if (getInterpreter().isConsole() && consoleOk) {
                /* debug */ // getInterpreter().outputerrln("Is console.");
                if (prompt != null) {
                    s = System.console().readLine("%s : ", prompt.trim());
                } else {
                    s = System.console().readLine();
                }
                try {
                    put(s);
                } catch (SQLException | IOException | AS400SecurityException | ErrorCompletingRequestException | InterruptedException | ObjectDoesNotExistException | RequestNotSupportedException ex) {
                    getLogger().log(Level.SEVERE, "Could not put response \"" + s + "\"" + inNameAndDescription(), ex);
                    setCommandResult(COMMANDRESULT.FAILURE);
                }
            } else { // Not console

                if (prompt != null) {
                    prompt = prompt.trim() + (isGoubluing() ? " : \n" : " : ");
                    getInterpreter().output(prompt);
                }
                try {
                    put(getInterpreter().getInputStreamBufferedReader().readLine());
                } catch (SQLException | IOException | AS400SecurityException | ErrorCompletingRequestException | InterruptedException | ObjectDoesNotExistException | RequestNotSupportedException ex) {
                    getLogger().log(Level.SEVERE, "Could not either get or put response with prompt " + prompt + inNameAndDescription(), ex);
                    setCommandResult(COMMANDRESULT.FAILURE);
                }
            }
        }
        return argArray;
    }

    private String getPromptFromFile() throws FileNotFoundException, IOException {
        String filepath = getDataSrc().getName();
        FileReader fileReader;
        fileReader = new FileReader(new File(filepath));
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        return bufferedReader.readLine();
    }

    @Override
    public ArgArray cmd(ArgArray args) {
        reinit();
        return cmdAsk(args);
    }

    @Override
    public COMMANDRESULT getResult() {
        return getCommandResult();
    }
}


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloCordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>


text:
'use strict';

const fs = require('fs');

// src\services\note\hooks\afterRemove.js
//
// Use this hook to manipulate incoming or outgoing data.
// For more information on hooks see: http://docs.feathersjs.com/hooks/readme.html

module.exports = function() {

  return function(hook) {
    return new Promise((resolve) => {
      const { filePath } = hook.result;
      fs.unlink(filePath, (err) => {
        if (err) {
          reject();
        } else {
          resolve(hook);
        }
      })
    });
  };
};


text:
INSERT INTO owners
VALUES('1','John','Porter','jay@ryde.com');

#Add two cars to the database
INSERT INTO cars
VALUES('1','Toyota','Camry','2016','silver','1','200','nice and reliable car');

INSERT INTO cars
VALUES('2','Saturn','Ion','2004','silver', '1','75','Car has been in two accidents, completely fixed up and safe');

#Add two users to the database
INSERT INTO users(id, firstname,lastname,username,pswrd)
VALUES('1','Connor', 'Kirk','username','bologna1');


text:
package com.lee.opengles.mesh;

/**
 * ClassName: Plane
 * Description TODO 平面
 * Auther lijun lee mingyangnc@163.com
 * Date 2016/7/18 11:19
 */
public class Plane extends Mesh {

    public Plane() {
        this(1, 1, 1, 1);
    }

    public Plane(float width, float height) {
        this(width, height, 1, 1);
    }

    public Plane(float width, float height, int widthSegments, int heightSegments) {
        float[] vertices = new float[(widthSegments + 1) * (heightSegments + 1) * 3];
        short[] indices = new short[(widthSegments + 1) * (heightSegments + 1) * 6];

        float xOffset = width / -2;
        float yOffset = height / -2;
        float xWidth = width / (widthSegments);
        float yHeight = height / (heightSegments);
        int currentVertex = 0;
        int currentIndex = 0;
        short w = (short) (widthSegments + 1);
        for (int y = 0; y < heightSegments + 1; y++) {
            for (int x = 0; x < widthSegments + 1; x++) {
                vertices[currentVertex] = xOffset + x * xWidth;
                vertices[currentVertex + 1] = yOffset + y * yHeight;
                vertices[currentVertex + 2] = 0; // 对应顶点
                currentVertex += 3;

                int n = y * (widthSegments + 1) + x;

                if (y < heightSegments && x < widthSegments) {

                    // Face one
                    indices[currentIndex] = (short) n;
                    indices[currentIndex + 1] = (short) (n + 1);
                    indices[currentIndex + 2] = (short) (n + w);

                    // face two
                    indices[currentIndex + 3] = (short) (n + 1);
                    indices[currentIndex + 4] = (short) (n + 1 + w);
                    indices[currentIndex + 5] = (short) (n + 1 + w - 1);

                    currentIndex += 6;
                }
            }
        }

        setVertices(vertices);
        setIndices(indices);
    }
}


text:
package org.teavm.interop;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD, ElementType.METHOD })
public @interface PlatformMarker {
    String value() default "";
}


text:
package com.thoughtworks.go.domain;

import com.rits.cloning.Cloner;
import com.thoughtworks.go.config.StageConfig;
import com.thoughtworks.go.util.Clock;
import org.slf4j.Logger;
import org.joda.time.DateTimeUtils;
import org.joda.time.Duration;
import org.slf4j.LoggerFactory;

import java.sql.Timestamp;
import java.util.Date;

public class Stage extends PersistentObject {
    private static final Logger LOG = LoggerFactory.getLogger(Stage.class);

    private Long pipelineId;
    private String name;
    private JobInstances jobInstances = new JobInstances();
    private String approvedBy;
    private String cancelledBy;
    private int orderId;
    private Timestamp createdTime;
    private Timestamp lastTransitionedTime;
    private String approvalType;
    private boolean fetchMaterials = StageConfig.DEFAULT_FETCH_MATERIALS;
    private StageResult result = DEFAULT_RESULT;
    private int counter;
    private StageIdentifier identifier;
    private Long completedByTransitionId;
    private StageState state;
    private boolean latestRun = true;
    private boolean cleanWorkingDir = StageConfig.DEFAULT_CLEAN_WORKING_DIR;
    private Integer rerunOfCounter;
    private boolean artifactsDeleted;

    private static final StageResult DEFAULT_RESULT = StageResult.Unknown;
    private static final Cloner CLONER = new Cloner();
    private String configVersion = null;
    private StageIdentifier previousStage;

    public Stage() {
    }

    public Stage(String name, JobInstances jobInstances, String approvedBy, String cancelledBy, String approvalType, final Clock clock) {
        this(name, jobInstances, approvedBy, cancelledBy, approvalType, StageConfig.DEFAULT_FETCH_MATERIALS, StageConfig.DEFAULT_CLEAN_WORKING_DIR, clock);
    }

    public Stage(String name, JobInstances jobInstances, String approvedBy, String cancelledBy, String approvalType, boolean fetchMaterials, boolean cleanWorkingDir, final Clock clock) {
        this.name = name;
        this.jobInstances = jobInstances;
        this.approvedBy = approvedBy;
        this.cancelledBy = cancelledBy;
        this.approvalType = approvalType;
        this.fetchMaterials = fetchMaterials;
        this.cleanWorkingDir = cleanWorkingDir;
        this.createdTime = new Timestamp(clock.currentTimeMillis());
    }

    public Stage(String name, JobInstances jobInstances, String approvedBy, String cancelledBy, String approvalType, boolean fetchMaterials, boolean cleanWorkingDir, String configVersion, final Clock clock) {
        this(name, jobInstances, approvedBy, cancelledBy, approvalType, fetchMaterials, cleanWorkingDir, clock);
        this.configVersion = configVersion;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public JobInstances getJobInstances() {
        return jobInstances;
    }

    public void setJobInstances(JobInstances jobInstances) {
        this.jobInstances = jobInstances;
    }

    public Long getPipelineId() {
        return pipelineId;
    }

    public void setPipelineId(Long pipelineId) {
        this.pipelineId = pipelineId;
    }

    public Stage mostRecent(Stage completed) {
        return this;
    }

    public StageState stageState() {
        return jobInstances.stageState();
    }

    public StageState getState() {
        return state;
    }

    public String status() {
        return stageState().status();
    }

    public Date scheduledDate() {
        return new Date(createdTime.getTime());
    }

    public Date completedDate() {
        if (completedByTransitionId != null && lastTransitionedTime != null) {
            return new Date(lastTransitionedTime.getTime());
        } else if (lastTransitionedTime == null) {//TODO: Should not be null anymore. Keeping this for Legacy code so that we dont end up fixing a lot of tests. We should remove this eventually.
            Date mostRecent = null;
            for (JobStateTransition transition : jobInstances.stateTransitions()) {
                if (transition.getCurrentState() == JobState.Completed && (mostRecent == null || transition.getStateChangeTime().after(mostRecent))) {
                    mostRecent = transition.getStateChangeTime();
                }
            }
            return mostRecent;
        }
        return null;
    }

    public Date latestTransitionDate() {
        Date latest = jobInstances.latestTransitionDate();
        if (latest == null) {
            return createdTime;
        }
        return latest;
    }

    public boolean isCompletedAndPassed() {
        return this.stageState().completed() && passed();
    }

    public boolean passed() {
        return StageState.Passed.equals(this.stageState());
    }

    public boolean failed() {
        return StageState.Failed.equals(this.stageState());
    }

    public boolean cancelled() {
        return StageState.Cancelled.equals(this.stageState());
    }

    public boolean isActive() {
        return this.stageState().isActive();
    }

    public String getApprovedBy() {
        return approvedBy;
    }

    public void setApprovedBy(String approvedBy) {
        this.approvedBy = approvedBy;
    }

    public String getCancelledBy() {
        return cancelledBy;
    }

    public void setCancelledBy(String cancelledBy) {
        this.cancelledBy = cancelledBy;
    }

    public boolean isApproved() {
        return approvedBy != null;
    }

    public void fail() {
        for (JobInstance job : getJobInstances()) {
            job.fail();
        }
    }

    public Timestamp getLastTransitionedTime() {
        return lastTransitionedTime;
    }

    public void setLastTransitionedTime(Timestamp lastTransitionedTime) {
        this.lastTransitionedTime = lastTransitionedTime;
    }

    public Timestamp getCreatedTime() {
        return createdTime;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    @Override
    public String toString() {
        return "<Stage"
                + " id='" + id + "'"
                + " name='" + name + "'"
                + " stageCounter='" + counter + "'"
                + " createdTime='" + createdTime + "'"
                + " result='" + result + "'"
                + ">";
    }

    public StageResult getResult() {
        return result;
    }

    public synchronized void calculateResult() {
        this.state = this.stageState();
        this.result = state.stageResult();
        if (state.completed()) {
            long latestTransitionId = jobInstances.latestTransitionId();
            if (latestTransitionId != JobStateTransition.NOT_PERSISTED) {
                LOG.info("Stage is being completed by transition id: {}", latestTransitionId);
                if (completedByTransitionId != null) {
                    LOG.warn("Completing transition id for stage is being changed from {} to {}", completedByTransitionId, latestTransitionId);
                }
                this.completedByTransitionId = latestTransitionId;
            }
        }
    }

    public void setApprovalType(String approvalType) {
        this.approvalType = approvalType;
    }

    public String getApprovalType() {
        return approvalType;
    }

    public void setCounter(int counter) {
        this.counter = counter;
        if (getIdentifier() != null) {
            getIdentifier().setStageCounter(String.valueOf(counter));
        }
    }

    public int getCounter() {
        return this.counter;
    }

    public void setIdentifier(StageIdentifier identifier) {
        this.identifier = identifier;
    }

    public StageIdentifier getIdentifier() {
        return identifier;
    }

    public JobInstance findJob(String name) {
        return jobInstances.getByName(name);
    }

    // This is to differentiate b/w scheduled & building
    public boolean isScheduled() {
        if (counter == 1) {
            return areAllJobsInScheduledState();
        }
        return false;
    }

    // This is to differentiate b/w re-run & building
    public boolean isReRun() {
        if (counter > 1) {
            // stage re-run || job re-run
            return areAllJobsInScheduledState() || (rerunOfCounter != null && areAllReRunJobsInScheduledState());
        }
        return false;
    }

    private boolean areAllJobsInScheduledState() {
        for (JobInstance instance : jobInstances) {
            if (instance.getState() != JobState.Scheduled) {
                return false;
            }
        }
        return true;
    }

    private boolean areAllReRunJobsInScheduledState() {
        for (JobInstance instance : jobInstances) {
            if (instance.isRerun() && instance.getState() != JobState.Scheduled) {
                return false;
            }
        }
        return true;
    }

    public boolean isCompleted() {
        return stageState().completed();
    }

    public RunDuration getDuration() {
        if (!state.completed()) {
            return RunDuration.IN_PROGRESS_DURATION;
        }
        Date start = new Date(createdTime.getTime());
        Date end = new Date(lastTransitionedTime.getTime());
        return new RunDuration.ActualDuration(new Duration(end.getTime() - start.getTime()));
    }

    public String stageLocator() {
        return identifier.stageLocator();
    }

    public String stageLocatorForDisplay() {
        return identifier.stageLocatorForDisplay();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Stage stage = (Stage) o;

        if (counter != stage.counter) {
            return false;
        }
        if (orderId != stage.orderId) {
            return false;
        }
        if (fetchMaterials != stage.fetchMaterials) {
            return false;
        }

        if (cleanWorkingDir != stage.cleanWorkingDir) {
            return false;
        }
        if (pipelineId != null ? !pipelineId.equals(stage.pipelineId) : stage.pipelineId != null) {
            return false;
        }
        if (approvalType != null ? !approvalType.equals(stage.approvalType) : stage.approvalType != null) {
            return false;
        }
        if (approvedBy != null ? !approvedBy.equals(stage.approvedBy) : stage.approvedBy != null) {
            return false;
        }
        if (cancelledBy != null ? !cancelledBy.equals(stage.cancelledBy) : stage.cancelledBy != null) {
            return false;
        }
        if (createdTime != null ? !createdTime.equals(stage.createdTime) : stage.createdTime != null) {
            return false;
        }
//TODO: ChrisS We need to fix this once all the tests are saving JobInstances correctly.
//see PipelineDao.saveWithStages to see why we can't do this
//        if (jobInstances != null ? !jobInstances.equals(stage.jobInstances) : stage.jobInstances != null) {
//            return false;
//        }
        if (name != null ? !name.equals(stage.name) : stage.name != null) {
            return false;
        }
        if (result != stage.result) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result1 = pipelineId != null ? pipelineId.hashCode() : 0;
        result1 = 31 * result1 + (name != null ? name.hashCode() : 0);
        result1 = 31 * result1 + (jobInstances != null ? jobInstances.hashCode() : 0);
        result1 = 31 * result1 + (approvedBy != null ? approvedBy.hashCode() : 0);
        result1 = 31 * result1 + (cancelledBy != null ? cancelledBy.hashCode() : 0);
        result1 = 31 * result1 + orderId;
        result1 = 31 * result1 + (createdTime != null ? createdTime.hashCode() : 0);
        result1 = 31 * result1 + (approvalType != null ? approvalType.hashCode() : 0);
        result1 = 31 * result1 + (result != null ? result.hashCode() : 0);
        result1 = 31 * result1 + counter;
        result1 = 31 * result1 + (identifier != null ? identifier.hashCode() : 0);
        result1 = 31 * result1 + (fetchMaterials ? 1 : 0);
        result1 = 31 * result1 + (cleanWorkingDir ? 1 : 0);
        return result1;
    }

    public JobInstance getFirstJob() {
        return jobInstances.first();
    }

    public JobInstances jobsWithResult(JobResult... results) {
        return jobInstances.filterByResult(results);
    }

    @Deprecated
    /**
     * for ibatis only
     */
    public void setCompletedByTransitionId(Long completedByTransitionId) {
        this.completedByTransitionId = completedByTransitionId;
    }

    public Long getCompletedByTransitionId() {
        return completedByTransitionId;
    }

    public void building() {
        state = StageState.Building;
    }

    public boolean isLatestRun() {
        return latestRun;
    }

    /**
     * for ibatis
     */
    public void setLatestRun(boolean latestRun) {
        this.latestRun = latestRun;
    }

    public boolean shouldFetchMaterials() {
        return fetchMaterials;
    }

    public boolean shouldCleanWorkingDir() {
        return cleanWorkingDir;
    }

    public Stage createClone() {
        return CLONER.deepClone(this);
    }

    public void prepareForRerunOf(SchedulingContext context, String latestConfigVersion) {
        setId(-1);
        if (rerunOfCounter == null) {
            setRerunOfCounter(counter);
        }
        this.configVersion = latestConfigVersion;
        setApprovedBy(context.getApprovedBy());
        setLatestRun(true);
        resetResult();
        setCreatedTime(new Timestamp(DateTimeUtils.currentTimeMillis()));
        jobInstances.resetJobsIds();
    }

    private void resetResult() {
        result = DEFAULT_RESULT;
    }

    public boolean hasRerunJobs() {
        return rerunOfCounter != null;
    }

    public Integer getRerunOfCounter() {
        return rerunOfCounter;
    }

    public void setRerunOfCounter(Integer rerunOfCounter) {
        this.rerunOfCounter = rerunOfCounter;
    }

    public boolean isArtifactsDeleted() {
        return artifactsDeleted;
    }

    public void setArtifactsDeleted(boolean artifactsDeleted) {
        this.artifactsDeleted = artifactsDeleted;
    }

    public String getConfigVersion() {
        return this.configVersion;
    }

    /**
     * for tests only
     */
    @Deprecated
    public void setConfigVersion(String configVersion) {
        this.configVersion = configVersion;
    }

    public void setCreatedTime(Timestamp timestamp) {
        this.createdTime = timestamp;
    }

    public void setPreviousStage(StageIdentifier previousStage) {
        this.previousStage = previousStage;
    }

    public StageIdentifier getPreviousStage() {
        return previousStage;
    }
}