text:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0"
	xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"
	xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
	xmlns:sap="http://www.sap.com/Protocols/SAPData">
	<edmx:DataServices m:DataServiceVersion="2.0">
		<Schema Namespace="cds_zrh_erhaordermanage" xml:lang="en" sap:schema-version="1"
			xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
			<Annotation Term="Core.SchemaVersion" String="1.0.0"
				xmlns="http://docs.oasis-open.org/odata/ns/edm"/>
			<EntityType Name="ErhaOrderItemType" sap:label="Order Item" sap:content-version="1">
				<Key>
					<PropertyRef Name="ErhaOrder"/>
					<PropertyRef Name="ErhaOrderItem"/>
				</Key>
				<Property Name="Delete_mc" Type="Edm.Boolean" sap:label="Dyn. Method Control" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Update_mc" Type="Edm.Boolean" sap:label="Dyn. Method Control" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="ErhaOrder" Type="Edm.String" Nullable="false" MaxLength="10" sap:display-format="NonNegative" sap:label="Order" sap:creatable="false" sap:updatable="false"/>
				<Property Name="ErhaOrderItem" Type="Edm.String" Nullable="false" MaxLength="6" sap:display-format="NonNegative" sap:hierarchy-node-external-key-for="HierarchyNode" sap:label="Item" sap:creatable="false" sap:updatable="false"/>
				<Property Name="ErhaOrderItemName" Type="Edm.String" MaxLength="40" sap:label="Item Name"/>
				<Property Name="ParentItem" Type="Edm.String" MaxLength="6" sap:display-format="NonNegative" sap:label="Parent Item" sap:creatable="false" sap:updatable="false"/>
				<Property Name="CreatedByUser" Type="Edm.String" MaxLength="12" sap:display-format="UpperCase" sap:label="Created By" sap:quickinfo="Created By User" sap:creatable="false" sap:updatable="false"/>
				<Property Name="CreationDateTime" Type="Edm.DateTimeOffset" Precision="7" sap:label="Created On" sap:quickinfo="Creation Date Time" sap:creatable="false" sap:updatable="false"/>
				<Property Name="LastChangedByUser" Type="Edm.String" MaxLength="12" sap:display-format="UpperCase" sap:label="Changed By" sap:quickinfo="Last Changed By User" sap:creatable="false" sap:updatable="false"/>
				<Property Name="LastChangeDateTime" Type="Edm.DateTimeOffset" Precision="7" sap:label="Changed On" sap:quickinfo="Last Change Date Time" sap:creatable="false" sap:updatable="false"/>
				<Property Name="HierarchyNode" Type="Edm.String" MaxLength="1333" sap:hierarchy-node-for="ErhaOrderItem"/>
				<Property Name="HierarchyParentNode" Type="Edm.String" MaxLength="1333" sap:hierarchy-parent-node-for="HierarchyNode"/>
				<Property Name="HierarchyDistanceFromRoot" Type="Edm.Int32" sap:hierarchy-level-for="HierarchyNode" sap:creatable="false" sap:updatable="false"/>
				<Property Name="HierarchyDescendantCount" Type="Edm.Int32" sap:hierarchy-node-descendant-count-for="HierarchyNode" sap:creatable="false" sap:updatable="false"/>
				<Property Name="HierarchyDrillState" Type="Edm.String" MaxLength="20" sap:hierarchy-drill-state-for="HierarchyNode" sap:creatable="false" sap:updatable="false"/>
				<Property Name="HierarchyPreorderRank" Type="Edm.Int32" sap:hierarchy-preorder-rank-for="HierarchyNode" sap:creatable="false" sap:updatable="false"/>
				<Property Name="HierarchySiblingRank" Type="Edm.Int32" sap:hierarchy-sibling-rank-for="HierarchyNode" sap:creatable="false" sap:updatable="false"/>
				<NavigationProperty Name="to_ErhaOrder" Relationship="cds_zrh_erhaordermanage.assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" FromRole="ToRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" ToRole="FromRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8"/>
			</EntityType>
			<EntityType Name="ErhaOrderType" sap:label="Order" sap:content-version="1">
				<Key>
					<PropertyRef Name="ErhaOrder"/>
				</Key>
				<Property Name="Delete_mc" Type="Edm.Boolean" sap:label="Dyn. Method Control" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Update_mc" Type="Edm.Boolean" sap:label="Dyn. Method Control" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="to_Item_oc" Type="Edm.Boolean" sap:label="Dynamic CbA-Control" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="ErhaOrder" Type="Edm.String" Nullable="false" MaxLength="10" sap:display-format="NonNegative" sap:label="Order" sap:creatable="false" sap:updatable="false"/>
				<Property Name="ErhaOrderName" Type="Edm.String" MaxLength="40" sap:label="Order Name"/>
				<Property Name="CreatedByUser" Type="Edm.String" MaxLength="12" sap:display-format="UpperCase" sap:label="Created By" sap:quickinfo="Created By User" sap:creatable="false" sap:updatable="false"/>
				<Property Name="CreationDateTime" Type="Edm.DateTimeOffset" Precision="7" sap:label="Created On" sap:quickinfo="Creation Date Time" sap:creatable="false" sap:updatable="false"/>
				<Property Name="LastChangedByUser" Type="Edm.String" MaxLength="12" sap:display-format="UpperCase" sap:label="Changed By" sap:quickinfo="Last Changed By User" sap:creatable="false" sap:updatable="false"/>
				<Property Name="LastChangeDateTime" Type="Edm.DateTimeOffset" Precision="7" sap:label="Changed On" sap:quickinfo="Last Change Date Time" sap:creatable="false" sap:updatable="false"/>
				<NavigationProperty Name="to_Item" Relationship="cds_zrh_erhaordermanage.assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" FromRole="FromRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" ToRole="ToRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8"/>
			</EntityType>
			<EntityType Name="SAP__Currency" sap:content-version="1">
				<Key>
					<PropertyRef Name="CurrencyCode"/>
				</Key>
				<Property Name="CurrencyCode" Type="Edm.String" Nullable="false" MaxLength="5" sap:label="Currency" sap:semantics="currency-code"/>
				<Property Name="ISOCode" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="ISO Code"/>
				<Property Name="Text" Type="Edm.String" Nullable="false" MaxLength="15" sap:label="Short Text"/>
				<Property Name="DecimalPlaces" Type="Edm.Byte" Nullable="false" sap:label="Decimals"/>
			</EntityType>
			<EntityType Name="SAP__UnitOfMeasure" sap:content-version="1">
				<Key>
					<PropertyRef Name="UnitCode"/>
				</Key>
				<Property Name="UnitCode" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Internal UoM" sap:semantics="unit-of-measure"/>
				<Property Name="ISOCode" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="ISO Code"/>
				<Property Name="ExternalCode" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Commercial"/>
				<Property Name="Text" Type="Edm.String" Nullable="false" MaxLength="30" sap:label="Measurement Unit Txt"/>
				<Property Name="DecimalPlaces" Type="Edm.Int16" sap:label="Decimal Places"/>
			</EntityType>
			<EntityType Name="SAP__DocumentDescription" sap:content-version="1">
				<Key>
					<PropertyRef Name="Id"/>
				</Key>
				<Property Name="Id" Type="Edm.Guid" Nullable="false" sap:label="UUID"/>
				<Property Name="CreatedBy" Type="Edm.String" Nullable="false" MaxLength="12"/>
				<Property Name="CreatedAt" Type="Edm.DateTime" Nullable="false" Precision="0" sap:label="Time Stamp"/>
				<Property Name="FileName" Type="Edm.String" Nullable="false" MaxLength="256"/>
				<Property Name="Title" Type="Edm.String" Nullable="false" MaxLength="256"/>
				<NavigationProperty Name="Format" Relationship="cds_zrh_erhaordermanage.to_format" FromRole="FromRole_to_format" ToRole="ToRole_to_format"/>
				<NavigationProperty Name="TableColumns" Relationship="cds_zrh_erhaordermanage.to_tablecolumns" FromRole="FromRole_to_tablecolumns" ToRole="ToRole_to_tablecolumns"/>
				<NavigationProperty Name="CoverPage" Relationship="cds_zrh_erhaordermanage.to_coverpage" FromRole="FromRole_to_coverpage" ToRole="ToRole_to_coverpage"/>
				<NavigationProperty Name="Signature" Relationship="cds_zrh_erhaordermanage.to_signature" FromRole="FromRole_to_signature" ToRole="ToRole_to_signature"/>
				<NavigationProperty Name="PDFStandard" Relationship="cds_zrh_erhaordermanage.to_pdfstandard" FromRole="FromRole_to_pdfstandard" ToRole="ToRole_to_pdfstandard"/>
			</EntityType>
			<EntityType Name="SAP__Format" sap:content-version="1">
				<Key>
					<PropertyRef Name="Id"/>
				</Key>
				<Property Name="FitToPage" Type="cds_zrh_erhaordermanage.SAP__FitToPage" Nullable="false"/>
				<Property Name="Id" Type="Edm.Guid" Nullable="false" sap:label="UUID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="FontSize" Type="Edm.Int32" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Orientation" Type="Edm.String" Nullable="false" MaxLength="10" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="PaperSize" Type="Edm.String" Nullable="false" MaxLength="10" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="BorderSize" Type="Edm.Int32" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="MarginSize" Type="Edm.Int32" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="FontName" Type="Edm.String" Nullable="false" MaxLength="255" sap:label="Font Name" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
			</EntityType>
			<EntityType Name="SAP__PDFStandard" sap:content-version="1">
				<Key>
					<PropertyRef Name="Id"/>
				</Key>
				<Property Name="Id" Type="Edm.Guid" Nullable="false" sap:label="UUID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="UsePDFAConformance" Type="Edm.Boolean" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="DoEnableAccessibility" Type="Edm.Boolean" Nullable="false" sap:label="Indicator" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
			</EntityType>
			<EntityType Name="SAP__TableColumns" sap:content-version="1">
				<Key>
					<PropertyRef Name="Id"/>
					<PropertyRef Name="Name"/>
					<PropertyRef Name="Header"/>
				</Key>
				<Property Name="Id" Type="Edm.Guid" Nullable="false" sap:label="UUID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="256" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Header" Type="Edm.String" Nullable="false" MaxLength="256" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="HorizontalAlignment" Type="Edm.String" Nullable="false" MaxLength="10" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
			</EntityType>
			<EntityType Name="SAP__CoverPage" sap:content-version="1">
				<Key>
					<PropertyRef Name="Title"/>
					<PropertyRef Name="Id"/>
					<PropertyRef Name="Name"/>
				</Key>
				<Property Name="Title" Type="Edm.String" Nullable="false" MaxLength="256" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Id" Type="Edm.Guid" Nullable="false" sap:label="UUID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="256" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Value" Type="Edm.String" Nullable="false" MaxLength="256" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
			</EntityType>
			<EntityType Name="SAP__Signature" sap:content-version="1">
				<Key>
					<PropertyRef Name="Id"/>
				</Key>
				<Property Name="Id" Type="Edm.Guid" Nullable="false" sap:label="UUID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="DoSign" Type="Edm.Boolean" Nullable="false" sap:label="Indicator" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="Reason" Type="Edm.String" Nullable="false" MaxLength="256" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
			</EntityType>
			<EntityType Name="SAP__ValueHelp" sap:content-version="1">
				<Key>
					<PropertyRef Name="VALUEHELP"/>
				</Key>
				<Property Name="VALUEHELP" Type="Edm.String" Nullable="false"/>
				<Property Name="FIELD_VALUE" Type="Edm.String" Nullable="false" MaxLength="10"/>
				<Property Name="DESCRIPTION" Type="Edm.String"/>
			</EntityType>
			<ComplexType Name="SAP__FitToPage">
				<Property Name="ErrorRecoveryBehavior" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Error behavior" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="IsEnabled" Type="Edm.Boolean" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
				<Property Name="MinimumFontSize" Type="Edm.Int32" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
			</ComplexType>
			<Association Name="to_format" sap:content-version="1">
				<End Type="cds_zrh_erhaordermanage.SAP__DocumentDescription" Multiplicity="1" Role="FromRole_to_format"/>
				<End Type="cds_zrh_erhaordermanage.SAP__Format" Multiplicity="1" Role="ToRole_to_format"/>
				<ReferentialConstraint>
					<Principal Role="FromRole_to_format">
						<PropertyRef Name="Id"/>
					</Principal>
					<Dependent Role="ToRole_to_format">
						<PropertyRef Name="Id"/>
					</Dependent>
				</ReferentialConstraint>
			</Association>
			<Association Name="to_tablecolumns" sap:content-version="1">
				<End Type="cds_zrh_erhaordermanage.SAP__DocumentDescription" Multiplicity="1" Role="FromRole_to_tablecolumns"/>
				<End Type="cds_zrh_erhaordermanage.SAP__TableColumns" Multiplicity="*" Role="ToRole_to_tablecolumns"/>
				<ReferentialConstraint>
					<Principal Role="FromRole_to_tablecolumns">
						<PropertyRef Name="Id"/>
					</Principal>
					<Dependent Role="ToRole_to_tablecolumns">
						<PropertyRef Name="Id"/>
					</Dependent>
				</ReferentialConstraint>
			</Association>
			<Association Name="to_coverpage" sap:content-version="1">
				<End Type="cds_zrh_erhaordermanage.SAP__DocumentDescription" Multiplicity="1" Role="FromRole_to_coverpage"/>
				<End Type="cds_zrh_erhaordermanage.SAP__CoverPage" Multiplicity="*" Role="ToRole_to_coverpage"/>
				<ReferentialConstraint>
					<Principal Role="FromRole_to_coverpage">
						<PropertyRef Name="Id"/>
					</Principal>
					<Dependent Role="ToRole_to_coverpage">
						<PropertyRef Name="Id"/>
					</Dependent>
				</ReferentialConstraint>
			</Association>
			<Association Name="to_signature" sap:content-version="1">
				<End Type="cds_zrh_erhaordermanage.SAP__DocumentDescription" Multiplicity="1" Role="FromRole_to_signature"/>
				<End Type="cds_zrh_erhaordermanage.SAP__Signature" Multiplicity="1" Role="ToRole_to_signature"/>
				<ReferentialConstraint>
					<Principal Role="FromRole_to_signature">
						<PropertyRef Name="Id"/>
					</Principal>
					<Dependent Role="ToRole_to_signature">
						<PropertyRef Name="Id"/>
					</Dependent>
				</ReferentialConstraint>
			</Association>
			<Association Name="to_pdfstandard" sap:content-version="1">
				<End Type="cds_zrh_erhaordermanage.SAP__DocumentDescription" Multiplicity="1" Role="FromRole_to_pdfstandard"/>
				<End Type="cds_zrh_erhaordermanage.SAP__PDFStandard" Multiplicity="1" Role="ToRole_to_pdfstandard"/>
				<ReferentialConstraint>
					<Principal Role="FromRole_to_pdfstandard">
						<PropertyRef Name="Id"/>
					</Principal>
					<Dependent Role="ToRole_to_pdfstandard">
						<PropertyRef Name="Id"/>
					</Dependent>
				</ReferentialConstraint>
			</Association>
			<Association Name="assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" sap:content-version="1">
				<End Type="cds_zrh_erhaordermanage.ErhaOrderType" Multiplicity="1" Role="FromRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8">
					<OnDelete Action="Cascade"/>
				</End>
				<End Type="cds_zrh_erhaordermanage.ErhaOrderItemType" Multiplicity="*" Role="ToRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8"/>
				<ReferentialConstraint>
					<Principal Role="FromRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8">
						<PropertyRef Name="ErhaOrder"/>
					</Principal>
					<Dependent Role="ToRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8">
						<PropertyRef Name="ErhaOrder"/>
					</Dependent>
				</ReferentialConstraint>
			</Association>
			<EntityContainer Name="cds_zrh_erhaordermanage_Entities" m:IsDefaultEntityContainer="true" sap:message-scope-supported="true" sap:supported-formats="atom json xlsx pdf">
				<EntitySet Name="SAP__Currencies" EntityType="cds_zrh_erhaordermanage.SAP__Currency" sap:content-version="1"/>
				<EntitySet Name="SAP__UnitsOfMeasure" EntityType="cds_zrh_erhaordermanage.SAP__UnitOfMeasure" sap:content-version="1"/>
				<EntitySet Name="SAP__MyDocumentDescriptions" EntityType="cds_zrh_erhaordermanage.SAP__DocumentDescription" sap:content-version="1"/>
				<EntitySet Name="SAP__FormatSet" EntityType="cds_zrh_erhaordermanage.SAP__Format" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:addressable="false" sap:content-version="1"/>
				<EntitySet Name="SAP__PDFStandardSet" EntityType="cds_zrh_erhaordermanage.SAP__PDFStandard" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:addressable="false" sap:content-version="1"/>
				<EntitySet Name="SAP__TableColumnsSet" EntityType="cds_zrh_erhaordermanage.SAP__TableColumns" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:addressable="false" sap:content-version="1"/>
				<EntitySet Name="SAP__CoverPageSet" EntityType="cds_zrh_erhaordermanage.SAP__CoverPage" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:addressable="false" sap:content-version="1"/>
				<EntitySet Name="SAP__SignatureSet" EntityType="cds_zrh_erhaordermanage.SAP__Signature" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:addressable="false" sap:content-version="1"/>
				<EntitySet Name="SAP__ValueHelpSet" EntityType="cds_zrh_erhaordermanage.SAP__ValueHelp" sap:content-version="1"/>
				<EntitySet Name="ErhaOrderItem" EntityType="cds_zrh_erhaordermanage.ErhaOrderItemType" sap:content-version="1" sap:deletable-path="Delete_mc" sap:updatable-path="Update_mc"/>
				<EntitySet Name="ErhaOrder" EntityType="cds_zrh_erhaordermanage.ErhaOrderType" sap:content-version="1" sap:deletable-path="Delete_mc" sap:updatable-path="Update_mc"/>
				<AssociationSet Name="to_formatSet" Association="cds_zrh_erhaordermanage.to_format" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
					<End EntitySet="SAP__MyDocumentDescriptions" Role="FromRole_to_format"/>
					<End EntitySet="SAP__FormatSet" Role="ToRole_to_format"/>
				</AssociationSet>
				<AssociationSet Name="to_pdfstandardSet" Association="cds_zrh_erhaordermanage.to_pdfstandard" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
					<End EntitySet="SAP__MyDocumentDescriptions" Role="FromRole_to_pdfstandard"/>
					<End EntitySet="SAP__PDFStandardSet" Role="ToRole_to_pdfstandard"/>
				</AssociationSet>
				<AssociationSet Name="to_tablecolumnsSet" Association="cds_zrh_erhaordermanage.to_tablecolumns" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
					<End EntitySet="SAP__MyDocumentDescriptions" Role="FromRole_to_tablecolumns"/>
					<End EntitySet="SAP__TableColumnsSet" Role="ToRole_to_tablecolumns"/>
				</AssociationSet>
				<AssociationSet Name="to_signatureSet" Association="cds_zrh_erhaordermanage.to_signature" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
					<End EntitySet="SAP__MyDocumentDescriptions" Role="FromRole_to_signature"/>
					<End EntitySet="SAP__SignatureSet" Role="ToRole_to_signature"/>
				</AssociationSet>
				<AssociationSet Name="to_coverpageSet" Association="cds_zrh_erhaordermanage.to_coverpage" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
					<End EntitySet="SAP__MyDocumentDescriptions" Role="FromRole_to_coverpage"/>
					<End EntitySet="SAP__CoverPageSet" Role="ToRole_to_coverpage"/>
				</AssociationSet>
				<AssociationSet Name="assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" Association="cds_zrh_erhaordermanage.assoc_E8E58BA809E1E1D34C5DA5DA48F898C8" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
					<End EntitySet="ErhaOrder" Role="FromRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8"/>
					<End EntitySet="ErhaOrderItem" Role="ToRole_assoc_E8E58BA809E1E1D34C5DA5DA48F898C8"/>
				</AssociationSet>
			</EntityContainer>
			<Annotations Target="cds_zrh_erhaordermanage.cds_zrh_erhaordermanage_Entities"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="Common.ApplyMultiUnitBehaviorForSortingAndFiltering" Bool="true"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.ErhaOrderType/to_Item"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="Common.Composition"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.cds_zrh_erhaordermanage_Entities/ErhaOrder"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="Capabilities.FilterRestrictions">
					<Record>
						<PropertyValue Property="NonFilterableProperties">
							<Collection>
								<PropertyPath>Delete_mc</PropertyPath>
								<PropertyPath>Update_mc</PropertyPath>
								<PropertyPath>to_Item_oc</PropertyPath>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="Capabilities.NavigationRestrictions">
					<Record>
						<PropertyValue Property="RestrictedProperties">
							<Collection>
								<Record>
									<PropertyValue Property="NavigationProperty" NavigationPropertyPath="to_Item"/>
									<PropertyValue Property="InsertRestrictions">
										<Record>
											<PropertyValue Property="Insertable" Path="to_Item_oc"/>
										</Record>
									</PropertyValue>
								</Record>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="SAP__core.OptimisticConcurrency">
					<Collection/>
				</Annotation>
				<Annotation Term="Capabilities.SortRestrictions">
					<Record>
						<PropertyValue Property="NonSortableProperties">
							<Collection>
								<PropertyPath>Delete_mc</PropertyPath>
								<PropertyPath>Update_mc</PropertyPath>
								<PropertyPath>to_Item_oc</PropertyPath>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.cds_zrh_erhaordermanage_Entities/ErhaOrderItem"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="Capabilities.FilterRestrictions">
					<Record>
						<PropertyValue Property="NonFilterableProperties">
							<Collection>
								<PropertyPath>Delete_mc</PropertyPath>
								<PropertyPath>Update_mc</PropertyPath>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="Capabilities.NavigationRestrictions">
					<Record>
						<PropertyValue Property="RestrictedProperties">
							<Collection>
								<Record>
									<PropertyValue Property="NavigationProperty" NavigationPropertyPath="to_ErhaOrder"/>
									<PropertyValue Property="InsertRestrictions">
										<Record>
											<PropertyValue Property="Insertable" Bool="false"/>
										</Record>
									</PropertyValue>
								</Record>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="SAP__core.OptimisticConcurrency">
					<Collection/>
				</Annotation>
				<Annotation Term="Capabilities.SortRestrictions">
					<Record>
						<PropertyValue Property="NonSortableProperties">
							<Collection>
								<PropertyPath>Delete_mc</PropertyPath>
								<PropertyPath>Update_mc</PropertyPath>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.cds_zrh_erhaordermanage_Entities"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="Org.OData.Capabilities.V1.BatchSupport">
					<Record Type="Org.OData.Capabilities.V1.BatchSupportType">
						<PropertyValue Property="ReferencesAcrossChangeSetsSupported" Bool="true"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__CodeList.CurrencyCodes">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__Currencies"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__CodeList.UnitsOfMeasure">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__UnitsOfMeasure"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__PDF.Features">
					<Record>
						<PropertyValue Property="DocumentDescriptionReference" String="./$metadata"/>
						<PropertyValue Property="DocumentDescriptionCollection" String="SAP__MyDocumentDescriptions"/>
						<PropertyValue Property="ArchiveFormat" Bool="true"/>
						<PropertyValue Property="CoverPage" Bool="true"/>
						<PropertyValue Property="Signature" Bool="true"/>
						<PropertyValue Property="FitToPage" Bool="true"/>
						<PropertyValue Property="FontName" Bool="true"/>
						<PropertyValue Property="FontSize" Bool="true"/>
						<PropertyValue Property="Margin" Bool="true"/>
						<PropertyValue Property="Border" Bool="true"/>
						<PropertyValue Property="ResultSizeDefault" Int="20000"/>
						<PropertyValue Property="ResultSizeMaximum" Int="20000"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__CodeList.SAP__DocumentDescription">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__MyDocumentDescriptions"/>
					</Record>
				</Annotation>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__Currency/CurrencyCode"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.Text" Path="Text"/>
				<Annotation Term="SAP__common.UnitSpecificScale" Path="DecimalPlaces"/>
				<Annotation Term="SAP__CodeList.StandardCode" Path="ISOCode"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__UnitOfMeasure/UnitCode"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.Text" Path="Text"/>
				<Annotation Term="SAP__common.UnitSpecificScale" Path="DecimalPlaces"/>
				<Annotation Term="SAP__CodeList.StandardCode" Path="ISOCode"/>
				<Annotation Term="SAP__CodeList.ExternalCode" Path="ExternalCode"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__UnitOfMeasure"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__core.AlternateKeys">
					<Collection>
						<Record>
							<PropertyValue Property="Key">
								<Collection>
									<Record>
										<PropertyValue Property="Name" Path="ExternalCode"/>
										<PropertyValue Property="Alias" String="ExternalCode"/>
									</Record>
								</Collection>
							</PropertyValue>
						</Record>
					</Collection>
				</Annotation>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__DocumentDescription/CreatedBy"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__core.Computed"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__DocumentDescription/CreatedAt"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__core.Computed"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__DocumentDescription"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__capabilties.InsertRestrictions">
					<Record>
						<PropertyValue Property="Insertable" Bool="false"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__capabilties.UpdateRestrictions">
					<Record>
						<PropertyValue Property="Updatable" Bool="false"/>
						<PropertyValue Property="QueryOptions">
							<Record>
								<PropertyValue Property="SelectSupported" Bool="true"/>
							</Record>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="SAP__capabilties.DeleteRestrictions">
					<Record>
						<PropertyValue Property="Deletable" Bool="false"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__capabilties.FilterRestrictions">
					<Record>
						<PropertyValue Property="FilterExpressionRestrictions">
							<Collection>
								<Record>
									<PropertyValue Property="Property" PropertyPath="Format/Orientation"/>
									<PropertyValue Property="AllowedExpressions" String="Multivalue"/>
								</Record>
								<Record>
									<PropertyValue Property="Property" PropertyPath="Format/PaperSize"/>
									<PropertyValue Property="AllowedExpressions" String="Multivalue"/>
								</Record>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__Format/FitToPage/ErrorRecoveryBehavior"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.ValueListReferences">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="../../../../SAP__ValueHelpSet?$filter=VALUEHELP%20eq%20%27ErrorRecoveryBehaviour%27"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__common.ValueListWithFixedValues"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__Format/FontName"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.ValueListReferences">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__ValueHelpSet?$filter=VALUEHELP%20eq%20%27FontName%27"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__common.ValueListWithFixedValues"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__Format/PaperSize"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.ValueListReferences">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__ValueHelpSet?$filter=VALUEHELP%20eq%20%27PaperSize%27"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__common.ValueListWithFixedValues"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__Format/Orientation"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.ValueListReferences">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__ValueHelpSet?$filter=VALUEHELP%20eq%20%27FontName%27"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__common.ValueListWithFixedValues"/>
			</Annotations>
			<Annotations Target="cds_zrh_erhaordermanage.SAP__TableColumns/HorizontalAlignment"
				xmlns="http://docs.oasis-open.org/odata/ns/edm">
				<Annotation Term="SAP__common.ValueListReferences">
					<Record>
						<PropertyValue Property="Url" String="./$metadata"/>
						<PropertyValue Property="CollectionPath" String="SAP__ValueHelpSet?$filter=VALUEHELP%20eq%20%27HorizontalAlignment%27"/>
					</Record>
				</Annotation>
				<Annotation Term="SAP__common.ValueListWithFixedValues"/>
			</Annotations>
		</Schema>
	</edmx:DataServices>
