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

   http://x12parser.rubyforge.org

   Copyright (C) 2009 APP Design, Inc.

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

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

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

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

<Segment name="CAD" comment="To specify transportation details for the transaction">
  <Field name="TransportationMethodTypeCode" required="y" min="1" max="2" validation="T91" comment="Code specifying the method or type of transportation for the shipment"/>
  <Field name="EquipmentInitial" required="y" min="1" max="4" comment="Prefix or alphabetic part of an equipment unit's identifying number"/>
  <Field name="EquipmentNumber" required="y" min="1" max="15" comment="Sequencing or serial part of an equipment unit's identifying number (pure numeric form for equipment number is preferred)"/>
  <Field name="StandardCarrierAlphaCode" required="y" min="2" max="4" comment="Standard Carrier Alpha Code"/>
  <Field name="Routing" required="y" min="1" max="35" comment="Free-form description of the routing or requested routing for shipment, or the originating carrier's identity"/>
  <Field name="ShipmentOrderStatusCode" required="y" min="2" max="2" validation="T368" comment="Code indicating the status of an order or shipment or the disposition of any difference between the quantity ordered and the quantity shipped for a line item or transaction"/>
  <Field name="ReferenceIdentificationQualifier" required="y" min="2" max="3" validation="T128" comment="Code qualifying the Reference Identification"/>
  <Field name="ReferenceIdentification" required="y" min="1" max="50" comment="Reference information as defined for a particular Transaction Set or as specified by the Reference Identification Qualifier"/>
  <Field name="ServiceLevelCode" required="y" min="2" max="2" validation="T284" comment="Code indicating the level of transportation service or the billing service offered by the transportation carrier"/>
</Segment>


