text:
namespace MTL
{
_MTL_ENUM(NS::UInteger, CommandBufferStatus) {
    CommandBufferStatusNotEnqueued = 0,
    CommandBufferStatusEnqueued = 1,
    CommandBufferStatusCommitted = 2,
    CommandBufferStatusScheduled = 3,
    CommandBufferStatusCompleted = 4,
    CommandBufferStatusError = 5,
};

_MTL_ENUM(NS::UInteger, CommandBufferError) {
    CommandBufferErrorNone = 0,
    CommandBufferErrorTimeout = 2,
    CommandBufferErrorPageFault = 3,
    CommandBufferErrorAccessRevoked = 4,
    CommandBufferErrorBlacklisted = 4,
    CommandBufferErrorNotPermitted = 7,
    CommandBufferErrorOutOfMemory = 8,
    CommandBufferErrorInvalidResource = 9,
    CommandBufferErrorMemoryless = 10,
    CommandBufferErrorDeviceRemoved = 11,
    CommandBufferErrorStackOverflow = 12,
};

_MTL_OPTIONS(NS::UInteger, CommandBufferErrorOption) {
    CommandBufferErrorOptionNone = 0,
    CommandBufferErrorOptionEncoderExecutionStatus = 1,
};

_MTL_ENUM(NS::Integer, CommandEncoderErrorState) {
    CommandEncoderErrorStateUnknown = 0,
    CommandEncoderErrorStateCompleted = 1,
    CommandEncoderErrorStateAffected = 2,
    CommandEncoderErrorStatePending = 3,
    CommandEncoderErrorStateFaulted = 4,
};

class CommandBufferDescriptor : public NS::Copying<CommandBufferDescriptor>
{
public:
    static class CommandBufferDescriptor* alloc();

    class CommandBufferDescriptor*        init();

    bool                                  retainedReferences() const;
    void                                  setRetainedReferences(bool retainedReferences);

    MTL::CommandBufferErrorOption         errorOptions() const;
    void                                  setErrorOptions(MTL::CommandBufferErrorOption errorOptions);
};

class CommandBufferEncoderInfo : public NS::Referencing<CommandBufferEncoderInfo>
{
public:
    NS::String*                   label() const;

    NS::Array*                    debugSignposts() const;

    MTL::CommandEncoderErrorState errorState() const;
};

_MTL_ENUM(NS::UInteger, DispatchType) {
    DispatchTypeSerial = 0,
    DispatchTypeConcurrent = 1,
};

class CommandBuffer;

using CommandBufferHandler = void (^)(CommandBuffer*);

using HandlerFunction = std::function<void(CommandBuffer*)>;

class CommandBuffer : public NS::Referencing<CommandBuffer>
{
public:
    void                                       addScheduledHandler(const HandlerFunction& function);

    void                                       addCompletedHandler(const HandlerFunction& function);

    class Device*                              device() const;

    class CommandQueue*                        commandQueue() const;

    bool                                       retainedReferences() const;

    MTL::CommandBufferErrorOption              errorOptions() const;

    NS::String*                                label() const;
    void                                       setLabel(const NS::String* label);

    CFTimeInterval                             kernelStartTime() const;

    CFTimeInterval                             kernelEndTime() const;

    class LogContainer*                        logs() const;

    CFTimeInterval                             GPUStartTime() const;

    CFTimeInterval                             GPUEndTime() const;

    void                                       enqueue();

    void                                       commit();

    void                                       addScheduledHandler(const MTL::CommandBufferHandler block);

    void                                       presentDrawable(const class Drawable* drawable);

    void                                       presentDrawableAtTime(const class Drawable* drawable, CFTimeInterval presentationTime);

    void                                       presentDrawableAfterMinimumDuration(const class Drawable* drawable, CFTimeInterval duration);

    void                                       waitUntilScheduled();

    void                                       addCompletedHandler(const MTL::CommandBufferHandler block);

    void                                       waitUntilCompleted();

    MTL::CommandBufferStatus                   status() const;

    NS::Error*                                 error() const;

    class BlitCommandEncoder*                  blitCommandEncoder();

    class RenderCommandEncoder*                renderCommandEncoder(const class RenderPassDescriptor* renderPassDescriptor);

    class ComputeCommandEncoder*               computeCommandEncoder(const class ComputePassDescriptor* computePassDescriptor);

    class BlitCommandEncoder*                  blitCommandEncoder(const class BlitPassDescriptor* blitPassDescriptor);

    class ComputeCommandEncoder*               computeCommandEncoder();

    class ComputeCommandEncoder*               computeCommandEncoder(MTL::DispatchType dispatchType);

    void                                       encodeWait(const class Event* event, uint64_t value);

    void                                       encodeSignalEvent(const class Event* event, uint64_t value);

    class ParallelRenderCommandEncoder*        parallelRenderCommandEncoder(const class RenderPassDescriptor* renderPassDescriptor);

    class ResourceStateCommandEncoder*         resourceStateCommandEncoder();

    class ResourceStateCommandEncoder*         resourceStateCommandEncoder(const class ResourceStatePassDescriptor* resourceStatePassDescriptor);

    class AccelerationStructureCommandEncoder* accelerationStructureCommandEncoder();

    void                                       pushDebugGroup(const NS::String* string);

    void                                       popDebugGroup();
};

}

// static method: alloc
_MTL_INLINE MTL::CommandBufferDescriptor* MTL::CommandBufferDescriptor::alloc()
{
    return NS::Object::alloc<MTL::CommandBufferDescriptor>(_MTL_PRIVATE_CLS(MTLCommandBufferDescriptor));
}

// method: init
_MTL_INLINE MTL::CommandBufferDescriptor* MTL::CommandBufferDescriptor::init()
{
    return NS::Object::init<MTL::CommandBufferDescriptor>();
}

// property: retainedReferences
_MTL_INLINE bool MTL::CommandBufferDescriptor::retainedReferences() const
{
    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(retainedReferences));
}

_MTL_INLINE void MTL::CommandBufferDescriptor::setRetainedReferences(bool retainedReferences)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRetainedReferences_), retainedReferences);
}

// property: errorOptions
_MTL_INLINE MTL::CommandBufferErrorOption MTL::CommandBufferDescriptor::errorOptions() const
{
    return Object::sendMessage<MTL::CommandBufferErrorOption>(this, _MTL_PRIVATE_SEL(errorOptions));
}

_MTL_INLINE void MTL::CommandBufferDescriptor::setErrorOptions(MTL::CommandBufferErrorOption errorOptions)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setErrorOptions_), errorOptions);
}

// property: label
_MTL_INLINE NS::String* MTL::CommandBufferEncoderInfo::label() const
{
    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
}

// property: debugSignposts
_MTL_INLINE NS::Array* MTL::CommandBufferEncoderInfo::debugSignposts() const
{
    return Object::sendMessage<NS::Array*>(this, _MTL_PRIVATE_SEL(debugSignposts));
}

// property: errorState
_MTL_INLINE MTL::CommandEncoderErrorState MTL::CommandBufferEncoderInfo::errorState() const
{
    return Object::sendMessage<MTL::CommandEncoderErrorState>(this, _MTL_PRIVATE_SEL(errorState));
}

_MTL_INLINE void MTL::CommandBuffer::addScheduledHandler(const HandlerFunction& function)
{
    __block HandlerFunction blockFunction = function;

    addScheduledHandler(^(MTL::CommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); });
}

_MTL_INLINE void MTL::CommandBuffer::addCompletedHandler(const HandlerFunction& function)
{
    __block HandlerFunction blockFunction = function;

    addCompletedHandler(^(MTL::CommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); });
}

// property: device
_MTL_INLINE MTL::Device* MTL::CommandBuffer::device() const
{
    return Object::sendMessage<MTL::Device*>(this, _MTL_PRIVATE_SEL(device));
}

// property: commandQueue
_MTL_INLINE MTL::CommandQueue* MTL::CommandBuffer::commandQueue() const
{
    return Object::sendMessage<MTL::CommandQueue*>(this, _MTL_PRIVATE_SEL(commandQueue));
}

// property: retainedReferences
_MTL_INLINE bool MTL::CommandBuffer::retainedReferences() const
{
    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(retainedReferences));
}

// property: errorOptions
_MTL_INLINE MTL::CommandBufferErrorOption MTL::CommandBuffer::errorOptions() const
{
    return Object::sendMessage<MTL::CommandBufferErrorOption>(this, _MTL_PRIVATE_SEL(errorOptions));
}

// property: label
_MTL_INLINE NS::String* MTL::CommandBuffer::label() const
{
    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
}

_MTL_INLINE void MTL::CommandBuffer::setLabel(const NS::String* label)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setLabel_), label);
}

// property: kernelStartTime
_MTL_INLINE CFTimeInterval MTL::CommandBuffer::kernelStartTime() const
{
    return Object::sendMessage<CFTimeInterval>(this, _MTL_PRIVATE_SEL(kernelStartTime));
}

// property: kernelEndTime
_MTL_INLINE CFTimeInterval MTL::CommandBuffer::kernelEndTime() const
{
    return Object::sendMessage<CFTimeInterval>(this, _MTL_PRIVATE_SEL(kernelEndTime));
}

// property: logs
_MTL_INLINE MTL::LogContainer* MTL::CommandBuffer::logs() const
{
    return Object::sendMessage<MTL::LogContainer*>(this, _MTL_PRIVATE_SEL(logs));
}

// property: GPUStartTime
_MTL_INLINE CFTimeInterval MTL::CommandBuffer::GPUStartTime() const
{
    return Object::sendMessage<CFTimeInterval>(this, _MTL_PRIVATE_SEL(GPUStartTime));
}

// property: GPUEndTime
_MTL_INLINE CFTimeInterval MTL::CommandBuffer::GPUEndTime() const
{
    return Object::sendMessage<CFTimeInterval>(this, _MTL_PRIVATE_SEL(GPUEndTime));
}

// method: enqueue
_MTL_INLINE void MTL::CommandBuffer::enqueue()
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(enqueue));
}

// method: commit
_MTL_INLINE void MTL::CommandBuffer::commit()
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(commit));
}