</edmx:Edmx>


text:
package bgames.stack;

public abstract class StackState {
  public abstract Stack next(Stack owner, OutsideWorld state);
  public boolean isReturnPoint() {
    return false;
  }
}

redpajama_set_name: RedPajamaGithub


text:
	<title>Matt Holland's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Matt Holland's panel show appearances

Matt Holland (born 1974-04-11[ref]) has appeared in 12 episodes between 2006-2013.  Matt Holland on Wikipedia.

2006

2007

2008

2009

2010

2011

2012

2013

2013-05-25 / A Question of Sport

2012-03-03 / Fighting Talk

2011-11-04 / A Question of Sport

2011-08-06 / Fighting Talk

2011-05-27 / A Question of Sport

2011-02-19 / Fighting Talk

2010-10-23 / Fighting Talk

2010-01-30 / Fighting Talk

2009-10-31 / Fighting Talk

2008-10-24 / A Question of Sport

2007-03-02 / A Question of Sport

2006-04-21 / A Question of Sport


text:
<!DOCTYPE html>

		<meta charset="UTF-8">
		<title> Scrolling Ad 賴建宏 JavaScript Homework #4</title>
		<meta name="author" content="Henry Lai"/>
		<meta name="date" content="2016/2/16"/>
		<meta name="description" content="JS Homework #4"/>
		<meta name="keywords" content="EEIT85, JavaScript, JS, Homework"/>

