/*
 * Copyright 2017 The Android Open Source Project
 *
 * 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.
 */

#include <cassert>

#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>

#include "oboe/AudioStreamBuilder.h"
#include "AudioInputStreamOpenSLES.h"
#include "AudioStreamOpenSLES.h"
#include "OpenSLESUtilities.h"

using namespace oboe;

static SLuint32 OpenSLES_convertInputPreset(InputPreset oboePreset) {
    SLuint32 openslPreset = SL_ANDROID_RECORDING_PRESET_NONE;
    switch(oboePreset) {
        case InputPreset::Generic:
            openslPreset =  SL_ANDROID_RECORDING_PRESET_GENERIC;
            break;
        case InputPreset::Camcorder:
            openslPreset =  SL_ANDROID_RECORDING_PRESET_CAMCORDER;
            break;
        case InputPreset::VoiceRecognition:
            openslPreset =  SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION;
            break;
        case InputPreset::VoiceCommunication:
            openslPreset =  SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;
            break;
        case InputPreset::Unprocessed:
            openslPreset =  SL_ANDROID_RECORDING_PRESET_UNPROCESSED;
            break;
        default:
            break;
    }
    return openslPreset;
}

AudioInputStreamOpenSLES::AudioInputStreamOpenSLES(const AudioStreamBuilder &builder)
        : AudioStreamOpenSLES(builder) {
}

AudioInputStreamOpenSLES::~AudioInputStreamOpenSLES() {
}

// Calculate masks specific to INPUT streams.
SLuint32 AudioInputStreamOpenSLES::channelCountToChannelMask(int channelCount) const {
    // Derived from internal sles_channel_in_mask_from_count(chanCount);
    // in "frameworks/wilhelm/src/android/channels.cpp".
    // Yes, it seems strange to use SPEAKER constants to describe inputs.
    // But that is how OpenSL ES does it internally.
    switch (channelCount) {
        case 1:
            return SL_SPEAKER_FRONT_LEFT;
        case 2:
            return SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;
        default:
            return channelCountToChannelMaskDefault(channelCount);
    }
}

Result AudioInputStreamOpenSLES::open() {
    logUnsupportedAttributes();

    SLAndroidConfigurationItf configItf = nullptr;

    if (getSdkVersion() < __ANDROID_API_M__ && mFormat == AudioFormat::Float){
        // TODO: Allow floating point format on API <23 using float->int16 converter
        return Result::ErrorInvalidFormat;
    }

    // If audio format is unspecified then choose a suitable default.
    // API 23+: FLOAT
    // API <23: INT16
    if (mFormat == AudioFormat::Unspecified){
        mFormat = (getSdkVersion() < __ANDROID_API_M__) ?
                  AudioFormat::I16 : AudioFormat::Float;
    }

    Result oboeResult = AudioStreamOpenSLES::open();
    if (Result::OK != oboeResult) return oboeResult;

    SLuint32 bitsPerSample = static_cast<SLuint32>(getBytesPerSample() * kBitsPerByte);

    // configure audio sink
    SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
            SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE,    // locatorType
            static_cast<SLuint32>(kBufferQueueLength)};   // numBuffers

    // Define the audio data format.
    SLDataFormat_PCM format_pcm = {
            SL_DATAFORMAT_PCM,       // formatType
            static_cast<SLuint32>(mChannelCount),           // numChannels
            static_cast<SLuint32>(mSampleRate * kMillisPerSecond), // milliSamplesPerSec
            bitsPerSample,                      // bitsPerSample
            bitsPerSample,                      // containerSize;
            channelCountToChannelMask(mChannelCount), // channelMask
            getDefaultByteOrder(),
    };

    SLDataSink audioSink = {&loc_bufq, &format_pcm};

    /**
     * API 23 (Marshmallow) introduced support for floating-point data representation and an
     * extended data format type: SLAndroidDataFormat_PCM_EX for recording streams (playback streams
     * got this in API 21). If running on API 23+ use this newer format type, creating it from our
     * original format.
     */
    SLAndroidDataFormat_PCM_EX format_pcm_ex;
    if (getSdkVersion() >= __ANDROID_API_M__) {
        SLuint32 representation = OpenSLES_ConvertFormatToRepresentation(getFormat());
        // Fill in the format structure.
        format_pcm_ex = OpenSLES_createExtendedFormat(format_pcm, representation);
        // Use in place of the previous format.
        audioSink.pFormat = &format_pcm_ex;
    }

    // configure audio source
    SLDataLocator_IODevice loc_dev = {SL_DATALOCATOR_IODEVICE,
                                      SL_IODEVICE_AUDIOINPUT,
                                      SL_DEFAULTDEVICEID_AUDIOINPUT,
                                      NULL};
    SLDataSource audioSrc = {&loc_dev, NULL};

    SLresult result = EngineOpenSLES::getInstance().createAudioRecorder(&mObjectInterface,
                                                                        &audioSrc,
                                                                        &audioSink);

    if (SL_RESULT_SUCCESS != result) {
        LOGE("createAudioRecorder() result:%s", getSLErrStr(result));
        goto error;
    }

    // Configure the stream.
    result = (*mObjectInterface)->GetInterface(mObjectInterface,
                                            SL_IID_ANDROIDCONFIGURATION,
                                            &configItf);

    if (SL_RESULT_SUCCESS != result) {
        LOGW("%s() GetInterface(SL_IID_ANDROIDCONFIGURATION) failed with %s",
             __func__, getSLErrStr(result));
    } else {
        SLuint32 presetValue = OpenSLES_convertInputPreset(getInputPreset());
        result = (*configItf)->SetConfiguration(configItf,
                                         SL_ANDROID_KEY_RECORDING_PRESET,
                                         &presetValue,
                                         sizeof(SLuint32));
        if (SL_RESULT_SUCCESS != result
            && presetValue != SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION) {
            presetValue = SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION;
            mInputPreset = InputPreset::VoiceRecognition;
            (*configItf)->SetConfiguration(configItf,
                                             SL_ANDROID_KEY_RECORDING_PRESET,
                                             &presetValue,
                                             sizeof(SLuint32));
        }

        result = configurePerformanceMode(configItf);
        if (SL_RESULT_SUCCESS != result) {
            goto error;
        }
    }

    result = (*mObjectInterface)->Realize(mObjectInterface, SL_BOOLEAN_FALSE);
    if (SL_RESULT_SUCCESS != result) {
        LOGE("Realize recorder object result:%s", getSLErrStr(result));
        goto error;
    }

    result = (*mObjectInterface)->GetInterface(mObjectInterface, SL_IID_RECORD, &mRecordInterface);
    if (SL_RESULT_SUCCESS != result) {
        LOGE("GetInterface RECORD result:%s", getSLErrStr(result));
        goto error;
    }

    result = AudioStreamOpenSLES::registerBufferQueueCallback();
    if (SL_RESULT_SUCCESS != result) {
        goto error;
    }

    result = updateStreamParameters(configItf);
    if (SL_RESULT_SUCCESS != result) {
        goto error;
    }

    oboeResult = configureBufferSizes(mSampleRate);
    if (Result::OK != oboeResult) {
        goto error;
    }

    allocateFifo();

    setState(StreamState::Open);
    return Result::OK;

error:
    return Result::ErrorInternal; // TODO convert error from SLES to OBOE
}

Result AudioInputStreamOpenSLES::close() {
    LOGD("AudioInputStreamOpenSLES::%s()", __func__);
    mLock.lock();
    Result result = Result::OK;
    if (getState() == StreamState::Closed){
        result = Result::ErrorClosed;
    } else {
        mLock.unlock(); // avoid recursive lock
        requestStop();
        mLock.lock();
        // invalidate any interfaces
        mRecordInterface = nullptr;
        result = AudioStreamOpenSLES::close();
    }
    mLock.unlock(); // avoid recursive lock
    return result;
}

Result AudioInputStreamOpenSLES::setRecordState_l(SLuint32 newState) {
    LOGD("AudioInputStreamOpenSLES::%s(%u)", __func__, newState);
    Result result = Result::OK;

    if (mRecordInterface == nullptr) {
        LOGE("AudioInputStreamOpenSLES::%s() mRecordInterface is null", __func__);
        return Result::ErrorInvalidState;
    }
    SLresult slResult = (*mRecordInterface)->SetRecordState(mRecordInterface, newState);
    //LOGD("AudioInputStreamOpenSLES::%s(%u) returned %u", __func__, newState, slResult);
    if (SL_RESULT_SUCCESS != slResult) {
        LOGE("AudioInputStreamOpenSLES::%s(%u) returned error %s",
                __func__, newState, getSLErrStr(slResult));
        result = Result::ErrorInternal; // TODO review
    }
    return result;
}

