text:
package com.amazonaws.services.ec2.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * CreateVpnConnectionRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateVpnConnectionRequestMarshaller implements Marshaller<Request<CreateVpnConnectionRequest>, CreateVpnConnectionRequest> {

    public Request<CreateVpnConnectionRequest> marshall(CreateVpnConnectionRequest createVpnConnectionRequest) {

        if (createVpnConnectionRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<CreateVpnConnectionRequest> request = new DefaultRequest<CreateVpnConnectionRequest>(createVpnConnectionRequest, "AmazonEC2");
        request.addParameter("Action", "CreateVpnConnection");
        request.addParameter("Version", "2016-11-15");
        request.setHttpMethod(HttpMethodName.POST);

        if (createVpnConnectionRequest.getCustomerGatewayId() != null) {
            request.addParameter("CustomerGatewayId", StringUtils.fromString(createVpnConnectionRequest.getCustomerGatewayId()));
        }

        if (createVpnConnectionRequest.getType() != null) {
            request.addParameter("Type", StringUtils.fromString(createVpnConnectionRequest.getType()));
        }

        if (createVpnConnectionRequest.getVpnGatewayId() != null) {
            request.addParameter("VpnGatewayId", StringUtils.fromString(createVpnConnectionRequest.getVpnGatewayId()));
        }

        if (createVpnConnectionRequest.getTransitGatewayId() != null) {
            request.addParameter("TransitGatewayId", StringUtils.fromString(createVpnConnectionRequest.getTransitGatewayId()));
        }

        VpnConnectionOptionsSpecification options = createVpnConnectionRequest.getOptions();
        if (options != null) {

            if (options.getEnableAcceleration() != null) {
                request.addParameter("Options.EnableAcceleration", StringUtils.fromBoolean(options.getEnableAcceleration()));
            }

            if (options.getStaticRoutesOnly() != null) {
                request.addParameter("Options.StaticRoutesOnly", StringUtils.fromBoolean(options.getStaticRoutesOnly()));
            }

            if (options.getTunnelInsideIpVersion() != null) {
                request.addParameter("Options.TunnelInsideIpVersion", StringUtils.fromString(options.getTunnelInsideIpVersion()));
            }

            com.amazonaws.internal.SdkInternalList<VpnTunnelOptionsSpecification> vpnConnectionOptionsSpecificationTunnelOptionsList = (com.amazonaws.internal.SdkInternalList<VpnTunnelOptionsSpecification>) options
                    .getTunnelOptions();
            if (!vpnConnectionOptionsSpecificationTunnelOptionsList.isEmpty() || !vpnConnectionOptionsSpecificationTunnelOptionsList.isAutoConstruct()) {
                int tunnelOptionsListIndex = 1;

                for (VpnTunnelOptionsSpecification vpnConnectionOptionsSpecificationTunnelOptionsListValue : vpnConnectionOptionsSpecificationTunnelOptionsList) {

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getTunnelInsideCidr() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".TunnelInsideCidr",
                                StringUtils.fromString(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getTunnelInsideCidr()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getTunnelInsideIpv6Cidr() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".TunnelInsideIpv6Cidr",
                                StringUtils.fromString(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getTunnelInsideIpv6Cidr()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getPreSharedKey() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".PreSharedKey",
                                StringUtils.fromString(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getPreSharedKey()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getPhase1LifetimeSeconds() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase1LifetimeSeconds",
                                StringUtils.fromInteger(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getPhase1LifetimeSeconds()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getPhase2LifetimeSeconds() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase2LifetimeSeconds",
                                StringUtils.fromInteger(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getPhase2LifetimeSeconds()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getRekeyMarginTimeSeconds() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".RekeyMarginTimeSeconds",
                                StringUtils.fromInteger(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getRekeyMarginTimeSeconds()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getRekeyFuzzPercentage() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".RekeyFuzzPercentage",
                                StringUtils.fromInteger(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getRekeyFuzzPercentage()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getReplayWindowSize() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".ReplayWindowSize",
                                StringUtils.fromInteger(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getReplayWindowSize()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getDPDTimeoutSeconds() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".DPDTimeoutSeconds",
                                StringUtils.fromInteger(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getDPDTimeoutSeconds()));
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getDPDTimeoutAction() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".DPDTimeoutAction",
                                StringUtils.fromString(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getDPDTimeoutAction()));
                    }

                    com.amazonaws.internal.SdkInternalList<Phase1EncryptionAlgorithmsRequestListValue> vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsList = (com.amazonaws.internal.SdkInternalList<Phase1EncryptionAlgorithmsRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getPhase1EncryptionAlgorithms();
                    if (!vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsList.isEmpty()
                            || !vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsList.isAutoConstruct()) {
                        int phase1EncryptionAlgorithmsListIndex = 1;

                        for (Phase1EncryptionAlgorithmsRequestListValue vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsListValue : vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsList) {

                            if (vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase1EncryptionAlgorithm."
                                        + phase1EncryptionAlgorithmsListIndex + ".Value",
                                        StringUtils.fromString(vpnTunnelOptionsSpecificationPhase1EncryptionAlgorithmsListValue.getValue()));
                            }
                            phase1EncryptionAlgorithmsListIndex++;
                        }
                    }

                    com.amazonaws.internal.SdkInternalList<Phase2EncryptionAlgorithmsRequestListValue> vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsList = (com.amazonaws.internal.SdkInternalList<Phase2EncryptionAlgorithmsRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getPhase2EncryptionAlgorithms();
                    if (!vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsList.isEmpty()
                            || !vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsList.isAutoConstruct()) {
                        int phase2EncryptionAlgorithmsListIndex = 1;

                        for (Phase2EncryptionAlgorithmsRequestListValue vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsListValue : vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsList) {

                            if (vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase2EncryptionAlgorithm."
                                        + phase2EncryptionAlgorithmsListIndex + ".Value",
                                        StringUtils.fromString(vpnTunnelOptionsSpecificationPhase2EncryptionAlgorithmsListValue.getValue()));
                            }
                            phase2EncryptionAlgorithmsListIndex++;
                        }
                    }

                    com.amazonaws.internal.SdkInternalList<Phase1IntegrityAlgorithmsRequestListValue> vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsList = (com.amazonaws.internal.SdkInternalList<Phase1IntegrityAlgorithmsRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getPhase1IntegrityAlgorithms();
                    if (!vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsList.isEmpty()
                            || !vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsList.isAutoConstruct()) {
                        int phase1IntegrityAlgorithmsListIndex = 1;

                        for (Phase1IntegrityAlgorithmsRequestListValue vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsListValue : vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsList) {

                            if (vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase1IntegrityAlgorithm."
                                        + phase1IntegrityAlgorithmsListIndex + ".Value",
                                        StringUtils.fromString(vpnTunnelOptionsSpecificationPhase1IntegrityAlgorithmsListValue.getValue()));
                            }
                            phase1IntegrityAlgorithmsListIndex++;
                        }
                    }

                    com.amazonaws.internal.SdkInternalList<Phase2IntegrityAlgorithmsRequestListValue> vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsList = (com.amazonaws.internal.SdkInternalList<Phase2IntegrityAlgorithmsRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getPhase2IntegrityAlgorithms();
                    if (!vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsList.isEmpty()
                            || !vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsList.isAutoConstruct()) {
                        int phase2IntegrityAlgorithmsListIndex = 1;

                        for (Phase2IntegrityAlgorithmsRequestListValue vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsListValue : vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsList) {

                            if (vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase2IntegrityAlgorithm."
                                        + phase2IntegrityAlgorithmsListIndex + ".Value",
                                        StringUtils.fromString(vpnTunnelOptionsSpecificationPhase2IntegrityAlgorithmsListValue.getValue()));
                            }
                            phase2IntegrityAlgorithmsListIndex++;
                        }
                    }

                    com.amazonaws.internal.SdkInternalList<Phase1DHGroupNumbersRequestListValue> vpnTunnelOptionsSpecificationPhase1DHGroupNumbersList = (com.amazonaws.internal.SdkInternalList<Phase1DHGroupNumbersRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getPhase1DHGroupNumbers();
                    if (!vpnTunnelOptionsSpecificationPhase1DHGroupNumbersList.isEmpty()
                            || !vpnTunnelOptionsSpecificationPhase1DHGroupNumbersList.isAutoConstruct()) {
                        int phase1DHGroupNumbersListIndex = 1;

                        for (Phase1DHGroupNumbersRequestListValue vpnTunnelOptionsSpecificationPhase1DHGroupNumbersListValue : vpnTunnelOptionsSpecificationPhase1DHGroupNumbersList) {

                            if (vpnTunnelOptionsSpecificationPhase1DHGroupNumbersListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase1DHGroupNumber."
                                        + phase1DHGroupNumbersListIndex + ".Value",
                                        StringUtils.fromInteger(vpnTunnelOptionsSpecificationPhase1DHGroupNumbersListValue.getValue()));
                            }
                            phase1DHGroupNumbersListIndex++;
                        }
                    }

                    com.amazonaws.internal.SdkInternalList<Phase2DHGroupNumbersRequestListValue> vpnTunnelOptionsSpecificationPhase2DHGroupNumbersList = (com.amazonaws.internal.SdkInternalList<Phase2DHGroupNumbersRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getPhase2DHGroupNumbers();
                    if (!vpnTunnelOptionsSpecificationPhase2DHGroupNumbersList.isEmpty()
                            || !vpnTunnelOptionsSpecificationPhase2DHGroupNumbersList.isAutoConstruct()) {
                        int phase2DHGroupNumbersListIndex = 1;

                        for (Phase2DHGroupNumbersRequestListValue vpnTunnelOptionsSpecificationPhase2DHGroupNumbersListValue : vpnTunnelOptionsSpecificationPhase2DHGroupNumbersList) {

                            if (vpnTunnelOptionsSpecificationPhase2DHGroupNumbersListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".Phase2DHGroupNumber."
                                        + phase2DHGroupNumbersListIndex + ".Value",
                                        StringUtils.fromInteger(vpnTunnelOptionsSpecificationPhase2DHGroupNumbersListValue.getValue()));
                            }
                            phase2DHGroupNumbersListIndex++;
                        }
                    }

                    com.amazonaws.internal.SdkInternalList<IKEVersionsRequestListValue> vpnTunnelOptionsSpecificationIKEVersionsList = (com.amazonaws.internal.SdkInternalList<IKEVersionsRequestListValue>) vpnConnectionOptionsSpecificationTunnelOptionsListValue
                            .getIKEVersions();
                    if (!vpnTunnelOptionsSpecificationIKEVersionsList.isEmpty() || !vpnTunnelOptionsSpecificationIKEVersionsList.isAutoConstruct()) {
                        int iKEVersionsListIndex = 1;

                        for (IKEVersionsRequestListValue vpnTunnelOptionsSpecificationIKEVersionsListValue : vpnTunnelOptionsSpecificationIKEVersionsList) {

                            if (vpnTunnelOptionsSpecificationIKEVersionsListValue.getValue() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".IKEVersion." + iKEVersionsListIndex + ".Value",
                                        StringUtils.fromString(vpnTunnelOptionsSpecificationIKEVersionsListValue.getValue()));
                            }
                            iKEVersionsListIndex++;
                        }
                    }

                    if (vpnConnectionOptionsSpecificationTunnelOptionsListValue.getStartupAction() != null) {
                        request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".StartupAction",
                                StringUtils.fromString(vpnConnectionOptionsSpecificationTunnelOptionsListValue.getStartupAction()));
                    }

                    VpnTunnelLogOptionsSpecification logOptions = vpnConnectionOptionsSpecificationTunnelOptionsListValue.getLogOptions();
                    if (logOptions != null) {

                        CloudWatchLogOptionsSpecification cloudWatchLogOptions = logOptions.getCloudWatchLogOptions();
                        if (cloudWatchLogOptions != null) {

                            if (cloudWatchLogOptions.getLogEnabled() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".LogOptions.CloudWatchLogOptions.LogEnabled",
                                        StringUtils.fromBoolean(cloudWatchLogOptions.getLogEnabled()));
                            }

                            if (cloudWatchLogOptions.getLogGroupArn() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".LogOptions.CloudWatchLogOptions.LogGroupArn",
                                        StringUtils.fromString(cloudWatchLogOptions.getLogGroupArn()));
                            }

                            if (cloudWatchLogOptions.getLogOutputFormat() != null) {
                                request.addParameter("Options.TunnelOptions." + tunnelOptionsListIndex + ".LogOptions.CloudWatchLogOptions.LogOutputFormat",
                                        StringUtils.fromString(cloudWatchLogOptions.getLogOutputFormat()));
                            }
                        }
                    }
                    tunnelOptionsListIndex++;
                }
            }

            if (options.getLocalIpv4NetworkCidr() != null) {
                request.addParameter("Options.LocalIpv4NetworkCidr", StringUtils.fromString(options.getLocalIpv4NetworkCidr()));
            }

            if (options.getRemoteIpv4NetworkCidr() != null) {
                request.addParameter("Options.RemoteIpv4NetworkCidr", StringUtils.fromString(options.getRemoteIpv4NetworkCidr()));
            }

            if (options.getLocalIpv6NetworkCidr() != null) {
                request.addParameter("Options.LocalIpv6NetworkCidr", StringUtils.fromString(options.getLocalIpv6NetworkCidr()));
            }

            if (options.getRemoteIpv6NetworkCidr() != null) {
                request.addParameter("Options.RemoteIpv6NetworkCidr", StringUtils.fromString(options.getRemoteIpv6NetworkCidr()));
            }

            if (options.getOutsideIpAddressType() != null) {
                request.addParameter("Options.OutsideIpAddressType", StringUtils.fromString(options.getOutsideIpAddressType()));
            }

            if (options.getTransportTransitGatewayAttachmentId() != null) {
                request.addParameter("Options.TransportTransitGatewayAttachmentId", StringUtils.fromString(options.getTransportTransitGatewayAttachmentId()));
            }
        }

        com.amazonaws.internal.SdkInternalList<TagSpecification> createVpnConnectionRequestTagSpecificationsList = (com.amazonaws.internal.SdkInternalList<TagSpecification>) createVpnConnectionRequest
                .getTagSpecifications();
        if (!createVpnConnectionRequestTagSpecificationsList.isEmpty() || !createVpnConnectionRequestTagSpecificationsList.isAutoConstruct()) {
            int tagSpecificationsListIndex = 1;

            for (TagSpecification createVpnConnectionRequestTagSpecificationsListValue : createVpnConnectionRequestTagSpecificationsList) {

                if (createVpnConnectionRequestTagSpecificationsListValue.getResourceType() != null) {
                    request.addParameter("TagSpecification." + tagSpecificationsListIndex + ".ResourceType",
                            StringUtils.fromString(createVpnConnectionRequestTagSpecificationsListValue.getResourceType()));
                }

                com.amazonaws.internal.SdkInternalList<Tag> tagSpecificationTagsList = (com.amazonaws.internal.SdkInternalList<Tag>) createVpnConnectionRequestTagSpecificationsListValue
                        .getTags();
                if (!tagSpecificationTagsList.isEmpty() || !tagSpecificationTagsList.isAutoConstruct()) {
                    int tagsListIndex = 1;

                    for (Tag tagSpecificationTagsListValue : tagSpecificationTagsList) {

                        if (tagSpecificationTagsListValue.getKey() != null) {
                            request.addParameter("TagSpecification." + tagSpecificationsListIndex + ".Tag." + tagsListIndex + ".Key",
                                    StringUtils.fromString(tagSpecificationTagsListValue.getKey()));
                        }

                        if (tagSpecificationTagsListValue.getValue() != null) {
                            request.addParameter("TagSpecification." + tagSpecificationsListIndex + ".Tag." + tagsListIndex + ".Value",
                                    StringUtils.fromString(tagSpecificationTagsListValue.getValue()));
                        }
                        tagsListIndex++;
                    }
                }
                tagSpecificationsListIndex++;
            }
        }

        return request;
    }

}


text:
# Get-PFC.ps1 based on working Get-DPFC.ps1. Using the AFC algorithmto merge Error and Warnigns and also handle .evtx format
# plan is to make Cmdlets
# could create a directory structure object
param (
[Parameter(
	Mandatory=$true,
	ValueFromPipeline=$true
	)
]
[string]$PFCZip
)
# Passing AFC password from SecretStore CredMan
. $env:HOMEPATH\Documents\WindowsPowerShell\Scripts\PSThUtils\Parsers\Get-7zip_PSW.ps1

$sb_name = ($PFCZip).Split('\\')[-1]

if (($sb_name) -match "PFC-.*.zip")
{

#extract bz2 and create a sub-directory 1 (non-configurable)
$subdir1 = (Get-ChildItem $PFCZip | Invoke-SevenZipPswdCMPFC)[-1]

}
else
{
Write-Host 'did not find PFC-something.zip'
Write-Host "We only got $sb_name"
break
}

# Navigates to the created directory as returned by Invoke-SevenZipPswd
$PFCExtractPath = ($PFCZip.TrimEnd("$sb_name") + $subdir1)
# String handling to remove any logs older than last year
$lastyear = (get-date).AddMonths(-12).Year

Write-Host "Extra filtering ongoing..."
Get-ChildItem $PFCExtractPath | ForEach-Object {
	switch ($_.Name)
	{
		"app.csv" {
			#Application Event
			Write-Output "Application Event Errors and Warnings--------------------------------------------------------------------------------------------------------------------------------" | Out-File $PFCExtractPath\app.csv_filtered.log -NoClobber
			Import-Csv $PFCExtractPath\app.csv | where {$_.'Date and Time'.Replace('-'," ").Replace('/',' ').Split(" ")[2] -ge "$lastyear"}  | where {$_.Level -like "Error" -or $_.Level -like "Warning"} | Out-File $PFCExtractPath\app.csv_filtered.log -Append
			break
		}
		"sys.csv" {
			# System Event
			Write-Output "System Event Errors and Warnings--------------------------------------------------------------------------------------------------------------------------------------" | Out-File $PFCExtractPath\sys.csv_filtered.log -NoClobber
			Import-Csv $PFCExtractPath\sys.csv | where {$_.'Date and Time'.Replace('-'," ").Replace('/',' ').Split(" ")[2] -ge "$lastyear"} | where {$_.Level -like "Error" -or $_.Level -like "Warning"} | Out-File $PFCExtractPath\sys.csv_filtered.log -Append
			break
		}

		"App.evtx" {
			# Get-WinEvent -Path $PFCExtractPath\App.evtx
			$GWEAppEvtx = Get-WinEvent -Path $PFCExtractPath\App.evtx
			Write-Output "Application Event Errors or Warnings ---------------------------------------------------------------------------------------------------------------------------------" | Out-File $PFCExtractPath\App.evtx_filtered.log -NoClobber
			$GWEAppEvtx | where {$_.TimeCreated.ToString().Replace('-'," ").Replace('/',' ').Split(" ")[2] -ge "$lastyear"} | where {$_.LevelDisplayName -like "Error" -or $_.LevelDisplayName -like "Warning"}  |  Format-List -Property LevelDisplayName,TimeCreated,ProviderName,Id,Keywords,ProcessId,MachineName,UserId,Message  | Out-File $PFCExtractPath\App.evtx_filtered.log -Width 300 -Append
			break
		}
		"Sys.evtx" {
			# Get-WinEvent -Path $PFCExtractPath\Sys.evtx
			$GWESysEvtx = Get-WinEvent -Path $PFCExtractPath\Sys.evtx
			Write-Output "System Event Errors or Warnings--------------------------------------------------------------------------------------------------------------------------------------" | Out-File $PFCExtractPath\Sys.evtx_filtered.log -NoClobber
			$GWESysEvtx | where {$_.TimeCreated.ToString().Replace('-'," ").Replace('/',' ').Split(" ")[2] -ge "$lastyear"} | where {$_.LevelDisplayName -like "Error" -or $_.LevelDisplayName -like "Warning"} | Format-List -Property LevelDisplayName,TimeCreated,ProviderName,Id,Keywords,ProcessId,MachineName,UserId,Message | Out-File $PFCExtractPath\Sys.evtx_filtered.log -Width 300 -Append
			break
		}
		default {
			# checking content of $_ as seen by the switch statement
			# What did not get selected by switch
			break
		}
	}
}
Write-Host "...extra filtering completed"

redpajama_set_name: RedPajamaGithub


text:
package main

type Events struct {
	DirectMessages []DirectMessage `json:"direct_message_events"`
	//todo figure out how to pick up json by user id for DM Users
}

type DirectMessage struct {
	Type             string        `json:"type"`
	Id               string        `json:"id"`
	CreatedTimestamp string        `json:"created_timestamp"`
	MessageCreate    MessageCreate `json:"message_create"`
}

type MessageCreate struct {
	Target      Target      `json:"target"`
	SenderId    string      `json:"sender_id"`
	MessageData MessageData `json:"message_data"`
}

//hopefully the target is generally us
type Target struct {
	RecipientId string `json:"recipient_id"`
}

type MessageData struct {
	Text               string             `json:"text"`
	Entities           Entities           `json:"entities"`
	QuickReplyResponse QuickReplyResponse `json:"quick_reply_response"`
}

type Entities struct {
	Hashtags     []string `json:"hashtags"`
	Symbols      []string `json:"symbols"`
	Urls         []string `json:"urls"`
	UserMentions []string `json:"user_mentions"`
}

type QuickReplyResponse struct {
	Type     string `json:"type"`
	Metadata string `json:"metadata"`
}


text:
'use strict';

const { QueryTransformation } = require('./QueryTransformation');

class CompositeQueryTransformation extends QueryTransformation {
  constructor(transformations) {
    super();
    this.transformations = transformations;
  }

  onConvertQueryBuilderBase(item, builder) {
    for (const transformation of this.transformations) {
      item = transformation.onConvertQueryBuilderBase(item, builder);
    }

    return item;
  }
}

module.exports = {
  CompositeQueryTransformation,
};


text:
<?php
namespace Craft;

/**
 * The class name is the UTC timestamp in the format of mYYMMDD_HHMMSS_migrationName
 */
class m140831_000001_extended_cache_keys extends BaseMigration
{
	/**
	 * Any migration code in here is wrapped inside of a transaction.
	 *
	 * @return bool
	 */
	public function safeUp()
	{
		$this->alterColumn(
			'templatecaches',
			'cacheKey',
			array('column' => ColumnType::Varchar, 'null' => false)
		);

		return true;
	}
}


text:
#pragma once
#include <aws/kinesisanalytics/KinesisAnalytics_EXPORTS.h>
#include <aws/kinesisanalytics/KinesisAnalyticsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace KinesisAnalytics
{
namespace Model
{

  /**
   */
  class AWS_KINESISANALYTICS_API DeleteApplicationCloudWatchLoggingOptionRequest : public KinesisAnalyticsRequest
  {
  public:
    DeleteApplicationCloudWatchLoggingOptionRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DeleteApplicationCloudWatchLoggingOption"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The Kinesis Analytics application name.

     */
    inline const Aws::String& GetApplicationName() const{ return m_applicationName; }

    /**
     *
The Kinesis Analytics application name.

     */
    inline void SetApplicationName(const Aws::String& value) { m_applicationNameHasBeenSet = true; m_applicationName = value; }

    /**
     *
The Kinesis Analytics application name.

     */
    inline void SetApplicationName(Aws::String&& value) { m_applicationNameHasBeenSet = true; m_applicationName = std::move(value); }

    /**
     *
The Kinesis Analytics application name.

     */
    inline void SetApplicationName(const char* value) { m_applicationNameHasBeenSet = true; m_applicationName.assign(value); }

    /**
     *
The Kinesis Analytics application name.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithApplicationName(const Aws::String& value) { SetApplicationName(value); return *this;}

    /**
     *
The Kinesis Analytics application name.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithApplicationName(Aws::String&& value) { SetApplicationName(std::move(value)); return *this;}

    /**
     *
The Kinesis Analytics application name.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithApplicationName(const char* value) { SetApplicationName(value); return *this;}

    /**
     *
The version ID of the Kinesis Analytics application.

     */
    inline long long GetCurrentApplicationVersionId() const{ return m_currentApplicationVersionId; }

    /**
     *
The version ID of the Kinesis Analytics application.

     */
    inline void SetCurrentApplicationVersionId(long long value) { m_currentApplicationVersionIdHasBeenSet = true; m_currentApplicationVersionId = value; }

    /**
     *
The version ID of the Kinesis Analytics application.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithCurrentApplicationVersionId(long long value) { SetCurrentApplicationVersionId(value); return *this;}

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline const Aws::String& GetCloudWatchLoggingOptionId() const{ return m_cloudWatchLoggingOptionId; }

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline void SetCloudWatchLoggingOptionId(const Aws::String& value) { m_cloudWatchLoggingOptionIdHasBeenSet = true; m_cloudWatchLoggingOptionId = value; }

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline void SetCloudWatchLoggingOptionId(Aws::String&& value) { m_cloudWatchLoggingOptionIdHasBeenSet = true; m_cloudWatchLoggingOptionId = std::move(value); }

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline void SetCloudWatchLoggingOptionId(const char* value) { m_cloudWatchLoggingOptionIdHasBeenSet = true; m_cloudWatchLoggingOptionId.assign(value); }

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithCloudWatchLoggingOptionId(const Aws::String& value) { SetCloudWatchLoggingOptionId(value); return *this;}

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithCloudWatchLoggingOptionId(Aws::String&& value) { SetCloudWatchLoggingOptionId(std::move(value)); return *this;}

    /**
     *
The CloudWatchLoggingOptionId of the CloudWatch logging option
     * to delete. You can get the CloudWatchLoggingOptionId by using the
     * DescribeApplication operation.

     */
    inline DeleteApplicationCloudWatchLoggingOptionRequest& WithCloudWatchLoggingOptionId(const char* value) { SetCloudWatchLoggingOptionId(value); return *this;}

  private:

    Aws::String m_applicationName;
    bool m_applicationNameHasBeenSet;

    long long m_currentApplicationVersionId;
    bool m_currentApplicationVersionIdHasBeenSet;

    Aws::String m_cloudWatchLoggingOptionId;
    bool m_cloudWatchLoggingOptionIdHasBeenSet;
  };

} // namespace Model
} // namespace KinesisAnalytics
} // namespace Aws


text:
package com.team254.frc2015.behavior.routines;

import com.team254.frc2015.behavior.Commands;
import com.team254.frc2015.behavior.RobotSetpoints;
import com.team254.lib.util.Latch;
import com.team254.lib.util.TimeDelayedBoolean;
import edu.wpi.first.wpilibj.Timer;

import java.util.Optional;

public class FloorLoadRoutine extends Routine {

    public enum States {
        START, MOVE_TO_STARTING_POS, WAIT_FOR_TOTE, CLAMP, MOVE_DOWN, MOVE_UP, PUSH_TOP_DOWN, DONE
    }

    private States m_state = States.START;
    private boolean m_is_new_state = true;
    Timer m_state_timer = new Timer();
    private static final double TOTE_CLEAR_POS = 18.5;
    private static final double WHEEL_CUTOFF_HEIGHT = 15;
    private static final double REGRASP_POS = 10;
    private static final double TOTE_GRAB_POS = 1.0;
    private boolean m_moved_down_once = false;
    private Latch m_top_carriage_init_latch = new Latch();
    private TimeDelayedBoolean m_stalled_motor = new TimeDelayedBoolean();

    @Override
    public void reset() {
        m_state = States.START;
        m_is_new_state = true;
        m_state_timer.start();
        m_state_timer.reset();
        m_moved_down_once = false;
    }

    @Override
    public RobotSetpoints update(Commands commands, RobotSetpoints setpoints) {
        States new_state = m_state;
        boolean do_squeeze = true;
        if (m_state != States.START && m_state != States.MOVE_TO_STARTING_POS) {
            setpoints.intake_action = RobotSetpoints.IntakeAction.CLOSE;
        }

        setpoints.roller_action = RobotSetpoints.RollerAction.INTAKE;

        boolean should_vent = false;

        switch (m_state) {
            case START:
                new_state = States.MOVE_TO_STARTING_POS;
                do_squeeze = false;
                break;
            case MOVE_TO_STARTING_POS:
                if (m_is_new_state) {
                    setpoints.m_elevator_setpoints.bottom_setpoint = Optional.of(TOTE_CLEAR_POS);
                    setpoints.m_elevator_setpoints.top_setpoint = Optional.of(TOTE_CLEAR_POS + 12.0);
                }
                if (!m_is_new_state && bottom_carriage.isOnTarget() || m_state_timer.get() > 2.0) {
                    new_state = States.WAIT_FOR_TOTE;
                }
                if (m_top_carriage_init_latch.update(top_carriage.getBreakbeamTriggered())) {
                    m_moved_down_once = true;
                }
                do_squeeze = m_moved_down_once;
                break;
            case WAIT_FOR_TOTE:
                do_squeeze = m_moved_down_once;
                if (intake.getBreakbeamTriggered()) {
                    new_state = States.MOVE_DOWN;
                }
                break;
            case CLAMP:
                do_squeeze = false;
                setpoints.bottom_open_loop_jog = Optional.of(0.0);
                if (m_state_timer.get() > .15) {
                    new_state = States.WAIT_FOR_TOTE;
                    setpoints.top_open_loop_jog = Optional.of(0.0);
                } else {
                    setpoints.top_open_loop_jog = Optional.of(-.55);
                }
                break;
            case MOVE_DOWN:
                if (m_is_new_state) {
                    bottom_carriage.setFastPositionSetpoint(TOTE_GRAB_POS);
                }
                if (m_moved_down_once && (bottom_carriage.isOnTarget() || m_state_timer.get() > 2.0)) {
                    new_state = States.MOVE_UP;
                }
                if (!m_moved_down_once && bottom_carriage.isOnTarget() && (top_carriage.getHeight() < 5.25 || m_state_timer.get() > .8)) {
                    new_state = States.MOVE_UP;
                }
                should_vent = (!m_moved_down_once && top_carriage.getHeight() < 10);
                break;
            case MOVE_UP:
                if (m_is_new_state) {
                    bottom_carriage.setFastPositionSetpoint(TOTE_CLEAR_POS);
                }
                if (bottom_carriage.getHeight() < WHEEL_CUTOFF_HEIGHT) {
                    setpoints.roller_action = RobotSetpoints.RollerAction.STOP;
                }
                if (bottom_carriage.isOnTarget() || m_state_timer.get() > 2.0) {
                    m_moved_down_once = true;
                    new_state = States.CLAMP;
                }
                if (top_carriage.getHeight() - bottom_carriage.getHeight() < 1.9 && !top_carriage.getBreakbeamTriggered()) {
                    new_state = States.MOVE_TO_STARTING_POS;
                }
                should_vent = !m_moved_down_once && (bottom_carriage.getHeight() < REGRASP_POS);
                break;
            case PUSH_TOP_DOWN:
                do_squeeze = false;
                setpoints.bottom_open_loop_jog = Optional.of(0.0);
                if (m_state_timer.get() > .15) {
                    new_state = States.DONE;
                    setpoints.top_open_loop_jog = Optional.of(0.0);
                } else {
                    setpoints.top_open_loop_jog = Optional.of(-.55);
                }
                break;
            case DONE:
                if (m_is_new_state) {
                    setpoints.bottom_open_loop_jog = Optional.of(0.0);
                }
                // Just in case
                if (bottom_carriage.getHeight() >= (TOTE_CLEAR_POS - 5.0) && intake.getBreakbeamTriggered()) {
                    new_state = States.MOVE_DOWN;
                }
                break;
        }

        if (commands.roller_request == Commands.RollerRequest.INTAKE) {
            setpoints.roller_action = RobotSetpoints.RollerAction.STOP;
        } else if (commands.roller_request == Commands.RollerRequest.EXHAUST) {
            setpoints.roller_action = RobotSetpoints.RollerAction.EXHAUST;
        }

        if (m_state != States.MOVE_TO_STARTING_POS) {
            m_top_carriage_init_latch.update(false);
        }

        if (m_state == States.MOVE_UP && bottom_carriage.fastHitTop()) {
            System.out.println("Hit top - floor load, moving to DONE");
            new_state = States.PUSH_TOP_DOWN;
        }

        if (m_stalled_motor.update(m_state == States.MOVE_UP && bottom_carriage.getEncoderVelocity() < 5.0, 1.25)) {
            System.out.println("Stalled motor!");
            new_state = States.DONE;
        }

        setpoints.top_carriage_squeeze = do_squeeze && !setpoints.top_open_loop_jog.isPresent();
        setpoints.claw_action = should_vent ? RobotSetpoints.TopCarriageClawAction.NEUTRAL : RobotSetpoints.TopCarriageClawAction.CLOSE;

        m_is_new_state = false;
        if (new_state != m_state) {
            m_state = new_state;
            m_state_timer.reset();
            m_is_new_state = true;
        }
        return setpoints;
    }

    public boolean isDoneWithSixStack() {
        return m_state == States.DONE;
    }

    @Override
    public void cancel() {

    }

    @Override
    public boolean isFinished() {
        return false;
    }

    @Override
    public String getName() {
        return "Floor load";
    }
}


text:
package com.sigma.gclc.controller;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.text.MessageFormat;

import javax.annotation.PostConstruct;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/backoffice/upload")
public class UploadController {

	private Logger logger = LoggerFactory.getLogger(getClass());

	@Value("${uploadImagesDirectory}")
	private File uploadImagesDirectory;

	@RequestMapping(produces=MediaType.TEXT_HTML_VALUE)
	public String uploadForm() {
		return "upload";
	}

	@PostConstruct
	public void postInit() {
		if (!uploadImagesDirectory.exists()) {
			if (!uploadImagesDirectory.mkdirs()) {
				logger.warn(MessageFormat.format("Impossible de créer le répertoire {0}", uploadImagesDirectory));
				//throw new IllegalArgumentException();
			}
		}
	}

	@RequestMapping(method=RequestMethod.POST, consumes=MediaType.MULTIPART_FORM_DATA_VALUE)
	public String upload(@RequestParam(value="name", required=false) String name, @RequestParam(value="file", required=true) MultipartFile file) throws Exception {

		if (StringUtils.isBlank(name)) {
			name = file.getOriginalFilename();
		}
		if (StringUtils.isBlank(name)) {
			name = "Nom de fichier non déterminé";
		}

		if (file.isEmpty()) {
			logger.info("Fichier {} vide", name);
			throw new IllegalArgumentException(MessageFormat.format("Fichier {0} est vide", name));
		}

		if (!uploadImagesDirectory.exists() && !uploadImagesDirectory.mkdirs()) {
			throw new IllegalArgumentException(MessageFormat.format("Impossible de créer le répertoire {0}", uploadImagesDirectory));
		}

		File uploadedFile = new File(uploadImagesDirectory, name);
		try (BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(uploadedFile)); BufferedInputStream input=new BufferedInputStream(file.getInputStream())) {
			IOUtils.copy(input, output);
			output.flush();
		}

		return "upload-success";

	}
}