Home

九九乘法表

表單製作

評點製作

廣告輪播

年日曆

記憶遊戲

五子棋

                        1
                        2
                        3
                        4
                        5

                        <input type="button" value ="Previous" id="pre" />
                        <input type="button" value="Stop" id="stop" />
                        <input type="button" value="Next" id="next" />

Aside

Event Name, mm/dd/yyyy

Event description

Event Name, mm/dd/yyyy

Event description

Event Name, mm/dd/yyyy

Event description

Event Name, mm/dd/yyyy

Event description

Event Name, mm/dd/yyyy

Event description

Event Name, mm/dd/yyyy

Event description

E-mail something@somewhere.com   Tel: (02)1234-5678   Somewhere in Taipei, Taiwan   © 2015 All Rights Reserved.   Written by Henry Lai.


text:
import * as React from "react";
import { createRef } from "react";

import * as d3 from "d3";

import { convertToRelative } from "../../helpers/convertToRelative";
import { interpolateArray } from "../../helpers/interpolateArray";
import { costsFor, PriceCategory } from "../../helpers/PriceCalculator";
import { UsageData, UsageField } from "../../models/UsageData";
import { assertNever } from "../../lib/assertNever";
import { getTimes } from "suncalc";
import { DayDescription, GraphXOffset, PeriodDescription } from "../../models/PeriodDescription";

type Props = {
    label: string;
    periodDescription: PeriodDescription;
    data: (UsageData | null)[];
    maxY: number;
    fieldName: UsageField;
    color: string;
    colorIntense: string;
    onClick: (index: number) => void;
    tooltipLabelBuilder: (title: number) => string;
    xOffset: GraphXOffset;
};

type DragSelectionData = {
    selectionStartPx: number;
    selectionEndPx: number;

    previousSelectionStartBand: number | null;
    previousSelectionEndBand: number | null;
    previousSelectionRelevantIndexes: number[];
};

const width = 480;
const height = 240;
const padding = {
    top: 30,
    right: 10,
    bottom: 10,
    left: 10
};

const axisWidth = 30;
const axisHeight = 10;

export class Graph extends React.Component<Props> {
    private readonly elementRef = createRef<SVGSVGElement>();

    private svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any> | null = null;

    private readonly scaleX: d3.ScaleBand<string>;
    /* When the user drags to select a number of bars,
     * it's necessary to find the bars corresponding to the
     * coordinates on-screen. Sadly, the BandScale that we use for
     * positioning the bars does not have an `inverse(x)` method,
     * so we build a second (linear) scale that matches the BandScale
     * and use that for finding the current bar for given x-coordinates.
     */
    private readonly scaleXForInversion: d3.ScaleLinear<number, number, never>;
    private readonly xAxis: d3.Axis<string>;

    private readonly scaleY: d3.ScaleLinear<number, number, never>;
    private readonly yAxis: d3.Axis<d3.NumberValue>;

    private mouseIsDown = false;
    private isDragging = false;
    private ignoreClickEvent = false;

    private dragSelectionData: DragSelectionData | null = null;

    constructor(props: Props) {
        super(props);

        this.scaleX = d3.scaleBand().padding(0.15).paddingOuter(0);
        this.scaleXForInversion = d3.scaleLinear();
        this.xAxis = d3.axisBottom(this.scaleX.align(0));

        this.scaleY = d3.scaleLinear().clamp(true);
        this.yAxis = d3.axisLeft(this.scaleY);
    }

    componentDidMount() {
        this.initializeGraph();
        this.renderGraph(this.svg!);
    }

    componentDidUpdate() {
        this.renderGraph(this.svg!);
    }

    render() {
        // Values are rendered above the selection for the tooltip
        return (
            <svg className="periodUsageGraph" id={`chart_${this.props.fieldName}`} ref={this.elementRef}>
                <g className="xAxis" />
                <g className="yAxis" />
                <g className="gridLines" />
                <g className="additionalInfo" />
                <g className="values" />
                <g className="selection">
                    <rect />
                </g>
            </svg>
        );
    }