// method: addScheduledHandler:
_MTL_INLINE void MTL::CommandBuffer::addScheduledHandler(const MTL::CommandBufferHandler block)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(addScheduledHandler_), block);
}

// method: presentDrawable:
_MTL_INLINE void MTL::CommandBuffer::presentDrawable(const MTL::Drawable* drawable)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(presentDrawable_), drawable);
}

// method: presentDrawable:atTime:
_MTL_INLINE void MTL::CommandBuffer::presentDrawableAtTime(const MTL::Drawable* drawable, CFTimeInterval presentationTime)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(presentDrawable_atTime_), drawable, presentationTime);
}

// method: presentDrawable:afterMinimumDuration:
_MTL_INLINE void MTL::CommandBuffer::presentDrawableAfterMinimumDuration(const MTL::Drawable* drawable, CFTimeInterval duration)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(presentDrawable_afterMinimumDuration_), drawable, duration);
}

// method: waitUntilScheduled
_MTL_INLINE void MTL::CommandBuffer::waitUntilScheduled()
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(waitUntilScheduled));
}

// method: addCompletedHandler:
_MTL_INLINE void MTL::CommandBuffer::addCompletedHandler(const MTL::CommandBufferHandler block)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(addCompletedHandler_), block);
}

// method: waitUntilCompleted
_MTL_INLINE void MTL::CommandBuffer::waitUntilCompleted()
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(waitUntilCompleted));
}

// property: status
_MTL_INLINE MTL::CommandBufferStatus MTL::CommandBuffer::status() const
{
    return Object::sendMessage<MTL::CommandBufferStatus>(this, _MTL_PRIVATE_SEL(status));
}

// property: error
_MTL_INLINE NS::Error* MTL::CommandBuffer::error() const
{
    return Object::sendMessage<NS::Error*>(this, _MTL_PRIVATE_SEL(error));
}

// method: blitCommandEncoder
_MTL_INLINE MTL::BlitCommandEncoder* MTL::CommandBuffer::blitCommandEncoder()
{
    return Object::sendMessage<MTL::BlitCommandEncoder*>(this, _MTL_PRIVATE_SEL(blitCommandEncoder));
}

// method: renderCommandEncoderWithDescriptor:
_MTL_INLINE MTL::RenderCommandEncoder* MTL::CommandBuffer::renderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor)
{
    return Object::sendMessage<MTL::RenderCommandEncoder*>(this, _MTL_PRIVATE_SEL(renderCommandEncoderWithDescriptor_), renderPassDescriptor);
}

// method: computeCommandEncoderWithDescriptor:
_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder(const MTL::ComputePassDescriptor* computePassDescriptor)
{
    return Object::sendMessage<MTL::ComputeCommandEncoder*>(this, _MTL_PRIVATE_SEL(computeCommandEncoderWithDescriptor_), computePassDescriptor);
}

// method: blitCommandEncoderWithDescriptor:
_MTL_INLINE MTL::BlitCommandEncoder* MTL::CommandBuffer::blitCommandEncoder(const MTL::BlitPassDescriptor* blitPassDescriptor)
{
    return Object::sendMessage<MTL::BlitCommandEncoder*>(this, _MTL_PRIVATE_SEL(blitCommandEncoderWithDescriptor_), blitPassDescriptor);
}

// method: computeCommandEncoder
_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder()
{
    return Object::sendMessage<MTL::ComputeCommandEncoder*>(this, _MTL_PRIVATE_SEL(computeCommandEncoder));
}

// method: computeCommandEncoderWithDispatchType:
_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder(MTL::DispatchType dispatchType)
{
    return Object::sendMessage<MTL::ComputeCommandEncoder*>(this, _MTL_PRIVATE_SEL(computeCommandEncoderWithDispatchType_), dispatchType);
}

// method: encodeWaitForEvent:value:
_MTL_INLINE void MTL::CommandBuffer::encodeWait(const MTL::Event* event, uint64_t value)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(encodeWaitForEvent_value_), event, value);
}

// method: encodeSignalEvent:value:
_MTL_INLINE void MTL::CommandBuffer::encodeSignalEvent(const MTL::Event* event, uint64_t value)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(encodeSignalEvent_value_), event, value);
}

// method: parallelRenderCommandEncoderWithDescriptor:
_MTL_INLINE MTL::ParallelRenderCommandEncoder* MTL::CommandBuffer::parallelRenderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor)
{
    return Object::sendMessage<MTL::ParallelRenderCommandEncoder*>(this, _MTL_PRIVATE_SEL(parallelRenderCommandEncoderWithDescriptor_), renderPassDescriptor);
}

// method: resourceStateCommandEncoder
_MTL_INLINE MTL::ResourceStateCommandEncoder* MTL::CommandBuffer::resourceStateCommandEncoder()
{
    return Object::sendMessage<MTL::ResourceStateCommandEncoder*>(this, _MTL_PRIVATE_SEL(resourceStateCommandEncoder));
}

// method: resourceStateCommandEncoderWithDescriptor:
_MTL_INLINE MTL::ResourceStateCommandEncoder* MTL::CommandBuffer::resourceStateCommandEncoder(const MTL::ResourceStatePassDescriptor* resourceStatePassDescriptor)
{
    return Object::sendMessage<MTL::ResourceStateCommandEncoder*>(this, _MTL_PRIVATE_SEL(resourceStateCommandEncoderWithDescriptor_), resourceStatePassDescriptor);
}

// method: accelerationStructureCommandEncoder
_MTL_INLINE MTL::AccelerationStructureCommandEncoder* MTL::CommandBuffer::accelerationStructureCommandEncoder()
{
    return Object::sendMessage<MTL::AccelerationStructureCommandEncoder*>(this, _MTL_PRIVATE_SEL(accelerationStructureCommandEncoder));
}

// method: pushDebugGroup:
_MTL_INLINE void MTL::CommandBuffer::pushDebugGroup(const NS::String* string)
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string);
}

// method: popDebugGroup
_MTL_INLINE void MTL::CommandBuffer::popDebugGroup()
{
    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(popDebugGroup));
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/margin_small" >

    <TextView
        android:id="@+id/list_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="24dp"
        android:layout_marginStart="24dp"
        android:textSize="18sp"
        android:textColor="@color/textPrimary" />

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
import { Matomo } from '../src/app/Matomo';

describe('index', () => {
  it('trackLogin() exists', () => {
    expect(typeof Matomo.trackLogin).toBe('function');
  });

  it('trackLogout() exists', () => {
    expect(typeof Matomo.trackLogout).toBe('function');
  });

  it('trackProvenance() exists', () => {
    expect(typeof Matomo.trackProvenance).toBe('function');
  });
});


text:
'use strict';

var open = require('opn');

module.exports = function(grunt) {
  grunt.registerMultiTask('open', 'Open urls and files from a grunt task', function() {
    var dest = this.data.url || this.data.file || this.data.path;
    dest = typeof dest === 'function' ? dest() : dest;
    var application = this.data.app || this.data.application;
    var options = this.options();

    function callback(error){
    if (error !== null)
      grunt.fail.warn(error);
    }

    options.delay = options.delay || 0;

    // allows to wait for server start up before opening
    var openOn = options.openOn;
    if (openOn) {
      grunt.event.on(openOn, function () {
        open(dest, application, callback);
      });
    } else {
      setTimeout(function(){
        open(dest, application, callback);
      }, options.delay);
    }

    // give the spawn some time before its parent (us) dies
    // https://github.com/onehealth/grunt-open/issues/6
    setTimeout(this.async(), 200);
  });
};


text:
function F = horzcat(f,g)
%HORZCAT Horizontal concatenation of chebfun2 objects.
%
%  This is not allowed and returns an error.  This function exists so that
%  the error message is meaningful to a Chebfun2 user.

% Copyright 2013 by The University of Oxford and The Chebfun Developers.
% See http://www.maths.ox.ac.uk/chebfun/ for Chebfun information.

error('CHEBFUN2:HORZCAT','Horizontal concatenation of chebfun2 objects is not supported.')

end


text:
import RCTooltip from 'rc-tooltip';
import * as React from 'react';

import './Tooltip.module.css';

interface ILocalProps {
  content: React.ReactNode;
  children: React.ReactNode;
  width?: number;
  visible?: boolean;
}

class Tooltip extends React.Component<ILocalProps> {
  public render() {
    const { visible, content, children } = this.props;
    return (
      <RCTooltip
        {...(visible !== undefined ? { visible } : {})}
        overlay={content}
        placement={'top'}
        arrowContent={<div className="rc-tooltip-arrow-inner" />}
        align={{ offset: [0, -2] }}
        overlayStyle={{ width: this.props.width }}
        mouseEnterDelay={0.1}
        destroyTooltipOnHide={true}
      >
        {children as any}
      </RCTooltip>
    );
  }
}

export default Tooltip;


text:
set -euo pipefail

function usage() {
CMDNAME="$(basename -- "$0")"

  cat << EOF
Usage: ${CMDNAME} <client_key_path> <client_cert_path>

Generate client certificate for Postgress connection

EXAMPLE:
$ ${CMDNAME} client.key client.crt

EOF

}

if [[ "$#" -ne 2 ]]; then
    echo "You must provide two arguments."
    echo
    usage
    exit 1
fi

CLIENT_KEY_PATH="${1}"
CLIENT_CERT_PATH="${2}"

openssl req \
       -newkey rsa:2048 -nodes -keyout "${CLIENT_KEY_PATH}" \
       -x509 -days 365 -out "${CLIENT_CERT_PATH}" \
       -subj "/C=PL/ST=$(hostname)/L=pola-app/O=pola-app/OU=pola-app/CN=pola-app"


text:
SUBDIRS = guessconv

include ../../buildsys.mk
include ../../extra.mk


text:
typedef struct {
	int codigoControle;
	short RRN;
} regAP1Page;

typedef struct {
  short keycount;         // numero de chaves presentes na pagina
  regAP1Page key[MAXKEYS];     // chaves da pagina
  short child[MAXKEYS+1]; // ponteiros
} regBTPage;