text:
#pragma once
#include <aws/rds/RDS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/rds/model/PendingCloudwatchLogsExports.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/rds/model/AutomationMode.h>
#include <aws/core/utils/DateTime.h>
#include <aws/rds/model/ProcessorFeature.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace RDS
{
namespace Model
{

  /**
   *
This data type is used as a response element in the
   * ModifyDBInstance operation and contains changes that will be
   * applied during the next maintenance window.

See Also:
   AWS
   * API Reference

   */
  class AWS_RDS_API PendingModifiedValues
  {
  public:
    PendingModifiedValues();
    PendingModifiedValues(const Aws::Utils::Xml::XmlNode& xmlNode);
    PendingModifiedValues& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline const Aws::String& GetDBInstanceClass() const{ return m_dBInstanceClass; }

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline bool DBInstanceClassHasBeenSet() const { return m_dBInstanceClassHasBeenSet; }

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline void SetDBInstanceClass(const Aws::String& value) { m_dBInstanceClassHasBeenSet = true; m_dBInstanceClass = value; }

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline void SetDBInstanceClass(Aws::String&& value) { m_dBInstanceClassHasBeenSet = true; m_dBInstanceClass = std::move(value); }

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline void SetDBInstanceClass(const char* value) { m_dBInstanceClassHasBeenSet = true; m_dBInstanceClass.assign(value); }

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline PendingModifiedValues& WithDBInstanceClass(const Aws::String& value) { SetDBInstanceClass(value); return *this;}

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline PendingModifiedValues& WithDBInstanceClass(Aws::String&& value) { SetDBInstanceClass(std::move(value)); return *this;}

    /**
     *
The name of the compute and memory capacity class for the DB instance.

     */
    inline PendingModifiedValues& WithDBInstanceClass(const char* value) { SetDBInstanceClass(value); return *this;}

    /**
     *
The allocated storage size for the DB instance specified in gibibytes
     * (GiB).

     */
    inline int GetAllocatedStorage() const{ return m_allocatedStorage; }

    /**
     *
The allocated storage size for the DB instance specified in gibibytes
     * (GiB).

     */
    inline bool AllocatedStorageHasBeenSet() const { return m_allocatedStorageHasBeenSet; }

    /**
     *
The allocated storage size for the DB instance specified in gibibytes
     * (GiB).

     */
    inline void SetAllocatedStorage(int value) { m_allocatedStorageHasBeenSet = true; m_allocatedStorage = value; }

    /**
     *
The allocated storage size for the DB instance specified in gibibytes
     * (GiB).

     */
    inline PendingModifiedValues& WithAllocatedStorage(int value) { SetAllocatedStorage(value); return *this;}

    /**
     *
The master credentials for the DB instance.

     */
    inline const Aws::String& GetMasterUserPassword() const{ return m_masterUserPassword; }

    /**
     *
The master credentials for the DB instance.

     */
    inline bool MasterUserPasswordHasBeenSet() const { return m_masterUserPasswordHasBeenSet; }

    /**
     *
The master credentials for the DB instance.

     */
    inline void SetMasterUserPassword(const Aws::String& value) { m_masterUserPasswordHasBeenSet = true; m_masterUserPassword = value; }

    /**
     *
The master credentials for the DB instance.

     */
    inline void SetMasterUserPassword(Aws::String&& value) { m_masterUserPasswordHasBeenSet = true; m_masterUserPassword = std::move(value); }

    /**
     *
The master credentials for the DB instance.

     */
    inline void SetMasterUserPassword(const char* value) { m_masterUserPasswordHasBeenSet = true; m_masterUserPassword.assign(value); }

    /**
     *
The master credentials for the DB instance.

     */
    inline PendingModifiedValues& WithMasterUserPassword(const Aws::String& value) { SetMasterUserPassword(value); return *this;}

    /**
     *
The master credentials for the DB instance.

     */
    inline PendingModifiedValues& WithMasterUserPassword(Aws::String&& value) { SetMasterUserPassword(std::move(value)); return *this;}

    /**
     *
The master credentials for the DB instance.

     */
    inline PendingModifiedValues& WithMasterUserPassword(const char* value) { SetMasterUserPassword(value); return *this;}

    /**
     *
The port for the DB instance.

     */
    inline int GetPort() const{ return m_port; }

    /**
     *
The port for the DB instance.

     */
    inline bool PortHasBeenSet() const { return m_portHasBeenSet; }

    /**
     *
The port for the DB instance.

     */
    inline void SetPort(int value) { m_portHasBeenSet = true; m_port = value; }

    /**
     *
The port for the DB instance.

     */
    inline PendingModifiedValues& WithPort(int value) { SetPort(value); return *this;}

    /**
     *
The number of days for which automated backups are retained.

     */
    inline int GetBackupRetentionPeriod() const{ return m_backupRetentionPeriod; }

    /**
     *
The number of days for which automated backups are retained.

     */
    inline bool BackupRetentionPeriodHasBeenSet() const { return m_backupRetentionPeriodHasBeenSet; }

    /**
     *
The number of days for which automated backups are retained.

     */
    inline void SetBackupRetentionPeriod(int value) { m_backupRetentionPeriodHasBeenSet = true; m_backupRetentionPeriod = value; }

    /**
     *
The number of days for which automated backups are retained.

     */
    inline PendingModifiedValues& WithBackupRetentionPeriod(int value) { SetBackupRetentionPeriod(value); return *this;}

    /**
     *
A value that indicates that the Single-AZ DB instance will change to a
     * Multi-AZ deployment.

     */
    inline bool GetMultiAZ() const{ return m_multiAZ; }

    /**
     *
A value that indicates that the Single-AZ DB instance will change to a
     * Multi-AZ deployment.

     */
    inline bool MultiAZHasBeenSet() const { return m_multiAZHasBeenSet; }

    /**
     *
A value that indicates that the Single-AZ DB instance will change to a
     * Multi-AZ deployment.

     */
    inline void SetMultiAZ(bool value) { m_multiAZHasBeenSet = true; m_multiAZ = value; }

    /**
     *
A value that indicates that the Single-AZ DB instance will change to a
     * Multi-AZ deployment.

     */
    inline PendingModifiedValues& WithMultiAZ(bool value) { SetMultiAZ(value); return *this;}

    /**
     *
The database engine version.

     */
    inline const Aws::String& GetEngineVersion() const{ return m_engineVersion; }

    /**
     *
The database engine version.

     */
    inline bool EngineVersionHasBeenSet() const { return m_engineVersionHasBeenSet; }

    /**
     *
The database engine version.

     */
    inline void SetEngineVersion(const Aws::String& value) { m_engineVersionHasBeenSet = true; m_engineVersion = value; }

    /**
     *
The database engine version.

     */
    inline void SetEngineVersion(Aws::String&& value) { m_engineVersionHasBeenSet = true; m_engineVersion = std::move(value); }

    /**
     *
The database engine version.

     */
    inline void SetEngineVersion(const char* value) { m_engineVersionHasBeenSet = true; m_engineVersion.assign(value); }

    /**
     *
The database engine version.

     */
    inline PendingModifiedValues& WithEngineVersion(const Aws::String& value) { SetEngineVersion(value); return *this;}

    /**
     *
The database engine version.

     */
    inline PendingModifiedValues& WithEngineVersion(Aws::String&& value) { SetEngineVersion(std::move(value)); return *this;}

    /**
     *
The database engine version.

     */
    inline PendingModifiedValues& WithEngineVersion(const char* value) { SetEngineVersion(value); return *this;}

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline const Aws::String& GetLicenseModel() const{ return m_licenseModel; }

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline bool LicenseModelHasBeenSet() const { return m_licenseModelHasBeenSet; }

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline void SetLicenseModel(const Aws::String& value) { m_licenseModelHasBeenSet = true; m_licenseModel = value; }

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline void SetLicenseModel(Aws::String&& value) { m_licenseModelHasBeenSet = true; m_licenseModel = std::move(value); }

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline void SetLicenseModel(const char* value) { m_licenseModelHasBeenSet = true; m_licenseModel.assign(value); }

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline PendingModifiedValues& WithLicenseModel(const Aws::String& value) { SetLicenseModel(value); return *this;}

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline PendingModifiedValues& WithLicenseModel(Aws::String&& value) { SetLicenseModel(std::move(value)); return *this;}

    /**
     *
The license model for the DB instance.

Valid values:
     * license-included | bring-your-own-license |
     * general-public-license

     */
    inline PendingModifiedValues& WithLicenseModel(const char* value) { SetLicenseModel(value); return *this;}

    /**
     *
The Provisioned IOPS value for the DB instance.

     */
    inline int GetIops() const{ return m_iops; }

    /**
     *
The Provisioned IOPS value for the DB instance.

     */
    inline bool IopsHasBeenSet() const { return m_iopsHasBeenSet; }

    /**
     *
The Provisioned IOPS value for the DB instance.

     */
    inline void SetIops(int value) { m_iopsHasBeenSet = true; m_iops = value; }

    /**
     *
The Provisioned IOPS value for the DB instance.

     */
    inline PendingModifiedValues& WithIops(int value) { SetIops(value); return *this;}

    /**
     *
The database identifier for the DB instance.

     */
    inline const Aws::String& GetDBInstanceIdentifier() const{ return m_dBInstanceIdentifier; }

    /**
     *
The database identifier for the DB instance.

     */
    inline bool DBInstanceIdentifierHasBeenSet() const { return m_dBInstanceIdentifierHasBeenSet; }

    /**
     *
The database identifier for the DB instance.

     */
    inline void SetDBInstanceIdentifier(const Aws::String& value) { m_dBInstanceIdentifierHasBeenSet = true; m_dBInstanceIdentifier = value; }

    /**
     *
The database identifier for the DB instance.

     */
    inline void SetDBInstanceIdentifier(Aws::String&& value) { m_dBInstanceIdentifierHasBeenSet = true; m_dBInstanceIdentifier = std::move(value); }

    /**
     *
The database identifier for the DB instance.

     */
    inline void SetDBInstanceIdentifier(const char* value) { m_dBInstanceIdentifierHasBeenSet = true; m_dBInstanceIdentifier.assign(value); }

    /**
     *
The database identifier for the DB instance.

     */
    inline PendingModifiedValues& WithDBInstanceIdentifier(const Aws::String& value) { SetDBInstanceIdentifier(value); return *this;}

    /**
     *
The database identifier for the DB instance.

     */
    inline PendingModifiedValues& WithDBInstanceIdentifier(Aws::String&& value) { SetDBInstanceIdentifier(std::move(value)); return *this;}

    /**
     *
The database identifier for the DB instance.

     */
    inline PendingModifiedValues& WithDBInstanceIdentifier(const char* value) { SetDBInstanceIdentifier(value); return *this;}

    /**
     *
The storage type of the DB instance.

     */
    inline const Aws::String& GetStorageType() const{ return m_storageType; }

    /**
     *
The storage type of the DB instance.

     */
    inline bool StorageTypeHasBeenSet() const { return m_storageTypeHasBeenSet; }

    /**
     *
The storage type of the DB instance.

     */
    inline void SetStorageType(const Aws::String& value) { m_storageTypeHasBeenSet = true; m_storageType = value; }

    /**
     *
The storage type of the DB instance.

     */
    inline void SetStorageType(Aws::String&& value) { m_storageTypeHasBeenSet = true; m_storageType = std::move(value); }

    /**
     *
The storage type of the DB instance.

     */
    inline void SetStorageType(const char* value) { m_storageTypeHasBeenSet = true; m_storageType.assign(value); }

    /**
     *
The storage type of the DB instance.

     */
    inline PendingModifiedValues& WithStorageType(const Aws::String& value) { SetStorageType(value); return *this;}

    /**
     *
The storage type of the DB instance.

     */
    inline PendingModifiedValues& WithStorageType(Aws::String&& value) { SetStorageType(std::move(value)); return *this;}

    /**
     *
The storage type of the DB instance.

     */
    inline PendingModifiedValues& WithStorageType(const char* value) { SetStorageType(value); return *this;}

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline const Aws::String& GetCACertificateIdentifier() const{ return m_cACertificateIdentifier; }

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline bool CACertificateIdentifierHasBeenSet() const { return m_cACertificateIdentifierHasBeenSet; }

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline void SetCACertificateIdentifier(const Aws::String& value) { m_cACertificateIdentifierHasBeenSet = true; m_cACertificateIdentifier = value; }

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline void SetCACertificateIdentifier(Aws::String&& value) { m_cACertificateIdentifierHasBeenSet = true; m_cACertificateIdentifier = std::move(value); }

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline void SetCACertificateIdentifier(const char* value) { m_cACertificateIdentifierHasBeenSet = true; m_cACertificateIdentifier.assign(value); }

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline PendingModifiedValues& WithCACertificateIdentifier(const Aws::String& value) { SetCACertificateIdentifier(value); return *this;}

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline PendingModifiedValues& WithCACertificateIdentifier(Aws::String&& value) { SetCACertificateIdentifier(std::move(value)); return *this;}

    /**
     *
The identifier of the CA certificate for the DB instance.

     */
    inline PendingModifiedValues& WithCACertificateIdentifier(const char* value) { SetCACertificateIdentifier(value); return *this;}

    /**
     *
The DB subnet group for the DB instance.

     */
    inline const Aws::String& GetDBSubnetGroupName() const{ return m_dBSubnetGroupName; }

    /**
     *
The DB subnet group for the DB instance.

     */
    inline bool DBSubnetGroupNameHasBeenSet() const { return m_dBSubnetGroupNameHasBeenSet; }

    /**
     *
The DB subnet group for the DB instance.

     */
    inline void SetDBSubnetGroupName(const Aws::String& value) { m_dBSubnetGroupNameHasBeenSet = true; m_dBSubnetGroupName = value; }

    /**
     *
The DB subnet group for the DB instance.

     */
    inline void SetDBSubnetGroupName(Aws::String&& value) { m_dBSubnetGroupNameHasBeenSet = true; m_dBSubnetGroupName = std::move(value); }

    /**
     *
The DB subnet group for the DB instance.

     */
    inline void SetDBSubnetGroupName(const char* value) { m_dBSubnetGroupNameHasBeenSet = true; m_dBSubnetGroupName.assign(value); }

    /**
     *
The DB subnet group for the DB instance.

     */
    inline PendingModifiedValues& WithDBSubnetGroupName(const Aws::String& value) { SetDBSubnetGroupName(value); return *this;}

    /**
     *
The DB subnet group for the DB instance.

     */
    inline PendingModifiedValues& WithDBSubnetGroupName(Aws::String&& value) { SetDBSubnetGroupName(std::move(value)); return *this;}

    /**
     *
The DB subnet group for the DB instance.

     */
    inline PendingModifiedValues& WithDBSubnetGroupName(const char* value) { SetDBSubnetGroupName(value); return *this;}

    inline const PendingCloudwatchLogsExports& GetPendingCloudwatchLogsExports() const{ return m_pendingCloudwatchLogsExports; }

    inline bool PendingCloudwatchLogsExportsHasBeenSet() const { return m_pendingCloudwatchLogsExportsHasBeenSet; }

    inline void SetPendingCloudwatchLogsExports(const PendingCloudwatchLogsExports& value) { m_pendingCloudwatchLogsExportsHasBeenSet = true; m_pendingCloudwatchLogsExports = value; }

    inline void SetPendingCloudwatchLogsExports(PendingCloudwatchLogsExports&& value) { m_pendingCloudwatchLogsExportsHasBeenSet = true; m_pendingCloudwatchLogsExports = std::move(value); }

    inline PendingModifiedValues& WithPendingCloudwatchLogsExports(const PendingCloudwatchLogsExports& value) { SetPendingCloudwatchLogsExports(value); return *this;}

    inline PendingModifiedValues& WithPendingCloudwatchLogsExports(PendingCloudwatchLogsExports&& value) { SetPendingCloudwatchLogsExports(std::move(value)); return *this;}

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline const Aws::Vector<ProcessorFeature>& GetProcessorFeatures() const{ return m_processorFeatures; }

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline bool ProcessorFeaturesHasBeenSet() const { return m_processorFeaturesHasBeenSet; }

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline void SetProcessorFeatures(const Aws::Vector<ProcessorFeature>& value) { m_processorFeaturesHasBeenSet = true; m_processorFeatures = value; }

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline void SetProcessorFeatures(Aws::Vector<ProcessorFeature>&& value) { m_processorFeaturesHasBeenSet = true; m_processorFeatures = std::move(value); }

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline PendingModifiedValues& WithProcessorFeatures(const Aws::Vector<ProcessorFeature>& value) { SetProcessorFeatures(value); return *this;}

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline PendingModifiedValues& WithProcessorFeatures(Aws::Vector<ProcessorFeature>&& value) { SetProcessorFeatures(std::move(value)); return *this;}

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline PendingModifiedValues& AddProcessorFeatures(const ProcessorFeature& value) { m_processorFeaturesHasBeenSet = true; m_processorFeatures.push_back(value); return *this; }

    /**
     *
The number of CPU cores and the number of threads per core for the DB
     * instance class of the DB instance.

     */
    inline PendingModifiedValues& AddProcessorFeatures(ProcessorFeature&& value) { m_processorFeaturesHasBeenSet = true; m_processorFeatures.push_back(std::move(value)); return *this; }

    /**
     *
Whether mapping of Amazon Web Services Identity and Access Management (IAM)
     * accounts to database accounts is enabled.

     */
    inline bool GetIAMDatabaseAuthenticationEnabled() const{ return m_iAMDatabaseAuthenticationEnabled; }

    /**
     *
Whether mapping of Amazon Web Services Identity and Access Management (IAM)
     * accounts to database accounts is enabled.

     */
    inline bool IAMDatabaseAuthenticationEnabledHasBeenSet() const { return m_iAMDatabaseAuthenticationEnabledHasBeenSet; }

    /**
     *
Whether mapping of Amazon Web Services Identity and Access Management (IAM)
     * accounts to database accounts is enabled.

     */
    inline void SetIAMDatabaseAuthenticationEnabled(bool value) { m_iAMDatabaseAuthenticationEnabledHasBeenSet = true; m_iAMDatabaseAuthenticationEnabled = value; }

    /**
     *
Whether mapping of Amazon Web Services Identity and Access Management (IAM)
     * accounts to database accounts is enabled.

     */
    inline PendingModifiedValues& WithIAMDatabaseAuthenticationEnabled(bool value) { SetIAMDatabaseAuthenticationEnabled(value); return *this;}

    /**
     *
The automation mode of the RDS Custom DB instance: full or
     * all-paused. If full, the DB instance automates
     * monitoring and instance recovery. If all-paused, the instance
     * pauses automation for the duration set by
     * --resume-full-automation-mode-minutes.

     */
    inline const AutomationMode& GetAutomationMode() const{ return m_automationMode; }

    /**
     *
The automation mode of the RDS Custom DB instance: full or
     * all-paused. If full, the DB instance automates
     * monitoring and instance recovery. If all-paused, the instance
     * pauses automation for the duration set by
     * --resume-full-automation-mode-minutes.

     */
    inline bool AutomationModeHasBeenSet() const { return m_automationModeHasBeenSet; }

    /**
     *
The automation mode of the RDS Custom DB instance: full or
     * all-paused. If full, the DB instance automates
     * monitoring and instance recovery. If all-paused, the instance
     * pauses automation for the duration set by
     * --resume-full-automation-mode-minutes.

     */
    inline void SetAutomationMode(const AutomationMode& value) { m_automationModeHasBeenSet = true; m_automationMode = value; }

    /**
     *
The automation mode of the RDS Custom DB instance: full or
     * all-paused. If full, the DB instance automates
     * monitoring and instance recovery. If all-paused, the instance
     * pauses automation for the duration set by
     * --resume-full-automation-mode-minutes.

     */
    inline void SetAutomationMode(AutomationMode&& value) { m_automationModeHasBeenSet = true; m_automationMode = std::move(value); }

    /**
     *
The automation mode of the RDS Custom DB instance: full or
     * all-paused. If full, the DB instance automates
     * monitoring and instance recovery. If all-paused, the instance
     * pauses automation for the duration set by
     * --resume-full-automation-mode-minutes.

     */
    inline PendingModifiedValues& WithAutomationMode(const AutomationMode& value) { SetAutomationMode(value); return *this;}

    /**
     *
The automation mode of the RDS Custom DB instance: full or
     * all-paused. If full, the DB instance automates
     * monitoring and instance recovery. If all-paused, the instance
     * pauses automation for the duration set by
     * --resume-full-automation-mode-minutes.

     */
    inline PendingModifiedValues& WithAutomationMode(AutomationMode&& value) { SetAutomationMode(std::move(value)); return *this;}

    /**
     *
The number of minutes to pause the automation. When the time period ends, RDS
     * Custom resumes full automation. The minimum value is 60 (default). The maximum
     * value is 1,440.

     */
    inline const Aws::Utils::DateTime& GetResumeFullAutomationModeTime() const{ return m_resumeFullAutomationModeTime; }

    /**
     *
The number of minutes to pause the automation. When the time period ends, RDS
     * Custom resumes full automation. The minimum value is 60 (default). The maximum
     * value is 1,440.

     */
    inline bool ResumeFullAutomationModeTimeHasBeenSet() const { return m_resumeFullAutomationModeTimeHasBeenSet; }

    /**
     *
The number of minutes to pause the automation. When the time period ends, RDS
     * Custom resumes full automation. The minimum value is 60 (default). The maximum
     * value is 1,440.

     */
    inline void SetResumeFullAutomationModeTime(const Aws::Utils::DateTime& value) { m_resumeFullAutomationModeTimeHasBeenSet = true; m_resumeFullAutomationModeTime = value; }

    /**
     *
The number of minutes to pause the automation. When the time period ends, RDS
     * Custom resumes full automation. The minimum value is 60 (default). The maximum
     * value is 1,440.

     */
    inline void SetResumeFullAutomationModeTime(Aws::Utils::DateTime&& value) { m_resumeFullAutomationModeTimeHasBeenSet = true; m_resumeFullAutomationModeTime = std::move(value); }

    /**
     *
The number of minutes to pause the automation. When the time period ends, RDS
     * Custom resumes full automation. The minimum value is 60 (default). The maximum
     * value is 1,440.

     */
    inline PendingModifiedValues& WithResumeFullAutomationModeTime(const Aws::Utils::DateTime& value) { SetResumeFullAutomationModeTime(value); return *this;}

    /**
     *
The number of minutes to pause the automation. When the time period ends, RDS
     * Custom resumes full automation. The minimum value is 60 (default). The maximum
     * value is 1,440.

     */
    inline PendingModifiedValues& WithResumeFullAutomationModeTime(Aws::Utils::DateTime&& value) { SetResumeFullAutomationModeTime(std::move(value)); return *this;}

    /**
     *
The storage throughput of the DB instance.

     */
    inline int GetStorageThroughput() const{ return m_storageThroughput; }

    /**
     *
The storage throughput of the DB instance.

     */
    inline bool StorageThroughputHasBeenSet() const { return m_storageThroughputHasBeenSet; }

    /**
     *
The storage throughput of the DB instance.

     */
    inline void SetStorageThroughput(int value) { m_storageThroughputHasBeenSet = true; m_storageThroughput = value; }

    /**
     *
The storage throughput of the DB instance.

     */
    inline PendingModifiedValues& WithStorageThroughput(int value) { SetStorageThroughput(value); return *this;}

  private:

    Aws::String m_dBInstanceClass;
    bool m_dBInstanceClassHasBeenSet = false;

    int m_allocatedStorage;
    bool m_allocatedStorageHasBeenSet = false;

    Aws::String m_masterUserPassword;
    bool m_masterUserPasswordHasBeenSet = false;

    int m_port;
    bool m_portHasBeenSet = false;

    int m_backupRetentionPeriod;
    bool m_backupRetentionPeriodHasBeenSet = false;

    bool m_multiAZ;
    bool m_multiAZHasBeenSet = false;

    Aws::String m_engineVersion;
    bool m_engineVersionHasBeenSet = false;

    Aws::String m_licenseModel;
    bool m_licenseModelHasBeenSet = false;

    int m_iops;
    bool m_iopsHasBeenSet = false;

    Aws::String m_dBInstanceIdentifier;
    bool m_dBInstanceIdentifierHasBeenSet = false;

    Aws::String m_storageType;
    bool m_storageTypeHasBeenSet = false;

    Aws::String m_cACertificateIdentifier;
    bool m_cACertificateIdentifierHasBeenSet = false;

    Aws::String m_dBSubnetGroupName;
    bool m_dBSubnetGroupNameHasBeenSet = false;

    PendingCloudwatchLogsExports m_pendingCloudwatchLogsExports;
    bool m_pendingCloudwatchLogsExportsHasBeenSet = false;

    Aws::Vector<ProcessorFeature> m_processorFeatures;
    bool m_processorFeaturesHasBeenSet = false;

    bool m_iAMDatabaseAuthenticationEnabled;
    bool m_iAMDatabaseAuthenticationEnabledHasBeenSet = false;

    AutomationMode m_automationMode;
    bool m_automationModeHasBeenSet = false;

    Aws::Utils::DateTime m_resumeFullAutomationModeTime;
    bool m_resumeFullAutomationModeTimeHasBeenSet = false;

    int m_storageThroughput;
    bool m_storageThroughputHasBeenSet = false;
  };

} // namespace Model
} // namespace RDS
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
package org.apache.flink.spargel.java;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.Validate;
import org.apache.flink.api.common.aggregators.Aggregator;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.operators.DeltaIteration;
import org.apache.flink.api.common.functions.RichCoGroupFunction;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.operators.CoGroupOperator;
import org.apache.flink.api.java.operators.CustomUnaryOperation;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.typeutils.ResultTypeQueryable;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.Collector;