    private initializeGraph() {
        const id = this.elementRef.current!.id;

        this.svg = d3
            .select("#" + id)
            .attr("viewBox", `0 0 ${width} ${height}`)
            .style("background-color", "white");

        addChartTitle(this.svg);

        this.svg.on("touchstart", (event: TouchEvent) => {
            if (event.touches.length === 1) {
                event.preventDefault();

                const touch = event.touches.item(0);

                if (!!touch) {
                    this.onDragStart(touch);
                }
            }
        });
        this.svg
            .on("mousedown", (event) => {
                event.preventDefault();

                this.onDragStart(event);
            })

            .on("touchmove", (event: TouchEvent) => {
                if (event.touches.length === 1) {
                    event.preventDefault();

                    const item = event.touches.item(0);

                    if (!!item) {
                        this.onDragMove(item);
                    }
                }
            })
            .on("mousemove", (event) => {
                event.preventDefault();

                this.onDragMove(event);
            })
            .on("touchend", () => {
                this.onDragEnd();
            })

            .on("mouseup", () => {
                this.onDragEnd();
            })

            .on("click", () => {
                if (this.ignoreClickEvent) {
                    return;
                }

                this.svg!.select("g.selection").select("rect").attr("display", "none");
                this.dragSelectionData = null;

                this.renderChartTitle(this.totalUsage());
                this.resetBarColors();
            });
    }

    private onDragStart = (item: Touch) => {
        this.mouseIsDown = true;

        const selectionStartPx = d3.pointer(item)[0];
        this.dragSelectionData = {
            selectionStartPx: selectionStartPx,
            selectionEndPx: selectionStartPx,
            previousSelectionStartBand: null,
            previousSelectionEndBand: null,
            previousSelectionRelevantIndexes: []
        };

        this.resetBarColors();
    };

    private onDragMove = (item: Touch) => {
        if (!this.mouseIsDown || !this.dragSelectionData) {
            return;
        }

        this.isDragging = true;
        this.dragSelectionData.selectionEndPx = d3.pointer(item)[0];

        const leftEdge = Math.min(this.dragSelectionData.selectionStartPx, this.dragSelectionData.selectionEndPx);
        const rightEdge = Math.max(this.dragSelectionData.selectionStartPx, this.dragSelectionData.selectionEndPx);

        this.svg!.select("g.selection")
            .select("rect")
            .attr("display", "block")
            .attr("x", leftEdge)
            .attr("y", padding.top)
            .attr("width", rightEdge - leftEdge)
            .attr("height", this.scaleY(0) - padding.top)
            .attr("fill", "rgba(128, 128, 128, 0.2)");

        const startBand = Math.max(-1, this.findBandForX(leftEdge, this.props.xOffset));
        const endBand = this.findBandForX(rightEdge, this.props.xOffset);

        if (
            startBand !== this.dragSelectionData.previousSelectionStartBand ||
            endBand !== this.dragSelectionData.previousSelectionEndBand
        ) {
            const relevantIndexes = this.calculateRelevantIndexesFromBands(startBand, endBand);

            const elementsToClear = d3.difference(
                this.dragSelectionData.previousSelectionRelevantIndexes,
                relevantIndexes
            );
            const elementsToFill = d3.difference(
                relevantIndexes,
                this.dragSelectionData.previousSelectionRelevantIndexes
            );

            const allBars = this.svg!.select("g.values").selectAll("rect");

            allBars.filter((_el, i) => elementsToClear.has(i)).attr("fill", this.props.color);
            allBars.filter((_el, i) => elementsToFill.has(i)).attr("fill", this.props.colorIntense);

            const total = this.calculateTotalFromBandIndexes(startBand, endBand);

            this.renderChartTitle(total);

            this.dragSelectionData.previousSelectionStartBand = startBand;
            this.dragSelectionData.previousSelectionEndBand = endBand;
            this.dragSelectionData.previousSelectionRelevantIndexes = relevantIndexes;
        }
    };

    private onDragEnd = () => {
        if (this.isDragging) {
            /* If the user clicks in the graph when we're not dragging, the selection should be hidden.
             * However, the click event also occurs after a mouseup and can't be easily prevented.
             *
             * Here, we set a variable that can be checked by the click event. The setTimeout
             * makes sure that it is only reset after the current event loop.
             */
            this.ignoreClickEvent = true;
            setTimeout(() => {
                this.ignoreClickEvent = false;
            }, 0);
        }

        this.isDragging = false;
        this.mouseIsDown = false;
    };

    private resetBarColors() {
        this.svg!.select("g.values").selectAll("rect").attr("fill", this.props.color);
    }

    private calculateRelevantIndexesFromBands(startBand: number, endBand: number) {
        if (startBand === -1 && endBand === -1) {
            return [];
        }

        return d3.range(startBand - 1, endBand);
    }

    private calculateTotalFromBandIndexes(startBand: number, endBand: number) {
        const relevantIndexes = this.calculateRelevantIndexesFromBands(startBand, endBand);

        return relevantIndexes.reduce((sum, index) => sum + this.processedData[index], 0);
    }

    private findBandForX(x: number, xOffset: GraphXOffset) {
        const factor = this.scaleXForInversion.invert(x) - 1;

        const numberOfBands = this.scaleX.domain().length;

        const interpolator = d3.interpolate(1, numberOfBands);

        const value = interpolator(factor);

        const offset = xOffset === "between_values" ? 1 : 0;

        return Math.floor(value - offset);
    }

    private renderGraph(svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>) {
        const domainNumeric = d3.range(1, this.processedData.length + 1);

        const domain = d3
            .range(this.props.xOffset === "between_values" ? 0 : 1, this.processedData.length + 1, 1)
            .map((el) => el.toString());

        this.scaleX.domain(domain).range([padding.left + axisWidth, width - padding.right]);
        this.scaleXForInversion
            .domain(domainNumeric)
            .range([padding.left + axisWidth, width - padding.right - padding.left]);
        this.scaleY.domain([0, this.props.maxY]).range([height - padding.bottom - axisHeight, padding.top]);

        this.updateAxes(svg);

        this.drawGridLines(svg);
        this.drawBars(svg, this.processedData);

        this.renderChartTitle(this.totalUsage());

        /* TODO: Only draw if we're drawing days */
        if (this.props.fieldName === "stroom") {
            const { periodDescription } = this.props;

            if (periodDescription instanceof DayDescription) {
                this.drawTimesOfDay(svg, periodDescription.toDate());
            } else {
                const g = svg.select("g.additionalInfo");

                g.selectChildren().remove();
            }
        }
    }

    private renderChartTitle(usage: number, extraText?: string) {
        const firstDataElement = this.props.data[0];

        const chartTitle = buildChartTitle(this.props.label, usage, this.props.fieldName, firstDataElement);
        this.svg!.select(".chartTitle").text(extraText ? `${chartTitle} (${extraText})` : chartTitle);
    }

    private clickBar = ({ target }: { target: SVGRectElement }) => {
        const index = parseInt(target.attributes.getNamedItem("index")!.value, 10);
        this.props.onClick(index);
    };

    private showTooltip = (event: any, value: number) => {
        if (this.mouseIsDown) {
            return;
        }

        const index = parseInt(event.target.attributes.getNamedItem("index")!.value, 10);
        const contents = this.buildTooltipContents(index, value);
        const tooltip = d3.select("#tooltip");

        tooltip
            .html(contents)
            .style("left", event.pageX + 20 + "px")
            .style("top", event.pageY - 58 + "px")
            .style("display", "block");
    };

    private hideTooltip = () => {
        const tooltip = d3.select("#tooltip");
        tooltip.style("display", "none");
    };

    private updateAxes(svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>) {
        this.xAxis.tickValues(buildTicks(this.processedData.length));

        svg.select(".xAxis")
            .attr("transform", `translate(0, ${this.scaleY(0)})`)
            .call(this.xAxis as any);
        svg.select(".yAxis")
            .attr("transform", `translate(${padding.left + axisWidth}, 0)`)
            .call(this.yAxis as any);
    }

    private drawGridLines(svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>) {
        const yTickValues = this.yAxis.tickValues() || this.scaleY.ticks();
        svg.select("g.gridLines")
            .selectAll("line")
            .data(yTickValues)
            .join("line")
            .attr("x1", padding.left + axisWidth)
            .attr("y1", (el) => this.scaleY(el))
            .attr("x2", width - padding.right)
            .attr("y2", (el) => this.scaleY(el))
            .attr("stroke", "#ddd")
            .attr("stroke-width", 1);
    }

    private drawBars(svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>, relativeData: number[]) {
        svg.select("g.values")
            .selectAll("rect")
            .data(relativeData)
            .join("rect")
            .on("click", this.clickBar)
            .on("mouseenter", this.showTooltip)
            .on("mouseleave", this.hideTooltip)

            .attr("y", (el) => this.scaleY(el))
            .attr("height", (el) => this.scaleY(0) - this.scaleY(el))
            .attr("x", (_val, i) => this.calculateBarXPosition(i))
            .attr("width", this.scaleX.bandwidth())
            .attr("fill", this.props.color)
            .attr("index", (_d, i) => i);
    }

    private drawTimesOfDay(svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>, date: Date) {
        const [latitude, longitude] = [51.922909, 4.47059];

        const times = getTimes(date, latitude, longitude);

        const g = svg.select("g.additionalInfo");

        g.selectChildren().remove();

        const nightColor = "#006"; // Sun > 18deg below horizon
        const darkTwilightColor = "#559"; // Sun > 12deg below horizon
        const lightTwilightColor = "#aad"; // Sun > 0deg below horizon
        const sunriseColor = "#dd8";
        const dayColor = "#fff";

        const timeBands: { startHour: number; endHour: number; color: string }[] = [];

        const night = times.night;

        if (isNaN(night.getTime())) {
            /* No "deep" night today, so just a long dusk */
            timeBands.push({
                startHour: this.calculateX(times.dusk)!,
                endHour: this.scaleX("24")!,
                color: darkTwilightColor
            });

            timeBands.push({
                startHour: this.scaleX("0")!,
                endHour: this.calculateX(times.dawn)!,
                color: darkTwilightColor
            });
        } else {
            if (night.getHours() > 12) {
                // Dusk is one entry, and night crosses midnight
                timeBands.push({
                    startHour: this.calculateX(times.dusk)!,
                    endHour: this.calculateX(times.night)!,
                    color: darkTwilightColor
                });

                timeBands.push({
                    startHour: this.calculateX(night)!,
                    endHour: this.scaleX("24")!,
                    color: nightColor
                });

                timeBands.push({
                    startHour: this.scaleX("0")!,
                    endHour: this.calculateX(times.nightEnd)!,
                    color: nightColor
                });
            } else {
                // Night is one entry and dusk crosses midnight
                timeBands.push({
                    startHour: this.calculateX(night)!,
                    endHour: this.calculateX(times.nightEnd)!,
                    color: nightColor
                });

                timeBands.push({
                    startHour: this.calculateX(times.dusk)!,
                    endHour: this.scaleX("24")!,
                    color: darkTwilightColor
                });

                timeBands.push({
                    startHour: this.scaleX("0")!,
                    endHour: this.calculateX(times.night)!,
                    color: darkTwilightColor
                });
            }

            timeBands.push({
                startHour: this.calculateX(times.nightEnd)!,
                endHour: this.calculateX(times.dawn)!,
                color: darkTwilightColor
            });
        }

        [
            {
                startTime: times.dawn,
                color: lightTwilightColor
            },
            {
                startTime: times.sunrise,
                color: sunriseColor
            },
            {
                startTime: times.sunriseEnd,
                color: dayColor
            },
            {
                startTime: times.sunsetStart,
                color: sunriseColor
            },
            {
                startTime: times.sunset,
                color: lightTwilightColor
            },
            {
                // This one is not actually used
                startTime: times.dusk,
                color: darkTwilightColor
            }
        ].forEach(({ startTime, color }, index, array) => {
            const endTime = array[index + 1]?.startTime;

            if (!endTime) {
                return;
            }

            timeBands.push({
                startHour: this.calculateX(startTime)!,
                endHour: this.calculateX(endTime)!,
                color: color
            });
        });

        timeBands.forEach(({ startHour, endHour, color }) => {
            g.append("rect")
                .attr("x", startHour)
                .attr("y", padding.top)
                .attr("width", endHour - startHour)
                .attr("height", this.scaleY(0) - padding.top)
                .attr("fill", color)
                .attr("fill-opacity", 0.15);
        });
    }