typedef struct {
	int codigoControle;
    int codigoCachorro;
    char vacina[30];
    char dataVacina[6];
    char respVacina[30];
} regAP1;

typedef struct {
	int codigoCachorro;
    char raca[30];
    char nomeCachorro[30];
} regAP2;

void cadastraCachorro();
void existeCachorro(int codigo);
int procuraCachorro(int codigo);
void cadastraVacina();
void inicializar();
void encerrar();
void criaHash();
int funcaoHash(int codigo);
void insereHash(int hashAddress, int chave, int offset);
int buscaVacinaHash(int codigoControle, int verifica);
int insereBTree(int codControle, short RRN);
void imprimeVacina(int codVacina, int posVacina);
int buscaBTree(int rrn, int codigo);
void buscaArvore(int codigo);


text:
select c1.cohort_definition_id,
  1320 as analysis_id,
  YEAR(measurement_date)*100 + month(measurement_date) as stratum_1,
  cast( '' as varchar(1) ) as stratum_2, cast( '' as varchar(1) ) as stratum_3, cast( '' as varchar(1) ) as stratum_4,
  COUNT_BIG(distinct o1.measurement_id) as count_value
into #results_1320
from
@CDM_schema.measurement o1
inner join #HERACLES_cohort c1
on o1.person_id = c1.subject_id
--{@measurement_concept_ids != '' | @cohort_period_only == 'true'}?{
WHERE
--{@cohort_period_only == 'true'}?{
o1.measurement_date>=c1.cohort_start_date and o1.measurement_date<=c1.cohort_end_date
--}
--{@measurement_concept_ids != '' & @cohort_period_only == 'true'}?{
AND
--}
--{@measurement_concept_ids != ''}?{
o1.measurement_concept_id in (@measurement_concept_ids)
--}
--}
group by c1.cohort_definition_id,
YEAR(measurement_date)*100 + month(measurement_date)
;


text:
<frameset rows="20%,*">
<frame src="./src/tutorial_header.html" frameborder=0>
<frameset cols="20%,*">
<frame src="./src/tutorial_menu.html" frameborder=0>
<frame name="right" src="./src/pages/p0.html" frameborder=0>
</frameset>
</frameset>


text:
// Copyright 2009 The Apache Software Foundation
//
// 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.

package org.apache.tapestry5.internal.services;

/**
 * Used within a {@link XMLToken} to identify namespaces defined with a start
 * element token.
 *
 * @since 5.2.0
 */
class NamespaceMapping
{
    final String prefix, uri;

    public NamespaceMapping(String prefix, String uri)
    {
        this.prefix = prefix;
        this.uri = uri;
    }

}


text:
using MediatR;
using EventService.Data;
using EventService.Data.Model;
using EventService.Features.Core;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using System.Data.Entity;

namespace EventService.Features.Accounts
{
    public class AddOrUpdateProfileCommand
    {
        public class AddOrUpdateProfileRequest : IRequest<AddOrUpdateProfileResponse>
        {
            public ProfileApiModel Profile { get; set; }
            public Guid TenantUniqueId { get; set; }
        }

        public class AddOrUpdateProfileResponse { }

        public class AddOrUpdateProfileHandler : IAsyncRequestHandler<AddOrUpdateProfileRequest, AddOrUpdateProfileResponse>
        {
            public AddOrUpdateProfileHandler(EventServiceContext context, ICache cache)
            {
                _context = context;
                _cache = cache;
            }

            public async Task<AddOrUpdateProfileResponse> Handle(AddOrUpdateProfileRequest request)
            {
                var entity = await _context.Profiles
                    .Include(x => x.Tenant)
                    .SingleOrDefaultAsync(x => x.Id == request.Profile.Id && x.Tenant.UniqueId == request.TenantUniqueId);

                if (entity == null) {
                    var tenant = await _context.Tenants.SingleAsync(x => x.UniqueId == request.TenantUniqueId);
                    _context.Profiles.Add(entity = new Profile() { TenantId = tenant.Id });
                }

                entity.Name = request.Profile.Name;

                await _context.SaveChangesAsync();

                return new AddOrUpdateProfileResponse();
            }

            private readonly EventServiceContext _context;
            private readonly ICache _cache;
        }

    }

}


text:
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %}Demography Database - Matrix Form{% endblock %}

{% block page_content %}

Matrix Editing Form

  Go back to previous page - changes will NOT be saved

Editing matrix #{{matrix.id}} for {{species.species_accepted}}

Population: {{population.population_name}}

Publication: {{ population.publication.authors }} ({{ population.publication.year }}). "{{ population.publication.pub_title }}" in {{ population.publication.journal_book_conf }} {{ population.publication.volume }}, {{ population.publication.pages }}

    <form method="post" role="form">

                {{ form.hidden_tag() }}
                {{ wtf.form_errors(form, hiddens="only") }}

Matrix infomation

                {{ wtf.form_field(form.treatment) }}

{{ protocol_dict["matrix_treatment_type"] }}

                {{ wtf.form_field(form.observations) }}

{{ protocol_dict["matrix_observations"] }}

                {{ wtf.form_field(form.matrix_composition) }}

{{ protocol_dict["matrix_composition"] }}

                {{ wtf.form_field(form.n_intervals)}}

{{ protocol_dict["matrix_n_intervals"] }}

                {{ wtf.form_field(form.captivity_id) }}

{{ protocol_dict["matrix_captivity"] }}

                {{ wtf.form_field(form.matrix_criteria_size) }}

{{ protocol_dict["matrix_criteria_size"] }}

                {{ wtf.form_field(form.matrix_complete) }}

{{ protocol_dict["matrix_complete"] }}

                {{ wtf.form_field(form.independence_origin) }}

{{ protocol_dict["matrix_independence_origin"] }}

                {{ wtf.form_field(form.independent) }}

{{ protocol_dict["matrix_independent"] }}

                {{ wtf.form_field(form.non_independence) }}

{{ protocol_dict["matrix_non_independence"] }}

                {{ wtf.form_field(form.non_independence_author) }}

{{ protocol_dict["matrix_non_independence_author"] }}

{{ wtf.form_field(form.matrix_criteria_age) }}

{{ protocol_dict["matrix_criteria_age"] }}

{{ wtf.form_field(form.matrix_criteria_ontogeny) }}

{{ protocol_dict["matrix_criteria_ontogeny"] }}

                {{ wtf.form_field(form.studied_sex) }}

{{ protocol_dict["matrix_studied_sex"] }}

Timing

{{ wtf.form_field(form.matrix_start_month) }}

{{ protocol_dict["matrix_start_month"] }}

{{ wtf.form_field(form.matrix_end_month) }}

{{ protocol_dict["matrix_end_month"] }}

{{ wtf.form_field(form.matrix_start_year) }}

{{ protocol_dict["matrix_start_year"] }}

{{ wtf.form_field(form.matrix_end_year) }}

{{ protocol_dict["matrix_end_year"] }}

                {{ wtf.form_field(form.seasonal) }}

{{ protocol_dict["matrix_seasonal"] }}

{{ wtf.form_field(form.matrix_start_season) }}

{{ protocol_dict["matrix_start_season"] }}

{{ wtf.form_field(form.matrix_end_season) }}

{{ protocol_dict["matrix_end_season"] }}

Matrix format information

{{ wtf.form_field(form.matrix_split) }}
{{ protocol_dict["matrix_split"] }}

{{ wtf.form_field(form.matrix_fec) }}
{{ protocol_dict["matrix_fec"] }}

{{ wtf.form_field(form.periodicity) }}
{{ protocol_dict["matrix_periodicity"] }}

{{ wtf.form_field(form.matrix_dimension) }}
{{ protocol_dict["matrix_dimension"] }}

Stage classes and matrices

                {{ wtf.form_field(form.class_author)}}

{{ protocol_dict["matrix_class_author"] }}

                {{ wtf.form_field(form.class_organized)}}

{{ protocol_dict["matrix_class_organized"] }}

                {{ wtf.form_field(form.class_number)}}

{{ protocol_dict["matrix_class_number"] }}

                <button type="button" class="btn btn-info pull-right" onclick="Javascript:addmat('matrix_a_')">Edit matrix A</button>
                {{ wtf.form_field(form.matrix_a_string) }}

{{ protocol_dict["matrix_a_string"] }}

                <button type="button" class="btn btn-info pull-right" onclick="Javascript:addmat('matrix_u_')">Edit matrix U</button>
                {{ wtf.form_field(form.matrix_u_string) }}

{{ protocol_dict["matrix_u_string"] }}

                <button type="button" class="btn btn-info pull-right" onclick="Javascript:addmat('matrix_f_')">Edit matrix F</button>
                {{ wtf.form_field(form.matrix_f_string) }}

{{ protocol_dict["matrix_f_string"] }}

                <button type="button" class="btn btn-info pull-right" onclick="Javascript:addmat('matrix_c_')">Edit matrix C</button>
                {{ wtf.form_field(form.matrix_c_string) }}

{{ protocol_dict["matrix_c_string"] }}

Please check;

Annual periodicity has been entered

Treatments have not been entered into observations and vice-versa

Matrix dimensions are consistent

Organised class stages are correctly labelled

            {{ wtf.form_field(form.matrix_difficulty) }}

{{ protocol_dict["matrix_difficulty"] }}

Submit changes: {{ wtf.form_field(form.submit) }}

    </form>

{% endblock %}
{% block scripts %}

{% endblock %}


text:
use std::fmt;
use std::cmp::Eq;
use std::hash::Hash;

use std::collections::HashMap;

use util::*;
use error::*;
use traits::*;

use super::*;

#[derive(Clone)]
pub struct ProcessingScope<T: Hash + Eq> {
    scope_id: String,
    parent_id: Option<String>,

    environment: ProcessingScopeEnvironment,

    scoped_idents: HashMap<String, CommonBindings<T>>,
    shaped_idents: HashMap<String, BindingShape<T>>,
    element_bindings: HashMap<String, CommonBindings<T>>,
}

impl<T: Hash + Eq> Default for ProcessingScope<T> {
    fn default() -> Self {
        ProcessingScope::new(None as Option<String>, Default::default())
    }
}