/**
 * This class represents iterative graph computations, programmed in a vertex-centric perspective.
 * It is a special case of Bulk Synchronous Parallel computation. The paradigm has also been
 * implemented by Google's Pregel system and by Apache Giraph.
 *

 * Vertex centric algorithms operate on graphs, which are defined through vertices and edges. The
 * algorithms send messages along the edges and update the state of vertices based on
 * the old state and the incoming messages. All vertices have an initial state.
 * The computation terminates once no vertex updates it state any more.
 * Additionally, a maximum number of iterations (supersteps) may be specified.
 *

 * The computation is here represented by two functions:
 *

 *
The {@link VertexUpdateFunction} receives incoming messages and may updates the state for
 *   the vertex. If a state is updated, messages are sent from this vertex. Initially, all vertices are
 *   considered updated.

 *
The {@link MessagingFunction} takes the new vertex state and sends messages along the outgoing
 *   edges of the vertex. The outgoing edges may optionally have an associated value, such as a weight.

 *

 *

 * Vertex-centric graph iterations are instantiated by the
 * {@link #withPlainEdges(DataSet, VertexUpdateFunction, MessagingFunction, int)} method, or the
 * {@link #withValuedEdges(DataSet, VertexUpdateFunction, MessagingFunction, int)} method, depending on whether
 * the graph's edges are carrying values.
 *
 * @param <VertexKey> The type of the vertex key (the vertex identifier).
 * @param <VertexValue> The type of the vertex value (the state of the vertex).
 * @param <Message> The type of the message sent between vertices along the edges.
 * @param <EdgeValue> The type of the values that are associated with the edges.
 */
