//==============================================================================
//
//	DO NO MODIFY THE CONTENT OF THIS FILE
//
//	This file contains the generic CFPlug-in code necessary for your generator
//	To complete your generator implement the function in GenerateThumbnailForURL/GeneratePreviewForURL.c
//
//==============================================================================

//  Created by Eberhard Rensch on 07.01.10.
//  Copyright 2010 Pleasant Software. All rights reserved.
//
//  This program is free software; you can redistribute it and/or modify it under
//  the terms of the GNU 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 General Public License for more details.
//
//  You should have received a copy of the GNU General Public License along with
//  this program; if not, see <http://www.gnu.org/licenses>.
//
//  Additional permission under GNU GPL version 3 section 7
//
//  If you modify this Program, or any covered work, by linking or combining it
//  with the P3DCore.framework (or a modified version of that framework),
//  containing parts covered by the terms of Pleasant Software's software license,
//  the licensors of this Program grant you additional permission to convey the
//  resulting work.
//

#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFPlugInCOM.h>
#include <CoreServices/CoreServices.h>
#include <QuickLook/QuickLook.h>

// -----------------------------------------------------------------------------
//	constants
// -----------------------------------------------------------------------------

// Don't modify this line
#define PLUGIN_ID "C02E94A7-9A81-43CB-9663-4C4F30F4D259"

//
// Below is the generic glue code for all plug-ins.
//
// You should not have to modify this code aside from changing
// names if you decide to change the names defined in the Info.plist
//

// -----------------------------------------------------------------------------
//	typedefs
// -----------------------------------------------------------------------------

// The thumbnail generation function to be implemented in GenerateThumbnailForURL.c
OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize);
void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail);

// The preview generation function to be implemented in GeneratePreviewForURL.c
OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options);
void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);

// The layout for an instance of QuickLookGeneratorPlugIn
typedef struct __QuickLookGeneratorPluginType
{
    void        *conduitInterface;
    CFUUIDRef    factoryID;
    UInt32       refCount;
} QuickLookGeneratorPluginType;

// -----------------------------------------------------------------------------
//	prototypes
// -----------------------------------------------------------------------------
//	Forward declaration for the IUnknown implementation.
//

QuickLookGeneratorPluginType  *AllocQuickLookGeneratorPluginType(CFUUIDRef inFactoryID);
void                         DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance);
HRESULT                      QuickLookGeneratorQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv);
void                        *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID);
ULONG                        QuickLookGeneratorPluginAddRef(void *thisInstance);
ULONG                        QuickLookGeneratorPluginRelease(void *thisInstance);

// -----------------------------------------------------------------------------
//	myInterfaceFtbl	definition
// -----------------------------------------------------------------------------
//	The QLGeneratorInterfaceStruct function table.
//
static QLGeneratorInterfaceStruct myInterfaceFtbl = {
    NULL,
    QuickLookGeneratorQueryInterface,
    QuickLookGeneratorPluginAddRef,
    QuickLookGeneratorPluginRelease,
    NULL,
    NULL,
    NULL,
    NULL
};

// -----------------------------------------------------------------------------
//	AllocQuickLookGeneratorPluginType
// -----------------------------------------------------------------------------
//	Utility function that allocates a new instance.
//      You can do some initial setup for the generator here if you wish
//      like allocating globals etc...
//
QuickLookGeneratorPluginType *AllocQuickLookGeneratorPluginType(CFUUIDRef inFactoryID)
{
    QuickLookGeneratorPluginType *theNewInstance;

    theNewInstance = (QuickLookGeneratorPluginType *)malloc(sizeof(QuickLookGeneratorPluginType));
    memset(theNewInstance,0,sizeof(QuickLookGeneratorPluginType));

        /* Point to the function table Malloc enough to store the stuff and copy the filler from myInterfaceFtbl over */
    theNewInstance->conduitInterface = malloc(sizeof(QLGeneratorInterfaceStruct));
    memcpy(theNewInstance->conduitInterface,&myInterfaceFtbl,sizeof(QLGeneratorInterfaceStruct));

        /*  Retain and keep an open instance refcount for each factory. */
    theNewInstance->factoryID = CFRetain(inFactoryID);
    CFPlugInAddInstanceForFactory(inFactoryID);

        /* This function returns the IUnknown interface so set the refCount to one. */
    theNewInstance->refCount = 1;
    return theNewInstance;
}

// -----------------------------------------------------------------------------
//	DeallocQuickLookGeneratorPluginType
// -----------------------------------------------------------------------------
//	Utility function that deallocates the instance when
//	the refCount goes to zero.
//      In the current implementation generator interfaces are never deallocated
//      but implement this as this might change in the future
//
void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance)
{
    CFUUIDRef theFactoryID;

    theFactoryID = thisInstance->factoryID;
        /* Free the conduitInterface table up */
    free(thisInstance->conduitInterface);

        /* Free the instance structure */
    free(thisInstance);
    if (theFactoryID){
        CFPlugInRemoveInstanceForFactory(theFactoryID);
        CFRelease(theFactoryID);
    }
}

// -----------------------------------------------------------------------------
//	QuickLookGeneratorQueryInterface
// -----------------------------------------------------------------------------
//	Implementation of the IUnknown QueryInterface function.
//
HRESULT QuickLookGeneratorQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv)
{
    CFUUIDRef interfaceID;

    interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault,iid);

    if (CFEqual(interfaceID,kQLGeneratorCallbacksInterfaceID)){
            /* If the Right interface was requested, bump the ref count,
             * set the ppv parameter equal to the instance, and
             * return good status.
             */
        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GenerateThumbnailForURL = GenerateThumbnailForURL;
        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelThumbnailGeneration = CancelThumbnailGeneration;
        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GeneratePreviewForURL = GeneratePreviewForURL;
        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelPreviewGeneration = CancelPreviewGeneration;
        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType*)thisInstance)->conduitInterface)->AddRef(thisInstance);
        *ppv = thisInstance;
        CFRelease(interfaceID);
        return S_OK;
    }else{
        /* Requested interface unknown, bail with error. */
        *ppv = NULL;
        CFRelease(interfaceID);
        return E_NOINTERFACE;
    }
}

// -----------------------------------------------------------------------------
// QuickLookGeneratorPluginAddRef
// -----------------------------------------------------------------------------
//	Implementation of reference counting for this type. Whenever an interface
//	is requested, bump the refCount for the instance. NOTE: returning the
//	refcount is a convention but is not required so don't rely on it.
//
ULONG QuickLookGeneratorPluginAddRef(void *thisInstance)
{
    ((QuickLookGeneratorPluginType *)thisInstance )->refCount += 1;
    return ((QuickLookGeneratorPluginType*) thisInstance)->refCount;
}

// -----------------------------------------------------------------------------
// QuickLookGeneratorPluginRelease
// -----------------------------------------------------------------------------
//	When an interface is released, decrement the refCount.
//	If the refCount goes to zero, deallocate the instance.
//
ULONG QuickLookGeneratorPluginRelease(void *thisInstance)
{
    ((QuickLookGeneratorPluginType*)thisInstance)->refCount -= 1;
    if (((QuickLookGeneratorPluginType*)thisInstance)->refCount == 0){
        DeallocQuickLookGeneratorPluginType((QuickLookGeneratorPluginType*)thisInstance );
        return 0;
    }else{
        return ((QuickLookGeneratorPluginType*) thisInstance )->refCount;
    }
}

// -----------------------------------------------------------------------------
//  QuickLookGeneratorPluginFactory
// -----------------------------------------------------------------------------
void *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID)
{
    QuickLookGeneratorPluginType *result;
    CFUUIDRef                 uuid;

        /* If correct type is being requested, allocate an
         * instance of kQLGeneratorTypeID and return the IUnknown interface.
         */
    if (CFEqual(typeID,kQLGeneratorTypeID)){
        uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID));
        result = AllocQuickLookGeneratorPluginType(uuid);
        CFRelease(uuid);
        return result;
    }
        /* If the requested type is incorrect, return NULL. */
    return NULL;
}


/**
 * \file dnn/src/cuda/relayout/opr_impl.cpp
 * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
 *
 * Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 */

#include "src/cuda/relayout/kern.cuh"
#include "src/cuda/relayout/kern_contiguous.cuh"
#include "src/cuda/relayout/kern_transpose.cuh"

#include "src/common/utils.h"
#include "src/cuda/utils.h"
#include "src/cuda/relayout/opr_impl.h"
#include "src/common/relayout_helper.h"

using namespace megdnn;
using namespace cuda;

RelayoutForwardImpl::Param::Param(const TensorND &src, const TensorND &dst,
        RelayoutForwardImpl *opr):
    m_src{src}, m_dst{dst}, m_opr{opr}
{
    opr->check_layout_and_canonize(m_src.layout, m_dst.layout);
}