Result AudioInputStreamOpenSLES::requestStart() {
    LOGD("AudioInputStreamOpenSLES(): %s() called", __func__);
    std::lock_guard<std::mutex> lock(mLock);
    StreamState initialState = getState();
    switch (initialState) {
        case StreamState::Starting:
        case StreamState::Started:
            return Result::OK;
        case StreamState::Closed:
            return Result::ErrorClosed;
        default:
            break;
    }

    // We use a callback if the user requests one
    // OR if we have an internal callback to fill the blocking IO buffer.
    setDataCallbackEnabled(true);

    setState(StreamState::Starting);
    Result result = setRecordState_l(SL_RECORDSTATE_RECORDING);
    if (result == Result::OK) {
        setState(StreamState::Started);
        // Enqueue the first buffer to start the streaming.
        // This does not call the callback function.
        enqueueCallbackBuffer(mSimpleBufferQueueInterface);
    } else {
        setState(initialState);
    }
    return result;
}

Result AudioInputStreamOpenSLES::requestPause() {
    LOGW("AudioInputStreamOpenSLES::%s() is intentionally not implemented for input "
         "streams", __func__);
    return Result::ErrorUnimplemented; // Matches AAudio behavior.
}

Result AudioInputStreamOpenSLES::requestFlush() {
    LOGW("AudioInputStreamOpenSLES::%s() is intentionally not implemented for input "
         "streams", __func__);
    return Result::ErrorUnimplemented; // Matches AAudio behavior.
}

Result AudioInputStreamOpenSLES::requestStop() {
    LOGD("AudioInputStreamOpenSLES(): %s() called", __func__);

    std::lock_guard<std::mutex> lock(mLock);
    StreamState initialState = getState();
    switch (initialState) {
        case StreamState::Stopping:
        case StreamState::Stopped:
            return Result::OK;
        case StreamState::Closed:
            return Result::ErrorClosed;
        default:
            break;
    }

    setState(StreamState::Stopping);

    Result result = setRecordState_l(SL_RECORDSTATE_STOPPED);
    if (result == Result::OK) {
        mPositionMillis.reset32(); // OpenSL ES resets its millisecond position when stopped.
        setState(StreamState::Stopped);
    } else {
        setState(initialState);
    }
    return result;
}

void AudioInputStreamOpenSLES::updateFramesWritten() {
    if (usingFIFO()) {
        AudioStreamBuffered::updateFramesWritten();
    } else {
        mFramesWritten = getFramesProcessedByServer();
    }
}

Result AudioInputStreamOpenSLES::updateServiceFrameCounter() {
    Result result = Result::OK;
    // Avoid deadlock if another thread is trying to stop or close this stream
    // and this is being called from a callback.
    if (mLock.try_lock()) {

        if (mRecordInterface == nullptr) {
            mLock.unlock();
            return Result::ErrorNull;
        }
        SLmillisecond msec = 0;
        SLresult slResult = (*mRecordInterface)->GetPosition(mRecordInterface, &msec);
        if (SL_RESULT_SUCCESS != slResult) {
            LOGW("%s(): GetPosition() returned %s", __func__, getSLErrStr(slResult));
            // set result based on SLresult
            result = Result::ErrorInternal;
        } else {
            mPositionMillis.update32(msec);
        }
        mLock.unlock();
    }
    return result;
}


const fs = require('fs');
const path = require('path');

const outputPath = path.join(__dirname, '../next.config.js');

const fileTemplate = routes => `
module.exports = {
  distDir: 'build',
  exportTrailingSlash: true,
  exportPathMap: function () {
    return ${routes};
  },
  webpack: (config, props) => {
    config.module.rules.push({
      test: /\.md$/,
      loader: 'emit-file-loader',
      options: {
        name: 'dist/[path][name].[ext]',
      },
    },
    {
      test: /\.md$/,
      loader: 'raw-loader',
    })

    return config
  }
};
`;

const generateRouteDefinitions = data => {
  // TODO: Automatically generate api/blog etc
  let routes = `
    '/': { page: '/' },
    '/support': { page: '/support' },
    '/api': { page: '/api' },
    '/blog': { page: '/blog' },
    '/pose': { page: '/pose' },
    '/pure': { page: '/pure' },
    '/popcorn': { page: '/popcorn' },
    '/pose/api': { page: '/pose/api' },
    '/pose/examples': { page: '/pose/examples' },
    '/page-not-found': { page: '/_error' },
    '/stylefire': { page: '/stylefire' },
    '/stylefire/api': { page: '/stylefire/api' },
  `;

  Object.keys(data).forEach(siteId => {
    const siteData = data[siteId];

    Object.keys(siteData).forEach(sectionId => {
      const sectionData = siteData[sectionId];
      const pageIds = Object.keys(sectionData);

      pageIds.forEach(pageId => {
        const route = `/${
          siteId === 'pure' ? '' : siteId + '/'
        }${sectionId}/${pageId}`;
        routes += `
          '${route}': {
            page: '${route}'
          },
        `;
      });
    });
  });

  return `{${routes}}`;
};

module.exports = function(data) {
  const routes = generateRouteDefinitions(data);
  fs.writeFileSync(outputPath, fileTemplate(routes));
};


package apiclient

import (
	"context"

	"google.golang.org/grpc"

	workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate"
	"github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
	grpcutil "github.com/argoproj/argo/util/grpc"
)

type errorTranslatingWorkflowTemplateServiceClient struct {
	delegate workflowtemplatepkg.WorkflowTemplateServiceClient
}

var _ workflowtemplatepkg.WorkflowTemplateServiceClient = &errorTranslatingWorkflowTemplateServiceClient{}

func (a *errorTranslatingWorkflowTemplateServiceClient) CreateWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateCreateRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {
	template, err := a.delegate.CreateWorkflowTemplate(ctx, req)
	if err != nil {
		return nil, grpcutil.TranslateError(err)
	}
	return template, nil
}

func (a *errorTranslatingWorkflowTemplateServiceClient) GetWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateGetRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {
	template, err := a.delegate.GetWorkflowTemplate(ctx, req)
	if err != nil {
		return nil, grpcutil.TranslateError(err)
	}
	return template, nil
}

func (a *errorTranslatingWorkflowTemplateServiceClient) ListWorkflowTemplates(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateListRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplateList, error) {
	templates, err := a.delegate.ListWorkflowTemplates(ctx, req)
	if err != nil {
		return nil, grpcutil.TranslateError(err)
	}
	return templates, nil
}

func (a *errorTranslatingWorkflowTemplateServiceClient) UpdateWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateUpdateRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {
	template, err := a.delegate.UpdateWorkflowTemplate(ctx, req)
	if err != nil {
		return nil, grpcutil.TranslateError(err)
	}
	return template, nil
}

func (a *errorTranslatingWorkflowTemplateServiceClient) DeleteWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateDeleteRequest, _ ...grpc.CallOption) (*workflowtemplatepkg.WorkflowTemplateDeleteResponse, error) {
	template, err := a.delegate.DeleteWorkflowTemplate(ctx, req)
	if err != nil {
		return nil, grpcutil.TranslateError(err)
	}
	return template, nil
}

func (a *errorTranslatingWorkflowTemplateServiceClient) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {
	template, err := a.delegate.LintWorkflowTemplate(ctx, req)
	if err != nil {
		return nil, grpcutil.TranslateError(err)
	}
	return template, nil
}


<?php
/*
Copyright (c) 2010, akosma software / Adrian Kosmaczewski
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 acknowledgement:
   This product includes software developed by akosma software.
4. Neither the name of the akosma software nor the
   names of its contributors may be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ADRIAN KOSMACZEWSKI ''AS IS'' AND ANY
EXPRESS 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 ADRIAN KOSMACZEWSKI 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.
*/

require_once('formatter.php');

class HTMLFormatter extends Formatter
{
    public function getContentType()
    {
        return "text/html";
    }

    public function formatData()
    {
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>data</title>

        id
        first name
        last name
        phone
        email
        address
        city
        zip
        state
        country
        description
        password
        created on
        modified on

<?php
while ($entry = $this->getData()->next())
{
    $this->formatEntryAsHTML($entry);
}
?>

        <?php
    }