public class VertexCentricIteration<VertexKey extends Comparable<VertexKey>, VertexValue, Message, EdgeValue>
	implements CustomUnaryOperation<Tuple2<VertexKey, VertexValue>, Tuple2<VertexKey, VertexValue>>
{
	private final VertexUpdateFunction<VertexKey, VertexValue, Message> updateFunction;

	private final MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> messagingFunction;

	private final DataSet<Tuple2<VertexKey, VertexKey>> edgesWithoutValue;

	private final DataSet<Tuple3<VertexKey, VertexKey, EdgeValue>> edgesWithValue;

	private final Map<String, Aggregator<?>> aggregators;

	private final int maximumNumberOfIterations;

	private final List<Tuple2<String, DataSet<?>>> bcVarsUpdate = new ArrayList<Tuple2<String,DataSet<?>>>(4);

	private final List<Tuple2<String, DataSet<?>>> bcVarsMessaging = new ArrayList<Tuple2<String,DataSet<?>>>(4);

	private final TypeInformation<Message> messageType;

	private DataSet<Tuple2<VertexKey, VertexValue>> initialVertices;

	private String name;

	private int parallelism = -1;

	private boolean unmanagedSolutionSet;

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

	private  VertexCentricIteration(VertexUpdateFunction<VertexKey, VertexValue, Message> uf,
			MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> mf,
			DataSet<Tuple2<VertexKey, VertexKey>> edgesWithoutValue,
			int maximumNumberOfIterations)
	{
		Validate.notNull(uf);
		Validate.notNull(mf);
		Validate.notNull(edgesWithoutValue);
		Validate.isTrue(maximumNumberOfIterations > 0, "The maximum number of iterations must be at least one.");

		// check that the edges are actually a valid tuple set of vertex key types
		TypeInformation<Tuple2<VertexKey, VertexKey>> edgesType = edgesWithoutValue.getType();
		Validate.isTrue(edgesType.isTupleType() && edgesType.getArity() == 2, "The edges data set (for edges without edge values) must consist of 2-tuples.");

		TupleTypeInfo<?> tupleInfo = (TupleTypeInfo<?>) edgesType;
		Validate.isTrue(tupleInfo.getTypeAt(0).equals(tupleInfo.getTypeAt(1))
			&& Comparable.class.isAssignableFrom(tupleInfo.getTypeAt(0).getTypeClass()),
			"Both tuple fields (source and target vertex id) must be of the data type that represents the vertex key and implement the java.lang.Comparable interface.");

		this.updateFunction = uf;
		this.messagingFunction = mf;
		this.edgesWithoutValue = edgesWithoutValue;
		this.edgesWithValue = null;
		this.maximumNumberOfIterations = maximumNumberOfIterations;
		this.aggregators = new HashMap<String, Aggregator<?>>();

		this.messageType = getMessageType(mf);
	}

	private VertexCentricIteration(VertexUpdateFunction<VertexKey, VertexValue, Message> uf,
			MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> mf,
			DataSet<Tuple3<VertexKey, VertexKey, EdgeValue>> edgesWithValue,
			int maximumNumberOfIterations,
			boolean edgeHasValueMarker)
	{
		Validate.notNull(uf);
		Validate.notNull(mf);
		Validate.notNull(edgesWithValue);
		Validate.isTrue(maximumNumberOfIterations > 0, "The maximum number of iterations must be at least one.");

		// check that the edges are actually a valid tuple set of vertex key types
		TypeInformation<Tuple3<VertexKey, VertexKey, EdgeValue>> edgesType = edgesWithValue.getType();
		Validate.isTrue(edgesType.isTupleType() && edgesType.getArity() == 3, "The edges data set (for edges with edge values) must consist of 3-tuples.");

		TupleTypeInfo<?> tupleInfo = (TupleTypeInfo<?>) edgesType;
		Validate.isTrue(tupleInfo.getTypeAt(0).equals(tupleInfo.getTypeAt(1))
			&& Comparable.class.isAssignableFrom(tupleInfo.getTypeAt(0).getTypeClass()),
			"The first two tuple fields (source and target vertex id) must be of the data type that represents the vertex key and implement the java.lang.Comparable interface.");

		Validate.isTrue(maximumNumberOfIterations > 0, "The maximum number of iterations must be at least one.");

		this.updateFunction = uf;
		this.messagingFunction = mf;
		this.edgesWithoutValue = null;
		this.edgesWithValue = edgesWithValue;
		this.maximumNumberOfIterations = maximumNumberOfIterations;
		this.aggregators = new HashMap<String, Aggregator<?>>();

		this.messageType = getMessageType(mf);
	}

	private TypeInformation<Message> getMessageType(MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> mf) {
		return TypeExtractor.createTypeInfo(MessagingFunction.class, mf.getClass(), 2, null, null);
	}

	/**
	 * Registers a new aggregator. Aggregators registered here are available during the execution of the vertex updates
	 * via {@link VertexUpdateFunction#getIterationAggregator(String)} and
	 * {@link VertexUpdateFunction#getPreviousIterationAggregate(String)}.
	 *
	 * @param name The name of the aggregator, used to retrieve it and its aggregates during execution.
	 * @param aggregator The aggregator.
	 */
	public void registerAggregator(String name, Aggregator<?> aggregator) {
		this.aggregators.put(name, aggregator);
	}

	/**
	 * Adds a data set as a broadcast set to the messaging function.
	 *
	 * @param name The name under which the broadcast data is available in the messaging function.
	 * @param data The data set to be broadcasted.
	 */
	public void addBroadcastSetForMessagingFunction(String name, DataSet<?> data) {
		this.bcVarsMessaging.add(new Tuple2<String, DataSet<?>>(name, data));
	}

	/**
	 * Adds a data set as a broadcast set to the vertex update function.
	 *
	 * @param name The name under which the broadcast data is available in the vertex update function.
	 * @param data The data set to be broadcasted.
	 */
	public void addBroadcastSetForUpdateFunction(String name, DataSet<?> data) {
		this.bcVarsUpdate.add(new Tuple2<String, DataSet<?>>(name, data));
	}

	/**
	 * Sets the name for the vertex-centric iteration. The name is displayed in logs and messages.
	 *
	 * @param name The name for the iteration.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets the name from this vertex-centric iteration.
	 *
	 * @return The name of the iteration.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the degree of parallelism for the iteration.
	 *
	 * @param parallelism The degree of parallelism.
	 */
	public void setParallelism(int parallelism) {
		Validate.isTrue(parallelism > 0 || parallelism == -1, "The degree of parallelism must be positive, or -1 (use default).");
		this.parallelism = parallelism;
	}

	/**
	 * Gets the iteration's degree of parallelism.
	 *
	 * @return The iterations parallelism, or -1, if not set.
	 */
	public int getParallelism() {
		return parallelism;
	}

	/**
	 * Defines whether the solution set is kept in managed memory (Flink's internal way of keeping object
	 * in serialized form) or as a simple object map.
	 * By default, the solution set runs in managed memory.
	 *
	 * @param unmanaged True, to keep the solution set in unmanaged memory, false otherwise.
	 */
	public void setSolutionSetUnmanagedMemory(boolean unmanaged) {
		this.unmanagedSolutionSet = unmanaged;
	}

	/**
	 * Gets whether the solution set is kept in managed memory (Flink's internal way of keeping object
	 * in serialized form) or as a simple object map.
	 * By default, the solution set runs in managed memory.
	 *
	 * @return True, if the solution set is in unmanaged memory, false otherwise.
	 */
	public boolean isSolutionSetUnmanagedMemory() {
		return this.unmanagedSolutionSet;
	}

	// --------------------------------------------------------------------------------------------
	//  Custom Operator behavior
	// --------------------------------------------------------------------------------------------

	/**
	 * Sets the input data set for this operator. In the case of this operator this input data set represents
	 * the set of vertices with their initial state.
	 *
	 * @param inputData The input data set, which in the case of this operator represents the set of
	 *                  vertices with their initial state.
	 *
	 * @see org.apache.flink.api.java.operators.CustomUnaryOperation#setInput(org.apache.flink.api.java.DataSet)
	 */
	@Override
	public void setInput(DataSet<Tuple2<VertexKey, VertexValue>> inputData) {
		// sanity check that we really have two tuples
		TypeInformation<Tuple2<VertexKey, VertexValue>> inputType = inputData.getType();
		Validate.isTrue(inputType.isTupleType() && inputType.getArity() == 2, "The input data set (the initial vertices) must consist of 2-tuples.");

		// check that the key type here is the same as for the edges
		TypeInformation<VertexKey> keyType = ((TupleTypeInfo<?>) inputType).getTypeAt(0);
		TypeInformation<?> edgeType = edgesWithoutValue != null ? edgesWithoutValue.getType() : edgesWithValue.getType();
		TypeInformation<VertexKey> edgeKeyType = ((TupleTypeInfo<?>) edgeType).getTypeAt(0);

		Validate.isTrue(keyType.equals(edgeKeyType), "The first tuple field (the vertex id) of the input data set (the initial vertices) " +
				"must be the same data type as the first fields of the edge data set (the source vertex id). " +
				"Here, the key type for the vertex ids is '%s' and the key type  for the edges is '%s'.", keyType, edgeKeyType);

		this.initialVertices = inputData;
	}

	/**
	 * Creates the operator that represents this vertex-centric graph computation.
	 *
	 * @return The operator that represents this vertex-centric graph computation.
	 */
	@Override
	public DataSet<Tuple2<VertexKey, VertexValue>> createResult() {
		if (this.initialVertices == null) {
			throw new IllegalStateException("The input data set has not been set.");
		}

		// prepare some type information
		TypeInformation<Tuple2<VertexKey, VertexValue>> vertexTypes = initialVertices.getType();
		TypeInformation<VertexKey> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
		TypeInformation<Tuple2<VertexKey, Message>> messageTypeInfo = new TupleTypeInfo<Tuple2<VertexKey,Message>>(keyType, messageType);

		// set up the iteration operator
		final String name = (this.name != null) ? this.name :
			"Vertex-centric iteration (" + updateFunction + " | " + messagingFunction + ")";
		final int[] zeroKeyPos = new int[] {0};

		final DeltaIteration<Tuple2<VertexKey, VertexValue>, Tuple2<VertexKey, VertexValue>> iteration =
			this.initialVertices.iterateDelta(this.initialVertices, this.maximumNumberOfIterations, zeroKeyPos);
		iteration.name(name);
		iteration.parallelism(parallelism);
		iteration.setSolutionSetUnManaged(unmanagedSolutionSet);

		// register all aggregators
		for (Map.Entry<String, Aggregator<?>> entry : this.aggregators.entrySet()) {
			iteration.registerAggregator(entry.getKey(), entry.getValue());
		}

		// build the messaging function (co group)
		CoGroupOperator<?, ?, Tuple2<VertexKey, Message>> messages;
		if (edgesWithoutValue != null) {
			MessagingUdfNoEdgeValues<VertexKey, VertexValue, Message> messenger = new MessagingUdfNoEdgeValues<VertexKey, VertexValue, Message>(messagingFunction, messageTypeInfo);
			messages = this.edgesWithoutValue.coGroup(iteration.getWorkset()).where(0).equalTo(0).with(messenger);
		}
		else {
			MessagingUdfWithEdgeValues<VertexKey, VertexValue, Message, EdgeValue> messenger = new MessagingUdfWithEdgeValues<VertexKey, VertexValue, Message, EdgeValue>(messagingFunction, messageTypeInfo);
			messages = this.edgesWithValue.coGroup(iteration.getWorkset()).where(0).equalTo(0).with(messenger);
		}

		// configure coGroup message function with name and broadcast variables
		messages = messages.name("Messaging");
		for (Tuple2<String, DataSet<?>> e : this.bcVarsMessaging) {
			messages = messages.withBroadcastSet(e.f1, e.f0);
		}

		VertexUpdateUdf<VertexKey, VertexValue, Message> updateUdf = new VertexUpdateUdf<VertexKey, VertexValue, Message>(updateFunction, vertexTypes);

		// build the update function (co group)
		CoGroupOperator<?, ?, Tuple2<VertexKey, VertexValue>> updates =
				messages.coGroup(iteration.getSolutionSet()).where(0).equalTo(0).with(updateUdf);

		// configure coGroup update function with name and broadcast variables
		updates = updates.name("Vertex State Updates");
		for (Tuple2<String, DataSet<?>> e : this.bcVarsUpdate) {
			updates = updates.withBroadcastSet(e.f1, e.f0);
		}

		// let the operator know that we preserve the key field
		updates.withConstantSetFirst("0").withConstantSetSecond("0");

		return iteration.closeWith(updates, updates);

	}

	// --------------------------------------------------------------------------------------------
	// Constructor builders to avoid signature conflicts with generic type erasure
	// --------------------------------------------------------------------------------------------

	/**
	 * Creates a new vertex-centric iteration operator for graphs where the edges are not associated with a value.
	 *
	 * @param edgesWithoutValue The data set containing edges. Edges are represented as 2-tuples: (source-id, target-id)
	 * @param vertexUpdateFunction The function that updates the state of the vertices from the incoming messages.
	 * @param messagingFunction The function that turns changed vertex states into messages along the edges.
	 *
	 * @param <VertexKey> The type of the vertex key (the vertex identifier).
	 * @param <VertexValue> The type of the vertex value (the state of the vertex).
	 * @param <Message> The type of the message sent between vertices along the edges.
	 *
	 * @return An in stance of the vertex-centric graph computation operator.
	 */
	public static final <VertexKey extends Comparable<VertexKey>, VertexValue, Message>
			VertexCentricIteration<VertexKey, VertexValue, Message, ?> withPlainEdges(
					DataSet<Tuple2<VertexKey, VertexKey>> edgesWithoutValue,
						VertexUpdateFunction<VertexKey, VertexValue, Message> vertexUpdateFunction,
						MessagingFunction<VertexKey, VertexValue, Message, ?> messagingFunction,
						int maximumNumberOfIterations)
	{
		@SuppressWarnings("unchecked")
		MessagingFunction<VertexKey, VertexValue, Message, Object> tmf =
								(MessagingFunction<VertexKey, VertexValue, Message, Object>) messagingFunction;

		return new VertexCentricIteration<VertexKey, VertexValue, Message, Object>(vertexUpdateFunction, tmf, edgesWithoutValue, maximumNumberOfIterations);
	}

	/**
	 * Creates a new vertex-centric iteration operator for graphs where the edges are associated with a value (such as
	 * a weight or distance).
	 *
	 * @param edgesWithValue The data set containing edges. Edges are represented as 2-tuples: (source-id, target-id)
	 * @param uf The function that updates the state of the vertices from the incoming messages.
	 * @param mf The function that turns changed vertex states into messages along the edges.
	 *
	 * @param <VertexKey> The type of the vertex key (the vertex identifier).
	 * @param <VertexValue> The type of the vertex value (the state of the vertex).
	 * @param <Message> The type of the message sent between vertices along the edges.
	 * @param <EdgeValue> The type of the values that are associated with the edges.
	 *
	 * @return An in stance of the vertex-centric graph computation operator.
	 */
	public static final <VertexKey extends Comparable<VertexKey>, VertexValue, Message, EdgeValue>
			VertexCentricIteration<VertexKey, VertexValue, Message, EdgeValue> withValuedEdges(
					DataSet<Tuple3<VertexKey, VertexKey, EdgeValue>> edgesWithValue,
					VertexUpdateFunction<VertexKey, VertexValue, Message> uf,
					MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> mf,
					int maximumNumberOfIterations)
	{
		return new VertexCentricIteration<VertexKey, VertexValue, Message, EdgeValue>(uf, mf, edgesWithValue, maximumNumberOfIterations, true);
	}

	// --------------------------------------------------------------------------------------------
	//  Wrapping UDFs
	// --------------------------------------------------------------------------------------------

	private static final class VertexUpdateUdf<VertexKey extends Comparable<VertexKey>, VertexValue, Message>
		extends RichCoGroupFunction<Tuple2<VertexKey, Message>, Tuple2<VertexKey, VertexValue>, Tuple2<VertexKey, VertexValue>>
		implements ResultTypeQueryable<Tuple2<VertexKey, VertexValue>>
	{
		private static final long serialVersionUID = 1L;

		private final VertexUpdateFunction<VertexKey, VertexValue, Message> vertexUpdateFunction;

		private final MessageIterator<Message> messageIter = new MessageIterator<Message>();

		private transient TypeInformation<Tuple2<VertexKey, VertexValue>> resultType;

		private VertexUpdateUdf(VertexUpdateFunction<VertexKey, VertexValue, Message> vertexUpdateFunction,
				TypeInformation<Tuple2<VertexKey, VertexValue>> resultType)
		{
			this.vertexUpdateFunction = vertexUpdateFunction;
			this.resultType = resultType;
		}

		@Override
		public void coGroup(Iterable<Tuple2<VertexKey, Message>> messages, Iterable<Tuple2<VertexKey, VertexValue>> vertex,
				Collector<Tuple2<VertexKey, VertexValue>> out)
			throws Exception
		{
			final Iterator<Tuple2<VertexKey, VertexValue>> vertexIter = vertex.iterator();

			if (vertexIter.hasNext()) {
				Tuple2<VertexKey, VertexValue> vertexState = vertexIter.next();

				@SuppressWarnings("unchecked")
				Iterator<Tuple2<?, Message>> downcastIter = (Iterator<Tuple2<?, Message>>) (Iterator<?>) messages.iterator();
				messageIter.setSource(downcastIter);

				vertexUpdateFunction.setOutput(vertexState, out);
				vertexUpdateFunction.updateVertex(vertexState.f0, vertexState.f1, messageIter);
			}
			else {
				final Iterator<Tuple2<VertexKey, Message>> messageIter = messages.iterator();
				if (messageIter.hasNext()) {
					String message = "Target vertex does not exist!.";
					try {
						Tuple2<VertexKey, Message> next = messageIter.next();
						message = "Target vertex '" + next.f0 + "' does not exist!.";
					} catch (Throwable t) {}
					throw new Exception(message);
				} else {
					throw new Exception();
				}
			}
		}

		@Override
		public void open(Configuration parameters) throws Exception {
			if (getIterationRuntimeContext().getSuperstepNumber() == 1) {
				this.vertexUpdateFunction.init(getIterationRuntimeContext());
			}
			this.vertexUpdateFunction.preSuperstep();
		}

		@Override
		public void close() throws Exception {
			this.vertexUpdateFunction.postSuperstep();
		}

		@Override
		public TypeInformation<Tuple2<VertexKey, VertexValue>> getProducedType() {
			return this.resultType;
		}
	}

	/*
	 * UDF that encapsulates the message sending function for graphs where the edges have no associated values.
	 */
	private static final class MessagingUdfNoEdgeValues<VertexKey extends Comparable<VertexKey>, VertexValue, Message>
		extends RichCoGroupFunction<Tuple2<VertexKey, VertexKey>, Tuple2<VertexKey, VertexValue>, Tuple2<VertexKey, Message>>
		implements ResultTypeQueryable<Tuple2<VertexKey, Message>>
	{
		private static final long serialVersionUID = 1L;

		private final MessagingFunction<VertexKey, VertexValue, Message, ?> messagingFunction;

		private transient TypeInformation<Tuple2<VertexKey, Message>> resultType;

		private MessagingUdfNoEdgeValues(MessagingFunction<VertexKey, VertexValue, Message, ?> messagingFunction,
				TypeInformation<Tuple2<VertexKey, Message>> resultType)
		{
			this.messagingFunction = messagingFunction;
			this.resultType = resultType;
		}

		@Override
		public void coGroup(Iterable<Tuple2<VertexKey, VertexKey>> edges,
				Iterable<Tuple2<VertexKey, VertexValue>> state, Collector<Tuple2<VertexKey, Message>> out)
			throws Exception
		{
			final Iterator<Tuple2<VertexKey, VertexValue>> stateIter = state.iterator();

			if (stateIter.hasNext()) {
				Tuple2<VertexKey, VertexValue> newVertexState = stateIter.next();
				messagingFunction.set((Iterator<?>) edges.iterator(), out);
				messagingFunction.sendMessages(newVertexState.f0, newVertexState.f1);
			}
		}

		@Override
		public void open(Configuration parameters) throws Exception {
			if (getIterationRuntimeContext().getSuperstepNumber() == 1) {
				this.messagingFunction.init(getIterationRuntimeContext(), false);
			}

			this.messagingFunction.preSuperstep();
		}

		@Override
		public void close() throws Exception {
			this.messagingFunction.postSuperstep();
		}

		@Override
		public TypeInformation<Tuple2<VertexKey, Message>> getProducedType() {
			return this.resultType;
		}
	}

	/*
	 * UDF that encapsulates the message sending function for graphs where the edges have an associated value.
	 */
	private static final class MessagingUdfWithEdgeValues<VertexKey extends Comparable<VertexKey>, VertexValue, Message, EdgeValue>
		extends RichCoGroupFunction<Tuple3<VertexKey, VertexKey, EdgeValue>, Tuple2<VertexKey, VertexValue>, Tuple2<VertexKey, Message>>
		implements ResultTypeQueryable<Tuple2<VertexKey, Message>>
	{
		private static final long serialVersionUID = 1L;

		private final MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> messagingFunction;

		private transient TypeInformation<Tuple2<VertexKey, Message>> resultType;

		private MessagingUdfWithEdgeValues(MessagingFunction<VertexKey, VertexValue, Message, EdgeValue> messagingFunction,
				TypeInformation<Tuple2<VertexKey, Message>> resultType)
		{
			this.messagingFunction = messagingFunction;
			this.resultType = resultType;
		}

		@Override
		public void coGroup(Iterable<Tuple3<VertexKey, VertexKey, EdgeValue>> edges,
				Iterable<Tuple2<VertexKey, VertexValue>> state, Collector<Tuple2<VertexKey, Message>> out)
			throws Exception
		{
			final Iterator<Tuple2<VertexKey, VertexValue>> stateIter = state.iterator();

			if (stateIter.hasNext()) {
				Tuple2<VertexKey, VertexValue> newVertexState = stateIter.next();
				messagingFunction.set((Iterator<?>) edges.iterator(), out);
				messagingFunction.sendMessages(newVertexState.f0, newVertexState.f1);
			}
		}

		@Override
		public void open(Configuration parameters) throws Exception {
			if (getIterationRuntimeContext().getSuperstepNumber() == 1) {
				this.messagingFunction.init(getIterationRuntimeContext(), true);
			}

			this.messagingFunction.preSuperstep();
		}

		@Override
		public void close() throws Exception {
			this.messagingFunction.postSuperstep();
		}

		@Override
		public TypeInformation<Tuple2<VertexKey, Message>> getProducedType() {
			return this.resultType;
		}
	}
}