bool RelayoutForwardImpl::Param::try_transpose() {
    relayout::TransposeParam transp;
    bool trans = relayout::is_transpose(m_src.layout, m_dst.layout, transp);
    if (!trans)
        return false;
    size_t dsize = transp.c * m_src.layout.dtype.size();
    if (dsize != 1 && dsize != 2 && dsize != 4)
        return false;

    if (m_src.layout.dtype == dtype::Float32() && transp.batch == 1 &&
        transp.c == 1) {
        auto handle = concrete_handle(m_opr->handle());
        cublas_check(cublasSgeam(
                handle->cublas_handle(), CUBLAS_OP_T, CUBLAS_OP_T, transp.m,
                transp.n, handle->one_device(), m_src.ptr<dt_float32>(),
                transp.n, handle->zero_device(), m_src.ptr<dt_float32>(),
                transp.n, m_dst.ptr<dt_float32>(), transp.m));
        return true;
    }
    float square_ratio =
            static_cast<float>(transp.m) / static_cast<float>(transp.n);
    if (transp.m < 32 || transp.n < 32 || square_ratio < 0.5f ||
        square_ratio > 2.f)
        return false;
    size_t batch = transp.batch, m = transp.m, n = transp.n;
    size_t lda = n, ldb = m, stride_A = m * n, stride_B = m * n;
    auto&& stream = m_opr->stream();
#define RUN(_dt)                                                           \
    do {                                                                   \
        typedef DTypeTrait<dtype::_dt>::ctype ctype;                       \
        copy_by_transpose<ctype>(                                          \
                reinterpret_cast<const ctype*>(m_src.raw_ptr),             \
                reinterpret_cast<ctype*>(m_dst.raw_ptr), batch, m, n, lda, \
                ldb, stride_A, stride_B, stream);                          \
        return true;                                                       \
    } while (0)
    switch (dsize) {
        case 1:
            RUN(Int8);
        case 2:
            RUN(Float16);
        case 4:
            RUN(Int32);
    }
    megdnn_assert(0, "bad dtype size");
}

bool RelayoutForwardImpl::Param::try_copy_contig() {
    auto &&lsrc = m_src.layout, &&ldst = m_dst.layout;
    if (lsrc.ndim != 1 || ldst.ndim != 1)
        return false;
    if (lsrc.stride[0] != 1 || ldst.stride[0] != 1)
        return false;
    cuda_check(cudaMemcpyAsync(
                m_dst.raw_ptr, m_src.raw_ptr,
                ldst.total_nr_elems() * dtype_size(),
                cudaMemcpyDeviceToDevice, m_opr->stream()));
    return true;
}

bool RelayoutForwardImpl::expand_dim2(
        TensorLayout &dst, const TensorLayout &src) {
    megdnn_assert(src.ndim == 2 && dst.ndim == 1);
    megdnn_assert(dst.shape[0] == src.shape[0] * src.shape[1]);
    if (src.stride[1] != 1 || dst.stride[0] != 1)
        return false;
    dst.ndim = 2;
    dst.stride[0] = src.shape[1];
    dst.stride[1] = 1;
    dst.shape[0] = src.shape[0];
    dst.shape[1] = src.shape[1];
    return true;
}

bool RelayoutForwardImpl::Param::try_copy_2d(bool cross_dev) {
    TensorLayout lsrc = m_src.layout, ldst = m_dst.layout;

    if (lsrc.ndim > 2 || ldst.ndim > 2)
        return false;

    if (ldst.ndim == 1 && lsrc.ndim == 1) {
        megdnn_assert(ldst.stride[0] != 1 || lsrc.stride[0] != 1);
        if (lsrc.stride[0] < 1 || ldst.stride[0] < 1 || !cross_dev)
            // test case: src=16x128x128(49152, 384, 3), dst=16x128x128(16384, 128, 1)
            // for both src and dst are one-dimensional, and one of them are not contiguous,
            // the relayout opr will call cudaMemcpy2DAsync, and the bandwidth=5GiB/s.
            // it is better to call copy_general, the bandwidth=100GiB/s.
            // call cudaMemcpy2DAsync when cross_dev, OR return false and call copy_general.
            return false;
        // extend to ndim == 2
        megdnn_assert(ldst.shape[0] == lsrc.shape[0]);
        ldst.ndim = lsrc.ndim = 2;
        ldst.shape[1] = lsrc.shape[1] = 1;
        ldst.stride[1] = lsrc.stride[1] = 1;
    } else if (ldst.ndim < 2) {
        if (!expand_dim2(ldst, lsrc))
            return false;
    } else if (lsrc.ndim < 2) {
        if (!expand_dim2(lsrc, ldst))
            return false;
    }
    if (ldst.stride[1] != 1 || lsrc.stride[1] != 1 ||
            ldst.shape[0] != lsrc.shape[0] ||
            ldst.shape[1] != lsrc.shape[1] ||
            ldst.stride[0] < static_cast<ptrdiff_t>(ldst.shape[1]) ||
            lsrc.stride[0] < static_cast<ptrdiff_t>(ldst.shape[1]))
        return false;

    auto dsize = dtype_size();
    cuda_check(cudaMemcpy2DAsync(
            m_dst.raw_ptr, ldst.stride[0] * dsize,
            m_src.raw_ptr, lsrc.stride[0] * dsize,
            ldst.shape[1] * dsize, ldst.shape[0],
            cudaMemcpyDeviceToDevice, m_opr->stream()));

    return true;
};

bool RelayoutForwardImpl::Param::try_copy_last_contig() {
    //! check if the last stride is contiguous
    auto gcd = [](size_t a, size_t b) {
        if (a > b) std::swap(a, b);
        size_t c;
        while (a != 0) {
            c = a;
            a = b % a;
            b = c;
        }
        return b;
    };
    auto has_negative_stride = [](const TensorLayout& layout) {
        rep(i, layout.ndim) {
            if (layout.stride[i] < 0) return true;
        }
        return false;
    };

    TensorLayout lsrc = m_src.layout, ldst = m_dst.layout;
    if (lsrc.stride[lsrc.ndim - 1] == 1 && ldst.stride[ldst.ndim - 1] == 1 &&
            !has_negative_stride(lsrc) && !has_negative_stride(ldst)) {
        size_t contiguous_size =
            gcd(lsrc.shape[lsrc.ndim - 1], ldst.shape[ldst.ndim - 1]);
        if (contiguous_size > 1) {
            copy_last_contiguous(m_dst, m_src, contiguous_size,
                                 m_opr->stream());
            return true;
        }
    }
    return false;
}

void RelayoutForwardImpl::Param::copy_general() {

    copy_noncontig_general(m_dst, m_src, m_opr->stream());
}

void RelayoutForwardImpl::exec(_megdnn_tensor_in src, _megdnn_tensor_out dst,
                               Handle *src_handle) {
    bool cross_dev = false;

    // check whether cross device copy
    if (src_handle && src_handle != handle()) {
        megcoreDeviceHandle_t dev;
        megcoreGetDeviceHandle(src_handle->megcore_computing_handle(), &dev);
        megcorePlatform_t plat;
        megcoreGetPlatform(dev, &plat);
        megdnn_assert(plat == megcorePlatformCUDA,
                      "only relayout between cuda devices are supported");
        int dst_dev_id = -1, src_dev_id = -1;
        megcoreGetDeviceID(dev, &src_dev_id);

        megcoreGetDeviceHandle(this->handle()->megcore_computing_handle(),
                               &dev);
        megcoreGetDeviceID(dev, &dst_dev_id);

        megdnn_assert(src_dev_id >= 0 && dst_dev_id >= 0);
        cross_dev = src_dev_id != dst_dev_id;
    }
    Param param{src, dst, this};
    if (!param.try_transpose() && !param.try_copy_contig() &&
        !param.try_copy_2d(cross_dev) && !param.try_copy_last_contig()) {
        megdnn_assert(!cross_dev,
                      "cross-device general non-contig copy unsupported");
        param.copy_general();
    }
}

// vim: syntax=cpp.doxygen


/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

var App = require('app');

var cmp = Ember.computed;