    private function formatEntryAsHTML($entry)
    {
        echo("
");
        echo("" . $entry['id'] . "	");
        echo("" . $entry['first_name'] . "	");
        echo("" . $entry['last_name'] . "	");
        echo("" . $entry['phone'] . "	");
        echo("" . $entry['email'] . "	");
        echo("" . $entry['address'] . "	");
        echo("" . $entry['city'] . "	");
        echo("" . $entry['zip'] . "	");
        echo("" . $entry['state'] . "	");
        echo("" . $entry['country'] . "	");
        echo("" . $entry['description'] . "	");
        echo("" . $entry['password'] . "	");
        echo("" . $entry['created_on'] . "	");
        echo("" . $entry['modified_on'] . "	");
        echo("
");
    }
}
?>


<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <Authors>Revo Framework</Authors>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\..\Revo.Testing\Revo.Testing.csproj" />
  </ItemGroup>

</Project>


#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

"""Argument parser functions."""

import argparse
import sys

import slowfast.utils.checkpoint as cu
from slowfast.config.defaults import get_cfg

def parse_args():
    """
    Parse the following arguments for a default parser for PySlowFast users.
    Args:
        shard_id (int): shard id for the current machine. Starts from 0 to
            num_shards - 1. If single machine is used, then set shard id to 0.
        num_shards (int): number of shards using by the job.
        init_method (str): initialization method to launch the job with multiple
            devices. Options includes TCP or shared file-system for
            initialization. details can be find in
            https://pytorch.org/docs/stable/distributed.html#tcp-initialization
        cfg (str): path to the config file.
        opts (argument): provide addtional options from the command line, it
            overwrites the config loaded from file.
        """
    parser = argparse.ArgumentParser(
        description="Provide SlowFast video training and testing pipeline."
    )
    parser.add_argument(
        "--shard_id",
        help="The shard id of current node, Starts from 0 to num_shards - 1",
        default=0,
        type=int,
    )
    parser.add_argument(
        "--num_shards",
        help="Number of shards using by the job",
        default=1,
        type=int,
    )
    parser.add_argument(
        "--init_method",
        help="Initialization method, includes TCP or shared file-system",
        default="tcp://localhost:9999",
        type=str,
    )
    parser.add_argument(
        "--cfg",
        dest="cfg_file",
        help="Path to the config file",
        default="configs/Kinetics/SLOWFAST_4x16_R50.yaml",
        type=str,
    )
    parser.add_argument(
        "opts",
        help="See slowfast/config/defaults.py for all options",
        default=None,
        nargs=argparse.REMAINDER,
    )
    if len(sys.argv) == 1:
        parser.print_help()
    return parser.parse_args()

def load_config(args):
    """
    Given the arguemnts, load and initialize the configs.
    Args:
        args (argument): arguments includes `shard_id`, `num_shards`,
            `init_method`, `cfg_file`, and `opts`.
    """
    # Setup cfg.
    cfg = get_cfg()
    # Load config from cfg.
    if args.cfg_file is not None:
        cfg.merge_from_file(args.cfg_file)
    # Load config from command line, overwrite config from opts.
    if args.opts is not None:
        cfg.merge_from_list(args.opts)

    # Inherit parameters from args.
    if hasattr(args, "num_shards") and hasattr(args, "shard_id"):
        cfg.NUM_SHARDS = args.num_shards
        cfg.SHARD_ID = args.shard_id
    if hasattr(args, "rng_seed"):
        cfg.RNG_SEED = args.rng_seed
    if hasattr(args, "output_dir"):
        cfg.OUTPUT_DIR = args.output_dir

    # Create the checkpoint dir.
    cu.make_checkpoint_dir(cfg.OUTPUT_DIR)
    return cfg


CancelSigningProfile

Changes the state of an ACTIVE signing profile to CANCELED. A canceled profile is still viewable with the ListSigningProfiles operation, but it cannot perform new signing jobs, and is deleted two years after cancelation.

DescribeSigningJob

Returns information about a specific code signing job. You specify the job by using the jobId value that is returned by the StartSigningJob operation.

GetSigningPlatform

Returns information on a specific signing platform.

GetSigningProfile

Returns information on a specific signing profile.

ListSigningJobs

Lists all your signing jobs. You can use the maxResults parameter to limit the number of signing jobs that are returned in the response. If additional jobs remain to be listed, code signing returns a nextToken value. Use this value in subsequent calls to ListSigningJobs to fetch the remaining values. You can continue calling ListSigningJobs with your maxResults parameter and with new values that code signing returns in the nextToken parameter until all of your signing jobs have been returned.

ListSigningPlatforms

Lists all signing platforms available in code signing that match the request parameters. If additional jobs remain to be listed, code signing returns a nextToken value. Use this value in subsequent calls to ListSigningJobs to fetch the remaining values. You can continue calling ListSigningJobs with your maxResults parameter and with new values that code signing returns in the nextToken parameter until all of your signing jobs have been returned.

ListSigningProfiles

Lists all available signing profiles in your AWS account. Returns only profiles with an ACTIVE status unless the includeCanceled request field is set to true. If additional jobs remain to be listed, code signing returns a nextToken value. Use this value in subsequent calls to ListSigningJobs to fetch the remaining values. You can continue calling ListSigningJobs with your maxResults parameter and with new values that code signing returns in the nextToken parameter until all of your signing jobs have been returned.

ListTagsForResource

Returns a list of the tags associated with a signing profile resource.

PutSigningProfile

Creates a signing profile. A signing profile is a code signing template that can be used to carry out a pre-defined signing job. For more information, see http://docs.aws.amazon.com/signer/latest/developerguide/gs-profile.html

StartSigningJob

Initiates a signing job to be performed on the code provided. Signing jobs are viewable by the ListSigningJobs operation for two years after they are performed. Note the following requirements:

 You must create an Amazon S3 source bucket. For more information, see Create a Bucket in the Amazon S3 Getting Started Guide.

Your S3 source bucket must be version enabled.

You must create an S3 destination bucket. Code signing uses your S3 destination bucket to write your signed code.

You specify the name of the source and destination buckets when calling the StartSigningJob operation.

You must also specify a request token that identifies your request to code signing.

You can call the DescribeSigningJob and the ListSigningJobs actions after you call StartSigningJob.

For a Java example that shows how to use this action, see http://docs.aws.amazon.com/acm/latest/userguide/

TagResource

Adds one or more tags to a signing profile. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. To specify the signing profile, use its Amazon Resource Name (ARN). To specify the tag, use a key-value pair.

UntagResource

Removes one or more tags from a signing profile. To remove the tags, specify a list of tag keys.

You do not have sufficient access to perform this action.

The request contains invalid parameters for the ARN or tags. This exception also occurs when you call a tagging API on a cancelled signing profile.

The name of the signing profile to be canceled.

The object that contains the name of your S3 bucket or your raw code.

The Amazon Resource Name (ARN) of your code signing certificate.

The microcontroller platform to which your signed code image will be distributed.

The name of the profile that initiated the signing operation.

A list of any overrides that were applied to the signing operation.

Map of user-assigned key-value pairs used during signing. These values contain any information that you specified for use in your signing job.

Date and time that the signing job was created.

Date and time that the signing job was completed.

The IAM principal that requested the signing job.

String value that contains the status reason.

Name of the S3 bucket where the signed code image is saved by code signing.

Points to an S3Destination object that contains information about your S3 bucket.

The set of accepted encryption algorithms that are allowed in a code signing job.

The default encryption algorithm that is used by a code signing job.

The encryption algorithm options that are available to a code signing job.

The display name of the target signing platform.

A list of partner entities that use the target signing platform.

The validation template that is used by the target signing platform.

The category type of the target signing platform.

A list of configurations applied to the target platform at signing.

The format of the target platform's signing image.

The maximum size (in MB) of the payload that can be signed by the target platform.

The ARN of the certificate that the target profile uses for signing operations.

The ID of the platform that is used by the target signing profile.

A list of overrides applied by the target signing profile for signing operations.

A map of key-value pairs for signing operations that is attached to the target signing profile.

The status of the target signing profile.

The Amazon Resource Name (ARN) for the signing profile.

A list of tags associated with the signing profile.

The set of accepted hash algorithms allowed in a code signing job.

The default hash algorithm that is used in a code signing job.

The hash algorithms that are available to a code signing job.

A status value with which to filter your results.

The ID of microcontroller platform that you specified for the distribution of your code image.

The IAM principal that requested the signing job.

Specifies the maximum number of items to return in the response. Use this parameter when paginating results. If additional items exist beyond the number you specify, the nextToken element is set in the response. Use the nextToken value in a subsequent request to retrieve additional items.

String for specifying the next set of paginated results to return. After you receive a response with truncated results, use this parameter in a subsequent request. Set it to the value of nextToken from the response that you just received.

String for specifying the next set of paginated results.

The category type of a signing platform.

Any partner entities connected to a signing platform.

The maximum number of results to be returned by this operation.

Value for specifying the next set of paginated results to return. After you receive a response with truncated results, use this parameter in a subsequent request. Set it to the value of nextToken from the response that you just received.

A list of all platforms that match the request parameters.

Value for specifying the next set of paginated results to return.

Designates whether to include profiles with the status of CANCELED.

The maximum number of profiles to be returned.

A list of profiles that are available in the AWS account. This includes profiles with the status of CANCELED if the includeCanceled parameter is set to true.

The Amazon Resource Name (ARN) for the signing profile.

A list of tags associated with the signing profile.

The name of the signing profile to be created.

The AWS Certificate Manager certificate that will be used to sign code with the new signing profile.

The ID of the signing platform to be created.

A subfield of platform. This specifies any different configuration options that you want to apply to the chosen platform (such as a different hash-algorithm or signing-algorithm).

Map of key-value pairs for signing. These can include any information that you want to use during signing.

Tags to be associated with the signing profile that is being created.

The Amazon Resource Name (ARN) of the signing profile created.

A specified resource could not be found.

An Amazon S3 prefix that you can use to limit responses to those that begin with the specified prefix.

The name and prefix of the S3 bucket where code signing saves your signed objects.

Key name that uniquely identifies a signed code image in your bucket.

The S3 bucket name and key where code signing saved your signed code image.

Key name of the bucket object that contains your unsigned code.

Version of your source image in your version enabled S3 bucket.

Information about the S3 bucket where you saved your unsigned code.

Points to an S3SignedObject object that contains information about your signed code image.

The encryption algorithm options that are available for a code signing job.

The hash algorithm options that are available for a code signing job.

The configuration of a code signing operation.

A specified override of the default encryption algorithm that is used in a code signing job.

A specified override of the default hash algorithm that is used in a code signing job.

A signing configuration that overrides the default encryption or hash algorithm of a signing job.

The supported formats of a code signing image.

The default format of a code signing image.

The image format of a code signing platform or profile.

A Source that contains information about a signing job's code image source.

A SignedObject structure that contains information about a signing job's signed code image.

A SigningMaterial object that contains the Amazon Resource Name (ARN) of the certificate used for the signing job.

The date and time that the signing job was created.

Contains information about a signing job.

The Amazon Resource Name (ARN) of the certificates that is used to sign your code.

The ACM certificate that is used to sign your code.

The display name of a code signing platform.

Any partner entities linked to a code signing platform.

The types of targets that can be signed by a code signing platform.

The category of a code signing platform.

The configuration of a code signing platform. This includes the designated hash algorithm and encryption algorithm of a signing platform.

The maximum size (in MB) of code that can be signed by a code signing platform.

Contains information about the signing configurations and parameters that are used to perform a code signing job.

A signed image is a JSON object. When overriding the default signing platform configuration, a customer can select either of two signing formats, JSONEmbedded or JSONDetached. (A third format value, JSON, is reserved for future use.) With JSONEmbedded, the signing image has the payload embedded in it. With JSONDetached, the payload is not be embedded in the signing image.

Any overrides that are applied to the signing configuration of a code signing platform.

The ACM certificate that is available for use by a signing profile.

The ID of a platform that is available for use by a signing profile.

The parameters that are available for use by a code signing user.

The Amazon Resource Name (ARN) for the signing profile.

A list of tags associated with the signing profile.

Contains information about the ACM certificates and code signing configuration parameters that can be used by a given code signing user.

An S3Source object that contains information about the S3 bucket where you saved your unsigned code.

The S3 bucket that contains the object to sign or a BLOB that contains your raw code.

The S3 bucket in which to save your signed object. The destination contains the name of your bucket and an optional prefix.

String that identifies the signing request. All calls after the first that use this token return the same response as the first call.

One or more tags to be associated with the signing profile.

A list of tag keys to be removed from the signing profile.

You signing certificate could not be validated.

With code signing for IoT, you can sign code that you create for any IoT device that is supported by Amazon Web Services (AWS). Code signing is available through Amazon FreeRTOS and AWS IoT Device Management, and integrated with AWS Certificate Manager (ACM). In order to sign code, you import a third-party code signing certificate with ACM that is used to sign updates in Amazon FreeRTOS and AWS IoT Device Management. For general information about using code signing, see the Code Signing for IoT Developer Guide.


#include "runtime_internal.h"

extern "C" WEAK_INLINE int halide_malloc_alignment() {
    return 64;
}


" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" Plugin: https://github.com/majutsushi/tagbar
" vim: et ts=2 sts=2 sw=2

scriptencoding utf-8

if !exists(':TagbarToggle')
  finish
endif

let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
let s:spc = g:airline_symbols.space
let s:init=0

" Arguments: current, sort, fname
function! airline#extensions#tagbar#get_status(...)
  let builder = airline#builder#new({ 'active': a:1 })
  call builder.add_section('airline_a', s:spc.'Tagbar'.s:spc)
  call builder.add_section('airline_b', s:spc.a:2.s:spc)
  call builder.add_section('airline_c', s:spc.a:3.s:spc)
  return builder.build()
endfunction

function! airline#extensions#tagbar#inactive_apply(...)
  if getwinvar(a:2.winnr, '&filetype') == 'tagbar'
    return -1
  endif
endfunction

let s:airline_tagbar_last_lookup_time = 0
let s:airline_tagbar_last_lookup_val = ''
function! airline#extensions#tagbar#currenttag()
  if get(w:, 'airline_active', 0)
    if !s:init
      try
        " try to load the plugin, if filetypes are disabled,
        " this will cause an error, so try only once
        let a=tagbar#currenttag('%', '', '')
      catch
      endtry
      unlet! a
      let s:init=1
    endif
    " function tagbar#currenttag does not exist, if filetype is not enabled
    if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")
      let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
      let s:airline_tagbar_last_lookup_time = localtime()
    endif
    return s:airline_tagbar_last_lookup_val
  endif
  return ''
endfunction

function! airline#extensions#tagbar#init(ext)
  call a:ext.add_inactive_statusline_func('airline#extensions#tagbar#inactive_apply')
  let g:tagbar_status_func = 'airline#extensions#tagbar#get_status'

  call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag')
endfunction


<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\String;

defined('JPATH_PLATFORM') or die;

use Joomla\Uri\UriHelper;

\JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php');

/**
 * Joomla Platform String Punycode Class
 *
 * Class for handling UTF-8 URLs
 * Wraps the Punycode library
 * All functions assume the validity of utf-8 URLs.
 *
 * @since  3.1.2
 */
abstract class PunycodeHelper
{
	/**
	 * Transforms a UTF-8 string to a Punycode string
	 *
	 * @param   string  $utfString  The UTF-8 string to transform
	 *
	 * @return  string  The punycode string
	 *
	 * @since   3.1.2
	 */
	public static function toPunycode($utfString)
	{
		$idn = new \idna_convert;

		return $idn->encode($utfString);
	}

	/**
	 * Transforms a Punycode string to a UTF-8 string
	 *
	 * @param   string  $punycodeString  The Punycode string to transform
	 *
	 * @return  string  The UF-8 URL
	 *
	 * @since   3.1.2
	 */
	public static function fromPunycode($punycodeString)
	{
		$idn = new \idna_convert;

		return $idn->decode($punycodeString);
	}

	/**
	 * Transforms a UTF-8 URL to a Punycode URL
	 *
	 * @param   string  $uri  The UTF-8 URL to transform
	 *
	 * @return  string  The punycode URL
	 *
	 * @since   3.1.2
	 */
	public static function urlToPunycode($uri)
	{
		$parsed = UriHelper::parse_url($uri);

		if (!isset($parsed['host']) || $parsed['host'] == '')
		{
			// If there is no host we do not need to convert it.
			return $uri;
		}

		$host = $parsed['host'];
		$hostExploded = explode('.', $host);
		$newhost = '';

		foreach ($hostExploded as $hostex)
		{
			$hostex = static::toPunycode($hostex);
			$newhost .= $hostex . '.';
		}

		$newhost = substr($newhost, 0, -1);
		$newuri = '';

		if (!empty($parsed['scheme']))
		{
			// Assume :// is required although it is not always.
			$newuri .= $parsed['scheme'] . '://';
		}

		if (!empty($newhost))
		{
			$newuri .= $newhost;
		}

		if (!empty($parsed['port']))
		{
			$newuri .= ':' . $parsed['port'];
		}

		if (!empty($parsed['path']))
		{
			$newuri .= $parsed['path'];
		}

		if (!empty($parsed['query']))
		{
			$newuri .= '?' . $parsed['query'];
		}

		if (!empty($parsed['fragment']))
		{
			$newuri .= '#' . $parsed['fragment'];
		}

		return $newuri;
	}

	/**
	 * Transforms a Punycode URL to a UTF-8 URL
	 *
	 * @param   string  $uri  The Punycode URL to transform
	 *
	 * @return  string  The UTF-8 URL
	 *
	 * @since   3.1.2
	 */
	public static function urlToUTF8($uri)
	{
		if (empty($uri))
		{
			return;
		}

		$parsed = UriHelper::parse_url($uri);

		if (!isset($parsed['host']) || $parsed['host'] == '')
		{
			// If there is no host we do not need to convert it.
			return $uri;
		}

		$host = $parsed['host'];
		$hostExploded = explode('.', $host);
		$newhost = '';

		foreach ($hostExploded as $hostex)
		{
			$hostex = self::fromPunycode($hostex);
			$newhost .= $hostex . '.';
		}

		$newhost = substr($newhost, 0, -1);
		$newuri = '';

		if (!empty($parsed['scheme']))
		{
			// Assume :// is required although it is not always.
			$newuri .= $parsed['scheme'] . '://';
		}

		if (!empty($newhost))
		{
			$newuri .= $newhost;
		}

		if (!empty($parsed['port']))
		{
			$newuri .= ':' . $parsed['port'];
		}

		if (!empty($parsed['path']))
		{
			$newuri .= $parsed['path'];
		}

		if (!empty($parsed['query']))
		{
			$newuri .= '?' . $parsed['query'];
		}

		if (!empty($parsed['fragment']))
		{
			$newuri .= '#' . $parsed['fragment'];
		}

		return $newuri;
	}

	/**
	 * Transforms a UTF-8 email to a Punycode email
	 * This assumes a valid email address
	 *
	 * @param   string  $email  The UTF-8 email to transform
	 *
	 * @return  string  The punycode email
	 *
	 * @since   3.1.2
	 */
	public static function emailToPunycode($email)
	{
		$explodedAddress = explode('@', $email);

		// Not addressing UTF-8 user names
		$newEmail = $explodedAddress[0];

		if (!empty($explodedAddress[1]))
		{
			$domainExploded = explode('.', $explodedAddress[1]);
			$newdomain = '';

			foreach ($domainExploded as $domainex)
			{
				$domainex = static::toPunycode($domainex);
				$newdomain .= $domainex . '.';
			}

			$newdomain = substr($newdomain, 0, -1);
			$newEmail = $newEmail . '@' . $newdomain;
		}

		return $newEmail;
	}

	/**
	 * Transforms a Punycode email to a UTF-8 email
	 * This assumes a valid email address
	 *
	 * @param   string  $email  The punycode email to transform
	 *
	 * @return  string  The punycode email
	 *
	 * @since   3.1.2
	 */
	public static function emailToUTF8($email)
	{
		$explodedAddress = explode('@', $email);

		// Not addressing UTF-8 user names
		$newEmail = $explodedAddress[0];

		if (!empty($explodedAddress[1]))
		{
			$domainExploded = explode('.', $explodedAddress[1]);
			$newdomain = '';

			foreach ($domainExploded as $domainex)
			{
				$domainex = static::fromPunycode($domainex);
				$newdomain .= $domainex . '.';
			}

			$newdomain = substr($newdomain, 0, -1);
			$newEmail = $newEmail . '@' . $newdomain;
		}

		return $newEmail;
	}
}


Deployed Versions

Pilot Versions

Resource Usage

Memory

CPU

Disk

Goroutines

Pilot Push Information

Shows the rate of pilot pushes

Pilot Pushes

Captures a variety of pilot errors

sum(pilot_xds_cds_reject{app="istiod"}) or (absent(pilot_xds_cds_reject{app="istiod"}) - 1)

sum(pilot_xds_eds_reject{app="istiod"}) or (absent(pilot_xds_eds_reject{app="istiod"}) - 1)

sum(pilot_xds_rds_reject{app="istiod"}) or (absent(pilot_xds_rds_reject{app="istiod"}) - 1)

sum(pilot_xds_lds_reject{app="istiod"}) or (absent(pilot_xds_lds_reject{app="istiod"}) - 1)

Pilot Errors

Shows the total time it takes to push a config update to a proxy

histogram_quantile(0.5, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))

histogram_quantile(0.9, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))