impl<T: Hash + Eq> ScopeParentId for ProcessingScope<T> {
    fn parent_id(&self) -> Option<&str> {
        self.parent_id.as_ref().map(|s| s.as_str())
    }
}

impl<T: Hash + Eq> fmt::Debug for ProcessingScope<T> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{} ({:?})", self.id(), self.environment())
    }
}

impl<T: Hash + Eq> ProcessingScope<T> {
    #[allow(dead_code)]
    pub fn new<P: Into<String>>(
        parent_id: Option<P>,
        environment: ProcessingScopeEnvironment,
    ) -> Self {
        let scope_id = allocate_element_key();
        let parent_id = parent_id.map(|s| s.into());

        ProcessingScope {
            scope_id: scope_id,
            parent_id: parent_id,

            environment: environment,

            scoped_idents: Default::default(),
            shaped_idents: Default::default(),
            element_bindings: Default::default(),
        }
    }

    pub fn id(&self) -> &str {
        &self.scope_id
    }

    pub fn add_ident(
        &mut self,
        key: String,
        binding: CommonBindings<T>,
    ) -> DocumentProcessingResult<()> {
        self.scoped_idents.insert(key, binding);
        Ok(())
    }

    pub fn get_ident(&mut self, key: &str) -> Option<CommonBindings<T>>
    where
        T: Clone,
    {
        self.scoped_idents.get(key).map(|v| v.to_owned())
    }

    pub fn add_ident_shape(
        &mut self,
        key: String,
        binding: BindingShape<T>,
    ) -> DocumentProcessingResult<()> {
        self.shaped_idents.insert(key, binding);
        Ok(())
    }

    pub fn get_ident_shape(&mut self, key: &str) -> Option<BindingShape<T>>
    where
        T: Clone,
    {
        self.shaped_idents.get(key).map(|v| v.to_owned())
    }

    pub fn add_element_binding(
        &mut self,
        key: String,
        common_binding: CommonBindings<T>,
    ) -> DocumentProcessingResult<()> {
        self.element_bindings.insert(key, common_binding);
        Ok(())
    }

    pub fn get_element_binding(&mut self, key: &str) -> Option<CommonBindings<T>>
    where
        T: Clone,
    {
        self.element_bindings.get(key).map(|v| v.to_owned())
    }

    pub fn environment(&self) -> &ProcessingScopeEnvironment {
        &self.environment
    }
}


text:
default_target: all
.PHONY : default_target

# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
.PHONY : .NOTPARALLEL

#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake

# The command to remove a file.
RM = /usr/bin/cmake -E remove -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/jmarple/code/mavlink

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/jmarple/code/UMass-Launch-Comm/mavlink-build

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
	/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target install
install: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	/usr/bin/cmake -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target install/local
install/local: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast

# Special rule for the target list_install_components
list_install_components:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Dev\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast

# Special rule for the target package
package: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
	/usr/bin/cpack --config ./CPackConfig.cmake
.PHONY : package

# Special rule for the target package
package/fast: package
.PHONY : package/fast

# Special rule for the target package_source
package_source:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
	/usr/bin/cpack --config ./CPackSourceConfig.cmake /home/jmarple/code/UMass-Launch-Comm/mavlink-build/CPackSourceConfig.cmake
.PHONY : package_source

# Special rule for the target package_source
package_source/fast: package_source
.PHONY : package_source/fast

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
	$(CMAKE_COMMAND) -E cmake_progress_start /home/jmarple/code/UMass-Launch-Comm/mavlink-build/CMakeFiles /home/jmarple/code/UMass-Launch-Comm/mavlink-build/CMakeFiles/progress.marks
	$(MAKE) -f CMakeFiles/Makefile2 all
	$(CMAKE_COMMAND) -E cmake_progress_start /home/jmarple/code/UMass-Launch-Comm/mavlink-build/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
	$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
	$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
	$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named ASLUAV.xml-v1.0

# Build rule for target.
ASLUAV.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ASLUAV.xml-v1.0
.PHONY : ASLUAV.xml-v1.0

# fast build rule for target.
ASLUAV.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/ASLUAV.xml-v1.0.dir/build.make CMakeFiles/ASLUAV.xml-v1.0.dir/build
.PHONY : ASLUAV.xml-v1.0/fast

#=============================================================================
# Target rules for targets named ardupilotmega.xml-v0.9

# Build rule for target.
ardupilotmega.xml-v0.9: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ardupilotmega.xml-v0.9
.PHONY : ardupilotmega.xml-v0.9

# fast build rule for target.
ardupilotmega.xml-v0.9/fast:
	$(MAKE) -f CMakeFiles/ardupilotmega.xml-v0.9.dir/build.make CMakeFiles/ardupilotmega.xml-v0.9.dir/build
.PHONY : ardupilotmega.xml-v0.9/fast

#=============================================================================
# Target rules for targets named ardupilotmega.xml-v1.0

# Build rule for target.
ardupilotmega.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ardupilotmega.xml-v1.0
.PHONY : ardupilotmega.xml-v1.0

# fast build rule for target.
ardupilotmega.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/ardupilotmega.xml-v1.0.dir/build.make CMakeFiles/ardupilotmega.xml-v1.0.dir/build
.PHONY : ardupilotmega.xml-v1.0/fast

#=============================================================================
# Target rules for targets named autoquad.xml-v1.0

# Build rule for target.
autoquad.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 autoquad.xml-v1.0
.PHONY : autoquad.xml-v1.0

# fast build rule for target.
autoquad.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/autoquad.xml-v1.0.dir/build.make CMakeFiles/autoquad.xml-v1.0.dir/build
.PHONY : autoquad.xml-v1.0/fast

#=============================================================================
# Target rules for targets named common.xml-v0.9

# Build rule for target.
common.xml-v0.9: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 common.xml-v0.9
.PHONY : common.xml-v0.9

# fast build rule for target.
common.xml-v0.9/fast:
	$(MAKE) -f CMakeFiles/common.xml-v0.9.dir/build.make CMakeFiles/common.xml-v0.9.dir/build
.PHONY : common.xml-v0.9/fast

#=============================================================================
# Target rules for targets named common.xml-v1.0

# Build rule for target.
common.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 common.xml-v1.0
.PHONY : common.xml-v1.0

# fast build rule for target.
common.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/common.xml-v1.0.dir/build.make CMakeFiles/common.xml-v1.0.dir/build
.PHONY : common.xml-v1.0/fast

#=============================================================================
# Target rules for targets named matrixpilot.xml-v1.0

# Build rule for target.
matrixpilot.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 matrixpilot.xml-v1.0
.PHONY : matrixpilot.xml-v1.0

# fast build rule for target.
matrixpilot.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/matrixpilot.xml-v1.0.dir/build.make CMakeFiles/matrixpilot.xml-v1.0.dir/build
.PHONY : matrixpilot.xml-v1.0/fast

#=============================================================================
# Target rules for targets named minimal.xml-v0.9

# Build rule for target.
minimal.xml-v0.9: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 minimal.xml-v0.9
.PHONY : minimal.xml-v0.9

# fast build rule for target.
minimal.xml-v0.9/fast:
	$(MAKE) -f CMakeFiles/minimal.xml-v0.9.dir/build.make CMakeFiles/minimal.xml-v0.9.dir/build
.PHONY : minimal.xml-v0.9/fast

#=============================================================================
# Target rules for targets named minimal.xml-v1.0

# Build rule for target.
minimal.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 minimal.xml-v1.0
.PHONY : minimal.xml-v1.0

# fast build rule for target.
minimal.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/minimal.xml-v1.0.dir/build.make CMakeFiles/minimal.xml-v1.0.dir/build
.PHONY : minimal.xml-v1.0/fast

#=============================================================================
# Target rules for targets named paparazzi.xml-v1.0

# Build rule for target.
paparazzi.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 paparazzi.xml-v1.0
.PHONY : paparazzi.xml-v1.0

# fast build rule for target.
paparazzi.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/paparazzi.xml-v1.0.dir/build.make CMakeFiles/paparazzi.xml-v1.0.dir/build
.PHONY : paparazzi.xml-v1.0/fast

#=============================================================================
# Target rules for targets named python_array_test.xml-v1.0

# Build rule for target.
python_array_test.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 python_array_test.xml-v1.0
.PHONY : python_array_test.xml-v1.0

# fast build rule for target.
python_array_test.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/python_array_test.xml-v1.0.dir/build.make CMakeFiles/python_array_test.xml-v1.0.dir/build
.PHONY : python_array_test.xml-v1.0/fast

#=============================================================================
# Target rules for targets named slugs.xml-v0.9

# Build rule for target.
slugs.xml-v0.9: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 slugs.xml-v0.9
.PHONY : slugs.xml-v0.9

# fast build rule for target.
slugs.xml-v0.9/fast:
	$(MAKE) -f CMakeFiles/slugs.xml-v0.9.dir/build.make CMakeFiles/slugs.xml-v0.9.dir/build
.PHONY : slugs.xml-v0.9/fast

#=============================================================================
# Target rules for targets named slugs.xml-v1.0

# Build rule for target.
slugs.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 slugs.xml-v1.0
.PHONY : slugs.xml-v1.0

# fast build rule for target.
slugs.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/slugs.xml-v1.0.dir/build.make CMakeFiles/slugs.xml-v1.0.dir/build
.PHONY : slugs.xml-v1.0/fast

#=============================================================================
# Target rules for targets named test.xml-v0.9

# Build rule for target.
test.xml-v0.9: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 test.xml-v0.9
.PHONY : test.xml-v0.9

# fast build rule for target.
test.xml-v0.9/fast:
	$(MAKE) -f CMakeFiles/test.xml-v0.9.dir/build.make CMakeFiles/test.xml-v0.9.dir/build
.PHONY : test.xml-v0.9/fast

#=============================================================================
# Target rules for targets named test.xml-v1.0

# Build rule for target.
test.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 test.xml-v1.0
.PHONY : test.xml-v1.0

