text:
SELECT
  ekpo.MANDT AS Client_MANDT,
  ekpo.EBELN AS DocumentNumber_EBELN,
  ekpo.EBELP AS Item_EBELP,
  ekpo.LOEKZ AS DeletionFlag_LOEKZ,
  ekko.BUKRS AS Company_BUKRS,
  ekko.BSTYP AS DocumentCategory_BSTYP,
  ekko.BSART AS DocumentType_BSART,
  ekko.BSAKZ AS ControlFlag_BSAKZ,
  ekko.LOEKZ AS DeletionFlagHdr_LOEKZ,
  ekko.STATU AS Status_STATU,
  ekko.AEDAT AS CreatedOn_AEDAT,
  ekko.ERNAM AS CreatedBy_ERNAM,
  ekko.PINCR AS ItemNumberInterval_PINCR,
  ekko.LPONR AS LastItemNumber_LPONR,
  ekko.LIFNR AS VendorAccountNumber_LIFNR,
  ekko.SPRAS AS Language_SPRAS,
  ekko.ZTERM AS TermsPaymentKey_ZTERM,
  ekko.ZBD1T AS DiscountDays1_ZBD1T,
  ekko.ZBD2T AS DiscountDays2_ZBD2T,
  ekko.ZBD3T AS DiscountDays3_ZBD3T,
  ekko.ZBD1P AS CashDiscountPercentage1_ZBD1P,
  ekko.ZBD2P AS CashDiscountPercentage2_ZBD2P,
  ekko.EKORG AS PurchasingOrganization_EKORG,
  ekko.EKGRP AS PurchasingGroup_EKGRP,
  ekko.WAERS AS CurrencyKey_WAERS,
  ekko.WKURS AS ExchangeRate_WKURS,
  ekko.KUFIX AS FlagFixingExchangeRate_KUFIX,
  ekko.BEDAT AS PurchasingDocumentDate_BEDAT,
  ekko.KDATB AS StartValidityPeriod_KDATB,
  ekko.KDATE AS EndValidityPeriod_KDATE,
  ekko.BWBDT AS ClosingDateforApplications_BWBDT,
  ekko.ANGDT AS Deadline_ANGDT,
  ekko.BNDDT AS BindingPeriodforQuotation_BNDDT,
  ekko.GWLDT AS WarrantyDate_GWLDT,
  ekko.AUSNR AS Bidinvitationnumber_AUSNR,
  ekko.ANGNR AS QuotationNumber_ANGNR,
  ekko.IHRAN AS QuotationSubmissionDate_IHRAN,
  ekko.IHREZ AS YourReference_IHREZ,
  ekko.VERKF AS VendorSalesperson_VERKF,
  ekko.TELF1 AS VendorTelephone_TELF1,
  ekko.LLIEF AS SupplyingVendor_LLIEF,
  ekko.KUNNR AS Customer_KUNNR,
  ekko.KONNR AS PrincipalPurchaseAgreement_KONNR,
  ekko.AUTLF AS CompleteDeliveryStipulated_AUTLF,
  ekko.WEAKT AS GoodsReceiptMsgFlag_WEAKT,
  ekko.RESWK AS SupplyTransportOrders_RESWK,
  ekko.KTWRT AS AreaPerDistributionValue_KTWRT,
  ekko.SUBMI AS CollectiveNumber_SUBMI,
  ekko.KNUMV AS Numberthedocumentcondition_KNUMV,
  ekko.KALSM AS Procedure_KALSM,
  ekko.STAFO AS UpdateGroupStatistics_STAFO,
  ekko.LIFRE AS DifferentInvoicingParty_LIFRE,
  ekko.EXNUM AS ForeignTradeDocument_EXNUM,
  ekko.UNSEZ AS OurReference_UNSEZ,
  ekko.LOGSY AS LogicalSystem_LOGSY,
  ekko.UPINC AS ItemNumberInterval_UPINC,
  ekko.STAKO AS TimeDependentConditions_STAKO,
  ekko.FRGGR AS Releasegroup_FRGGR,
  ekko.FRGSX AS ReleaseStrategy_FRGSX,
  ekko.FRGKE AS PurchasingDocumentRelease_FRGKE,
  ekko.FRGZU AS ReleaseStatus_FRGZU,
  ekko.FRGRL AS ReleaseIncomplete_FRGRL,
  ekko.LANDS AS CountryforTaxReturn_LANDS,
  ekko.LPHIS AS SchedulingAgreement_LPHIS,
  ekko.ADRNR AS Address_ADRNR,
  ekko.STCEG_L AS CountrySalesTaxIDNumber_STCEG_L,
  ekko.STCEG AS VATRegistrationNumber_STCEG,
  ekko.ABSGR AS ReasonforCancellation_ABSGR,
  ekko.ADDNR AS AdditionalDocument_ADDNR,
  ekko.KORNR AS CorrectionMiscProvisions_KORNR,
  ekko.MEMORY AS IncompleteFlag_MEMORY,
  ekko.PROCSTAT AS ProcessingState_PROCSTAT,
  ekko.RLWRT AS ValueAtRelease_RLWRT,
  ekko.REVNO AS VersionnumberinPurchasing_REVNO,
  ekko.SCMPROC AS SCMProcess_SCMPROC,
  ekko.REASON_CODE AS GoodsReceiptReason_REASON_CODE,
  ekko.MEMORYTYPE AS CategoryIncompleteness_MEMORYTYPE,
  ekko.RETTP AS RetentionFlag_RETTP,
  ekko.MSR_ID AS ProcessIdentificationNumber_MSR_ID,
  ekko.HIERARCHY_EXISTS AS PartaContractHierarchy_HIERARCHY_EXISTS,
  ekko.THRESHOLD_EXISTS AS ExchangeThresholdValue_THRESHOLD_EXISTS,
  ekko.LEGAL_CONTRACT AS LegalContractNumber_LEGAL_CONTRACT,
  ekko.DESCRIPTION AS ContractName_DESCRIPTION,
  ekko.RELEASE_DATE AS ReleaseDateContract_RELEASE_DATE,
  ekko.HANDOVERLOC AS Physicalhandover_HANDOVERLOC,
  ekko.FORCE_ID AS InternalKeyforForceElement_FORCE_ID,
  ekko.FORCE_CNT AS InternalCounter_FORCE_CNT,
  ekko.RELOC_ID AS RelocationID_RELOC_ID,
  ekko.RELOC_SEQ_ID AS RelocationStepID_RELOC_SEQ_ID,
  ekko.SOURCE_LOGSYS AS Logicalsystem_SOURCE_LOGSYS,
  ekko.VZSKZ AS InterestcalculationFlag_VZSKZ,
  ekko.POHF_TYPE AS SeasonalProcesingDocument_POHF_TYPE,
  ekko.EQ_EINDT AS SameDeliveryDate_EQ_EINDT,
  ekko.EQ_WERKS AS SameReceivingPlant_EQ_WERKS,
  ekko.FIXPO AS FirmDealFlag_FIXPO,
  ekko.EKGRP_ALLOW AS TakeAccountPurchGroup_EKGRP_ALLOW,
  ekko.WERKS_ALLOW AS TakeAccountPlants_WERKS_ALLOW,
  ekko.CONTRACT_ALLOW AS TakeAccountContracts_CONTRACT_ALLOW,
  ekko.PSTYP_ALLOW AS TakeAccountItemCategories_PSTYP_ALLOW,
  ekko.FIXPO_ALLOW AS TakeAccountFixedDate_FIXPO_ALLOW,
  ekko.KEY_ID_ALLOW AS ConsiderBudget_KEY_ID_ALLOW,
  ekko.AUREL_ALLOW AS TakeAccountAllocTableRelevance_AUREL_ALLOW,
  ekko.DELPER_ALLOW AS TakeAccountDlvyPeriod_DELPER_ALLOW,
  ekko.EINDT_ALLOW AS TakeAccountDeliveryDate_EINDT_ALLOW,
  ekko.LTSNR_ALLOW AS IncludeVendorSubrange_LTSNR_ALLOW,
  ekko.OTB_LEVEL AS OTBCheckLevel_OTB_LEVEL,
  ekko.OTB_COND_TYPE AS OTBConditionType_OTB_COND_TYPE,
  ekko.KEY_ID AS UniqueNumberBudget_KEY_ID,
  ekko.OTB_VALUE AS RequiredBudget_OTB_VALUE,
  ekko.OTB_CURR AS OTBCurrency_OTB_CURR,
  ekko.OTB_RES_VALUE AS ReservedBudgetforOTB_OTB_RES_VALUE,
  ekko.OTB_SPEC_VALUE AS SpecialReleaseBudget_OTB_SPEC_VALUE,
  ekko.BUDG_TYPE AS BudgetType_BUDG_TYPE,
  ekko.OTB_STATUS AS OTBCheckStatus_OTB_STATUS,
  ekko.OTB_REASON AS ReasonFlagforOTBCheckStatus_OTB_REASON,
  ekko.CHECK_TYPE AS TypeOTBCheck_CHECK_TYPE,
  ekko.CON_OTB_REQ AS OTBRelevantContract_CON_OTB_REQ,
  ekko.CON_PREBOOK_LEV AS OTBFlagLevelforContracts_CON_PREBOOK_LEV,
  ekko.CON_DISTR_LEV AS DistributionUsingTargetValueorItemData_CON_DISTR_LEV,
  ekpo.STATU AS RFQtatus_STATU,
  ekpo.AEDAT AS ChangeDate_AEDAT,
  ekpo.TXZ01 AS ShortText_TXZ01,
  ekpo.MATNR AS MaterialNumber_MATNR,
  ekpo.EMATN AS MaterialNumber_EMATN,
  ekpo.BUKRS AS CompanyCode_BUKRS,
  ekpo.WERKS AS Plant_WERKS,
  ekpo.LGORT AS StorageLocation_LGORT,
  ekpo.BEDNR AS RequirementTrackingNumber_BEDNR,
  ekpo.MATKL AS MaterialGroup_MATKL,
  ekpo.INFNR AS NumberofPurchasingInfoRecord_INFNR,
  ekpo.IDNLF AS MaterialNumberVendor_IDNLF,
  ekpo.KTMNG AS TargetQuantity_KTMNG,
  ekpo.MENGE AS POQuantity_MENGE,
  ekpo.MEINS AS UoM_MEINS,
  ekpo.BPRME AS OrderPriceUnit_BPRME,
  ekpo.BPUMZ AS OrderUnitNumerator_BPUMZ,
  ekpo.BPUMN AS OrderUnitDenominator_BPUMN,
  ekpo.UMREZ AS NumeratorforConversionofOrderUnittoBaseUnit_UMREZ,
  ekpo.UMREN AS DenominatorforConversionofOrderUnittoBaseUnit_UMREN,
  ekpo.PEINH AS PriceUnit_PEINH,
  ekpo.AGDAT AS DeadlineforSubmissionofBid_AGDAT,
  ekpo.WEBAZ AS GoodsReceiptProcessingTimeinDays_WEBAZ,
  ekpo.MWSKZ AS Taxcode_MWSKZ,
  ekpo.BONUS AS SettlementGroup1_BONUS,
  ekpo.INSMK AS StockType_INSMK,
  ekpo.SPINF AS UpdateInfoRecordFlag_SPINF,
  ekpo.PRSDR AS PricePrintout_PRSDR,
  ekpo.SCHPR AS EstimatedPriceFlag_SCHPR,
  ekpo.MAHNZ AS NumberofReminders_MAHNZ,
  ekpo.MAHN1 AS NumberofDaysforFirstReminder_MAHN1,
  ekpo.MAHN2 AS NumberofDaysforSecondReminder_MAHN2,
  ekpo.MAHN3 AS NumberofDaysforThirdReminder_MAHN3,
  ekpo.UEBTO AS OverdeliveryToleranceLimit_UEBTO,
  ekpo.UEBTK AS UnlimitedOverdeliveryAllowed_UEBTK,
  ekpo.UNTTO AS UnderdeliveryToleranceLimit_UNTTO,
  ekpo.BWTAR AS ValuationType_BWTAR,
  ekpo.BWTTY AS ValuationCategory_BWTTY,
  ekpo.ABSKZ AS RejectionFlag_ABSKZ,
  ekpo.AGMEM AS InternalCommentonQuotation_AGMEM,
  ekpo.ELIKZ AS DeliveryCompletedFlag_ELIKZ,
  ekpo.EREKZ AS FinalInvoiceFlag_EREKZ,
  ekpo.PSTYP AS ItemCategoryinPurchasingDocument_PSTYP,
  ekpo.KNTTP AS AccountAssignmentCategory_KNTTP,
  ekpo.KZVBR AS ConsumptionPosting_KZVBR,
  ekpo.VRTKZ AS DistributionFlagformultipleaccountassignment_VRTKZ,
  ekpo.TWRKZ AS PartialInvoiceFlag_TWRKZ,
  ekpo.WEPOS AS GoodsReceiptFlag_WEPOS,
  ekpo.WEUNB AS GoodsReceiptNonValuated_WEUNB,
  ekpo.REPOS AS InvoiceReceiptFlag_REPOS,
  ekpo.WEBRE AS FlagGRBasedInvoiceVerification_WEBRE,
  ekpo.KZABS AS OrderAcknowledgmentRequirement_KZABS,
  ekpo.LABNR AS OrderAcknowledgmentNumber_LABNR,
  ekpo.KONNR AS NumberofPrincipalPurchaseAgreement_KONNR,
  ekpo.KTPNR AS ItemNumberofPrincipalPurchaseAgreement_KTPNR,
  ekpo.ABDAT AS ReconciliationDateforAgreedCumulativeQuantity_ABDAT,
  ekpo.ABFTZ AS AgreedCumulativeQuantity_ABFTZ,
  ekpo.ETFZ1 AS FirmZone_ETFZ1,
  ekpo.ETFZ2 AS TradeOffZone_ETFZ2,
  ekpo.KZSTU AS FirmTradeOffZones_KZSTU,
  ekpo.NOTKZ AS ExclusioninOutlineAgreementItemwithMaterialClass_NOTKZ,
  ekpo.LMEIN AS BaseUnitofMeasure_LMEIN,
  ekpo.EVERS AS ShippingInstructions_EVERS,
  ekpo.NAVNW AS Nondeductibleinputtax_NAVNW,
  ekpo.ABMNG AS Standardreleaseorderquantity_ABMNG,
  ekpo.PRDAT AS DateofPriceDetermination_PRDAT,
  ekpo.BSTYP AS PurchasingDocumentCategory_BSTYP,
  ekpo.XOBLR AS Itemaffectscommitments_XOBLR,
  ekpo.ADRNR AS Manualaddressnumberinpurchasingdocumentitem_ADRNR,
  ekpo.EKKOL AS ConditionGroupwithVendor_EKKOL,
  ekpo.SKTOF AS ItemDoesNotQualifyforCashDiscount_SKTOF,
  ekpo.STAFO AS Updategroupforstatisticsupdate_STAFO,
  ekpo.PLIFZ AS PlannedDeliveryTimeinDays_PLIFZ,
  ekpo.NTGEW AS NetWeight_NTGEW,
  ekpo.GEWEI AS UnitofWeight_GEWEI,
  ekpo.TXJCD AS TaxJurisdiction_TXJCD,
  ekpo.ETDRK AS FlagPrintrelevantSchedulelinesexist_ETDRK,
  ekpo.SOBKZ AS SpecialStockFlag_SOBKZ,
  ekpo.ARSNR AS Settlementreservationnumber_ARSNR,
  ekpo.ARSPS AS Itemnumberofthesettlementreservation_ARSPS,
  ekpo.INSNC AS QualityinspectionFlagcannotbechanged_INSNC,
  ekpo.SSQSS AS ControlKeyforQualityManagementinProcurement_SSQSS,
  ekpo.ZGTYP AS CertificateType_ZGTYP,
  ekpo.EAN11 AS InternationalArticleNumber_EAN11,
  ekpo.BSTAE AS ConfirmationControlKey_BSTAE,
  ekpo.REVLV AS RevisionLevel_REVLV,
  ekpo.GEBER AS Fund_GEBER,
  ekpo.FISTL AS FundsCenter_FISTL,
  ekpo.FIPOS AS CommitmentItem_FIPOS,
  ekpo.KO_GSBER AS Businessareareportedtothepartner_KO_GSBER,
  ekpo.KO_PARGB AS assumedbusinessareaofthebusinesspartner_KO_PARGB,
  ekpo.KO_PRCTR AS ProfitCenter_KO_PRCTR,
  ekpo.KO_PPRCTR AS PartnerProfitCenter_KO_PPRCTR,
  ekpo.MEPRF AS PricingDateControl_MEPRF,
  ekpo.BRGEW AS GrossWeight_BRGEW,
  ekpo.VOLUM AS Volume_VOLUM,
  ekpo.VOLEH AS Volumeunit_VOLEH,
  ekpo.INCO1 AS Incoterms1_INCO1,
  ekpo.INCO2 AS Incoterms2_INCO2,
  ekpo.VORAB AS Advanceprocurement_VORAB,
  ekpo.KOLIF AS PriorVendor_KOLIF,
  ekpo.LTSNR AS VendorSubrange_LTSNR,
  ekpo.PACKNO AS Packagenumber_PACKNO,
  ekpo.FPLNR AS Invoicingplannumber_FPLNR,
  ekpo.STAPO AS Itemisstatistical_STAPO,
  ekpo.UEBPO AS HigherLevelIteminPurchasingDocuments_UEBPO,
  ekpo.LEWED AS LatestPossibleGoodsReceipt_LEWED,
  ekpo.EMLIF AS Vendortobesupplied_EMLIF,
  ekpo.LBLKZ AS Subcontractingvendor_LBLKZ,
  ekpo.SATNR AS CrossPlantConfigurableMaterial_SATNR,
  ekpo.ATTYP AS MaterialCategory_ATTYP,
  ekpo.VSART AS Shippingtype_VSART,
  ekpo.HANDOVERLOC AS Locationforaphysicalhandoverofgoods_HANDOVERLOC,
  ekpo.KANBA AS KanbanFlag_KANBA,
  ekpo.ADRN2 AS Numberofdeliveryaddress_ADRN2,
  ekpo.CUOBJ AS internalObjectNumber_CUOBJ,
  ekpo.XERSY AS EvaluatedReceiptSettlement_XERSY,
  ekpo.EILDT AS StartDateforGRBasedSettlement_EILDT,
  ekpo.DRDAT AS LastTransmission_DRDAT,
  ekpo.DRUHR AS Time_DRUHR,
  ekpo.DRUNR AS SequentialNumber_DRUNR,
  ekpo.AKTNR AS Promotion_AKTNR,
  ekpo.ABELN AS AllocationTableNumber_ABELN,
  ekpo.ABELP AS Itemnumberofallocationtable_ABELP,
  ekpo.ANZPU AS NumberofPoints_ANZPU,
  ekpo.PUNEI AS Pointsunit_PUNEI,
  ekpo.SAISO AS SeasonCategory_SAISO,
  ekpo.SAISJ AS SeasonYear_SAISJ,
  ekpo.EBON2 AS SettlementGroup2_EBON2,
  ekpo.EBON3 AS SettlementGroup3_EBON3,
  ekpo.EBONF AS ItemRelevanttoSubsequentSettlement_EBONF,
  ekpo.MLMAA AS Materialledgeractivatedatmateriallevel_MLMAA,
  ekpo.MHDRZ AS MinimumRemainingShelfLife_MHDRZ,
  ekpo.ANFNR AS RFQNumber_ANFNR,
  ekpo.ANFPS AS ItemNumberofRFQ_ANFPS,
  ekpo.KZKFG AS OriginofConfiguration_KZKFG,
  ekpo.USEQU AS Quotaarrangementusage_USEQU,
  ekpo.UMSOK AS SpecialStockFlagforPhysicalStockTransfer_UMSOK,
  ekpo.BANFN AS PurchaseRequisitionNumber_BANFN,
  ekpo.BNFPO AS ItemNumberofPurchaseRequisition_BNFPO,
  ekpo.MTART AS MaterialType_MTART,
  ekpo.UPTYP AS SubitemCategory_UPTYP,
  ekpo.UPVOR AS SubitemsExist_UPVOR,
  ekpo.KZWI1 AS Subtotal1frompricingprocedureforcondition_KZWI1,
  ekpo.KZWI2 AS Subtotal2frompricingprocedureforcondition_KZWI2,
  ekpo.KZWI3 AS Subtotal3frompricingprocedureforcondition_KZWI3,
  ekpo.KZWI4 AS Subtotal4frompricingprocedureforcondition_KZWI4,
  ekpo.KZWI5 AS Subtotal5frompricingprocedureforcondition_KZWI5,
  ekpo.KZWI6 AS Subtotal6frompricingprocedureforcondition_KZWI6,
  ekpo.SIKGR AS Processingkeyforsubitems_SIKGR,
  ekpo.MFZHI AS MaximumCumulativeMaterialGoAheadQuantity_MFZHI,
  ekpo.FFZHI AS MaximumCumulativeProductionGoAheadQuantity_FFZHI,
  ekpo.RETPO AS ReturnsItem_RETPO,
  ekpo.AUREL AS RelevanttoAllocationTable_AUREL,
  ekpo.BSGRU AS ReasonforOrdering_BSGRU,
  ekpo.LFRET AS DeliveryTypeforReturnstoVendors_LFRET,
  ekpo.MFRGR AS Materialfreightgroup_MFRGR,
  ekpo.NRFHG AS Materialqualifiesfordiscountinkind_NRFHG,
  ekpo.ABUEB AS ReleaseCreationProfile_ABUEB,
  ekpo.NLABD AS NextForecastDeliveryScheduleTransmission_NLABD,
  ekpo.NFABD AS NextJITDeliveryScheduleTransmission_NFABD,
  ekpo.KZBWS AS ValuationofSpecialStock_KZBWS,
  ekpo.FABKZ AS FlagItemRelevanttoJITDeliverySchedules_FABKZ,
  ekpo.J_1AINDXP AS InflationIndex_J_1AINDXP,
  ekpo.J_1AIDATEP AS InflationIndexDate_J_1AIDATEP,
  ekpo.MPROF AS ManufacturerPartProfile_MPROF,
  ekpo.EGLKZ AS OutwardDeliveryCompletedFlag_EGLKZ,
  ekpo.KZTLF AS StockTransfer_KZTLF,
  ekpo.KZFME AS Unitsofmeasureusage_KZFME,
  ekpo.RDPRF AS RoundingProfile_RDPRF,
  ekpo.TECHS AS StandardVariant_TECHS,
  ekpo.CHG_SRV AS Configurationchanged_CHG_SRV,
  ekpo.CHG_FPLNR AS Noinvoiceforthisitemalthoughnotfreeofcharge_CHG_FPLNR,
  ekpo.MFRPN AS ManufacturerPartNumber_MFRPN,
  ekpo.MFRNR AS NumberofaManufacturer_MFRNR,
  ekpo.EMNFR AS Externalmanufacturercodenameornumber_EMNFR,
  ekpo.NOVET AS ItemblockedforSDdelivery_NOVET,
  ekpo.AFNAM AS NameofRequester_AFNAM,
  ekpo.TZONRC AS Timezoneofrecipientlocation_TZONRC,
  ekpo.IPRKZ AS PeriodFlagforShelfLifeExpirationDate_IPRKZ,
  ekpo.LEBRE AS FlagforServiceBasedInvoiceVerification_LEBRE,
  ekpo.BERID AS MRPArea_BERID,
  ekpo.XCONDITIONS AS Conditionsforitemalthoughnoinvoice_XCONDITIONS,
  ekpo.APOMS AS APOasPlanningSystem_APOMS,
  ekpo.CCOMP AS PostingLogicintheCaseofStockTransfers_CCOMP,
  ekpo.GRANT_NBR AS Grant_GRANT_NBR,
  ekpo.FKBER AS FunctionalArea_FKBER,
  ekpo.STATUS AS StatusofPurchasingDocumentItem_STATUS,
  ekpo.RESLO AS IssuingStorageLocationforStockTransportOrder_RESLO,
  ekpo.KBLNR AS DocumentNumberforEarmarkedFunds_KBLNR,
  ekpo.KBLPOS AS EarmarkedFundsDocumentItem_KBLPOS,
  ekpo.WEORA AS AcceptanceAtOrigin_WEORA,
  ekpo.SRV_BAS_COM AS ServiceBasedCommitment_SRV_BAS_COM,
  ekpo.PRIO_URG AS RequirementUrgency_PRIO_URG,
  ekpo.PRIO_REQ AS RequirementPriority_PRIO_REQ,
  ekpo.EMPST AS Receivingpoint_EMPST,
  ekpo.DIFF_INVOICE AS DifferentialInvoicing_DIFF_INVOICE,
  ekpo.TRMRISK_RELEVANT AS RiskRelevancyinPurchasing_TRMRISK_RELEVANT,
  ekpo.SPE_ABGRU AS Reasonforrejectionofquotationsandsalesorders_SPE_ABGRU,
  ekpo.SPE_CRM_SO AS CRMSalesOrderNumberforTPOP_SPE_CRM_SO,
  ekpo.SPE_CRM_SO_ITEM AS CRMSalesOrderItemNumberinTPOP_SPE_CRM_SO_ITEM,
  ekpo.SPE_CRM_REF_SO AS CRMReferenceOrderNumberforTPOP_SPE_CRM_REF_SO,
  ekpo.SPE_CRM_REF_ITEM AS CRMReferenceSalesOrderItemNumberinTPOP_SPE_CRM_REF_ITEM,
  ekpo.SPE_CRM_FKREL AS BillingRelevanceCRM_SPE_CRM_FKREL,
  ekpo.SPE_CHNG_SYS AS LastChangerSystemType_SPE_CHNG_SYS,
  ekpo.SPE_INSMK_SRC AS StockTypeofSourceStorageLocationinSTO_SPE_INSMK_SRC,
  ekpo.SPE_CQ_CTRLTYPE AS CQControlType_SPE_CQ_CTRLTYPE,
  ekpo.SPE_CQ_NOCQ AS NoTransmissionofCumulativeQuantitiesinSARelease_SPE_CQ_NOCQ,
  ekpo.REASON_CODE AS GoodsReceiptReasonCode_REASON_CODE,
  ekpo.CQU_SAR AS CumulativeGoodsReceipts_CQU_SAR,
  ekpo.ANZSN AS Numberofserialnumbers_ANZSN,
  ekpo.SPE_EWM_DTC AS EWMDeliveryBasedToleranceCheck_SPE_EWM_DTC,
  ekpo.EXLIN AS ItemNumberLength_EXLIN,
  ekpo.EXSNR AS ExternalSorting_EXSNR,
  ekpo.EHTYP AS ExternalHierarchyCategory_EHTYP,
  ekpo.RETPC AS RetentioninPercent_RETPC,
  ekpo.DPTYP AS DownPaymentFlag_DPTYP,
  ekpo.DPPCT AS DownPaymentPercentage_DPPCT,
  ekpo.DPAMT AS DownPaymentinDocumentCurrency_DPAMT,
  ekpo.DPDAT AS DueDateforDownPayment_DPDAT,
  ekpo.FLS_RSTO AS StoreReturnwithInboundandOutboundDelivery_FLS_RSTO,
  ekpo.EXT_RFX_NUMBER AS DocumentNumberofExternalDocument_EXT_RFX_NUMBER,
  ekpo.EXT_RFX_ITEM AS ItemNumberofExternalDocument_EXT_RFX_ITEM,
  ekpo.EXT_RFX_SYSTEM AS LogicalSystem_EXT_RFX_SYSTEM,
  ekpo.SRM_CONTRACT_ID AS CentralContract_SRM_CONTRACT_ID,
  ekpo.SRM_CONTRACT_ITM AS CentralContractItemNumber_SRM_CONTRACT_ITM,
  ekpo.BLK_REASON_ID AS BlockingReasonID_BLK_REASON_ID,
  ekpo.BLK_REASON_TXT AS BlockingReasonText_BLK_REASON_TXT,
  ekpo.ITCONS AS RealTimeConsumptionPostingofSubcontractingComponents_ITCONS,
  ekpo.FIXMG AS DeliveryDateandQuantityFixed_FIXMG,
  ekpo.WABWE AS FlagforGIbasedgoodsreceipt_WABWE,
  ekpo.TC_AUT_DET AS TaxCodeAutomaticallyDetermined_TC_AUT_DET,
  ekpo.MANUAL_TC_REASON AS ManualTaxCodeReason_MANUAL_TC_REASON,
  ekpo.FISCAL_INCENTIVE AS TaxIncentiveType_FISCAL_INCENTIVE,
  ekpo.TAX_SUBJECT_ST AS TaxSubject_TAX_SUBJECT_ST,
  ekpo.FISCAL_INCENTIVE_ID AS IncentiveID_FISCAL_INCENTIVE_ID,
  ekpo.ADVCODE AS AdviceCode_ADVCODE,
  ekpo.BUDGET_PD AS FMBudgetPeriod_BUDGET_PD,
  ekpo.EXCPE AS AcceptancePeriod_EXCPE,
  ekpo.IUID_RELEVANT AS IUIDRelevant_IUID_RELEVANT,
  ekpo.MRPIND AS RetailPriceRelevant_MRPIND,
  ekpo.REFSITE AS ReferenceSiteForPurchasing_REFSITE,
  ekpo.SERRU AS Typeofsubcontracting_SERRU,
  ekpo.SERNP AS SerialNumberProfile_SERNP,
  ekpo.DISUB_SOBKZ AS SpecialstockFlagSubcontracting_DISUB_SOBKZ,
  ekpo.DISUB_PSPNR AS WBSElement_DISUB_PSPNR,
  ekpo.DISUB_KUNNR AS CustomerNumber_DISUB_KUNNR,
  ekpo.DISUB_VBELN AS SalesandDistributionDocumentNumber_DISUB_VBELN,
  ekpo.DISUB_POSNR AS ItemnumberoftheSDdocument_DISUB_POSNR,
  ekpo.DISUB_OWNER AS Ownerofstock_DISUB_OWNER,
  ekpo.REF_ITEM AS ReferenceItemforRemainingQtyCancellation_REF_ITEM,
  ekpo.SOURCE_ID AS OriginProfile_SOURCE_ID,
  ekpo.SOURCE_KEY AS KeyinSourceSystem_SOURCE_KEY,
  ekpo.PUT_BACK AS FlagforPuttingBackfromGroupedPODocument_PUT_BACK,
  ekpo.POL_ID AS OrderListItemNumber_POL_ID,
  ekpo.CONS_ORDER AS PurchaseOrderforConsignment_CONS_ORDER,
  --##CORTEX-CUSTOMER Consider adding other dimensions from the calendar_date_dim table as per your requirement
  CalendarDateDimension_AEDAT.CalYear AS YearOfChangeDate_AEDAT,
  CalendarDateDimension_AEDAT.CalMonth AS MonthOfChangeDate_AEDAT,
  CalendarDateDimension_AEDAT.CalWeek AS WeekOfChangeDate_AEDAT,
  CalendarDateDimension_AEDAT.CalQuarter AS QuarterOfChangeDate_AEDAT,
  CalendarDateDimension_BEDAT.CalYear AS YearOfPurchasingDocumentDate_BEDAT,
  CalendarDateDimension_BEDAT.CalMonth AS MonthOfPurchasingDocumentDate_BEDAT,
  CalendarDateDimension_BEDAT.CalWeek AS WeekOfPurchasingDocumentDate_BEDAT,
  CalendarDateDimension_BEDAT.CalQuarter AS QuarterOfPurchasingDocumentDate_BEDAT,
  --##CORTEX-CUSTOMER If you prefer to use currency conversion, uncomment below
  -- currency_conversion.UKURS AS ExchangeRate_UKURS,
  -- currency_conversion.TCURR AS TargetCurrency_TCURR,
  -- currency_conversion.conv_date AS Conversion_date,
  -- ekpo.NETPR * currency_conversion.UKURS AS NetPriceInTargetCurrency_NETPR,
  -- ekpo.NETWR * currency_conversion.UKURS AS NetOrderValueInTargetCurrency_NETWR,
  -- ekpo.BRTWR * currency_conversion.UKURS AS GrossOrderValueInTargetCurrency_BRTWR,
  -- ekpo.ZWERT * currency_conversion.UKURS AS TargetValueforOutlineAgreementInTargetCurrency_ZWERT,
  -- ekpo.EFFWR * currency_conversion.UKURS AS EffectiveValueofitemInTargetCurrency_EFFWR,
  -- ekpo.GNETWR * currency_conversion.UKURS AS CurrentlyNotUsedInTargetCurrency_GNETWR,
  -- ekpo.BONBA * currency_conversion.UKURS AS RebateBasis1InTargetCurrency_BONBA,
  COALESCE(ekpo.NETPR * currency_decimal.CURRFIX, ekpo.NETPR) AS NetPrice_NETPR,
  COALESCE(ekpo.NETWR * currency_decimal.CURRFIX, ekpo.NETWR) AS NetOrderValueinPOCurrency_NETWR,
  COALESCE(ekpo.BRTWR * currency_decimal.CURRFIX, ekpo.BRTWR) AS GrossOrderValueinPOcurrency_BRTWR,
  COALESCE(ekpo.ZWERT * currency_decimal.CURRFIX, ekpo.ZWERT) AS TargetValueforOutlineAgreementinDocumentCurrency_ZWERT,
  COALESCE(ekpo.EFFWR * currency_decimal.CURRFIX, ekpo.EFFWR) AS Effectivevalueofitem_EFFWR,
  COALESCE(ekpo.GNETWR * currency_decimal.CURRFIX, ekpo.GNETWR) AS Currentlynotused_GNETWR,
  COALESCE(ekpo.BONBA * currency_decimal.CURRFIX, ekpo.BONBA) AS Rebatebasis1_BONBA

FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.ekko` AS ekko
INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.ekpo` AS ekpo
  ON ekko.MANDT = ekpo.MANDT
    AND ekko.EBELN = ekpo.EBELN
LEFT JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.currency_decimal` AS currency_decimal
  ON ekko.WAERS = currency_decimal.CURRKEY
--##CORTEX-CUSTOMER If you prefer to use currency conversion, uncomment below
-- LEFT JOIN
--   `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.currency_conversion` AS currency_conversion
--   ON ekko.MANDT = currency_conversion.MANDT
--     AND ekko.WAERS = currency_conversion.FCURR
--     AND ekko.AEDAT = currency_conversion.conv_date
--     AND currency_conversion.TCURR {{ currency }}
--     --##CORTEX-CUSTOMER Modify the exchange rate type based on your requirement
--     AND currency_conversion.KURST = 'M'
LEFT JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.calendar_date_dim` AS CalendarDateDimension_AEDAT
  ON CalendarDateDimension_AEDAT.Date = ekko.AEDAT
LEFT JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.calendar_date_dim` AS CalendarDateDimension_BEDAT
  ON CalendarDateDimension_BEDAT.Date = ekko.BEDAT


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H

#include "board.h"

/*-----------------------------------------------------------
 * Application specific definitions.
 *
 * These definitions should be adjusted for your particular hardware and
 * application requirements.
 *
 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
 *
 * See http://www.freertos.org/a00110.html.
 *----------------------------------------------------------*/

#define configUSE_PREEMPTION      1
#define configUSE_IDLE_HOOK       0
#define configUSE_TICK_HOOK       0
#define configCPU_CLOCK_HZ        ( 48000000 ) /* Hz clk gen */
#define configPBA_CLOCK_HZ        ( 24000000 )
#define configTICK_RATE_HZ        ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES      ( ( unsigned portBASE_TYPE ) 8 )
#define configMINIMAL_STACK_SIZE  ( ( unsigned portSHORT ) 256 )
/* configTOTAL_HEAP_SIZE is not used when heap_3.c is used. */
#define configTOTAL_HEAP_SIZE     ( ( size_t ) ( 1024*25 ) )
#define configMAX_TASK_NAME_LEN   ( 20 )
#define configUSE_TRACE_FACILITY  1
#define configUSE_16_BIT_TICKS    0
#define configIDLE_SHOULD_YIELD   1

/* Co-routine definitions. */
#define configUSE_CO_ROUTINES     0
#define configMAX_CO_ROUTINE_PRIORITIES ( 1 )

/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */

#define INCLUDE_vTaskPrioritySet            1
#define INCLUDE_uxTaskPriorityGet           1
#define INCLUDE_vTaskDelete                 1
#define INCLUDE_vTaskCleanUpResources       0
#define INCLUDE_vTaskSuspend                1
#define INCLUDE_vTaskDelayUntil             1
#define INCLUDE_vTaskDelay                  1
#define INCLUDE_xTaskGetCurrentTaskHandle   1
#define INCLUDE_xTaskGetSchedulerState      0

/* configTICK_USE_TC is a boolean indicating whether to use a Timer Counter or
   the CPU Cycle Counter for the tick generation.
   Both methods will generate an accurate tick.
   0: Use of the CPU Cycle Counter.
   1: Use of the Timer Counter (configTICK_TC_CHANNEL is the TC channel). */
#define configTICK_USE_TC             0
#define configTICK_TC_CHANNEL         2

/* configHEAP_INIT is a boolean indicating whether to initialize the heap with
   0xA5 in order to be able to determine the maximal heap consumption. */
#define configHEAP_INIT               0

// #define configUSE_MUTEXES                   0
// #define configUSE_RECURSIVE_MUTEXES         0
// #define configUSE_COUNTING_SEMAPHORES       0
// #define configUSE_ALTERNATIVE_API           0
// #define configCHECK_FOR_STACK_OVERFLOW      0
// #define configQUEUE_REGISTRY_SIZE           10
// #define configGENERATE_RUN_TIME_STATS       0

// #define INCLUDE_vResumeFromISR              1
// #define INCLUDE_uxTaskGetStackHighWaterMark 0

#endif /* FREERTOS_CONFIG_H */

redpajama_set_name: RedPajamaGithub


text:
package com.company.opendaylight.controller.hello;

import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.http.controller.opendaylight.company.com.ns.model.hello.rev131113.HelloService;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author David Bainbridge <davidk.bainbridge@gmail.com>
 *
 */
public class HelloProvider extends AbstractBindingAwareProvider {
    private static final Logger log = LoggerFactory
            .getLogger(HelloProvider.class);

    private ProviderContext providerContext = null;
    private HelloServiceImpl service = null;
    private RpcRegistration<HelloService> registration = null;

    public HelloProvider() {
        service = new HelloServiceImpl();
    }

    /*
     * (non-Javadoc)
     *
     * @see org.opendaylight.controller.sal.binding.api.BindingAwareProvider#
     * onSessionInitiated
     * (org.opendaylight.controller.sal.binding.api.BindingAwareBroker
     * .ProviderContext)
     */
    @Override
    public void onSessionInitiated(ProviderContext providerContext) {
        try {
            this.providerContext = providerContext;
            service.setNotificationProvider(this.providerContext
                    .getSALService(NotificationProviderService.class));
            registration = providerContext.addRpcImplementation(
                    HelloService.class, service);
            log.info(
                    "Registered 'HelloService' implementation '{}' with registration '{}'",
                    service, registration);
        } catch (IllegalStateException e) {
            log.error("Unable to register 'HelloService' implementation", e);
        }
    }

    @Override
    protected void stopImpl(BundleContext context) {
        if (registration != null) {
            try {
                log.info(
                        "Closing 'HelloService' implementation '{}' with registration '{}'",
                        service, registration);
                registration.close();
                registration = null;
            } catch (Exception e) {
                log.error(
                        "Failed to close 'HelloService' registration, may lead to mulitple implementation registrations and errors",
                        e);
            }
        } else {
            log.info("'HelloService' implementation being stopped, but implementation is not registered.");
        }
    }

    public final ProviderContext getProviderContext() {
        return providerContext;
    }

    public final HelloService getService() {
        return service;
    }
}


text:
var changed    = require('gulp-changed');
var gulp       = require('gulp');
var imagemin   = require('gulp-imagemin');

gulp.task('images', function() {
	var dest = './generated/img';

	return gulp.src('./src/img/**')
		.pipe(changed(dest)) // Ignore unchanged files
		.pipe(imagemin()) // Optimize
		.pipe(gulp.dest(dest));
});


text:
/**
*	Construct a new yahoo.geocoding object
*	@class
*	@constructor
*	@extends LilyObjectBase
*/
function $yahoodotgeocoding()
{
	var thisPtr=this;

	var appid=LilyAPIKeyManager.getKey("yahooAPIkey");
	if(!appid) return null; //fail if no key

	var url="http://api.local.yahoo.com/MapsService/V1/geocode?appid="+appid;

	this.inlet1=new this.inletClass("inlet1",this,"location to geocode");
	this.outlet1=new this.outletClass("outlet1",this,"coordinates as hash {latitude, longitude}");
	this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");

	this.xhr=new LilyComponents._xhr(outputResponse,"xml",this);

	//bang method
	this.inlet1["anything"]=function(str){
		thisPtr.xhr.loadXMLDoc(url + "&location=" + str);
	}

	function outputResponse(xmlDoc) {

		if(!xmlDoc)
			return;

		var lat=xmlDoc.getElementsByTagName("Latitude")[0].firstChild.nodeValue;
		var lon=xmlDoc.getElementsByTagName("Longitude")[0].firstChild.nodeValue;

		var add=(xmlDoc.getElementsByTagName("Address")[0].firstChild)?xmlDoc.getElementsByTagName("Address")[0].firstChild.nodeValue:"";
		var city=(xmlDoc.getElementsByTagName("City")[0].firstChild)?xmlDoc.getElementsByTagName("City")[0].firstChild.nodeValue:"";
		var state=(xmlDoc.getElementsByTagName("State")[0].firstChild)?xmlDoc.getElementsByTagName("State")[0].firstChild.nodeValue:"";
		var zip=(xmlDoc.getElementsByTagName("Zip")[0].firstChild)?xmlDoc.getElementsByTagName("Zip")[0].firstChild.nodeValue:"";
		var co=(xmlDoc.getElementsByTagName("Country")[0].firstChild)?xmlDoc.getElementsByTagName("Country")[0].firstChild.nodeValue:"";

		this.outlet1.doOutlet({"latitude":lat,"longitude":lon,"address":add,"city":city,"state":state,"zip":zip,"country":co});
		this.outlet2.doOutlet("bang");

	}

	return this;
}

var $yahoodotgeocodingMetaData = {
	textName:"yahoo.geocoding",
	htmlName:"yahoo.geocoding",
	objectCategory:"Web Service",
	objectSummary:"Get geolocation data using Yahoo Web API.",
	objectArguments:""
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>jp.integ.web</groupId>
  <artifactId>integ-web-spring-webmvc-mixer2</artifactId>
  <packaging>jar</packaging>
  <name>Integ Web for Spring Web MVC Mixer2</name>
  <version>x.y.z-SNAPSHOT</version>
  <url>http://jfut.integ.jp/</url>
  <inceptionYear>2014</inceptionYear>
  <dependencies>
    <dependency>
      <groupId>dummy.foo.bar</groupId>
      <artifactId>foo-bar.hoge1</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>dummy.foo.foo</groupId>
      <artifactId>foo-foo.hoge2</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>dummy.foo.foo</groupId>
      <artifactId>foo-foo.hoge3</artifactId>
      <version>3.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


text:
<?php $this->load->view("components/backend/header"); ?>
<?php $this->load->view("components/backend/navbar"); ?>

            <?= $this->lang->line("member_title_list_of_member"); ?>

                            <button class="btn btn-default btn-sm pull-right" data-widget='collapse'
                                    data-toggle="tooltip" title="Collapse" style="margin-right: 5px;">
                                </button>

                            <?= $this->lang->line("button_search"); ?>

                                <?= $this->lang->line("member_full_name"); ?>

                                    <input class="form-control" type="text" id="full_name">

                                <?= $this->lang->line("member_email"); ?>

                                    <input class="form-control" type="text" id="email">

                                <?= $this->lang->line("form_field_status"); ?>

                                    <select class="form-control" id="status" name="status">
                                        <option value=""></option>
                                        <option value="0"><?= $this->lang->line("form_field_active"); ?></option>
                                        <option value="1"><?= $this->lang->line("form_field_inactive"); ?></option>
                                    </select>

                            <button type="button" onclick="search()" class="btn btn-primary "> <?= $this->lang->line("button_search"); ?>
                            </button>
                            <button id="btn_clear_search" onclick="clearTextSearch()" type="button"
                                    class="btn btn-default">

                                <?= $this->lang->line("button_clear"); ?>
                            </button>

                                    <?= $this->lang->line("table_seq"); ?>
                                    <?= $this->lang->line("member_full_name"); ?>
                                    <?= $this->lang->line("member_email"); ?>
                                    <?= $this->lang->line("member_phone"); ?>
                                    <?= $this->lang->line("table_created_date"); ?>

<?php $this->load->view("components/backend/footer"); ?>


text:
import base64
import json
import re
import requests
import sys

TRANSPORT_SECURITY_STATE_STATIC_URL = "https://chromium.googlesource.com/chromium/src/+/main/net/http/transport_security_state_static.json?format=TEXT"

def log(s):
  sys.stderr.write(s)

class State:
  BeforeLegacy18WeekBulkEntries, \
  DuringLegacy18WeekBulkEntries, \
  AfterLegacy18WeekBulkEntries, \
  During18WeekBulkEntries, \
  After18WeekBulkEntries, \
  During1YearBulkEntries, \
  After1YearBulkEntries, \
  During1YearBulkSubdomainEntries, \
  After1YearBulkSubdomainEntries = range(9)

def getRawText():
  log("Fetching preload list from Chromium source...\n")
  return base64.b64decode(
          requests.get(TRANSPORT_SECURITY_STATE_STATIC_URL).text).decode()

def extractBulkEntries(rawText):
  log("Extracting bulk entries...\n")
  state = State.BeforeLegacy18WeekBulkEntries
  bulkEntryString = "[\n"
  for line in rawText.splitlines():
    if state == State.BeforeLegacy18WeekBulkEntries:
      if "START OF LEGACY 18-WEEK BULK HSTS ENTRIES" in line:
        state = State.DuringLegacy18WeekBulkEntries
    elif state == State.DuringLegacy18WeekBulkEntries:
      if "END OF LEGACY 18-WEEK BULK HSTS ENTRIES" in line:
        state = State.AfterLegacy18WeekBulkEntries
      else:
        bulkEntryString += line + "\n"
    if state == State.AfterLegacy18WeekBulkEntries:
      if "START OF 18-WEEK BULK HSTS ENTRIES" in line:
        state = State.During18WeekBulkEntries
    elif state == State.During18WeekBulkEntries:
      if "END OF 18-WEEK BULK HSTS ENTRIES" in line:
        state = State.After18WeekBulkEntries
      else:
        bulkEntryString += line + "\n"
    if state == State.After18WeekBulkEntries:
      if "START OF 1-YEAR BULK HSTS ENTRIES" in line:
        state = State.During1YearBulkEntries
    elif state == State.During1YearBulkEntries:
      if "END OF 1-YEAR BULK HSTS ENTRIES" in line:
        state = State.After1YearBulkEntries
      else:
        bulkEntryString += line + "\n"
    elif state == State.After1YearBulkEntries:
      if "START OF 1-YEAR BULK SUBDOMAIN HSTS ENTRIES" in line:
        state = State.During1YearBulkSubdomainEntries
    elif state == State.During1YearBulkSubdomainEntries:
      if "END OF 1-YEAR BULK SUBDOMAIN HSTS ENTRIES" in line:
        state = State.After1YearBulkSubdomainEntries
      else:
        bulkEntryString += line + "\n"
    elif state == State.After1YearBulkSubdomainEntries:
      if "BULK" in line:
        print(line)
        raise Exception("Preload list contains unexpected bulk entry markers.")
  if state != State.After1YearBulkSubdomainEntries:
    raise Exception("Unexpected end state: %d" % state)

  # Add an empty object for the last entry to go after the trailing comma.
  bulkEntryString += "{}]"

  entries = json.loads(bulkEntryString)
  # Remove empty object at the end.
  del entries[-1]
  log("Found %d bulk entries.\n" % len(entries))
  return entries

def sanityCheck(domainList):
  log("Sanity checking domains...\n")
  for domain in domainList:
    log("\033[K\rChecking: %s" % domain)
    if not re.match(r'^[a-z0-9-\.]+$', domain):
      raise Exception("Incorrectly formatted domain: %s" % domain)
    if domain in ["google.com", "gmail.com", "hstspreload.org"]:
      raise Exception("Unexpected domain in list")
  log("\n")

def formatForGo(domainList):
  obj = {}
  for domain in domainList:
    obj[domain] = True
  return obj

def write(bulkDomains):
  log("Writing...\n")
  with open(sys.argv[1], 'w') as file:
    json.dump(formatForGo(bulkDomains), file)

def main():
  rawText = getRawText()
  bulkEntries = extractBulkEntries(rawText)
  bulkDomains = [entry["name"] for entry in bulkEntries]
  sanityCheck(bulkDomains)
  write(bulkDomains)
  log("\033[92mStatic bulk domain data update done!\x1b[0m\n")

if __name__ == "__main__":
    main()


text:
var debug = require('debug')('ircapp:services');
var _ = require('lodash-node');

function Services(bot) {
  this.bot = bot;
  this.services = {};
}

Services.prototype.add = function(name, fn) {
  if (_.has(this.services, name)) {
    debug('add(): service \'' + name + '\' already exists'); // TODO throw?
    return;
  }
  if (_.isFunction(fn)) {
    debug('add(): adding service \'' + name + '\'');
    this.services[name] = fn;
  } else {
    debug('add(): ignoring \'' + name + '\', not a function: ' + fn); // TODO throw?
  }
};

Services.prototype.remove = function(name) {
  if (!_.has(this.services, name)) {
    debug('remove(): service \'' + name + '\' not found');
    return;
  }
  debug('remove(): deleting service \'' + name + '\'');
  delete this.services[name];
};

Services.prototype.get = function(name) {
  if (!_.has(this.services, name)) {
    return undefined;
  }
  return this.services[name];
};

module.exports = Services;


text:
#include "pebble.h"

Window *window;
TextLayer *text_date_layer;
TextLayer *text_time_layer;
Layer *line_layer;

// TextLayer *debug_layer;

#define MAX_MIN_FORWARD 7 // Maximum number of minutes to forward time

static int min_forward = 0; // Random number of minutes used to forward time
static int min_forward_countdown = 0; // Minute countdown before fetching a new random number
static time_t forward_time = 0; // Used to override the default tick_time

/**
 * Updates forward_time with the current time forwarded to a random number of minutes ahead.
 * This random number is kept for a small time interval, before generating a new random number.
 */
void update_forward_time() {
  static char debug_text[] = "00, -00";

  if (min_forward_countdown > 1) {
    min_forward_countdown--;
  } else {
    min_forward = rand() % (MAX_MIN_FORWARD + 1);
    min_forward_countdown = MAX_MIN_FORWARD / 2;
  }

  forward_time = time(NULL) + (min_forward * 60);

//  snprintf(debug_text, sizeof(debug_text), "%d, -%d", min_forward, min_forward_countdown);
//  text_layer_set_text(debug_layer, debug_text);
}

void handle_minute_tick(struct tm *tick_time, TimeUnits units_changed) {
  // Need to be static because they're used by the system later.
  static char time_text[] = "00:00";
  static char date_text[] = "Xxxxxxxxx 00";
  char *time_format;

  // Load forward time on tick_time
  update_forward_time();
  tick_time = localtime(&forward_time);

  strftime(date_text, sizeof(date_text), "%B %e", tick_time);
  text_layer_set_text(text_date_layer, date_text);

  if (clock_is_24h_style()) {
    time_format = "%R";
  } else {
    time_format = "%I:%M";
  }

  strftime(time_text, sizeof(time_text), time_format, tick_time);

  // Kludge to handle lack of non-padded hour format string
  // for twelve hour clock.
  if (!clock_is_24h_style() && (time_text[0] == '0')) {
    memmove(time_text, &time_text[1], sizeof(time_text) - 1);
  }

  text_layer_set_text(text_time_layer, time_text);
}

void line_layer_update_callback(Layer *layer, GContext* ctx) {
  graphics_context_set_fill_color(ctx, GColorWhite);
  graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);
}

void handle_deinit(void) {
  tick_timer_service_unsubscribe();
}

void handle_init(void) {
  window = window_create();
  window_stack_push(window, true /* Animated */);
  window_set_background_color(window, GColorBlack);

  Layer *window_layer = window_get_root_layer(window);

  text_date_layer = text_layer_create(GRect(8, 68, 144-8, 168-68));
  text_layer_set_text_color(text_date_layer, GColorWhite);
  text_layer_set_background_color(text_date_layer, GColorClear);
  text_layer_set_font(text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
  layer_add_child(window_layer, text_layer_get_layer(text_date_layer));

  text_time_layer = text_layer_create(GRect(7, 92, 144-7, 168-92));
  text_layer_set_text_color(text_time_layer, GColorWhite);
  text_layer_set_background_color(text_time_layer, GColorClear);
  text_layer_set_font(text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_49)));
  layer_add_child(window_layer, text_layer_get_layer(text_time_layer));

  GRect line_frame = GRect(8, 97, 139, 1);
  line_layer = layer_create(line_frame);
  layer_set_update_proc(line_layer, line_layer_update_callback);
  layer_add_child(window_layer, line_layer);
/*
  debug_layer = text_layer_create(GRect(29, 14, 144-40, 168-54));
  text_layer_set_text_color(debug_layer, GColorWhite);
  text_layer_set_background_color(debug_layer, GColorClear);
  text_layer_set_font(debug_layer, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
  layer_add_child(window_layer, text_layer_get_layer(debug_layer));
*/
  // Seeds the random number generator
  srand(time(NULL));

  tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);
}

int main(void) {
  handle_init();

  app_event_loop();

  handle_deinit();
}


text:
(function(window){
  var mbtn = document.getElementById("mobilenav-button");
  mbtn.onclick = function() {
    //document.getElementById("sidenav").style.transition = "max-height 0.5s ease";
    document.getElementById("sidenav").style.maxHeight = "100%";
    //document.getElementById("sitemain").style.marginTop  = "280px";
  }

  var xbtn =document.getElementById("sidenav-header__close");
  xbtn.onclick = function() {
    document.getElementById("sidenav").style.maxHeight = "0";
    //document.getElementById("sitemain").style.marginTop = "0";
  }

})(window);


text:
#include "precomp.hpp"

#if 0

ML_IMPL int
icvCmpIntegers (const void* a, const void* b) {return *(const int*)a - *(const int*)b;}

/****************************************************************************************\
*                    Cross-validation algorithms realizations                            *
\****************************************************************************************/

// Return pointer to trainIdx. Function DOES NOT FILL this matrix!
ML_IMPL
const CvMat* cvCrossValGetTrainIdxMatrix (const CvStatModel* estimateModel)
{
    CvMat* result = NULL;

        CV_FUNCNAME ("cvCrossValGetTrainIdxMatrix");
        __BEGIN__

    if (!CV_IS_CROSSVAL(estimateModel))
    {
        CV_ERROR (CV_StsBadArg, "Pointer point to not CvCrossValidationModel");
    }

    result = ((CvCrossValidationModel*)estimateModel)->sampleIdxTrain;

        __END__

    return result;
} // End of cvCrossValGetTrainIdxMatrix

/****************************************************************************************/
// Return pointer to checkIdx. Function DOES NOT FILL this matrix!
ML_IMPL
const CvMat* cvCrossValGetCheckIdxMatrix (const CvStatModel* estimateModel)
{
    CvMat* result = NULL;

        CV_FUNCNAME ("cvCrossValGetCheckIdxMatrix");
        __BEGIN__

    if (!CV_IS_CROSSVAL (estimateModel))
    {
        CV_ERROR (CV_StsBadArg, "Pointer point to not CvCrossValidationModel");
    }

    result = ((CvCrossValidationModel*)estimateModel)->sampleIdxEval;

        __END__

    return result;
} // End of cvCrossValGetCheckIdxMatrix

/****************************************************************************************/
// Create new Idx-matrix for next classifiers training and return code of result.
//   Result is 0 if function can't make next step (error input or folds are finished),
//   it is 1 if all was correct, and it is 2 if current fold wasn't' checked.
ML_IMPL
int cvCrossValNextStep (CvStatModel* estimateModel)
{
    int result = 0;

        CV_FUNCNAME ("cvCrossValGetNextTrainIdx");
        __BEGIN__

    CvCrossValidationModel* crVal = (CvCrossValidationModel*) estimateModel;
    int k, fold;

    if (!CV_IS_CROSSVAL (estimateModel))
    {
        CV_ERROR (CV_StsBadArg, "Pointer point to not CvCrossValidationModel");
    }

    fold = ++crVal->current_fold;

    if (fold >= crVal->folds_all)
    {
        if (fold == crVal->folds_all)
            EXIT;
        else
        {
            CV_ERROR (CV_StsInternal, "All iterations has end long ago");
        }
    }

    k = crVal->folds[fold + 1] - crVal->folds[fold];
    crVal->sampleIdxTrain->data.i = crVal->sampleIdxAll + crVal->folds[fold + 1];
    crVal->sampleIdxTrain->cols = crVal->samples_all - k;
    crVal->sampleIdxEval->data.i = crVal->sampleIdxAll + crVal->folds[fold];
    crVal->sampleIdxEval->cols = k;

    if (crVal->is_checked)
    {
        crVal->is_checked = 0;
        result = 1;
    }
    else
    {
        result = 2;
    }

        __END__

    return result;
}

/****************************************************************************************/
// Do checking part of loop  of cross-validations metod.
ML_IMPL
void cvCrossValCheckClassifier (CvStatModel*  estimateModel,
                          const CvStatModel*  model,
                          const CvMat*        trainData,
                                int           sample_t_flag,
                          const CvMat*        trainClasses)
{
        CV_FUNCNAME ("cvCrossValCheckClassifier ");
        __BEGIN__

    CvCrossValidationModel* crVal = (CvCrossValidationModel*) estimateModel;
    int  i, j, k;
    int* data;
    float* responses_fl;
    int    step;
    float* responses_result;
    int* responses_i;
    double te, te1;
    double sum_c, sum_p, sum_pp, sum_cp, sum_cc, sq_err;

// Check input data to correct values.
    if (!CV_IS_CROSSVAL (estimateModel))
    {
        CV_ERROR (CV_StsBadArg,"First parameter point to not CvCrossValidationModel");
    }
    if (!CV_IS_STAT_MODEL (model))
    {
        CV_ERROR (CV_StsBadArg, "Second parameter point to not CvStatModel");
    }
    if (!CV_IS_MAT (trainData))
    {
        CV_ERROR (CV_StsBadArg, "Third parameter point to not CvMat");
    }
    if (!CV_IS_MAT (trainClasses))
    {
        CV_ERROR (CV_StsBadArg, "Fifth parameter point to not CvMat");
    }
    if (crVal->is_checked)
    {
        CV_ERROR (CV_StsInternal, "This iterations already was checked");
    }

// Initialize.
    k = crVal->sampleIdxEval->cols;
    data = crVal->sampleIdxEval->data.i;

// Eval tested feature vectors.
    CV_CALL (cvStatModelMultiPredict (model, trainData, sample_t_flag,
                                         crVal->predict_results, NULL, crVal->sampleIdxEval));
// Count number if correct results.
    responses_result = crVal->predict_results->data.fl;
    if (crVal->is_regression)
    {
        sum_c = sum_p = sum_pp = sum_cp = sum_cc = sq_err = 0;
        if (CV_MAT_TYPE (trainClasses->type) == CV_32FC1)
        {
            responses_fl = trainClasses->data.fl;
            step = trainClasses->rows == 1 ? 1 : trainClasses->step / sizeof(float);
            for (i = 0; i < k; i++)
            {
                te = responses_result[*data];
                te1 = responses_fl[*data * step];
                sum_c += te1;
                sum_p += te;
                sum_cc += te1 * te1;
                sum_pp += te * te;
                sum_cp += te1 * te;
                te -= te1;
                sq_err += te  * te;

                data++;
            }
        }
        else
        {
            responses_i = trainClasses->data.i;
            step = trainClasses->rows == 1 ? 1 : trainClasses->step / sizeof(int);
            for (i = 0; i < k; i++)
            {
                te = responses_result[*data];
                te1 = responses_i[*data * step];
                sum_c += te1;
                sum_p += te;
                sum_cc += te1 * te1;
                sum_pp += te * te;
                sum_cp += te1 * te;
                te -= te1;
                sq_err += te  * te;

                data++;
            }
        }
    // Fixing new internal values of accuracy.
        crVal->sum_correct += sum_c;
        crVal->sum_predict += sum_p;
        crVal->sum_cc += sum_cc;
        crVal->sum_pp += sum_pp;
        crVal->sum_cp += sum_cp;
        crVal->sq_error += sq_err;
    }
    else
    {
        if (CV_MAT_TYPE (trainClasses->type) == CV_32FC1)
        {
            responses_fl = trainClasses->data.fl;
            step = trainClasses->rows == 1 ? 1 : trainClasses->step / sizeof(float);
            for (i = 0, j = 0; i < k; i++)
            {
                if (cvRound (responses_result[*data]) == cvRound (responses_fl[*data * step]))
                    j++;
                data++;
            }
        }
        else
        {
            responses_i = trainClasses->data.i;
            step = trainClasses->rows == 1 ? 1 : trainClasses->step / sizeof(int);
            for (i = 0, j = 0; i < k; i++)
            {
                if (cvRound (responses_result[*data]) == responses_i[*data * step])
                    j++;
                data++;
            }
        }
    // Fixing new internal values of accuracy.
        crVal->correct_results += j;
    }
// Fixing that this fold already checked.
    crVal->all_results += k;
    crVal->is_checked = 1;

        __END__
} // End of cvCrossValCheckClassifier

/****************************************************************************************/
// Return current accuracy.
ML_IMPL
float cvCrossValGetResult (const CvStatModel* estimateModel,
                                 float*       correlation)
{
    float result = 0;

        CV_FUNCNAME ("cvCrossValGetResult");
        __BEGIN__

    double te, te1;
    CvCrossValidationModel* crVal = (CvCrossValidationModel*)estimateModel;

    if (!CV_IS_CROSSVAL (estimateModel))
    {
        CV_ERROR (CV_StsBadArg, "Pointer point to not CvCrossValidationModel");
    }

    if (crVal->all_results)
    {
        if (crVal->is_regression)
        {
            result = ((float)crVal->sq_error) / crVal->all_results;
            if (correlation)
            {
                te = crVal->all_results * crVal->sum_cp -
                                             crVal->sum_correct * crVal->sum_predict;
                te *= te;
                te1 = (crVal->all_results * crVal->sum_cc -
                                    crVal->sum_correct * crVal->sum_correct) *
                           (crVal->all_results * crVal->sum_pp -
                                    crVal->sum_predict * crVal->sum_predict);
                *correlation = (float)(te / te1);

            }
        }
        else
        {
            result = ((float)crVal->correct_results) / crVal->all_results;
        }
    }

        __END__

    return result;
}

/****************************************************************************************/
// Reset cross-validation EstimateModel to state the same as it was immidiatly after
//   its creating.
ML_IMPL
void cvCrossValReset (CvStatModel* estimateModel)
{
        CV_FUNCNAME ("cvCrossValReset");
        __BEGIN__

    CvCrossValidationModel* crVal = (CvCrossValidationModel*)estimateModel;

    if (!CV_IS_CROSSVAL (estimateModel))
    {
        CV_ERROR (CV_StsBadArg, "Pointer point to not CvCrossValidationModel");
    }

    crVal->current_fold = -1;
    crVal->is_checked = 1;
    crVal->all_results = 0;
    crVal->correct_results = 0;
    crVal->sq_error = 0;
    crVal->sum_correct = 0;
    crVal->sum_predict = 0;
    crVal->sum_cc = 0;
    crVal->sum_pp = 0;
    crVal->sum_cp = 0;

        __END__
}

/****************************************************************************************/
// This function is standart CvStatModel field to release cross-validation EstimateModel.
ML_IMPL
void cvReleaseCrossValidationModel (CvStatModel** model)
{
    CvCrossValidationModel* pModel;

        CV_FUNCNAME ("cvReleaseCrossValidationModel");
        __BEGIN__

    if (!model)
    {
        CV_ERROR (CV_StsNullPtr, "");
    }

    pModel = (CvCrossValidationModel*)*model;
    if (!pModel)
    {
        return;
    }
    if (!CV_IS_CROSSVAL (pModel))
    {
        CV_ERROR (CV_StsBadArg, "");
    }

    cvFree (&pModel->sampleIdxAll);
    cvFree (&pModel->folds);
    cvReleaseMat (&pModel->sampleIdxEval);
    cvReleaseMat (&pModel->sampleIdxTrain);
    cvReleaseMat (&pModel->predict_results);

    cvFree (model);

        __END__
} // End of cvReleaseCrossValidationModel.

/****************************************************************************************/
// This function create cross-validation EstimateModel.
ML_IMPL CvStatModel*
cvCreateCrossValidationEstimateModel(
             int                samples_all,
       const CvStatModelParams* estimateParams,
       const CvMat*             sampleIdx)
{
    CvStatModel*            model   = NULL;
    CvCrossValidationModel* crVal   = NULL;

        CV_FUNCNAME ("cvCreateCrossValidationEstimateModel");
        __BEGIN__

    int  k_fold = 10;

    int  i, j, k, s_len;
    int  samples_selected;
    CvRNG rng;
    CvRNG* prng;
    int* res_s_data;
    int* te_s_data;
    int* folds;

    rng = cvRNG(cvGetTickCount());
    cvRandInt (&rng); cvRandInt (&rng); cvRandInt (&rng); cvRandInt (&rng);
// Check input parameters.
    if (estimateParams)
        k_fold = ((CvCrossValidationParams*)estimateParams)->k_fold;
    if (!k_fold)
    {
        CV_ERROR (CV_StsBadArg, "Error in parameters of cross-validation (k_fold == 0)!");
    }
    if (samples_all <= 0)
    {
        CV_ERROR (CV_StsBadArg, "<samples_all> should be positive!");
    }

// Alloc memory and fill standart StatModel's fields.
    CV_CALL (crVal = (CvCrossValidationModel*)cvCreateStatModel (
                            CV_STAT_MODEL_MAGIC_VAL | CV_CROSSVAL_MAGIC_VAL,
                            sizeof(CvCrossValidationModel),
                            cvReleaseCrossValidationModel,
                            NULL, NULL));
    crVal->current_fold    = -1;
    crVal->folds_all       = k_fold;
    if (estimateParams && ((CvCrossValidationParams*)estimateParams)->is_regression)
        crVal->is_regression = 1;
    else
        crVal->is_regression = 0;
    if (estimateParams && ((CvCrossValidationParams*)estimateParams)->rng)
        prng = ((CvCrossValidationParams*)estimateParams)->rng;
    else
        prng = &rng;

    // Check and preprocess sample indices.
    if (sampleIdx)
    {
        int s_step;
        int s_type = 0;

        if (!CV_IS_MAT (sampleIdx))
            CV_ERROR (CV_StsBadArg, "Invalid sampleIdx array");

        if (sampleIdx->rows != 1 && sampleIdx->cols != 1)
            CV_ERROR (CV_StsBadSize, "sampleIdx array must be 1-dimensional");

        s_len = sampleIdx->rows + sampleIdx->cols - 1;
        s_step = sampleIdx->rows == 1 ?
                                     1 : sampleIdx->step / CV_ELEM_SIZE(sampleIdx->type);

        s_type = CV_MAT_TYPE (sampleIdx->type);

        switch (s_type)
        {
        case CV_8UC1:
        case CV_8SC1:
            {
            uchar* s_data = sampleIdx->data.ptr;

            // sampleIdx is array of 1's and 0's -
            // i.e. it is a mask of the selected samples
            if( s_len != samples_all )
                CV_ERROR (CV_StsUnmatchedSizes,
       "Sample mask should contain as many elements as the total number of samples");

            samples_selected = 0;
            for (i = 0; i < s_len; i++)
                samples_selected += s_data[i * s_step] != 0;

            if (samples_selected == 0)
                CV_ERROR (CV_StsOutOfRange, "No samples is selected!");
            }
            s_len = samples_selected;
            break;
        case CV_32SC1:
            if (s_len > samples_all)
                CV_ERROR (CV_StsOutOfRange,
        "sampleIdx array may not contain more elements than the total number of samples");
            samples_selected = s_len;
            break;
        default:
            CV_ERROR (CV_StsUnsupportedFormat, "Unsupported sampleIdx array data type "
                                               "(it should be 8uC1, 8sC1 or 32sC1)");
        }

        // Alloc additional memory for internal Idx and fill it.
/*!!*/  CV_CALL (res_s_data = crVal->sampleIdxAll =
                                                 (int*)cvAlloc (2 * s_len * sizeof(int)));

        if (s_type < CV_32SC1)
        {
            uchar* s_data = sampleIdx->data.ptr;
            for (i = 0; i < s_len; i++)
                if (s_data[i * s_step])
                {
                    *res_s_data++ = i;
                }
            res_s_data = crVal->sampleIdxAll;
        }
        else
        {
            int* s_data = sampleIdx->data.i;
            int out_of_order = 0;

            for (i = 0; i < s_len; i++)
            {
                res_s_data[i] = s_data[i * s_step];
                if (i > 0 && res_s_data[i] < res_s_data[i - 1])
                    out_of_order = 1;
            }

            if (out_of_order)
                qsort (res_s_data, s_len, sizeof(res_s_data[0]), icvCmpIntegers);

            if (res_s_data[0] < 0 ||
                res_s_data[s_len - 1] >= samples_all)
                    CV_ERROR (CV_StsBadArg, "There are out-of-range sample indices");
            for (i = 1; i < s_len; i++)
                if (res_s_data[i] <= res_s_data[i - 1])
                    CV_ERROR (CV_StsBadArg, "There are duplicated");
        }
    }
    else // if (sampleIdx)
    {
        // Alloc additional memory for internal Idx and fill it.
        s_len = samples_all;
        CV_CALL (res_s_data = crVal->sampleIdxAll = (int*)cvAlloc (2 * s_len * sizeof(int)));
        for (i = 0; i < s_len; i++)
        {
            *res_s_data++ = i;
        }
        res_s_data = crVal->sampleIdxAll;
    } // if (sampleIdx) ... else

// Resort internal Idx.
    te_s_data = res_s_data + s_len;
    for (i = s_len; i > 1; i--)
    {
        j = cvRandInt (prng) % i;
        k = *(--te_s_data);
        *te_s_data = res_s_data[j];
        res_s_data[j] = k;
    }

// Duplicate resorted internal Idx.
// It will be used to simplify operation of getting trainIdx.
    te_s_data = res_s_data + s_len;
    for (i = 0; i < s_len; i++)
    {
        *te_s_data++ = *res_s_data++;
    }

// Cut sampleIdxAll to parts.
    if (k_fold > 0)
    {
        if (k_fold > s_len)
        {
            CV_ERROR (CV_StsBadArg,
                        "Error in parameters of cross-validation ('k_fold' > #samples)!");
        }
        folds = crVal->folds = (int*) cvAlloc ((k_fold + 1) * sizeof (int));
        *folds++ = 0;
        for (i = 1; i < k_fold; i++)
        {
            *folds++ = cvRound (i * s_len * 1. / k_fold);
        }
        *folds = s_len;
        folds = crVal->folds;

        crVal->max_fold_size = (s_len - 1) / k_fold + 1;
    }
    else
    {
        k = -k_fold;
        crVal->max_fold_size = k;
        if (k >= s_len)
        {
            CV_ERROR (CV_StsBadArg,
                      "Error in parameters of cross-validation (-'k_fold' > #samples)!");
        }
        crVal->folds_all = k = (s_len - 1) / k + 1;

        folds = crVal->folds = (int*) cvAlloc ((k + 1) * sizeof (int));
        for (i = 0; i < k; i++)
        {
            *folds++ = -i * k_fold;
        }
        *folds = s_len;
        folds = crVal->folds;
    }

// Prepare other internal fields to working.
    CV_CALL (crVal->predict_results = cvCreateMat (1, samples_all, CV_32FC1));
    CV_CALL (crVal->sampleIdxEval = cvCreateMatHeader (1, 1, CV_32SC1));
    CV_CALL (crVal->sampleIdxTrain = cvCreateMatHeader (1, 1, CV_32SC1));
    crVal->sampleIdxEval->cols = 0;
    crVal->sampleIdxTrain->cols = 0;
    crVal->samples_all = s_len;
    crVal->is_checked = 1;

    crVal->getTrainIdxMat = cvCrossValGetTrainIdxMatrix;
    crVal->getCheckIdxMat = cvCrossValGetCheckIdxMatrix;
    crVal->nextStep = cvCrossValNextStep;
    crVal->check = cvCrossValCheckClassifier;
    crVal->getResult = cvCrossValGetResult;
    crVal->reset = cvCrossValReset;

    model = (CvStatModel*)crVal;

        __END__

    if (!model)
    {
        cvReleaseCrossValidationModel ((CvStatModel**)&crVal);
    }

    return model;
} // End of cvCreateCrossValidationEstimateModel

/****************************************************************************************\
*                Extended interface with backcalls for models                            *
\****************************************************************************************/
ML_IMPL float
cvCrossValidation (const CvMat*            trueData,
                         int               tflag,
                   const CvMat*            trueClasses,
                         CvStatModel*     (*createClassifier) (const CvMat*,
                                                                     int,
                                                               const CvMat*,
                                                               const CvClassifierTrainParams*,
                                                               const CvMat*,
                                                               const CvMat*,
                                                               const CvMat*,
                                                               const CvMat*),
                   const CvClassifierTrainParams*    estimateParams,
                   const CvClassifierTrainParams*    trainParams,
                   const CvMat*            compIdx,
                   const CvMat*            sampleIdx,
                         CvStatModel**     pCrValModel,
                   const CvMat*            typeMask,
                   const CvMat*            missedMeasurementMask)
{
    CvCrossValidationModel* crVal = NULL;
    float  result = 0;
    CvStatModel* pClassifier = NULL;

        CV_FUNCNAME ("cvCrossValidation");
        __BEGIN__

    const CvMat* trainDataIdx;
    int    samples_all;

// checking input data
    if ((createClassifier) == NULL)
    {
        CV_ERROR (CV_StsNullPtr, "Null pointer to functiion which create classifier");
    }
    if (pCrValModel && *pCrValModel && !CV_IS_CROSSVAL(*pCrValModel))
    {
        CV_ERROR (CV_StsBadArg,
           "<pCrValModel> point to not cross-validation model");
    }

// initialization
    if (pCrValModel && *pCrValModel)
    {
        crVal = (CvCrossValidationModel*)*pCrValModel;
        crVal->reset ((CvStatModel*)crVal);
    }
    else
    {
        samples_all = ((tflag) ? trueData->rows : trueData->cols);
        CV_CALL (crVal = (CvCrossValidationModel*)
           cvCreateCrossValidationEstimateModel (samples_all, estimateParams, sampleIdx));
    }

    CV_CALL (trainDataIdx = crVal->getTrainIdxMat ((CvStatModel*)crVal));

// operation loop
    for (; crVal->nextStep((CvStatModel*)crVal) != 0; )
    {
        CV_CALL (pClassifier = createClassifier (trueData, tflag, trueClasses,
                    trainParams, compIdx, trainDataIdx, typeMask, missedMeasurementMask));
        CV_CALL (crVal->check ((CvStatModel*)crVal, pClassifier,
                                                           trueData, tflag, trueClasses));

        pClassifier->release (&pClassifier);
    }

// Get result and fill output field.
    CV_CALL (result = crVal->getResult ((CvStatModel*)crVal, 0));

    if (pCrValModel && !*pCrValModel)
        *pCrValModel = (CvStatModel*)crVal;

        __END__

// Free all memory that should be freed.
    if (pClassifier)
        pClassifier->release (&pClassifier);
    if (crVal && (!pCrValModel || !*pCrValModel))
        crVal->release ((CvStatModel**)&crVal);

    return result;
} // End of cvCrossValidation

#endif

/* End of file */


text:
using System;
using System.Collections.Generic;
using System.Linq;
namespace LargestNElements
{
    class LargestNElements
    {
        public static void Main()
        {
            var numbers = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToList();
            var numberOfElements = int.Parse(Console.ReadLine());

            numbers.Sort();
            numbers.Reverse();
            var result = new List<int>();
            for (int i = 0; i < numberOfElements; i++)
            {
                result.Add(numbers[i]);
            }
            Console.WriteLine(string.Join(" ", result));
        }
    }
}


text:
namespace GeometricCalculations
{
	class Parallelepiped : public ISurfaceCalculatable, public IVolumeCalculatable
	{
	private:
		float widthInCm;
		float heightInCm;
		float depthInCm;

	public:
		Parallelepiped(float widthCm, float heightCm, float depthCm);

		virtual float CalculateSurface() override;
		virtual float CalculateVolume() override;
	};
}


text:
(function() {
  'use strict';
  var module = angular.module('bk.evaluateJobManager', ['bk.utils', 'bk.evaluatorManager']);
  module.factory('bkEvaluateJobManager', function(bkUtils, bkEvaluatorManager, $timeout) {

    var outputMap = { };

    var errorMessage = function(msg) {
      return {
        type: "BeakerDisplay",
        innertype: "Error",
        object: msg
      };
    };
    var textMessage = function(msg) {
      return {
        type: "BeakerDisplay",
        innertype: "Text",
        object: msg
      };
    };
    var ERROR_MESSAGE_ON_EARLIER_FAILURE =
      errorMessage("Evaluation cancelled due to a failure of an earlier cell evaluation");
    var ERROR_MESSAGE_ON_CANCEL =
      errorMessage("... cancelled!");
    var MESSAGE_PENDING =
      textMessage("pending");
    var MESSAGE_WAITING_FOR_EVALUTOR_INIT =
      textMessage("waiting for evaluator initialization ...");

    var jobQueue = (function() {

      var _queue = [];
      var _jobInProgress = [];
      var running = {};

      var evaluateJob = function(job) {
        job.evaluator = bkEvaluatorManager.getEvaluator(job.evaluatorId);
        if (job.evaluator) {
          bkUtils.log("evaluate", {
            plugin: job.evaluator.pluginName,
            length: job.code.length });
          return job.evaluator.evaluate(job.code, job.output, outputMap[job.cellId]);
        }
        job.output.result = MESSAGE_WAITING_FOR_EVALUTOR_INIT;
        return bkEvaluatorManager.waitEvaluator(job.evaluatorId)
          .then(function(ev) {
            job.evaluator = ev;
            if (ev !== undefined)
              return job.evaluator.evaluate(job.code, job.output, outputMap[job.cellId]);
            return "cannot find evaluator for "+job.evaluatorId;
          } );
      };

      var doNext = function(innext) {
        var job;

        if (_jobInProgress.length == 0) {
          // start a new root job
          job = _queue.shift();
        } else {
          // we have something executing...
          var last = _jobInProgress[_jobInProgress.length-1];
          if (last.runchild !== undefined && last.runchild.finished) {
            last.runchild = undefined;
          }
          if (last.finished && last.cancel_deferred !== undefined) {
            var parent, idx;
            // this job has finished but due to cancellation
            if (_jobInProgress.length > 1) {
              // we have a parent job to cancel
              parent = _jobInProgress[_jobInProgress.length-2];
            }

            if (parent !== undefined) {
              parent.cancel_deferred = last.cancel_deferred;
              if (parent.evaluator && parent.evaluator.cancelExecution) {
                parent.evaluator.cancelExecution();
              }
              for(idx = 0; idx<parent.children.length; idx++) {
                parent.children[idx].output.result=ERROR_MESSAGE_ON_CANCEL;
                parent.children[idx].whendone.reject('... cancelled!');
                delete running[parent.children[idx].cellId];
              }
              parent.children = [];
            } else {
              for(idx = 0; idx<_queue.length; idx++) {
                _queue[idx].output.result=ERROR_MESSAGE_ON_CANCEL;
                _queue[idx].whendone.reject('... cancelled!');
                delete running[_queue[idx].cellId];
              }
              _queue = [];
            }
            last.whendone.reject('... cancelled!');
            delete running[last.cellId];
            _jobInProgress.pop();
            bkHelper.clearStatus("Evaluating " + last.evaluatorId + " cell " + last.cellId, true);
            if (parent !== undefined) {
              bkHelper.showStatus("Evaluating " + parent.evaluatorId + " cell " + parent.cellId, true);
            } else {
              last.cancel_deferred.resolve('done');
            }
            doNext(true);
            if (innext === undefined)
              bkHelper.updateStatus();
            return;
          }
          else if (last.runchild === undefined && last.children.length > 0) {
            // check if we can start a children
            job = last.children[0];
            last.children.shift();
            last.runchild = job;
          } else if (last.finished && last.children.length === 0) {
            // check if this has finished
            if (last.error) {
              last.whendone.reject(last.error);
              if (_jobInProgress.length > 1) {
                // we have a parent job to cancel
                var parent = _jobInProgress[_jobInProgress.length-2];

                var idx;
                for(idx = 0; idx<parent.children.length; idx++) {
                  parent.children[idx].output.result=ERROR_MESSAGE_ON_EARLIER_FAILURE;
                  parent.children[idx].whendone.reject("Evaluation cancelled due to a failure of an earlier cell evaluation");
                  delete running[parent.children[idx].cellId];
                }
                parent.children = [];
              } else {
                var idx;
                for(idx = 0; idx<_queue.length; idx++) {
                  _queue[idx].output.result=ERROR_MESSAGE_ON_EARLIER_FAILURE;
                  _queue[idx].whendone.reject("Evaluation cancelled due to a failure of an earlier cell evaluation");
                  delete running[_queue[idx].cellId];
                }
                _queue = [];
              }
            } else
              last.whendone.resolve(last.output);
            bkHelper.clearStatus("Evaluating " + last.evaluatorId + " cell " + last.cellId, true);
            delete running[last.cellId];
            _jobInProgress.pop();
            if (_jobInProgress.length > 0) {
              job = _jobInProgress[_jobInProgress.length-1];
              bkHelper.showStatus("Evaluating " + job.evaluatorId + " cell " + job.cellId, true);
            }
            doNext(true);
            if (innext === undefined)
              bkHelper.updateStatus();
            return;
          }
        }

        if (job === undefined) {
          $timeout(function() { bkHelper.refreshRootScope(); }, 0);
          return;
        }

        _jobInProgress.push(job);
        bkHelper.showStatus("Evaluating " + job.evaluatorId + " cell " + job.cellId, true);

        evaluateJob(job)
        .then(function(data) {
          job.finished = true;
          job.output = data;
          doNext();
        }, function(err) {
          job.finished = true;
          job.error = err;
          doNext();
        });
        if (innext === undefined)
          bkHelper.updateStatus();
      };

      return {
        add: function(job) {
          running[job.cellId] = true;
          _queue.push(job);
        },
        addChildren: function(job, child) {
          running[child.cellId] = true;
          job.children.push(child);
        },
        getCurrentJob: function() {
          if (_jobInProgress.length > 0)
            return _jobInProgress[_jobInProgress.length-1];
          return undefined;
        },
        cancelAll: function() {
          var idx;
          for ( idx=0; idx<_queue.length; idx++) {
            _queue[idx].output.output.result = ERROR_MESSAGE_ON_CANCEL;
            delete running[_queue[idx].cellId];
          }
          _queue = [];
        },
        isRunning: function(n) {
          return running[n] === true;
        },
        tick: function() {
          bkUtils.fcall(doNext);
        }
      };
    })();

    return {
      // evaluate a cell (as a subcell of currently running cell)
      evaluate: function(cell, notick) {
        var parent = jobQueue.getCurrentJob();
        if (parent === undefined)
          return this.evaluateRoot(cell);

        var deferred = bkUtils.newDeferred();
        if (jobQueue.isRunning(cell.id)) {
          bkHelper.showTransientStatus("ERROR: restart blocked for cell "+cell.id);
          console.log("RESTART PROHIBITED for cell "+cell.id);
          // prevent self restart
          deferred.reject("RESTART PROHIBITED for cell "+cell.id);
          return deferred.promise;
        }
        cell.output.result = MESSAGE_PENDING;
        if (!cell.output) {
          cell.output = {};
        }
        var evalJob = {
          parent: parent,
          cellId: cell.id,
          evaluatorId: cell.evaluator,
          code: cell.input.body,
          output: cell.output,
          retry: 0,
          finished: false,
          runchild: undefined,
          children: [],
          whendone : deferred
        };
        jobQueue.addChildren(parent,evalJob);
        if (notick === undefined)
          jobQueue.tick();
        return deferred.promise;
      },
      // evaluate a cell in top level context
      evaluateRoot: function(cell, notick) {
        var deferred = bkUtils.newDeferred();
        if (jobQueue.isRunning(cell.id)) {
          bkHelper.showTransientStatus("ERROR: restart blocked for cell "+cell.id);
          console.log("RESTART PROHIBITED for cell "+cell.id);
          // prevent self restart
          deferred.reject("RESTART PROHIBITED for cell "+cell.id);
          return deferred.promise;
        }
        cell.output.result = MESSAGE_PENDING;
        if (!cell.output) {
          cell.output = {};
        }
        var evalJob = {
          parent: parent,
          cellId: cell.id,
          evaluatorId: cell.evaluator,
          code: cell.input.body,
          output: cell.output,
          retry: 0,
          finished: false,
          runchild: undefined,
          children: [],
          whendone : deferred
        };
        jobQueue.add(evalJob);
        if (notick === undefined)
          jobQueue.tick();
        return deferred.promise;
      },
      // evaluate a cell (as a subcell of currently running cell)
      evaluateAll: function(cells) {
        var self = this;
        var promises = _(cells).map(function(cell) {
          return self.evaluate(cell, true);
        });
        jobQueue.tick();
        return bkUtils.all(promises);
      },
      // evaluate all cells in top level context
      evaluateRootAll: function(cells, parent) {
        var self = this;
        var promises = _(cells).map(function(cell) {
          return self.evaluateRoot(cell, true);
        });
        jobQueue.tick();
        return bkUtils.all(promises);
      },
      isCancellable: function() {
        var currentJob = jobQueue.getCurrentJob();
        return !!(currentJob && currentJob.evaluator && currentJob.evaluator.cancelExecution);
      },
      cancel: function() {
        var currentJob = jobQueue.getCurrentJob();
        var deferred = bkUtils.newDeferred();

        if (currentJob && currentJob.evaluator) {
          if (currentJob.evaluator.cancelExecution) {
            currentJob.cancel_deferred = deferred;
            currentJob.evaluator.cancelExecution();
            return deferred.promise;
          }
        }
        deferred.resolve();
        return deferred.promise;
      },
      cancelAll: function() {
        var currentJob = jobQueue.getCurrentJob();
        var deferred = bkUtils.newDeferred();

        jobQueue.cancelAll();

        if (currentJob && currentJob.evaluator) {
          if (currentJob.evaluator.cancelExecution) {
            currentJob.cancel_deferred = deferred;
            currentJob.evaluator.cancelExecution();
            return deferred.promise;
          }
        }
        deferred.resolve();
        return deferred.promise;
      },
      isAnyInProgress: function() {
        return !!jobQueue.getCurrentJob();
      },
      reset: function() {
        this.cancelAll();
      },
      registerOutputCell: function(id, out) {
        outputMap[id] = out;
      },
      deRegisterOutputCell: function(id) {
        delete outputMap[id];
      },
      getOutputCell: function(id) {
        return outputMap[id];
      },

    };
  });

})();


text:
<?php

namespace dokuwiki\Menu\Item;

/**
 * Class ImgBackto
 *
 * Links back to the originating page from a detail image view
 */
class ImgBackto extends AbstractItem {

    /** @inheritdoc */
    public function __construct() {
        global $ID;
        parent::__construct();

        $this->svg = DOKU_INC . 'lib/images/menu/12-back_arrow-left.svg';
        $this->type = 'img_backto';
        $this->params = array();
        $this->accesskey = 'b';
        $this->replacement = $ID;
    }

}


text:
GameEngine
Engine Github Assigment 3:
https://github.com/Game-Masters/Game-Engine-Unreal

Collaborators Github:

Nicolas Babot:
Github: https://github.com/nicobabot
Daniel Olondriz:
Github: https://github.com/danielolondriz
Arstation: https://www.artstation.com/drixxart

Link to our website:
There you can see more detailed explanations with gifs of the shader pipeline, and the how the Engine Works.
https://nicobabotaltisen.wixsite.com/zenigine

Link to the official License:
https://www.apache.org/licenses/LICENSE-2.0

##VERSIONS:
	check [NEW] tag for the new things implemented in the last version (please check important notes down below) :

	V0.7 [NEW]

	Now the game engine works with the Shader Pipeline. Now any mesh will be rendered using shaders. You can create vertex and fragment shaders and link them
	to a Program Shader. You can switch between shaders from the inspector tab. If you double click on a shader, it will open in a built-in editor, where you can
	edit and save your shaders. Shaders will change in realtime, so you can see the changes you're making. Keep in mind that if a shader does not compile
 	the shader will show an uncompiled shader.

	V0.4
	Code is based on a structure of gameobjects and components, and files are saved in our own file format (.ric). You can save and load scenes
	from your directories (serialization), and load meshes and fbx aswell. Optimization has been added to the scene, like frustrum Culling and Octree implementation.
	You can select the diferent objects by clicking on them (mouse picking) and you can move, scale and rotate using Gizmos. You can also play,
	pause and stop in scene(time managment).
	Resource Managment is implemented aswell, like reference counting, assets bar inside game engine UI, texture updated in realtime.

	V0.03
	The geometry is imported with the same transformation and it can have normals and textures
	You can move arround the world using WASD and also the wheel mouse to Zoom if yoy press alt you will rotate the camera arround the geometry in the world
	We also added the system of Dock to make the UI of our Engine better
	Added JSON library to access to XML files
	We are students from the UPC CITM and we are making a game engine for 3D videogames.

	V0.02
	On this version the 3D engine has:
	A window for all the options of every module, such as: wireframe mode, show normal, size of the window, title window, full screen…
	A window that shows the performance of the engine. You can see the frames average and also the time spend in every module.
	Console to see the outputs of the Engine.
	Drag and drop of FBX in the Engine and importing geometry.

	v0.01
	In the first version we added the ImGui Library and if you run it you should press the 'GRAVE' to show the game engine GUI. Also, if you press F1 button you can move around
	the 3D world with the mouse.

##INNOVATION
-Assets tab, unity style ( and double click in one fbx to load it with textures!).
-Octree is adaptative to the mesh dropped in scene.
-You can add components (mesh and material) to a gameobject.
-Gizmos.
-You can clean scene.
[NEW]- You can choose the colors of the light, albedo, and shines of the water shader, from the shader inspector.
[NEW]- Water Shader Variations.
[NEW]- Use of normal maps in the water shader.

[NEW]
##SHADER PIPELINE

	If you want to load the scene asked in the 3rd Assignment, go to Menu, Load Scene, open the Assets/Scene tab and Choose Scene_Water_Assignment3.json
	Please check the Assigment 3 Notes paragraph  for more info in the scene.

	##Create a shader
	Go to gameobject menu-> Create New Shader.
	Choose the type of shader and its name and press Enter to save it.

	##Edit a shader in the builtIn Editor
	In the Assets tab, go to the Shader Folder, double click your shader and the editor will open.
	There you can edit and Save all the changes.

	##Build a Program Shader
	Go to gameobject menu->Link new shader program.
	Choose the two shaders you want to attach, add a name to the Shader Program and press Enter to save it.
	##Change shader
	The Default shader is set if you double click a fbx in the Asset Window.
	To change it, double click the object in the World Window or select the mesh from the Scene window.
	In the Inspector Window, click Shader Type, and select the shader you want to use.
	If you save a scene and load it. It will load the shaders you have used.

##CONTROLS:
The controls in the info button inside the Engine are outdated! Check the following ones for correct inputs:

Camera Movement:
	ALT+LEFT CLICK: Click alt+left click to orbit around axis, or the center of the object, if there is one.
	SCROLL WHEEL: use the scroll wheel to zoom in/ zoom out.
	W A S D: use w a s d to move around the world.
	R F: use R & F to go up or go down in the Y axis.

Tabs:
	Right tabs:
		Imspector:It displays info of the meshes that are loaded in scene, like position, rotation, texture, texture size and others.
		Information: Every important variable of each module is displayed here, like your computer's info, change scene background and others.

	Main tabs:
		Rendering options:Buttons that let you activate different rendering options, check out it's help icon for more...
		UPDATE: There is also the OCTREE window and PLAY PAUSE buttons

		World:World is displayed.

		About:Info about the engine and its creators.

		Application:Performance graphs.
		Assets: Directories, FBX and textures are displayed here. Double clikc a folder to open it, press ESC to go back.

	Left tabs:
		Scene Inspector: here you can see all gameobjects in scene with his parents. Click on "root" to open it's children.

Menu:
	Console:opens the console.
	Open github:opens developer github's page.
	Close:closes the app.
	Save & Load Scene: You can save and load scenes

Gameobject:
	Create Empty Gameobject: Creates new empty gameobject.
	Create Camera: Creates camera gameobject with Frustum.

[NEW]
##ASSIGMENT 3 NOTES
	The scene is composed by the Street Enviroment rendered with the Default Shader and 3 planes with a water shader.
	The right one is render with the shader Water_with_Foam which should be the definitive and most complete water shader, with homogeneous foam on top of the waves.
	However we added two variations to the shader, with the middle one having no foam on top  of the waves and using the Water_No_Foam shader, and the third one
	with non homogeneous foam on top  of the waves with the shader Water_With_Foam_NoUniform.
	All those three shaders use 3 color pickers, where you can change the color of the albedo, light, and specular light maps.
	Advice: Try not to load or save while the engine is in play mode because it has some bugs. If you create any shader object remember to add the version 300 of GLSL.

##IMPORTANT NOTES AND HOW TO LOAD FBX AND GAMEOBJECTS

When you drag and drop fbx, they are imported to the libraries, not in scene.
When you create a Empty Game Object, it is created in scene. Doubleclick it in the SCENE TAB and It's components will show in the INSPECTOR.
You can add 2 new components in the inspector:

	MESH: Double click the fbx to load it (without textures!)
	TEXTURE: Select the png or texture you want to load to your mesh (NOTE: This only works if the Gameobject has already a Mesh component!!)

If you want to load fbx with its textures, you can double click them in the ASSETS window, and they will be loaded with textures.
You can create a directory by RIGHT CLICKING in the asset tab.
You can also create a gameobject, or a camera gameobject by RIGHTCLICKING the SCENE INSPECTOR tab.

NOTE: If you find that controls are not responsive, please keep in mind that we use a focus system, so if you want to create a directory be sure
to LEFT CLICK over the asset window before doing it, and same for any control that involves clicking over a certain window.

Thanks to ImGui, Assimp, Devil, JSON and also cereal libraries.


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Andirá</logradouro><bairro>Guaraituba</bairro><cidade>Colombo</cidade><uf>PR</uf><cep>83410030</cep></feed>


text:
import unittest
import invoiced
from invoiced.test.objects.operations import (
    TestEndpoint,
    CreatableObject,
    RetrievableObject,
    UpdatableObject,
    DeletableObject,
    ListAll
)

class TestSignUpPage(TestEndpoint, CreatableObject, RetrievableObject,
                     UpdatableObject, DeletableObject, ListAll,
                     unittest.TestCase):
    objectClass = invoiced.SignUpPage
    endpoint = '/sign_up_pages'


text:
package org.daisy.pipeline.gui;

import java.text.Collator;
import java.net.MalformedURLException;
import javafx.beans.value.ChangeListener;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.transformation.SortedList;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.util.Callback;
import javafx.util.StringConverter;
import javafx.collections.FXCollections;

import org.daisy.pipeline.gui.databridge.Script;
import org.daisy.pipeline.job.Job;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Iterators;
import org.daisy.pipeline.gui.databridge.BoundScript;
import org.daisy.pipeline.gui.databridge.JobExecutor;
import org.daisy.pipeline.gui.databridge.ObservableJob;
import org.daisy.pipeline.gui.databridge.ScriptField.DataType;
import org.daisy.pipeline.gui.databridge.ScriptFieldAnswer;
import org.daisy.pipeline.gui.databridge.ScriptValidator;

public class NewJobPane extends VBox {
        private static final Logger logger = LoggerFactory.getLogger(NewJobPane.class);

	private ScriptInfoHeaderVBox scriptInfoBox;
	private GridPaneHelper scriptFormControlsGrid;
	private MainWindow main;
	private ServiceRegistry pipelineServices;
	private ObservableList<Script> scripts;
	private BoundScript boundScript;

	private final ComboBox<Script> scriptsCombo = new ComboBox<Script>();

	public NewJobPane(MainWindow main, ServiceRegistry pipelineServices) {
		super();
		this.main = main;
		this.pipelineServices = pipelineServices;
                scripts = main.getScriptData();
                String css = getClass().getResource("/org/daisy/pipeline/gui/resources/application.css").toExternalForm();
                this.getStylesheets().add(css);
                initControls();

	}

	public BoundScript getBoundScript() {
		return boundScript;
	}

	// reset the combo selection and clear the script details grid
	public void clearScriptDetails() {
		scriptsCombo.getSelectionModel().clearSelection();
		scriptInfoBox.clearControls();
		scriptFormControlsGrid.clearControls();
		main.clearValidationMessages();
	}
	public void newFromBoundScript(BoundScript boundScript) {
		scriptsCombo.getSelectionModel().select(boundScript.getScript());

	}

	@Override
	public void requestFocus() {
		scriptsCombo.requestFocus();
	}

	private void initControls() {
		this.getStyleClass().add("new-job");
	    HBox topGrid = new HBox();
	    this.getChildren().add(topGrid);

	    topGrid.setSpacing(20.0);

		String paneTitle = "New job";
		Label title = new Label("Script:");

		// prepend the pane title to the accessible text of the first node
		// so that it is spoken when switching between panes with F6
		title.setAccessibleText(paneTitle + " - Choose a script");
		title.setLabelFor(scriptsCombo);
    //scriptsCombo.accessibleTextProperty().bind( new SimpleStringProperty( ((Script)scriptsCombo.getSelectionModel().selectedItemProperty().getValue()).getName()) );
    //scriptsCombo.accessibleHelpProperty().bind( new SimpleStringProperty( ((Script)scriptsCombo.getSelectionModel().selectedItemProperty().getValue()).getDescription()) );
		topGrid.getChildren().add(title);

		//scriptsCombo.setItems(scripts.sorted());
		scriptsCombo.setItems(new SortedList<Script>(scripts,new Script.ScriptComparator()));
		scriptsCombo.setCellFactory(new Callback<ListView<Script>,ListCell<Script>>(){

            public ListCell<Script> call(ListView<Script> p) {
                final ListCell<Script> cell = new ListCell<Script>(){
                    @Override
                    protected void updateItem(Script t, boolean bln) {
                        super.updateItem(t, bln);

                        if(t != null) {
                            setText(t.getName());
                        }
                        else {
                            setText(null);
                        }
                    }
                };
                return cell;
            }
        });
                scriptsCombo.setConverter(new StringConverter<Script>() {
            @Override
            public String toString(Script script) {
              if (script == null){
                return null;
              }
              else {
                return script.getName();
              }
            }

                        @Override
                        public Script fromString(String string) {
                                // TODO Auto-generated method stub
                                return null;
                        }

      });

                topGrid.getChildren().add(scriptsCombo);

                scriptsCombo.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Script>() {

                        public void changed(ObservableValue<? extends Script> observable,
                                        Script oldValue, Script newValue) {

                                newScriptSelected(newValue);
                                // skip "Choose a script" when a script has been selected
                                title.setAccessibleText(paneTitle);
                        }
                });

                scriptInfoBox = new ScriptInfoHeaderVBox(main);
                this.getChildren().add(scriptInfoBox);
                scriptFormControlsGrid = new GridPaneHelper(main);
                scriptFormControlsGrid.setColumnWidths(50, 40, 20);
                this.getChildren().add(scriptFormControlsGrid);

        }

        private void newScriptSelected(Script script) {
                if (script == null) {
                        return;
                }
                main.clearValidationMessages();
                main.enableRunJobMenuItem();
                scriptInfoBox.clearControls();
                scriptFormControlsGrid.clearControls();
                boundScript = new BoundScript(script);
                populateScriptDetailsGrid();
        }

        private void populateScriptDetailsGrid() {

                scriptInfoBox.populate(boundScript.getScript());

                for (ScriptFieldAnswer option : boundScript.getRequiredOptionFields()) {
                        addOptionField(option);
                }

                if (Iterators.size(boundScript.getOptionalOptionFields().iterator()) > 0) {
                        Text options = new Text("Options:");
                        options.getStyleClass().add("subtitle");
                        scriptFormControlsGrid.addRow(options);
                }
                for (ScriptFieldAnswer option : boundScript.getOptionalOptionFields()) {
                        addOptionField(option);
                }

                addStandardButtons();

        }

        private void addOptionField(ScriptFieldAnswer answer) {
                switch (answer.getField().getFieldType()) {
                case OUTPUT:
                        throw new RuntimeException();
                case INPUT:
                        if (answer.getField().isSequence()) {
                            scriptFormControlsGrid.addFileDirPickerSequence((ScriptFieldAnswer.ScriptFieldAnswerList)answer);
                        } else {
                            scriptFormControlsGrid.addFileDirPicker((ScriptFieldAnswer.ScriptFieldAnswerString)answer);
                        }
                        break;
                case OPTION:
                        DataType fieldDataType = answer.getField().getDataType();
                        if (fieldDataType == DataType.FILE || fieldDataType == DataType.DIRECTORY) {
                                if (answer.getField().isSequence()) {
                                        scriptFormControlsGrid.addFileDirPickerSequence((ScriptFieldAnswer.ScriptFieldAnswerList)answer);
                                }
                                else {
                                        scriptFormControlsGrid.addFileDirPicker((ScriptFieldAnswer.ScriptFieldAnswerString)answer);
                                }
                        } else if (fieldDataType == DataType.BOOLEAN) {
                                scriptFormControlsGrid.addCheckbox((ScriptFieldAnswer.ScriptFieldAnswerBoolean)answer);
                        } else {
                                if (answer.getField().isSequence()) {
                                        scriptFormControlsGrid.addTextFieldSequence((ScriptFieldAnswer.ScriptFieldAnswerList)answer);
                                } else {
                                        scriptFormControlsGrid.addTextField((ScriptFieldAnswer.ScriptFieldAnswerString)answer);
                                }
                        }
                }
        }

        private void addStandardButtons() {
                Button run = new Button("Run");
                run.getStyleClass().add("run-button");
                scriptFormControlsGrid.addRow(run);

                run.setOnAction(new EventHandler<ActionEvent>() {
                        public void handle(ActionEvent event) {
                                runJob();
                        }
                });

        }

        public void runJob() {
                ScriptValidator validator = new ScriptValidator(boundScript);
                if (!validator.validate()) {
                        logger.debug("Script is not valid");
                        ObservableList<String> messages = validator.getMessages();
                        main.addValidationMessages(messages);
                }
                else {
                        Job newJob;
                        try {
                                newJob = JobExecutor.runJob(main, pipelineServices, boundScript);
                                if (newJob != null) {
                                        ObservableJob objob = main.getDataManager().addJob(newJob, boundScript);
                                        main.getCurrentJobProperty().set(objob);
                                } else {
                                        logger.error("Couldn't create the job");
                                }
                        } catch (MalformedURLException e) {
                                ObservableList<String> error= FXCollections.observableArrayList();
                                error.add("Error while trasfroming path: "+e.getMessage());
                                main.addValidationMessages(error);
                                logger.error("Couldn't create the job",e);
                        }
                }
        }
}


text:
package text;

import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class Snippet346 {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		shell.setText("Snippet 346");

		Text text = new Text(shell, SWT.PASSWORD | SWT.BORDER);
		text.setTextChars(new char[]{'p','a','s','s'});
		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}