    private calculateX(date: Date): number | null {
        /* Interpolate position because `this.scaleX` only interpolates full
         * bars based on hours */
        const startOfHourBar = this.scaleX(date.getHours().toString());
        const endOfHourBar = this.scaleX((date.getHours() + 1).toString());

        if (!startOfHourBar || !endOfHourBar) {
            return null;
        }

        const width = endOfHourBar - startOfHourBar;

        return startOfHourBar + width * (date.getMinutes() / 60);
    }

    private totalUsage() {
        const actualValues = this.dataForField().filter(isNotNull);

        return Math.max(...actualValues) - Math.min(...actualValues);
    }

    private calculateBarXPosition(i: number) {
        const shiftBars = this.props.xOffset === "between_values" ? this.scaleX.bandwidth() / 2 : 0;
        const pos = this.scaleX((i + 1).toString());

        return !!pos ? pos - shiftBars : 0;
    }

    private buildTooltipContents(index: number, value: number) {
        return `${this.props.tooltipLabelBuilder(index)}:<br />${value} ${unit(this.props.fieldName)}`;
    }

    private dataForField(): (number | null)[] {
        return this.props.data.map((u) => {
            return u?.[this.props.fieldName] ?? null;
        });
    }

    private get processedData(): number[] {
        const interpolatedData = interpolateArray(this.dataForField());
        const relativeData = convertToRelative(interpolatedData);
        const roundedData = relativeData.map((value) => truncate(value, 3));

        return roundedData;
    }
}

function buildChartTitle(
    label: string,
    usage: number,
    fieldName: UsageField,
    firstDataElement: UsageData | null
): string {
    return `${label}: ${printableTotal(usage)} ${unit(fieldName)} (${printableCosts(
        usage,
        fieldName,
        firstDataElement
    )})`;
}

function printableTotal(usage: number): string {
    return truncate(usage, 1).toString().replace(".", ",");
}

function printableCosts(usage: number, fieldName: UsageField, firstDataElement: UsageData | null): string {
    if (!firstDataElement) {
        return "0";
    }

    const firstTimestamp = new Date(firstDataElement.time_stamp);

    const category = getCategory(fieldName);

    return costsFor(usage, category, firstTimestamp).toString();
}

function getCategory(fieldName: UsageField): PriceCategory {
    switch (fieldName) {
        case "gas":
            return PriceCategory.Gas;
        case "water":
            return PriceCategory.Water;
        case "stroom":
            return PriceCategory.Stroom;
    }
}

function isNotNull<T>(x: T | null | undefined): x is T {
    return x !== null && x !== undefined;
}

function truncate(value: number, precision: number): number {
    return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);
}

function unit(fieldName: UsageField) {
    switch (fieldName) {
        case "gas":
            return "m³";
        case "stroom":
            return "kWh";
        case "water":
            return "L";
        default:
            return assertNever(fieldName);
    }
}

function buildTicks(dataCount: number): string[] {
    return d3.range(1, dataCount + 1, 2).map((el) => el.toString());
}

function addChartTitle(svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>) {
    const middleOfChart = (padding.left + axisWidth + (width - padding.right)) / 2;

    svg.append("text")
        .attr("class", "chartTitle")
        .attr("x", middleOfChart)
        .attr("y", padding.top / 2)
        .style("text-anchor", "middle")
        .style("font-style", "italic");
}


text:
(function( jQuery ) {

var // Promise methods
	promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
	// Static reference to slice
	sliceDeferred = [].slice;

jQuery.extend({
	// Create a simple deferred (one callbacks list)
	_Deferred: function() {
		var // callbacks list
			callbacks = [],
			// stored [ context , args ]
			fired,
			// to avoid firing when already doing so
			firing,
			// flag to know if the deferred has been cancelled
			cancelled,
			// the deferred itself
			deferred  = {

				// done( f1, f2, ...)
				done: function() {
					if ( !cancelled ) {
						var args = arguments,
							i,
							length,
							elem,
							type,
							_fired;
						if ( fired ) {
							_fired = fired;
							fired = 0;
						}
						for ( i = 0, length = args.length; i < length; i++ ) {
							elem = args[ i ];
							type = jQuery.type( elem );
							if ( type === "array" ) {
								deferred.done.apply( deferred, elem );
							} else if ( type === "function" ) {
								callbacks.push( elem );
							}
						}
						if ( _fired ) {
							deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
						}
					}
					return this;
				},

				// resolve with given context and args
				resolveWith: function( context, args ) {
					if ( !cancelled && !fired && !firing ) {
						// make sure args are available (#8421)
						args = args || [];
						firing = 1;
						try {
							while( callbacks[ 0 ] ) {
								callbacks.shift().apply( context, args );
							}
						}
						finally {
							fired = [ context, args ];
							firing = 0;
						}
					}
					return this;
				},

				// resolve with this as context and given arguments
				resolve: function() {
					deferred.resolveWith( this, arguments );
					return this;
				},

				// Has this deferred been resolved?
				isResolved: function() {
					return !!( firing || fired );
				},

				// Cancel
				cancel: function() {
					cancelled = 1;
					callbacks = [];
					return this;
				}
			};

		return deferred;
	},

	// Full fledged deferred (two callbacks list)
	Deferred: function( func ) {
		var deferred = jQuery._Deferred(),
			failDeferred = jQuery._Deferred(),
			promise;
		// Add errorDeferred methods, then and promise
		jQuery.extend( deferred, {
			then: function( doneCallbacks, failCallbacks ) {
				deferred.done( doneCallbacks ).fail( failCallbacks );
				return this;
			},
			fail: failDeferred.done,
			rejectWith: failDeferred.resolveWith,
			reject: failDeferred.resolve,
			isRejected: failDeferred.isResolved,
			// Get a promise for this deferred
			// If obj is provided, the promise aspect is added to the object
			promise: function( obj ) {
				if ( obj == null ) {
					if ( promise ) {
						return promise;
					}
					promise = obj = {};
				}
				var i = promiseMethods.length;
				while( i-- ) {
					obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
				}
				return obj;
			}
		} );
		// Make sure only one callback list will be used
		deferred.done( failDeferred.cancel ).fail( deferred.cancel );
		// Unexpose cancel
		delete deferred.cancel;
		// Call given func if any
		if ( func ) {
			func.call( deferred, deferred );
		}
		return deferred;
	},

	// Deferred helper
	when: function( firstParam ) {
		var args = arguments,
			i = 0,
			length = args.length,
			count = length,
			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
				firstParam :
				jQuery.Deferred();
		function resolveFunc( i ) {
			return function( value ) {
				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
				if ( !( --count ) ) {
					deferred.resolveWith( deferred, args );
				}
			};
		}
		if ( length > 1 ) {
			for( ; i < length; i++ ) {
				if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
					args[ i ].promise().then( resolveFunc(i), deferred.reject );
				} else {
					--count;
				}
			}
			if ( !count ) {
				deferred.resolveWith( deferred, args );
			}
		} else if ( deferred !== firstParam ) {
			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
		}
		return deferred.promise();
	}
});

})( jQuery );


text:
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Organizer.Web.Config;
using Organizer.Web.Services;

namespace Organizer.Web
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .AddJsonFile("appsettings.json")
                .AddEnvironmentVariables();

            Configuration = builder.Build();
        }

        public IConfigurationRoot Configuration { get; set; }

        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure<RethinkDBConfig>(Configuration.GetSection("RethinkDB"));
            services.AddTransient<IDataStore, RethinkDBDataStore>();

            services.AddAuthorization(options =>
            {
                options.AddPolicy("AdminAccess", policy => policy.RequireRole("Administrator"));
            });

            services.AddMvc();
        }

        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler( "/Home/Error");
            }

            app.UseIISPlatformHandler();

            app.UseStaticFiles();

            app.UseCookieAuthentication(options =>
            {
                options.AuthenticationScheme = "Cookies";
                options.LoginPath = new PathString("/Auth/Login");
                options.AccessDeniedPath = new PathString("/Auth/Denied");
                options.AutomaticAuthenticate = true;
                options.AutomaticChallenge = true;
            });

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "areaRoute",
                    template: "{area:exists}/{controller=Home}/{action=Index}");

                routes.MapRoute(
                    name: "defaultRoute",
                    template: "{controller=Home}/{action=Index}");

            });
        }

        // Entry point for the application.
        public static void Main(string[] args) => WebApplication.Run<Startup>(args);
    }
}


text:
package org.wso2.siddhi.core.query.output.callback;

import org.wso2.siddhi.core.event.StreamEvent;
import org.wso2.siddhi.core.exception.QueryCreationException;
import org.wso2.siddhi.core.table.EventTable;
import org.wso2.siddhi.query.api.definition.Attribute;
import org.wso2.siddhi.query.api.definition.StreamDefinition;

import java.util.List;

public class InsertIntoTableCallback implements OutputCallback {
    private EventTable eventTable;

    public InsertIntoTableCallback(EventTable eventTable, StreamDefinition outputStreamDefinition) {
        this.eventTable = eventTable;
        validateInsertIntoTable(eventTable.getTableDefinition().getAttributeList(), outputStreamDefinition.getAttributeList());
    }

    private void validateInsertIntoTable(List<Attribute> tableAttributeList, List<Attribute> outStreamAttributeList) {
        if (tableAttributeList.size() != outStreamAttributeList.size()) {
            throw new QueryCreationException("Event table " + eventTable.getTableDefinition().getTableId() + " expects " + tableAttributeList.size() + " attributes but found " + outStreamAttributeList.size() + " attributes");
        } else {
            for (int i = 0; i < tableAttributeList.size(); i++) {
                Attribute tableAttribute = tableAttributeList.get(i);
                Attribute streamAttribute = outStreamAttributeList.get(i);
                if (tableAttribute.getType() != streamAttribute.getType()) {
                    throw new QueryCreationException("Event table " + eventTable.getTableDefinition().getTableId() + " expects " + tableAttribute.getType() + " as attribute:" + (i + 1) + " but found type " + streamAttribute.getType());
                }
            }
        }
    }

    @Override
    public void send(StreamEvent streamEvent) {
        eventTable.add(streamEvent);
    }
}


text:
Hermione
===========

## Установка

```shell
npm i hermione --save-dev
```

## Запуск тестов

```shell
node_modules/.bin/hermione path/to/tests --baseUrl http://yandex.ru/search --grid http://localhost:4444/wd/hub
```

## Конфигурация

