text
stringlengths 4
6.14k
|
|---|
/*
Copyright 2010-2013 SourceGear, LLC
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.
*/
/**
*
* @file sg_exec_argvec_prototypes.h
*
* @details Wrapper and prototypes for argument vector used by sg_exec.
*
*/
//////////////////////////////////////////////////////////////////
#ifndef H_SG_EXEC_ARGVEC_PROTOTYPES_H
#define H_SG_EXEC_ARGVEC_PROTOTYPES_H
BEGIN_EXTERN_C;
//////////////////////////////////////////////////////////////////
void SG_exec_argvec__alloc(SG_context* pCtx, SG_exec_argvec ** ppArgVec);
void SG_exec_argvec__free(SG_context * pCtx, SG_exec_argvec * pArgVec);
void SG_exec_argvec__append__sz(SG_context* pCtx, SG_exec_argvec * pArgVec, const char * sz);
void SG_exec_argvec__remove_last(SG_context* pCtx, SG_exec_argvec * pArgVec);
void SG_exec_argvec__length(SG_context* pCtx, const SG_exec_argvec * pArgVec, SG_uint32 * pLength);
/**
* fetch the k-th argument into a SG_string.
*
* you do not own this string.
*/
void SG_exec_argvec__get(SG_context* pCtx, const SG_exec_argvec * pArgVec, SG_uint32 k, const SG_string ** ppStr);
//////////////////////////////////////////////////////////////////
END_EXTERN_C;
#endif//H_SG_EXEC_ARGVEC_PROTOTYPES_H
|
/*
* Copyright 2017 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mongoc/mongoc-config.h"
#ifdef MONGOC_ENABLE_SASL_GSSAPI
#include "mongoc/mongoc-gssapi-private.h"
#include "mongoc/mongoc-trace-private.h"
#undef MONGOC_LOG_DOMAIN
#define MONGOC_LOG_DOMAIN "GSSAPI"
/* ... */
#endif
|
//
// AppDelegate.h
// Soulscour
//
// Created by lanou on 16/10/27.
// Copyright © 2016年 lanou. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "ch.h"
#include "hal.h"
static void pwmpcb(PWMDriver *pwmp) {
(void)pwmp;
palClearPad(GPIOC, GPIOC_LED1);
}
static void pwmc1cb(PWMDriver *pwmp) {
(void)pwmp;
palSetPad(GPIOC, GPIOC_LED1);
}
static PWMConfig pwmcfg = {
10000, /* 10kHz PWM clock frequency. */
10000, /* Initial PWM period 1S. */
pwmpcb,
{
{PWM_OUTPUT_ACTIVE_LOW, pwmc1cb},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL}
},
0,
0
};
icucnt_t last_width, last_period;
static void icuwidthcb(ICUDriver *icup) {
palSetPad(GPIOC, GPIOC_LED2);
last_width = icuGetWidthX(icup);
}
static void icuperiodcb(ICUDriver *icup) {
palClearPad(GPIOC, GPIOC_LED2);
last_period = icuGetPeriodX(icup);
}
static ICUConfig icucfg = {
ICU_INPUT_ACTIVE_LOW,
10000, /* 10kHz ICU clock frequency. */
icuwidthcb,
icuperiodcb,
NULL,
ICU_CHANNEL_1,
0
};
/*
* Application entry point.
*/
int main(void) {
/*
* System initializations.
* - HAL initialization, this also initializes the configured device drivers
* and performs the board-specific initializations.
* - Kernel initialization, the main() function becomes a thread and the
* RTOS is active.
*/
halInit();
chSysInit();
/*
* Initializes the PWM driver 5 and ICU driver 3.
* GPIOC0 is the PWM output.
* GPIOC6 is the ICU input.
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD5, &pwmcfg);
pwmEnablePeriodicNotification(&PWMD5);
palSetPadMode(GPIOC, 0, PAL_MODE_ALTERNATE(2));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
icuStartCapture(&ICUD3);
icuEnableNotifications(&ICUD3);
chThdSleepMilliseconds(2000);
/*
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD5, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD5, 7500));
pwmEnableChannelNotification(&PWMD5, 0);
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 50% duty cycle.
*/
pwmEnableChannel(&PWMD5, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD5, 5000));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 25% duty cycle.
*/
pwmEnableChannel(&PWMD5, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD5, 2500));
chThdSleepMilliseconds(5000);
/*
* Changes PWM period to half second the duty cycle becomes 50%
* implicitly.
*/
pwmChangePeriod(&PWMD5, 5000);
chThdSleepMilliseconds(5000);
/*
* Disables channel 0 and stops the drivers.
*/
pwmDisableChannel(&PWMD5, 0);
pwmStop(&PWMD5);
icuStopCapture(&ICUD3);
icuStop(&ICUD3);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (true) {
chThdSleepMilliseconds(500);
}
return 0;
}
|
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
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.
==============================================================================*/
#ifndef TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_H_
#define TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_H_
#if defined(HIFIMINI)
#include <xtensa/tie/xt_hifi2.h>
#elif ((defined(FUSION_F1)) || (defined(HIFI5)))
#include "include/nnlib/xa_nnlib_api.h"
#include "include/nnlib/xa_nnlib_standards.h"
#define ALIGNED_SIZE(x, bytes) (((x) + (bytes - 1)) & (~(bytes - 1)))
#define ALIGN_PTR(x, bytes) ((((unsigned)(x)) + (bytes - 1)) & (~(bytes - 1)))
#endif
#endif // TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_H_
|
//
// PizzaPickupService.h
//
// Definition of the PizzaPickupService class.
//
// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH.
// All rights reserved.
//
// SPDX-License-Identifier: GPL-3.0-only
//
#ifndef PizzaPickupService_INCLUDED
#define PizzaPickupService_INCLUDED
#include "Pizzeria/PizzaDeliveryService.h"
#include "Poco/Random.h"
#include "Poco/DateTime.h"
#include "Poco/Timespan.h"
namespace Pizzeria {
//@ namespace="http://www.appinf.com/webservices/PizzaDeliveryService/", cacheExpire="5min"
class PizzaPickupService: public PizzaDeliveryService
/// Pizzeria that allows self pickup.
{
public:
PizzaPickupService();
/// Creates the PizzaPickupService.
virtual ~PizzaPickupService();
/// Destroys the PizzaPickupService.
//@ remote
//@ synchronized = "true"
//@ $pizza = {order = 2}
//@ $phoneNumber = {order = 1}
Poco::DateTime orderForSelfPickup(const Pizza& pizza, const std::string& phoneNumber);
/// Order a pizza, send it to the given deliveryAddress.
/// Returns the expected time when the Pizza will arrive.
//@ remote
//@ synchronized = "true"
//@ $pizza = {order = 2}
//@ $deliverTo = {order = 1}
Poco::DateTime order(const Pizza& pizza, const DeliveryAddress& deliverTo);
/// Order a pizza, send it to the given deliveryAddress.
/// Returns the expected time when the Pizza will arrive.
/// Note that when we override a method it must be equal even for all annotations
};
inline Poco::DateTime PizzaPickupService::order(const Pizza& pizza, const DeliveryAddress& deliverTo)
{
return PizzaDeliveryService::order(pizza, deliverTo);
}
} // namespace Pizzeria
#endif // PizzaPickupService_INCLUDED
|
#include <stdio.h>
main () {
int A,B,C,D;
printf ("\n** CALCULAR UMA EQUACAO QUADRATICA ** \n");
printf ("\nQual o valor de A? ");
scanf ("%i",&A);
printf ("Qual o valor de B? ");
scanf ("%i",&B);
printf ("Qual o valor de C? ");
scanf ("%i",&C);
D = B * B - 4 * A * C;
printf ("\nO valor de Delta e: %i.\n",D);
printf ("\n\n<< Marco_Tulio >>\n");
getchar(),getchar();
}
|
/*
* Copyright 2013 David Farrell
*
* 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.
*/
#ifndef CUBEDRAWABLE_H
#define CUBEDRAWABLE_H
#include "Drawable.h"
class CubeDrawable : public Drawable
{
protected:
virtual unsigned int Make(glm::vec3 **vertices,
glm::vec3 **normals,
glm::vec3 **tangents,
glm::vec3 **bitangents,
glm::vec2 **texcoords)
{
/* 4 vertices per face
* 6 faces per cube
*/
const unsigned int num = 24;
*vertices = new glm::vec3[num];
*normals = new glm::vec3[num];
*tangents = new glm::vec3[num];
*bitangents = new glm::vec3[num];
*texcoords = new glm::vec2[num];
memset(*vertices, 0, num * sizeof(glm::vec3));
memset(*normals, 0, num * sizeof(glm::vec3));
memset(*tangents, 0, num * sizeof(glm::vec3));
memset(*bitangents, 0, num * sizeof(glm::vec3));
memset(*texcoords, 0, num * sizeof(glm::vec2));
// vertices
// left
(*vertices)[ 0] = glm::vec3(-1, 1, -1);
(*vertices)[ 1] = glm::vec3(-1, -1, -1);
(*vertices)[ 2] = glm::vec3(-1, 1, 1);
(*vertices)[ 3] = glm::vec3(-1, -1, 1);
// right
(*vertices)[ 4] = glm::vec3( 1, 1, 1);
(*vertices)[ 5] = glm::vec3( 1, -1, 1);
(*vertices)[ 6] = glm::vec3( 1, 1, -1);
(*vertices)[ 7] = glm::vec3( 1, -1, -1);
// bottom
(*vertices)[ 8] = glm::vec3(-1, -1, 1);
(*vertices)[ 9] = glm::vec3(-1, -1, -1);
(*vertices)[10] = glm::vec3( 1, -1, 1);
(*vertices)[11] = glm::vec3( 1, -1, -1);
// top
(*vertices)[12] = glm::vec3(-1, 1, -1);
(*vertices)[13] = glm::vec3(-1, 1, 1);
(*vertices)[14] = glm::vec3( 1, 1, -1);
(*vertices)[15] = glm::vec3( 1, 1, 1);
// back
(*vertices)[16] = glm::vec3( 1, 1, -1);
(*vertices)[17] = glm::vec3( 1, -1, -1);
(*vertices)[18] = glm::vec3(-1, 1, -1);
(*vertices)[19] = glm::vec3(-1, -1, -1);
// front
(*vertices)[20] = glm::vec3(-1, 1, 1);
(*vertices)[21] = glm::vec3(-1, -1, 1);
(*vertices)[22] = glm::vec3( 1, 1, 1);
(*vertices)[23] = glm::vec3( 1, -1, 1);
// texcoords
// left
(*texcoords)[ 0] = glm::vec2(0, 0);
(*texcoords)[ 1] = glm::vec2(0, 1);
(*texcoords)[ 2] = glm::vec2(1, 0);
(*texcoords)[ 3] = glm::vec2(1, 1);
// right
(*texcoords)[ 4] = glm::vec2(0, 0);
(*texcoords)[ 5] = glm::vec2(0, 1);
(*texcoords)[ 6] = glm::vec2(1, 0);
(*texcoords)[ 7] = glm::vec2(1, 1);
// bottom
(*texcoords)[ 8] = glm::vec2(0, 0);
(*texcoords)[ 9] = glm::vec2(0, 1);
(*texcoords)[10] = glm::vec2(1, 0);
(*texcoords)[11] = glm::vec2(1, 1);
// top
(*texcoords)[12] = glm::vec2(0, 0);
(*texcoords)[13] = glm::vec2(0, 1);
(*texcoords)[14] = glm::vec2(1, 0);
(*texcoords)[15] = glm::vec2(1, 1);
// back
(*texcoords)[16] = glm::vec2(0, 0);
(*texcoords)[17] = glm::vec2(0, 1);
(*texcoords)[18] = glm::vec2(1, 0);
(*texcoords)[19] = glm::vec2(1, 1);
// front
(*texcoords)[20] = glm::vec2(0, 0);
(*texcoords)[21] = glm::vec2(0, 1);
(*texcoords)[22] = glm::vec2(1, 0);
(*texcoords)[23] = glm::vec2(1, 1);
for(int i=0; i<24; i+=4)
{
glm::vec3 deltaPos1 = (*vertices)[i + 1] - (*vertices)[i];
glm::vec3 deltaPos2 = (*vertices)[i + 2] - (*vertices)[i];
glm::vec2 deltaUV1 = (*texcoords)[i + 1] - (*texcoords)[i];
glm::vec2 deltaUV2 = (*texcoords)[i + 2] - (*texcoords)[i];
// calculate surface normal
glm::vec3 normal = glm::vec3(0);
normal.x = deltaPos1.y * deltaPos2.z - deltaPos1.z * deltaPos2.y;
normal.y = deltaPos1.z * deltaPos2.x - deltaPos1.x * deltaPos2.z;
normal.z = deltaPos1.x * deltaPos2.y - deltaPos1.y * deltaPos2.x;
// calculate tangent and bitangent (what is this magic?!)
float r = 1.0f / (deltaUV1.x * deltaUV2.y - deltaUV1.y * deltaUV2.x);
glm::vec3 tangent = (deltaPos1 * deltaUV2.y - deltaPos2 * deltaUV1.y) * r;
glm::vec3 bitangent = (deltaPos2 * deltaUV1.x - deltaPos1 * deltaUV2.x) * r;
// put everything into the buffers
for(int j=0; j<4; ++j)
{
(*normals )[i + j] = normal;
(*tangents )[i + j] = tangent;
(*bitangents)[i + j] = bitangent;
}
}
return num;
}
public:
virtual void Draw(void)
{
GLenum err;
Drawable::Draw();
const GLint firsts[] = {0, 4, 8, 12, 16, 20};
const GLint counts[] = {4, 4, 4, 4, 4, 4};
glMultiDrawArrays(GL_TRIANGLE_STRIP, firsts, counts, sizeof(firsts) / sizeof(GLint));
if((err = glGetError()) != GL_NO_ERROR) fprintf(stderr, "CubeDrawable::Draw => glMultiDrawArrays: error: 0x%x\n", err);
}
};
#endif
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Jan Steemann
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_MMFILES_MMFILES_REVISIONS_CACHE_H
#define ARANGOD_MMFILES_MMFILES_REVISIONS_CACHE_H 1
#include "Basics/Common.h"
#include "Basics/AssocUnique.h"
#include "Basics/ReadWriteLock.h"
#include "MMFiles/MMFilesDocumentPosition.h"
#include "VocBase/voc-types.h"
struct MMFilesMarker;
namespace arangodb {
class MMFilesRevisionsCache {
public:
MMFilesRevisionsCache();
~MMFilesRevisionsCache();
public:
void sizeHint(int64_t hint);
size_t size();
size_t capacity();
size_t memoryUsage();
void clear();
MMFilesDocumentPosition lookup(TRI_voc_rid_t revisionId) const;
MMFilesDocumentPosition insert(TRI_voc_rid_t revisionId, uint8_t const* dataptr, TRI_voc_fid_t fid, bool isInWal, bool shouldLock);
void insert(MMFilesDocumentPosition const& position, bool shouldLock);
void update(TRI_voc_rid_t revisionId, uint8_t const* dataptr, TRI_voc_fid_t fid, bool isInWal);
bool updateConditional(TRI_voc_rid_t revisionId, MMFilesMarker const* oldPosition, MMFilesMarker const* newPosition, TRI_voc_fid_t newFid, bool isInWal);
void remove(TRI_voc_rid_t revisionId);
MMFilesDocumentPosition fetchAndRemove(TRI_voc_rid_t revisionId);
private:
mutable arangodb::basics::ReadWriteLock _lock;
arangodb::basics::AssocUnique<TRI_voc_rid_t, MMFilesDocumentPosition> _positions;
};
} // namespace arangodb
#endif
|
/*
** Authors: Simone Mutti <simone.mutti@unibg.it>
** Enrico Bacis <enrico.bacis@unibg.it>
**
** Copyright 2015, Università degli Studi di Bergamo
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include "sesqlite.h"
#define NELEMS(x) (sizeof(x) / sizeof(x[0]))
#define SOURCE_MASK 0xfff00000
#define TARGET_MASK 0xfff00
#define CLASS_MASK 0xe0
#define PERM_MASK 0xf1
#define SOURCE_SHIFT 20
#define TARGET_SHIFT 8
#define CLASS_SHIFT 5
#define PERM_SHIFT 0
/* Used for internal representation of security contexts*/
unsigned int compress(
unsigned short source,
unsigned short target,
unsigned char tclass,
unsigned char perm
){
return ( perm << PERM_SHIFT )
+ ( tclass << CLASS_SHIFT )
+ ( target << TARGET_SHIFT )
+ ( source << SOURCE_SHIFT );
}
void decompress(
unsigned int data,
unsigned short* source,
unsigned short* target,
unsigned char* tclass,
unsigned char* perm
){
*source = ( data & SOURCE_MASK ) >> SOURCE_SHIFT;
*target = ( data & TARGET_MASK ) >> TARGET_SHIFT;
*tclass = ( data & CLASS_MASK ) >> CLASS_SHIFT;
*perm = ( data & PERM_MASK ) >> PERM_SHIFT;
}
|
/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* File: $Id: mbtcp.c,v 1.3 2006/12/07 22:10:34 wolti Exp $
*/
/* ----------------------- System includes ----------------------------------*/
#include "stdlib.h"
#include "string.h"
/* ----------------------- Platform includes --------------------------------*/
#include "port.h"
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbconfig.h"
#include "mbtcp_m.h"
#include "mbframe.h"
#include "mbport.h"
#if MB_MASTER_TCP_ENABLED
/* ----------------------- Defines ------------------------------------------*/
/* ----------------------- MBAP Header --------------------------------------*/
/*
*
* <------------------------ MODBUS TCP/IP ADU(1) ------------------------->
* <----------- MODBUS PDU (1') ---------------->
* +-----------+---------------+------------------------------------------+
* | TID | PID | Length | UID |Code | Data |
* +-----------+---------------+------------------------------------------+
* | | | | |
* (2) (3) (4) (5) (6)
*
* (2) ... MB_TCP_TID = 0 (Transaction Identifier - 2 Byte)
* (3) ... MB_TCP_PID = 2 (Protocol Identifier - 2 Byte)
* (4) ... MB_TCP_LEN = 4 (Number of bytes - 2 Byte)
* (5) ... MB_TCP_UID = 6 (Unit Identifier - 1 Byte)
* (6) ... MB_TCP_FUNC = 7 (Modbus Function Code)
*
* (1) ... Modbus TCP/IP Application Data Unit
* (1') ... Modbus Protocol Data Unit
*/
#define MB_TCP_PROTOCOL_ID 0 /* 0 = Modbus Protocol */
/* ----------------------- Start implementation -----------------------------*/
eMBErrorCode
eMBMasterTCPDoInit( USHORT ucTCPPort )
{
eMBErrorCode eStatus = MB_ENOERR;
if( xMBMasterTCPPortInit( ucTCPPort ) == FALSE )
{
eStatus = MB_EPORTERR;
}
return eStatus;
}
void
eMBMasterTCPStart( void )
{
}
void
eMBMasterTCPStop( void )
{
/* Make sure that no more clients are connected. */
vMBMasterTCPPortDisable( );
}
eMBErrorCode
eMBMasterTCPReceive( UCHAR * pucRcvAddress, UCHAR ** ppucFrame, USHORT * pusLength )
{
eMBErrorCode eStatus = MB_EIO;
UCHAR *pucMBTCPFrame;
USHORT usLength;
USHORT usPID;
if( xMBMasterTCPPortGetRequest( &pucMBTCPFrame, &usLength ) != FALSE )
{
usPID = pucMBTCPFrame[MB_TCP_PID] << 8U;
usPID |= pucMBTCPFrame[MB_TCP_PID + 1];
if( usPID == MB_TCP_PROTOCOL_ID )
{
*ppucFrame = &pucMBTCPFrame[MB_TCP_FUNC];
*pusLength = usLength - MB_TCP_FUNC;
eStatus = MB_ENOERR;
/* Modbus TCP does not use any addresses. Fake the source address such
* that the processing part deals with this frame.
*/
*pucRcvAddress = MB_TCP_PSEUDO_ADDRESS;
}
}
else
{
eStatus = MB_EIO;
}
return eStatus;
}
eMBErrorCode
eMBMasterTCPSend( UCHAR _unused, const UCHAR * pucFrame, USHORT usLength )
{
eMBErrorCode eStatus = MB_ENOERR;
UCHAR *pucMBTCPFrame = ( UCHAR * ) pucFrame - MB_TCP_FUNC;
USHORT usTCPLength = usLength + MB_TCP_FUNC;
/* The MBAP header is already initialized because the caller calls this
* function with the buffer returned by the previous call. Therefore we
* only have to update the length in the header. Note that the length
* header includes the size of the Modbus PDU and the UID Byte. Therefore
* the length is usLength plus one.
*/
pucMBTCPFrame[MB_TCP_LEN] = ( usLength + 1 ) >> 8U;
pucMBTCPFrame[MB_TCP_LEN + 1] = ( usLength + 1 ) & 0xFF;
if( xMBMasterTCPPortSendResponse( pucMBTCPFrame, usTCPLength ) == FALSE )
{
eStatus = MB_EIO;
}
return eStatus;
}
#endif
|
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
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.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_COMMON_H_
#define TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_COMMON_H_
// This file defines functionality shared between chlo/mhlo/lhlo dialects.
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/Operation.h"
namespace mlir {
namespace hlo {
// Verifies the source target pairs attached to collective permute.
LogicalResult VerifyCollectivePermuteSourceTargetPairs(
Operation* op, DenseIntElementsAttr attr);
LogicalResult VerifyAllReduceScatter(Operation* op, TypeRange operand_types,
TypeRange result_types,
uint64_t scatter_dimension);
// Custom formatting for convolution window attributes.
void printWindowAttributes(OpAsmPrinter& p, Operation* op,
llvm::Optional<DenseIntElementsAttr> window_strides,
llvm::Optional<DenseIntElementsAttr> padding,
llvm::Optional<DenseIntElementsAttr> lhs_dilation,
llvm::Optional<DenseIntElementsAttr> rhs_dilation,
llvm::Optional<DenseElementsAttr> window_reversal);
ParseResult parseWindowAttributes(OpAsmParser& parser,
DenseIntElementsAttr& window_strides,
DenseIntElementsAttr& padding,
DenseIntElementsAttr& lhs_dilation,
DenseIntElementsAttr& rhs_dilation,
DenseElementsAttr& window_reversal);
} // namespace hlo
} // namespace mlir
#endif // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_COMMON_H_
|
/* Copyright 2012 Brian Ellis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "rectangular_prism_renderable.h"
#ifndef PANE_RENDERABLE_H
#define PANE_RENDERABLE_H
/**
* Subclass of RectangularPrismRenderable used for drawing panes, like glass panes or iron bars. Panes actually have
* fairly little resemblance to rectangular prisms, but they can be constructed out of multiple rectangular prisms in
* various orientations, so we subclass RectangularPrismRenderable mainly to get its texture coordinate mapping code.
*
* To support the myriad different possible orientations of panes, we define a grand total of five different prisms:
*
* * A full-width pane running north-south,
* * A half-width pane on the north side of the block,
* * A half-width pane on the east side of the block,
* * A half-width pane on the south side of the block,
* * A half-width pane on the west side of the block.
*
* This allows us to construct almost every necessary orientation (including all four corner orientations) by merely
* hiding or showing certain quads when we render. The sole exception is a full-width east-west pane, which is
* rendered by simply rotating the north-south pane before we render it.
*
* @todo Arguably, composition would be more appropriate than inheritance for this class.
*/
class PaneRenderable : public RectangularPrismRenderable {
public:
explicit PaneRenderable(const QVector3D& size);
virtual ~PaneRenderable();
protected:
enum QuadIndex {
kFullWidthFront,
kFullWidthBack,
kFullWidthBottom,
kFullWidthRight,
kFullWidthTop,
kFullWidthLeft,
kSouthHalfFront,
kSouthHalfBack,
kSouthHalfBottom,
kSouthHalfRight,
kSouthHalfTop,
kSouthHalfLeft,
kNorthHalfFront,
kNorthHalfBack,
kNorthHalfBottom,
kNorthHalfRight,
kNorthHalfTop,
kNorthHalfLeft,
kWestHalfFront,
kWestHalfBack,
kWestHalfBottom,
kWestHalfRight,
kWestHalfTop,
kWestHalfLeft,
kEastHalfFront,
kEastHalfBack,
kEastHalfBottom,
kEastHalfRight,
kEastHalfTop,
kEastHalfLeft
};
virtual Geometry createGeometry();
virtual TextureCoords createTextureCoords(const Geometry& geometry);
virtual Geometry moveToOrigin(const Geometry& geometry);
virtual void addGeometry(const Geometry& geometry, const TextureCoords& texture_coords);
virtual void applyOrientationTransform(const BlockOrientation* orientation) const;
virtual bool shouldRenderQuad(int index, const QVector3D& location, const BlockOrientation* orientation) const;
virtual Texture textureForQuad(int index, const BlockOrientation* orientation) const;
};
#endif // PANE_RENDERABLE_H
|
//
// File: SequenceReader.h
// Purpose: Provides an abstract interface to an image sequence reader. Its
// initial purpose was to easily deal with both image sequences and
// videos in OpenCV using a unified interface to simplify client code.
// Author: Vlad Morariu
// Created: 2009-05-13
//
// Copyright (c) 2009-2013 Vlad Morariu
//
// 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.
//
#ifndef SEQUENCE_READER_H
#define SEQUENCE_READER_H
#include "cv.h"
#include "SequenceExports.h"
class SEQUENCES_EXPORT SequenceReader
{
public:
// static factory function that creates a derived reader that can read "filename"
static SequenceReader * Create(const char * filename, int first, int last, int is_color);
// call this to destroy whatever was returned by Create()
static void Destroy(SequenceReader ** reader);
// open a sequence
virtual bool Open(const char * filename, int first, int last, int is_color)=0;
// closes the sequence
virtual void Close()=0;
// the returned image needs to be released by the caller!!
virtual IplImage * Read(int pos)=0;
// returns the actual start index
virtual int First()=0;
// returns the actual end index
virtual int Last()=0;
// return the next available frame (or -1 if unknown -- this can happen in the
// multi-file image sequence case)
virtual int Next()=0;
virtual CvSize Size()=0;
virtual ~SequenceReader(){};
};
#ifdef SEQUENCES_HEADER_ONLY
// include factory source here to make this code headers only
#include "SequenceReader.cpp"
#endif
#endif //SEQUENCE_READER_H
|
#ifndef _ESBMC_SOLVERS_SMT_SMT_ARRAY_H_
#define _ESBMC_SOLVERS_SMT_SMT_ARRAY_H_
#include "smt_conv.h"
// Interface definition for array manipulation
class array_iface
{
public:
// This constructor makes this not qualify as an abstract interface, but
// meh.
array_iface(bool _b, bool inf) : supports_bools_in_arrays(_b),
can_init_infinite_arrays(inf) { }
virtual smt_astt mk_array_symbol(const std::string &name, smt_sortt sort,
smt_sortt subtype) = 0;
/** Extract an element from the model of an array, at an explicit index.
* @param array AST representing the array we are extracting from
* @param index The index of the element we wish to expect
* @param subtype The type of the element we are extracting, i.e. array range
* @return Expression representation of the element */
virtual expr2tc get_array_elem(smt_astt a, uint64_t idx,
const type2tc &subtype) = 0;
/** Create an array with a single initializer. This may be a small, fixed
* size array, or it may be a nondeterministically sized array with a
* word-sized domain. Default implementation is to repeatedly store into
* the array for as many elements as necessary; subclassing class should
* override if it has a more efficient method.
* Nondeterministically sized memory with an initializer is very rare;
* the only real users of this are fixed sized (but large) static arrays
* that are zero initialized, or some infinite-domain modelling arrays
* used in ESBMC.
* @param init_val The value to initialize each element with.
* @param domain_width The size of the array to create, in domain bits.
* @return An AST representing the created constant array. */
virtual const smt_ast *convert_array_of(smt_astt init_val,
unsigned long domain_width) = 0;
static const smt_ast *default_convert_array_of(smt_astt init_val,
unsigned long domain_width,
smt_convt *ctx);
virtual void add_array_constraints_for_solving() = 0;
virtual void push_array_ctx(void) = 0;
virtual void pop_array_ctx(void) = 0;
// And everything else goes through the ast methods!
// Small piece of internal munging:
bool supports_bools_in_arrays;
bool can_init_infinite_arrays;
};
#endif /* _ESBMC_SOLVERS_SMT_SMT_ARRAY_H_ */
|
/*******************************************************************************
* Copyright 2017 MINRES Technologies GmbH
*
* 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.
*******************************************************************************/
#ifndef _SPARSE_ARRAY_H_
#define _SPARSE_ARRAY_H_
#include <array>
#include <cassert>
namespace util {
/**
* a simple array which allocates memory in configurable chunks (size of 2^lower_width), used for
* large sparse arrays. Memory is allocated on demand
*/
template <typename T, uint64_t SIZE, int lower_width = 24> class sparse_array {
public:
const uint64_t page_addr_mask = (1 << lower_width) - 1;
const uint64_t page_size = (1 << lower_width);
const unsigned page_count = 1 + SIZE / page_size;
const uint64_t page_addr_width = lower_width;
using page_type = std::array<T, 1 << lower_width>;
/**
* the default constructor
*/
sparse_array() { arr.fill(nullptr); }
/**
* the destructor
*/
~sparse_array() {
for(auto i : arr)
delete i;
}
/**
* element access operator
*
* @param addr address to access
* @return the data type reference
*/
T& operator[](uint32_t addr) {
assert(addr < SIZE);
T nr = addr >> lower_width;
if(arr[nr] == nullptr)
arr[nr] = new page_type();
return arr[nr]->at(addr & page_addr_mask);
}
/**
* page fetch operator
*
* @param page_nr the page number ot fetch
* @return reference to page
*/
page_type& operator()(uint32_t page_nr) {
assert(page_nr < page_count);
if(arr[page_nr] == nullptr)
arr.at(page_nr) = new page_type();
return *(arr[page_nr]);
}
/**
* check if page for address is allocated
*
* @param addr the address to check
* @return true if the page is allocated
*/
bool is_allocated(uint32_t addr) {
assert(addr < SIZE);
T nr = addr >> lower_width;
return arr.at(nr) != nullptr;
}
/**
* get the size of the array
*
* @return the size
*/
uint64_t size() { return SIZE; }
protected:
std::array<page_type*, SIZE / (1 << lower_width) + 1> arr;
};
} // namespace util
#endif /* _SPARSE_ARRAY_H_ */
|
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs */
/* */
/* 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. */
/* -------------------------------------------------------------------------- */
#ifndef VIRTUAL_MACHINE_TEMPLATE_H_
#define VIRTUAL_MACHINE_TEMPLATE_H_
#include "Template.h"
#include <string.h>
using namespace std;
/**
* Virtual Machine Template class, it represents a VM configuration file.
*/
class VirtualMachineTemplate : public Template
{
public:
VirtualMachineTemplate():
Template(false,'=',"TEMPLATE"){};
VirtualMachineTemplate(
bool _replace_mode,
const char _separator,
const char * _xml_root):
Template(_replace_mode, _separator, _xml_root){};
~VirtualMachineTemplate(){};
VirtualMachineTemplate(VirtualMachineTemplate& vmt):Template(vmt){};
/**
* Checks the template for RESTRICTED ATTRIBUTES
* @param rs_attr the first restricted attribute found if any
* @return true if a restricted attribute is found in the template
*/
bool check(string& rs_attr)
{
return Template::check(rs_attr, restricted_attributes);
};
void set_xml_root(const char * _xml_root)
{
Template::set_xml_root(_xml_root);
};
/**
* Deletes all restricted attributes
*/
void remove_restricted();
/**
* Deletes all the attributes, excepts the restricted ones
*/
void remove_all_except_restricted();
/**
* Replaces the given image from the DISK attribute with a new one
* @param target_id IMAGE_ID the image to be replaced
* @param target_name IMAGE the image to be replaced
* @param target_uname IMAGE_UNAME the image to be replaced
* @param new_name of the new image
* @param new_uname of the owner of the new image
*/
int replace_disk_image(int target_id, const string&
target_name, const string& target_uname, const string& new_name,
const string& new_uname);
private:
friend class VirtualMachinePool;
static vector<string> restricted_attributes;
/**
* Stores the attributes as restricted, these attributes will be used in
* VirtualMachineTemplate::check
* @param rattrs Attributes to restrict
*/
static void set_restricted_attributes(vector<const Attribute *>& rattrs)
{
Template::set_restricted_attributes(rattrs, restricted_attributes);
};
};
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
#endif /*VIRTUAL_MACHINE_TEMPLATE_H_*/
|
#if !defined(AFX_ROSTERNAMESSET_H__EC473CC1_5B18_11D2_839B_00400548A44F__INCLUDED_)
#define AFX_ROSTERNAMESSET_H__EC473CC1_5B18_11D2_839B_00400548A44F__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// RosterNamesSet.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CRosterNamesSet recordset
class CRosterNamesSet : public CRecordsetEx
{
public:
CRosterNamesSet(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(CRosterNamesSet)
// Field/Param Data
//{{AFX_FIELD(CRosterNamesSet, CRecordsetEx)
long m_SeriesID;
long m_EventID;
long m_Roster_PersonID;
long m_Roster_TaskID;
long m_RosterDescriptions_TaskID;
CString m_TaskDescription;
long m_Person_PersonID;
CString m_LastName;
CString m_FirstName;
CString m_MiddleName;
long m_dobDAY;
long m_dobMONTH;
long m_dobYEAR;
CString m_Sex;
CString m_Address1;
CString m_Address2;
CString m_Town;
CString m_State;
CString m_Country;
CString m_PostCode;
CString m_PhoneHm;
CString m_PhoneWk;
CString m_Fax;
CString m_Mobile;
CString m_email;
long m_ContactPersonID;
//}}AFX_FIELD
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRosterNamesSet)
public:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // Default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//}}AFX_VIRTUAL
// Implementation
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ROSTERNAMESSET_H__EC473CC1_5B18_11D2_839B_00400548A44F__INCLUDED_)
|
/*
Noel Lopes is an Assistant Professor at the Polytechnic Institute of Guarda, Portugal
Copyright (C) 2009, 2010, 2011, 2012 Noel de Jesus Mendonça Lopes
This file is part of GPUMLib.
GPUMLib 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/>.
*/
#ifndef GPUMLib_Random_h
#define GPUMLib_Random_h
#include <curand.h>
#include "../memory/DeviceArray.h"
namespace GPUMLib {
//! \addtogroup random Random Generator
//! @{
//! Class for generating random values on the device. Uses the CURAND library.
class Random {
private:
static curandGenerator_t randomGenerator;
static curandRngType_t randomGeneratorType;
static curandGenerator_t RandomGenerator();
public:
//! Destroys the existing random generator and frees the memory associated with its state.
static void CleanUp();
//! Set the seed value of the pseudorandom number generator.
//! \param seed the new seed to be used.
//! \param generatorType Generator type. For more information see the CURAND documentation. Valid values include: CURAND_RNG_PSEUDO_DEFAULT, CURAND_RNG_PSEUDO_XORWOW, CURAND_RNG_QUASI_DEFAULT, CURAND_RNG_QUASI_SOBOL32, CURAND_RNG_QUASI_SCRAMBLED_SOBOL32, CURAND_RNG_QUASI_SOBOL64, CURAND_RNG_QUASI_SCRAMBLED_SOBOL64
static void SetSeed(unsigned long long seed, curandRngType_t generatorType = CURAND_RNG_PSEUDO_DEFAULT);
//! Fills a device array with random numbers between 0 and 1.
//! \param a array to fill
static void Fill(DeviceArray<float> & a);
};
//! @}
}
#endif
|
#ifndef LIBERATION_SANS_20PT_H
#define LIBERATION_SANS_20PT_H
#include "fonts-tdf.h"
/* Font data for Liberation Sans 20pt */
extern const font_info_t liberation_sans_20pt_font_info;
#endif
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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.txt
*
* 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.
*
*=========================================================================*/
#ifndef itkStatisticsKeepNObjectsLabelMapFilter_h
#define itkStatisticsKeepNObjectsLabelMapFilter_h
#include "itkShapeKeepNObjectsLabelMapFilter.h"
#include "itkStatisticsLabelObject.h"
#include "itkStatisticsLabelObjectAccessors.h"
namespace itk
{
/** \class StatisticsKeepNObjectsLabelMapFilter
* \brief keep N objects according to their statistics attributes
*
* StatisticsKeepNObjectsLabelMapFilter keep the N objects in a label collection image
* with the highest (or lowest) attribute value. The attributes are the ones
* of the StatisticsLabelObject.
*
* \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
*
* This implementation was taken from the Insight Journal paper:
*
* https://hdl.handle.net/1926/584 or
* http://www.insight-journal.org/browse/publication/176
*
* \sa StatisticsLabelObject, BinaryStatisticsKeepNObjectsImageFilter, LabelShapeKeepNObjectsImageFilter
* \ingroup ImageEnhancement MathematicalMorphologyImageFilters
* \ingroup ITKLabelMap
*/
template< typename TImage >
class StatisticsKeepNObjectsLabelMapFilter:
public ShapeKeepNObjectsLabelMapFilter< TImage >
{
public:
/** Standard class typedefs. */
typedef StatisticsKeepNObjectsLabelMapFilter Self;
typedef ShapeKeepNObjectsLabelMapFilter< TImage > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Some convenient typedefs. */
typedef TImage ImageType;
typedef typename ImageType::Pointer ImagePointer;
typedef typename ImageType::ConstPointer ImageConstPointer;
typedef typename ImageType::PixelType PixelType;
typedef typename ImageType::IndexType IndexType;
typedef typename ImageType::LabelObjectType LabelObjectType;
typedef typename LabelObjectType::AttributeType AttributeType;
/** ImageDimension constants */
itkStaticConstMacro(ImageDimension, unsigned int,
TImage::ImageDimension);
/** Standard New method. */
itkNewMacro(Self);
/** Runtime information support. */
itkTypeMacro(StatisticsKeepNObjectsLabelMapFilter,
ShapeKeepNObjectsLabelMapFilter);
#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
/* itkConceptMacro(InputEqualityComparableCheck,
(Concept::EqualityComparable<InputImagePixelType>));
itkConceptMacro(IntConvertibleToInputCheck,
(Concept::Convertible<int, InputImagePixelType>));
itkConceptMacro(InputOStreamWritableCheck,
(Concept::OStreamWritable<InputImagePixelType>));*/
// End concept checking
#endif
protected:
StatisticsKeepNObjectsLabelMapFilter();
~StatisticsKeepNObjectsLabelMapFilter() {}
void GenerateData() ITK_OVERRIDE;
private:
ITK_DISALLOW_COPY_AND_ASSIGN(StatisticsKeepNObjectsLabelMapFilter);
}; // end of class
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkStatisticsKeepNObjectsLabelMapFilter.hxx"
#endif
#endif
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// Mono.Security.X509.X509Certificate
struct X509Certificate_t1623369439;
// System.Byte[]
struct ByteU5BU5D_t4260760469;
// System.String
struct String_t;
#include "mscorlib_System_Object4170816371.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Security.Cryptography.X509Certificates.X509Certificate
struct X509Certificate_t3076817455 : public Il2CppObject
{
public:
// Mono.Security.X509.X509Certificate System.Security.Cryptography.X509Certificates.X509Certificate::x509
X509Certificate_t1623369439 * ___x509_0;
// System.Boolean System.Security.Cryptography.X509Certificates.X509Certificate::hideDates
bool ___hideDates_1;
// System.Byte[] System.Security.Cryptography.X509Certificates.X509Certificate::cachedCertificateHash
ByteU5BU5D_t4260760469* ___cachedCertificateHash_2;
// System.String System.Security.Cryptography.X509Certificates.X509Certificate::issuer_name
String_t* ___issuer_name_3;
// System.String System.Security.Cryptography.X509Certificates.X509Certificate::subject_name
String_t* ___subject_name_4;
public:
inline static int32_t get_offset_of_x509_0() { return static_cast<int32_t>(offsetof(X509Certificate_t3076817455, ___x509_0)); }
inline X509Certificate_t1623369439 * get_x509_0() const { return ___x509_0; }
inline X509Certificate_t1623369439 ** get_address_of_x509_0() { return &___x509_0; }
inline void set_x509_0(X509Certificate_t1623369439 * value)
{
___x509_0 = value;
Il2CppCodeGenWriteBarrier(&___x509_0, value);
}
inline static int32_t get_offset_of_hideDates_1() { return static_cast<int32_t>(offsetof(X509Certificate_t3076817455, ___hideDates_1)); }
inline bool get_hideDates_1() const { return ___hideDates_1; }
inline bool* get_address_of_hideDates_1() { return &___hideDates_1; }
inline void set_hideDates_1(bool value)
{
___hideDates_1 = value;
}
inline static int32_t get_offset_of_cachedCertificateHash_2() { return static_cast<int32_t>(offsetof(X509Certificate_t3076817455, ___cachedCertificateHash_2)); }
inline ByteU5BU5D_t4260760469* get_cachedCertificateHash_2() const { return ___cachedCertificateHash_2; }
inline ByteU5BU5D_t4260760469** get_address_of_cachedCertificateHash_2() { return &___cachedCertificateHash_2; }
inline void set_cachedCertificateHash_2(ByteU5BU5D_t4260760469* value)
{
___cachedCertificateHash_2 = value;
Il2CppCodeGenWriteBarrier(&___cachedCertificateHash_2, value);
}
inline static int32_t get_offset_of_issuer_name_3() { return static_cast<int32_t>(offsetof(X509Certificate_t3076817455, ___issuer_name_3)); }
inline String_t* get_issuer_name_3() const { return ___issuer_name_3; }
inline String_t** get_address_of_issuer_name_3() { return &___issuer_name_3; }
inline void set_issuer_name_3(String_t* value)
{
___issuer_name_3 = value;
Il2CppCodeGenWriteBarrier(&___issuer_name_3, value);
}
inline static int32_t get_offset_of_subject_name_4() { return static_cast<int32_t>(offsetof(X509Certificate_t3076817455, ___subject_name_4)); }
inline String_t* get_subject_name_4() const { return ___subject_name_4; }
inline String_t** get_address_of_subject_name_4() { return &___subject_name_4; }
inline void set_subject_name_4(String_t* value)
{
___subject_name_4 = value;
Il2CppCodeGenWriteBarrier(&___subject_name_4, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/* $NetBSD: sdmmcchip.h,v 1.4 2011/05/18 01:07:17 dyoung Exp $ */
/* $OpenBSD: sdmmcchip.h,v 1.3 2007/05/31 10:09:01 uwe Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _SDMMC_CHIP_H_
#define _SDMMC_CHIP_H_
#include <sys/device.h>
#include <sys/bus.h>
struct sdmmc_command;
typedef struct sdmmc_chip_functions *sdmmc_chipset_tag_t;
typedef struct sdmmc_spi_chip_functions *sdmmc_spi_chipset_tag_t;
typedef void *sdmmc_chipset_handle_t;
struct sdmmc_chip_functions {
/* host controller reset */
int (*host_reset)(sdmmc_chipset_handle_t);
/* host capabilities */
uint32_t (*host_ocr)(sdmmc_chipset_handle_t);
int (*host_maxblklen)(sdmmc_chipset_handle_t);
/* card detection */
int (*card_detect)(sdmmc_chipset_handle_t);
/* write protect */
int (*write_protect)(sdmmc_chipset_handle_t);
/* bus power, clock frequency, width and ROD(OpenDrain/PushPull) */
int (*bus_power)(sdmmc_chipset_handle_t, uint32_t);
int (*bus_clock)(sdmmc_chipset_handle_t, int);
int (*bus_width)(sdmmc_chipset_handle_t, int);
int (*bus_rod)(sdmmc_chipset_handle_t, int);
/* command execution */
void (*exec_command)(sdmmc_chipset_handle_t,
struct sdmmc_command *);
/* card interrupt */
void (*card_enable_intr)(sdmmc_chipset_handle_t, int);
void (*card_intr_ack)(sdmmc_chipset_handle_t);
};
/* host controller reset */
#define sdmmc_chip_host_reset(tag, handle) \
((tag)->host_reset((handle)))
/* host capabilities */
#define sdmmc_chip_host_ocr(tag, handle) \
((tag)->host_ocr((handle)))
#define sdmmc_chip_host_maxblklen(tag, handle) \
((tag)->host_maxblklen((handle)))
/* card detection */
#define sdmmc_chip_card_detect(tag, handle) \
((tag)->card_detect((handle)))
/* write protect */
#define sdmmc_chip_write_protect(tag, handle) \
((tag)->write_protect((handle)))
/* bus power, clock frequency, width and rod */
#define sdmmc_chip_bus_power(tag, handle, ocr) \
((tag)->bus_power((handle), (ocr)))
#define sdmmc_chip_bus_clock(tag, handle, freq) \
((tag)->bus_clock((handle), (freq)))
#define sdmmc_chip_bus_width(tag, handle, width) \
((tag)->bus_width((handle), (width)))
#define sdmmc_chip_bus_rod(tag, handle, width) \
((tag)->bus_rod((handle), (width)))
/* command execution */
#define sdmmc_chip_exec_command(tag, handle, cmdp) \
((tag)->exec_command((handle), (cmdp)))
/* card interrupt */
#define sdmmc_chip_card_enable_intr(tag, handle, enable) \
((tag)->card_enable_intr((handle), (enable)))
#define sdmmc_chip_card_intr_ack(tag, handle) \
((tag)->card_intr_ack((handle)))
/* clock frequencies for sdmmc_chip_bus_clock() */
#define SDMMC_SDCLK_OFF 0
#define SDMMC_SDCLK_400K 400
/* SPI mode */
struct sdmmc_spi_chip_functions {
/* card initialize */
void (*initialize)(sdmmc_chipset_handle_t);
};
#define sdmmc_spi_chip_initialize(tag, handle) \
((tag)->initialize((handle)))
struct sdmmcbus_attach_args {
const char *saa_busname;
sdmmc_chipset_tag_t saa_sct;
sdmmc_spi_chipset_tag_t saa_spi_sct;
sdmmc_chipset_handle_t saa_sch;
bus_dma_tag_t saa_dmat;
u_int saa_clkmin;
u_int saa_clkmax;
uint32_t saa_caps; /* see sdmmc_softc.sc_caps */
};
void sdmmc_needs_discover(device_t);
void sdmmc_card_intr(device_t);
void sdmmc_delay(u_int);
#endif /* _SDMMC_CHIP_H_ */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2010 by NodeACS, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiProxy.h"
#ifdef USE_TI_UIIOS
#ifdef USE_TI_UIIOSADVIEW
#import "TiUIiOSAdViewProxy.h"
#endif
#endif
@interface TiUIiOSProxy : TiProxy {
@private
}
#ifdef USE_TI_UIIOSADVIEW
-(id)createAdView:(id)args;
@property(nonatomic,readonly) NSString* AD_SIZE_PORTRAIT;
@property(nonatomic,readonly) NSString* AD_SIZE_LANDSCAPE;
#endif
#ifdef USE_TI_UIIOS3DMATRIX
-(id)create3DMatrix:(id)args;
#endif
#ifdef USE_TI_UIIOSCOVERFLOWVIEW
-(id)createCoverFlowView:(id)args;
#endif
#ifdef USE_TI_UIIOSTOOLBAR
-(id)createToolbar:(id)args;
#endif
#ifdef USE_TI_UIIOSTABBEDBAR
-(id)createTabbedBar:(id)args;
#endif
@end
|
//
// WGMainViewController.h
// WeygoIPhone
//
// Created by muma on 2016/10/24.
// Copyright © 2016年 weygo.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WGMainViewController : UITabBarController
- (void)openSideBarViewController;
- (void)closeSideBarViewController;
@end
|
#pragma once
#include <string>
#include <tuple>
#include <vector>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include "pmlc/util/math/polynomial.h"
namespace pmlc::util::math {
class Matrix : public boost::numeric::ublas::matrix<Rational> {
public:
// Constructors (inherit all from ublas)
Matrix() : boost::numeric::ublas::matrix<Rational>() {}
Matrix(size_type size1, size_type size2)
: boost::numeric::ublas::matrix<Rational>(size1, size2) {}
Matrix(size_type size1, size_type size2, const value_type &init)
: boost::numeric::ublas::matrix<Rational>(size1, size2, init) {}
Matrix(size_type size1, size_type size2, const array_type &data)
: boost::numeric::ublas::matrix<Rational>(size1, size2, data) {}
// These one-param ctors are not explicit b/c boost does not make them
// explicit; so presumably implicit conversion is an intended use
Matrix(const boost::numeric::ublas::matrix<Rational>
&m) // NOLINT(runtime/explicit)
: boost::numeric::ublas::matrix<Rational>(m) {}
template <class AE>
Matrix(const boost::numeric::ublas::matrix_expression<AE>
&ae) // NOLINT(runtime/explicit)
: boost::numeric::ublas::matrix<Rational>(ae) {}
// Row ops
void swapRows(size_t r, size_t s);
void multRow(size_t r, Rational multiplier);
void addRowMultToRow(size_t dest_row, size_t src_row,
const Rational &multiplier);
void makePivotAt(size_t row, size_t col);
// Performs a rational matrix inversion, return false if singular
bool invert();
std::string toString() const; // Pretty-print to string
bool operator==(const Matrix &m);
};
// Play nice with std::to_string
inline std::string to_string(const Matrix &m) { return m.toString(); }
typedef boost::numeric::ublas::vector<Rational> Vector;
typedef boost::numeric::ublas::identity_matrix<Rational> IdentityMatrix;
using boost::numeric::ublas::prod;
using boost::numeric::ublas::trans;
// Matrix literals to make things easier
Vector VectorLit(const std::vector<Rational> &vec);
Matrix MatrixLit(const std::vector<std::vector<Rational>> &vecs);
// Equality operators
bool operator==(const Vector &a, const Vector &b);
bool operator==(const Matrix &a, const Matrix &b);
// Returns a matrix of polys.size() rows and with one column for each
// variable in polys (in lexigraphical order). Also, returns a vector of
// polys.size() containing the constants for each polynomial
std::tuple<Matrix, Vector>
FromPolynomials(const std::vector<Polynomial<Rational>> &polys);
// Convert matrix + vector of offsets to Hermite Normal Form
bool HermiteNormalForm(Matrix &m); // NOLINT(runtime/references)
} // namespace pmlc::util::math
|
extern int v3p_netlib_dlatrs_(
char *uplo,
char *trans,
char *diag,
char *normin,
v3p_netlib_integer *n,
v3p_netlib_doublereal *a,
v3p_netlib_integer *lda,
v3p_netlib_doublereal *x,
v3p_netlib_doublereal *scale,
v3p_netlib_doublereal *cnorm,
v3p_netlib_integer *info,
v3p_netlib_ftnlen uplo_len,
v3p_netlib_ftnlen trans_len,
v3p_netlib_ftnlen diag_len,
v3p_netlib_ftnlen normin_len
);
|
#include <stdio.h>
#include <stdlib.h>
#include "include/Status.h"
void heapAdjust(int h[], int s, int m)
{// 构建序列h[s, m]的堆(完全二叉树),堆顶h[1]为序列的最大值,s > 0
int rc = h[s];
for(int j = 2*s; j <= m; j *= 2)
{// 遍历一棵完全二叉树,j指向二叉树的左树
if((j < m) && (h[j] < h[j+1])) j++; //若右子树大于左子树,取右子树
if(rc > h[j]) break; //若根比子树大,不需要交换根与子树的值
h[s] = h[j]; //交换根与子树的值
s = j; //取子树根再向下遍历知道树叶
}
h[s] = rc; //原树根就位
}
void heapSort(int h[], int length)
{// 对序列h进行堆排序
int temp;
for(int i = length/2; i > 0; i--) //构建序列h为一个根大于子树的堆(完全二叉树)
heapAdjust(h, i, length); //i指向子树的根
for(int i = length; i > 1; i--)
{// 在已建成堆的情况下,提取最大值,重组堆,直到整个序列有序
temp = h[i];
h[i] = h[1];
h[1] = temp; //互换1与i的值
heapAdjust(h, 1, i-1);
}
}
Status main(void)
{
int h[] = {0, 49, 38, 65, 97, 76, 13, 27, 49, 0};
printf("==============未排序之前==================\n");
for(int i = 1; i <= 8; i++) printf("%d ", h[i]);
printf("\n==============排序之后==================\n");
heapSort(h, 8);
for(int i = 1; i <=8; i++) printf("%d ", h[i]);
printf("\n");
return OK;
}
|
#pragma once
#include <memory>
#include "envoy/common/pure.h"
namespace Envoy {
namespace Upstream {
/**
* A monitor for "passive" health check events that might happen on every thread. For example, if a
* special HTTP header is received, the data plane may decide to fast fail a host to avoid waiting
* for the full Health Check interval to elapse before determining the host is active health check
* failed.
*/
class HealthCheckHostMonitor {
public:
virtual ~HealthCheckHostMonitor() {}
/**
* Mark the host as unhealthy. Note that this may not be immediate as events may need to be
* propagated between multiple threads.
*/
virtual void setUnhealthy() PURE;
};
typedef std::unique_ptr<HealthCheckHostMonitor> HealthCheckHostMonitorPtr;
} // namespace Upstream
} // namespace Envoy
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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.txt
*
* 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.
*
*=========================================================================*/
#ifndef itkRedColormapFunction_h
#define itkRedColormapFunction_h
#include "itkColormapFunction.h"
namespace itk
{
namespace Function
{
/**
* \class RedColormapFunction
* \brief Function object which maps a scalar value into an RGB colormap value.
*
* \image html RedColormapFunction.png "Red colormap."
*
* \author Nicholas Tustison, Hui Zhang, Gaetan Lehmann, Paul Yushkevich
* and James C. Gee
*
* This code was contributed in the Insight Journal paper:
*
* "Meeting Andy Warhol Somewhere Over the Rainbow: RGB Colormapping and ITK"
* http://www.insight-journal.org/browse/publication/285
* https://hdl.handle.net/1926/1452
*
* \ingroup ITKColormap
*/
template< typename TScalar, typename TRGBPixel >
class ITK_TEMPLATE_EXPORT RedColormapFunction:
public ColormapFunction< TScalar, TRGBPixel >
{
public:
typedef RedColormapFunction Self;
typedef ColormapFunction< TScalar, TRGBPixel > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
typedef typename Superclass::RGBPixelType RGBPixelType;
typedef typename Superclass::ScalarType ScalarType;
typedef typename Superclass::RealType RealType;
virtual RGBPixelType operator()(const TScalar &) const ITK_OVERRIDE;
protected:
RedColormapFunction() {}
~RedColormapFunction() {}
private:
ITK_DISALLOW_COPY_AND_ASSIGN(RedColormapFunction);
};
} // end namespace functor
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkRedColormapFunction.hxx"
#endif
#endif
|
// COMMON SETTINGS
// ----------------------------------------------------------------------------------------------
// These settings are used in both SW UART, HW UART and SPI mode
// ----------------------------------------------------------------------------------------------
#define BUFSIZE 160 // Size of the read buffer for incoming data
#define VERBOSE_MODE true // If set to 'true' enables debug output
// SOFTWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the pins that will be used for 'SW' serial.
// You should use this option if you are connecting the UART Friend to an UNO
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_SWUART_RXD_PIN 9 // Required for software serial!
#define BLUEFRUIT_SWUART_TXD_PIN 10 // Required for software serial!
#define BLUEFRUIT_UART_CTS_PIN -1 // Required for software serial!
#define BLUEFRUIT_UART_RTS_PIN -1 // Optional, set to -1 if unused
// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
// this makes it not complain on compilation if there's no Serial1
#define BLUEFRUIT_HWSERIAL_NAME Serial1
// SHARED UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following sets the optional Mode pin, its recommended but not required
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_UART_MODE_PIN -1 // Set to -1 if unused
// SHARED SPI SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the pins to use for HW and SW SPI communication.
// SCK, MISO and MOSI should be connected to the HW SPI pins on the Uno when
// using HW SPI. This should be used with nRF51822 based Bluefruit LE modules
// that use SPI (Bluefruit LE SPI Friend).
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_SPI_CS 8
#define BLUEFRUIT_SPI_IRQ 7
#define BLUEFRUIT_SPI_RST 4 // Optional but recommended, set to -1 if unused
// SOFTWARE SPI SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the pins to use for SW SPI communication.
// This should be used with nRF51822 based Bluefruit LE modules that use SPI
// (Bluefruit LE SPI Friend).
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_SPI_SCK 13
#define BLUEFRUIT_SPI_MISO 12
#define BLUEFRUIT_SPI_MOSI 11
|
#ifndef SEARCHABLE_H
#define SEARCHABLE_H
#include <QRegExp>
#include <QStringList>
#include "Subject.h"
class Searchable : public Subject
{
public:
virtual ~Searchable() {}
void Search(const QStringList& keywords,
const Qt::CaseSensitivity& caseSensitive,
QRegExp::PatternSyntax syntax = QRegExp::RegExp);
void StopSearch();
private:
virtual void DoSearch(const QStringList& keywords,
const Qt::CaseSensitivity& caseSensitive,
QRegExp::PatternSyntax syntax = QRegExp::RegExp) = 0;
virtual void DoStopSearch();
};
#endif
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include <assert.h>
#include <exception>
#include "codegen/il2cpp-codegen.h"
#include "mscorlib_System_Predicate_1_gen3781873254MethodDeclarations.h"
// System.Void System.Predicate`1<UnityEngine.Events.BaseInvokableCall>::.ctor(System.Object,System.IntPtr)
#define Predicate_1__ctor_m1324607315(__this, ___object0, ___method1, method) (( void (*) (Predicate_1_t1170687545 *, Il2CppObject *, IntPtr_t, const MethodInfo*))Predicate_1__ctor_m982040097_gshared)(__this, ___object0, ___method1, method)
// System.Boolean System.Predicate`1<UnityEngine.Events.BaseInvokableCall>::Invoke(T)
#define Predicate_1_Invoke_m3718106813(__this, ___obj0, method) (( bool (*) (Predicate_1_t1170687545 *, BaseInvokableCall_t1559630662 *, const MethodInfo*))Predicate_1_Invoke_m4106178309_gshared)(__this, ___obj0, method)
// System.IAsyncResult System.Predicate`1<UnityEngine.Events.BaseInvokableCall>::BeginInvoke(T,System.AsyncCallback,System.Object)
#define Predicate_1_BeginInvoke_m2931120076(__this, ___obj0, ___callback1, ___object2, method) (( Il2CppObject * (*) (Predicate_1_t1170687545 *, BaseInvokableCall_t1559630662 *, AsyncCallback_t1369114871 *, Il2CppObject *, const MethodInfo*))Predicate_1_BeginInvoke_m2038073176_gshared)(__this, ___obj0, ___callback1, ___object2, method)
// System.Boolean System.Predicate`1<UnityEngine.Events.BaseInvokableCall>::EndInvoke(System.IAsyncResult)
#define Predicate_1_EndInvoke_m3795713335(__this, ___result0, method) (( bool (*) (Predicate_1_t1170687545 *, Il2CppObject *, const MethodInfo*))Predicate_1_EndInvoke_m3970497007_gshared)(__this, ___result0, method)
|
#pragma once
#include <libclient/net_cl_exports.h>
#include <libdariadb/meas.h>
#include <libdariadb/query.h>
#include <libdariadb/stat.h>
#include <libdariadb/timeutil.h>
#include <libdariadb/utils/async/locker.h>
#include <common/net_common.h>
#include <functional>
#include <memory>
#include <string>
namespace dariadb {
namespace net {
namespace client {
struct ReadResult {
using callback =
std::function<void(const ReadResult *parent, const Meas &m, const Statistic &st)>;
QueryNumber id;
DATA_KINDS kind;
utils::async::Locker locker;
callback clbk;
bool is_ok; // true - if server send OK to this query.
bool is_closed; // true - if all data received.
bool is_error; // true - if error. 'errc' contain error type.
ERRORS errc;
ReadResult() {
is_error = false;
is_ok = false;
id = std::numeric_limits<QueryNumber>::max();
is_closed = false;
}
void wait() { locker.lock(); }
};
using ReadResult_ptr = std::shared_ptr<ReadResult>;
class Client {
public:
struct Param {
std::string host;
unsigned short port;
unsigned short http_port;
Param(const std::string &_host, unsigned short _port, unsigned short _http_port) {
host = _host;
port = _port;
http_port = _http_port;
}
};
CL_EXPORT Client(const Param &p);
CL_EXPORT ~Client();
CL_EXPORT void connect();
CL_EXPORT void disconnect();
CL_EXPORT CLIENT_STATE state() const;
CL_EXPORT size_t pings_answers() const;
/// connection id on server
CL_EXPORT int id() const;
CL_EXPORT void append(const MeasArray &ma);
CL_EXPORT MeasArray readInterval(const QueryInterval &qi);
CL_EXPORT ReadResult_ptr readInterval(const QueryInterval &qi,
ReadResult::callback &clbk);
CL_EXPORT Id2Meas readTimePoint(const QueryTimePoint &qi);
CL_EXPORT ReadResult_ptr readTimePoint(const QueryTimePoint &qi,
ReadResult::callback &clbk);
CL_EXPORT ReadResult_ptr currentValue(const IdArray &ids, const Flag &flag,
ReadResult::callback &clbk);
CL_EXPORT Id2Meas currentValue(const IdArray &ids, const Flag &flag);
CL_EXPORT ReadResult_ptr subscribe(const IdArray &ids, const Flag &flag,
ReadResult::callback &clbk);
CL_EXPORT std::map<std::string, dariadb::Id> loadScheme();
CL_EXPORT bool addToScheme(const std::string &value);
protected:
class Private;
std::unique_ptr<Private> _Impl;
};
typedef std::shared_ptr<dariadb::net::client::Client> Client_Ptr;
}
}
}
|
#include <stdio.h>
int main(void){
int ni, nf, dez, cen, uni;
printf("Digite o número: ");
scanf("%d", &ni);
cen = ni / 100;
dez = (ni / 10) % 10;
uni = ni % 10;
nf = uni * 100 + dez * 10 + cen;
printf("O número invertido é %d\n", nf);
return 0;
}
|
//
// Copyright 2014, 2015 Razer Inc.
//
// 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.
//
#pragma once
#include "OSVRInterface.h"
#include <functional>
class OSVRInterfaceCollection
{
public:
OSVRInterfaceCollection(OSVR_ClientContext osvrClientContext);
OSVRInterface* GetInterface(const FName& Name)
{
return GetInterfaceImpl(Name, false);
}
OSVRInterface* GetOrCreateInterface(const FName& Name)
{
return GetInterfaceImpl(Name, true);
}
struct RegistrationToken
{
static const int32 INVALID_TOKEN = -1;
RegistrationToken()
: Token(INVALID_TOKEN)
{
}
explicit RegistrationToken(int32 InToken)
: Token(InToken)
{
}
int32 Token;
};
RegistrationToken RegisterOnStateChangedCallback(OSVRInterface::StateChangedCallback Function);
void DeregisterOnStateChangedCallback(RegistrationToken Token);
private:
void AddDefaultInterfaces();
void ClearAllInterfaces();
OSVRInterface* GetInterfaceImpl(const FName& Name, bool CreateIfNotExist);
void PropagateCallbacks(OSVRInterface* Interface, uint32 Caps);
TArray< OSVRInterface::StateChangedCallback > Callbacks;
TArray< TSharedPtr< OSVRInterface > > Interfaces;
OSVR_ClientContext osvrClientContext;
};
|
//
// MessageViewController.h
// 新浪微博
//
// Created by 郑雨鑫 on 15/11/10.
// Copyright © 2015年 郑雨鑫. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MessageViewController : UITableViewController
@end
|
//
// smbBuffer.h
// test
//
// Created by trekvn on 4/13/17.
// Copyright © 2017 trekvn. All rights reserved.
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
/*!Hold a pointer and the size of its data
*/
typedef struct
{
void *data; /// Data pointed
size_t size; /// Size in byte of the pointed
} smb_buffer;
@interface smbBuffer : NSObject
#pragma mark - smbBufferInit
/*!Initialize a buffer structure. It'll contain nothing
*\param buf Pointer to a buffer to initialize
*/
void smb_buffer_init(smb_buffer *buf, void *data, size_t size);
#pragma mark - smbBufferAlloc
/*!Allocate a size long memory area and place it in the buffer structure
*/
int smb_buffer_alloc(smb_buffer *buf, size_t size);
#pragma mark - smbBufferFree
/*!Free the data of this buffer if necessary
*\param buf Pointer to a buffer to free
*/
void smb_buffer_free(smb_buffer *buf);
@end
#endif
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by CascadeXmas, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#ifdef USE_TI_NETWORKSOCKET
#import <Foundation/Foundation.h>
#import "TiStreamProxy.h"
#import "AsyncSocket.h"
#import "TiNetworkSocketProxy.h"
// Used to determine the type of processing
typedef enum {
TO_BUFFER = 1,
TO_STREAM,
TO_CALLBACK,
} ReadDestination;
@interface TiNetworkSocketTCPProxy : TiStreamProxy<AsyncSocketDelegate, TiStreamInternal> {
AsyncSocket* socket;
SocketState internalState;
NSCondition* listening;
NSThread* socketThread;
// We have to have an explicit "host" property because of some 'fun' undocumented KVO
// behavior - it turns out that KVO 'getters' also look for '-(type)_key' signature
// selectors. TiProxy has a '_host' function.
NSString* host;
// We offer synchronous I/O. The underlying socket implementation is asynchronous.
// So we need to ensure our own synchronicity by signaling a condition when operations
// complete.
NSCondition* ioCondition;
NSUInteger readDataLength;
NSError* socketError;
// In order to put the accepted socket on the right run loop, and make sure it's constructed
// properly, we need THESE as well...
NSMutableDictionary* acceptArgs;
NSRunLoop* acceptRunLoop;
BOOL accepting;
// And, last but not least, in order to make sure that socket run loops are configured AND ACTIVE before performing any work on them,
// we need to be able to signal that they're
NSCondition* readyCondition;
BOOL socketReady;
// Information used to hash callbacks and asynch ops to tags.
int asynchTagCount;
NSMutableDictionary* operationInfo;
KrollCallback* connected;
KrollCallback* accepted;
KrollCallback* closed;
KrollCallback* error;
}
// Properties:
// -- Stored on TiProxy dynprops --
// int port
// ----
@property (nonatomic, readwrite, retain) NSString* host;
@property (nonatomic, readonly) NSNumber* state; // Req's local processing
@property (nonatomic, readwrite, retain) KrollCallback* connected;
@property (nonatomic, readwrite, retain) KrollCallback* accepted;
@property (nonatomic, readwrite, retain) KrollCallback* closed;
@property (nonatomic, readwrite, retain) KrollCallback* error;
// Public API
-(void)connect:(id)_void;
-(void)listen:(id)arg; // arg[0]: int maxAcceptQueueSize : queue size
-(void)accept:(id)arg; // arg[0]: Object params : callbacks for created socket
-(void)close:(id)_void;
@end
#endif
|
//
// FacadeAppDelegate.h
// Facade
//
// Created by Carlo Chung on 11/15/10.
// Copyright 2010 Carlo Chung. All rights reserved.
//
#import <UIKit/UIKit.h>
@class FacadeViewController;
@interface FacadeAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
FacadeViewController *viewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet FacadeViewController *viewController;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/redshift/Redshift_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/redshift/model/ResponseMetadata.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/redshift/model/SnapshotErrorMessage.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Xml
{
class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace Redshift
{
namespace Model
{
class AWS_REDSHIFT_API BatchModifyClusterSnapshotsResult
{
public:
BatchModifyClusterSnapshotsResult();
BatchModifyClusterSnapshotsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
BatchModifyClusterSnapshotsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline const Aws::Vector<Aws::String>& GetResources() const{ return m_resources; }
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline void SetResources(const Aws::Vector<Aws::String>& value) { m_resources = value; }
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline void SetResources(Aws::Vector<Aws::String>&& value) { m_resources = std::move(value); }
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline BatchModifyClusterSnapshotsResult& WithResources(const Aws::Vector<Aws::String>& value) { SetResources(value); return *this;}
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline BatchModifyClusterSnapshotsResult& WithResources(Aws::Vector<Aws::String>&& value) { SetResources(std::move(value)); return *this;}
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline BatchModifyClusterSnapshotsResult& AddResources(const Aws::String& value) { m_resources.push_back(value); return *this; }
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline BatchModifyClusterSnapshotsResult& AddResources(Aws::String&& value) { m_resources.push_back(std::move(value)); return *this; }
/**
* <p>A list of the snapshots that were modified.</p>
*/
inline BatchModifyClusterSnapshotsResult& AddResources(const char* value) { m_resources.push_back(value); return *this; }
/**
* <p>A list of any errors returned.</p>
*/
inline const Aws::Vector<SnapshotErrorMessage>& GetErrors() const{ return m_errors; }
/**
* <p>A list of any errors returned.</p>
*/
inline void SetErrors(const Aws::Vector<SnapshotErrorMessage>& value) { m_errors = value; }
/**
* <p>A list of any errors returned.</p>
*/
inline void SetErrors(Aws::Vector<SnapshotErrorMessage>&& value) { m_errors = std::move(value); }
/**
* <p>A list of any errors returned.</p>
*/
inline BatchModifyClusterSnapshotsResult& WithErrors(const Aws::Vector<SnapshotErrorMessage>& value) { SetErrors(value); return *this;}
/**
* <p>A list of any errors returned.</p>
*/
inline BatchModifyClusterSnapshotsResult& WithErrors(Aws::Vector<SnapshotErrorMessage>&& value) { SetErrors(std::move(value)); return *this;}
/**
* <p>A list of any errors returned.</p>
*/
inline BatchModifyClusterSnapshotsResult& AddErrors(const SnapshotErrorMessage& value) { m_errors.push_back(value); return *this; }
/**
* <p>A list of any errors returned.</p>
*/
inline BatchModifyClusterSnapshotsResult& AddErrors(SnapshotErrorMessage&& value) { m_errors.push_back(std::move(value)); return *this; }
inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }
inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; }
inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = std::move(value); }
inline BatchModifyClusterSnapshotsResult& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}
inline BatchModifyClusterSnapshotsResult& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;}
private:
Aws::Vector<Aws::String> m_resources;
Aws::Vector<SnapshotErrorMessage> m_errors;
ResponseMetadata m_responseMetadata;
};
} // namespace Model
} // namespace Redshift
} // namespace Aws
|
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
//
// 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.
#ifndef _NET_SUITE_STDINOUT_H
#define _NET_SUITE_STDINOUT_H
/**
* @brief Gets one packet from stdin
*
* @param packet ptr to the packet buffer
* @param max_len maximum size of allocated data buffer
*
* @return actual size of received packet (-1 in case of error)
*/
ssize_t netsuite_io_get_packet(char *packet, size_t max_len);
/**
* @brief Initializes the I/O object handle to be attached to esp-netif instance
*
* @return I/O object pointer
*/
void * netsuite_io_new(void);
#endif //_NET_SUITE_STDINOUT_H
|
//
// HMAppDelegate.h
// 网易新闻
//
// Created by apple on 14-7-25.
// Copyright (c) 2014年 heima. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HMAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* Copyright (c) 2005-2006 Institute for System Programming
* Russian Academy of Sciences
* All rights reserved.
*
* 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.
*/
#ifndef TA_FS_META_STATVFS_AGENT_H
#define TA_FS_META_STATVFS_AGENT_H
#include "common/agent.h"
/********************************************************************/
/** Agent Initialization **/
/********************************************************************/
void register_fs_meta_statvfs_commands(void);
#endif
|
//
// SAMMidViewController.h
#import <UIKit/UIKit.h>
@interface SAMMidViewController : UIViewController
@end
|
//
// WPCopyPath.h
// WinPaths
//
// Created by Timothy on 5/27/14.
// Copyright (c) 2014 Timothy Woodford.
//
// 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.
//
#import <Foundation/Foundation.h>
@interface WPCopyPath : NSObject
+ (void) copyPath: (NSURL *)inurl;
@end
|
// Copyright 2019 Google LLC
//
// 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.
#ifndef SRC_DCMTKUTILS_H_
#define SRC_DCMTKUTILS_H_
#include <absl/strings/string_view.h>
#include <dcmtk/dcmdata/dcdatset.h>
#include <dcmtk/dcmdata/dcofsetl.h>
#include <dcmtk/dcmdata/dcpixel.h>
#include <dcmtk/dcmdata/libi2d/i2dimgs.h>
#include <dcmtk/ofstd/ofcond.h>
#include <memory>
#include <string>
#include <vector>
#include "src/dcmTags.h"
#include "src/dcmtkImgDataInfo.h"
#include "src/enums.h"
#include "src/frame.h"
namespace wsiToDicomConverter {
class DcmtkUtils {
public:
// Generates DICOM file based on outputFileName
// imageHeight, imageWidth - size of complete image
// rowSize - how many frames in one row of this image
// studyId, seriesId, imageName - required DICOM metadata
// pixelData - pixel data, requre transfer of ownership
// imgInfo - image metadata
// numberOfFrames - how many frames in this file
// row, column - position to start
// level - which level represent this file
// batchNumber - index number of this file for one level
// offset - how many frames where already generated
// for this level
// totalNumberOfFrames - how many frames in this level
// tiled - frame organizationtype
// true:TILED_FULL
// false:TILED_SPARSE
// additionalTags - additional DICOM metadata
// firstLevelWidthMm, firstLevelHeightMm - physical size
// of first level
static OFCondition startConversion(
int64_t imageHeight, int64_t imageWidth, uint32_t rowSize,
absl::string_view studyId, absl::string_view seriesId,
absl::string_view imageName, std::unique_ptr<DcmPixelData> pixelData,
const DcmtkImgDataInfo& imgInfo, uint32_t numberOfFrames, uint32_t row,
uint32_t column, int level, int batchNumber, unsigned int offset,
uint32_t totalNumberOfFrames, bool tiled, DcmTags* additionalTags,
double firstLevelWidthMm, double firstLevelHeightMm,
DcmOutputStream* outStream);
// Wrapper for startConversion without additional parameters.
static OFCondition startConversion(
int64_t imageHeight, int64_t imageWidth, uint32_t rowSize,
absl::string_view studyId, absl::string_view seriesId,
absl::string_view imageName, std::unique_ptr<DcmPixelData> pixelData,
const DcmtkImgDataInfo& imgInfo, uint32_t numberOfFrames, uint32_t row,
uint32_t column, int level, int batchNumber, uint32_t offset,
uint32_t totalNumberOfFrames, bool tiled, DcmOutputStream* outStream);
// Generates DICOM file object.
static OFCondition populateDataSet(
const int64_t imageHeight, const int64_t imageWidth,
const uint32_t rowSize, absl::string_view studyId,
absl::string_view seriesId, absl::string_view imageName,
std::unique_ptr<DcmPixelData> pixelData, const DcmtkImgDataInfo& imgInfo,
const uint32_t numberOfFrames, const uint32_t row, const uint32_t column,
const int level, const int batchNumber, const uint32_t offset,
const uint32_t totalNumberOfFrames, const bool tiled,
DcmTags* additionalTags, const double firstLevelWidthMm,
const double firstLevelHeightMm, DcmDataset* dataSet);
// Inserts current date/time into DCM_ContentDate/Time.
static OFCondition generateDateTags(DcmDataset* dataSet);
// Inserts which is same for pathology DICOMs.
static OFCondition insertStaticTags(DcmDataset* dataSet, int level);
// Inserts studyId and seriesId by params and generated instanceId.
static OFCondition insertIds(absl::string_view studyId,
absl::string_view seriesId,
DcmDataset* dataSet);
// Inserts tags related to base image.
static OFCondition insertBaseImageTags(absl::string_view imageName,
const int64_t imageHeight,
const int64_t imageWidth,
const double firstLevelWidthMm,
const double firstLevelHeightMm,
DcmDataset* dataSet);
// Inserts tags which is required for multi frame DICOM.
static OFCondition insertMultiFrameTags(
const DcmtkImgDataInfo& imgInfo, const uint32_t numberOfFrames,
const uint32_t rowSize, const uint32_t row, const uint32_t column,
const int level, const int batchNumber, const uint32_t offset,
const uint32_t totalNumberOfFrames, const bool tiled,
absl::string_view seriesId, DcmDataset* dataSet);
};
} // namespace wsiToDicomConverter
#endif // SRC_DCMTKUTILS_H_
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/guardduty/GuardDuty_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/guardduty/model/Member.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace GuardDuty
{
namespace Model
{
class AWS_GUARDDUTY_API ListMembersResult
{
public:
ListMembersResult();
ListMembersResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListMembersResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
inline const Aws::Vector<Member>& GetMembers() const{ return m_members; }
inline void SetMembers(const Aws::Vector<Member>& value) { m_members = value; }
inline void SetMembers(Aws::Vector<Member>&& value) { m_members = std::move(value); }
inline ListMembersResult& WithMembers(const Aws::Vector<Member>& value) { SetMembers(value); return *this;}
inline ListMembersResult& WithMembers(Aws::Vector<Member>&& value) { SetMembers(std::move(value)); return *this;}
inline ListMembersResult& AddMembers(const Member& value) { m_members.push_back(value); return *this; }
inline ListMembersResult& AddMembers(Member&& value) { m_members.push_back(std::move(value)); return *this; }
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
inline ListMembersResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
inline ListMembersResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
inline ListMembersResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<Member> m_members;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace GuardDuty
} // namespace Aws
|
////////////////////////////////////////////////////////////////////////////
// Copyright 2017 Game Engine
//
// 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.
////////////////////////////////////////////////////////////////////////////
#if !defined(EA_833EF06C_7DC2_41a8_B324_816CB2507704__INCLUDED_)
#define EA_833EF06C_7DC2_41a8_B324_816CB2507704__INCLUDED_
#include "GameEngine.h"
namespace GameEngine
{
namespace Core
{
class Game;
class Viewport;
/**
* Abstract factory for the game engine.
*/
class AbstractObjectFactory
{
public:
/**
* Default constructor.
*/
AbstractObjectFactory() {};
/**
* Destructor.
*/
virtual ~AbstractObjectFactory() {};
/**
* Creates a viewport with the given settings.
* @return The viewport.
*/
virtual Viewport& createViewport(Game& game, DisplayMode displayMode = DisplayMode::WINDOWED, bool canSwitchSize = true, float minimumScale = 0.2f, float maximumScale = 0.8f) = 0;
/**
* Creates a viewport for the given Window.
* @return The viewport.
*/
virtual Viewport& createViewport(Game& game, HWND hWnd) = 0;
};
}
}
#endif // !defined(EA_833EF06C_7DC2_41a8_B324_816CB2507704__INCLUDED_)
|
/**
Atomix project, ORILIB_Interleaver48.c, TODO: insert summary here
Copyright (c) 2015 Stanford University
Released under the Apache License v2.0. See the LICENSE file for details.
Author(s): Manu Bansal
*/
#include <osl/inc/swpform.h>
#include <src/DSP_ifft16x16/c66/DSP_ifft16x16.h>
#include "ORILIB_t.h"
/** Table defines the interleaver bit mapping from input bits to output bits
* for a BPSK-encoded OFDM symbol */
static const uint16_t InterleaverLutWifi_BpskLUT[48] = { 0, 3, 6, 9, 12, 15, 18, 21,
24, 27, 30, 33, 36, 39, 42, 45,
1, 4, 7, 10, 13, 16, 19, 22,
25, 28, 31, 34, 37, 40, 43, 46,
2, 5, 8, 11, 14, 17, 20, 23,
26, 29, 32, 35, 38, 41, 44, 47 };
void ORILIB_Interleaver48(
IN ORILIB_t_ByteBuf48 * inpSampleBuf,
OUT ORILIB_t_ByteBuf48 * outSampleBuf
) {
uint16_t const * const lut_pointer = InterleaverLutWifi_BpskLUT;
const uint32_t num_bits = 48;
uint32_t i=0;
uint64_t temp_bits_in, output_indices_0123, output_indices_4567;
uint64_t output_indices_x0x2, output_indices_x4x6, output_indices_x1x3, output_indices_x5x7;
/* Declare a variable such that we can look at a single unpacked bit of the input */
uint8_t const * const temp_bits_in_ptr8 = (uint8_t*)&temp_bits_in;
BitsUnpacked const * const coded_bits_in = inpSampleBuf->bytes;
BitsUnpacked * const restrict interleaved_bits_out = outSampleBuf->bytes;
#pragma MUST_ITERATE(48/8,288/8,48/8)
for (i=0; i < num_bits; i+=8)
{
/* Read 8 bytes out of the input bits array - 0, 1, 2, 3, 4, 5, 6, 7, 8 */
temp_bits_in = _amem8((void*)(coded_bits_in + i));
/* Read 4 half words of indices - 0,1,2,3 */
output_indices_0123 = _amem8((void*)(lut_pointer + i));
/* Read another 4 half words of indices - 4,5,6,7 */
output_indices_4567 = _amem8((void*)(lut_pointer + i + 4));
/* Use SIMD instructions to move each of the indices to the
* upper and lower words of a long long. Now we just have to grab
* the upper and lower halves for each run through the algorithm. */
output_indices_x0x2 = _dshru(output_indices_0123,16); // shift HI and LO right by 16 bits
output_indices_x1x3 = output_indices_0123 & ((long long)(0x0000FFFF0000FFFF));
output_indices_x4x6 = _dshru(output_indices_4567,16);
output_indices_x5x7 = output_indices_4567 & ((long long)(0x0000FFFF0000FFFF));
/* Write one unpacked bit (one BYTE) at a time to the output array.
* Because bytes are spread all over the symbol now,
* this is basically the simplest, but still fairly efficient way to interleave.
* Last benchmark - 436 cycles for 64QAM */
interleaved_bits_out[ _hill(output_indices_x0x2) ] = temp_bits_in_ptr8[0]; //hword 0
interleaved_bits_out[ _hill(output_indices_x1x3) ] = temp_bits_in_ptr8[1]; //hword 1
interleaved_bits_out[ _loll(output_indices_x0x2) ] = temp_bits_in_ptr8[2]; //hword 2
interleaved_bits_out[ _loll(output_indices_x1x3) ] = temp_bits_in_ptr8[3]; //hword 3
interleaved_bits_out[ _hill(output_indices_x4x6) ] = temp_bits_in_ptr8[4]; //hword 4
interleaved_bits_out[ _hill(output_indices_x5x7) ] = temp_bits_in_ptr8[5]; //hword 5
interleaved_bits_out[ _loll(output_indices_x4x6) ] = temp_bits_in_ptr8[6]; //hword 6
interleaved_bits_out[ _loll(output_indices_x5x7) ] = temp_bits_in_ptr8[7]; //hword 7
}
}
|
/*
Copyright 2016 Vanderbilt University
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.
*/
/** \file
* Autogenerated public API
*/
#ifndef ACCRE_GOP_PORTAL_H_INCLUDED
#define ACCRE_GOP_PORTAL_H_INCLUDED
#include <apr_hash.h>
#include <apr_thread_cond.h>
#include <apr_thread_mutex.h>
#include <apr_thread_proc.h>
#include <assert.h>
#include <gop/gop.h>
#include <gop/visibility.h>
#include <gop/types.h>
#include <stdlib.h>
#include <string.h>
#include <tbx/apr_wrapper.h>
#include <tbx/assert_result.h>
#include <tbx/atomic_counter.h>
#include <tbx/log.h>
#include <tbx/network.h>
#include <tbx/pigeon_coop.h>
#include <tbx/stack.h>
#include <tbx/type_malloc.h>
#ifdef __cplusplus
extern "C" {
#endif
//Separator between the host and the port
#define HP_HOSTPORT_SEPARATOR "|"
// Typedefs
typedef void *(*gop_portal_dup_fn_t)(void *connect_context); //** Duplicates a ccon
typedef void (*gop_portal_destroy_fn_t)(void *connect_context);
typedef int (*gop_portal_connect_fn_t)(tbx_ns_t *ns, void *connect_context, char *host, int port, tbx_ns_timeout_t timeout);
typedef void (*gop_portal_close_fn_t)(tbx_ns_t *ns);
typedef void (*gop_portal_sort_fn_t)(void *arg, gop_opque_t *q); //** optional
typedef void (*gop_portal_submit_fn_t)(void *arg, gop_op_generic_t *op);
typedef void *(*gop_portal_exec_fn_t)(void *arg, gop_op_generic_t *op); //** optional
struct gop_portal_fn_t {
gop_portal_dup_fn_t dup_connect_context;
gop_portal_destroy_fn_t destroy_connect_context;
gop_portal_connect_fn_t connect;
gop_portal_close_fn_t close_connection;
gop_portal_sort_fn_t sort_tasks;
gop_portal_submit_fn_t submit;
gop_portal_exec_fn_t sync_exec;
};
struct gop_portal_context_t;
typedef struct gop_host_portal_t gop_host_portal_t;
// Functions
GOP_API int gop_hp_que_op_submit(gop_portal_context_t *hpc, gop_op_generic_t *op);
GOP_API gop_portal_context_t *gop_hp_context_create(gop_portal_fn_t *hpi, char *name);
GOP_API void gop_hp_context_destroy(gop_portal_context_t *hpc);
GOP_API void gop_hpc_load(gop_portal_context_t *hpc, tbx_inip_file_t *fd, char *section);
GOP_API gop_portal_fn_t *gop_hp_fn_get(gop_portal_context_t *hpc);
GOP_API void gop_hp_fn_set(gop_portal_context_t *hpc, gop_portal_fn_t *fn);
GOP_API int gop_hp_que_op_submit(gop_portal_context_t *hpc, gop_op_generic_t *op);
GOP_API void gop_hp_shutdown(gop_portal_context_t *hpc);
GOP_API int gop_hp_submit(gop_host_portal_t *dp, gop_op_generic_t *op, bool addtotop, bool release_master);
GOP_API void gop_hpc_print_running_config(gop_portal_context_t *hpc, FILE *fd, int print_section_heading);
// tunable accessors
GOP_API void gop_hpc_dead_dt_set(gop_portal_context_t *hpc, apr_time_t dt);
GOP_API apr_time_t gop_hpct_dead_dt_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_dead_check_set(gop_portal_context_t *hpc, apr_time_t dt);
GOP_API apr_time_t gop_hpc_dead_check_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_max_idle_set(gop_portal_context_t *hpc, apr_time_t dt);
GOP_API apr_time_t gop_hpc_max_idle_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_wait_stable_set(gop_portal_context_t *hpc, apr_time_t dt);
GOP_API apr_time_t gop_hpc_wait_stable_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_max_total_conn_set(gop_portal_context_t *hpc, int n);
GOP_API int gop_hpc_max_total_conn_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_min_host_conn_set(gop_portal_context_t *hpc, int n);
GOP_API int gop_hpc_min_host_conn_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_max_host_conn_set(gop_portal_context_t *hpc, int n);
GOP_API int gop_hpc_max_host_conn_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_max_workload_set(gop_portal_context_t *hpc, int64_t n);
GOP_API int64_t gop_hpc_max_workload_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_min_bw_fraction_set(gop_portal_context_t *hpc, double d);
GOP_API double gop_hpc_min_bw_fraction_get(gop_portal_context_t *hpc);
GOP_API void gop_hpc_mex_latest_fraction_set(gop_portal_context_t *hpc, double d);
GOP_API double gop_hpc_mix_latest_fraction_get(gop_portal_context_t *hpc);
#ifdef __cplusplus
}
#endif
#endif /* ^ ACCRE_GOP_PORTAL_H_INCLUDED ^ */
|
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#define IDF_PERFORMANCE_MIN_AES_CBC_THROUGHPUT_MBSEC 43
// SHA256 hardware throughput at 240MHz, threshold set lower than worst case
#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 90
// esp_sha() time to process 32KB of input data from RAM
#define IDF_PERFORMANCE_MAX_TIME_SHA1_32KB 1000
#define IDF_PERFORMANCE_MAX_TIME_SHA512_32KB 900
#define IDF_PERFORMANCE_MAX_RSA_2048KEY_PUBLIC_OP 18000
#define IDF_PERFORMANCE_MAX_RSA_2048KEY_PRIVATE_OP 210000
#define IDF_PERFORMANCE_MAX_RSA_3072KEY_PUBLIC_OP 45000
#define IDF_PERFORMANCE_MAX_RSA_3072KEY_PRIVATE_OP 670000
#define IDF_PERFORMANCE_MAX_RSA_4096KEY_PUBLIC_OP 80000
#define IDF_PERFORMANCE_MAX_RSA_4096KEY_PRIVATE_OP 1500000
#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING 15
#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING_NO_DMA 15
#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING 32
#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING_NO_DMA 30
// floating point instructions per divide and per sqrt (configured for worst-case with PSRAM workaround)
#define IDF_PERFORMANCE_MAX_CYCLES_PER_DIV 70
#define IDF_PERFORMANCE_MAX_CYCLES_PER_SQRT 140
|
/*
* Copyright (c) 2018 <Carlos Chacón>
* All rights reserved
*
* 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.
*/
#pragma once
#ifndef _DEBUG_STATS_H
#define _DEBUG_STATS_H
/**********************
* System Includes *
***********************/
/*************************
* 3rd Party Includes *
**************************/
/***************************
* Game Engine Includes *
****************************/
#include "AEGameComponentsDefs.h"
#include "Vertex\Types\VertexPositionColor.h"
/************
* Using *
*************/
/********************
* Forward Decls *
*********************/
class GameApp;
struct TimerParams;
class SpriteFontAE;
class CameraUpdater;
class SpriteBatchAE;
class BasicColorMaterial;
template<class T>
class VertexBuffer;
/**************
* Structs *
***************/
struct DebugStatsConfig
{
std::string m_SpriteFontFile = "";
Color m_TextColor = AEColors::White;
bool m_FPSEnabled = true;
bool m_AxisEnabled = true;
float m_AxisLength = 1.0f;
bool m_GridEnabled = true;
Color m_GridColor = AEColors::Black;
float m_GridSize = 10.0f;
float m_GridUnits = 1.0f;
DebugStatsConfig()
{
}
};
/*****************
* Class Decl *
******************/
class DebugStats : public DrawableGameComponent
{
protected:
//Variables
DebugStatsConfig m_DebugStatsConfig; // No need to initialize
SpriteBatchAE* m_SpriteBatchAE = nullptr;
SpriteFontAE* m_SpriteFontAE = nullptr;
VertexBuffer<VertexPositionColor>* m_GridVertexBuffer = nullptr;
VertexBuffer<VertexPositionColor>* m_AxisVertexBuffer = nullptr;
BasicColorMaterial* m_BasicColorMaterial = nullptr;
CameraUpdater* m_CameraUpdater = nullptr;
glm::mat4 m_WVP = AEMathHelpers::Mat4Identity;
void InitializeAxisAndGrid();
public:
//Constructor Destructor.
DebugStats(GameApp& gameApp, const DebugStatsConfig& debugStatsConfig, const std::string& gameComponentName = AE_DEBUG_STATS_DEF_COMPONENT_NAME, const std::string& cameraServiceName = AE_CAMERA_UPDATER_DEF_SERVICE_NAME, uint32_t callOrder = AEGameComponentCallOrder::_AE_GCCO_DebugStats);
virtual ~DebugStats();
//Gets
//Framework Methods
inline bool GetGridEnabled() const
{
return m_DebugStatsConfig.m_GridEnabled;
}
inline void SetGridEnabled(bool enable)
{
m_DebugStatsConfig.m_GridEnabled = enable;
}
inline bool GetAxisEnabled()
{
return m_DebugStatsConfig.m_AxisEnabled;
}
inline void SetAxisEnabled(bool enable)
{
m_DebugStatsConfig.m_AxisEnabled = enable;
}
inline bool GetFPSEnabled()
{
return m_DebugStatsConfig.m_FPSEnabled;
}
inline void SetFPSEnabled(bool enable)
{
m_DebugStatsConfig.m_FPSEnabled = enable;
}
//Drawable Game Component Override methods
void Initialize() override;
void LoadContent() override;
void Update(const TimerParams& timerParams) override;
void Render(const TimerParams& timerParams) override;
void OnLostDevice() override;
void OnResetDevice() override;
};
#endif
|
//
// AudioStreamer.h
// StreamingAudioPlayer
//
// Created by Matt Gallagher on 27/09/08.
// Copyright 2008 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
// this copyright and permission notice. Attribution in compiled projects is
// appreciated but not required.
//
// This file is meant to be a repository for common defintions between AudioStreamerBC (backcompat, 3.1.x)
// and AudioStreamerCUR (iOS 3.2+), as well as a proxy which shunts messages to the appropriate AudioStreamer.
// - SPT
// Also note that we've had to change enumeration and class names here - this is because
// some modules may require the use of AudioStreamer in external libraries and the
// symbols cannot be changed on that end. The use of common symbols in mattan without
// namespaces is a recurring problem, and we can thank Objective-C for it.
// - SPT
#ifdef USE_TI_MEDIA
#define LOG_QUEUED_BUFFERS 0
#define kNumAQBufs 16 // Number of audio queue buffers we allocate.
// Needs to be big enough to keep audio pipeline
// busy (non-zero number of queued buffers) but
// not so big that audio takes too long to begin
// (kNumAQBufs * kAQBufSize of data must be
// loaded before playback will start).
// Set LOG_QUEUED_BUFFERS to 1 to log how many
// buffers are queued at any time -- if it drops
// to zero too often, this value may need to
// increase. Min 3, typical 8-24.
#define kAQMaxPacketDescs 512 // Number of packet descriptions in our array
typedef enum
{
AS_INITIALIZED = 0,
AS_STARTING_FILE_THREAD,
AS_WAITING_FOR_DATA,
AS_WAITING_FOR_QUEUE_TO_START,
AS_PLAYING,
AS_BUFFERING,
AS_STOPPING,
AS_STOPPED,
AS_PAUSED,
AS_FLUSHING_EOF
} TI_AudioStreamerState;
typedef enum
{
AS_NO_STOP = 0,
AS_STOPPING_EOF,
AS_STOPPING_USER_ACTION,
AS_STOPPING_ERROR,
AS_STOPPING_TEMPORARILY
} TI_AudioStreamerStopReason;
typedef enum
{
AS_NO_ERROR = 0,
AS_NETWORK_CONNECTION_FAILED,
AS_FILE_STREAM_GET_PROPERTY_FAILED,
AS_FILE_STREAM_SEEK_FAILED,
AS_FILE_STREAM_PARSE_BYTES_FAILED,
AS_FILE_STREAM_OPEN_FAILED,
AS_FILE_STREAM_CLOSE_FAILED,
AS_AUDIO_DATA_NOT_FOUND,
AS_AUDIO_QUEUE_CREATION_FAILED,
AS_AUDIO_QUEUE_BUFFER_ALLOCATION_FAILED,
AS_AUDIO_QUEUE_ENQUEUE_FAILED,
AS_AUDIO_QUEUE_ADD_LISTENER_FAILED,
AS_AUDIO_QUEUE_REMOVE_LISTENER_FAILED,
AS_AUDIO_QUEUE_START_FAILED,
AS_AUDIO_QUEUE_PAUSE_FAILED,
AS_AUDIO_QUEUE_BUFFER_MISMATCH,
AS_AUDIO_QUEUE_DISPOSE_FAILED,
AS_AUDIO_QUEUE_STOP_FAILED,
AS_AUDIO_QUEUE_FLUSH_FAILED,
AS_AUDIO_STREAMER_FAILED,
AS_GET_AUDIO_TIME_FAILED,
AS_AUDIO_BUFFER_TOO_SMALL
} TI_AudioStreamerErrorCode;
extern NSString * const ASStatusChangedNotification;
@protocol AudioStreamerDelegate<NSObject>
-(void)playbackStateChanged:(id)sender;
@end
@protocol AudioStreamerProtocol<NSObject>
@property TI_AudioStreamerErrorCode errorCode;
@property (readonly) TI_AudioStreamerState state;
@property (readonly) double progress;
@property (readwrite) UInt32 bitRate;
@property (readwrite,assign) id<AudioStreamerDelegate> delegate;
- (void)start;
- (void)stop;
- (void)pause;
- (BOOL)isPlaying;
- (BOOL)isPaused;
- (BOOL)isWaiting;
- (BOOL)isIdle;
@end
@interface TI_AudioStreamer : NSObject<AudioStreamerProtocol,AudioStreamerDelegate>
{
id<AudioStreamerProtocol> streamer;
id<AudioStreamerDelegate> delegate;
}
- (id)initWithURL:(NSURL *)aURL;
+ (NSString*)stringForErrorCode:(TI_AudioStreamerErrorCode)code;
@end
@compatibility_alias AudioStreamer TI_AudioStreamer;
#endif
|
//
// MGRepoCommitsViewModel.h
// MVVMGitHub
//
// Created by XingJie on 2017/6/16.
// Copyright © 2017年 xingjie. All rights reserved.
//
#import "MGViewModel.h"
extern NSString *const kRepoForKnowCommits;
extern NSString *const kSHAForKnowCommits;
@interface MGRepoCommitsViewModel : MGViewModel<MGTableViewModelProtocol>
@property (nonatomic, strong, readonly) OCTRepository *repo;
@property (nonatomic, strong, readonly) NSString *SHA;
@property (nonatomic, strong, readonly) RACCommand *fetchCommitCommand;
@end
|
void MVM_mast_to_cu(MVMThreadContext *tc, MVMObject *mast, MVMObject *types, MVMRegister *res);
void MVM_mast_to_file(MVMThreadContext *tc, MVMObject *mast, MVMObject *types, MVMString *filename);
|
/*
* Copyright 2014 Nutiteq Llc. All rights reserved.
* Copying and using this code is allowed only according
* to license terms, as given in https://www.nutiteq.com/license/
*/
#ifndef _NUTI_MAPNIKVT_TILESYMBOLIZERFACTORY_H_
#define _NUTI_MAPNIKVT_TILESYMBOLIZERFACTORY_H_
#include "MapParser.h"
namespace Nuti { namespace MapnikVT {
class TileSymbolizerFactory : public Mapnik::MapParser::SymbolizerFactory {
public:
TileSymbolizerFactory(const std::shared_ptr<Mapnik::Logger>& logger) : _logger(logger) { }
virtual std::shared_ptr<Mapnik::Symbolizer> createSymbolizer(const pugi::xml_node& node, const std::shared_ptr<Mapnik::Map>& map) const override;
protected:
const std::shared_ptr<Mapnik::Logger> _logger;
};
} }
#endif
|
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_ARRAY_H_INCLUDED_
#define _NGX_ARRAY_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef struct {
void *elts; //元素集合
ngx_uint_t nelts; //当前元素个数
size_t size; //元素大小
ngx_uint_t nalloc; //数组大小
ngx_pool_t *pool; //内存池
} ngx_array_t;
ngx_array_t *ngx_array_create(ngx_pool_t *p, ngx_uint_t n, size_t size);
void ngx_array_destroy(ngx_array_t *a);
void *ngx_array_push(ngx_array_t *a);
void *ngx_array_push_n(ngx_array_t *a, ngx_uint_t n);
static ngx_inline ngx_int_t
ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
{
/*
* set "array->nelts" before "array->elts", otherwise MSVC thinks
* that "array->nelts" may be used without having been initialized
*/
array->nelts = 0;
array->size = size;
array->nalloc = n;
array->pool = pool;
array->elts = ngx_palloc(pool, n * size);
if (array->elts == NULL) {
return NGX_ERROR;
}
return NGX_OK;
}
#endif /* _NGX_ARRAY_H_INCLUDED_ */
|
//
// MWBackgroundLayer.h
// TweaksDemo
//
// Created by Tudor Munteanu on 11/07/14.
// Copyright 2014 moWOW Studios. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
@interface MWBackgroundLayer : CCLayer
+ (MWBackgroundLayer *)background;
@end
|
//=================================================================================================
/*!
// \file blaze/Math.h
// \brief Header file for the inclusion of the math module of the Blaze library
//
// Copyright (C) 2012-2017 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZE_MATH_MODULE_H_
#define _BLAZE_MATH_MODULE_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blaze/math/Accuracy.h>
#include <blaze/math/Aliases.h>
#include <blaze/math/AlignmentFlag.h>
#include <blaze/math/BLAS.h>
#include <blaze/math/CompressedMatrix.h>
#include <blaze/math/CompressedVector.h>
#include <blaze/math/Constraints.h>
#include <blaze/math/CustomMatrix.h>
#include <blaze/math/CustomVector.h>
#include <blaze/math/DiagonalMatrix.h>
#include <blaze/math/DynamicMatrix.h>
#include <blaze/math/DynamicVector.h>
#include <blaze/math/Epsilon.h>
#include <blaze/math/Functions.h>
#include <blaze/math/Functors.h>
#include <blaze/math/IdentityMatrix.h>
#include <blaze/math/Infinity.h>
#include <blaze/math/InversionFlag.h>
#include <blaze/math/HermitianMatrix.h>
#include <blaze/math/HybridMatrix.h>
#include <blaze/math/HybridVector.h>
#include <blaze/math/LAPACK.h>
#include <blaze/math/LowerMatrix.h>
#include <blaze/math/PaddingFlag.h>
#include <blaze/math/RelaxationFlag.h>
#include <blaze/math/Serialization.h>
#include <blaze/math/Shims.h>
#include <blaze/math/SMP.h>
#include <blaze/math/StaticMatrix.h>
#include <blaze/math/StaticVector.h>
#include <blaze/math/StorageOrder.h>
#include <blaze/math/StrictlyLowerMatrix.h>
#include <blaze/math/StrictlyUpperMatrix.h>
#include <blaze/math/SymmetricMatrix.h>
#include <blaze/math/Traits.h>
#include <blaze/math/TransposeFlag.h>
#include <blaze/math/TypeTraits.h>
#include <blaze/math/UniLowerMatrix.h>
#include <blaze/math/UniUpperMatrix.h>
#include <blaze/math/UpperMatrix.h>
#include <blaze/math/Views.h>
#endif
|
#include "pthread.h"
#include "util/memory.h"
struct thread_info
{
void *(*entry)(void *);
void *param;
};
static DWORD WINAPI entry_point(void *parameter)
{
struct thread_info *ti = (struct thread_info *) parameter;
ti->entry(ti->param);
free(ti);
return 0;
}
int pthread_attr_init(pthread_attr_t *attr)
{
/* No need for this */
return 0;
}
int pthread_attr_setdetachstate(pthread_attr_t *attr, int state)
{
/* No need for this */
return 0;
}
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*entry)(void *), void *param)
{
struct thread_info *ti = malloc(sizeof(struct thread_info));
ti->entry = entry;
ti->param = param;
*thread = CreateThread(NULL, 0, entry_point, ti, 0, NULL);
if (!*thread)
{
free(ti);
return -1;
}
return 0;
}
int pthread_join(pthread_t thread, void **value)
{
if (WaitForSingleObject(thread, INFINITE) == WAIT_FAILED)
return -1;
CloseHandle(thread);
return 0;
}
void pthread_exit(int i)
{
ExitThread(i);
}
int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
{
InitializeCriticalSection(mutex);
return 0;
}
int pthread_mutex_destroy(pthread_mutex_t *mutex)
{
DeleteCriticalSection(mutex);
return 0;
}
int pthread_mutex_lock(pthread_mutex_t *mutex)
{
EnterCriticalSection(mutex);
return 0;
}
int pthread_mutex_trylock(pthread_mutex_t *mutex)
{
return !TryEnterCriticalSection(mutex);
}
int pthread_mutex_unlock(pthread_mutex_t *mutex)
{
LeaveCriticalSection(mutex);
return 0;
}
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
{
*cond = CreateEvent(NULL, false, false, NULL);
if (*cond == NULL)
return -1;
return 0;
}
int pthread_cond_destroy(pthread_cond_t *cond)
{
return !CloseHandle(*cond);
}
int pthread_cond_signal(pthread_cond_t *cond)
{
return !PulseEvent(*cond);
}
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
LeaveCriticalSection(mutex);
WaitForSingleObject(*cond, INFINITE);
EnterCriticalSection(mutex);
return 0;
}
|
/*
[BSD-style license for Stamina and Charisma]
* Copyright (c) 1997-2009, Sylvain Demongeot
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY Sylvain Demongeot ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Sylvain Demongeot BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
status_t create_directory_(const char *path, mode_t mode);
|
#ifndef __MONO_NATIVE_MSCORLIB_SYSTEM_REFLECTION_TARGETEXCEPTION_H
#define __MONO_NATIVE_MSCORLIB_SYSTEM_REFLECTION_TARGETEXCEPTION_H
#include <mscorlib/System/mscorlib_System_ApplicationException.h>
#include <mscorlib/System/mscorlib_System_String.h>
#include <mscorlib/System/mscorlib_System_Exception.h>
#include <mscorlib/System/Runtime/InteropServices/mscorlib_System_Runtime_InteropServices__Exception.h>
#include <mscorlib/System/Runtime/Serialization/mscorlib_System_Runtime_Serialization_ISerializable.h>
#include <mscorlib/System/Collections/mscorlib_System_Collections_IDictionary.h>
#include <mscorlib/System/mscorlib_System_Object.h>
namespace mscorlib
{
namespace System
{
namespace Reflection
{
class MethodBase;
}
}
}
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace Serialization
{
class SerializationInfo;
class StreamingContext;
}
}
}
}
namespace mscorlib
{
namespace System
{
class Type;
}
}
namespace mscorlib
{
namespace System
{
namespace Reflection
{
class TargetException
: public mscorlib::System::ApplicationException
, public virtual mscorlib::System::Runtime::InteropServices::_Exception
, public virtual mscorlib::System::Runtime::Serialization::ISerializable
{
public:
TargetException()
: mscorlib::System::ApplicationException(mscorlib::NativeTypeInfo::GetTypeInfo("mscorlib","System.Reflection.TargetException"))
, mscorlib::System::Runtime::InteropServices::_Exception(NULL)
, mscorlib::System::Runtime::Serialization::ISerializable(NULL)
{
__native_object__ = Global::New("mscorlib", "System.Reflection", "TargetException");
};
TargetException(mscorlib::System::String message)
: mscorlib::System::ApplicationException(mscorlib::NativeTypeInfo::GetTypeInfo("mscorlib","System.Reflection.TargetException"))
, mscorlib::System::Runtime::InteropServices::_Exception(NULL)
, mscorlib::System::Runtime::Serialization::ISerializable(NULL)
{
MonoType *__parameter_types__[1];
void *__parameters__[1];
__parameter_types__[0] = Global::GetType("mscorlib", "System", "String");
__parameters__[0] = (MonoObject*)message;
__native_object__ = Global::New("mscorlib", "System.Reflection", "TargetException", 1, __parameter_types__, __parameters__);
};
TargetException(mscorlib::System::String message, mscorlib::System::Exception inner)
: mscorlib::System::ApplicationException(mscorlib::NativeTypeInfo::GetTypeInfo("mscorlib","System.Reflection.TargetException"))
, mscorlib::System::Runtime::InteropServices::_Exception(NULL)
, mscorlib::System::Runtime::Serialization::ISerializable(NULL)
{
MonoType *__parameter_types__[2];
void *__parameters__[2];
__parameter_types__[0] = Global::GetType("mscorlib", "System", "String");
__parameter_types__[1] = Global::GetType("mscorlib", "System", "Exception");
__parameters__[0] = (MonoObject*)message;
__parameters__[1] = (MonoObject*)inner;
__native_object__ = Global::New("mscorlib", "System.Reflection", "TargetException", 2, __parameter_types__, __parameters__);
};
TargetException(mscorlib::NativeTypeInfo *nativeTypeInfo)
: mscorlib::System::ApplicationException(nativeTypeInfo)
, mscorlib::System::Runtime::InteropServices::_Exception(NULL)
, mscorlib::System::Runtime::Serialization::ISerializable(NULL)
{
};
TargetException(MonoObject *nativeObject)
: mscorlib::System::ApplicationException(nativeObject)
, mscorlib::System::Runtime::InteropServices::_Exception(nativeObject)
, mscorlib::System::Runtime::Serialization::ISerializable(nativeObject)
{
};
~TargetException()
{
};
TargetException & operator=(TargetException &value) { __native_object__ = value.GetNativeObject(); return value; };
bool operator==(TargetException &value) { return mscorlib::System::Object::Equals(value); };
operator MonoObject*() { return __native_object__; };
MonoObject* operator=(MonoObject* value) { return __native_object__ = value; };
virtual MonoObject* GetNativeObject() override { return __native_object__; };
//Public Properties
__declspec(property(get=get_InnerException)) mscorlib::System::Exception InnerException;
__declspec(property(get=get_HelpLink, put=set_HelpLink)) mscorlib::System::String HelpLink;
__declspec(property(get=get_HResult, put=set_HResult)) mscorlib::System::Int32 HResult;
__declspec(property(get=get_Message)) mscorlib::System::String Message;
__declspec(property(get=get_Source, put=set_Source)) mscorlib::System::String Source;
__declspec(property(get=get_StackTrace)) mscorlib::System::String StackTrace;
__declspec(property(get=get_TargetSite)) mscorlib::System::Reflection::MethodBase TargetSite;
__declspec(property(get=get_Data)) mscorlib::System::Collections::IDictionary Data;
//Get Set Properties Methods
// Get:InnerException
mscorlib::System::Exception get_InnerException() const;
// Get/Set:HelpLink
mscorlib::System::String get_HelpLink() const;
void set_HelpLink(mscorlib::System::String value);
// Get/Set:HResult
mscorlib::System::Int32 get_HResult() const;
void set_HResult(mscorlib::System::Int32 value);
// Get:Message
mscorlib::System::String get_Message() const;
// Get/Set:Source
mscorlib::System::String get_Source() const;
void set_Source(mscorlib::System::String value);
// Get:StackTrace
mscorlib::System::String get_StackTrace() const;
// Get:TargetSite
mscorlib::System::Reflection::MethodBase get_TargetSite() const;
// Get:Data
mscorlib::System::Collections::IDictionary get_Data() const;
protected:
private:
};
}
}
}
#endif
|
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef StorageThread_h
#define StorageThread_h
#include <wtf/Function.h>
#include <wtf/HashSet.h>
#include <wtf/MessageQueue.h>
#include <wtf/Threading.h>
namespace WebCore {
class StorageAreaSync;
class StorageTask;
class StorageThread {
WTF_MAKE_NONCOPYABLE(StorageThread); WTF_MAKE_FAST_ALLOCATED;
public:
StorageThread();
~StorageThread();
bool start();
void terminate();
void dispatch(Function<void ()>&&);
static void releaseFastMallocFreeMemoryInAllThreads();
private:
// Called on background thread.
static void threadEntryPointCallback(void*);
void threadEntryPoint();
// Background thread part of the terminate procedure.
void performTerminate();
ThreadIdentifier m_threadID;
MessageQueue<Function<void ()>> m_queue;
};
} // namespace WebCore
#endif // StorageThread_h
|
#include "stdlibrary.h"
extern "C" {
CONCEPT_DLL_API ON_CREATE_CONTEXT MANAGEMENT_PARAMETERS;
CONCEPT_FUNCTION(MSWRead)
CONCEPT_FUNCTION(MSWMeta)
}
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
/**
* A level viewport toolbar widget that is placed in a viewport
*/
class UNREALED_API SViewportToolBar : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS( SViewportToolBar ){}
SLATE_END_ARGS()
void Construct( const FArguments& InArgs );
/**
* @return The currently open pull down menu if there is one
*/
TWeakPtr<SMenuAnchor> GetOpenMenu() const;
/**
* Sets the open menu to a new menu and closes any currently opened one
*
* @param NewMenu The new menu that is opened
*/
void SetOpenMenu( TSharedPtr< SMenuAnchor >& NewMenu );
/**
* @return The color and opacity of this viewport.
*/
FLinearColor OnGetColorAndOpacity() const;
private:
/**
* Called when the mouse enters the toolbar area. We fade in the toolbar when this happens
*
* @param MyGeometry Information about the size of the toolbar
* @param MouseEvent The mouse event that triggered this function
*/
virtual void OnMouseEnter( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
/**
* Called when the mouse leaves the toolbar area. We fade out the toolbar when this happens
*
* @param MouseEvent The mouse event that triggered this function
*/
virtual void OnMouseLeave( const FPointerEvent& MouseEvent ) override;
private:
/** Curve sequence for fading out the toolbar */
FCurveSequence FadeOutSequence;
/** Curve sequence for fading in the toolbar */
FCurveSequence FadeInSequence;
/** The pulldown menu that is open if any */
TWeakPtr< SMenuAnchor > OpenedMenu;
/** True if the mouse is inside the toolbar */
bool bIsHovered;
};
|
#ifndef _MAINFRAME_H_
#define _MAINFRAME_H_
/* ----------------------------------------------------------------------------
* Copyright (C) 2009-2011 by egnite GmbH
* Copyright (C) 2005-2006 by egnite Software GmbH
*
* 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 2 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* ----------------------------------------------------------------------------
*/
/*
* $Id: mainframe.h 4115 2012-04-12 21:06:13Z olereinhardt $
*/
#include <wx/listctrl.h>
#include <wx/timer.h>
#include "taskbaricon.h"
#include "discovery.h"
class CUdpThread;
enum
{
ID_SCAN = 1,
ID_AUTOSCAN,
ID_OPTIONS,
ID_CONFIG,
ID_HIDE,
ID_RESTORE,
ID_ABOUT,
ID_LIST
};
/*!
* \brief Application main window frame.
*/
class CMainFrame : public wxFrame
{
public:
CMainFrame(const wxString& title);
virtual ~CMainFrame();
void AddNode(DISCOVERY_TELE *info);
void OnActivated(wxListEvent& event);
void OnUdpEvent(wxCommandEvent& event);
protected:
void EditNodeConfig(DISCOVERY_TELE *dist);
void OnScan(wxCommandEvent& event);
void OnAutoScan(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnOptions(wxCommandEvent& event);
void OnNodeConfig(wxCommandEvent& event);
void OnHide(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnScanTimer(wxTimerEvent& event);
void OnNodeConfigUpdUI(wxUpdateUIEvent& event);
private:
wxListCtrl *m_nutList;
CUdpThread *m_thread;
wxTimer m_timer;
protected:
CTaskBarIcon *m_taskBarIcon;
#if defined(__WXCOCOA__)
CTaskBarIcon *m_dockIcon;
#endif
DECLARE_EVENT_TABLE()
};
#endif
|
/**
* @file
* @brief Tests array utilities.
*
* @date 14.03.11
* @author Nikolay Korotky
*/
#include <embox/test.h>
#include <stdint.h>
#include <util/array.h>
EMBOX_TEST_SUITE("util/array test");
/* Spread array unaligned head regression. */
/* Pointer size struct. */
struct unaligned {
void *foo;
};
/* Define a spread array of one pointer size element.
* Notice the array name. */
ARRAY_SPREAD_DEF(static const struct unaligned, spread_0_unaligned);
ARRAY_SPREAD_ADD(spread_0_unaligned, {0});
/* Struct of eight pointers. */
struct aligned {
void *bar[8];
};
/* Define an array of bigger elements assuming that compiler will decide to
* align them on bigger boundary.
* Because of the name this array will be placed in .rodata just after the
* previous one making a room between its last element and the head of this
* array. */
ARRAY_SPREAD_DEF(static const struct aligned, spread_1_aligned);
ARRAY_SPREAD_ADD_NAMED(spread_1_aligned, spread_aligned_element, {{0}});
TEST_CASE("Pointers to a spread array and to the first array element should "
"be equal") {
volatile uintptr_t head = (uintptr_t) spread_1_aligned;
volatile uintptr_t element = (uintptr_t) spread_aligned_element;
test_assert_equal(head, element);
}
|
/**
@file fragmentShader.h
@author Andrew Krause - contact@alienbug.net
@date 07.12.12
Wrapper for GLSL fragment shader
*/
#ifndef VISAGE_FRAGMENT_SHADER_H
#define VISAGE_FRAGMENT_SHADER_H
#include <glee.h>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include "resourceManager.h"
namespace Visage {
class FragmentShader : public Resource {
public:
FragmentShader();
virtual ~FragmentShader();
virtual void load(std::string const& filename);
virtual void release();
GLuint glHandle; // handle to OpenGL shader object
};
} // namespace
#endif
|
#pragma once
#include "Iop_Module.h"
#include "../ISO9660/ISO9660.h"
#include "zip/ZipArchiveWriter.h"
#include "zip/ZipArchiveReader.h"
class CIopBios;
namespace Iop
{
class CCdvdman : public CModule
{
public:
enum CDVD_STATUS
{
CDVD_STATUS_STOPPED = 0,
CDVD_STATUS_SPINNING = 2,
CDVD_STATUS_READING = 6,
CDVD_STATUS_PAUSED = 10,
CDVD_STATUS_SEEK = 18,
};
CCdvdman(CIopBios&, uint8*);
virtual ~CCdvdman();
virtual std::string GetId() const override;
virtual std::string GetFunctionName(unsigned int) const override;
virtual void Invoke(CMIPS&, unsigned int) override;
void SetIsoImage(CISO9660*);
void LoadState(Framework::CZipArchiveReader&);
void SaveState(Framework::CZipArchiveWriter&);
uint32 CdReadClockDirect(uint8*);
private:
uint32 CdInit(uint32);
uint32 CdRead(uint32, uint32, uint32, uint32);
uint32 CdSeek(uint32);
uint32 CdGetError();
uint32 CdSearchFile(uint32, uint32);
uint32 CdSync(uint32);
uint32 CdGetDiskType();
uint32 CdDiskReady(uint32);
uint32 CdTrayReq(uint32, uint32);
uint32 CdReadClock(uint32);
uint32 CdStatus();
uint32 CdCallback(uint32);
uint32 CdSetMmode(uint32);
uint32 CdReadDvdDualInfo(uint32, uint32);
uint32 CdLayerSearchFile(uint32, uint32, uint32);
CIopBios& m_bios;
CISO9660* m_image = nullptr;
uint8* m_ram = nullptr;
uint32 m_callbackPtr = 0;
uint32 m_status = CDVD_STATUS_STOPPED;
};
typedef std::shared_ptr<CCdvdman> CdvdmanPtr;
};
|
#ifndef ERRC_H_
#define ERRC_H_
enum {
SUCCESS = 0,
ERROR = 1,
POOL_MALLOC_ERROR= 100,
};
#endif /* ERRC_H_ */
|
/*
* Copyright (c) 2010-2011 Juli Mallett. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef IO_PIPE_PIPE_PAIR_SIMPLE_H
#define IO_PIPE_PIPE_PAIR_SIMPLE_H
#include <io/pipe/pipe_simple.h>
#include <io/pipe/pipe_simple_wrapper.h>
class PipePairSimple : public PipePair {
PipeSimpleWrapper<PipePairSimple> *incoming_pipe_;
PipeSimpleWrapper<PipePairSimple> *outgoing_pipe_;
protected:
PipePairSimple(void)
: incoming_pipe_(NULL),
outgoing_pipe_(NULL)
{ }
public:
virtual ~PipePairSimple()
{
if (incoming_pipe_ != NULL) {
delete incoming_pipe_;
incoming_pipe_ = NULL;
}
if (outgoing_pipe_ != NULL) {
delete outgoing_pipe_;
outgoing_pipe_ = NULL;
}
}
protected:
virtual bool incoming_process(Buffer *, Buffer *) = 0;
virtual bool outgoing_process(Buffer *, Buffer *) = 0;
public:
Pipe *get_incoming(void)
{
ASSERT(log_, incoming_pipe_ == NULL);
incoming_pipe_ = new PipeSimpleWrapper<PipePairSimple>(this, &PipePairSimple::incoming_process);
return (incoming_pipe_);
}
Pipe *get_outgoing(void)
{
ASSERT(log_, outgoing_pipe_ == NULL);
outgoing_pipe_ = new PipeSimpleWrapper<PipePairSimple>(this, &PipePairSimple::outgoing_process);
return (outgoing_pipe_);
}
};
#endif /* !IO_PIPE_PIPE_PAIR_SIMPLE_H */
|
/* JAMS
* (c) 2014 Justin Gottula
* The source code of this project is distributed under the terms of the
* simplified BSD license. See the LICENSE file for details.
*/
#ifndef JAMS_IO_STDFILE_H
#define JAMS_IO_STDFILE_H
#include "std.h"
void stdfile_open(void);
void stdfile_close(void);
#endif
|
/*
* This file is part of GPaste.
*
* Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
*/
#if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
#error "Only <gpaste.h> can be included directly."
#endif
#ifndef __G_PASTE_CLIPBOARD_H__
#define __G_PASTE_CLIPBOARD_H__
#include <gpaste-history.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define G_PASTE_TYPE_CLIPBOARD (g_paste_clipboard_get_type ())
G_PASTE_FINAL_TYPE (Clipboard, clipboard, CLIPBOARD, GObject)
typedef void (*GPasteClipboardTextCallback) (GPasteClipboard *self,
const gchar *text,
gpointer user_data);
typedef void (*GPasteClipboardImageCallback) (GPasteClipboard *self,
GdkPixbuf *image,
gpointer user_data);
void g_paste_clipboard_bootstrap (GPasteClipboard *self,
GPasteHistory *history);
gboolean g_paste_clipboard_is_clipboard (const GPasteClipboard *self);
GtkClipboard *g_paste_clipboard_get_real (const GPasteClipboard *self);
const gchar *g_paste_clipboard_get_text (const GPasteClipboard *self);
void g_paste_clipboard_set_text (GPasteClipboard *self,
GPasteClipboardTextCallback callback,
gpointer user_data);
void g_paste_clipboard_select_text (GPasteClipboard *self,
const gchar *text);
void g_paste_clipboard_sync_text (const GPasteClipboard *self,
GPasteClipboard *other);
void g_paste_clipboard_clear (GPasteClipboard *self);
void g_paste_clipboard_store (GPasteClipboard *self);
const gchar *g_paste_clipboard_get_image_checksum (const GPasteClipboard *self);
void g_paste_clipboard_set_image (GPasteClipboard *self,
GPasteClipboardImageCallback callback,
gpointer user_data);
gboolean g_paste_clipboard_select_item (GPasteClipboard *self,
GPasteItem *item);
void g_paste_clipboard_ensure_not_empty (GPasteClipboard *self,
GPasteHistory *history);
GPasteClipboard *g_paste_clipboard_new_clipboard (GPasteSettings *settings);
GPasteClipboard *g_paste_clipboard_new_primary (GPasteSettings *settings);
G_END_DECLS
#endif /*__G_PASTE_CLIPBOARD_H__*/
|
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef BENCHMARK_DEMO_H
#define BENCHMARK_DEMO_H
#include "DemoApplication.h"
#include "LinearMath/btAlignedObjectArray.h"
#define NUMRAYS 200
class btBroadphaseInterface;
class btCollisionShape;
class btOverlappingPairCache;
class btCollisionDispatcher;
class btConstraintSolver;
struct btCollisionAlgorithmCreateFunc;
class btDefaultCollisionConfiguration;
///BenchmarkDemo is provides several performance tests
class BenchmarkDemo : public DemoApplication
{
//keep the collision shapes, for deletion/cleanup
btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
btAlignedObjectArray<class RagDoll*> m_ragdolls;
btBroadphaseInterface* m_overlappingPairCache;
btCollisionDispatcher* m_dispatcher;
btConstraintSolver* m_solver;
btDefaultCollisionConfiguration* m_collisionConfiguration;
int m_benchmark;
void createTest1();
void createTest2();
void createTest3();
void createTest4();
void createTest5();
void createTest6();
void createTest7();
void createWall(const btVector3& offsetPosition,int stackSize,const btVector3& boxSize);
void createPyramid(const btVector3& offsetPosition,int stackSize,const btVector3& boxSize);
void createTowerCircle(const btVector3& offsetPosition,int stackSize,int rotSize,const btVector3& boxSize);
void createLargeMeshBody();
class SpuBatchRaycaster* m_batchRaycaster;
class btThreadSupportInterface* m_batchRaycasterThreadSupport;
void castRays();
void initRays();
public:
BenchmarkDemo(int benchmark)
:m_benchmark(benchmark)
{
}
virtual ~BenchmarkDemo()
{
exitPhysics();
}
void initPhysics();
void exitPhysics();
virtual void clientMoveAndDisplay();
virtual void displayCallback();
};
class BenchmarkDemo1 : public BenchmarkDemo
{
public:
BenchmarkDemo1()
:BenchmarkDemo(1)
{
}
static DemoApplication* Create()
{
BenchmarkDemo1* demo = new BenchmarkDemo1;
demo->myinit();
demo->initPhysics();
return demo;
}
};
class BenchmarkDemo2 : public BenchmarkDemo
{
public:
BenchmarkDemo2()
:BenchmarkDemo(2)
{
}
static DemoApplication* Create()
{
BenchmarkDemo2* demo = new BenchmarkDemo2;
demo->myinit();
demo->initPhysics();
return demo;
}
};
class BenchmarkDemo3 : public BenchmarkDemo
{
public:
BenchmarkDemo3()
:BenchmarkDemo(3)
{
}
static DemoApplication* Create()
{
BenchmarkDemo3* demo = new BenchmarkDemo3;
demo->myinit();
demo->initPhysics();
return demo;
}
};
class BenchmarkDemo4 : public BenchmarkDemo
{
public:
BenchmarkDemo4()
:BenchmarkDemo(4)
{
}
static DemoApplication* Create()
{
BenchmarkDemo4* demo = new BenchmarkDemo4;
demo->myinit();
demo->initPhysics();
return demo;
}
};
class BenchmarkDemo5 : public BenchmarkDemo
{
public:
BenchmarkDemo5()
:BenchmarkDemo(5)
{
}
static DemoApplication* Create()
{
BenchmarkDemo5* demo = new BenchmarkDemo5;
demo->myinit();
demo->initPhysics();
return demo;
}
};
class BenchmarkDemo6 : public BenchmarkDemo
{
public:
BenchmarkDemo6()
:BenchmarkDemo(6)
{
}
static DemoApplication* Create()
{
BenchmarkDemo6* demo = new BenchmarkDemo6;
demo->myinit();
demo->initPhysics();
return demo;
}
};
class BenchmarkDemo7 : public BenchmarkDemo
{
public:
BenchmarkDemo7()
:BenchmarkDemo(7)
{
}
static DemoApplication* Create()
{
BenchmarkDemo7* demo = new BenchmarkDemo7;
demo->myinit();
demo->initPhysics();
return demo;
}
};
#endif //BENCHMARK_DEMO_H
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MovieSceneObjectManager.h"
#include "SequencerPossessedObject.h"
#include "SequencerMovieSceneObjectManager.generated.h"
/**
* Movie scene object manager used by Sequencer.
*/
UCLASS(BlueprintType, MinimalAPI)
class USequencerMovieSceneObjectManager
: public UObject
, public IMovieSceneObjectManager
{
GENERATED_UCLASS_BODY()
/** Virtual destructor. */
virtual ~USequencerMovieSceneObjectManager();
public:
// IMovieSceneObjectManager interface
virtual bool AllowsSpawnableObjects() const override;
virtual void BindPossessableObject(const FGuid& ObjectId, UObject& PossessedObject) override;
virtual bool CanPossessObject(UObject& Object) const override;
virtual void DestroyAllSpawnedObjects(UMovieScene& MovieScene) override;
virtual FGuid FindObjectId(const UMovieScene& MovieScene, UObject& Object) const override;
virtual UObject* FindObject(const FGuid& ObjectId) const override;
virtual void SpawnOrDestroyObjects(UMovieScene* MovieScene, bool DestroyAll) override;
virtual bool TryGetObjectDisplayName(const FGuid& ObjectId, FText& OutDisplayName) const override;
virtual void UnbindPossessableObjects(const FGuid& ObjectId) override;
protected:
/**
* Deselect all proxy actors in the Editor.
*
* @todo sequencer: remove Editor dependencies from this class
*/
SEQUENCER_API void DeselectAllActors();
/**
* Get the world that possessed actors belong to or where spawned actors should go.
*
* @return The world object.
* @todo sequencer: remove Editor dependencies from this class
*/
SEQUENCER_API UWorld* GetWorld() const;
private:
/** Handles changes of non-auto-keyed properties on any object. */
void HandlePropagateObjectChanges(UObject* Object);
/** Refresh either the reference actor or the data descriptor BP after its puppet proxy actor has been changed. */
void PropagateActorChanges(const FGuid& ObjectId, AActor* Actor);
private:
/** Collection of possessed objects. */
// @todo sequencer: gmp: need support for UStruct keys in TMap
UPROPERTY()
TMap<FString, FSequencerPossessedObject> PossessedObjects;
//TMap<FGuid, FSequencerBinding> Bindings;
/** The object change listener. */
TWeakPtr<ISequencerObjectChangeListener> ObjectChangeListener;
/** Collection of spawned proxy actors. */
TMap<FGuid, TWeakObjectPtr<AActor>> SpawnedActors;
};
|
#ifndef MYON_FMPLAYER_COMMON_H_INCLUDED
#define MYON_FMPLAYER_COMMON_H_INCLUDED
#include <stddef.h>
#include <stdbool.h>
void *fmplayer_load_data(const char *name, size_t size);
struct fmdriver_work;
struct ppz8;
struct opna;
struct opna_timer;
void fmplayer_init_work_opna(
struct fmdriver_work *work,
struct ppz8 *ppz8,
struct opna *opna,
struct opna_timer *timer,
void *adpcm_ram
);
#endif // MYON_FMPLAYER_COMMON_H_INCLUDED
|
/* Copyright (c) 2005, Regents of Massachusetts Institute of Technology,
* Brandeis University, Brown University, and University of Massachusetts
* Boston. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of Massachusetts Institute of Technology,
* Brandeis University, Brown University, or University of
* Massachusetts Boston nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DOUBLEVALPOS_H
#define DOUBLEVALPOS_H
#include "ValPos.h"
class DoubleValPos : public ValPos {
public:
DoubleValPos();
DoubleValPos(unsigned int pos_, double value_);
DoubleValPos(DoubleValPos& valpos_);
virtual ValPos* clone();
virtual ~DoubleValPos();
virtual void set(byte* value_);
virtual void set(unsigned int pos_, byte* value_);
virtual void set(unsigned int type_, unsigned int pos_, byte* value_);
virtual double getDouble() {return (double)doublevalue;}
virtual void printVal(std::ostream* o);
virtual unsigned short getSize();
double doublevalue;
//generic function overloads
virtual bool operator > (ValPos*);
virtual bool operator < (ValPos*);
virtual bool operator >= (ValPos*);
virtual bool operator <= (ValPos*);
virtual bool operator == (ValPos*);
virtual bool operator != (ValPos*);
//specialized function overloads
virtual bool operator > (int);
virtual bool operator < (int);
virtual bool operator >= (int);
virtual bool operator <= (int);
virtual bool operator == (int);
virtual bool operator != (int);
};
#endif // DOUBLEVALPOS_H
|
/* Copyright (c) 1985-2012, B-Core (UK) Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define max_sym_val 22400
/* multiple of 128? */
/* Maximum Number of THEORIES */
#define max_the_val 1256
/* Maximum Number of RULES */
/* #define max_rul_val 8029 */
/* #define max_rul_val 10029 */
/* #define max_rul_val 15029 */
#define max_rul_val 30029
/* Maximum Number of GOALS */
/* #define max_gol_val 15013 */
#define max_gol_val 50075
/* Maximum Number of NODES */
/* #define max_nod_val 19019 */
/* #define max_nod_val 25019 */
#define max_nod_val 60109
/* Maximum Number of TACTICS */
#define max_tac_val 20123
/* Maximum Number of HYPOTHESES */
#define max_hyp_val 3037
/* Maximum Number of SEQUENCES */
/* #define max_seq_val 125013 */
#define max_seq_val 250011
|
/*
* Copyright (C) Yichun Zhang (agentzh)
*/
#ifndef DDEBUG
#define DDEBUG 0
#endif
#include "ddebug.h"
#include <ngx_core.h>
#include <ngx_http.h>
#include "ngx_http_drizzle_quoting.h"
ngx_int_t
ngx_http_drizzle_check_int(ngx_str_t *value, void *data)
{
/* TODO */
return NGX_OK;
}
ngx_int_t
ngx_http_drizzle_check_float(ngx_str_t *value, void *data)
{
/* TODO */
return NGX_OK;
}
ngx_int_t
ngx_http_drizzle_check_bool(ngx_str_t *value, void *data)
{
/* TODO */
return NGX_OK;
}
ngx_int_t
ngx_http_drizzle_check_col(ngx_str_t *value, void *data)
{
/* TODO */
return NGX_OK;
}
ngx_int_t
ngx_http_drizzle_check_table(ngx_str_t *value, void *data)
{
/* TODO */
return NGX_OK;
}
ngx_int_t
ngx_http_drizzle_check_keyword(ngx_str_t *value, void *data)
{
/* TODO */
return NGX_OK;
}
|
/*
* Copyright (c) 2013 Ambroz Bizjak
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AMBROLIB_DISTANCE_SPLITTER_H
#define AMBROLIB_DISTANCE_SPLITTER_H
#include <stdint.h>
#include <aprinter/meta/PowerOfTwo.h>
#include <aprinter/meta/ServiceUtils.h>
#include <aprinter/math/FloatTools.h>
#include <aprinter/base/Object.h>
#include <aprinter/printer/Configuration.h>
namespace APrinter {
template <typename Arg>
class DistanceSplitter {
using Context = typename Arg::Context;
using ParentObject = typename Arg::ParentObject;
using Config = typename Arg::Config;
using FpType = typename Arg::FpType;
using Params = typename Arg::Params;
public:
struct Object;
private:
using ClockTimeUnit = APRINTER_FP_CONST_EXPR(Context::Clock::time_unit);
using CMinSplitLengthRec = decltype(ExprCast<FpType>(ExprRec(Config::e(Params::MinSplitLength::i()))));
using CMaxSplitLengthRec = decltype(ExprCast<FpType>(ExprRec(Config::e(Params::MaxSplitLength::i()))));
using CSegmentsPerSecondTimeUnit = decltype(ExprCast<FpType>(Config::e(Params::SegmentsPerSecond::i()) * ClockTimeUnit()));
public:
class Splitter {
public:
void start (Context c, FpType distance, FpType base_max_v_rec, FpType time_freq_by_max_speed)
{
FpType base_segments_by_distance = APRINTER_CFG(Config, CSegmentsPerSecondTimeUnit, c) * time_freq_by_max_speed;
FpType fpcount = distance * FloatMin(APRINTER_CFG(Config, CMinSplitLengthRec, c), FloatMax(APRINTER_CFG(Config, CMaxSplitLengthRec, c), base_segments_by_distance));
if (fpcount >= FloatLdexp(FpType(1.0f), 31)) {
m_count = PowerOfTwo<uint32_t, 31>::Value;
} else {
m_count = 1 + (uint32_t)fpcount;
}
m_pos = 1;
m_max_v_rec = base_max_v_rec / m_count;
}
bool pull (Context c, FpType *out_rel_max_v_rec, FpType *out_frac)
{
*out_rel_max_v_rec = m_max_v_rec;
if (m_pos == m_count) {
return false;
}
*out_frac = (FpType)m_pos / m_count;
m_pos++;
return true;
}
private:
uint32_t m_count;
uint32_t m_pos;
FpType m_max_v_rec;
};
public:
using ConfigExprs = MakeTypeList<CMinSplitLengthRec, CMaxSplitLengthRec, CSegmentsPerSecondTimeUnit>;
struct Object : public ObjBase<DistanceSplitter, ParentObject, EmptyTypeList> {};
};
APRINTER_ALIAS_STRUCT_EXT(DistanceSplitterService, (
APRINTER_AS_TYPE(MinSplitLength),
APRINTER_AS_TYPE(MaxSplitLength),
APRINTER_AS_TYPE(SegmentsPerSecond)
), (
APRINTER_ALIAS_STRUCT_EXT(Splitter, (
APRINTER_AS_TYPE(Context),
APRINTER_AS_TYPE(ParentObject),
APRINTER_AS_TYPE(Config),
APRINTER_AS_TYPE(FpType)
), (
using Params = DistanceSplitterService;
APRINTER_DEF_INSTANCE(Splitter, DistanceSplitter)
))
))
}
#endif
|
/* IDT */
#define IDT_ENTRY_MAX 128
#define IDT_FLAGS_NONE 0x0
#define IDT_FLAGS_VALID 0x1
#define IDT_FLAGS_ENABLE 0x2
/* GCI */
#define IDT_GCI_START_NUM 5
#define IDT_GCI_KMC_NUM (IDT_GCI_START_NUM + GCI_KMC_NUM)
/* DPS */
#define IDT_DPS_UTIM64_NUM 36
#define IDT_DPS_LS_NUM 37
/* FAULT */
#define IDT_PAGEFAULT_NUM 40
#define IDT_INVALIDPRIV_NUM 41
#define IDT_INVALIDINST_NUM 42
#define IDT_INVALIDIDT_NUM 43
#define IDT_DIVERROR_NUM 40
/* ABORT */
#define IDT_DOUBLEFAULT_NUM 63
/* SOFTWARE IRQ */
#define IDT_SWIRQ_START_NUM 64
/* IDT Entry struct */
typedef volatile struct _idt_entry {
unsigned int flags;
void (*handler)(void);
} idt_entry;
idt_entry *idt_setup(void);
void idt_entry_setup(idt_entry *idt, unsigned int num, void (*handler)(void));
void idt_entry_enable(idt_entry *idt, unsigned int num);
/* inline function */
static inline __attribute__((always_inline)) void interrupt_enable(void)
{
__asm__("srieiw 1");
}
static inline __attribute__((always_inline)) void interrupt_disable(void)
{
__asm__("srieiw 0");
}
static inline __attribute__((always_inline)) void idt_set(idt_entry *idtr)
{
__asm__("sridtw %0" : : "r"(idtr));
}
static inline __attribute__((always_inline)) void idt_load(void)
{
__asm__("idts");
}
|
/*
* Copyright (c) 2014 Jos Kuijpers. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@interface ACKDisabledSplitViewDelegate : NSObject <NSSplitViewDelegate>
@end
|
struct KeypointMatchEntry
{
int index;
string file;
int x;
int y;
vector<float> descriptor;
};
struct DepthImage
{
static vec3f makePt(int x, int y, float depth);
void load(const string &filename);
void filter();
void saveDebug();
void makePointCloud();
Grid2f rawDepths;
Grid2f smoothDepths;
Grid2<vec3f> gridPoints;
PointCloudf cloud;
};
struct App
{
void loadKeypointMatchEntries();
//void computeAllFPFH();
//void loadKeypointMatchClouds();
void computeKeypointDescriptors();
void computeFinalDescFile();
void go();
void processFragment(const string &path, const string &subfolder);
void processAllFragments(const string &dir, const string &subfolder);
void computeBinDescriptor(const string &fileIn, const string &fileOut);
void computeFinalDescFileTDFs();
void computeKeypointDescriptor(KeypointMatchEntry &entry);
set<string> filenameSet;
//map<string, DepthImage*> allImages;
vector<KeypointMatchEntry> keypointMatchEntries;
};
|
#pragma once
#include <vector>
#include <ncs/sim/DeviceDescription.h>
namespace ncs {
namespace sim {
class MachineDescription {
public:
MachineDescription(const std::vector<DeviceDescription*>& devices);
const std::vector<DeviceDescription*>& getDevices() const;
static MachineDescription* getThisMachine(unsigned int enabled_device_types);
private:
std::vector<DeviceDescription*> devices_;
};
} // namespace sim
} // namespace ncs
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "intellibot.h"
void usage(char *path)
{
fprintf(stderr, "USAGE: %s <db>\n", path);
exit(1);
}
int main(int argc, char *argv[])
{
INTELLIBOT *bot;
ROW *rows, *row;
COLUMN *column;
if (argc != 2)
usage(argv[0]);
bot = Initialize_Bot(argv[1]);
if (!(bot)) {
fprintf(stderr, "[-] Could not initialize bot\n");
return 1;
}
Server_Loop(bot);
Deinitialize_Bot(bot);
return 0;
}
|
#ifndef GENETIC_REGION_H_
#define GENETIC_REGION_H_
#include "genetic_mapping.h"
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
namespace bg = boost::geometry;
class genetic_region : public genetic_mapping {
public:
typedef pos_t coord_t;
typedef bg::model::point< coord_t, 2, bg::cs::cartesian > point_t;
typedef bg::model::box< point_t > region_t;
genetic_region( const chromosome_t & c, pos_t s );
genetic_region( const chromosome_t & c, pos_t s, pos_t e );
region_t getRegion() const;
virtual bool operator==( const genetic_region & rhs ) const;
virtual ~genetic_region();
protected:
region_t m_region;
};
#endif // GENETIC_REGION_H_
|
#ifndef EXTENSION_H_
#define EXTENSION_H_
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <libcryptosec/Base64.h>
#include "ObjectIdentifier.h"
#include "ObjectIdentifierFactory.h"
#include <libcryptosec/exception/CertificationException.h>
class Extension
{
public:
enum Name
{
UNKNOWN,
KEY_USAGE,
EXTENDED_KEY_USAGE,
AUTHORITY_KEY_IDENTIFIER,
CRL_DISTRIBUTION_POINTS,
AUTHORITY_INFORMATION_ACCESS,
BASIC_CONSTRAINTS,
CERTIFICATE_POLICIES,
ISSUER_ALTERNATIVE_NAME,
SUBJECT_ALTERNATIVE_NAME,
SUBJECT_INFORMATION_ACCESS,
SUBJECT_KEY_IDENTIFIER,
CRL_NUMBER,
DELTA_CRL_INDICATOR
};
Extension(X509_EXTENSION *ext) throw (CertificationException);
Extension(std::string oid, bool critical, std::string valueBase64) throw (CertificationException);
virtual ~Extension();
/**
* @deprecated
* Retorna o conteudo da extensão em formato XML.
* Esta função será substituida por toXml().
* */
virtual std::string getXmlEncoded();
virtual std::string getXmlEncoded(std::string tab);
std::string toXml(std::string tab = "") throw(CertificationException);
virtual std::string extValue2Xml(std::string tab = "");
ObjectIdentifier getObjectIdentifier() const;
std::string getName();
Extension::Name getTypeName();
ByteArray getValue() const;
std::string getBase64Value();
void setCritical(bool critical);
bool isCritical() const;
virtual X509_EXTENSION* getX509Extension();
static Extension::Name getName(int nid);
static Extension::Name getName(X509_EXTENSION *ext);
protected:
Extension();
ObjectIdentifier objectIdentifier;
bool critical;
ByteArray value;
};
#endif /*EXTENSION_H_*/
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_ASSISTANT_UI_DIALOG_PLATE_MIC_VIEW_H_
#define ASH_ASSISTANT_UI_DIALOG_PLATE_MIC_VIEW_H_
#include "ash/assistant/model/assistant_interaction_model_observer.h"
#include "ash/assistant/ui/base/assistant_button.h"
#include "ash/public/cpp/assistant/controller/assistant_controller.h"
#include "ash/public/cpp/assistant/controller/assistant_controller_observer.h"
#include "ash/public/cpp/assistant/controller/assistant_interaction_controller.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "base/scoped_observer.h"
namespace ash {
class LogoView;
// A stateful view belonging to DialogPlate which indicates current mic state
// and delivers notification of press events.
class COMPONENT_EXPORT(ASSISTANT_UI) MicView
: public AssistantButton,
public AssistantControllerObserver,
public AssistantInteractionModelObserver {
public:
MicView(AssistantButtonListener* listener,
AssistantButtonId button_id);
~MicView() override;
// AssistantButton:
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override;
int GetHeightForWidth(int width) const override;
// AssistantControllerObserver:
void OnAssistantControllerDestroying() override;
// AssistantInteractionModelObserver:
void OnMicStateChanged(MicState mic_state) override;
void OnSpeechLevelChanged(float speech_level_db) override;
private:
void InitLayout();
// If |animate| is false, there is no exit animation of current state and
// enter animation of the next state of the LogoView. Note that |animate| will
// only take effect if Assistant UI is visible. Otherwise, we proceed
// immediately to the next state regardless of |animate|.
void UpdateState(bool animate);
LogoView* logo_view_; // Owned by view hierarchy.
// True when speech level goes above a threshold and sets LogoView in
// kUserSpeaks state.
bool is_user_speaking_ = false;
ScopedObserver<AssistantController, AssistantControllerObserver>
assistant_controller_observer_{this};
ScopedObserver<AssistantInteractionController,
AssistantInteractionModelObserver,
&AssistantInteractionController::AddModelObserver,
&AssistantInteractionController::RemoveModelObserver>
assistant_interaction_model_observer_{this};
DISALLOW_COPY_AND_ASSIGN(MicView);
};
} // namespace ash
#endif // ASH_ASSISTANT_UI_DIALOG_PLATE_MIC_VIEW_H_
|
//
// Megalog.h
// eXplora MuSe
//
// Created by Nicolò Tosi on 7/17/13.
// Copyright (c) 2013 MobFarm. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DDLog.h"
#if DEBUG
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
#else
// TODO: change this when we can deploy safely
// static const int ddLogLevel = LOG_LEVEL_ERROR;
static const int ddLogLevel = LOG_LEVEL_INFO;
#endif
#define MFLogError(fmt,...) {\
[Megalog logErrorWithFormat:fmt,##__VA_ARGS__];\
}\
#define MFLogWarning(fmt,...){\
[Megalog logWarningWithFormat:fmt,##__VA_ARGS__];\
}\
#define MFLogInfo(fmt, ...) {\
[Megalog logInfoWithFormat:fmt,##__VA_ARGS__];\
}\
#define MFLogVerbose(fmt,...) {\
[Megalog logVerboseWithFormat:fmt,##__VA_ARGS__];\
}\
@interface Megalog : NSObject
+(void)logErrorWithFormat:(NSString *)format, ...;
+(void)logWarningWithFormat:(NSString *)format, ...;
+(void)logInfoWithFormat:(NSString *)format, ...;
+(void)logVerboseWithFormat:(NSString *)format, ...;
+(NSString *)currentLogFilePath;
@end
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_TEST_CHROMEDRIVER_CHROME_PERFORMANCE_LOGGER_H_
#define CHROME_TEST_CHROMEDRIVER_CHROME_PERFORMANCE_LOGGER_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
class Log;
// Translates DevTools profiler events into Log messages with info level.
//
// The message is a JSON string of the following structure:
// {
// "webview": <originating WebView ID>,
// "message": { "method": "...", "params": { ... }} // DevTools message.
// }
class PerformanceLogger : public DevToolsEventListener {
public:
explicit PerformanceLogger(Log* log);
virtual Status OnConnected(DevToolsClient* client) OVERRIDE;
virtual void OnEvent(DevToolsClient* client,
const std::string& method,
const base::DictionaryValue& params) OVERRIDE;
private:
Log* log_;
DISALLOW_COPY_AND_ASSIGN(PerformanceLogger);
};
#endif // CHROME_TEST_CHROMEDRIVER_CHROME_PERFORMANCE_LOGGER_H_
|
///////////////////////////////////////////////////////////////////////////////
// Name: SherpaEvent.h
// Purpose:
// Author: Joe Yates
// Modified by:
// Created: 11/10/2004
// RCS-ID: $Id: SherpaEvent.h,v 1.1.1.1 2006/01/24 22:13:19 titusd Exp $
// Copyright: (c) BID Snc
// License: BSD license (see the file 'LICENSE.txt')
///////////////////////////////////////////////////////////////////////////////
#ifndef __SherpaEvent_h__
#define __SherpaEvent_h__
// Event IDs
enum
{
// Menu Ids
shMENUID_FILE_EXIT,
shMENUID_FILE_EMPTY_WASTEBIN,
shMENUID_EDIT_UNDO,
shMENUID_EDIT_REDO,
shMENUID_EDIT_PREFERENCES,
shMENUID_VIEW_SHOWHIDDEN,
shMENUID_DEBUG_WASTEBIN,
shMENUID_DEBUG_UNDO,
shMENUID_DELETE,
shMENUID_TOWASTEBIN,
shMENUID_NEW_DIRECTORY,
shMENUID_NEW_FILE
};
extern wxEventType shEVT_SET_PATH;
extern wxEventType shEVT_RENAME;
extern wxEventType shEVT_DELETE;
extern wxEventType shEVT_TOWASTEBIN;
extern wxEventType shEVT_RESTORE;
extern wxEventType shEVT_CREATE;
class shSetPathEvent: public wxCommandEvent
{
public:
shSetPathEvent(const wxString& sPath);
public:
// accessors
wxString GetPath()
{return m_sPath;}
private:
wxString m_sPath;
};
class shRenameEvent: public wxCommandEvent
{
public:
shRenameEvent(const wxString& sOldPathName, const wxString& sNewPathName);
public:
// accessors
wxString GetOldPathName()
{return m_sOldPathName;}
wxString GetNewPathName()
{return m_sNewPathName;}
private:
wxString m_sOldPathName;
wxString m_sNewPathName;
};
class shDeleteEvent: public wxCommandEvent
{
public:
shDeleteEvent(const wxString& sPathName);
public:
// accessors
wxString GetPathName()
{return m_sPathName;}
private:
wxString m_sPathName;
};
class shToWastebinEvent: public wxCommandEvent
{
public:
shToWastebinEvent(const wxString& sPathName);
public:
// accessors
wxString GetPathName()
{return m_sPathName;}
private:
wxString m_sPathName;
};
class shRestoreEvent: public wxCommandEvent
{
public:
shRestoreEvent(const wxString& sPathName);
public:
// accessors
wxString GetPathName()
{return m_sPathName;}
private:
wxString m_sPathName;
};
class shCreateEvent: public wxCommandEvent
{
public:
shCreateEvent(const wxString& sPath, const wxString& sFileType);
public:
// accessors
wxString GetPath()
{return m_sPath;}
wxString GetFileType()
{return m_sFileType;}
private:
wxString m_sPath;
wxString m_sFileType;
};
typedef void (wxEvtHandler::*shSetPathEventFunction)(shSetPathEvent&);
typedef void (wxEvtHandler::*shRenameEventFunction)(shRenameEvent&);
typedef void (wxEvtHandler::*shDeleteEventFunction)(shDeleteEvent&);
typedef void (wxEvtHandler::*shToWastebinEventFunction)(shToWastebinEvent&);
typedef void (wxEvtHandler::*shRestoreEventFunction)(shRestoreEvent&);
typedef void (wxEvtHandler::*shCreateEventFunction)(shCreateEvent&);
#define EVT_SET_PATH(fn) \
wxEventTableEntry(shEVT_SET_PATH, -1, -1, \
(wxObjectEventFunction) (wxEventFunction) (shSetPathEventFunction) &fn, (wxObject *) NULL ),
#define EVT_RENAME(fn) \
wxEventTableEntry(shEVT_RENAME, -1, -1, \
(wxObjectEventFunction) (wxEventFunction) (shRenameEventFunction) &fn, (wxObject *) NULL ),
#define EVT_DELETE(fn) \
wxEventTableEntry(shEVT_DELETE, -1, -1, \
(wxObjectEventFunction) (wxEventFunction) (shDeleteEventFunction) &fn, (wxObject *) NULL ),
#define EVT_TOWASTEBIN(fn) \
wxEventTableEntry(shEVT_TOWASTEBIN, -1, -1, \
(wxObjectEventFunction) (wxEventFunction) (shToWastebinEventFunction) &fn, (wxObject *) NULL ),
#define EVT_RESTORE(fn) \
wxEventTableEntry(shEVT_RESTORE, -1, -1, \
(wxObjectEventFunction) (wxEventFunction) (shRestoreEventFunction) &fn, (wxObject *) NULL ),
#define EVT_CREATE(fn) \
wxEventTableEntry(shEVT_CREATE, -1, -1, \
(wxObjectEventFunction) (wxEventFunction) (shCreateEventFunction) &fn, (wxObject *) NULL ),
#endif // ndef __SherpaEvent_h__
|
/*****************************************************************************
Copyright (c) 2011, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************
* Contents: Native high-level C interface to LAPACK function dgtrfs
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke.h"
#include "lapacke_utils.h"
lapack_int LAPACKE_dgtrfs( int matrix_order, char trans, lapack_int n,
lapack_int nrhs, const double* dl, const double* d,
const double* du, const double* dlf,
const double* df, const double* duf,
const double* du2, const lapack_int* ipiv,
const double* b, lapack_int ldb, double* x,
lapack_int ldx, double* ferr, double* berr )
{
lapack_int info = 0;
lapack_int* iwork = NULL;
double* work = NULL;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgtrfs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
return -13;
}
if( LAPACKE_d_nancheck( n, d, 1 ) ) {
return -6;
}
if( LAPACKE_d_nancheck( n, df, 1 ) ) {
return -9;
}
if( LAPACKE_d_nancheck( n-1, dl, 1 ) ) {
return -5;
}
if( LAPACKE_d_nancheck( n-1, dlf, 1 ) ) {
return -8;
}
if( LAPACKE_d_nancheck( n-1, du, 1 ) ) {
return -7;
}
if( LAPACKE_d_nancheck( n-2, du2, 1 ) ) {
return -11;
}
if( LAPACKE_d_nancheck( n-1, duf, 1 ) ) {
return -10;
}
if( LAPACKE_dge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
return -15;
}
#endif
/* Allocate memory for working array(s) */
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,3*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_dgtrfs_work( matrix_order, trans, n, nrhs, dl, d, du, dlf,
df, duf, du2, ipiv, b, ldb, x, ldx, ferr, berr,
work, iwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( iwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgtrfs", info );
}
return info;
}
|
#include "code.h"
/**
* Returns whether or not the Code is a termination code.
*/
int is_termination_code(const Code code) { return code == CODE_QUIT || code == CODE_CLOSE; }
|
/*
* ARC++
*
* Copyright (c) 2007-2008 Steven Noonan.
*
* Licensed under the New BSD License.
*
*/
#ifndef __included_soundsystem_openal_h
#define __included_soundsystem_openal_h
#ifdef USE_OPENAL
#ifdef TARGET_OS_WINDOWS
# include <al.h>
# include <alc.h>
#elif defined(TARGET_OS_MACOSX)
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
#else
# include <AL/al.h>
# include <AL/alc.h>
#endif
class OpenALSoundSystem : public SoundSystem
{
protected:
Data::LList<ALuint> m_usedSources;
Data::LList<ALuint> m_freeSources;
Data::RedBlackTree<const char *, ALuint> m_buffers;
Data::DArray<Data::LList<std::string> *> m_queues;
ALCcontext* m_context;
ALCdevice* m_device;
ALuint AcquireSource ();
public:
OpenALSoundSystem();
virtual ~OpenALSoundSystem();
virtual void AddQueue ( Data::LList<std::string> *_queue );
virtual bool IsPlaying ( const char *_soundName );
virtual int LoadWave ( const char *_soundName );
virtual int PlaySound ( const char *_soundName, short _distX, short _distY );
virtual void Update ();
};
#endif
#endif
|
/**
* Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "ABI38_0_0RNSVGRenderableManager.h"
@interface ABI38_0_0RNSVGRectManager : ABI38_0_0RNSVGRenderableManager
@end
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_WIN_H_
#define CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_WIN_H_
#include "base/macros.h"
#include "components/crash/core/app/crash_reporter_client.h"
class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {
public:
#if !defined(NACL_WIN64)
// Instantiates a process wide instance of the ChromeCrashReporterClient
// class and initializes crash reporting for the process. The instance is
// leaked.
static void InitializeCrashReportingForProcess();
#endif // !defined(NACL_WIN64)
ChromeCrashReporterClient();
~ChromeCrashReporterClient() override;
// crash_reporter::CrashReporterClient implementation.
bool GetAlternativeCrashDumpLocation(base::string16* crash_dir) override;
void GetProductNameAndVersion(const base::string16& exe_path,
base::string16* product_name,
base::string16* version,
base::string16* special_build,
base::string16* channel_name) override;
bool ShouldShowRestartDialog(base::string16* title,
base::string16* message,
bool* is_rtl_locale) override;
bool AboutToRestart() override;
bool GetIsPerUserInstall() override;
bool GetShouldDumpLargerDumps() override;
int GetResultCodeRespawnFailed() override;
bool GetCrashDumpLocation(base::string16* crash_dir) override;
bool GetCrashMetricsLocation(base::string16* metrics_dir) override;
bool IsRunningUnattended() override;
bool GetCollectStatsConsent() override;
bool GetCollectStatsInSample() override;
bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) override;
bool ShouldMonitorCrashHandlerExpensively() override;
bool EnableBreakpadForProcess(const std::string& process_type) override;
private:
DISALLOW_COPY_AND_ASSIGN(ChromeCrashReporterClient);
};
#endif // CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_WIN_H_
|
/*-
* Copyright (c) 2013 Nathan Whitehorn
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: stable/9/usr.sbin/bsdinstall/partedit/scripted.c 248240 2013-03-13 13:50:50Z nwhitehorn $
*/
#include <sys/param.h>
#include <errno.h>
#include <libutil.h>
#include <inttypes.h>
#include <libgeom.h>
#include <dialog.h>
#include <dlg_keys.h>
#include "partedit.h"
static struct gprovider *
provider_for_name(struct gmesh *mesh, const char *name)
{
struct gclass *classp;
struct gprovider *pp = NULL;
struct ggeom *gp;
LIST_FOREACH(classp, &mesh->lg_class, lg_class) {
LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
if (LIST_EMPTY(&gp->lg_provider))
continue;
LIST_FOREACH(pp, &gp->lg_provider, lg_provider)
if (strcmp(pp->lg_name, name) == 0)
break;
if (pp != NULL) break;
}
if (pp != NULL) break;
}
return (pp);
}
static int
part_config(char *disk, const char *scheme, char *config)
{
char *partition, *ap, *size = NULL, *type = NULL, *mount = NULL;
struct gclass *classp;
struct gmesh mesh;
struct ggeom *gpart = NULL;
int error;
if (scheme == NULL)
scheme = default_scheme();
error = geom_gettree(&mesh);
if (provider_for_name(&mesh, disk) == NULL) {
fprintf(stderr, "GEOM provider %s not found\n", disk);
geom_deletetree(&mesh);
return (-1);
}
/* Remove any existing partitioning and create new scheme */
LIST_FOREACH(classp, &mesh.lg_class, lg_class)
if (strcmp(classp->lg_name, "PART") == 0)
break;
if (classp != NULL) {
LIST_FOREACH(gpart, &classp->lg_geom, lg_geom)
if (strcmp(gpart->lg_name, disk) == 0)
break;
}
if (gpart != NULL)
gpart_destroy(gpart);
gpart_partition(disk, scheme);
if (strcmp(scheme, "PC98") == 0 || strcmp(scheme, "MBR") == 0) {
struct gmesh submesh;
geom_gettree(&submesh);
gpart_create(provider_for_name(&submesh, disk),
"freebsd", NULL, NULL, &disk, 0);
geom_deletetree(&submesh);
} else {
disk= strdup(disk);
}
geom_deletetree(&mesh);
error = geom_gettree(&mesh);
/* Create partitions */
if (config == NULL) {
wizard_makeparts(&mesh, disk, 0);
goto finished;
}
while ((partition = strsep(&config, ",")) != NULL) {
while ((ap = strsep(&partition, " \t\n")) != NULL) {
if (*ap == '\0')
continue;
if (size == NULL)
size = ap;
else if (type == NULL)
type = ap;
else if (mount == NULL)
mount = ap;
}
if (size == NULL)
continue;
if (strcmp(size, "auto") == 0)
size = NULL;
gpart_create(provider_for_name(&mesh, disk), type, size, mount,
NULL, 0);
geom_deletetree(&mesh);
error = geom_gettree(&mesh);
size = type = mount = NULL;
}
finished:
geom_deletetree(&mesh);
free(disk);
return (0);
}
static
int parse_disk_config(char *input)
{
char *ap;
char *disk = NULL, *scheme = NULL, *partconfig = NULL;
while (input != NULL && *input != 0) {
if (isspace(*input)) {
input++;
continue;
}
switch(*input) {
case '{':
input++;
partconfig = strchr(input, '}');
if (partconfig == NULL) {
fprintf(stderr, "Malformed partition setup "
"string: %s\n", input);
return (1);
}
*partconfig = '\0';
ap = partconfig+1;
partconfig = input;
input = ap;
break;
default:
if (disk == NULL)
disk = strsep(&input, " \t\n");
else if (scheme == NULL)
scheme = strsep(&input, " \t\n");
else {
fprintf(stderr, "Unknown directive: %s\n",
strsep(&input, " \t\n"));
return (1);
}
}
} while (input != NULL && *input != 0);
if (disk != NULL)
return (part_config(disk, scheme, partconfig));
return (0);
}
int
scripted_editor(int argc, const char **argv)
{
char *token;
int i, error = 0, len = 0;
for (i = 1; i < argc; i++)
len += strlen(argv[i]) + 1;
char inputbuf[len], *input = inputbuf;
strcpy(input, argv[1]);
for (i = 2; i < argc; i++) {
strcat(input, " ");
strcat(input, argv[i]);
}
while ((token = strsep(&input, ";")) != NULL) {
error = parse_disk_config(token);
if (error != 0)
return (error);
}
return (0);
}
|
#ifndef TRAJECTORY_H
#define TRAJECTORY_H
#include <ros/assert.h>
#include <serializable/serializable.h>
#include <eigen_extensions/eigen_extensions.h>
namespace clams
{
class Trajectory : public Serializable
{
public:
Trajectory() {}
//! Deep copy
Trajectory(const Trajectory& other);
//! Deep copy
Trajectory& operator=(const Trajectory& other);
~Trajectory();
void clear();
//! Destroys everything inside.
void resize(size_t num);
void set(size_t idx, const Eigen::Affine3d& transform);
const Eigen::Affine3d& get(size_t idx) const;
bool exists(size_t idx) const;
void remove(size_t idx);
size_t size() const { return transforms_.size(); }
size_t numValid() const;
std::string status(const std::string& prefix) const;
void serialize(std::ostream& out) const;
void deserialize(std::istream& in);
protected:
std::vector<Eigen::Affine3d*> transforms_;
};
}
#endif // TRAJECTORY_H
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_connect_socket_system_66b.c
Label Definition File: CWE78_OS_Command_Injection.one_string.label.xml
Template File: sources-sink-66b.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: connect_socket Read data using a connect socket (client side)
* GoodSource: Fixed string
* Sinks: system
* BadSink : Execute command in data using system()
* Flow Variant: 66 Data flow: data passed in an array from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define FULL_COMMAND L"dir "
#else
#include <unistd.h>
#define FULL_COMMAND L"ls "
#endif
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else /* NOT _WIN32 */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define IP_ADDRESS "127.0.0.1"
#ifdef _WIN32
#define SYSTEM _wsystem
#else /* NOT _WIN32 */
#define SYSTEM system
#endif
#ifndef OMITBAD
void CWE78_OS_Command_Injection__wchar_t_connect_socket_system_66b_badSink(wchar_t * dataArray[])
{
/* copy data out of dataArray */
wchar_t * data = dataArray[2];
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) != 0)
{
printLine("command execution failed!");
exit(1);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE78_OS_Command_Injection__wchar_t_connect_socket_system_66b_goodG2BSink(wchar_t * dataArray[])
{
wchar_t * data = dataArray[2];
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) != 0)
{
printLine("command execution failed!");
exit(1);
}
}
#endif /* OMITGOOD */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.