App.CapschedAdvancedController = Ember.Controller.extend({
  needs: ['capsched'],

  actions: {
    rollbackQueueMappingProps: function() {
      var tempRefreshNeeded = this.get('isRefreshOrRestartNeeded');
      var sched = this.get('scheduler'),
      attributes = sched.changedAttributes(),
      props = this.queueMappingProps;
      props.forEach(function(prop) {
        if (attributes.hasOwnProperty(prop)) {
          sched.set(prop, attributes[prop][0]);
        }
      });
      this.set('isRefreshOrRestartNeeded', tempRefreshNeeded);
    },
    rollbackProp: function(prop, item) {
      var tempRefreshNeeded = this.get('isRefreshOrRestartNeeded');
      var attributes = item.changedAttributes();
      if (attributes.hasOwnProperty(prop)) {
        item.set(prop, attributes[prop][0]);
      }
      this.set('isRefreshOrRestartNeeded', tempRefreshNeeded);
      this.afterRollbackProp();
    },
    showSaveConfigDialog: function(mode) {
      if (mode) {
        this.set('saveMode', mode);
      } else {
        this.set('saveMode', '');
      }
      this.set('isSaveConfigDialogOpen', true);
    },
    showConfirmDialog: function() {
      this.set('isConfirmDialogOpen', true);
    }
  },

  initEvents: function() {
    this.get('eventBus').subscribe('beforeSavingConfigs', function() {
      this.set("tempRefreshNeed", this.get('isRefreshOrRestartNeeded') || false);
    }.bind(this));

    this.get('eventBus').subscribe('afterConfigsSaved', function(refresh) {
      this.set('isRefreshOrRestartNeeded', refresh !== undefined? refresh:this.get('tempRefreshNeed'));
    }.bind(this));
  }.on('init'),

  teardownEvents: function() {
    this.get('eventBus').unsubscribe('beforeSavingConfigs');
    this.get('eventBus').unsubscribe('afterConfigsSaved');
  }.on('willDestroy'),

  isOperator: cmp.alias('controllers.capsched.isOperator'),
  scheduler: cmp.alias('controllers.capsched.content'),
  queues: cmp.alias('controllers.capsched.queues'),

  isQueueMappingsDirty: false,
  queueMappingProps: ['queue_mappings', 'queue_mappings_override_enable'],
  isRefreshOrRestartNeeded: false,
  isQueueMappignsNeedSaveOrRefresh: cmp.or('isQueueMappingsDirty', 'isRefreshOrRestartNeeded'),

  saveMode: '',

  isConfirmDialogOpen: false,
  isSaveConfigDialogOpen: false,

  configNote: cmp.alias('store.configNote'),

  queueMappingsDidChange: function() {
    var sched = this.get('scheduler'),
    attributes = sched.changedAttributes(),
    props = this.queueMappingProps;
    var isDirty = props.any(function(prop){
      return attributes.hasOwnProperty(prop);
    });
    this.set('isQueueMappingsDirty', isDirty);
    this.set('isRefreshOrRestartNeeded', isDirty);
  }.observes('scheduler.queue_mappings', 'scheduler.queue_mappings_override_enable'),

  forceRefreshRequired: function() {
    return !this.get('isQueueMappingsDirty') && this.get('isRefreshOrRestartNeeded');
  }.property('isQueueMappingsDirty', 'isRefreshOrRestartNeeded'),

  afterRollbackProp: function() {
    if (this.get('isQueueMappingsDirty')) {
      this.set('isRefreshOrRestartNeeded', true);
    } else {
      this.set('isRefreshOrRestartNeeded', false);
    }
  }
});


/*++

Copyright (c) 1995  Microsoft Corporation

Module Name:

    ppdchar.c

Abstract:

    PS driver PPD parser - character classfication table

[Notes:]

    The PPD spec is very ad hoc. There are various rules
    regarding what character can and can't appear in what
    part of an entry. We'll use a table to classify them.

Revision History:

    4/19/95 -davidx-
        Created it.

    mm/dd/yy -author-
        description

--*/

#include <windef.h>
#include "ppdchar.h"

// Character classification table

BYTE _charTable[256] = {

    /*   0 -   */   0,
    /*   1 -   */   0,
    /*   2 -   */   0,
    /*   3 -   */   0,
    /*   4 -   */   0,
    /*   5 -   */   0,
    /*   6 -   */   0,
    /*   7 -   */   0,
    /*   8 -   */   0,
    /*   9 -   */   CC_VALID | CC_XLATION | CC_SPACE,
    /*  10 -   */   CC_VALID | CC_NEWLINE,
    /*  11 -   */   0,
    /*  12 -   */   0,
    /*  13 -   */   CC_VALID | CC_NEWLINE,
    /*  14 -   */   0,
    /*  15 -   */   0,
    /*  16 -   */   0,
    /*  17 -   */   0,
    /*  18 -   */   0,
    /*  19 -   */   0,
    /*  20 -   */   0,
    /*  21 -   */   0,
    /*  22 -   */   0,
    /*  23 -   */   0,
    /*  24 -   */   0,
    /*  25 -   */   0,
    /*  26 -   */   0,
    /*  27 -   */   0,
    /*  28 -   */   0,
    /*  29 -   */   0,
    /*  30 -   */   0,
    /*  31 -   */   0,
    /*  32 -   */   CC_VALID | CC_XLATION | CC_SPACE,
    /*  33 - ! */   CC_NORMAL,
    /*  34 - " */   CC_NORMAL,
    /*  35 - # */   CC_NORMAL,
    /*  36 - $ */   CC_NORMAL,
    /*  37 - % */   CC_NORMAL,
    /*  38 - & */   CC_NORMAL,
    /*  39 - ' */   CC_NORMAL,
    /*  40 - ( */   CC_NORMAL,
    /*  41 - ) */   CC_NORMAL,
    /*  42 - * */   CC_NORMAL,
    /*  43 - + */   CC_NORMAL,
    /*  44 - , */   CC_NORMAL,
    /*  45 - - */   CC_NORMAL,
    /*  46 - . */   CC_NORMAL,
    /*  47 - / */   CC_VALID | CC_KEYWORD | CC_XLATION,
    /*  48 - 0 */   CC_NORMAL | CC_DIGIT,
    /*  49 - 1 */   CC_NORMAL | CC_DIGIT,
    /*  50 - 2 */   CC_NORMAL | CC_DIGIT,
    /*  51 - 3 */   CC_NORMAL | CC_DIGIT,
    /*  52 - 4 */   CC_NORMAL | CC_DIGIT,
    /*  53 - 5 */   CC_NORMAL | CC_DIGIT,
    /*  54 - 6 */   CC_NORMAL | CC_DIGIT,
    /*  55 - 7 */   CC_NORMAL | CC_DIGIT,
    /*  56 - 8 */   CC_NORMAL | CC_DIGIT,
    /*  57 - 9 */   CC_NORMAL | CC_DIGIT,
    /*  58 - : */   CC_VALID,
    /*  59 - ; */   CC_NORMAL,
    /*  60 - < */   CC_NORMAL,
    /*  61 - = */   CC_NORMAL,
    /*  62 - > */   CC_NORMAL,
    /*  63 - ? */   CC_NORMAL,
    /*  64 - @ */   CC_NORMAL,
    /*  65 - A */   CC_NORMAL | CC_HEX,
    /*  66 - B */   CC_NORMAL | CC_HEX,
    /*  67 - C */   CC_NORMAL | CC_HEX,
    /*  68 - D */   CC_NORMAL | CC_HEX,
    /*  69 - E */   CC_NORMAL | CC_HEX,
    /*  70 - F */   CC_NORMAL | CC_HEX,
    /*  71 - G */   CC_NORMAL,
    /*  72 - H */   CC_NORMAL,
    /*  73 - I */   CC_NORMAL,
    /*  74 - J */   CC_NORMAL,
    /*  75 - K */   CC_NORMAL,
    /*  76 - L */   CC_NORMAL,
    /*  77 - M */   CC_NORMAL,
    /*  78 - N */   CC_NORMAL,
    /*  79 - O */   CC_NORMAL,
    /*  80 - P */   CC_NORMAL,
    /*  81 - Q */   CC_NORMAL,
    /*  82 - R */   CC_NORMAL,
    /*  83 - S */   CC_NORMAL,
    /*  84 - T */   CC_NORMAL,
    /*  85 - U */   CC_NORMAL,
    /*  86 - V */   CC_NORMAL,
    /*  87 - W */   CC_NORMAL,
    /*  88 - X */   CC_NORMAL,
    /*  89 - Y */   CC_NORMAL,
    /*  90 - Z */   CC_NORMAL,
    /*  91 - [ */   CC_NORMAL,
    /*  92 - \ */   CC_NORMAL,
    /*  93 - ] */   CC_NORMAL,
    /*  94 - ^ */   CC_NORMAL,
    /*  95 - _ */   CC_NORMAL,
    /*  96 - ` */   CC_NORMAL,
    /*  97 - a */   CC_NORMAL | CC_HEX,
    /*  98 - b */   CC_NORMAL | CC_HEX,
    /*  99 - c */   CC_NORMAL | CC_HEX,
    /* 100 - d */   CC_NORMAL | CC_HEX,
    /* 101 - e */   CC_NORMAL | CC_HEX,
    /* 102 - f */   CC_NORMAL | CC_HEX,
    /* 103 - g */   CC_NORMAL,
    /* 104 - h */   CC_NORMAL,
    /* 105 - i */   CC_NORMAL,
    /* 106 - j */   CC_NORMAL,
    /* 107 - k */   CC_NORMAL,
    /* 108 - l */   CC_NORMAL,
    /* 109 - m */   CC_NORMAL,
    /* 110 - n */   CC_NORMAL,
    /* 111 - o */   CC_NORMAL,
    /* 112 - p */   CC_NORMAL,
    /* 113 - q */   CC_NORMAL,
    /* 114 - r */   CC_NORMAL,
    /* 115 - s */   CC_NORMAL,
    /* 116 - t */   CC_NORMAL,
    /* 117 - u */   CC_NORMAL,
    /* 118 - v */   CC_NORMAL,
    /* 119 - w */   CC_NORMAL,
    /* 120 - x */   CC_NORMAL,
    /* 121 - y */   CC_NORMAL,
    /* 122 - z */   CC_NORMAL,
    /* 123 - { */   CC_NORMAL,
    /* 124 - | */   CC_NORMAL,
    /* 125 - } */   CC_NORMAL,
    /* 126 - ~ */   CC_NORMAL,
    /* 127 -   */   0,
    /* 128 -   */   0,
    /* 129 -   */   0,
    /* 130 -   */   0,
    /* 131 -   */   0,
    /* 132 -   */   0,
    /* 133 -   */   0,
    /* 134 -   */   0,
    /* 135 -   */   0,
    /* 136 -   */   0,
    /* 137 -   */   0,
    /* 138 -   */   0,
    /* 139 -   */   0,
    /* 140 -   */   0,
    /* 141 -   */   0,
    /* 142 -   */   0,
    /* 143 -   */   0,
    /* 144 -   */   0,
    /* 145 -   */   0,
    /* 146 -   */   0,
    /* 147 -   */   0,
    /* 148 -   */   0,
    /* 149 -   */   0,
    /* 150 -   */   0,
    /* 151 -   */   0,
    /* 152 -   */   0,
    /* 153 -   */   0,
    /* 154 -   */   0,
    /* 155 -   */   0,
    /* 156 -   */   0,
    /* 157 -   */   0,
    /* 158 -   */   0,
    /* 159 -   */   0,
    /* 160 -   */   0,
    /* 161 -   */   0,
    /* 162 -   */   0,
    /* 163 -   */   0,
    /* 164 -   */   0,
    /* 165 -   */   0,
    /* 166 -   */   0,
    /* 167 -   */   0,
    /* 168 -   */   0,
    /* 169 -   */   0,
    /* 170 -   */   0,
    /* 171 -   */   0,
    /* 172 -   */   0,
    /* 173 -   */   0,
    /* 174 -   */   0,
    /* 175 -   */   0,
    /* 176 -   */   0,
    /* 177 -   */   0,
    /* 178 -   */   0,
    /* 179 -   */   0,
    /* 180 -   */   0,
    /* 181 -   */   0,
    /* 182 -   */   0,
    /* 183 -   */   0,
    /* 184 -   */   0,
    /* 185 -   */   0,
    /* 186 -   */   0,
    /* 187 -   */   0,
    /* 188 -   */   0,
    /* 189 -   */   0,
    /* 190 -   */   0,
    /* 191 -   */   0,
    /* 192 -   */   0,
    /* 193 -   */   0,
    /* 194 -   */   0,
    /* 195 -   */   0,
    /* 196 -   */   0,
    /* 197 -   */   0,
    /* 198 -   */   0,
    /* 199 -   */   0,
    /* 200 -   */   0,
    /* 201 -   */   0,
    /* 202 -   */   0,
    /* 203 -   */   0,
    /* 204 -   */   0,
    /* 205 -   */   0,
    /* 206 -   */   0,
    /* 207 -   */   0,
    /* 208 -   */   0,
    /* 209 -   */   0,
    /* 210 -   */   0,
    /* 211 -   */   0,
    /* 212 -   */   0,
    /* 213 -   */   0,
    /* 214 -   */   0,
    /* 215 -   */   0,
    /* 216 -   */   0,
    /* 217 -   */   0,
    /* 218 -   */   0,
    /* 219 -   */   0,
    /* 220 -   */   0,
    /* 221 -   */   0,
    /* 222 -   */   0,
    /* 223 -   */   0,
    /* 224 -   */   0,
    /* 225 -   */   0,
    /* 226 -   */   0,
    /* 227 -   */   0,
    /* 228 -   */   0,
    /* 229 -   */   0,
    /* 230 -   */   0,
    /* 231 -   */   0,
    /* 232 -   */   0,
    /* 233 -   */   0,
    /* 234 -   */   0,
    /* 235 -   */   0,
    /* 236 -   */   0,
    /* 237 -   */   0,
    /* 238 -   */   0,
    /* 239 -   */   0,
    /* 240 -   */   0,
    /* 241 -   */   0,
    /* 242 -   */   0,
    /* 243 -   */   0,
    /* 244 -   */   0,
    /* 245 -   */   0,
    /* 246 -   */   0,
    /* 247 -   */   0,
    /* 248 -   */   0,
    /* 249 -   */   0,
    /* 250 -   */   0,
    /* 251 -   */   0,
    /* 252 -   */   0,
    /* 253 -   */   0,
    /* 254 -   */   0,
    /* 255 -   */   0,

};