**hermione** настраивается с помощью конфигурационного файла. Путь к этому файлу можно задать с помощью опции `--conf`. Стандартное имя файла -  `.hermione.conf.js`.

Ниже приведён пример полного конфига. Обязательными полями являются `specs` и `browsers`.

```javascript
var command = require('path/to/command');

module.exports = {
    grid: 'http://localhost:4444/wd/hub',
    baseUrl: 'http://yandex.ru/search',
    waitTimeout: 10000,
    debug: true,
    sessionsPerBrowser: 2,
    retry: 2,

    plugins: {
        'my-cool-plugin': {
            param: 'value'
        }
    },

    specs: [
        'tests/desktop',
        'tests/touch'
    ],

    browsers: {
        chrome: {
            desiredCapabilities: {
                browserName: 'chrome'
            },
            sessionsPerBrowser: 3,
            retry: 3
        },

        firefox: {
            desiredCapabilities: {
                browserName: 'firefox'
            },
            sessionsPerBrowser: 10 // по умолчанию тесты запускаются в одной сессии
        }
    },

    // Дополнительная настройка mocha
    mochaOpts: {
        retries: 3
    },

    prepareBrowser: function (browser) {
        browser.addCommand('command', command);
    },

    // Кастомизация окружения
    prepareEnvironment: function() {
        if (process.env.desktop) {
            this.specs = ['tests/desktop'];
        }
    }
};
```

## Описание конфигурационного файла

### Настройки браузеров

Браузеры, в которых необходимо запускать тесты, настраиваются в секции `browsers`.
Формат секции:
```js
browsers: {
    <browser_id> {
        <setting>:<value>
        <setting>:<value>
    }
}
```
Значение `<browser-id>` используется в отчёте для идентификации браузера.
Доступные настройки браузера:

* `desiredCapabilities` (обязательная) - Необходимые для этого браузера WebDriver [DesiredCapabilites](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities)
* `sessionsPerBrowser` - Количество одновременно запущеных сессий для браузера с данным id. По умолчанию 1.
* `retry` - Сколько раз тест может быть перезапущен. По умолчанию 0.

### Подготовка webdriver-сессии к работе
Подготовка сессии к работе (например, установка специфических для пользователя команд) выполняется в секции `prepareBrowser`.
Формат секции:
```js
prepareBrowser: function(browser) {
    // do setup here
}
```

В данную функцию будет передана сессия `webdriver.io`.

### Кастомизация настройки окружения

Данные в конфиге можно изменять в зависимости от дополнительных условий в функции `prepareEnvironment`. Использование этой функции не обязательно, она для удобства.

## Плагины
hermione поддерживает расширения.
Плагин представляет из себя модуль, экспортирующий одну единственную функцию. Эта функция принимает на вход два параметра:
* инстанс hermione
* опции плагина из конфига

В момент запуска тестов плагин будет загружен и вызван с текущим инстансом hermione и опциями конфига, соответствующими данному плагину.

Если название модуля плагина начинается с `hermione-`, то в конфиге этот префикс можно опустить. Если в зависимостях есть два модуля, например `hermione-some-module` и `some-module`, то приоритет отдается модулю с префиксом.

Пример.
```js
// .hermione.conf.js
...
plugins: {
    'my-cool-plugin': {
        param: 'value'
    }
}
...

// hermione-my-cool-plugin/index.js
module.exports = function(hermione, opts) {
    hermione.on(hermione.events.RUNNER_START, function() {
        return setUp(hermione.config, opts.param); // config can be mutated
    });

    hermione.on(hermione.events.RUNNER_END, function() {
        return tearDown();
    });
}
```

Свойства объекта hermione:
* `config` - конфиг, который используется в раннере. Может быть модифицирован
* `events` - список событий, на которые можно подписаться

#### События
* `RUNNER_START` - триггерится перед запуском тестов. Обработчик может вернуть промис, тесты запустятся только после того как промис зарезолвится
* `RUNNER_END` - триггерится после завершения всех тестов. Аналогично `RUNNER_START`, обработчик может вернуть промис
* `SUITE_BEGIN` - запустился новый сьют
* `SUITE_END` - сьют завершен
* `TEST_BEGIN` - тест пошел на исполнение
* `TEST_END` - тест завершился
* `TEST_PASS` - тест пройден
* `TEST_FAIL` - тест упал
* `TEST_PENDING` - тест скипнут
* `RETRY` - тест упал, но ушел на retry
* `ERROR` - произошла какая-то ошибка не в тесте, например не поднялся браузер
* `INFO` - (зарезервировано)
* `WARNING` - (зарезервировано)
* `EXIT` - триггерится когда получен сигнал на завершение (например при нажатии на Ctrl + C). Обработчик может вернуть промис

### Прочие свойства

* `specs`(обязательный) - Массив путей до директорий с тестами.
* `grid` – URL до Selenium grid. По умолчанию `http://localhost:4444/wd/hub`
* `baseUrl` - Базовый URL тестируемой страницы. По умолчанию `localhost`
* `timeout` - Время ожидания выполнения теста. По умолчанию `60000`
* `waitTimeout` - Время ожидания события на странице. По умолчанию `10000`
* `slow` - Если время выполнения теста превышает это значение, то тест считается медленным. По умолчанию `10000`
* `debug` - Включает вывод отладочной информации в консоль. По умолчанию `false`
* `sessionsPerBrowser` - Глобальное значение опции `sessionsPerBrowser` для всех браузеров
* `retry` - Глобальное значение опции `retry` для всех браузеров

### Переопределение настроек

С помощью CLI можно переопределить параметры, используя следующие опции:

* `-c|--conf` - указать путь к конфигу. По умолчанию используется файл с именем `.hermione.conf.js`
* `--baseUrl` - задать базовый `url` для всех тестов
* `--wait-timeout` - время ожидания событий на странице в миллисекундах. По умолчанию 10000
* `-b|--browser` - запуск тестов в определенном браузере. Возможно задать несколько браузеров одновременно. Например,
```
node_modules/.bin/hermione -b chrome --browser firefox
```
* `-r|--reporter` - указать используемый репортер. Возможно задать несколько репортеров одновременно. Например,
```
node_modules/.bin/hermione -r flat --reporter teamcity
```
* `--debug` - включить debug-режим


text:
Configuration

    <form ng-submit="data.sendSettings()" >

                Decimation
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#dcmtion" aria-expanded="false" aria-controls="dcmtion">
                    Info
                </button>

The Decimation is the number of ignored points you have between two saved points. The values of each saved points are averaged with the ignored ones

                <select ng-init="data.settings.decimation = 1" class="form-control" id="decimation" placeholder="1 or 8" ng-model="data.settings.decimation"
				>
                     <option type="number" value="1" ng-click="deci_bool=0">1</option>
                     <option type="number" value="8" ng-click="deci_bool=1">8</option>
                </select>

                Start of measurement xo
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#b_mesu" aria-expanded="false" aria-controls="b_mesu">
                    Info
                </button>

The image is made between xo and xf (in mm)

                <input ng-if="deci_bool" type="number" class="form-control" id="b_mesu" placeholder="Between 0 and 255" ng-model="data.settings.b_mesu" min="0" max="255" step="1" ng-click="b_mesu_ctrl" required>
                <input ng-if="!deci_bool" type="number"  class="form-control" id="b_mesu" placeholder="Between 0 and {{(data.settings.decimation * 1 -1)/7*255 + (data.settings.decimation * 1 -8)/7*(-97)}}" ng-model="data.settings.b_mesu" min="0" max="97" step="1" ng-click="b_mesu_ctrl" required>

                End of measurement xf
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#e_mesu" aria-expanded="false" aria-controls="e_mesu">
                    Info
                </button>

The image is made between xo and xf (in mm)

                <input ng-if="deci_bool" type="number" class="form-control" id="e_mesu" placeholder="Between {{data.settings.b_mesu + 1}} and 255" ng-model="data.settings.e_mesu" min={{data.settings.b_mesu+1}} max="255" step="1" required>
				<input ng-if="!deci_bool" type="number" class="form-control" id="e_mesu" placeholder="Between {{data.settings.b_mesu + 1}} and 97" ng-model="data.settings.e_mesu" min={{data.settings.b_mesu+1}} max="97" step="1" required>

                Value of the ramp at the beginning
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#d_ramp" aria-expanded="false" aria-controls="d_ramp">
                    Info
                </button>

The ramp drives the TGC (VGA): at 0 there is no amplification, 1 is the  amplification maximum

                <input type="number" class="form-control" id="d_ramp" placeholder="Between 0 and 255" ng-model="data.settings.d_ramp" min="0" max="255" step="1" required>

                Value of the ramp at the end
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#e_ramp" aria-expanded="false" aria-controls="e_ramp">
                    Info
                </button>

The ramp drives the TGC (VGA): at 0 there is no amplification, 1 is the  amplification maximum

                <input type="number" class="form-control" id="e_ramp" placeholder="Between {{data.settings.d_ramp + 1}} and 255" ng-model="data.settings.e_ramp" min="{{data.settings.d_ramp + 1}}" max="255" step="1" required>

                Angle of the sector
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#angle" aria-expanded="false" aria-controls="angle">
                    Info
                </button>

Total angle of the image

                <input type="number" class="form-control" id="angle" placeholder="Between 1 and 180" ng-model="data.settings.angle" min="1" max="180" step="1" required>

                Number of lines
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#nb_lin" aria-expanded="false" aria-controls="nb_lin">
                    Info
                </button>

Number of lines.

                <input type="number" class="form-control" id="nb_lin" placeholder="Between 1 and 255" ng-model="data.settings.nb_lin" min="1" max="255" step="1" required>

                Number of images
                <button class="btn btn-info btn-xs btn-rnd" type="button" data-toggle="collapse" data-target="#nb_img" aria-expanded="false" aria-controls="nb_img">
                    Info
                </button>

The number of images.

                <input type="number" class="form-control" id="nb_img" placeholder="Between 1 and 50" ng-model="data.settings.nb_img" min="1" max="50" step="1" required>

<button type="submit" class="btn btn-primary col-xs-12" ng-click ="data.setProcess()">Next</button>

Processing ... please wait a few seconds.

    </form>


text:
import unittest
from transcode.src import process_audio
from transcode.src import read_xwav_header
from pydub import AudioSegment
import os