text:
package funcatron.helpers;

import clojure.java.api.Clojure;

import java.util.List;

/**
 * A 3 element tuple
 */
public class Tuple3<A, B, C> extends Tuple2<A,B> {

    private final C c;

    public Tuple3(A a, B b,C c) {
        super(a,b);
        this.c = c;
    }

    public C _3() {return c;}
    public C c() {return c;}

    /**
     * Convert the Tuple into a List
     * @return a List containing the elements of the Tuple
     */
    @Override
    public List toList() {
        return (List) Clojure.var("clojure/core", "list").invoke(_1(), _2(), c);
    }
}


text:
title: Lesson Blog 5 (Getting bigger and more complex tasks)
layout: post
author: oscar.ryley
permalink: /lesson-blog-5-(getting-bigger-and-more-complex-tasks)/
source-id: 1SlJnBndrVSqaB36r6iWdaR7VwNUSr0YW2-B6CWy_-BM
published: true
---

    Title
    Lesson Blog 5
    Date
    14/06/18

    Starting point:
    I was on 5.

    Target for this lesson?
    To get a lot of a way through the tasks that I am on.

    Did I reach my target?
(add details to "Lesson Review")
     Yes, I did.

    Lesson Review

    How did I learn? What strategies were effective?

    I learnt how to use a lot of syntax which I have previously learned across the weeks in one group as the coding tasks have begun to make me write out huge blocks of very complex code and bringing together in one lesson to make my own full set of code that does what I want and completes its own complex tasks. The strategy of reading literally everything that is given to me in way of hints and examples usually gives me enough of the clues which I need to piece together some good code that will achieve the task given to me during the briefing.

    What limited my learning? Which habits do I need to work on?

    The amount of syntax which I have to remember in order to complete even one task at this point of 'chapter six' is incredible, but often slows down my work and work speed as I have to make the odd check back down my work or google search on my home computer in order to find out how to complete the order that I have been instructed to do. I need to work on the habit of my memory and improving and expanding my knowledge of the syntax necessary to go further in this project and complete the course.

    What will I change for next time? How will I improve my learning?

    Next time I will try to remember more of the syntax which I have already gone over so that I can easily create large paragraphs of code using this import and basic syntax to help structure my good code. I will improve my learning by doing more codecademy and continuously looking over the older tasks where the python course went over the most important or ones that I have forgotten syntax so that I can remember who to use the specific code that is relevant to me.