# fast build rule for target.
test.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/test.xml-v1.0.dir/build.make CMakeFiles/test.xml-v1.0.dir/build
.PHONY : test.xml-v1.0/fast

#=============================================================================
# Target rules for targets named ualberta.xml-v0.9

# Build rule for target.
ualberta.xml-v0.9: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ualberta.xml-v0.9
.PHONY : ualberta.xml-v0.9

# fast build rule for target.
ualberta.xml-v0.9/fast:
	$(MAKE) -f CMakeFiles/ualberta.xml-v0.9.dir/build.make CMakeFiles/ualberta.xml-v0.9.dir/build
.PHONY : ualberta.xml-v0.9/fast

#=============================================================================
# Target rules for targets named ualberta.xml-v1.0

# Build rule for target.
ualberta.xml-v1.0: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ualberta.xml-v1.0
.PHONY : ualberta.xml-v1.0

# fast build rule for target.
ualberta.xml-v1.0/fast:
	$(MAKE) -f CMakeFiles/ualberta.xml-v1.0.dir/build.make CMakeFiles/ualberta.xml-v1.0.dir/build
.PHONY : ualberta.xml-v1.0/fast

# Help Target
help:
	@echo "The following are some of the valid targets for this Makefile:"
	@echo "... all (the default if no target is provided)"
	@echo "... clean"
	@echo "... depend"
	@echo "... ASLUAV.xml-v1.0"
	@echo "... ardupilotmega.xml-v0.9"
	@echo "... ardupilotmega.xml-v1.0"
	@echo "... autoquad.xml-v1.0"
	@echo "... common.xml-v0.9"
	@echo "... common.xml-v1.0"
	@echo "... edit_cache"
	@echo "... install"
	@echo "... install/local"
	@echo "... install/strip"
	@echo "... list_install_components"
	@echo "... matrixpilot.xml-v1.0"
	@echo "... minimal.xml-v0.9"
	@echo "... minimal.xml-v1.0"
	@echo "... package"
	@echo "... package_source"
	@echo "... paparazzi.xml-v1.0"
	@echo "... python_array_test.xml-v1.0"
	@echo "... rebuild_cache"
	@echo "... slugs.xml-v0.9"
	@echo "... slugs.xml-v1.0"
	@echo "... test.xml-v0.9"
	@echo "... test.xml-v1.0"
	@echo "... ualberta.xml-v0.9"
	@echo "... ualberta.xml-v1.0"
.PHONY : help

#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system


text:
#ifndef LEP_JSONNUMBER_H_
#define LEP_JSONNUMBER_H_

#include "JsonValue.h"

namespace lep {
class JsonNumber : public JsonValue {
  public:
    JsonNumber(int number);
    virtual SmartPointer<String> ToString();

  private:
    int number_;
};
} // namespace lep

#endif // LEP_JSONNUMBER_H_


text:
using Telerik.UI.Automation.Peers;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;

namespace Telerik.UI.Xaml.Controls.Input.Calendar
{
    /// <summary>
    /// Represents the topmost panel that holds the calendar view cells.
    /// </summary>
    public class CalendarViewHost : Canvas
    {
        protected override AutomationPeer OnCreateAutomationPeer()
        {
            RadCalendar calendar = ElementTreeHelper.FindVisualAncestor<RadCalendar>(this);
            if (calendar != null)
            {
                return new CalendarViewHostAutomationPeer(this, calendar);
            }
            return null;
        }
    }
}


text:
/* @flow */
'use strict'

const NS = exports.NS = 'urn:xmpp:delay'

exports.parse = function (stanza, data) {
  const element = stanza.getChild('delay', NS)
  if (!element) {
    return
  }
  const reason = element.getText()
  const delay = { when: element.attrs.stamp }
  if (element.attrs.from) {
    delay.from = element.attrs.from
  }
  if (reason) {
    delay.reason = reason
  }
  data.delay = delay
}

exports.build = (stanza, data) => {
  if (!data || (typeof data !== 'object')) {
    return
  }
  const attrs = { xmlns: NS }
  if (data.when) {
    attrs.stamp = data.when
  }
  if (data.from) {
    attrs.from = data.from
  }
  const delay = stanza.c('delay', attrs)
  if (data.reason) {
    delay.t(data.reason)
  }
}


text:
import os
import datetime

from flask import current_app, abort, send_from_directory
from werkzeug import secure_filename

from .forms import TicketForm, ReplyForm
from ..same import *

from app.models import User, Site, Ticket, Reply
from app.utils.smsapi import SendSms

now = 'task'
thead = [(0, '工单ID'), (1, u'发布者'), (2, u'任务名称'), (3, u'机房'),
         (4, u'客户名称'), (5, u'技术支持'), (6, u'创建时间'), (7, u'结束时间'),
         (8, u'状态')]
check_field = ['client', 'linkman', 'contack', 'body']
endpoint= '.task_search'

# 判断上传的文件是否允许
def allowed_file(filename):
    return '.' in filename and \
            filename.rsplit('.', 1)[1] in current_app.config.get('ALLOWED_EXTENSIONS')

@ticket.route('/ticket/task/search',  methods=['GET'])
@login_required
def task_search():
    task_info = ticket_status()
    search_value = request.args.get('search', '')
    if search_value:
        page = int(request.args.get('page', 1))
        result = search(Ticket, 'id' , search_value)
        result = result.search_return()
        if result:
            pagination = result.paginate(page, 100, False)
            items = pagination.items
            return render_template(
                'ticket/task_search.html', task_info=task_info, sidebar=sidebar,
                search_value=search_value, thead=thead, pagination=pagination,
                endpoint=endpoint, items=items, now=now
            )

    return render_template('ticket/task_search.html', task_info=task_info, sidebar=sidebar,
                           search_value=search_value, thead=thead)

@ticket.route('/ticket/task/add',  methods=['GET', 'POST'])
@login_required
@permission_validation(Permission.ADMIN, ['QUERY', 'ALL_QUERY', 'AUDIT_QUERY', 'ADVANCED_QUERY'])
def task_add():
    ticket_form = TicketForm()
    task_info = ticket_status()
    ticket_form.site.choices = [(site.site, site.site) for site in Site.query.order_by(Site.site.asc()).all()]
    if ticket_form.validate_on_submit():
        ticket = Ticket(
            sales=current_user.alias,
            task=ticket_form.task.data,
            site=ticket_form.site.data,
            client=ticket_form.client.data,
            linkman=ticket_form.linkman.data,
            contack=ticket_form.contack.data,
            body=ticket_form.body.data,
            status="audit"
        )
        add_sql = edit(ticket, record=False)
        add_sql.run('add')
        sms = SendSms(ticket)
        sms.run()
        flash(u'任务添加成功')
        return redirect(url_for('.task_search', search='status==audit'))
    else:
        for key in check_field :
            if ticket_form.errors.get(key, None):
                flash(ticket_form.errors[key][0])
                break
    return render_template('ticket/task_add.html', task_info=task_info, sidebar=sidebar,
                            ticket_form=ticket_form)

@ticket.route('/ticket/task/reply/<int:id>',  methods=['GET', 'POST'])
@login_required
def task_reply(id):
    ticket = Ticket.query.get_or_404(id)
    # 如果用户是普通查询用户 要看是不是工单发布人 如果不是返回403
    if current_user.role == 'QUERY' and current_user.alias != ticket.sales:
        abort(403)
    reply_form = ReplyForm()
    task_info = ticket_status()
    alter_user = [ user.alias for user in User.query.all() if user.role == "ALTER"]

    if request.method == "POST" and ticket.status == "processing" and \
            (current_user.alias == ticket.sales or current_user.alias == ticket.support):
        # 回复内容
        if request.form.get("action") == "body":
            if reply_form.validate_on_submit():
                reply = Reply(
                    ticket_id = ticket.id,
                    user = current_user.alias,
                    body = reply_form.body.data
                )
            else:
                flash(reply_form.errors['body'][0])
        # 回复图片
        else:
            file = request.files['upload']
            if file and allowed_file(file.filename):
                # 重命名上传名称使用时间到毫秒做文件名
                date = datetime.datetime.now().strftime("%Y%m%d%H%M%S%f")
                # 防止上传人使用../../这种形式将文件上传到危险目录
                filename = secure_filename( date + '.' + file.filename.split('.')[-1])
                save_path = os.path.join(current_app.config.get('UPLOAD_FOLDER'), filename)
                file.save(save_path)
                reply = Reply(
                    ticket_id = ticket.id,
                    user = current_user.alias,
                    body = '/static/uploads/ticket/' + filename,
                    image = True
                )
            else:
                abort(400)

        # 判断这个变量是否存在
        if locals().get('reply'):
            add_sql = edit(reply, record=False)
            add_sql.run('add')
            change_sql = edit(ticket, 'last_reply', current_user.alias, record=False)
            change_sql.run('change')
            return redirect(url_for('.task_reply', id=ticket.id))
    # 查找出所有跟这个ticket相关的回复 然后按照发布时间从小到大排序
    all_reply = Reply.query.filter_by(ticket_id =  \
                    ticket.id).order_by(Reply.reply_datetime.asc()).all()
    return render_template('ticket/task_reply.html', task_info=task_info, sidebar=sidebar,
                            ticket=ticket, all_reply=all_reply, reply_form=reply_form,
                            alter_user=alter_user)

# 显示图片
@ticket.route('/ticket/task/uploaded/<filename>')
@login_required
def task_uploaded_file(filename):
    return send_from_directory(current_app.config.get('UPLOAD_FOLDER'), filename)