class TestReadHeader(unittest.TestCase):
    def setUp(self):
        pass

    def testProcess(self):
        generator = process_audio.process_and_split_audiofile(
            'transcode/tests/audio/Palmyra5_stWT_080829_154230.d20.x.wav',
            60)

        res = []
        for r in generator:
            res.append(r)

        r = res[0]
        self.assertEqual(r['audio'].duration_seconds, 75)
        self.assertEqual(r['time_start_original'], 1220024550000.0)
        self.assertEqual(r['time_start'], 1220024550000.0)
        self.assertEqual(r['time_end'], 1220024550000.0 + 75000)
        self.assertEqual(r['chunk_index_start'], 0)
        self.assertEqual(r['chunk_index_end'], 0)
        self.assertEqual(r['duration'], 75)
        self.assertIsNotNone(r['header'])

        r = res[1]
        self.assertEqual(r['time_start'], 1220024625000.0)
        self.assertEqual(r['audio'].duration_seconds, 75)
        self.assertEqual(r['chunk_index_start'], 1)

        r = res[2]
        self.assertEqual(r['time_start'], 1220025600000.0)
        self.assertEqual(r['audio'].duration_seconds, 75)
        self.assertEqual(r['chunk_index_start'], 2)

        r = res[3]
        self.assertEqual(r['time_start'], 1220025675000.0)
        self.assertEqual(r['audio'].duration_seconds, 75)
        self.assertEqual(r['chunk_index_start'], 3)
        self.assertEqual(r['time_offset'], 0)

    def testProcessLongerMaxDuration(self):
        generator = process_audio.process_and_split_audiofile(
            'transcode/tests/audio/Palmyra5_stWT_080829_154230.d20.x.wav',
            200)

        res = []
        for r in generator:
            res.append(r)

        r = res[0]
        self.assertEqual(r['audio'].duration_seconds, 150)
        self.assertEqual(r['time_start'], 1220024550000.0)
        self.assertEqual(r['chunk_index_start'], 0)
        self.assertEqual(r['chunk_index_end'], 1)
        self.assertIsNotNone(r['header'])

        r = res[1]
        self.assertEqual(r['audio'].duration_seconds, 150)
        self.assertEqual(r['chunk_index_start'], 2)

        r = res[2]
        self.assertEqual(r['audio'].duration_seconds, 150)
        self.assertEqual(r['chunk_index_start'], 4)

        r = res[3]
        self.assertEqual(r['audio'].duration_seconds, 75)

    def testProcessMaxDuration(self):
        generator = process_audio.process_and_split_audiofile(
            'transcode/tests/audio/Palmyra5_stWT_080829_154230.d20.x.wav',
            20000)

        res = []
        for r in generator:
            res.append(r)

        r = res[0]
        self.assertEqual(r['audio'].duration_seconds, 150)
        self.assertEqual(r['time_start'], 1220024550000.0)
        self.assertIsNotNone(r['header'])

        r = res[1]
        self.assertEqual(r['audio'].duration_seconds, 300)

        r = res[2]
        self.assertEqual(r['audio'].duration_seconds, 75)

    # def testWeirdHeaderTimecode(self):
        with self.assertRaises(Exception):
            g = process_audio.process_and_split_audiofile(
                'transcode/tests/audio/wrong_timecode_header.wav',
                60)
            g.next()

    def testNonLinearAudiofile(self):
        with self.assertRaises(Exception):
            g = process_audio.process_and_split_audiofile(
                'transcode/tests/audio/wrong_order.wav',
                60)
            g.next()

    def testGetDestinationName(self):
        fileIn = open('transcode/tests/audio/Palmyra5_stWT_080829_154230.d20.x.wav', 'rb')
        # header = read_xwav_header.read_header(fileIn)

        filename = process_audio.get_destination_name('Palmyra5_stWT_080829_154230.d20.wav', 3, 'mp3')
        self.assertEqual(filename,'Palmyra5_stWT_080829_154230.d20.0003.mp3')

        filename = process_audio.get_destination_name('test/Palmyra5_stWT_080829_154230.d20.wav', 300, 'wav')
        self.assertEqual(filename,'Palmyra5_stWT_080829_154230.d20.0300.wav')
        fileIn.close()

    # def testExport(self):
    #     generator = process_audio.process_and_split_audiofile(
    #         'transcode/tests/audio/Palmyra5_stWT_080829_154230.d20.x.wav',
    #         60)

    #     if os.path.exists('/tmp/export.wav'):
    #         os.remove('/tmp/export.wav')

    #     for r in generator:
    #         path = process_audio.export_wav(r['audio'])
    #         self.assertTrue(os.path.exists(path))
    #         sound1 = AudioSegment.from_file(path, format="wav")
    #         self.assertEqual(sound1.duration_seconds, 75)

    #         path = process_audio.export_mp3(r['audio'])
    #         self.assertTrue(os.path.exists(path))
    #         sound2 = AudioSegment.from_file(path, format="mp3")
    #         self.assertEqual(sound2.duration_seconds, 75)

    def testReadSubchunks(self):
        chunks = process_audio.read_subchunks('transcode/tests/audio/Palmyra5_stWT_080829_154230.d20.x.wav')
        print(chunks)
        self.assertEqual(len(chunks), 7)

        self.assertEqual(chunks[0]['time_start'], 1220024550000.0)
        self.assertEqual(chunks[0]['time_end'], chunks[1]['time_start'])
        self.assertEqual(chunks[0]['chunk_index'], 0)
        self.assertEqual(chunks[0]['duration'], 75)

    # def testOffset(self):
    #     fileIn = open('/Hawaii19K_DL10_150223_024718.df20.x.wav', 'rb')
    #     header = read_xwav_header.read_header(fileIn)
    #     offsets = process_audio.calculate_offsets(header)
    #     print(offsets)

    # def testFullFile(self):
    #     subchunks = process_audio.read_subchunks('/Hawaii19K_DL10_150223_024718.df20.x.wav')

    #     t = subchunks[0]['time_start']
    #     for chunk in subchunks:
    #         if t != chunk['time_start']:
    #             raise Exception("%i: wrong time %f != %f offset %f" % (chunk['chunk_index'], t,chunk['time_start'], chunk['time_offset'] ) )

    #         t = chunk['time_end']
if __name__ == '__main__':
    unittest.main()


text:
<?php
/**
 * Created by PhpStorm.
 * User: Cangzhou.Wu
 * Date: 15-6-30
 * Time: 下午1:37
 */

namespace star\member;

use matter\base\BaseBootstrap;

class Bootstrap extends BaseBootstrap{

    public  $_modelMap = [
        'DeliveryAddress' => 'star\member\models\DeliveryAddress',
        'Wishlist' => 'star\member\models\Wishlist',
    ];
    public $settingCode = 'system_module_member';
}


text:
describe('<CarMarker />', () => {
  it('Expect to have unit tests specified', () => {
    expect(true).toEqual(false);
  });
});


text:
/* eslint-disable no-undef, no-console */
window.alert = msg => { console.log(msg); };
window.scrollTo = () => { };


text:
const config = require('./webpack.common.config.js');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');

// Using AOT TypeScript compiler.
config.module.rules.unshift(
    {
        test: /\.ts$/,
        use: '@ngtools/webpack',
        exclude: [/\.(spec|e2e)\.ts$/]
    }
);

config.plugins.push(
    // AOT Angular Plugin
    new AotPlugin({
        tsConfigPath: path.join(__dirname, '../tsconfig.json'),
        entryModule: path.join(__dirname, '../src/frontend/scripts/app.module#AppModule')
    }),
    // HTML Webpack Plugin with dev not present (aka false)
    new HtmlWebpackPlugin({
        template: path.join(__dirname, '../src/frontend/index.html.ejs'),
        favicon: path.join(__dirname, '../src/frontend/resources/favicons/favicon.ico'),
        filename: path.join(__dirname, '../target/classes/static/index.html'),
        inject: 'body',
        minify: {
            minifyCSS: true,
            minifyJS: true,
            removeComments: true,
            collapseWhitespace: true,
            collapseInlineTagWhitespace: true
        },
        chunksSortMode: 'dependency'
    })
);

module.exports = config;


text:
using document::BucketId;
using storage::adjusted_num_stripes;
using storage::calc_num_stripe_bits;
using storage::stripe_of_bucket_key;
using storage::tune_num_stripes_based_on_cpu_cores;
constexpr uint8_t MUB = storage::spi::BucketLimits::MinUsedBits;

TEST(BucketStripeUtilsTest, stripe_of_bucket_key)
{
    BucketId id(MUB, std::numeric_limits<uint64_t>::max());
    uint64_t key = id.stripUnused().toKey();
    EXPECT_EQ(0, stripe_of_bucket_key(key, 0));
    EXPECT_EQ(1, stripe_of_bucket_key(key, 1));
    EXPECT_EQ(3, stripe_of_bucket_key(key, 2));
    EXPECT_EQ(127, stripe_of_bucket_key(key, 7));
    EXPECT_EQ(255, stripe_of_bucket_key(key, 8));
}

TEST(BucketStripeUtilsTest, calc_num_stripe_bits)
{
    EXPECT_EQ(0, calc_num_stripe_bits(1));
    EXPECT_EQ(1, calc_num_stripe_bits(2));
    EXPECT_EQ(2, calc_num_stripe_bits(4));
    EXPECT_EQ(7, calc_num_stripe_bits(128));
    EXPECT_EQ(8, calc_num_stripe_bits(256));
}

TEST(BucketStripeUtilsTest, adjusted_num_stripes)
{
    EXPECT_EQ(0, adjusted_num_stripes(0));
    EXPECT_EQ(1, adjusted_num_stripes(1));
    EXPECT_EQ(2, adjusted_num_stripes(2));
    EXPECT_EQ(4, adjusted_num_stripes(3));
    EXPECT_EQ(256, adjusted_num_stripes(255));
    EXPECT_EQ(256, adjusted_num_stripes(256));
    EXPECT_EQ(256, adjusted_num_stripes(257));
}

TEST(BucketStripeUtilsTest, max_stripe_values)
{
    EXPECT_EQ(8, storage::MaxStripeBits);
    EXPECT_EQ(256, storage::MaxStripes);
}

TEST(BucketStripeUtilsTest, num_stripes_tuned_based_on_cpu_cores)
{
    EXPECT_EQ(1, tune_num_stripes_based_on_cpu_cores(0));
    EXPECT_EQ(1, tune_num_stripes_based_on_cpu_cores(1));
    EXPECT_EQ(1, tune_num_stripes_based_on_cpu_cores(16));
    EXPECT_EQ(2, tune_num_stripes_based_on_cpu_cores(17));
    EXPECT_EQ(2, tune_num_stripes_based_on_cpu_cores(64));
    EXPECT_EQ(4, tune_num_stripes_based_on_cpu_cores(65));
}


text:
/**
 * @file
 *   This file implements the Energy Scan Client.
 */

#define WPP_NAME "energy_scan_client.tmh"
#include <openthread/config.h>

#include "energy_scan_client.hpp"

#include <openthread/platform/random.h>

#include "coap/coap_header.hpp"
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/encoding.hpp"
#include "common/logging.hpp"
#include "meshcop/meshcop.hpp"
#include "meshcop/meshcop_tlvs.hpp"
#include "thread/thread_netif.hpp"
#include "thread/thread_uri_paths.hpp"

#if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD

using ot::Encoding::BigEndian::HostSwap16;
using ot::Encoding::BigEndian::HostSwap32;