INT
HexValue(
    char    chDigit
    )

/*++

Routine Description:

    Return the value of a hex-decimal digit

Arguments:

    chDigit - valid hex-decimal digit character [0-9] [a-f] [A-F]

Return Value:

    integer value corresponding to the hex digit

--*/

{
    return
        (IsDigit(chDigit)) ?
            (chDigit - '0') :
            (chDigit >= 'a' && chDigit <= 'f') ?
                (chDigit - 'a' + 10) :
                (chDigit - 'A' + 10);
}


.sort-table {
	font:		Icon;
	border:		1px Solid ThreeDShadow;
	background:	Window;
	color:		WindowText;
}

.sort-table thead {
	background:	ButtonFace;
}

.sort-table td {
	padding:	2px 5px;
}

.sort-table thead td {
	border:			1px solid;
	border-color:	ButtonHighlight ButtonShadow
					ButtonShadow ButtonHighlight;
	cursor:			default;
}

.sort-table thead td:active {
	border-color:	ButtonShadow ButtonHighlight
					ButtonHighlight ButtonShadow;
	padding:		3px 4px 1px 6px;
}

.sort-table thead td[_sortType=None]:active {
	border-color:	ButtonHighlight ButtonShadow
					ButtonShadow ButtonHighlight;
	padding:		2px 5px;
}

.sort-arrow {
	width:					11px;
	height:					11px;
	background-position:	center center;
	background-repeat:		no-repeat;
	margin:					0 2px;
}

.sort-arrow.descending {
	background-image:		url("../images/downsimple.png");

}

.sort-arrow.ascending {
	background-image:		url("../images/upsimple.png");
}


{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.services.mame;
  mame = "mame${lib.optionalString pkgs.stdenv.is64bit "64"}";
in
{
  options = {
    services.mame = {
      enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
          Whether to setup TUN/TAP Ethernet interface for MAME emulator.
        '';
      };
      user = mkOption {
        type = types.str;
        description = ''
          User from which you run MAME binary.
        '';
      };
      hostAddr = mkOption {
        type = types.str;
        description = ''
          IP address of the host system. Usually an address of the main network
          adapter or the adapter through which you get an internet connection.
        '';
        example = "192.168.31.156";
      };
      emuAddr = mkOption {
        type = types.str;
        description = ''
          IP address of the guest system. The same you set inside guest OS under
          MAME. Should be on the same subnet as <option>services.mame.hostAddr</option>.
        '';
        example = "192.168.31.155";
      };
    };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = [ pkgs.mame ];

    security.wrappers."${mame}" = {
      source = "${pkgs.mame}/bin/${mame}";
      capabilities = "cap_net_admin,cap_net_raw+eip";
    };

    systemd.services.mame = {
      description = "MAME TUN/TAP Ethernet interface";
      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];
      path = [ pkgs.iproute ];
      serviceConfig = {
        Type = "oneshot";
        RemainAfterExit = true;
        ExecStart = "${pkgs.mame}/bin/taputil.sh -c ${cfg.user} ${cfg.emuAddr} ${cfg.hostAddr} -";
        ExecStop = "${pkgs.mame}/bin/taputil.sh -d ${cfg.user}";
      };
    };
  };

  meta.maintainers = with lib.maintainers; [ gnidorah ];
}


################################################################################
#
# qt5connectivity
#
################################################################################

QT5CONNECTIVITY_VERSION = $(QT5_VERSION)
QT5CONNECTIVITY_SITE = $(QT5_SITE)
QT5CONNECTIVITY_SOURCE = qtconnectivity-opensource-src-$(QT5CONNECTIVITY_VERSION).tar.xz
QT5CONNECTIVITY_DEPENDENCIES = bluez_utils qt5base
QT5CONNECTIVITY_INSTALL_STAGING = YES

ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
QT5CONNECTIVITY_LICENSE = LGPLv2.1 with exception or LGPLv3 or GPLv2
QT5CONNECTIVITY_LICENSE_FILES = LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.GPLv2
else
QT5CONNECTIVITY_LICENSE = Commercial license
QT5CONNECTIVITY_REDISTRIBUTE = NO
endif

ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
QT5CONNECTIVITY_DEPENDENCIES += qt5declarative
endif

define QT5CONNECTIVITY_CONFIGURE_CMDS
	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
endef

define QT5CONNECTIVITY_BUILD_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
endef