text:
angular.module("nh")
	.config(($routeProvider) => {
		$routeProvider
			.when("/houseDetail/:houseId", {
				controller: "HouseDetailControl",
				controllerAs: "houseCtrl",
				templateUrl: "app/houseDetail/houseDetail.html",
				// resolve: { requiresAuth, getLoggedInUser }
			})
	})


text:
import React from "react";
import { mount } from "enzyme";

import MediaWrapper from "../../src/components/MediaWrapper";

describe("MediaWrapper", () => {
  let testContext;

  beforeEach(() => {
    testContext = {};
    testContext.setReadOnly = jest.fn();
    testContext.setInitialReadOnly = jest.fn();

    testContext.wrapper = mount(
      <MediaWrapper
        setReadOnly={testContext.setReadOnly}
        setInitialReadOnly={testContext.setInitialReadOnly}
      >
        <input type="text" />
      </MediaWrapper>
    );

    testContext.input = testContext.wrapper.find("input");
  });

  it("enables readOnly on input focus", () => {
    testContext.input.simulate("focus");
    expect(testContext.setReadOnly).toHaveBeenCalledWith(true);
  });

  it("restores readOnly on input blur", () => {
    testContext.input.simulate("blur");
    expect(testContext.setInitialReadOnly).toHaveBeenCalled();
  });
});


text:
package com.codegame.codeseries.notreal2d.collision;

import com.codeforces.commons.geometry.*;
import com.codegame.codeseries.notreal2d.Body;
import com.codegame.codeseries.notreal2d.form.*;

import javax.annotation.*;

/**
 * @author Maxim Shipko (sladethe@gmail.com)
 * Date: 19.06.2015
 * TODO check epsilon comparison
 */
public class RectangleAndRectangleCollider extends ColliderBase {
    public RectangleAndRectangleCollider(@Nonnegative double epsilon) {
        super(epsilon);
    }

    @Override
    protected boolean matchesOneWay(@Nonnull Body bodyA, @Nonnull Body bodyB) {
        return bodyA.getForm().getShape() == Shape.RECTANGLE && bodyB.getForm().getShape() == Shape.RECTANGLE;
    }

    @Nullable
    @Override
    protected CollisionInfo collideOneWay(@Nonnull Body bodyA, @Nonnull Body bodyB) {
        RectangularForm rectangularFormA = (RectangularForm) bodyA.getForm();
        RectangularForm rectangularFormB = (RectangularForm) bodyB.getForm();

        Point2D[] pointsA = rectangularFormA.getPoints(bodyA.getPosition(), bodyA.getAngle(), epsilon);
        Point2D[] pointsB = rectangularFormB.getPoints(bodyB.getPosition(), bodyB.getAngle(), epsilon);

        CollisionInfo collisionInfoA = collideOneWay(bodyA, bodyB, pointsA, pointsB);
        if (collisionInfoA == null) {
            return null;
        }

        CollisionInfo collisionInfoB = collideOneWay(bodyB, bodyA, pointsB, pointsA);
        if (collisionInfoB == null) {
            return null;
        }

        if (collisionInfoB.getDepth() < collisionInfoA.getDepth()) {
            return new CollisionInfo(
                    bodyA, bodyB, collisionInfoB.getPoint(), collisionInfoB.getNormalB().negate(),
                    collisionInfoB.getDepth(), epsilon
            );
        } else {
            return collisionInfoA;
        }
    }

    @SuppressWarnings("OverlyLongMethod")
    @Nullable
    private CollisionInfo collideOneWay(
            @Nonnull Body bodyA, @Nonnull Body bodyB, @Nonnull Point2D[] pointsA, @Nonnull Point2D[] pointsB) {
        int pointACount = pointsA.length;
        int pointBCount = pointsB.length;

        double minDepth = Double.POSITIVE_INFINITY;
        Point2D bestIntersectionPoint = null;
        Vector2D bestCollisionNormalB = null;

        for (int pointAIndex = 0; pointAIndex < pointACount; ++pointAIndex) {
            Point2D point1A = pointsA[pointAIndex];
            Point2D point2A = pointsA[pointAIndex == pointACount - 1 ? 0 : pointAIndex + 1];

            Line2D lineA = Line2D.getLineByTwoPoints(point1A, point2A);

            if (lineA.getSignedDistanceFrom(bodyA.getPosition()) > -epsilon) {
                throw new IllegalStateException(String.format("%s of %s is too small, " +
                                "does not represent a convex polygon, or its points are going in wrong order.",
                        Form.toString(bodyA.getForm()), bodyA
                ));
            }

            double minDistanceFromB = Double.POSITIVE_INFINITY;
            Point2D intersectionPoint = null;
            Vector2D collisionNormalB = null;

            for (int pointBIndex = 0; pointBIndex < pointBCount; ++pointBIndex) {
                Point2D pointB = pointsB[pointBIndex];
                double distanceFromPointB = lineA.getSignedDistanceFrom(pointB);

                if (distanceFromPointB < minDistanceFromB) {
                    minDistanceFromB = distanceFromPointB;
                    intersectionPoint = pointB;
                    collisionNormalB = lineA.getUnitNormalFrom(bodyA.getPosition(), epsilon).negate();
                }
            }

            if (minDistanceFromB > 0.0D) {
                return null;
            }

            double depth = -minDistanceFromB;
            if (depth < minDepth) {
                minDepth = depth;
                bestIntersectionPoint = intersectionPoint;
                bestCollisionNormalB = collisionNormalB;
            }
        }

        if (bestIntersectionPoint == null) {
            return null;
        }

        return new CollisionInfo(bodyA, bodyB, bestIntersectionPoint, bestCollisionNormalB, minDepth, epsilon);
    }
}


text:
/**
 * Creates a function that produces singleton instances based
 * on `instanceDefinition`
 *
 * @param {object} instanceDefinition  Instance definitions. Is used to instantiate
 * singleton classes. Has the following structure
 * {key: ConstructorFn} `key` is used to access singleton instances,
 * `ConstructorFn` is constructor function used to instantiate objects
 * @returns {Function} singleton factory method
 */
const createSingletonFactory = instanceDefinition => {
  const instanceMap = {}
  /**
   * Singleton factory
   *
   * @param {string} key one of keys used in  `instanceDefinition` as `key`
   * @returns {object|null} class instance
   */
  return key => {
    if (instanceMap[key]) {
      return instanceMap[key]
    }

    const ConstructorFn = instanceDefinition[key]
    if (ConstructorFn) {
      instanceMap[key] = new ConstructorFn()
      return instanceMap[key]
    }

    return null
  }
}

export default createSingletonFactory


text:
//-----------------------------------------------------------------------
// <copyright file="ProjectExtensions.cs" company="Copacetic Software">
// Copyright (c) Copacetic Software.
// <author>Philip Pittle</author>
// <date>Wednesday, April 30, 2014 11:07:08 PM</date>
// Licensed under the Apache License, Version 2.0,
// you may not use this file except in compliance with this License.
//
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
//-----------------------------------------------------------------------

using Microsoft.Build.Evaluation;

namespace CopaceticSoftware.CodeGenerator.StarterKit.Extensions
{
    public static class ProjectExtensions
    {
        public static bool? GetBoolProperty(this Project p, string propertyName)
        {
            string val = p.GetPropertyValue(propertyName);
            bool result;
            if (bool.TryParse(val, out result))
                return result;

            return null;
        }
    }
}


text:
//
// Copyright (c) 2015 CNRS
// Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.

#ifndef __se3_joint_free_flyer_hpp__
#define __se3_joint_free_flyer_hpp__

#include "pinocchio/spatial/inertia.hpp"
#include "pinocchio/multibody/joint/joint-base.hpp"
#include "pinocchio/multibody/constraint.hpp"

namespace se3
{

  struct JointDataFreeFlyer;
  struct JointModelFreeFlyer;

  struct ConstraintIdentity;

  template <>
  struct traits< ConstraintIdentity >
  {
    typedef double Scalar_t;
    typedef Eigen::Matrix<double,3,1,0> Vector3;
    typedef Eigen::Matrix<double,4,1,0> Vector4;
    typedef Eigen::Matrix<double,6,1,0> Vector6;
    typedef Eigen::Matrix<double,3,3,0> Matrix3;
    typedef Eigen::Matrix<double,4,4,0> Matrix4;
    typedef Eigen::Matrix<double,6,6,0> Matrix6;
    typedef Matrix3 Angular_t;
    typedef Vector3 Linear_t;
    typedef Matrix6 ActionMatrix_t;
    typedef Eigen::Quaternion<double,0> Quaternion_t;
    typedef SE3Tpl<double,0> SE3;
    typedef ForceTpl<double,0> Force;
    typedef MotionTpl<double,0> Motion;
    typedef Symmetric3Tpl<double,0> Symmetric3;
    enum {
      LINEAR = 0,
      ANGULAR = 3
    };
    typedef Eigen::Matrix<Scalar_t,6,1,0> JointMotion;
    typedef Eigen::Matrix<Scalar_t,6,1,0> JointForce;
    typedef Eigen::Matrix<Scalar_t,6,6> DenseBase;
  }; // traits ConstraintRevolute

    struct ConstraintIdentity : ConstraintBase < ConstraintIdentity >
    {
      SPATIAL_TYPEDEF_NO_TEMPLATE(ConstraintIdentity);
      enum { NV = 6, Options = 0 };
      typedef traits<ConstraintIdentity>::JointMotion JointMotion;
      typedef traits<ConstraintIdentity>::JointForce JointForce;
      typedef traits<ConstraintIdentity>::DenseBase DenseBase;

      SE3::Matrix6 se3Action(const SE3 & m) const { return m.toActionMatrix(); }

      int nv_impl() const { return NV; }

      struct TransposeConst
      {
        Force::Vector6 operator* (const Force & phi)
        {  return phi.toVector();  }
      };

      TransposeConst transpose() const { return TransposeConst(); }
      operator ConstraintXd () const { return ConstraintXd(SE3::Matrix6::Identity()); }
    }; // struct ConstraintIdentity

    template<typename D>
    Motion operator* (const ConstraintIdentity&, const Eigen::MatrixBase<D>& v)
    {
      EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(D,6);
      return Motion(v);
    }

  /* [CRBA] ForceSet operator* (Inertia Y,Constraint S) */
  inline Inertia::Matrix6 operator* (const Inertia & Y, const ConstraintIdentity &)
  {
    return Y.matrix();
  }

  /* [ABA] Y*S operator*/
  inline const Inertia::Matrix6 & operator* (const Inertia::Matrix6 & Y, const ConstraintIdentity &)
  {
    return Y;
  }

  inline Inertia::Matrix6 & operator* (Inertia::Matrix6 & Y, const ConstraintIdentity &)
  {
    return Y;
  }

  inline Inertia::Matrix6 operator* (const ConstraintIdentity::TransposeConst &, const Inertia & Y)
  {
    return Y.matrix();
  }