text:
package org.apache.camel.component.fhir;

import java.io.ByteArrayInputStream;
import java.nio.charset.Charset;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.hl7.HL7DataFormat;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.hl7.fhir.dstu3.model.Patient;
import org.junit.Test;

/**
 * This test demonstrates how to convert a HL7V2 patient to a FHIR dtsu3 Patient.
 */
public class Hl7v2PatientToFhirPatientIT extends CamelTestSupport {

    /*
    Segment Purpose                 FHIR Resource
    MSH     Message header          MessageHeader
    PID     Patient Identification  Patient
    PV1     Patient Visit           Not used in this example
    PV2     Patient Visit           – Additional data Not used in this example
    ORC     Common Order            Not used in this example
    OBR     Observation             Request Observation
    OBX     Observation             ObservationProvider

    See https://fhirblog.com/2014/10/05/mapping-hl7-version-2-to-fhir-messages for more information
    */
    private static final String HL7_MESSAGE = "MSH|^~\\&|Amalga HIS|BUM|New Tester|MS|20111121103141||ORU^R01|2847970-2"
            + "01111211031|P|2.4|||AL|NE|764|ASCII|||\r"
            + "PID||100005056|100005056||Dasher^Mary^\"\"^^\"\"|\"\"|19810813000000|F||CA|Street 1^\"\"^\"\"^\"\"^34000^SGP^^"
            + "\"\"~\"\"^\"\"^\"\"^\"\"^Danling Street 5th^THA^^\"\"||326-2275^PRN^PH^^66^675~476-5059^ORN^CP^^66^359~(123)"
            + "456-7890^ORN^FX^^66^222~^NET^X.400^a@a.a~^NET^X.400^dummy@hotmail.com|(123)456-7890^WPN^PH^^66|UNK|S|BUD||BP000111899|"
            + "D99999^\"\"||CA|Bangkok|||THA||THA|\"\"|N\r"
            + "PV1||OPD   ||||\"\"^\"\"^\"\"||||CNSLT|||||C|VIP|||6262618|PB1||||||||||||||||||||||||20101208134638\r"
            + "PV2|||^Unknown|\"\"^\"\"||||\"\"|\"\"|0||\"\"|||||||||||||||||||||||||||||HP1\r"
            + "ORC|NW|\"\"|BMC1102771601|\"\"|CM||^^^^^\"\"|||||||||\"\"^\"\"^^^\"\"\r"
            + "OBR|1|\"\"|BMC1102771601|\"\"^Brain (CT)||20111028124215||||||||||||||||||CTSCAN|F||^^^^^ROUTINE|||\"\"||||||\"\"|||||||||||^\"\"\r"
            + "OBX|1|FT|\"\"^Brain (CT)||++++ text of report goes here +++|||REQAT|||FINAL|||20111121103040||75929^Gosselin^Angelina";