histogram_quantile(0.99, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))

histogram_quantile(0.999, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))

Proxy Push Time

Outbound Listeners (http over current tcp)

Outbound Listeners (tcp over current tcp)

Outbound Listeners (tcp over current http)

Conflicts

ADS Monitoring

Envoy Information

Shows details about Envoy proxies in the mesh

Envoy Details

XDS Active Connections

Shows the size of XDS requests and responses

XDS Requests Size

Webhooks

Configuration Validation

Sidecar Injection

datasource

default

Question: prometheus

Istio Control Plane Dashboard


using System.Collections.Immutable;
using System.Reflection;
using ExtendedXmlSerializer.Core.Sources;

namespace ExtendedXmlSerializer.ReflectionModel
{
	interface ITypePartitions : IParameterizedSource<TypePartition, ImmutableArray<TypeInfo>?> {}
}


<!DOCTYPE html>

  <meta charset="utf-8" />
  <title translate="yes">İclaslar</title>
  <link href="/public/pure-min.css" rel="stylesheet">
  <link href="/public/content.css" rel="stylesheet">
  <link href="/public/content-additional.css" rel="stylesheet">
  <base target="_top" href="/">

İclaslar

Bunlar hər istifadəçi daxil olduqda yaradılır.

Hələ iclaslar yoxdur.

        ID
        Hesab
        Adı
        Elektron poçt
        Yaradilib
        Bitir

  <template id="page-link">

      ${page.pageNumber}

  </template>
  <template id="session-row">

        ${session.sessionid}

        ${session.accountid}

      ${session.firstName} ${session.lastName}

        ${session.email}

      ${session.createdFormatted}
      ${session.expiresFormatted}

  </template>