  /* [CRBA]  MatrixBase operator* (Constraint::Transpose S, ForceSet::Block) */
  template<typename D>
  const Eigen::MatrixBase<D> &
  operator*( const ConstraintIdentity::TransposeConst &, const Eigen::MatrixBase<D> & F )
  {
    return F;
  }

  namespace internal
  {
    template<>
    struct ActionReturn<ConstraintIdentity >
    { typedef SE3::Matrix6 Type; };
  }

  struct JointFreeFlyer;

  template<>
  struct traits<JointFreeFlyer>
  {
    enum {
      NQ = 7,
      NV = 6
    };
    typedef JointDataFreeFlyer JointData;
    typedef JointModelFreeFlyer JointModel;
    typedef ConstraintIdentity Constraint_t;
    typedef SE3 Transformation_t;
    typedef Motion Motion_t;
    typedef BiasZero Bias_t;
    typedef Eigen::Matrix<double,6,NV> F_t;

    // [ABA]
    typedef Eigen::Matrix<double,6,NV> U_t;
    typedef Eigen::Matrix<double,NV,NV> D_t;
    typedef Eigen::Matrix<double,6,NV> UD_t;
  };
  template<> struct traits<JointDataFreeFlyer> { typedef JointFreeFlyer Joint; };
  template<> struct traits<JointModelFreeFlyer> { typedef JointFreeFlyer Joint; };

  struct JointDataFreeFlyer : public JointDataBase<JointDataFreeFlyer>
  {
    typedef JointFreeFlyer Joint;
    SE3_JOINT_TYPEDEF;

    typedef Eigen::Matrix<double,6,6> Matrix6;
    typedef Eigen::Quaternion<double> Quaternion;
    typedef Eigen::Matrix<double,3,1> Vector3;

    Constraint_t S;
    Transformation_t M;
    Motion_t v;
    Bias_t c;

    F_t F; // TODO if not used anymore, clean F_t

    // [ABA] specific data
    U_t U;
    D_t Dinv;
    UD_t UDinv;

    JointDataFreeFlyer() : M(1), U(), Dinv(), UDinv(UD_t::Identity()) {}

    JointDataDense<NQ, NV> toDense_impl() const
    {
      return JointDataDense<NQ, NV>(S, M, v, c, F);
    }
  }; // struct JointDataFreeFlyer

  struct JointModelFreeFlyer : public JointModelBase<JointModelFreeFlyer>
  {
    typedef JointFreeFlyer Joint;
    SE3_JOINT_TYPEDEF;

    using JointModelBase<JointModelFreeFlyer>::id;
    using JointModelBase<JointModelFreeFlyer>::idx_q;
    using JointModelBase<JointModelFreeFlyer>::idx_v;
    using JointModelBase<JointModelFreeFlyer>::lowerPosLimit;
    using JointModelBase<JointModelFreeFlyer>::upperPosLimit;
    using JointModelBase<JointModelFreeFlyer>::maxEffortLimit;
    using JointModelBase<JointModelFreeFlyer>::maxVelocityLimit;
    using JointModelBase<JointModelFreeFlyer>::setIndexes;

    JointData createData() const { return JointData(); }
    void calc( JointData& data,
         const Eigen::VectorXd & qs) const
    {
      Eigen::VectorXd::ConstFixedSegmentReturnType<NQ>::Type q = qs.segment<NQ>(idx_q());
      const JointData::Quaternion quat(q.tail<4> ()); // TODO

      data.M.rotation (quat.matrix());
      data.M.translation (q.head<3>());
    }
    void calc( JointData& data,
         const Eigen::VectorXd & qs,
         const Eigen::VectorXd & vs ) const
    {
      Eigen::VectorXd::ConstFixedSegmentReturnType<NQ>::Type q = qs.segment<NQ>(idx_q());
      data.v = vs.segment<NV>(idx_v());

      const JointData::Quaternion quat(q.tail<4> ()); // TODO

      data.M.rotation (quat.matrix());
      data.M.translation (q.head<3>());
    }

    void calc_aba(JointData & data, Inertia::Matrix6 & I, const bool update_I) const
    {
      data.U = I;
      data.Dinv = I.inverse();

      if (update_I)
        I.setZero();
    }

    JointModelDense<NQ, NV> toDense_impl() const
    {
      return JointModelDense<NQ, NV>( id(),
                                      idx_q(),
                                      idx_v(),
                                      lowerPosLimit(),
                                      upperPosLimit(),
                                      maxEffortLimit(),
                                      maxVelocityLimit()
                                    );
    }

    static const std::string shortname()
    {
      return std::string("JointModelFreeFlyer");
    }

    template <class D>
    bool operator == (const JointModelBase<D> &) const
    {
      return false;
    }

    bool operator == (const JointModelBase<JointModelFreeFlyer> & jmodel) const
    {
      return jmodel.id() == id()
              && jmodel.idx_q() == idx_q()
              && jmodel.idx_v() == idx_v()
              && jmodel.lowerPosLimit() == lowerPosLimit()
              && jmodel.upperPosLimit() == upperPosLimit()
              && jmodel.maxEffortLimit() == maxEffortLimit()
              && jmodel.maxVelocityLimit() == maxVelocityLimit();
    }
  }; // struct JointModelFreeFlyer

} // namespace se3

#endif // ifndef __se3_joint_free_flyer_hpp__


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB">

  <title>testutils - The Go Programming Language</title>

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

<link rel="stylesheet" href="../../godoc/jquery.treeview.css">

...

The Go Programming Language

Go

▽
<form method="GET" action="http://localhost:8080/search">

Documents
Packages
The Project
Help
Blog

<input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">

</form>

Package testutils

import "ds3_integration/utils"

Overview

Index

Overview ▹

Overview ▾

Index ▹

Index ▾

Variables

func ConvertBooksToDs3Objects(books map[string]networking.ReaderWithSizeDecorator) ([]models.Ds3PutObject, error)

func ConvertObjectsIntoObjectNameList(objects []models.Contents) []string

func DeleteBucket(client *ds3.Client, bucketName string) error

func DeleteBucketContents(client *ds3.Client, bucketName string)

func DeleteBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error

func DeleteDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) error

func DeleteObject(client *ds3.Client, bucketName string, objectName string) error

func DeleteObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) error

func GetBucket(client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)

func GetBucketLogError(t *testing.T, client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)

func GetDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) (*models.GetDataPolicySpectraS3Response, error)

func GetObject(client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)

func GetObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)

func GetResourceBookAsStream(book string) (*networking.ReaderWithSizeDecorator, error)

func GetResourceBooks() (map[string]networking.ReaderWithSizeDecorator, error)

func GetUserByNameLogError(t *testing.T, client *ds3.Client, userName string) (*models.SpectraUser, error)

func LoadBook(book string) ([]byte, error)

func LoadBookLogError(t *testing.T, book string) ([]byte, error)

func PutBucket(client *ds3.Client, bucketName string) error

func PutBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error

func PutDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyName string) (*models.PutDataPolicySpectraS3Response, error)

func PutObject(client *ds3.Client, bucketName string, objectName string, data []byte) error

func PutObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string, data []byte) error

func PutTestBooks(client *ds3.Client, bucketName string) error

func SetupTestEnv(testBucket string, userName string, envTestNameSpace string) (*ds3.Client, *TestIds, error)

func TeardownTestEnv(client *ds3.Client, ids *TestIds, testBucket string)

func VerifyBookContent(t *testing.T, bookName string, content io.ReadCloser)

type TestIds

Package files

				testUtils.go

Internal call graph ▹

Internal call graph ▾

			  In the call graph viewer below, each node
			  is a function belonging to this package
			  and its children are the functions it
			  calls—perhaps dynamically.

			  The root nodes are the entry points of the
			  package: functions that may be called from
			  outside the package.
			  There may be non-exported or anonymous
			  functions among them if they are called
			  dynamically from another package.

			  Click a node to visit that function's source code.
			  From there you can visit its callers by
			  clicking its declaring func
			  token.

			  Functions may be omitted if they were
			  determined to be unreachable in the
			  particular programs or tests that were
			  analyzed.

Variables

var BookTitles = []string{"beowulf.txt", "sherlock_holmes.txt", "tale_of_two_cities.txt", "ulysses.txt"}

func ConvertBooksToDs3Objects

func ConvertBooksToDs3Objects(books map[string]networking.ReaderWithSizeDecorator) ([]models.Ds3PutObject, error)

func ConvertObjectsIntoObjectNameList

func ConvertObjectsIntoObjectNameList(objects []models.Contents) []string

func DeleteBucket

func DeleteBucket(client *ds3.Client, bucketName string) error

Deletes the specified bucket and returns an error if one occurs

func DeleteBucketContents

func DeleteBucketContents(client *ds3.Client, bucketName string)

func DeleteBucketLogError

func DeleteBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error

Deletes the specified bucket. If an error occurs, it is logged, and the calling
test is marked as failed.

func DeleteDataPolicyLogError

func DeleteDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) error

Deletes the specified data policy. If an error occurs, it is logged, and the calling
test is marked as failed, but continues running.

func DeleteObject

func DeleteObject(client *ds3.Client, bucketName string, objectName string) error

Deletes the specified object. Returns an error if not successful.

func DeleteObjectLogError

func DeleteObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) error

Deletes the specified object. If an error occurs, it is logged, and the calling
test is marked as failed.

func GetBucket

func GetBucket(client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)

Retrieves the specified bucket. Returns an error if unsuccessful.

func GetBucketLogError

func GetBucketLogError(t *testing.T, client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)

Retrieves the specified bucket. If an error occurs, it is logged, and the calling
test is marked as failed.

func GetDataPolicyLogError

func GetDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) (*models.GetDataPolicySpectraS3Response, error)

Retrieves the specified data policy. If an error occurs, it is logged, and the calling
test is marked as failed, but continues running

func GetObject

func GetObject(client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)

Retrieves the specified object. Returns an error if not successful.

func GetObjectLogError

func GetObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)

Retrieves the specified object. If an error occurs, it is logged, and the calling
test is marked as failed.

func GetResourceBookAsStream

func GetResourceBookAsStream(book string) (*networking.ReaderWithSizeDecorator, error)

func GetResourceBooks

func GetResourceBooks() (map[string]networking.ReaderWithSizeDecorator, error)

func GetUserByNameLogError

func GetUserByNameLogError(t *testing.T, client *ds3.Client, userName string) (*models.SpectraUser, error)

Retrieves the specified user by name. Expects there to be one user with the specified name.
If there is not exactly 1 user with the specified name, it is treated as an error. If an
error occurs, it is logged, and the calling  test is marked as failed, but continues running.

func LoadBook

func LoadBook(book string) ([]byte, error)

Loads the specified book. Assumes that the book is located in the /resources/books/ folder.

func LoadBookLogError

func LoadBookLogError(t *testing.T, book string) ([]byte, error)

Loads the specified book. If an error occurs, it is logged, and the calling
test is marked as failed.

func PutBucket

func PutBucket(client *ds3.Client, bucketName string) error

Puts the specified bucket. Returns an error if not successful.