@ticket.route('/ticket/task/audit', methods=['POST'])
@login_required
@permission_validation(Permission.ADMIN, ['AUDIT_QUERY','ADVANCED_QUERY'])
def task_audit():
    # 审核工单
    ticket_id = int(request.form["ticket_id"])
    result = request.form["result"]
    headnote = request.form["headnote"]
    if len(headnote) > 32:
        return "审核失败 审核批注最多32个字符"
    ticket =Ticket.query.filter_by(id=ticket_id).first()
    if result == "agree":
        state = "approved"
    else:
        state = "failure"
        change_sql = edit(ticket, 'end_datetime', datetime.datetime.now(), record=False)
        change_sql.run('change')
    if ticket:
        if ticket.auditor:
            return "审核失败 这个工单已审核"
        change_sql = edit(ticket, 'auditor', current_user.alias, record=False)
        change_sql.run('change')
        change_sql = edit(ticket, 'results', result, record=False)
        change_sql.run('change')
        change_sql = edit(ticket, 'headnote', headnote, record=False)
        change_sql.run('change')
        change_sql = edit(ticket, 'status', state, record=False)
        change_sql.run('change')
        sms = SendSms(ticket)
        sms.run()
        return "OK"
    return u"审核失败 没有找到这个工单"

@ticket.route('/ticket/task/support', methods=['POST'])
@login_required
@permission_validation(Permission.ALTER)
def task_support():
    ticket_id = int(request.form["ticket_id"])
    support = request.form["support"]
    ticket =Ticket.query.filter_by(id=ticket_id).first()
    if ticket:
        if ticket.status in ["success", "failure"]:
            return "更改失败 这个工单已经结束"
        if not ticket.support:
            return "更改失败 这个工单还没有处理"
        if support == current_user.alias:
            return "更改失败 不能更改相同技术支持"
        change_sql = edit(ticket, 'support', support, record=False)
        change_sql.run('change')
        return "OK"
    return "更改失败 没有找到这个工单"

@ticket.route('/ticket/task/status', methods=['POST'])
@login_required
@permission_validation(Permission.AUDIT_QUERY, ['QUERY', "ALL_QUERY"])
def task_status():
    # 更改工单状态
    ticket_id = int(request.form["ticket_id"])
    state = request.form["state"]
    ticket =Ticket.query.filter_by(id=ticket_id).first()
    if ticket:
        if not ticket.auditor:
            return "更改失败 这个工单未审核"

        if ticket.status in ["success", "failure"]:
            return "更改失败 这个工单已经结束"

        if current_user.role in ["QUERY", "ALL_QUERY", "AUDIT_QUERY", "ADVANCED_QUERY"]:
            # 获取评价
            evaluate = request.form["evaluate"]
            if ticket.status != "processing":
                return "更改失败 这个任务还没有处理"
            # 防止其他用户提交
            elif current_user.alias == ticket.sales and \
                    state not in ["success", "failure"]:
                return "更改失败 没有更改这个状态权限"
            if len(evaluate) > 32:
                return "更改失败 评价最多32个字符"
            elif state in ["success", "failure"]:
                change_sql = edit(ticket, 'end_datetime', datetime.datetime.now(), record=False)
                change_sql.run('change')
                change_sql = edit(ticket, 'evaluate', evaluate, record=False)
                change_sql.run('change')

        if current_user.role == "ALTER":
            if ticket.support:
                return "更改失败 已经更改这个状态"
            if state !="processing":
                return "更改失败 没有更改这个状态的权限"
            change_sql = edit(ticket, 'support', current_user.alias, record=False)
            change_sql.run('change')
        change_sql = edit(ticket, 'status', state, record=False)
        change_sql.run('change')
        sms = SendSms(ticket)
        sms.run()
        return "OK"
    return "更改失败 没有找到这个工单"


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>SuperLU: SRC/creadrb.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Data Structures

Files

SRC/creadrb.c File Reference
Read a matrix stored in Rutherford-Boeing format. More...

#include "slu_cdefs.h"

Functions

static int 	cDumpLine (FILE *fp)

 	Eat up the rest of the current line.

static int 	cParseIntFormat (char *buf, int *num, int *size)

static int 	cParseFloatFormat (char *buf, int *num, int *size)

static int 	ReadVector (FILE *fp, int n, int *where, int perline, int persize)

static int 	cReadValues (FILE *fp, int n, complex *destination, int perline, int persize)

 	Read complex numbers as pairs of (real, imaginary).

void 	creadrb (int *nrow, int *ncol, int *nonz, complex **nzval, int **rowind, int **colptr)

Detailed Description

 -- SuperLU routine (version 4.0) --
 Lawrence Berkeley National Laboratory.
 June 30, 2009

Purpose =======

Read a COMPLEX PRECISION matrix stored in Rutherford-Boeing format as described below.

Line 1 (A72, A8) Col. 1 - 72 Title (TITLE) Col. 73 - 80 Matrix name / identifier (MTRXID)

Line 2 (I14, 3(1X, I13)) Col. 1 - 14 Total number of lines excluding header (TOTCRD) Col. 16 - 28 Number of lines for pointers (PTRCRD) Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) Col. 44 - 56 Number of lines for numerical values (VALCRD)

Line 3 (A3, 11X, 4(1X, I13)) Col. 1 - 3 Matrix type (see below) (MXTYPE) Col. 15 - 28 Compressed Column: Number of rows (NROW) Elemental: Largest integer used to index variable (MVAR) Col. 30 - 42 Compressed Column: Number of columns (NCOL) Elemental: Number of element matrices (NELT) Col. 44 - 56 Compressed Column: Number of entries (NNZERO) Elemental: Number of variable indeces (NVARIX) Col. 58 - 70 Compressed Column: Unused, explicitly zero Elemental: Number of elemental matrix entries (NELTVL)

Line 4 (2A16, A20) Col. 1 - 16 Fortran format for pointers (PTRFMT) Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) Col. 33 - 52 Fortran format for numerical values of coefficient matrix (VALFMT) (blank in the case of matrix patterns)

The three character type field on line 3 describes the matrix type. The following table lists the permitted values for each of the three characters. As an example of the type field, RSA denotes that the matrix is real, symmetric, and assembled.

First Character: R Real matrix C Complex matrix I integer matrix P Pattern only (no numerical values supplied) Q Pattern only (numerical values supplied in associated auxiliary value file)

Second Character: S Symmetric U Unsymmetric H Hermitian Z Skew symmetric R Rectangular

Third Character: A Compressed column form E Elemental form

 -- SuperLU routine (version 4.0) --
 Lawrence Berkeley National Laboratory.
 June 30, 2009

Function Documentation

          static int cDumpLine
          (
          FILE *
           fp
           )
           [static]

          static int cParseFloatFormat
          (
          char *
           buf,

          int *
           num,

          int *
           size

          )
          		 [static]

          static int cParseIntFormat
          (
          char *
           buf,

          int *
           num,

          int *
           size

          )
          		 [static]

          void creadrb
          (
          int *
           nrow,

          int *
           ncol,

          int *
           nonz,

          complex **
           nzval,

          int **
           rowind,

          int **
           colptr

          )

          static int cReadValues
          (
          FILE *
           fp,

          int
           n,

          complex *
           destination,

          int
           perline,

          int
           persize

          )
          		 [static]

          static int ReadVector
          (
          FILE *
           fp,

          int
           n,

          int *
           where,

          int
           perline,

          int
           persize

          )
          		 [static]

<address style="text-align: right;">Generated on Mon Nov 22 10:23:47 2010 for SuperLU by

 1.5.5 </address>


text:
<md-progress-linear ng-if="!note || loading" flex md-mode="indeterminate"></md-progress-linear>
<form name="noteForm" class="noteForm" novalidate>
    <ng-if ng-if="note && !loading">
      <md-input-container class="md-block" md-form-error>
        NOTES.NAME
        <input md-maxlength="20"
            tabindex="0"
            name="name"
            ng-model="note.name"
            required/>

NOTES.NAME.HINT

NOTES.NAME.REQUIRED

NOTES.NAME.MAX_LENGTH

      </md-input-container>
      <md-input-container class="md-block" md-form-error>
        <md-quill name="content"
            ng-model="note.content"
            max-length="10000"
            required></md-quill>

NOTES.CONTENT.REQUIRED

NOTES.CONTENT.MAX_LENGTH

      </md-input-container>
      <md-input-container class="md-block" md-form-error>
          NOTES.TAGS
          <md-chips class="custom-chips"
               name="tags"
               secondary-placeholder="+"
               readonly="false"
               md-removable="true"
               md-max-chips="3"
               md-add-on-blur="true"
               ng-model="note.tags">
             <md-chip-template>

                 {{$chip}}

             </md-chip-template>
             <button md-chip-remove class="md-primary" type="button">
               <md-icon md-svg-icon="img/icons/close.svg"></md-icon>
             </button>
          </md-chips>

NOTES.TAGS.HINT

NOTES.TAGS.MAX_LENGTH

      </md-input-container>

          <md-button ui-sref="notes" class="">
              COMMON.CANCEL
          </md-button>
          <md-button ng-click="saveNote()" class="md-raised md-primary">
              COMMON.SAVE
          </md-button>

    </ng-if>
</form>


text:
exports.create = function(req, res) {
	res.render('user/create');
};


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

#endregion

namespace Leoxia.Testing.Reflection
{
    /// <summary>
    ///     Builder for objects
    /// </summary>
    public static class ObjectBuilder
    {
        private static readonly object[] _dummyParams = { };

        /// <summary>
        ///     Call MemberwiseClone on given object.
        /// </summary>
        /// <param name="instanceToClone">The instance to clone.</param>
        /// <returns></returns>
        public static object MemberwiseClone(object instanceToClone)
        {
            var methodInfo = instanceToClone.GetType().GetMethod("MemberwiseClone",
                BindingFlags.NonPublic |
                BindingFlags.Instance |
                BindingFlags.InvokeMethod |
                BindingFlags.FlattenHierarchy);
            return methodInfo.Invoke(instanceToClone, _dummyParams);
        }