    private FhirContext fhirContext = FhirContext.forDstu3();
    private IGenericClient client   = fhirContext.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu3");
    private HL7DataFormat hl7       = new HL7DataFormat();

    @Test
    public void testUnmarshalWithExplicitUTF16Charset() throws Exception {
        // Message with explicit encoding in MSH
        String charset = "ASCII";
        byte[] body = HL7_MESSAGE.getBytes(Charset.forName(charset));
        template.sendBodyAndHeader("direct:input", new ByteArrayInputStream(body), Exchange.CHARSET_NAME, charset);

        MockEndpoint mock = getMockEndpoint("mock:result");
        final MethodOutcome results = (MethodOutcome) mock.getExchanges().get(0).getIn().getBody();
        Patient patient = (Patient) results.getResource();
        assertNotNull(patient);
        assertEquals("Dasher", patient.getNameFirstRep().getFamily());
    }

    protected RouteBuilder createRouteBuilder() throws Exception {

        return new RouteBuilder() {
            public void configure() throws Exception {

                Processor patientProcessor = new PatientProcessor(client, getContext());
                from("direct:input")
                    .unmarshal(hl7)
                    .process(patientProcessor)
                    .to("mock:result");
            }
        };
    }
}


text:
class Level < ActiveRecord::Base
  belongs_to :scenario
  has_many :challenges

  validates_presence_of :description
  validates_presence_of :number
  validates_presence_of :scenario