/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#include "mpi.h"
#include "mpitestconf.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include "mpitest.h"

static int verbose = 0;

/* tests */
int builtin_float_test(void);
int vector_of_vectors_test(void);
int optimizable_vector_of_basics_test(void);
int indexed_of_basics_test(void);
int indexed_of_vectors_test(void);
int struct_of_basics_test(void);

/* helper functions */
char *combiner_to_string(int combiner);
int parse_args(int argc, char **argv);

int main(int argc, char **argv)
{
    int err, errs = 0;

    MTest_Init(&argc, &argv);
    parse_args(argc, argv);

    /* To improve reporting of problems about operations, we
     * change the error handler to errors return */
    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);

    /* perform some tests */
    err = builtin_float_test();
    errs += err;
    if (err) {
        fprintf(stderr, "Found %d errors in builtin float test.\n", err);
    }

    err = vector_of_vectors_test();
    errs += err;
    if (err) {
        fprintf(stderr, "Found %d errors in vector of vectors test.\n", err);
    }

    err = optimizable_vector_of_basics_test();
    errs += err;
    if (err) {
        fprintf(stderr, "Found %d errors in vector of basics test.\n", err);
    }

    err = indexed_of_basics_test();
    errs += err;
    if (err) {
        fprintf(stderr, "Found %d errors in indexed of basics test.\n", err);
    }

    err = indexed_of_vectors_test();
    errs += err;
    if (err) {
        fprintf(stderr, "Found %d errors in indexed of vectors test.\n", err);
    }
#ifdef HAVE_MPI_TYPE_CREATE_STRUCT
    err = struct_of_basics_test();
    errs += err;
#endif

    MTest_Finalize(errs);
    return MTestReturnValue(errs);
}

/* builtin_float_test()
 *
 * Tests functionality of get_envelope() and get_contents() on a MPI_FLOAT.
 *
 * Returns the number of errors encountered.
 */
int builtin_float_test(void)
{
    int nints, nadds, ntypes, combiner;

    int err, errs = 0;

    err = MPI_Type_get_envelope(MPI_FLOAT, &nints, &nadds, &ntypes, &combiner);

    if (combiner != MPI_COMBINER_NAMED)
        errs++;
    if (verbose && combiner != MPI_COMBINER_NAMED)
        fprintf(stderr, "combiner = %s; should be named\n", combiner_to_string(combiner));

    /* Note: it is erroneous to call MPI_Type_get_contents() on a basic. */
    return errs;
}

/* vector_of_vectors_test()
 *
 * Builds a vector of a vector of ints.  Assuming an int array of size 9
 * integers, and treating the array as a 3x3 2D array, this will grab the
 * corners.
 *
 * Returns the number of errors encountered.
 */