        /// <summary>
        ///     Creates a <see cref="IList" />.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="seed">The seed.</param>
        /// <param name="recurse">if set to <c>true</c> [recurse].</param>
        /// <returns></returns>
        // ReSharper disable once ExcessiveIndentation
        internal static object CreateIList(Type type, int seed, bool recurse)
        {
            //ConstructorInfo constructorInfo = type.GetConstructor(BindingFlags.Static|BindingFlags.Public |BindingFlags.CreateInstance, null, new Type[]{typeof(int)}, new ParameterModifier[]{});
            var args = new object[] {3};
            var newValue = Activator.CreateInstance(type, args);
            for (var i = 0; i < 3; ++i)
            {
                object resultValue;
                Type elementType;
                if (type.HasElementType)
                {
                    elementType = type.GetElementType();
                }
                else
                {
                    elementType = type.GetGenericArguments()[0];
                }
                var flag = CreateValue(elementType, seed, out resultValue);
                if (!flag)
                {
                    if (elementType == typeof(string))
                    {
                        resultValue = seed.ToString();
                    }
                    else
                    {
                        var elementInfo = elementType.GetConstructor(Type.EmptyTypes);
                        if (elementInfo != null)
                        {
                            resultValue = elementInfo.Invoke(null);
                            if (recurse)
                            {
                                ObjectFiller.Fill(resultValue, true);
                            }
                        }
                    }
                }
                AddInList(type, i, newValue, resultValue);
            }
            return newValue;
        }

        private static void AddInList(Type type, int index, object list, object value)
        {
            if (type.IsArray)
            {
                ((IList) list)[index] = value;
            }
            else
            {
                ((IList) list).Add(value);
            }
        }

        /// <summary>
        ///     Creates the instance and populates it.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="seed">The seed.</param>
        /// <param name="recurse">if set to <c>true</c> [recurse].</param>
        /// <returns></returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public static object CreateInstance(Type type, int seed, bool recurse)
        {
            object resultValue;
            var flag = CreateValue(type, seed, out resultValue);
            if (flag)
            {
                return resultValue;
            }
            if (type == typeof(string))
            {
                return seed.ToString();
            }
            if (typeof(IList).IsAssignableFrom(type))
            {
                return CreateIList(type, seed, recurse);
            }
            var elementInfo = type.GetConstructor(Type.EmptyTypes);
            if (elementInfo != null)
            {
                resultValue = elementInfo.Invoke(null);
                if (recurse)
                {
                    ObjectFiller.Fill(resultValue, true);
                }
            }
            else
            {
                var constructorInfos = type.GetConstructors();
                if (constructorInfos.Length == 0)
                {
                    throw new InvalidOperationException($"Cannot find constructors for {type}");
                }
                elementInfo = constructorInfos[0];
                var parameters = new List<object>();
                foreach (var info in elementInfo.GetParameters())
                {
                    parameters.Add(CreateInstance(info.ParameterType, Environment.TickCount, false));
                }
                resultValue = elementInfo.Invoke(parameters.ToArray());
                if (recurse)
                {
                    ObjectFiller.Fill(resultValue, true);
                }
            }
            return resultValue;
        }

        /// <summary>
        ///     Mocks the value.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="seed">The seed used to generate a value.</param>
        /// <param name="newValue">The new value.</param>
        /// <returns></returns>
        // ReSharper disable once ExcessiveIndentation
        internal static bool CreateValue(Type type, int seed, out object newValue)
        {
            newValue = null;
            var typeInfo = type.GetTypeInfo();
            if (typeInfo.IsPrimitive)
            {
                if (type == typeof(bool))
                {
                    newValue = true;
                }
                else if (type == typeof(double))
                {
                    newValue = (double) seed;
                }
                else if (type == typeof(float))
                {
                    newValue = (float) seed;
                }
                else if (type == typeof(long))
                {
                    newValue = (long) seed;
                }
                else if (type == typeof(int))
                {
                    newValue = seed;
                }
                else if (type == typeof(byte))
                {
                    newValue = (byte) seed;
                }
                else if (type == typeof(char))
                {
                    newValue = (char) seed;
                }
                else
                {
                    return true;
                }
            }
            else if (typeInfo.IsValueType)
            {
                if (type == typeof(decimal))
                {
                    newValue = (decimal) seed;
                }
                else if (typeInfo.IsEnum)
                {
                    var names = Enum.GetNames(type);
                    // Special case for flags in order to check for limit cases
                    if (type.HasAttribute(typeof(FlagsAttribute))
                        && names.Length > 1)
                    {
                        var index = seed % (names.Length - 1);
                        newValue = (int) Enum.Parse(type, names[names.Length - 1]) +
                                   (int) Enum.Parse(type, names[index]);
                    }
                    else
                    {
                        var index = seed % names.Length;
                        newValue = Enum.Parse(type, names[index]);
                    }
                }
                else if (type == typeof(DateTime))
                {
                    newValue = DateTime.Now;
                    return true;
                }
                else if (type == typeof(TimeSpan))
                {
                    newValue = TimeSpan.FromMilliseconds(Environment.TickCount);
                    return true;
                }
                else if (type == typeof(string))
                {
                    newValue = seed.ToString();
                    return true;
                }
                return true;
            }
            else
            {
                return false;
            }

            return true;
        }
    }
}


text:
<?php

namespace Ongoing;

class UploadArticleDefFileResponse
{

    public function __construct()
    {

    }

}


text:
#include "precomp.hpp"

namespace cv
{

class GFTTDetector_Impl CV_FINAL : public GFTTDetector
{
public:
    GFTTDetector_Impl( int _nfeatures, double _qualityLevel,
                      double _minDistance, int _blockSize, int _gradientSize,
                      bool _useHarrisDetector, double _k )
        : nfeatures(_nfeatures), qualityLevel(_qualityLevel), minDistance(_minDistance),
        blockSize(_blockSize), gradSize(_gradientSize), useHarrisDetector(_useHarrisDetector), k(_k)
    {
    }

    void setMaxFeatures(int maxFeatures) CV_OVERRIDE { nfeatures = maxFeatures; }
    int getMaxFeatures() const CV_OVERRIDE { return nfeatures; }

    void setQualityLevel(double qlevel) CV_OVERRIDE { qualityLevel = qlevel; }
    double getQualityLevel() const CV_OVERRIDE { return qualityLevel; }

    void setMinDistance(double minDistance_) CV_OVERRIDE { minDistance = minDistance_; }
    double getMinDistance() const CV_OVERRIDE { return minDistance; }

    void setBlockSize(int blockSize_) CV_OVERRIDE { blockSize = blockSize_; }
    int getBlockSize() const CV_OVERRIDE { return blockSize; }

    //void setGradientSize(int gradientSize_) { gradSize = gradientSize_; }
    //int getGradientSize() { return gradSize; }

    void setHarrisDetector(bool val) CV_OVERRIDE { useHarrisDetector = val; }
    bool getHarrisDetector() const CV_OVERRIDE { return useHarrisDetector; }

    void setK(double k_) CV_OVERRIDE { k = k_; }
    double getK() const CV_OVERRIDE { return k; }

    void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask ) CV_OVERRIDE
    {
        CV_INSTRUMENT_REGION();

        if(_image.empty())
        {
            keypoints.clear();
            return;
        }

        std::vector<Point2f> corners;
        std::vector<float> cornersQuality;

        if (_image.isUMat())
        {
            UMat ugrayImage;
            if( _image.type() != CV_8U )
                cvtColor( _image, ugrayImage, COLOR_BGR2GRAY );
            else
                ugrayImage = _image.getUMat();

            goodFeaturesToTrack( ugrayImage, corners, nfeatures, qualityLevel, minDistance, _mask,
                                 cornersQuality, blockSize, gradSize, useHarrisDetector, k );
        }
        else
        {
            Mat image = _image.getMat(), grayImage = image;
            if( image.type() != CV_8U )
                cvtColor( image, grayImage, COLOR_BGR2GRAY );

            goodFeaturesToTrack( grayImage, corners, nfeatures, qualityLevel, minDistance, _mask,
                                 cornersQuality, blockSize, gradSize, useHarrisDetector, k );
        }

        CV_Assert(corners.size() == cornersQuality.size());

        keypoints.resize(corners.size());
        for (size_t i = 0; i < corners.size(); i++)
            keypoints[i] = KeyPoint(corners[i], (float)blockSize, -1, cornersQuality[i]);

    }

    int nfeatures;
    double qualityLevel;
    double minDistance;
    int blockSize;
    int gradSize;
    bool useHarrisDetector;
    double k;
};

Ptr<GFTTDetector> GFTTDetector::create( int _nfeatures, double _qualityLevel,
                         double _minDistance, int _blockSize, int _gradientSize,
                         bool _useHarrisDetector, double _k )
{
    return makePtr<GFTTDetector_Impl>(_nfeatures, _qualityLevel,
                                      _minDistance, _blockSize, _gradientSize, _useHarrisDetector, _k);
}

Ptr<GFTTDetector> GFTTDetector::create( int _nfeatures, double _qualityLevel,
                         double _minDistance, int _blockSize,
                         bool _useHarrisDetector, double _k )
{
    return makePtr<GFTTDetector_Impl>(_nfeatures, _qualityLevel,
                                      _minDistance, _blockSize, 3, _useHarrisDetector, _k);
}

String GFTTDetector::getDefaultName() const
{
    return (Feature2D::getDefaultName() + ".GFTTDetector");
}

}


text:
/**
 * @fileoverview Object in charge of loading, storing, and playing audio for a
 *     workspace.
 * @author fenichel@google.com (Rachel Fenichel)
 */
'use strict';

goog.provide('Blockly.WorkspaceAudio');

goog.require('Blockly.utils');
goog.require('Blockly.utils.userAgent');

/**
 * Class for loading, storing, and playing audio for a workspace.
 * @param {Blockly.WorkspaceSvg} parentWorkspace The parent of the workspace
 *     this audio object belongs to, or null.
 * @constructor
 */
Blockly.WorkspaceAudio = function(parentWorkspace) {

  /**
   * The parent of the workspace this object belongs to, or null.  May be
   * checked for sounds that this object can't find.
   * @type {Blockly.WorkspaceSvg}
   * @private
   */
  this.parentWorkspace_ = parentWorkspace;

  /**
   * Database of pre-loaded sounds.
   * @private
   * @const
   */
  this.SOUNDS_ = Object.create(null);
};

/**
 * Time that the last sound was played.
 * @type {Date}
 * @private
 */
Blockly.WorkspaceAudio.prototype.lastSound_ = null;

/**
 * Dispose of this audio manager.
 * @package
 */