define QT5CONNECTIVITY_INSTALL_STAGING_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
	$(QT5_LA_PRL_FILES_FIXUP)
endef

ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
define QT5CONNECTIVITY_INSTALL_TARGET_QMLS
	cp -dpfr $(STAGING_DIR)/usr/qml/QtBluetooth $(TARGET_DIR)/usr/qml/
endef
endif

define QT5CONNECTIVITY_INSTALL_TARGET_CMDS
	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Bluetooth.so.* $(TARGET_DIR)/usr/lib
	$(QT5CONNECTIVITY_INSTALL_TARGET_QMLS)
endef

$(eval $(generic-package))


import 'source-map-support/register'
import { DynamoDB } from 'aws-sdk'
import {
  makeErrorResponse,
  makeSuccessResponse
} from '../../infrastructure/http/makeResponse'

const region = process.env.REGION || 'us-east-1'
const linksTable = process.env.LINKS_TABLE || 'links'
const dynamoClient = new DynamoDB.DocumentClient({ region })

export const handler = async (event, context, cb) => {
  if (!event.queryStringParameters || !event.queryStringParameters.linkHash) {
    return cb(null, makeErrorResponse(404, 'link not found'))
  }

  const linkHash = event.queryStringParameters.linkHash

  return dynamoClient
    .get({
      TableName: linksTable,
      Key: {
        linkHash
      }
    })
    .promise()
    .then(res => {
      return res.Item
    })
    .then(data => {
      if (!data) {
        return cb(null, makeErrorResponse(404, 'link not found'))
      } else {
        return cb(null, makeSuccessResponse(data))
      }
    })
    .catch(err => {
      cb(null, makeErrorResponse(err))
    })
}


# This file is distributed under the same license as the Django package.
#
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-03-15 13:20-0400\n"
"PO-Revision-Date: 2011-03-04 18:45+0000\n"
"Last-Translator: Jannis <jannis@leidel.info>\n"
"Language-Team: Hungarian <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

#: models.py:41
msgid "session key"
msgstr "munkamenet kulcs"

#: models.py:43
msgid "session data"
msgstr "munkamenet adat"

#: models.py:44
msgid "expire date"
msgstr "lejárat dátuma"

#: models.py:49
msgid "session"
msgstr "munkamenet"

#: models.py:50
msgid "sessions"
msgstr "munkamenetek"


REBOL [
	System: "REBOL [R3] Language Interpreter and Run-time Environment"
	Title: "REBOL 3 Mezzanine: End of Mezz"
	Rights: {
		Copyright 2012 REBOL Technologies
		REBOL is a trademark of REBOL Technologies
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
]

funco: :func ; save it for expert usage

; Final FUNC definition:
func: funco [
	{Defines a user function with given spec and body.}
	spec [block!] {Help string (opt) followed by arg words (and opt type and string)}
	body [block!] {The body block of the function}
][
	make function! copy/deep reduce [spec body] ; (now it deep copies)
]

; Quick test runner (temporary):
t: does [do %test.r]


<Application
    x:Class="helloworld.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:helloworld">

</Application>


# Tenko parser test case

- Path: tests/testcases/assigns/to_keyword/should_listen_to_use_strict_directive_in_global5breturn5d.md

> :: assigns : to keyword
>
> ::> should listen to use strict directive in global5breturn5d

## Input

`````js
"use strict"; (return = "sentinal 48945666");
`````

## Output

_Note: the whole output block is auto-generated. Manual changes will be overwritten!_

Below follow outputs in five parsing modes: sloppy, sloppy+annexb, strict script, module, module+annexb.

Note that the output parts are auto-generated by the test runner to reflect actual result.

### Sloppy mode

Parsed with script goal and as if the code did not start with strict mode header.

`````
throws: Parser error!
  Cannot use this name (`return`) as a variable name because: Cannot never use this reserved word as a variable name

start@1:0, error@1:15
╔══╦═════════════════
 1 ║ "use strict"; (return = "sentinal 48945666");
   ║                ^^^^^^------- error
╚══╩═════════════════

`````

### Strict mode

Parsed with script goal but as if it was starting with `"use strict"` at the top.

_Output same as sloppy mode._

### Module goal

Parsed with the module goal.

_Output same as sloppy mode._

### Sloppy mode with AnnexB

Parsed with script goal with AnnexB rules enabled and as if the code did not start with strict mode header.

_Output same as sloppy mode._

### Module goal with AnnexB

Parsed with the module goal with AnnexB rules enabled.

_Output same as sloppy mode._


import pino from "pino"

const logger = pino({ level: process.env.LOG_LEVEL || inferDefaultLogLevel() })

export const log = logger

function inferDefaultLogLevel() {
  if (process.env.NODE_ENV === "test" && process.env.DEBUG_TEST == null) {
    return "silent"
  }

  if (process.env.NODE_ENV === "production") {
    return "info"
  }

  return "debug"
}


<!DOCTYPE html>
<meta charset=utf-8>
<title>Test for logical properties of input type=color in the UA stylesheet</title>

  <input type=color>

  <input type=color class=a>

  <input type=color>

  <input type=color class=a>

  <input type=color>

  <input type=color class=a>


<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema

    Version 2.0

    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.

    Example:

    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>

    There are any number of "resheader" rows that contain simple
    name/value pairs.

    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.

    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:

    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.

    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
</root>


/*
Copyright The Kubernetes Authors.

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.
*/

// Code generated by client-gen. DO NOT EDIT.

package v1beta1

import (
	"context"
	"time"

	v1beta1 "k8s.io/api/scheduling/v1beta1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	scheme "k8s.io/client-go/kubernetes/scheme"
	rest "k8s.io/client-go/rest"
)

// PriorityClassesGetter has a method to return a PriorityClassInterface.
// A group's client should implement this interface.
type PriorityClassesGetter interface {
	PriorityClasses() PriorityClassInterface
}

// PriorityClassInterface has methods to work with PriorityClass resources.
type PriorityClassInterface interface {
	Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (*v1beta1.PriorityClass, error)
	Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (*v1beta1.PriorityClass, error)
	Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
	DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
	Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PriorityClass, error)
	List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error)
	Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
	Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error)
	PriorityClassExpansion
}

// priorityClasses implements PriorityClassInterface
type priorityClasses struct {
	client rest.Interface
}

// newPriorityClasses returns a PriorityClasses
func newPriorityClasses(c *SchedulingV1beta1Client) *priorityClasses {
	return &priorityClasses{
		client: c.RESTClient(),
	}
}

// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) {
	result = &v1beta1.PriorityClass{}
	err = c.client.Get().
		Resource("priorityclasses").
		Name(name).
		VersionedParams(&options, scheme.ParameterCodec).
		Do(ctx).
		Into(result)
	return
}

// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) {
	var timeout time.Duration
	if opts.TimeoutSeconds != nil {
		timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
	}
	result = &v1beta1.PriorityClassList{}
	err = c.client.Get().
		Resource("priorityclasses").
		VersionedParams(&opts, scheme.ParameterCodec).
		Timeout(timeout).
		Do(ctx).
		Into(result)
	return
}

// Watch returns a watch.Interface that watches the requested priorityClasses.
func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
	var timeout time.Duration
	if opts.TimeoutSeconds != nil {
		timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
	}
	opts.Watch = true
	return c.client.Get().
		Resource("priorityclasses").
		VersionedParams(&opts, scheme.ParameterCodec).
		Timeout(timeout).
		Watch(ctx)
}

// Create takes the representation of a priorityClass and creates it.  Returns the server's representation of the priorityClass, and an error, if there is any.
func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) {
	result = &v1beta1.PriorityClass{}
	err = c.client.Post().
		Resource("priorityclasses").
		VersionedParams(&opts, scheme.ParameterCodec).
		Body(priorityClass).
		Do(ctx).
		Into(result)
	return
}

// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) {
	result = &v1beta1.PriorityClass{}
	err = c.client.Put().
		Resource("priorityclasses").
		Name(priorityClass.Name).
		VersionedParams(&opts, scheme.ParameterCodec).
		Body(priorityClass).
		Do(ctx).
		Into(result)
	return
}

// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
	return c.client.Delete().
		Resource("priorityclasses").
		Name(name).
		Body(&opts).
		Do(ctx).
		Error()
}

// DeleteCollection deletes a collection of objects.
func (c *priorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
	var timeout time.Duration
	if listOpts.TimeoutSeconds != nil {
		timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
	}
	return c.client.Delete().
		Resource("priorityclasses").
		VersionedParams(&listOpts, scheme.ParameterCodec).
		Timeout(timeout).
		Body(&opts).
		Do(ctx).
		Error()
}

// Patch applies the patch and returns the patched priorityClass.
func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) {
	result = &v1beta1.PriorityClass{}
	err = c.client.Patch(pt).
		Resource("priorityclasses").
		Name(name).
		SubResource(subresources...).
		VersionedParams(&opts, scheme.ParameterCodec).
		Body(data).
		Do(ctx).
		Into(result)
	return
}