int vector_of_vectors_test(void)
{
    MPI_Datatype inner_vector, inner_vector_copy;
    MPI_Datatype outer_vector;

    int nints, nadds, ntypes, combiner, *ints;
    MPI_Aint *adds = NULL;
    MPI_Datatype *types;

    int err, errs = 0;

    /* set up type */
    err = MPI_Type_vector(2, 1, 2, MPI_INT, &inner_vector);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    err = MPI_Type_vector(2, 1, 2, inner_vector, &outer_vector);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    /* decode outer vector (get envelope, then contents) */
    err = MPI_Type_get_envelope(outer_vector, &nints, &nadds, &ntypes, &combiner);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    if (nints != 3)
        errs++;
    if (nadds != 0)
        errs++;
    if (ntypes != 1)
        errs++;
    if (combiner != MPI_COMBINER_VECTOR)
        errs++;

    if (verbose) {
        if (nints != 3)
            fprintf(stderr, "outer vector nints = %d; should be 3\n", nints);
        if (nadds != 0)
            fprintf(stderr, "outer vector nadds = %d; should be 0\n", nadds);
        if (ntypes != 1)
            fprintf(stderr, "outer vector ntypes = %d; should be 1\n", ntypes);
        if (combiner != MPI_COMBINER_VECTOR)
            fprintf(stderr, "outer vector combiner = %s; should be vector\n",
                    combiner_to_string(combiner));
    }
    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    ints = malloc(nints * sizeof(*ints));
    if (nadds)
        adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    /* get contents of outer vector */
    err = MPI_Type_get_contents(outer_vector, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != 2)
        errs++;
    if (ints[1] != 1)
        errs++;
    if (ints[2] != 2)
        errs++;

    if (verbose) {
        if (ints[0] != 2)
            fprintf(stderr, "outer vector count = %d; should be 2\n", ints[0]);
        if (ints[1] != 1)
            fprintf(stderr, "outer vector blocklength = %d; should be 1\n", ints[1]);
        if (ints[2] != 2)
            fprintf(stderr, "outer vector stride = %d; should be 2\n", ints[2]);
    }
    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    inner_vector_copy = types[0];
    free(ints);
    if (nadds)
        free(adds);
    free(types);

    /* decode inner vector */
    err = MPI_Type_get_envelope(inner_vector_copy, &nints, &nadds, &ntypes, &combiner);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    if (nints != 3)
        errs++;
    if (nadds != 0)
        errs++;
    if (ntypes != 1)
        errs++;
    if (combiner != MPI_COMBINER_VECTOR)
        errs++;

    if (verbose) {
        if (nints != 3)
            fprintf(stderr, "inner vector nints = %d; should be 3\n", nints);
        if (nadds != 0)
            fprintf(stderr, "inner vector nadds = %d; should be 0\n", nadds);
        if (ntypes != 1)
            fprintf(stderr, "inner vector ntypes = %d; should be 1\n", ntypes);
        if (combiner != MPI_COMBINER_VECTOR)
            fprintf(stderr, "inner vector combiner = %s; should be vector\n",
                    combiner_to_string(combiner));
    }
    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    ints = malloc(nints * sizeof(*ints));
    if (nadds)
        adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    err = MPI_Type_get_contents(inner_vector_copy, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != 2)
        errs++;
    if (ints[1] != 1)
        errs++;
    if (ints[2] != 2)
        errs++;

    if (verbose) {
        if (ints[0] != 2)
            fprintf(stderr, "inner vector count = %d; should be 2\n", ints[0]);
        if (ints[1] != 1)
            fprintf(stderr, "inner vector blocklength = %d; should be 1\n", ints[1]);
        if (ints[2] != 2)
            fprintf(stderr, "inner vector stride = %d; should be 2\n", ints[2]);
    }
    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    free(ints);
    if (nadds)
        free(adds);
    free(types);

    MPI_Type_free(&inner_vector_copy);
    MPI_Type_free(&inner_vector);
    MPI_Type_free(&outer_vector);

    return MTestReturnValue(errs);
}

/* optimizable_vector_of_basics_test()
 *
 * Builds a vector of ints.  Count is 10, blocksize is 2, stride is 2, so this
 * is equivalent to a contig of 20.  But remember...we should get back our
 * suboptimal values under MPI-2.
 *
 * Returns the number of errors encountered.
 */
int optimizable_vector_of_basics_test(void)
{
    MPI_Datatype parent_type;

    int nints, nadds, ntypes, combiner, *ints;
    MPI_Aint *adds = NULL;
    MPI_Datatype *types;

    int err, errs = 0;

    /* set up type */
    err = MPI_Type_vector(10, 2, 2, MPI_INT, &parent_type);

    /* decode */
    err = MPI_Type_get_envelope(parent_type, &nints, &nadds, &ntypes, &combiner);

    if (nints != 3)
        errs++;
    if (nadds != 0)
        errs++;
    if (ntypes != 1)
        errs++;
    if (combiner != MPI_COMBINER_VECTOR)
        errs++;

    if (verbose) {
        if (nints != 3)
            fprintf(stderr, "nints = %d; should be 3\n", nints);
        if (nadds != 0)
            fprintf(stderr, "nadds = %d; should be 0\n", nadds);
        if (ntypes != 1)
            fprintf(stderr, "ntypes = %d; should be 1\n", ntypes);
        if (combiner != MPI_COMBINER_VECTOR)
            fprintf(stderr, "combiner = %s; should be vector\n", combiner_to_string(combiner));
    }

    ints = malloc(nints * sizeof(*ints));
    if (nadds)
        adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    err = MPI_Type_get_contents(parent_type, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != 10)
        errs++;
    if (ints[1] != 2)
        errs++;
    if (ints[2] != 2)
        errs++;
    if (types[0] != MPI_INT)
        errs++;

    if (verbose) {
        if (ints[0] != 10)
            fprintf(stderr, "count = %d; should be 10\n", ints[0]);
        if (ints[1] != 2)
            fprintf(stderr, "blocklength = %d; should be 2\n", ints[1]);
        if (ints[2] != 2)
            fprintf(stderr, "stride = %d; should be 2\n", ints[2]);
        if (types[0] != MPI_INT)
            fprintf(stderr, "type is not MPI_INT\n");
    }

    free(ints);
    if (nadds)
        free(adds);
    free(types);

    MPI_Type_free(&parent_type);

    return errs;
}

/* indexed_of_basics_test(void)
 *
 * Simple indexed type.
 *
 * Returns number of errors encountered.
 */
int indexed_of_basics_test(void)
{
    MPI_Datatype parent_type;
    int s_count = 3, s_blocklengths[3] = { 3, 2, 1 };
    int s_displacements[3] = { 10, 20, 30 };

    int nints, nadds, ntypes, combiner, *ints;
    MPI_Aint *adds = NULL;
    MPI_Datatype *types;

    int err, errs = 0;

    /* set up type */
    err = MPI_Type_indexed(s_count, s_blocklengths, s_displacements, MPI_INT, &parent_type);

    /* decode */
    err = MPI_Type_get_envelope(parent_type, &nints, &nadds, &ntypes, &combiner);

    if (nints != 7)
        errs++;
    if (nadds != 0)
        errs++;
    if (ntypes != 1)
        errs++;
    if (combiner != MPI_COMBINER_INDEXED)
        errs++;

    if (verbose) {
        if (nints != 7)
            fprintf(stderr, "nints = %d; should be 7\n", nints);
        if (nadds != 0)
            fprintf(stderr, "nadds = %d; should be 0\n", nadds);
        if (ntypes != 1)
            fprintf(stderr, "ntypes = %d; should be 1\n", ntypes);
        if (combiner != MPI_COMBINER_INDEXED)
            fprintf(stderr, "combiner = %s; should be indexed\n", combiner_to_string(combiner));
    }

    ints = malloc(nints * sizeof(*ints));
    if (nadds)
        adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    err = MPI_Type_get_contents(parent_type, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != s_count)
        errs++;
    if (ints[1] != s_blocklengths[0])
        errs++;
    if (ints[2] != s_blocklengths[1])
        errs++;
    if (ints[3] != s_blocklengths[2])
        errs++;
    if (ints[4] != s_displacements[0])
        errs++;
    if (ints[5] != s_displacements[1])
        errs++;
    if (ints[6] != s_displacements[2])
        errs++;
    if (types[0] != MPI_INT)
        errs++;

    if (verbose) {
        if (ints[0] != s_count)
            fprintf(stderr, "count = %d; should be %d\n", ints[0], s_count);
        if (ints[1] != s_blocklengths[0])
            fprintf(stderr, "blocklength[0] = %d; should be %d\n", ints[1], s_blocklengths[0]);
        if (ints[2] != s_blocklengths[1])
            fprintf(stderr, "blocklength[1] = %d; should be %d\n", ints[2], s_blocklengths[1]);
        if (ints[3] != s_blocklengths[2])
            fprintf(stderr, "blocklength[2] = %d; should be %d\n", ints[3], s_blocklengths[2]);
        if (ints[4] != s_displacements[0])
            fprintf(stderr, "displacement[0] = %d; should be %d\n", ints[4], s_displacements[0]);
        if (ints[5] != s_displacements[1])
            fprintf(stderr, "displacement[1] = %d; should be %d\n", ints[5], s_displacements[1]);
        if (ints[6] != s_displacements[2])
            fprintf(stderr, "displacement[2] = %d; should be %d\n", ints[6], s_displacements[2]);
        if (types[0] != MPI_INT)
            fprintf(stderr, "type[0] does not match\n");
    }

    free(ints);
    if (nadds)
        free(adds);
    free(types);

    MPI_Type_free(&parent_type);
    return errs;
}