end


text:
package com.daviancorp.android.loader;

import android.content.Context;
import android.database.Cursor;

import com.daviancorp.android.data.database.DataManager;

/*
 *  Refer to MonsterListPagerAdapter and MonsterListFragment on
 *  how to call this loader
 */
public class QuestListCursorLoader extends SQLiteCursorLoader {
	public static String HUB_CARAVAN = "Caravan";
	public static String HUB_GUILD = "Guild";
	public static String HUB_EVENT = "Event";

	private String hub; 	// "Village", "Port", or "DLC"
	private String stars; 	// "1", "2", "3", "4", "5", "6", "7", "8", or
							// "9" (Only use 9 if hub = "Port")

	public QuestListCursorLoader(Context context, String hub, String stars) {
		super(context);
		this.hub = hub;
		this.stars = stars;
	}

	@Override
	protected Cursor loadCursor() {
		if (hub == null && stars == null) {
			// Query the list of all quests
			return DataManager.get(getContext()).queryQuests();
		} else if (stars == null) {
			// Query the list of quests based on hub
			return DataManager.get(getContext()).queryQuestHub(hub);
		} else {
			// Query the list of quests based on hub and stars
			return DataManager.get(getContext()).queryQuestHubStar(hub, stars);
		}
	}
}


text:
A validator for the
[AMP HTML format](https://github.com/ampproject/amphtml/blob/main/README.md).

## Validating a Page

If you just want to validate a page, please see
[our documentation over at amp.dev](https://amp.dev/documentation/guides-and-tutorials/learn/validation-workflow/validate_amp).

### Chrome Extension

Please see [js/chromeextension/README.md](https://github.com/ampproject/amphtml/blob/main/validator/js/chromeextension/README.md).

### Visual Studio Code Extension

An extension for Visual Studio Code
[VSCode marketplace](https://marketplace.visualstudio.com/items?itemName=amphtml.amphtml-validator)

### Command Line Tool and Node.js API

Please see [js/nodejs/README.md](https://github.com/ampproject/amphtml/blob/main/validator/js/nodejs/README.md).

### Web UI

Please see [js/webui/README.md](https://github.com/ampproject/amphtml/blob/main/validator/js/webui/README.md).

### JSON

The validator rules are exported in the JSON format and hosted on: `https://cdn.ampproject.org/v0/validator.json`

The JSON rules are provided on best-effort basis and it's not recommended to
rely on them in a production environment.

## Building a Custom Validator

This is only useful development - e.g. when making changes to
`cpp/engine/validator.h`.

### Development Prerequisites

1. Start an interactive docker container. Note that you will be the `root` user inside the docker container.
    ```bash
    docker run -it -u root cimg/openjdk:17.0-node bash
    ```
1. Run following commands in the container.
    ```bash
    apt update
    apt install -y python sudo
    git clone https://github.com/ampproject/amphtml.git
    cd amphtml
    npm install
    npm run postinstall
    .circleci/install_validator_dependencies.sh
    ```

### Building Validator Engine

In `amphtml/validator` folder, run

```bash
bazel build --cxxopt='-Wno-error=return-type' \
            --cxxopt='-Wno-error=unused-but-set-variable' \
            --cxxopt='-Wno-error=unused-variable' \
            cpp/engine/wasm:validator_js_bin
```

This creates `bazel-bin/cpp/engine/wasm/validator_js_bin.js`, which is
equivalent to the validator deployed at `cdn.ampproject.org`.

You may now use the `--validator_js` command line flag to
[amphtml-validator](https://amp.dev/documentation/guides-and-tutorials/learn/validation-workflow/validate_amp#command-line-tool) to use this validator.

### Reproducing Validator Tests of Circle CI workflow

1. In `amphtml` folder, run

    ```bash
    amp validator-cpp && echo SUCCESS || echo FAIL
    ```

1. To see more information of the tests
    ```bash
    sed -i 's/--test_output=errors//' build-system/tasks/validator.js
    sed -i 's/--ui_event_filters=INFO//' build-system/tasks/validator.js
    ```
    Then re-run `amp validator-cpp && echo SUCCESS || echo FAIL`.


text:
[![CodeFactor](https://www.codefactor.io/repository/github/ssbug696/c-string-helper/badge)](https://www.codefactor.io/repository/github/ssbug696/c-string-helper)

# Example

### Init
```
  string str = "This text is a bit strange! Yeah!   ";
  string sep = "!";
  string temp = "?!";
  StringHelper ss(str);
```

#### Trim (remove backspaces from left and right border)
  ```
  ss.lr_trim();
  > Output: before trim 38 symbols length
  > Output: This text is a bit strange! Yeah!
  > Output: after trim 35 symbols length. Left and right backspaces is removed
```
#### Inject substring
  ```
  string sset = " Some message: ";
  ss.set(sset, 0);

  > Output: Some message: 1This text is a bit strange! Yeah!2
```
#### Find and wrap sub-string
  ```
  ss.wrap("message", "<<", ">>", 0, 0);

  > Output: Some <<<message>>>: 1This text is a bit strange! Yeah!2
```
#### Replace which substring and reverse(optional)
  ```
  ss.replace(temp, sep, 0, 0)->reverse(); // can do ss.replace(temp, sep, 0, 0)

  > Output: 2!haeY !egnarts tib a si txet sihT1 :>>egassem<< emoS
```
#### Reverse string(full reverse with some sort of filter function for some symbols), step 1
  ```
  ss.reverse(checkSimbols);

  > Output: s!haeY !1gnarts tib a si txet sihTe :>>ega2sem<< emoS
```
#### Simple reverse, step 2
  ```
  ss.reverse();

  > Output: Some <<mes2age>>: eThis text is a bit strang1! Yeah!s
```


text:
#include <aws/comprehend/model/PiiOutputDataConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace Comprehend
{
namespace Model
{

PiiOutputDataConfig::PiiOutputDataConfig() :
    m_s3UriHasBeenSet(false),
    m_kmsKeyIdHasBeenSet(false)
{
}

PiiOutputDataConfig::PiiOutputDataConfig(JsonView jsonValue) :
    m_s3UriHasBeenSet(false),
    m_kmsKeyIdHasBeenSet(false)
{
  *this = jsonValue;
}

PiiOutputDataConfig& PiiOutputDataConfig::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("S3Uri"))
  {
    m_s3Uri = jsonValue.GetString("S3Uri");

    m_s3UriHasBeenSet = true;
  }

  if(jsonValue.ValueExists("KmsKeyId"))
  {
    m_kmsKeyId = jsonValue.GetString("KmsKeyId");

    m_kmsKeyIdHasBeenSet = true;
  }

  return *this;
}

JsonValue PiiOutputDataConfig::Jsonize() const
{
  JsonValue payload;

  if(m_s3UriHasBeenSet)
  {
   payload.WithString("S3Uri", m_s3Uri);

  }

  if(m_kmsKeyIdHasBeenSet)
  {
   payload.WithString("KmsKeyId", m_kmsKeyId);

  }

  return payload;
}

} // namespace Model
} // namespace Comprehend
} // namespace Aws


text:
The *Pull to Refresh* widget implements the *Pull to Refresh* design pattern for the [Alloy](http://docs.appcelerator.com/titanium/latest/#!/guide/Alloy_Quick_Start) MVC framework for [Titanium](http://www.appcelerator.com/platform) by [Appcelerator](http://www.appcelerator.com). A Titanium Classic implementation can be found in the [documentation](http://docs.appcelerator.com/titanium/latest/#!/guide/TableView_Refresh_with_headerPullView).

Also take a look at my [Infinite Scroll](https://github.com/FokkeZB/nl.fokkezb.infiniteScroll) widget.

## Overview
The widgets adds a *HeaderPullView* to a *TableView* that is shown when the users drags the view down when it is already scrolled to the top. An event is triggered so that the implementing controller can reload data.

![Extend edges](https://raw.github.com/FokkeZB/nl.fokkezb.pullToRefresh/master/docs/extend.png)

![Pull](https://raw.github.com/FokkeZB/nl.fokkezb.pullToRefresh/master/docs/pull.png)

![Release](https://raw.github.com/FokkeZB/nl.fokkezb.pullToRefresh/master/docs/release.png)

![Updating](https://raw.github.com/FokkeZB/nl.fokkezb.pullToRefresh/master/docs/updating.png)

## Features
* Add the widget to your *TableView* using just one line of code.
* Override all styling via your app's `app.tss`.
* Manually trigger the widget from your controller.
* Compatible with Android and other OS by using *HeaderView*

## Future work
* Support for *ListView*s.

## Quick Start
* Download the latest [release](https://github.com/FokkeZB/nl.fokkezb.pullToRefresh/releases).
* Unzip the file to `app/widgets/nl.fokkezb.pullToRefresh`.
* Add the widget as a dependency to your `app/config.json` file:

	```javascript
		"dependencies": {
			"nl.fokkezb.pullToRefresh":"1.5"
		}
	```

* Add the widget to your *TableView*:

	```xml
	<Alloy>
	  <Collection src="myCollection" />
	  <TableView dataCollection="myCollection">
	    <Widget id="ptr" src="nl.fokkezb.pullToRefresh" onRelease="myLoader" />
	    <TableViewRow title="{myColumn}" />
	  </TableView>
	</Alloy>
	```

* In the callback set via `myLoader` make sure you call `e.hide()` to hide the *headerPullView* when it is done loading. For example:

	```javascript
	function myLoader(e) {
		myCollection.fetch({
			success: e.hide,
			error: e.hide
		});
	}
	```

## Styling
The widget can be fully styled without touching the widget source. Use the following ID's in your app's `app.tss` to override the default style:

| ID | Description |
| --------- | ------- |
| `#ptr` | The background of the *HeaderPullView* |
| `#ptrCenter` | Centers the contents, you probably only want to change `bottom` in conjuction with using the `height` parameter mentioned further on. |
| `#ptrArrow` | The arrow image. Use `WPATH('/images/white.png')` to use the white instead of the default grey image, or roll your own. |
| `#ptrIndicator` | The *ActivityIndicator* showing during load |
| `#ptrText` | The text |
| `#ptrLine` | The line separating the widget and the table |

## Internationalization
The widget texts can be overridden and translated via your `strings.xml` file, using the following names:

| Name        | Default |
| ----------- | ------- |
| msgPull     | Pull to refresh... |
| msgRelease  | Release to refresh... |
| msgUpdating | Updating... |

## Options
There are no required options to pass via TSS properties or XML attributes, apart from the `onRelease` attribute to bind your callback to the release-event.

| Parameter | Type | Default |
| --------- | ---- | ----------- |
| msgPull | `string` | Overrides `Pull to refresh...` |
| msgRelease | `string`  | Overrides `Release to refresh...` |
| msgUpdating | `string` | Overrides `Updating...` |
| top **(iOS)**| `number` | If the top of the table is covered by another view - e.g. when using `Ti.UI.Window.extendEges` - set this to the height of that view (`60` for both status and navigation bar) |

## Methods
You can also manually show and hide the view or trigger the complete cycle of the widget. You could use this for the first load when your window opens.

| Function   | Parameters | Usage |
| ---------- | ---------- | ----- |
| setOptions | `object`   | Set any of the options |
| refresh    |            | Manually trigger pull + release |
| show       |            | Show the *headerPullView* |
| hide       |            | Hide the *headerPullView* |
| dettach    |            | Remove the *headerPullView* |
| attach     |            | Re-add the *headerPullView* after removal |

## Changelog
* 1.5
  * New `top` option for compatibility with `Ti.UI.Window.extendEdges` on iOS7
  * Arrow now properly hidden on Android, using opacity
  * Default style updated to match Twitter on iOS7
* 1.4
  * Now compatible with Android and other OS!
* 1.3
  * From now on declared in the XML view instead of the controller!
  * Splitted `init` into `setOptions` and `attach`
  * Renamed `remove` to `dettach`
  * Renamed `trigger` to `refresh` to not interfere with BackBone
* 1.2
  * Retina arrow images, including new (default) grey one
  * Removed text showing last update for more clear view
  * Easier styling
* 1.1
  * Exposed new API functions to `show`/`hide` the view, set the `date` and `trigger` the widget manually.
  * Renamed `load` parameter to `loader` in line with upcomming widgets.
* 1.0
  * Initial version

## License

<pre>
Copyright 2013 Fokke Zandbergen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>


text:
package main

import (
    "sync"
)

// JobQueue is our internal job queue
var JobQueue = queue{
    list: make(chan Doer, 100),
    wg: &sync.WaitGroup{},
}

// Doer interface describes an object that can be considered a unit of work
type Doer interface {
    Do() error
}

// PkgInstallJob handles the installation of a package
type PkgInstallJob struct {
    pkg *Pkg
}

// PkgDiscoverJob handles the discovery of dependencies for a package
type PkgDiscoverJob struct {
    pkg *Pkg
}

// Queue is our internal Doer list manager
type queue struct {
    list chan Doer
    wg *sync.WaitGroup
    stop chan bool
}

func (q *queue) Add(j Doer) {
    q.list <- j
}

func (q *queue) Start() {
    go func() {
        for {
    		select {
    		case <-q.stop:
                Log("Stopping queue execution")
    			return
    		case j := <- q.list:
    			j.Do()
                q.wg.Done()
    			return
    		}
    	}
    }()
}

func (q *queue) Stop() {
    q.stop <- true
}

func (q *queue) Wait() {
    q.wg.Wait()
}


text:
package io.fabric8.kubernetes.client.mock;

import io.fabric8.kubernetes.api.model.scheduling.PriorityClass;
import io.fabric8.kubernetes.api.model.scheduling.PriorityClassBuilder;
import io.fabric8.kubernetes.api.model.scheduling.PriorityClassList;
import io.fabric8.kubernetes.api.model.scheduling.PriorityClassListBuilder;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientException;
import io.fabric8.kubernetes.client.server.mock.KubernetesServer;
import org.junit.Rule;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public class PriorityClassTest {
  @Rule
  public KubernetesServer server = new KubernetesServer();

  @Test
  public void testList() {
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses").andReturn(200, new PriorityClassListBuilder()
      .addNewItem().and()
      .addNewItem().and()
      .addNewItem()
      .and().build()).once();

    KubernetesClient client = server.getClient();

    PriorityClassList priorityClassList = client.scheduling().priorityClass().list();
    assertNotNull(priorityClassList);
    assertEquals(3, priorityClassList.getItems().size());
  }

  @Test
  public void testListWithLables() {
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses?labelSelector=" + toUrlEncoded("key1=value1,key2=value2,key3=value3")).andReturn(200, new PriorityClassListBuilder().build()).always();
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses?labelSelector=" + toUrlEncoded("key1=value1,key2=value2")).andReturn(200, new PriorityClassListBuilder()
      .addNewItem().and()
      .addNewItem().and()
      .addNewItem().and()
      .build()).once();

    KubernetesClient client = server.getClient();

    PriorityClassList priorityClassList = client.scheduling().priorityClass()
      .withLabel("key1", "value1")
      .withLabel("key2", "value2")
      .list();
    assertEquals(3, priorityClassList.getItems().size());

    priorityClassList = client.scheduling().priorityClass()
      .withLabel("key1", "value1")
      .withLabel("key2","value2")
      .withLabel("key3","value3")
      .list();
    assertEquals(0, priorityClassList.getItems().size());
  }

  @Test
  public void testGet() {
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass1").andReturn(200, new PriorityClassBuilder().build()).once();
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass2").andReturn(200, new PriorityClassBuilder().build()).once();

    KubernetesClient client = server.getClient();

    PriorityClass priorityClass1 = client.scheduling().priorityClass().withName("priorityclass1").get();
    assertNotNull(priorityClass1);

    priorityClass1 = client.scheduling().priorityClass().withName("priorityclass2").get();
    assertNotNull(priorityClass1);

  }

  @Test
  public void testDelete() {
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass1").andReturn(200, new PriorityClassBuilder()
      .withNewMetadata().withName("high-priority").endMetadata()
      .withValue(new Integer(100000))
      .withGlobalDefault(false)
      .withDescription("This priority class should be used for XYZ service pods only.")
      .build()).once();

    KubernetesClient client = server.getClient();

    Boolean deleted = client.scheduling().priorityClass().withName("priorityclass1").delete();
    assertNotNull(deleted);
    assertTrue(deleted);
  }

  @Test
  public void testDeleteMulti() {
    PriorityClass priorityClass1 = new PriorityClassBuilder()
      .withNewMetadata().withName("high-priority").endMetadata()
      .withValue(new Integer(100000))
      .withGlobalDefault(false)
      .withDescription("This priority class should be used for XYZ service pods only.")
      .build();
    PriorityClass priorityClass2 = new PriorityClassBuilder()
      .withNewMetadata().withName("super-high-priority").endMetadata()
      .withValue(new Integer(1000000))
      .withGlobalDefault(false)
      .withDescription("This priority class should be used for XYZ service pods only.")
      .build();

    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass1").andReturn(200, priorityClass1).once();
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass1").andReturn(200, new PriorityClassBuilder(priorityClass1)
      .editMetadata().addToAnnotations("foo", "bar").endMetadata().build()).times(5);
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass2").andReturn(200, priorityClass2).once();
    server.expect().withPath("/apis/scheduling.k8s.io/v1beta1/priorityclasses/priorityclass2").andReturn(200, new PriorityClassBuilder(priorityClass2)
      .editMetadata().addToAnnotations("foo", "bar").endMetadata().build()).times(5);

    KubernetesClient client = server.getClient();

    Boolean deleted = client.scheduling().priorityClass().delete(priorityClass1, priorityClass2);
    assertNotNull(deleted);
  }

  @Test(expected = KubernetesClientException.class)
  public void testCreateWithNameMismatch() {
    PriorityClass priorityClass1 = new PriorityClassBuilder().withNewMetadata().withName("priorityclass1").and().build();
    KubernetesClient client = server.getClient();

    client.scheduling().priorityClass().withName("mypriorityclass1").create(priorityClass1);
  }

  @Test
  public void testLoadFromFile() {
    KubernetesClient client = server.getClient();
    assertNotNull(client.scheduling().priorityClass().load(getClass().getResourceAsStream("/test-priorityclass.yml")).get());
  }

  /**
   * Converts string to URL encoded string.
   * It's not a full blown converter, it serves just the purpose of this test.
   * @param str
   * @return
   */
  private static final String toUrlEncoded(String str) {
    return str.replaceAll("=", "%3D");
  }
}


text:
<?php

namespace PHPPdf\Core\ComplexAttribute;

use PHPPdf\Exception\InvalidArgumentException;

use PHPPdf\Core\Node\Page;
use PHPPdf\Core\UnitConverter;
use PHPPdf\Core\Document;
use PHPPdf\Core\Engine\GraphicsContext;
use PHPPdf\Util;
use PHPPdf\Core\Node\Node;

/**
 * Enhance node by drawing background
 *
 * @author Piotr Śliwa <peter.pl7@gmail.com>
 */
class Background extends ComplexAttribute
{
    const REPEAT_NONE = 0;
    const REPEAT_X = 1;
    const REPEAT_Y = 2;
    const REPEAT_ALL = 3;

    const POSITION_LEFT = 'left';
    const POSITION_RIGHT = 'right';
    const POSITION_TOP = 'top';
    const POSITION_BOTTOM = 'bottom';
    const POSITION_CENTER = 'center';

    private $image = null;
    private $repeat;
    private $useRealDimension;
    private $imageWidth = null;
    private $imageHeight = null;
    private $positionX = null;
    private $positionY = null;

    public function __construct($color = null, $image = null, $repeat = self::REPEAT_NONE, $radius = null, $useRealDimension = false, $imageWidth = null, $imageHeight = null, $positionX = self::POSITION_LEFT, $positionY = self::POSITION_TOP)
    {
        parent::__construct($color, $radius);

        $this->image = $image;
        $this->setRepeat($repeat);
        $this->useRealDimension = Util::convertBooleanValue($useRealDimension);
        $this->setImageDimension($imageWidth, $imageHeight);
        $this->setPosition($positionX, $positionY);
    }

    private function setPosition($positionX, $positionY)
    {
        $allowedXPositions = array(self::POSITION_LEFT, self::POSITION_CENTER, self::POSITION_RIGHT);
        if(!in_array($positionX, $allowedXPositions) && !$this->isNumeric($positionX))
        {
            throw new InvalidArgumentException(sprintf('Invalid x position "%s" for background, allowed values: %s or numeric value.', $positionX, implode(', ', $allowedXPositions)));
        }

        $allowedYPositions = array(self::POSITION_TOP, self::POSITION_CENTER, self::POSITION_BOTTOM);
        if(!in_array($positionY, $allowedYPositions) && !$this->isNumeric($positionY))
        {
            throw new InvalidArgumentException(sprintf('Invalid y position "%s" for background, allowed values: %s or numeric value.', $positionY, implode(', ', $allowedYPositions)));
        }

        $this->positionX = $positionX;
        $this->positionY = $positionY;
    }

    private function isNumeric($value)
    {
        if(is_numeric($value))
        {
            return true;
        }

        $numericValue = (string) (double) $value;

        return $numericValue === substr($value, 0, strlen($numericValue));
    }

    private function setRepeat($repeat)
    {
        if(!is_numeric($repeat))
        {
            $repeat = $this->getConstantValue('REPEAT', $repeat);
        }

        $this->repeat = $repeat;
    }

    public function getRepeat()
    {
        return $this->repeat;
    }

    private function setImageDimension($width, $height)
    {
        if($this->image === null)
        {
            return;
        }

        $this->imageWidth = $width;
        $this->imageHeight = $height;
    }

    public function getImage()
    {
        return $this->image;
    }

    protected function doEnhance($graphicsContext, Node $node, Document $document)
    {
        if($node->getShape() === Node::SHAPE_RECTANGLE)
        {
            $this->drawRectangleBackground($graphicsContext, $node, $document);
        }
        elseif($node->getShape() === Node::SHAPE_ELLIPSE)
        {
            $this->drawCircleBackground($graphicsContext, $node, $document);
        }
    }

    private function drawRectangleBackground(GraphicsContext $graphicsContext, Node $node, Document $document)
    {
        if($this->getColor() !== null)
        {
            $boundary = $this->getBoundary($node);
            if($this->getRadius() !== null)
            {
                $firstPoint = $boundary->getPoint(3);
                $diagonalPoint = $boundary->getPoint(1);

                $this->drawRoundedBoundary($graphicsContext, $firstPoint->getX(), $firstPoint->getY(), $diagonalPoint->getX(), $diagonalPoint->getY(), GraphicsContext::SHAPE_DRAW_FILL_AND_STROKE);
            }
            else
            {
                $this->drawBoundary($graphicsContext, $boundary, GraphicsContext::SHAPE_DRAW_FILL);
            }
        }

        $image = $this->getImage();
        $image = $image ? $document->createImage($image) : null;

        if($image !== null)
        {
            $positionTranslation = $node->getPositionTranslation();
            list($x, $y) = $this->getFirstPoint($node)->translate($positionTranslation->getX(), $positionTranslation->getY())->toArray();
            list($endX, $endY) = $this->getDiagonalPoint($node)->translate($positionTranslation->getX(), $positionTranslation->getY())->toArray();

            list($width, $height) = $this->getImageDimension($document, $image, $node);

            $graphicsContext->saveGS();
            $graphicsContext->clipRectangle($x, $y, $x+$this->getWidth($node), $y-$this->getHeight($node));

            $repeatX = $this->repeat & self::REPEAT_X;
            $repeatY = $this->repeat & self::REPEAT_Y;

            $currentX = $this->getXCoord($node, $width, $x, $document);
            $currentY = $y = $this->getYCoord($node, $height, $y, $document);

            do
            {
                $currentY = $y;
                do
                {
                    $graphicsContext->drawImage($image, $currentX, $currentY-$height, $currentX+$width, $currentY);
                    $currentY -= $height;
                }
                while($repeatY && $currentY > $endY);

                $currentX += $width;
            }
            while($repeatX && $currentX < $endX);

            $graphicsContext->restoreGS();
        }
    }

    private function getXCoord(Node $node, $width, $x, UnitConverter $converter)
    {
        switch($this->positionX)
        {
            case self::POSITION_RIGHT:
                $realWidth = $node->getDiagonalPoint()->getX() - $node->getFirstPoint()->getX();
                return ($x + $realWidth) - $width;
            case self::POSITION_CENTER:
                $realWidth = $node->getDiagonalPoint()->getX() - $node->getFirstPoint()->getX();
                return ($x + $realWidth/2) - $width/2;
            case self::POSITION_LEFT:
                return $x;
            default:
                return $x + $converter->convertUnit($converter->convertPercentageValue($this->positionX, $node->getWidth()));
        }
    }

    private function getYCoord(Node $node, $height, $y, UnitConverter $converter)
    {
        switch($this->positionY)
        {
            case self::POSITION_BOTTOM:
                $realHeight = $node->getFirstPoint()->getY() - $node->getDiagonalPoint()->getY();
                return ($y - $realHeight) + $height;
            case self::POSITION_CENTER:
                $realHeight = $node->getFirstPoint()->getY() - $node->getDiagonalPoint()->getY();
                return ($y - $realHeight/2) + $height/2;
            case self::POSITION_TOP:
                return $y;
            default:
                return $y - $converter->convertUnit($converter->convertPercentageValue($this->positionY, $node->getHeight()));
        }
    }

    private function getImageDimension(UnitConverter $converter, $image, Node $node)
    {
        $width = $converter->convertUnit($this->imageWidth);
        $height = $converter->convertUnit($this->imageHeight);

        if(!$width && !$height)
        {
            return array($image->getOriginalWidth(), $image->getOriginalHeight());
        }

        list($width, $height) = $this->convertPercentageDimension($converter, $node, $width, $height);

        $ratio = $image->getOriginalWidth() / $image->getOriginalHeight();

        list($width, $height) = Util::calculateDependantSizes($width, $height, $ratio);

        return array($width, $height);
    }

    private function convertPercentageDimension(UnitConverter $converter, Node $node, $width, $height)
    {
        $width = $converter->convertPercentageValue($width, $this->getWidth($node));
        $height = $converter->convertPercentageValue($height, $this->getHeight($node));

        return array($width, $height);
    }

    private function getFirstPoint(Node $node)
    {
        if($this->useRealDimension)
        {
            return $node->getRealFirstPoint();
        }

        return $node->getFirstPoint();
    }

    private function getDiagonalPoint(Node $node)
    {
        if($this->useRealDimension)
        {
            return $node->getRealDiagonalPoint();
        }

        return $node->getDiagonalPoint();
    }

    private function getBoundary(Node $node)
    {
        $boundary = $this->useRealDimension ? $node->getRealBoundary() : $node->getBoundary();

        return $this->getTranslationAwareBoundary($node, $boundary);
    }

    private function getWidth(Node $node)
    {
        if($this->useRealDimension)
        {
            return $node->getRealWidth();
        }

        return $node->getWidth();
    }

    private function getHeight(Node $node)
    {
        if($this->useRealDimension)
        {
            return $node->getRealHeight();
        }

        return $node->getHeight();
    }

    private function drawCircleBackground(GraphicsContext $gc, Node $node, Document $document)
    {
        $point = $node->getMiddlePoint();

        $translation = $node->getPositionTranslation();

        if(!$translation->isZero())
        {
            $point = $point->translate($translation->getX(), $translation->getY());
        }

        $this->drawCircle($gc, $node->getAttribute('radius'), $point->getX(), $point->getY(), GraphicsContext::SHAPE_DRAW_FILL);
    }
}


text:
<title>Delhi Metro</title>
<link rel="stylesheet" type="text/css" href="css\metro.css">
<link rel="stylesheet" href="css\bootstrap.min.css">

delhi dekho!

Home

Things to do

Accomodation

Move Around

Contact

Here are nine interesting facts about Delhi Metro that will amaze you:

The female voice of Delhi Metro, who speaks in English, is Ms. Rini Simon Khanna  and male voice of Delhi Metro, who speaks in Hindi, is Mr. Shammi Narang

The  few of the famous movies ever to be shot in the Delhi metro are Bewafaa, Paa, Dev D, Love Aaj Kal and Delhi 6 too have scenes from Delhi metro

The escalators at all the Delhi metro stations are provided with unique 'sari guard' feature that sidetracks loose clothing such as saris of ladies from getting trapped in the escalator

 Most of the metro station in the blue line of Delhi metro  is inducted into rain water harvesting as an environment measure taken up by DMRC

The Delhi Metro Platform is constructed in such a way that blind people can easily walk on it without any ones assistance. The yellow tiles with horizontal lines serves as a path for the blind people and leads directly to the lift

The one which  people consider power cuts are attributed by DMRC  as power shifts! The momentary power lapses which causes the lights and AC to  go off at certain stations are actually 'power shifts'

A lot of metro stations provide bicycles on rent for as meagre as 10  rupees for 4 hours with a valid ID proof

    All stations have ramps built right at the entrance to help wheelchair-bound people to  move around the station

The Delhi Metro network consists of a total of 200 trains covering a total distance of 69,000 kilo meters every day.
So next time you travel, your journey will definitely be happier.

So next time you travel, your journey will definitely be happier.


text:
'use strict';

/**
 * @ngdoc service
 * @name myNewProjectApp.myService
 * @description
 * # myService
 * Service in the myNewProjectApp.
 */
angular.module('myNewProjectApp')
  .service('myService', function ($resource) {
    this.test = function () {
      return $resource("http://localhost:8080/six/rest/partition-map/:partition")
    };
  });


text:
#pragma once
#ifndef PRIG_STUBBERCOMMANDFWD_H
#define PRIG_STUBBERCOMMANDFWD_H

namespace prig {

    class StubberCommand;

}   // namespace prig {

#endif  // PRIG_STUBBERCOMMANDFWD_H


text:
var Buffer = require('buffer').Buffer;
var Buffers = require('../node_modules/bitcore-p2p/lib/buffers');
var EventEmitter = require('events').EventEmitter;
var bitcore = require('bitcore-lib');
var Networks = bitcore.Networks;
var Messages = require('../node_modules/bitcore-p2p/lib/messages');
var $ = bitcore.util.preconditions;
var util = require('util');

var peers = {};

function onReceive (info) {
    if (info.socketId in peers) {
        peers[info.socketId]._onReceive(info.data);
    }
};

function onReceiveError (info) {
    if (info.socketId in peers) {
        peers[info.socketId]._onError(info.resultCode);
    }
};

cordova.require('cordova/channel').onCordovaReady.subscribe(function() {
    if (typeof chrome === 'undefined') {
        throw new ReferenceError("TCP client sockets are missing.");
    }
    chrome.sockets.tcp.onReceive.addListener(onReceive);
    chrome.sockets.tcp.onReceiveError.addListener(onReceiveError);
});

function Peer (options) {
    var options = options || {};

    if (!(this instanceof Peer)) {
        return new Peer(options);
    }

    this.status = Peer.STATUS.DISCONNECTED;
    this.host = options.host || 'localhost';
    this.port = options.port;

    this.network = Networks.get(options.network) || Networks.defaultNetwork;

    if (!this.port) {
        this.port = this.network.port;
    }

    this.messages = new Messages({
        network: this.network,
        Block: bitcore.Block,
        Transaction: bitcore.Transaction
    });

    this.dataBuffer = new Buffers();

    this.version = 0;
    this.bestHeight = 0;
    this.subversion = null;
    this.relay = options.relay === false ? false : true;

    this.versionSent = false;

    // set message handlers
    var self = this;
    this.on('verack', function() {
        self.status = Peer.STATUS.READY;
        self.emit('ready');
    });

    this.on('version', function(message) {
        self.version = message.version;
        self.subversion = message.subversion;
        self.bestHeight = message.startHeight;

        var verackResponse = self.messages.VerAck();
        self.sendMessage(verackResponse);

        if(!self.versionSent) {
            self._sendVersion();
        }
    });

    this.on('ping', function(message) {
        self._sendPong(message.nonce);
    });

    return this;
};

util.inherits(Peer, EventEmitter);

Peer.MAX_RECEIVE_BUFFER = 10000000;
Peer.STATUS = {
    DISCONNECTED: 'disconnected',
    CONNECTING: 'connecting',
    CONNECTED: 'connected',
    READY: 'ready'
};

Peer.prototype._onReceive = function(data) {
    var buffer = new Buffer(new Uint8Array(data));
    this.dataBuffer.push(buffer);
    if (this.dataBuffer.length > Peer.MAX_RECEIVE_BUFFER) {
        return this.disconnect();
    }
    this._readMessage();
};

/**
 * Init the connection with the remote peer.
 * @returns {Peer} The same peer instance.
 */
Peer.prototype.connect = function() {
    var self = this;

    chrome.sockets.tcp.create(function(createInfo) {
        self.status = Peer.STATUS.CONNECTING;
        self.socketId = createInfo.socketId;
        peers[createInfo.socketId] = self;

        chrome.sockets.tcp.connect(self.socketId, self.host, self.port, function(result) {
            if (result === 0) {
                self.status = Peer.STATUS.CONNECTED;
                self.emit('connect');
                self._sendVersion();
            }
        });
    });

    return this;
};

Peer.prototype._onError = function(e) {
    this.emit('error', e);
    if (this.status !== Peer.STATUS.DISCONNECTED) {
        this.disconnect();
    }
};

/**
 * Disconnects the remote connection.
 * @returns {Peer} The same peer instance.
 */
Peer.prototype.disconnect = function() {
    var self = this;

    chrome.sockets.tcp.disconnect(self.socketId, function () {
        chrome.sockets.tcp.close(self.socketId);
        self.status = Peer.STATUS.DISCONNECTED;
        self.emit('disconnect');
    });

    return this;
};

/**
 * Send a Message to the remote peer.
 * @param {Message} message - A message instance
 */
Peer.prototype.sendMessage = function(message) {
    chrome.sockets.tcp.send(this.socketId, message.toBuffer().buffer);
};

/**
 * Internal function that sends VERSION message to the remote peer.
 */
Peer.prototype._sendVersion = function() {
    var message = this.messages.Version({relay: this.relay});
    this.sendMessage(message);
    this.versionSent = true;
};

/**
 * Send a PONG message to the remote peer.
 */
Peer.prototype._sendPong = function(nonce) {
    var message = this.messages.Pong(nonce);
    this.sendMessage(message);
};

/**
 * Internal function that tries to read a message from the data buffer
 */
Peer.prototype._readMessage = function() {
    var message = this.messages.parseBuffer(this.dataBuffer);
    if (message) {
        this.emit(message.command, message);
        this._readMessage();
    }
};

// currently only to fix tests
Peer.prototype._getSocket = function() {
    if (this.proxy) {
        var Client = require('socks5-client');
        return new Client();
    } else {
        var net = require('net');
        return new net.Socket();
    }
};

// currently only to fix tests
Peer.prototype.setProxy = function(host,port) {
    this.proxy = {
        'host' : host ,
        'port' : port
    };
    return this;
};

module.exports = Peer;


text:
+++
# Slider widget.
widget = "slider"  # Do not modify this line!
active = false  # Activate this widget? true/false

# Order that this section will appear in.
weight = 1

# Slide interval.
# Use `false` to disable animation or enter a time in ms, e.g. `5000` (5s).
interval = false

# Minimum slide height.
# Specify a height to ensure a consistent height for each slide.
height = "300px"

# Slides.
# Duplicate an `[[item]]` block to add more slides.
[[item]]
  title = "Hello"
  content = "I am center aligned :smile:"
  align = "center"  # Choose `center`, `left`, or `right`.

  # Overlay a color or image (optional).
  #   Deactivate an option by commenting out the line, prefixing it with `#`.
  overlay_color = "#666"  # An HTML color value.
  overlay_img = "headers/bubbles-wide.jpg"  # Image path relative to your `static/img/` folder.
  overlay_filter = 0.5  # Darken the image. Value in range 0-1.

  # Call to action button (optional).
  #   Activate the button by specifying a URL and button label below.
  #   Deactivate by commenting out parameters, prefixing lines with `#`.
  cta_label = "Get Academic"
  cta_url = "https://sourcethemes.com/academic/"
  cta_icon_pack = "fas"
  cta_icon = "graduation-cap"

[[item]]
  title = "Left"
  content = "I am left aligned :smile:"
  align = "left"

  overlay_color = "#555"  # An HTML color value.
  overlay_img = ""  # Image path relative to your `static/img/` folder.
  overlay_filter = 0.5  # Darken the image. Value in range 0-1.

[[item]]
  title = "Right"
  content = "I am right aligned :smile:"
  align = "right"

  overlay_color = "#333"  # An HTML color value.
  overlay_img = ""  # Image path relative to your `static/img/` folder.
  overlay_filter = 0.5  # Darken the image. Value in range 0-1.
+++


text:
/*--------------------------- Package Declaration ----------------------------*/

package com.github.jessemull.microflex.doubleflex.io;

/*------------------------------- Dependencies -------------------------------*/

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.github.jessemull.microflex.doubleflex.plate.WellDouble;

/**
 * This is a wrapper class used to marshal/unmarshal an XML encoded well in a result.
 *
 * @author Jesse L. Mull
 * @update Updated Oct 17, 2016
 * @address http://www.jessemull.com
 * @email hello@jessemull.com
 */
@XmlRootElement(name="well")
@XmlType (propOrder={"index", "value"})
public class ResultWellXMLDouble {

	/*---------------------------- Private Fields ----------------------------*/

    private String index;    // The well index
    private double value;    // The value

    /*------------------------------ Constructors ----------------------------*/

    public ResultWellXMLDouble(){}

    /**
     * Creates a simple XML well from an index and value.
     * @param    WellDouble    the well object
     */
    public ResultWellXMLDouble(String index, Double value) {
        this.index = index;
        this.value = value;
    }

    /*-------------------------- Getters and setters -------------------------*/

    /**
     * Sets the index.
     * @param    String    the new index
     */
    @XmlElement
    public void setIndex(String newIndex) {
        this.index = newIndex;
    }

    /**
     * Sets the value.
     * @param    double    the new value
     */
    @XmlElement
    public void setValue(double value) {
        this.value = value;
    }

    /**
     * Returns the index.
     * @return    the index
     */
    public String getIndex() {
        return this.index;
    }

    /**
     * Returns the value.
     * @return    the value
     */
    public double getValue() {
        return this.value;
    }

    /**
     * Returns a WellDouble object.
     * @return    the well
     */
    public WellDouble toWellObject() {

    	WellDouble well = new WellDouble(this.index);
    	well.add(this.value);

    	return well;

    }
}