// Decompiled with JetBrains decompiler
// Type: UnityEngine.Input
// Assembly: UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A8FF7A2C-E4EE-4232-AB17-3FCABEC16496
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.dll

using System;
using System.Runtime.CompilerServices;

namespace UnityEngine
{
  /// <summary>
  ///   <para>Interface into the Input system.</para>
  /// </summary>
  public sealed class Input
  {
    private static Gyroscope m_MainGyro;
    private static LocationService locationServiceInstance;
    private static Compass compassInstance;

    /// <summary>
    ///   <para>This property controls if input sensors should be compensated for screen orientation.</para>
    /// </summary>
    public static extern bool compensateSensors { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }

    [Obsolete("isGyroAvailable property is deprecated. Please use SystemInfo.supportsGyroscope instead.")]
    public static extern bool isGyroAvailable { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Returns default gyroscope.</para>
    /// </summary>
    public static Gyroscope gyro
    {
      get
      {
        if (Input.m_MainGyro == null)
          Input.m_MainGyro = new Gyroscope(Input.mainGyroIndex_Internal());
        return Input.m_MainGyro;
      }
    }

    /// <summary>
    ///   <para>The current mouse position in pixel coordinates. (Read Only)</para>
    /// </summary>
    public static Vector3 mousePosition
    {
      get
      {
        Vector3 vector3;
        Input.INTERNAL_get_mousePosition(out vector3);
        return vector3;
      }
    }

    /// <summary>
    ///   <para>The current mouse scroll delta. (Read Only)</para>
    /// </summary>
    public static Vector2 mouseScrollDelta
    {
      get
      {
        Vector2 vector2;
        Input.INTERNAL_get_mouseScrollDelta(out vector2);
        return vector2;
      }
    }

    public static extern bool mousePresent { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Enables/Disables mouse simulation with touches. By default this option is enabled.</para>
    /// </summary>
    public static extern bool simulateMouseWithTouches { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Is any key or mouse button currently held down? (Read Only)</para>
    /// </summary>
    public static extern bool anyKey { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Returns true the first frame the user hits any key or mouse button. (Read Only)</para>
    /// </summary>
    public static extern bool anyKeyDown { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Returns the keyboard input entered this frame. (Read Only)</para>
    /// </summary>
    public static extern string inputString { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Last measured linear acceleration of a device in three-dimensional space. (Read Only)</para>
    /// </summary>
    public static Vector3 acceleration
    {
      get
      {
        Vector3 vector3;
        Input.INTERNAL_get_acceleration(out vector3);
        return vector3;
      }
    }

    /// <summary>
    ///   <para>Returns list of acceleration measurements which occurred during the last frame. (Read Only) (Allocates temporary variables).</para>
    /// </summary>
    public static AccelerationEvent[] accelerationEvents
    {
      get
      {
        int accelerationEventCount = Input.accelerationEventCount;
        AccelerationEvent[] accelerationEventArray = new AccelerationEvent[accelerationEventCount];
        for (int index = 0; index < accelerationEventCount; ++index)
          accelerationEventArray[index] = Input.GetAccelerationEvent(index);
        return accelerationEventArray;
      }
    }

    /// <summary>
    ///   <para>Number of acceleration measurements which occurred during last frame.</para>
    /// </summary>
    public static extern int accelerationEventCount { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Returns list of objects representing status of all touches during last frame. (Read Only) (Allocates temporary variables).</para>
    /// </summary>
    public static Touch[] touches
    {
      get
      {
        int touchCount = Input.touchCount;
        Touch[] touchArray = new Touch[touchCount];
        for (int index = 0; index < touchCount; ++index)
          touchArray[index] = Input.GetTouch(index);
        return touchArray;
      }
    }

    /// <summary>
    ///   <para>Number of touches. Guaranteed not to change throughout the frame. (Read Only)</para>
    /// </summary>
    public static extern int touchCount { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Property indicating whether keypresses are eaten by a textinput if it has focus (default true).</para>
    /// </summary>
    [Obsolete("eatKeyPressOnTextFieldFocus property is deprecated, and only provided to support legacy behavior.")]
    public static extern bool eatKeyPressOnTextFieldFocus { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Bool value which let's users check if touch pressure is supported.</para>
    /// </summary>
    public static extern bool touchPressureSupported { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Returns true when Stylus Touch is supported by a device or platform.</para>
    /// </summary>
    public static extern bool stylusTouchSupported { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Returns whether the device on which application is currently running supports touch input.</para>
    /// </summary>
    public static bool touchSupported
    {
      get
      {
        return false;
      }
    }

    /// <summary>
    ///   <para>Property indicating whether the system handles multiple touches.</para>
    /// </summary>
    public static extern bool multiTouchEnabled { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Property for accessing device location (handheld devices only). (Read Only)</para>
    /// </summary>
    public static LocationService location
    {
      get
      {
        if (Input.locationServiceInstance == null)
          Input.locationServiceInstance = new LocationService();
        return Input.locationServiceInstance;
      }
    }

    /// <summary>
    ///   <para>Property for accessing compass (handheld devices only). (Read Only)</para>
    /// </summary>
    public static Compass compass
    {
      get
      {
        if (Input.compassInstance == null)
          Input.compassInstance = new Compass();
        return Input.compassInstance;
      }
    }

    /// <summary>
    ///   <para>Device physical orientation as reported by OS. (Read Only)</para>
    /// </summary>
    public static extern DeviceOrientation deviceOrientation { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Controls enabling and disabling of IME input composition.</para>
    /// </summary>
    public static extern IMECompositionMode imeCompositionMode { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The current IME composition string being typed by the user.</para>
    /// </summary>
    public static extern string compositionString { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Does the user have an IME keyboard input source selected?</para>
    /// </summary>
    public static extern bool imeIsSelected { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>The current text input position used by IMEs to open windows.</para>
    /// </summary>
    public static Vector2 compositionCursorPos
    {
      get
      {
        Vector2 vector2;
        Input.INTERNAL_get_compositionCursorPos(out vector2);
        return vector2;
      }
      set
      {
        Input.INTERNAL_set_compositionCursorPos(ref value);
      }
    }

    /// <summary>
    ///         <para>Should  Back button quit the application?
    ///
    /// Only usable on Android, Windows Phone or Windows Tablets.</para>
    ///       </summary>
    public static extern bool backButtonLeavesApp { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern int mainGyroIndex_Internal();

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetKeyInt(int key);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetKeyString(string name);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetKeyUpInt(int key);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetKeyUpString(string name);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetKeyDownInt(int key);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetKeyDownString(string name);

    /// <summary>
    ///   <para>Returns the value of the virtual axis identified by axisName.</para>
    /// </summary>
    /// <param name="axisName"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern float GetAxis(string axisName);

    /// <summary>
    ///   <para>Returns the value of the virtual axis identified by axisName with no smoothing filtering applied.</para>
    /// </summary>
    /// <param name="axisName"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern float GetAxisRaw(string axisName);

    /// <summary>
    ///   <para>Returns true while the virtual button identified by buttonName is held down.</para>
    /// </summary>
    /// <param name="buttonName"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool GetButton(string buttonName);

    /// <summary>
    ///   <para>Returns true during the frame the user pressed down the virtual button identified by buttonName.</para>
    /// </summary>
    /// <param name="buttonName"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool GetButtonDown(string buttonName);

    /// <summary>
    ///   <para>Returns true the first frame the user releases the virtual button identified by buttonName.</para>
    /// </summary>
    /// <param name="buttonName"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool GetButtonUp(string buttonName);

    /// <summary>
    ///   <para>Returns true while the user holds down the key identified by name. Think auto fire.</para>
    /// </summary>
    /// <param name="name"></param>
    public static bool GetKey(string name)
    {
      return Input.GetKeyString(name);
    }

    /// <summary>
    ///   <para>Returns true while the user holds down the key identified by the key KeyCode enum parameter.</para>
    /// </summary>
    /// <param name="key"></param>
    public static bool GetKey(KeyCode key)
    {
      return Input.GetKeyInt((int) key);
    }

    /// <summary>
    ///   <para>Returns true during the frame the user starts pressing down the key identified by name.</para>
    /// </summary>
    /// <param name="name"></param>
    public static bool GetKeyDown(string name)
    {
      return Input.GetKeyDownString(name);
    }

    /// <summary>
    ///   <para>Returns true during the frame the user starts pressing down the key identified by the key KeyCode enum parameter.</para>
    /// </summary>
    /// <param name="key"></param>
    public static bool GetKeyDown(KeyCode key)
    {
      return Input.GetKeyDownInt((int) key);
    }

    /// <summary>
    ///   <para>Returns true during the frame the user releases the key identified by name.</para>
    /// </summary>
    /// <param name="name"></param>
    public static bool GetKeyUp(string name)
    {
      return Input.GetKeyUpString(name);
    }

    /// <summary>
    ///   <para>Returns true during the frame the user releases the key identified by the key KeyCode enum parameter.</para>
    /// </summary>
    /// <param name="key"></param>
    public static bool GetKeyUp(KeyCode key)
    {
      return Input.GetKeyUpInt((int) key);
    }

    /// <summary>
    ///   <para>Returns an array of strings describing the connected joysticks.</para>
    /// </summary>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern string[] GetJoystickNames();

    /// <summary>
    ///   <para>Determine whether a particular joystick model has been preconfigured by Unity. (Linux-only).</para>
    /// </summary>
    /// <param name="joystickName">The name of the joystick to check (returned by Input.GetJoystickNames).</param>
    /// <returns>
    ///   <para>True if the joystick layout has been preconfigured; false otherwise.</para>
    /// </returns>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool IsJoystickPreconfigured(string joystickName);

    /// <summary>
    ///   <para>Returns whether the given mouse button is held down.</para>
    /// </summary>
    /// <param name="button"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool GetMouseButton(int button);

    /// <summary>
    ///   <para>Returns true during the frame the user pressed the given mouse button.</para>
    /// </summary>
    /// <param name="button"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool GetMouseButtonDown(int button);

    /// <summary>
    ///   <para>Returns true during the frame the user releases the given mouse button.</para>
    /// </summary>
    /// <param name="button"></param>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool GetMouseButtonUp(int button);

    /// <summary>
    ///   <para>Resets all input. After ResetInputAxes all axes return to 0 and all buttons return to 0 for one frame.</para>
    /// </summary>
    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void ResetInputAxes();

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_get_mousePosition(out Vector3 value);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_get_mouseScrollDelta(out Vector2 value);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_get_acceleration(out Vector3 value);

    /// <summary>
    ///   <para>Returns specific acceleration measurement which occurred during last frame. (Does not allocate temporary variables).</para>
    /// </summary>
    /// <param name="index"></param>
    public static AccelerationEvent GetAccelerationEvent(int index)
    {
      AccelerationEvent accelerationEvent;
      Input.INTERNAL_CALL_GetAccelerationEvent(index, out accelerationEvent);
      return accelerationEvent;
    }

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_CALL_GetAccelerationEvent(int index, out AccelerationEvent value);

    /// <summary>
    ///   <para>Returns object representing status of a specific touch. (Does not allocate temporary variables).</para>
    /// </summary>
    /// <param name="index"></param>
    public static Touch GetTouch(int index)
    {
      Touch touch;
      Input.INTERNAL_CALL_GetTouch(index, out touch);
      return touch;
    }

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_CALL_GetTouch(int index, out Touch value);

    [Obsolete("Use ps3 move API instead", true)]
    public static Quaternion GetRotation(int deviceID)
    {
      return Quaternion.identity;
    }

    [Obsolete("Use ps3 move API instead", true)]
    public static Vector3 GetPosition(int deviceID)
    {
      return Vector3.zero;
    }

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_get_compositionCursorPos(out Vector2 value);

    [WrapperlessIcall]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void INTERNAL_set_compositionCursorPos(ref Vector2 value);
  }
}


/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you 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 .
 */

#ifndef __com_sun_star_text_BaseIndex_idl__
#define __com_sun_star_text_BaseIndex_idl__

#include <com/sun/star/util/Color.idl>
#include <com/sun/star/util/XRefreshable.idl>
#include <com/sun/star/text/XDocumentIndex.idl>
#include <com/sun/star/container/XIndexReplace.idl>
#include <com/sun/star/text/XTextColumns.idl>
#include <com/sun/star/style/GraphicLocation.idl>
#include <com/sun/star/lang/Locale.idl>
#include <com/sun/star/text/XTextSection.idl>
#include <com/sun/star/graphic/XGraphic.idl>

module com {  module sun {  module star {  module text {

/** specifies the basic service of different indexes within a document.@see com::sun::star::text::DocumentIndex
        @see com::sun::star::text::ContentIndex
        @see com::sun::star::text::UserDefinedIndex
        @see com::sun::star::text::IllustrationsIndex
        @see com::sun::star::text::TableIndex
        @see com::sun::star::text::ObjectIndex
 */
published service BaseIndex
{
    interface com::sun::star::text::XDocumentIndex;

    /** @since LibreOffice 4.0 */
    [optional] interface com::sun::star::util::XRefreshable;

    /** contains the title of the index.*/
    [property] string Title;
    /** determines if the index is protected.*/
    [property] boolean IsProtected;
    /** contains the name of the paragraph style that is applied to the heading.*/
    [property] string ParaStyleHeading;
    /** contains the name of the paragraph style that is applied to the 1st level.*/
    [property] string ParaStyleLevel1;
    /** contains the name of the paragraph style that is applied to the 2nd level.*/
    [optional, property] string ParaStyleLevel2;
    /** contains the name of the paragraph style that is applied to the 3rd level.*/
    [optional, property] string ParaStyleLevel3;
    /** contains the name of the paragraph style that is applied to the 4th level.*/
    [optional, property] string ParaStyleLevel4;
    /** contains the name of the paragraph style that is applied to the 5th level.*/
    [optional, property] string ParaStyleLevel5;
    /** contains the name of the paragraph style that is applied to the 6th level.*/
    [optional, property] string ParaStyleLevel6;
    /** contains the name of the paragraph style that is applied to the 7th level.*/
    [optional, property] string ParaStyleLevel7;
    /** contains the name of the paragraph style that is applied to the 8th level.*/
    [optional, property] string ParaStyleLevel8;
    /** contains the name of the paragraph style that is applied to the 9th level.*/
    [optional, property] string ParaStyleLevel9;
    /** contains the name of the paragraph style that is applied to the 10th level.*/
    [optional, property] string ParaStyleLevel10;
    /** contains the name of the paragraph style that is applied to the separator level.*/
    [optional, property] string ParaStyleSeparator;
    /** contains the column interface.*/
    [property] XTextColumns TextColumns;

    /** contains the URL of a graphic file that is displayed as background graphic

        @deprecated as of LibreOffice 6.1 - use BackGraphic instead

        Note the new behaviour since it this was deprecated:
        This property can only be set and only external URLs are
        supported (no more vnd.sun.star.GraphicObject scheme). When an
        URL is set, then it will load the graphic and set the BackGraphic
        property.
    */
    [property] string BackGraphicURL;

    /** contains the name of the filter of the graphic file that is
         displayed as background graphic*/
    [property] string BackGraphicFilter;
    /** determines the position of the background graphic.@see GraphicLocation
     */
    [property] com::sun::star::style::GraphicLocation BackGraphicLocation;
    /** specifies the color of the background.
     */
    [property] com::sun::star::util::Color BackColor;

    /** If `TRUE`, the background color value in "BackColor" is not visible.
     */
    [property] boolean BackTransparent;

    /** returns the interface of the level format of the index.

        The description of the format of the levels depends on the type of the document index.

     @see DocumentIndexLevelFormat
     */
    [optional, property] com::sun::star::container::XIndexReplace LevelFormat;
    /** determines if the content of the document index is created from the
         complete document content or from the current chapter only.

 It is not available in the bibliography
*/
    [optional, property] boolean CreateFromChapter;
    /** the text section containing the content of the index */
    [property] com::sun::star::text::XTextSection ContentSection;
    /** the text section containing the header of the index */
    [property] com::sun::star::text::XTextSection HeaderSection;

    /** contains the graphic object that is displayed as background graphic.

        @since LibreOffice 6.1
    */
    [optional, property] com::sun::star::graphic::XGraphic BackGraphic;
};

}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


const { addMatchers } = require('add-matchers');

require('jasmine-expect');

addMatchers({
    toBeError(value) {
        return value instanceof Error;
    },
    toBeErrorOfType(other, value) {
        return value instanceof Error && value.name === other;
    },
    toBeInstanceOf(other, value) {
        let otherName;
        let valueName;

        if (typeof value !== 'object') {
            throw new TypeError(`Expected object value, got ${typeof value}`);
        }

        valueName = value.constructor.name;

        // Class name.
        if (typeof other === 'string') {
            otherName = other;
        // Class constructor.
        } else if (typeof other === 'function') {
            otherName = other.name;
        } else {
            otherName = other.constructor.name;
        }

        return valueName === otherName;
    }
});


// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland

// This file was modified by Oracle on 2015.
// Modifications copyright (c) 2015, Oracle and/or its affiliates.

// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP
#define BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP

#include <cstddef>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/coordinate_system.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/util/math.hpp>

namespace boost { namespace geometry
{

namespace detail
{

template <typename Geometry, std::size_t Index>
class indexed_point_view
{
    indexed_point_view & operator=(indexed_point_view const&);

public:
    typedef typename geometry::point_type<Geometry>::type point_type;
    typedef typename geometry::coordinate_type<Geometry>::type coordinate_type;

    indexed_point_view(Geometry & geometry)
        : m_geometry(geometry)
    {}

    template <std::size_t Dimension>
    inline coordinate_type get() const
    {
        return geometry::get<Index, Dimension>(m_geometry);
    }

    template <std::size_t Dimension>
    inline void set(coordinate_type const& value)
    {
        geometry::set<Index, Dimension>(m_geometry, value);
    }

private:
    Geometry & m_geometry;
};

}

#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{

template <typename Geometry, std::size_t Index>
struct tag< geometry::detail::indexed_point_view<Geometry, Index> >
{
    typedef point_tag type;
};

template <typename Geometry, std::size_t Index>
struct coordinate_type< geometry::detail::indexed_point_view<Geometry, Index> >
{
    typedef typename geometry::coordinate_type<Geometry>::type type;
};

template <typename Geometry, std::size_t Index>
struct coordinate_system
    <
        geometry::detail::indexed_point_view<Geometry, Index>
    >
{
    typedef typename geometry::coordinate_system<Geometry>::type type;
};

template <typename Geometry, std::size_t Index>
struct dimension< geometry::detail::indexed_point_view<Geometry, Index> >
    : geometry::dimension<Geometry>
{};

template<typename Geometry, std::size_t Index, std::size_t Dimension>
struct access
    <
       geometry::detail::indexed_point_view<Geometry, Index>, Dimension
    >
{
    typedef typename geometry::coordinate_type<Geometry>::type coordinate_type;

    static inline coordinate_type get(
        geometry::detail::indexed_point_view<Geometry, Index> const& p)
    {
        return p.template get<Dimension>();
    }

    static inline void set(
        geometry::detail::indexed_point_view<Geometry, Index> & p,
        coordinate_type const& value)
    {
        p.template set<Dimension>(value);
    }
};

} // namespace traits
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP


// This module exports paths, names, and other metadata that is referenced
// throughout the build.

'use strict'

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

const repositoryRootPath = path.resolve(__dirname, '..')
const apmRootPath = path.join(repositoryRootPath, 'apm')
const scriptRootPath = path.join(repositoryRootPath, 'script')
const buildOutputPath = path.join(repositoryRootPath, 'out')
const docsOutputPath = path.join(repositoryRootPath, 'docs', 'output')
const intermediateAppPath = path.join(buildOutputPath, 'app')
const symbolsPath = path.join(buildOutputPath, 'symbols')
const electronDownloadPath = path.join(repositoryRootPath, 'electron')
const homeDirPath = process.env.HOME || process.env.USERPROFILE
// const atomHomeDirPath = path.join(homeDirPath, '.atom')
const atomHomeDirPath = path.join(homeDirPath, '.thera')
const appMetadata = require(path.join(repositoryRootPath, 'package.json'))
const apmMetadata = require(path.join(apmRootPath, 'package.json'))
const channel = getChannel()

module.exports = {
  appMetadata, apmMetadata, channel,
  repositoryRootPath, apmRootPath, scriptRootPath,
  buildOutputPath, docsOutputPath, intermediateAppPath, symbolsPath,
  electronDownloadPath, atomHomeDirPath, homeDirPath,
  getApmBinPath, getNpmBinPath, getTnpmBinPath,
  snapshotAuxiliaryData: {}
}

function getChannel () {
  if (appMetadata.version.match(/dev/)) {
    return 'dev'
  } else if (appMetadata.version.match(/beta/)) {
    return 'beta'
  } else {
    return 'stable'
  }
}

function getApmBinPath () {
  const apmBinName = process.platform === 'win32' ? 'apm.cmd' : 'apm'
  return path.join(apmRootPath, 'node_modules', 'atom-package-manager', 'bin', apmBinName)
}

function getNpmBinPath () {
  const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm'
  const localNpmBinPath = path.resolve(repositoryRootPath, 'script', 'node_modules', '.bin', npmBinName)
  return fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName
}

function getTnpmBinPath () {
  // const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm'
  // const localNpmBinPath = path.resolve(repositoryRootPath, 'script', 'node_modules', '.bin', npmBinName)
  // return fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName
  return '/usr/local/bin/tnpm'
}


class Fortune
  include DataMapper::Resource

  storage_names[:default] = 'Fortune'

  # property <name>, <type>
  property :id, Serial
  property :message, String
end


// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace UnrealGameSync
{
	class UpdateMonitor : IDisposable
	{
		PerforceConnection Perforce;
		string WatchPath;
		Thread WorkerThread;
		ManualResetEvent QuitEvent;

		public event Action OnUpdateAvailable;

		public UpdateMonitor(PerforceConnection InPerforce, string InWatchPath)
		{
			Perforce = InPerforce;
			WatchPath = InWatchPath;

			QuitEvent = new ManualResetEvent(false);

			if(WatchPath != null)
			{
				WorkerThread = new Thread(() => PollForUpdates());
				WorkerThread.Start();
			}
		}

		public void Close()
		{
			QuitEvent.Set();

			if(WorkerThread != null)
			{
				if(!WorkerThread.Join(30))
				{
					WorkerThread.Abort();
					WorkerThread.Join();
				}
				WorkerThread = null;
			}
		}

		public void Dispose()
		{
			Close();
		}

		public bool IsUpdateAvailable
		{
			get;
			private set;
		}

		void PollForUpdates()
		{
			while(!QuitEvent.WaitOne(5 * 60 * 1000))
			{
				StringWriter Log = new StringWriter();

				List<PerforceChangeSummary> Changes;
				if(Perforce.FindChanges(WatchPath, 1, out Changes, Log) && Changes.Count > 0)
				{
					TriggerUpdate();
				}
			}
		}

		public void TriggerUpdate()
		{
			IsUpdateAvailable = true;
			if(OnUpdateAvailable != null)
			{
				OnUpdateAvailable();
			}
		}
	}
}


//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18046
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace HcwHelper.Properties {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }
    }
}


//
//  main.m
//  ZWFlowingController
//
//  Created by 流年划过颜夕 on 2017/9/28.
//  Copyright © 2017年 liunianhuaguoyanxi. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AppDelegate.h"

int main(int argc, char * argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}


# Operator Brick Setter

![Symbol](../../../img/csvimport/operator_bricksetter.png)

Allows to set a brick field and create the brick itself if needed.

Note: you can directly drag and drop a brick field from the class definition tree.

* `Attribute`: the object attribute
* `Brick Type`: the brick type

Mode:
* `Never`: Never create the brick. If there CSV data for that brick an error will occur.
* `If not empty`: Create brick if CSV data is not empty
* `Always`: Always create the brick

![Example](../../../img/csvimport/operator_bricksetter_example.png)


/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch licenses this file to you 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.
 */
package org.elasticsearch.hadoop.util;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;

import org.elasticsearch.hadoop.EsHadoopIllegalArgumentException;
import org.elasticsearch.hadoop.EsHadoopIllegalStateException;

public abstract class ReflectionUtils {

    public static Field findField(Class<?> clazz, String name) {
        return findField(clazz, name, null);
    }

    public static Field findField(Class<?> clazz, String name, Class<?> type) {
        Assert.notNull(clazz, "Class must not be null");
        Assert.isTrue(name != null || type != null, "Either name or type of the field must be specified");
        Class<?> searchType = clazz;
        while (!Object.class.equals(searchType) && searchType != null) {
            Field[] fields = searchType.getDeclaredFields();
            for (Field field : fields) {
                if ((name == null || name.equals(field.getName())) && (type == null || type.equals(field.getType()))) {
                    return field;
                }
            }
            searchType = searchType.getSuperclass();
        }
        return null;
    }

    @SuppressWarnings("unchecked")
    public static <T> T getField(Field field, Object target) {
        try {
            return (T) field.get(target);
        } catch (IllegalAccessException ex) {
            throw new EsHadoopIllegalStateException("Unexpected reflection exception - " + ex.getClass().getName() + ": "+ ex.getMessage());
        }
    }

    public static void setField(Field field, Object target, Object value) {
        try {
            field.set(target, value);
        } catch (IllegalAccessException ex) {
            throw new EsHadoopIllegalStateException("Unexpected reflection exception - " + ex.getClass().getName() + ": "+ ex.getMessage());
        }
    }

    public static void makeAccessible(AccessibleObject accessible) {
        if (!accessible.isAccessible()) {
            accessible.setAccessible(true);
        }
    }

    public static Method findMethod(Class<?> targetClass, String name, Class<?>... paramTypes) {
        while (targetClass != null) {
            Method[] methods = (targetClass.isInterface() ? targetClass.getMethods() : targetClass.getDeclaredMethods());
            for (Method method : methods) {
                if (name.equals(method.getName())
                        && (paramTypes == null || Arrays.equals(paramTypes, method.getParameterTypes()))) {
                    return method;
                }
            }
            targetClass = targetClass.getSuperclass();
        }
        return null;
    }

    @SuppressWarnings("unchecked")
    public static <T> T invoke(Method method, Object target, Object...args) {
        try {
            return (T) method.invoke(target, args);
        } catch (Exception ex) {
            throw new EsHadoopIllegalArgumentException("Cannot invoke method " + method, ex);
        }
    }
}