/* indexed_of_vectors_test()
 *
 * Builds an indexed type of vectors of ints.
 *
 * Returns the number of errors encountered.
 */
int indexed_of_vectors_test(void)
{
    MPI_Datatype inner_vector, inner_vector_copy;
    MPI_Datatype outer_indexed;

    int i_count = 3, i_blocklengths[3] = { 3, 2, 1 };
    int i_displacements[3] = { 10, 20, 30 };

    int nints, nadds, ntypes, combiner, *ints;
    MPI_Aint *adds = NULL;
    MPI_Datatype *types;

    int err, errs = 0;

    /* set up type */
    err = MPI_Type_vector(2, 1, 2, MPI_INT, &inner_vector);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    err = MPI_Type_indexed(i_count, i_blocklengths, i_displacements, inner_vector, &outer_indexed);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    /* decode outer vector (get envelope, then contents) */
    err = MPI_Type_get_envelope(outer_indexed, &nints, &nadds, &ntypes, &combiner);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    if (nints != 7)
        errs++;
    if (nadds != 0)
        errs++;
    if (ntypes != 1)
        errs++;
    if (combiner != MPI_COMBINER_INDEXED)
        errs++;

    if (verbose) {
        if (nints != 7)
            fprintf(stderr, "nints = %d; should be 7\n", nints);
        if (nadds != 0)
            fprintf(stderr, "nadds = %d; should be 0\n", nadds);
        if (ntypes != 1)
            fprintf(stderr, "ntypes = %d; should be 1\n", ntypes);
        if (combiner != MPI_COMBINER_INDEXED)
            fprintf(stderr, "combiner = %s; should be indexed\n", combiner_to_string(combiner));
    }

    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    ints = malloc(nints * sizeof(*ints));
    if (nadds)
        adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    /* get contents of outer vector */
    err = MPI_Type_get_contents(outer_indexed, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != i_count)
        errs++;
    if (ints[1] != i_blocklengths[0])
        errs++;
    if (ints[2] != i_blocklengths[1])
        errs++;
    if (ints[3] != i_blocklengths[2])
        errs++;
    if (ints[4] != i_displacements[0])
        errs++;
    if (ints[5] != i_displacements[1])
        errs++;
    if (ints[6] != i_displacements[2])
        errs++;

    if (verbose) {
        if (ints[0] != i_count)
            fprintf(stderr, "count = %d; should be %d\n", ints[0], i_count);
        if (ints[1] != i_blocklengths[0])
            fprintf(stderr, "blocklength[0] = %d; should be %d\n", ints[1], i_blocklengths[0]);
        if (ints[2] != i_blocklengths[1])
            fprintf(stderr, "blocklength[1] = %d; should be %d\n", ints[2], i_blocklengths[1]);
        if (ints[3] != i_blocklengths[2])
            fprintf(stderr, "blocklength[2] = %d; should be %d\n", ints[3], i_blocklengths[2]);
        if (ints[4] != i_displacements[0])
            fprintf(stderr, "displacement[0] = %d; should be %d\n", ints[4], i_displacements[0]);
        if (ints[5] != i_displacements[1])
            fprintf(stderr, "displacement[1] = %d; should be %d\n", ints[5], i_displacements[1]);
        if (ints[6] != i_displacements[2])
            fprintf(stderr, "displacement[2] = %d; should be %d\n", ints[6], i_displacements[2]);
    }

    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    inner_vector_copy = types[0];
    free(ints);
    if (nadds)
        free(adds);
    free(types);

    /* decode inner vector */
    err = MPI_Type_get_envelope(inner_vector_copy, &nints, &nadds, &ntypes, &combiner);
    if (err != MPI_SUCCESS) {
        if (verbose)
            fprintf(stderr, "error in MPI call; aborting after %d errors\n", errs + 1);
        return errs + 1;
    }

    if (nints != 3)
        errs++;
    if (nadds != 0)
        errs++;
    if (ntypes != 1)
        errs++;
    if (combiner != MPI_COMBINER_VECTOR)
        errs++;

    if (verbose) {
        if (nints != 3)
            fprintf(stderr, "inner vector nints = %d; should be 3\n", nints);
        if (nadds != 0)
            fprintf(stderr, "inner vector nadds = %d; should be 0\n", nadds);
        if (ntypes != 1)
            fprintf(stderr, "inner vector ntypes = %d; should be 1\n", ntypes);
        if (combiner != MPI_COMBINER_VECTOR)
            fprintf(stderr, "inner vector combiner = %s; should be vector\n",
                    combiner_to_string(combiner));
    }
    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    ints = malloc(nints * sizeof(*ints));
    if (nadds)
        adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    err = MPI_Type_get_contents(inner_vector_copy, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != 2)
        errs++;
    if (ints[1] != 1)
        errs++;
    if (ints[2] != 2)
        errs++;

    if (verbose) {
        if (ints[0] != 2)
            fprintf(stderr, "inner vector count = %d; should be 2\n", ints[0]);
        if (ints[1] != 1)
            fprintf(stderr, "inner vector blocklength = %d; should be 1\n", ints[1]);
        if (ints[2] != 2)
            fprintf(stderr, "inner vector stride = %d; should be 2\n", ints[2]);
    }
    if (errs) {
        if (verbose)
            fprintf(stderr, "aborting after %d errors\n", errs);
        return errs;
    }

    free(ints);
    if (nadds)
        free(adds);
    free(types);

    MPI_Type_free(&inner_vector_copy);
    MPI_Type_free(&inner_vector);
    MPI_Type_free(&outer_indexed);

    return MTestReturnValue(errs);
}

#ifdef HAVE_MPI_TYPE_CREATE_STRUCT
/* struct_of_basics_test(void)
 *
 * There's nothing simple about structs :).  Although this is an easy one.
 *
 * Returns number of errors encountered.
 *
 * NOT TESTED.
 */
int struct_of_basics_test(void)
{
    MPI_Datatype parent_type;
    int s_count = 3, s_blocklengths[3] = { 3, 2, 1 };
    MPI_Aint s_displacements[3] = { 10, 20, 30 };
    MPI_Datatype s_types[3] = { MPI_CHAR, MPI_INT, MPI_FLOAT };

    int nints, nadds, ntypes, combiner, *ints;
    MPI_Aint *adds = NULL;
    MPI_Datatype *types;

    int err, errs = 0;

    /* set up type */
    err = MPI_Type_create_struct(s_count, s_blocklengths, s_displacements, s_types, &parent_type);

    /* decode */
    err = MPI_Type_get_envelope(parent_type, &nints, &nadds, &ntypes, &combiner);

    if (nints != 4)
        errs++;
    if (nadds != 3)
        errs++;
    if (ntypes != 3)
        errs++;
    if (combiner != MPI_COMBINER_STRUCT)
        errs++;

    if (verbose) {
        if (nints != 4)
            fprintf(stderr, "nints = %d; should be 3\n", nints);
        if (nadds != 3)
            fprintf(stderr, "nadds = %d; should be 0\n", nadds);
        if (ntypes != 3)
            fprintf(stderr, "ntypes = %d; should be 3\n", ntypes);
        if (combiner != MPI_COMBINER_STRUCT)
            fprintf(stderr, "combiner = %s; should be struct\n", combiner_to_string(combiner));
    }

    ints = malloc(nints * sizeof(*ints));
    adds = malloc(nadds * sizeof(*adds));
    types = malloc(ntypes * sizeof(*types));

    err = MPI_Type_get_contents(parent_type, nints, nadds, ntypes, ints, adds, types);

    if (ints[0] != s_count)
        errs++;
    if (ints[1] != s_blocklengths[0])
        errs++;
    if (ints[2] != s_blocklengths[1])
        errs++;
    if (ints[3] != s_blocklengths[2])
        errs++;
    if (adds[0] != s_displacements[0])
        errs++;
    if (adds[1] != s_displacements[1])
        errs++;
    if (adds[2] != s_displacements[2])
        errs++;
    if (types[0] != s_types[0])
        errs++;
    if (types[1] != s_types[1])
        errs++;
    if (types[2] != s_types[2])
        errs++;

    if (verbose) {
        if (ints[0] != s_count)
            fprintf(stderr, "count = %d; should be %d\n", ints[0], s_count);
        if (ints[1] != s_blocklengths[0])
            fprintf(stderr, "blocklength[0] = %d; should be %d\n", ints[1], s_blocklengths[0]);
        if (ints[2] != s_blocklengths[1])
            fprintf(stderr, "blocklength[1] = %d; should be %d\n", ints[2], s_blocklengths[1]);
        if (ints[3] != s_blocklengths[2])
            fprintf(stderr, "blocklength[2] = %d; should be %d\n", ints[3], s_blocklengths[2]);
        if (adds[0] != s_displacements[0])
            fprintf(stderr, "displacement[0] = %d; should be %d\n", adds[0], s_displacements[0]);
        if (adds[1] != s_displacements[1])
            fprintf(stderr, "displacement[1] = %d; should be %d\n", adds[1], s_displacements[1]);
        if (adds[2] != s_displacements[2])
            fprintf(stderr, "displacement[2] = %d; should be %d\n", adds[2], s_displacements[2]);
        if (types[0] != s_types[0])
            fprintf(stderr, "type[0] does not match\n");
        if (types[1] != s_types[1])
            fprintf(stderr, "type[1] does not match\n");
        if (types[2] != s_types[2])
            fprintf(stderr, "type[2] does not match\n");
    }

    free(ints);
    free(adds);
    free(types);

    MPI_Type_free(&parent_type);

    return errs;
}
#endif