func PutBucketLogError

func PutBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error

Puts the specified bucket. If an error occurs, it is logged, and the calling
test is marked as failed.

func PutDataPolicyLogError

func PutDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyName string) (*models.PutDataPolicySpectraS3Response, error)

Creates the specified data policy. If an error occurs, it is logged, and the calling
test is marked as failed, but continues running.

func PutObject

func PutObject(client *ds3.Client, bucketName string, objectName string, data []byte) error

Puts the specified object. Returns an error if not successful.

func PutObjectLogError

func PutObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string, data []byte) error

Puts the specified object. If an error occurs, it is logged, and the calling
test is marked as failed.

func PutTestBooks

func PutTestBooks(client *ds3.Client, bucketName string) error

Puts the test books onto the BP

func SetupTestEnv

func SetupTestEnv(testBucket string, userName string, envTestNameSpace string) (*ds3.Client, *TestIds, error)

Sets up the test environment by
1) creating a client from environment variables and
2) creating a test bucket
3) creating new data policy
4) setting default user to use new data policy
5) crating a pool partition
6) creating a storage domain
7) creating a storage domain member
8) creating a data persistence rule

func TeardownTestEnv

func TeardownTestEnv(client *ds3.Client, ids *TestIds, testBucket string)

Tears down the test environment by deleting all contents in the
test bucket and deleting all items created in SetupTestEnv

func VerifyBookContent

func VerifyBookContent(t *testing.T, bookName string, content io.ReadCloser)

type TestIds

type TestIds struct {
    DataPersistenceRuleId *string
    DataPolicyId          *string
    OriginalDataPolicyId  *string
    PoolPartitionId       *string
    StorageDomainId       *string
    StorageDomainMemberId *string
    UserId                *string
}

Used to keep track of all IDs for items created in SetupTestEnv, and used
in TeardownTestEnv. Items that have not been initialized are represented
with nil, denoting no teardown is required for that element.

Build version go1.6.

Except as noted,
the content of this page is licensed under the
Creative Commons Attribution 3.0 License,
and code is licensed under a BSD license.

Terms of Service |
Privacy Policy


text:
package com.google.jstestdriver.token;

import com.google.common.collect.Lists;

import java.util.Iterator;
import java.util.List;

/**
 * Acts as a buffer for an Iterator<Token>.
 * @author corysmith@google.com (Cory Smith)
 */
public class BufferedTokenStream {
  private final Iterator<Token> iterator;
  private int streamPos = 0;
  private int bufferIndex = 0;
  private final int readAhead = 2;
  private List<Token> buffer = Lists.newArrayList();

  public BufferedTokenStream(Iterator<Token> iterator) {
    this.iterator = iterator;
  }

  public Token read() {
    while(iterator.hasNext() && (buffer.size() - (bufferIndex + 1)) < readAhead) {
      streamPos++;
      buffer.add(iterator.next());
    }
    if (isBufferEmpty()) {
      return null;
    }
    Token token = buffer.get(bufferIndex++);
    return token;
  }

  private boolean isBufferEmpty() {
    return buffer.isEmpty() || bufferIndex + 1 > buffer.size();
  }

  public boolean available() {
    return iterator.hasNext() || !isBufferEmpty();
  }

  public void mark() {
    List<Token> oldBuffer = buffer;
    buffer = Lists.newArrayList();
    buffer.addAll(oldBuffer.subList(bufferIndex, oldBuffer.size()));
    bufferIndex = 0;
  }

  public void reset() {
    bufferIndex = 0;
  }
}


text:
@include('emails.header')

  Hello {!! $admin['firstname'] !!} {!! $admin['lastname'] !!},

  {!! $reported_user_name !!} has reported a post/comment. Please see below details.

  @if($is_post_reported)
    Reported Post Post: {!! $data['content'] !!}

    Post's Owner: {!! $data['User']['firstname'] !!} {!! $data['User']['lastname'] !!} ({!! $data['User']['email'] !!})

  @else
    Post Title: {!! $data['content'] !!}

    Post's Owner: {!! $data['User']['firstname'] !!} {!! $data['User']['lastname'] !!} ({!! $data['User']['email'] !!})

@if(isset($data['timelineComments']) && isset($data['timelineComments'][0]))Comment Description: {!! $data['timelineComments'][0]['content'] !!}

    Comment's Owner: {!! $data['timelineComments'][0]['user']['firstname']!!} {!! $data['timelineComments'][0]['user']['lastname']!!}
  @endif

  @endif

  Reported By: {!! $reported_user_name !!}({!! $report_user_email !!})

  Report Notes: {!! $report_notes !!}

  Click here to view this post detail after login to Fitnessity.

@include('emails.footer')


text:
@interface SPPictureViewController : UITableViewController

@end


text:
/* $OpenBSD: ecs_err.c,v 1.2 2014/06/12 15:49:29 deraadt Exp $ */
/* ====================================================================
 * Copyright (c) 1999-2011 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    openssl-core@OpenSSL.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */

/* NOTE: this file was auto generated by the mkerr.pl script: any changes
 * made to it will be overwritten when the script next updates this file,
 * only reason strings will be preserved.
 */

#include <stdio.h>

#include <openssl/opensslconf.h>

#include <openssl/err.h>
#include <openssl/ecdsa.h>

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECDSA,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECDSA,0,reason)

static ERR_STRING_DATA ECDSA_str_functs[]=
	{
{ERR_FUNC(ECDSA_F_ECDSA_CHECK),	"ECDSA_CHECK"},
{ERR_FUNC(ECDSA_F_ECDSA_DATA_NEW_METHOD),	"ECDSA_DATA_NEW_METHOD"},
{ERR_FUNC(ECDSA_F_ECDSA_DO_SIGN),	"ECDSA_do_sign"},
{ERR_FUNC(ECDSA_F_ECDSA_DO_VERIFY),	"ECDSA_do_verify"},
{ERR_FUNC(ECDSA_F_ECDSA_SIGN_SETUP),	"ECDSA_sign_setup"},
{0,NULL}
	};

static ERR_STRING_DATA ECDSA_str_reasons[]=
	{
{ERR_REASON(ECDSA_R_BAD_SIGNATURE)       ,"bad signature"},
{ERR_REASON(ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE),"data too large for key size"},
{ERR_REASON(ECDSA_R_ERR_EC_LIB)          ,"err ec lib"},
{ERR_REASON(ECDSA_R_MISSING_PARAMETERS)  ,"missing parameters"},
{ERR_REASON(ECDSA_R_NEED_NEW_SETUP_VALUES),"need new setup values"},
{ERR_REASON(ECDSA_R_NON_FIPS_METHOD)     ,"non fips method"},
{ERR_REASON(ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED),"random number generation failed"},
{ERR_REASON(ECDSA_R_SIGNATURE_MALLOC_FAILED),"signature malloc failed"},
{0,NULL}
	};

#endif

void ERR_load_ECDSA_strings(void)
	{
#ifndef OPENSSL_NO_ERR

	if (ERR_func_error_string(ECDSA_str_functs[0].error) == NULL)
		{
		ERR_load_strings(0,ECDSA_str_functs);
		ERR_load_strings(0,ECDSA_str_reasons);
		}
#endif
	}


text:
package ru.agolovin;

import java.util.concurrent.Semaphore;

/**
 * @author agolovin (agolovin@list.ru)
 * @version $
 * @since 0.1
 */
public class TaskString {

    private final int LIMIT = 10;
    private StringBuffer buffer = new StringBuffer();
    private Semaphore semaphore = new Semaphore(1);
    private int repeat = 1;

    public void setRepeatString(int number) {
        this.repeat = number;
    }

    public String getString() {
        return this.buffer.toString();
    }

    public void start() {
        Thread threadOne = new Thread(new StringThread(2));
        Thread threadTwo = new Thread(new StringThread(3));
        threadOne.start();
        threadTwo.start();
        try {
            threadTwo.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private class StringThread implements Runnable {
        private int anInt;

        public StringThread(int number) {
            this.anInt = number;
        }

        @Override
        public void run() {

            int repeatAmount = LIMIT * repeat;
            try {
                semaphore.acquire();
                for (int i = 1; i <= repeatAmount; i++) {
                    buffer.append(anInt);
                    if ((i % LIMIT) == 0) {
                        semaphore.release();
                        Thread.yield();
                        semaphore.acquire();
                    }
                }
                semaphore.release();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}


text:
          <title>Department Master</title>
          <meta name="viewport" content="width=device-width, initial-scale=1.0">

          <link rel="stylesheet" href="<?php echo base_url("assets/css/bootstrap.css"); ?>">

     <?php
          $attributes = array("class" => "form-horizontal", "id" => "loginform", "name" => "loginform");
          echo form_open("Department/index", $attributes);?>
          <fieldset>
               <legend>Search professors by department</legend>

Dept Name

                    <input class="form-control" id="txt_id" name="txt_id" placeholder="Username" type="text" value="<?php echo set_value('txt_id'); ?>" />

                    <input id="btn_login" name="btn_login" type="submit" class="btn btn-default" value="Dig!" />

                    <?php echo form_close(); ?>

                              #
                              Instructor ID
                              Name
                              Instructor Salary

                         <?php for ($i = 0; $i < count($deptlist); ++$i) { ?>

                                   <?php echo ($i+1); ?>
                                   <?php echo $deptlist[$i]->InstId; ?>
                                   <?php echo $deptlist[$i]->Name ?>
                                  <?php if($admin==1) echo $deptlist[$i]->Salary; ?>

                         <?php } ?>

          <button type="button" class="btn btn-default navbar-btn">Back to Home</button>


text:
<?php

namespace app\models;

/**
 * This is the ActiveQuery class for [[Emp]].
 *
 * @see Emp
 */
class EmpQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        $this->andWhere('[[status]]=1');
        return $this;
    }*/

    /**
     * @inheritdoc
     * @return Emp[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return Emp|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>P-Index</title>
<meta name="date" content="2017-05-10">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D G H I L M P R S T U V

P

Parte - Class in Modelo

Parte() - Constructor for class Modelo.Parte

Parte(Date, double, double, double, double, double, double, String) - Constructor for class Modelo.Parte

A B C D G H I L M P R S T U V

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
{-# LANGUAGE RecordWildCards #-}

module System.Relocated.Exec (
 exec
) where

import System.Relocated.Records

import System.Posix.Signals
import System.Posix.Process
import System.Process
import System.Exit

import Control.Concurrent

exec :: (String, Relocator) -> IO ()
exec (source,Relocator{..}) = do
 printRelocate
 (_, _, _, r) <- createProcess $
  proc
  _relocate
  [ _name, _nameSpace, _class, source, _destination]
 waitForProcess r
 return ()
 where
  printRelocate =
   putStrLn $
    "RELOCATE: _name: " ++ _name ++ ", _nameSpace: " ++ _nameSpace ++ ", _class: " ++ _class ++ ", source: " ++ source ++ ", destination: " ++ _destination