namespace ot {

EnergyScanClient::EnergyScanClient(ThreadNetif &aThreadNetif) :
    ThreadNetifLocator(aThreadNetif),
    mEnergyScan(OT_URI_PATH_ENERGY_REPORT, &EnergyScanClient::HandleReport, this)
{
    mContext = NULL;
    mCallback = NULL;
    aThreadNetif.GetCoap().AddResource(mEnergyScan);
}

otError EnergyScanClient::SendQuery(uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
                                    uint16_t aScanDuration, const Ip6::Address &aAddress,
                                    otCommissionerEnergyReportCallback aCallback, void *aContext)
{
    ThreadNetif &netif = GetNetif();
    otError error = OT_ERROR_NONE;
    Coap::Header header;
    MeshCoP::CommissionerSessionIdTlv sessionId;
    MeshCoP::ChannelMask0Tlv channelMask;
    MeshCoP::CountTlv count;
    MeshCoP::PeriodTlv period;
    MeshCoP::ScanDurationTlv scanDuration;
    Ip6::MessageInfo messageInfo;
    Message *message = NULL;

    VerifyOrExit(netif.GetCommissioner().IsActive(), error = OT_ERROR_INVALID_STATE);

    header.Init(aAddress.IsMulticast() ? OT_COAP_TYPE_NON_CONFIRMABLE : OT_COAP_TYPE_CONFIRMABLE,
                OT_COAP_CODE_POST);
    header.SetToken(Coap::Header::kDefaultTokenLength);
    header.AppendUriPathOptions(OT_URI_PATH_ENERGY_SCAN);
    header.SetPayloadMarker();

    VerifyOrExit((message = MeshCoP::NewMeshCoPMessage(netif.GetCoap(), header)) != NULL,
                 error = OT_ERROR_NO_BUFS);

    sessionId.Init();
    sessionId.SetCommissionerSessionId(netif.GetCommissioner().GetSessionId());
    SuccessOrExit(error = message->Append(&sessionId, sizeof(sessionId)));

    channelMask.Init();
    channelMask.SetMask(aChannelMask);
    SuccessOrExit(error = message->Append(&channelMask, sizeof(channelMask)));

    count.Init();
    count.SetCount(aCount);
    SuccessOrExit(error = message->Append(&count, sizeof(count)));

    period.Init();
    period.SetPeriod(aPeriod);
    SuccessOrExit(error = message->Append(&period, sizeof(period)));

    scanDuration.Init();
    scanDuration.SetScanDuration(aScanDuration);
    SuccessOrExit(error = message->Append(&scanDuration, sizeof(scanDuration)));

    messageInfo.SetSockAddr(netif.GetMle().GetMeshLocal16());
    messageInfo.SetPeerAddr(aAddress);
    messageInfo.SetPeerPort(kCoapUdpPort);
    messageInfo.SetInterfaceId(netif.GetInterfaceId());
    SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));

    otLogInfoMeshCoP(GetInstance(), "sent energy scan query");

    mCallback = aCallback;
    mContext = aContext;

exit:

    if (error != OT_ERROR_NONE && message != NULL)
    {
        message->Free();
    }

    return error;
}

void EnergyScanClient::HandleReport(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
                                    const otMessageInfo *aMessageInfo)
{
    static_cast<EnergyScanClient *>(aContext)->HandleReport(
        *static_cast<Coap::Header *>(aHeader), *static_cast<Message *>(aMessage),
        *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
}

void EnergyScanClient::HandleReport(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
{
    ThreadNetif &netif = GetNetif();
    MeshCoP::ChannelMask0Tlv channelMask;
    Ip6::MessageInfo responseInfo(aMessageInfo);

    OT_TOOL_PACKED_BEGIN
    struct
    {
        MeshCoP::EnergyListTlv tlv;
        uint8_t list[OPENTHREAD_CONFIG_MAX_ENERGY_RESULTS];
    } OT_TOOL_PACKED_END energyList;

    VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE &&
                 aHeader.GetCode() == OT_COAP_CODE_POST);

    otLogInfoMeshCoP(GetInstance(), "received energy scan report");

    SuccessOrExit(MeshCoP::Tlv::GetTlv(aMessage, MeshCoP::Tlv::kChannelMask, sizeof(channelMask), channelMask));
    VerifyOrExit(channelMask.IsValid());

    SuccessOrExit(MeshCoP::Tlv::GetTlv(aMessage, MeshCoP::Tlv::kEnergyList, sizeof(energyList), energyList.tlv));
    VerifyOrExit(energyList.tlv.IsValid());

    if (mCallback != NULL)
    {
        mCallback(channelMask.GetMask(), energyList.list, energyList.tlv.GetLength(), mContext);
    }

    SuccessOrExit(netif.GetCoap().SendEmptyAck(aHeader, responseInfo));

    otLogInfoMeshCoP(GetInstance(), "sent energy scan report response");

exit:
    return;
}

}  // namespace ot

#endif // OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD


text:
#ifndef _LUA_LUAPROC_SCHED_H_
#define _LUA_LUAPROC_SCHED_H_

#include "luaproc.h"

/****************************************
 * scheduler functions return constants *
 ***************************************/

/* scheduler function return constants */
#define	LUAPROC_SCHED_OK                 0
#define LUAPROC_SCHED_PTHREAD_ERROR     -1

/*************************************
 * default number of initial workers *
 ************************************/

/* scheduler default number of worker threads */
#define LUAPROC_SCHED_DEFAULT_WORKER_THREADS 1

/***********************
 * function prototypes *
 **********************/

/* initialize scheduler */
int sched_init( void );
/* join workers */
void sched_join_workers( void );
/* wait until there are no more active lua processes */
void sched_wait( void );
/* move process to ready queue (ie, schedule process) */
void sched_queue_proc( luaproc *lp );
/* increase active luaproc count */
void sched_inc_lpcount( void );
/* set number of active workers (creates and destroys accordingly) */
int sched_set_numworkers( int numworkers );
/* return the number of active workers */
int sched_get_numworkers( void );

#endif


text:
We love contributors! Your help is welcome to make this project better!

Some simple guidelines we'd like you to follow.

## Got Questions or Problems?

If you have questions about http-proxy-middle usage; Please check if your question hasn't been already answered on [Stack Overflow](http://stackoverflow.com/search?q=%22http-proxy-middleware%22) or in our [issue archive](https://github.com/chimurai/http-proxy-middleware/issues?utf8=%E2%9C%93&q=is%3Aissue+), [examples](https://github.com/chimurai/http-proxy-middleware/tree/master/examples) and [recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes).

Since Nodejitsu's `http-proxy` is providing the actual proxy functionality; You might find your answer in their [documentation](https://github.com/nodejitsu/node-http-proxy), [issue archive](https://github.com/nodejitsu/node-http-proxy/issues?utf8=%E2%9C%93&q=is%3Aissue) or [examples](https://github.com/nodejitsu/node-http-proxy/tree/master/examples).

Feel free to [ask a question](https://github.com/chimurai/http-proxy-middleware/issues) if the above resources didn't answer your question.

Tips on how to ask: http://stackoverflow.com/help/how-to-ask

## Report Issues

If you think you've found an issue, please submit it to the [Github issue tracker](https://github.com/chimurai/http-proxy-middleware/issues).

"*[It doesn't work](https://goo.gl/GzkkTg)*" is not very useful for anyone.
A good issue report should have a well described **problem description** and proxy **configuration**. A great issue report includes a **minimal example**.

Properly format your code example for easier reading: [Code and Syntax Highlighting](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting).

The quality of your issue report will determine how quickly and deeply we'll delve into it. Some simple pointers for reporting an issue:

#### Problem Description

- describe the problem
- steps taken (request urls)
- found
- expected

#### Configuration / Setup

- http-proxy-middleware version
- http-proxy-middleware configuration

It might be useful to provide server information in which http-proxy-middleware is used and the target server information to which requests are being proxied.

- server + version (express, connect, browser-sync, etc...)
    + server port number
- target server
    + target server port number

### Minimal example

Provide a minimal example to exclude external factors. This will greatly help identifying the issue.

Tips on how to create a minimal example: http://stackoverflow.com/help/mcve

## New Feature?

Request a new feature by submitting an issue into our [Github issue tracker](https://github.com/chimurai/http-proxy-middleware/issues).

PRs are welcome. Please discuss it in our [Github issue tracker](https://github.com/chimurai/http-proxy-middleware/issues) before you start working on it, to avoid wasting your time and effort in case we are already (planning to) working on it.

## Documentation

Feel free to send PRs to improve the documentation, [examples](https://github.com/chimurai/http-proxy-middleware/tree/master/examples) and [recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes).


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2.FlowerShop
{
    class Program
    {
        static void Main(string[] args)
        {
            var magnolii = int.Parse(Console.ReadLine());
            var zumbuli = int.Parse(Console.ReadLine());
            var roses = int.Parse(Console.ReadLine());
            var cactuses = int.Parse(Console.ReadLine());
            var giftPrice = double.Parse(Console.ReadLine());

            var magnoliaPrice = 3.25;
            var zumbuliPrice = 4.0;
            var rosesPrice = 3.5;
            var cactusesPrice = 8.0;

            var sum = (magnolii * magnoliaPrice + zumbuli * zumbuliPrice + roses * rosesPrice +
                cactuses * cactusesPrice) * 0.95;

            if (sum >= giftPrice)
            {
                Console.WriteLine("She is left with {0} leva.", Math.Floor(sum - giftPrice));
            }
            else
            {
                Console.WriteLine("She will have to borrow {0} leva.", Math.Ceiling(giftPrice - sum));
            }
        }
    }
}


text:
package javax.xml.parsers;

@com.francetelecom.rd.stubs.annotation.ClassDone(0)
public abstract class SAXParser
{
  // Constructors

  protected SAXParser(){
  }
  // Methods

  public abstract void setProperty(java.lang.String arg1, java.lang.Object arg2) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
  public abstract java.lang.Object getProperty(java.lang.String arg1) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
  public void reset(){
  }
  public void parse(java.io.InputStream arg1, org.xml.sax.HandlerBase arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.io.InputStream arg1, org.xml.sax.HandlerBase arg2, java.lang.String arg3) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.io.InputStream arg1, org.xml.sax.helpers.DefaultHandler arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.io.InputStream arg1, org.xml.sax.helpers.DefaultHandler arg2, java.lang.String arg3) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.lang.String arg1, org.xml.sax.HandlerBase arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.lang.String arg1, org.xml.sax.helpers.DefaultHandler arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.io.File arg1, org.xml.sax.HandlerBase arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(java.io.File arg1, org.xml.sax.helpers.DefaultHandler arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(org.xml.sax.InputSource arg1, org.xml.sax.HandlerBase arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public void parse(org.xml.sax.InputSource arg1, org.xml.sax.helpers.DefaultHandler arg2) throws org.xml.sax.SAXException, java.io.IOException{
  }
  public abstract org.xml.sax.XMLReader getXMLReader() throws org.xml.sax.SAXException;
  public abstract boolean isNamespaceAware();
  public abstract boolean isValidating();
  public javax.xml.validation.Schema getSchema(){
    return (javax.xml.validation.Schema) null;
  }
  public boolean isXIncludeAware(){
    return false;
  }
  public abstract org.xml.sax.Parser getParser() throws org.xml.sax.SAXException;
}


text:
using namespace std;

int main(){

int size,i,count,majorityElement;
count = 0;
cout<<"Enter the number of elements\n";
cin>>size;
int A[size];
cout<<"Enter the elements\n";

	for(i=0;i<size;i++)
	cin>>A[i];

majorityElement = A[0];
count = 1;

for(i=1;i<size;i++){
	if(A[i] == majorityElement)
		count++;
	else
		count--;

	if(count == 0){
		majorityElement = A[i];
		count = 1;
	}
}

if(count > 0)
cout<<"Majority element is "<<majorityElement<<"\n";
else
cout<<"No majority element exists\n";
return 0;
}