Blockly.WorkspaceAudio.prototype.dispose = function() {
  this.parentWorkspace_ = null;
  this.SOUNDS_ = null;
};

/**
 * Load an audio file.  Cache it, ready for instantaneous playing.
 * @param {!Array.<string>} filenames List of file types in decreasing order of
 *   preference (i.e. increasing size).  E.g. ['media/go.mp3', 'media/go.wav']
 *   Filenames include path from Blockly's root.  File extensions matter.
 * @param {string} name Name of sound.
 */
Blockly.WorkspaceAudio.prototype.load = function(filenames, name) {
  if (!filenames.length) {
    return;
  }
  try {
    var audioTest = new Blockly.utils.global['Audio']();
  } catch (e) {
    // No browser support for Audio.
    // IE can throw an error even if the Audio object exists.
    return;
  }
  var sound;
  for (var i = 0; i < filenames.length; i++) {
    var filename = filenames[i];
    var ext = filename.match(/\.(\w+)$/);
    if (ext && audioTest.canPlayType('audio/' + ext[1])) {
      // Found an audio format we can play.
      sound = new Blockly.utils.global['Audio'](filename);
      break;
    }
  }
  if (sound && sound.play) {
    this.SOUNDS_[name] = sound;
  }
};

/**
 * Preload all the audio files so that they play quickly when asked for.
 * @package
 */
Blockly.WorkspaceAudio.prototype.preload = function() {
  for (var name in this.SOUNDS_) {
    var sound = this.SOUNDS_[name];
    sound.volume = 0.01;
    sound.play().catch(function() {});
    sound.pause();
    // iOS can only process one sound at a time.  Trying to load more than one
    // corrupts the earlier ones.  Just load one and leave the others uncached.
    if (Blockly.utils.userAgent.IPAD || Blockly.utils.userAgent.IPHONE) {
      break;
    }
  }
};

/**
 * Play a named sound at specified volume.  If volume is not specified,
 * use full volume (1).
 * @param {string} name Name of sound.
 * @param {number=} opt_volume Volume of sound (0-1).
 */
Blockly.WorkspaceAudio.prototype.play = function(name, opt_volume) {
  var sound = this.SOUNDS_[name];
  if (sound) {
    // Don't play one sound on top of another.
    var now = new Date;
    if (this.lastSound_ != null &&
        now - this.lastSound_ < Blockly.SOUND_LIMIT) {
      return;
    }
    this.lastSound_ = now;
    var mySound;
    if (Blockly.utils.userAgent.IPAD || Blockly.utils.userAgent.ANDROID) {
      // Creating a new audio node causes lag in Android and iPad.  Android
      // refetches the file from the server, iPad uses a singleton audio
      // node which must be deleted and recreated for each new audio tag.
      mySound = sound;
    } else {
      mySound = sound.cloneNode();
    }
    mySound.volume = (opt_volume === undefined ? 1 : opt_volume);
    mySound.play();
  } else if (this.parentWorkspace_) {
    // Maybe a workspace on a lower level knows about this sound.
    this.parentWorkspace_.getAudioManager().play(name, opt_volume);
  }
};


text:
int main(int, char const* []) { return 0; }
#else

#include <boost/convert.hpp>
#include <boost/convert/stream.hpp>
#include <boost/convert/printf.hpp>
#include <boost/convert/strtol.hpp>
#include <boost/convert/lexical_cast.hpp>
#include <boost/convert/spirit.hpp>
#include <boost/detail/lightweight_test.hpp>

using std::string;

template<typename Converter>
void
int_to_str(Converter const& cnv)
{
    string const    not_int_str = "not an int";
    string const        std_str = "-11";
    char const* const     c_str = "-12";
    char const      array_str[] = "-15";

    ////////////////////////////////////////////////////////////////////////////
    // Testing int-to-string conversion with various string
    // containers as the fallback values.
    ////////////////////////////////////////////////////////////////////////////

    string                    s01 = boost::convert< string>(-1, cnv).value_or(std_str);
    string                    s02 = boost::convert< string>(-2, cnv).value_or(c_str);
    string                    s05 = boost::convert< string>(-5, cnv).value_or(array_str);
    boost::optional< string> rs01 = boost::convert< string>(-1, cnv);
    boost::optional< string> rs02 = boost::convert< string>(-2, cnv);
    boost::optional< string> rs05 = boost::convert< string>(-5, cnv);

    BOOST_TEST(s01 ==  "-1"); BOOST_TEST(rs01 && rs01.value() ==  "-1");
    BOOST_TEST(s02 ==  "-2"); BOOST_TEST(rs02 && rs02.value() ==  "-2");
    BOOST_TEST(s05 ==  "-5"); BOOST_TEST(rs05 && rs05.value() ==  "-5");

    string                    s11 = boost::convert< string>(-1, cnv).value();
    boost::optional< string> rs11 = boost::convert< string>(-1, cnv);

    BOOST_TEST( s11 ==  "-1");
    BOOST_TEST(rs11 && rs11.value() ==  "-1");
}

template<typename Converter>
void
str_to_int(Converter const& cnv)
{
    string const           not_int_str = "not an int";
    string const               std_str =  "-11";
    char const* const            c_str = "-123";
    char const             array_str[] = "3456";

    ////////////////////////////////////////////////////////////////////////////
    // Testing various kinds of string containers.
    // Testing implicit conversion directly to TypeOut (int).
    // Testing with the fallback value value provided.
    // On failure returns the provided fallback value and DOES NOT THROW.
    ////////////////////////////////////////////////////////////////////////////

    int const a00 = boost::convert<int>(not_int_str, cnv).value_or(-1);
    int const a01 = boost::convert<int>(std_str,     cnv).value_or(-1);
    int const a02 = boost::convert<int>(c_str,       cnv).value_or(-1);
    int const a05 = boost::convert<int>(array_str,   cnv).value_or(-1);

    BOOST_TEST(a00 ==   -1); // Failed conversion
    BOOST_TEST(a01 ==  -11);
    BOOST_TEST(a02 == -123);
    BOOST_TEST(a05 == 3456);

    ////////////////////////////////////////////////////////////////////////////
    // Testing "optional"
    ////////////////////////////////////////////////////////////////////////////

    boost::optional<int> const r00 = boost::convert<int>(not_int_str, cnv);
    boost::optional<int> const r01 = boost::convert<int>(std_str,     cnv);
    boost::optional<int> const r02 = boost::convert<int>(c_str,       cnv);
    boost::optional<int> const r05 = boost::convert<int>(array_str,   cnv);

    BOOST_TEST(!r00); // Failed conversion
    BOOST_TEST( r01 && r01.value() ==  -11);
    BOOST_TEST( r02 && r02.value() == -123);
    BOOST_TEST( r05 && r05.value() == 3456);

    ////////////////////////////////////////////////////////////////////////////
    // Testing value() on invalid result.
    ////////////////////////////////////////////////////////////////////////////

    try
    {
        boost::convert<int>(not_int_str, cnv).value();
        BOOST_TEST(!"failed to throw");
    }
    catch (std::exception&)
    {
        // Expected behavior: received 'boost::convert failed' exception. All well.
    }
    ////////////////////////////////////////////////////////////////////////////
    // Testing value() on valid result.
    ////////////////////////////////////////////////////////////////////////////

    int a21 = boost::convert<int>(std_str,   cnv).value();
    int a22 = boost::convert<int>(c_str,     cnv).value();
    int a25 = boost::convert<int>(array_str, cnv).value();

    BOOST_TEST(a21 ==  -11);
    BOOST_TEST(a22 == -123);
    BOOST_TEST(a25 == 3456);

    ////////////////////////////////////////////////////////////////////////////
    // Testing empty string.
    ////////////////////////////////////////////////////////////////////////////

    int a31 = boost::convert<int>(std::string(), cnv).value_or(-1);
    int a32 = boost::convert<int>(std::string(""), cnv).value_or(-1);
    int a33 = boost::convert<int>("", cnv).value_or(-1);

    BOOST_ASSERT(a31 == -1);
    BOOST_ASSERT(a32 == -1);
    BOOST_ASSERT(a33 == -1);
}

int
main(int, char const* [])
{
    boost::cnv::lexical_cast lxcast_cnv;
    boost::cnv::cstream      stream_cnv;
    boost::cnv::strtol       strtol_cnv;
    boost::cnv::printf       printf_cnv;
    boost::cnv::spirit       spirit_cnv;

    str_to_int(lxcast_cnv);
    str_to_int(stream_cnv);
    str_to_int(strtol_cnv);
    str_to_int(printf_cnv);
    str_to_int(spirit_cnv);

    int_to_str(lxcast_cnv);
    int_to_str(stream_cnv);
    int_to_str(strtol_cnv);
    int_to_str(printf_cnv);
    int_to_str(spirit_cnv);

    return boost::report_errors();
}

#endif


text:
export interface UpdateUserInput {
  userName: string;
  name: string;
  surname: string;
  emailAddress: string;
  isActive: boolean;
  fullName: string;
  lastLoginTime: Date;
  creationTime: Date;
  roleNames: string[];
  id: number;
}


text:
import os.path as op
import logging

HOST = 'localhost:5000'
API_HOST = 'localhost:5001'

LOG_LEVEL = logging.DEBUG
LOGGER_NAME = "pmg_frontend_logger"  # make sure this is not the same as the name of the package to avoid conflicts with Flask's own logger
DEBUG = True

SECRET_KEY = "AEORJAEONIAEGCBGKMALMAENFXGOAERGN"


text:
_[www.codever.land/bookmarks/t/construct-2](https://www.codever.land/bookmarks/t/construct-2)_
---
#### [awesome-construct](https://github.com/WebCreationClub/awesome-construct#readme)
_https://github.com/WebCreationClub/awesome-construct#readme_

A curated list of tools, tutorials, examples, and much more, for the awesome game development engines Construct 2 and Construct 3 - WebCreationClub/awesome-construct
* **tags**: [awesome-list](../tagged/awesome-list.md), [game-development](../tagged/game-development.md), [construct-2](../tagged/construct-2.md)
* :octocat: **[source code](https://github.com/WebCreationClub/awesome-construct#readme)**
---