/* combiner_to_string(combiner)
 *
 * Converts a numeric combiner into a pointer to a string used for printing.
 */
char *combiner_to_string(int combiner)
{
    static char c_named[] = "named";
    static char c_contig[] = "contig";
    static char c_vector[] = "vector";
    static char c_hvector[] = "hvector";
    static char c_indexed[] = "indexed";
    static char c_hindexed[] = "hindexed";
    static char c_struct[] = "struct";
#ifdef HAVE_MPI2_COMBINERS
    static char c_dup[] = "dup";
    static char c_hvector_integer[] = "hvector_integer";
    static char c_hindexed_integer[] = "hindexed_integer";
    static char c_indexed_block[] = "indexed_block";
    static char c_struct_integer[] = "struct_integer";
    static char c_subarray[] = "subarray";
    static char c_darray[] = "darray";
    static char c_f90_real[] = "f90_real";
    static char c_f90_complex[] = "f90_complex";
    static char c_f90_integer[] = "f90_integer";
    static char c_resized[] = "resized";
#endif

    if (combiner == MPI_COMBINER_NAMED)
        return c_named;
    if (combiner == MPI_COMBINER_CONTIGUOUS)
        return c_contig;
    if (combiner == MPI_COMBINER_VECTOR)
        return c_vector;
    if (combiner == MPI_COMBINER_HVECTOR)
        return c_hvector;
    if (combiner == MPI_COMBINER_INDEXED)
        return c_indexed;
    if (combiner == MPI_COMBINER_HINDEXED)
        return c_hindexed;
    if (combiner == MPI_COMBINER_STRUCT)
        return c_struct;
#ifdef HAVE_MPI2_COMBINERS
    if (combiner == MPI_COMBINER_DUP)
        return c_dup;
    if (combiner == MPI_COMBINER_HVECTOR_INTEGER)
        return c_hvector_integer;
    if (combiner == MPI_COMBINER_HINDEXED_INTEGER)
        return c_hindexed_integer;
    if (combiner == MPI_COMBINER_INDEXED_BLOCK)
        return c_indexed_block;
    if (combiner == MPI_COMBINER_STRUCT_INTEGER)
        return c_struct_integer;
    if (combiner == MPI_COMBINER_SUBARRAY)
        return c_subarray;
    if (combiner == MPI_COMBINER_DARRAY)
        return c_darray;
    if (combiner == MPI_COMBINER_F90_REAL)
        return c_f90_real;
    if (combiner == MPI_COMBINER_F90_COMPLEX)
        return c_f90_complex;
    if (combiner == MPI_COMBINER_F90_INTEGER)
        return c_f90_integer;
    if (combiner == MPI_COMBINER_RESIZED)
        return c_resized;
#endif

    return NULL;
}

int parse_args(int argc, char **argv)
{
#ifdef HAVE_GET_OPT
    int ret;

    while ((ret = getopt(argc, argv, "v")) >= 0) {
        switch (ret) {
            case 'v':
                verbose = 1;
                break;
        }
    }
#else
#endif
    return 0;
}


// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.  All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * 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.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS 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 COPYRIGHT
// OWNER OR 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.

// Author: kenton@google.com (Kenton Varda)
//  Based on original Protocol Buffers design by
//  Sanjay Ghemawat, Jeff Dean, and others.

#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__
#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__

#include <map>
#include <string>

#include <google/protobuf/stubs/common.h>

namespace google {
namespace protobuf {
  class FieldDescriptor;       // descriptor.h
  namespace compiler {
    namespace java {
      class Context;           // context.h
      class ClassNameResolver; // name_resolver.h
    }
  }
  namespace io {
    class Printer;             // printer.h
  }
}

namespace protobuf {
namespace compiler {
namespace java {

// Generates code for an extension, which may be within the scope of some
// message or may be at file scope.  This is much simpler than FieldGenerator
// since extensions are just simple identifiers with interesting types.
class ExtensionGenerator {
 public:
  explicit ExtensionGenerator() {}
  virtual ~ExtensionGenerator() {}

  virtual void Generate(io::Printer* printer) = 0;

  // Returns an estimate of the number of bytes the printed code will compile to
  virtual int GenerateNonNestedInitializationCode(io::Printer* printer) = 0;

  // Returns an estimate of the number of bytes the printed code will compile to
  virtual int GenerateRegistrationCode(io::Printer* printer) = 0;

 protected:
  static void InitTemplateVars(const FieldDescriptor* descriptor,
                               const string& scope,
                               bool immutable,
                               ClassNameResolver* name_resolver,
                               std::map<string, string>* vars_pointer);

 private:
  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
};

class ImmutableExtensionGenerator : public ExtensionGenerator {
 public:
  explicit ImmutableExtensionGenerator(const FieldDescriptor* descriptor,
                                       Context* context);
  virtual ~ImmutableExtensionGenerator();

  virtual void Generate(io::Printer* printer);
  virtual int GenerateNonNestedInitializationCode(io::Printer* printer);
  virtual int GenerateRegistrationCode(io::Printer* printer);

 protected:
  const FieldDescriptor* descriptor_;
  Context* context_;
  ClassNameResolver* name_resolver_;
  string scope_;

 private:
  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableExtensionGenerator);
};

}  // namespace java
}  // namespace compiler
}  // namespace protobuf

}  // namespace google
#endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__


name: 'Wait'
description: 'Wait a designated number of milliseconds'
inputs:
  milliseconds:  # id of input
    description: 'number of milliseconds to wait'
    required: true
    default: '1000'
outputs:
  time: # output will be available to future steps
    description: 'The message to output'
runs:
  using: 'node12'
  main: 'dist/index.js'


<?xml version="1.0" encoding="UTF-8"?>
<!--

    ***************************************************************************
    Copyright (c) 2010 Qcadoo Limited
    Project: Qcadoo MES
    Version: 1.4

    This file is part of Qcadoo.

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

    This program 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 Affero General Public License for more details.

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

-->
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:mvc="http://www.springframework.org/schema/mvc"
	   xsi:schemaLocation="
		http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context-3.0.xsd
		http://www.springframework.org/schema/mvc
		http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

	<context:component-scan base-package="com.qcadoo.mes.materialFlowResources">
		<context:include-filter type="annotation"
								expression="org.springframework.stereotype.Controller"/>
	</context:component-scan>

	<mvc:resources mapping="/materialFlowResources/resources/**"
				   location="classpath:materialFlowResources/public/resources/"/>

</beans>


/* eslint-disable node/no-unsupported-features/es-syntax */

module.exports = async function*(x = 1, z = 0) {
    yield* [10 + x + z, 20 + x + z];
    await new Promise(res => process.nextTick(res));
    if (z === 666) throw new Error("An error occured");
    yield* [30 + x + z, 40 + x + z];
};


// +build darwin dragonfly freebsd netbsd openbsd
// +build !js

package logrus

import "golang.org/x/sys/unix"

const ioctlReadTermios = unix.TIOCGETA

func isTerminal(fd int) bool {
	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
	return err == nil
}