text stringlengths 4 6.14k |
|---|
/****************************************************************************
**
** Copyright (C) 2013-2014 Andrey Bogdanov
**
** This file is part of the TeXSampleCore module of the TeXSample library.
**
** TeXSample is free software: you can redistribute it and/or modify it under
** the terms of the GNU Lesser General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** TeXSample 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 Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with TeXSample. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef TEDITGROUPREQUESTDATA_H
#define TEDITGROUPREQUESTDATA_H
class TEditGroupRequestDataPrivate;
class QDataStream;
class QDebug;
class QString;
class QVariant;
#include "tglobal.h"
#include <BBase>
#include <QMetaType>
/*============================================================================
================================ TEditGroupRequestData =======================
============================================================================*/
class T_CORE_EXPORT TEditGroupRequestData : public BBase
{
B_DECLARE_PRIVATE(TEditGroupRequestData)
public:
explicit TEditGroupRequestData();
TEditGroupRequestData(const TEditGroupRequestData &other);
~TEditGroupRequestData();
public:
void clear();
quint64 id() const;
bool isValid() const;
QString name() const;
void setId(quint64 id);
void setName(const QString &name);
public:
TEditGroupRequestData &operator =(const TEditGroupRequestData &other);
bool operator ==(const TEditGroupRequestData &other) const;
bool operator !=(const TEditGroupRequestData &other) const;
operator QVariant() const;
public:
T_CORE_EXPORT friend QDataStream &operator <<(QDataStream &stream, const TEditGroupRequestData &data);
T_CORE_EXPORT friend QDataStream &operator >>(QDataStream &stream, TEditGroupRequestData &data);
T_CORE_EXPORT friend QDebug operator <<(QDebug dbg, const TEditGroupRequestData &data);
};
Q_DECLARE_METATYPE(TEditGroupRequestData)
#endif // TEDITGROUPREQUESTDATA_H
|
/*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2015 Intel Corporation. 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
the 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 INTEL OR
ITS 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.
END_LEGAL */
/// @file xed-chip-enum.h
// This file was automatically generated.
// Do not edit this file.
#if !defined(_XED_CHIP_ENUM_H_)
# define _XED_CHIP_ENUM_H_
#include "xed-common-hdrs.h"
typedef enum
{
XED_CHIP_INVALID,
XED_CHIP_I86,
XED_CHIP_I86FP,
XED_CHIP_I186,
XED_CHIP_I186FP,
XED_CHIP_I286REAL,
XED_CHIP_I286,
XED_CHIP_I2186FP,
XED_CHIP_I386REAL,
XED_CHIP_I386,
XED_CHIP_I386FP,
XED_CHIP_I486REAL,
XED_CHIP_I486,
XED_CHIP_PENTIUMREAL,
XED_CHIP_PENTIUM,
XED_CHIP_QUARK,
XED_CHIP_PENTIUMMMXREAL,
XED_CHIP_PENTIUMMMX,
XED_CHIP_ALLREAL,
XED_CHIP_PENTIUMPRO,
XED_CHIP_PENTIUM2,
XED_CHIP_PENTIUM3,
XED_CHIP_PENTIUM4,
XED_CHIP_P4PRESCOTT,
XED_CHIP_P4PRESCOTT_NOLAHF,
XED_CHIP_P4PRESCOTT_VTX,
XED_CHIP_CORE2,
XED_CHIP_PENRYN,
XED_CHIP_PENRYN_E,
XED_CHIP_NEHALEM,
XED_CHIP_WESTMERE,
XED_CHIP_BONNELL,
XED_CHIP_SALTWELL,
XED_CHIP_SILVERMONT,
XED_CHIP_AMD,
XED_CHIP_GOLDMONT,
XED_CHIP_SANDYBRIDGE,
XED_CHIP_IVYBRIDGE,
XED_CHIP_HASWELL,
XED_CHIP_BROADWELL,
XED_CHIP_SKYLAKE,
XED_CHIP_SKYLAKE_SERVER,
XED_CHIP_MEMORY_FUTURE,
XED_CHIP_KNL,
XED_CHIP_AVX512_FUTURE,
XED_CHIP_ALL,
XED_CHIP_LAST
} xed_chip_enum_t;
/// This converts strings to #xed_chip_enum_t types.
/// @param s A C-string.
/// @return #xed_chip_enum_t
/// @ingroup ENUM
XED_DLL_EXPORT xed_chip_enum_t str2xed_chip_enum_t(const char* s);
/// This converts strings to #xed_chip_enum_t types.
/// @param p An enumeration element of type xed_chip_enum_t.
/// @return string
/// @ingroup ENUM
XED_DLL_EXPORT const char* xed_chip_enum_t2str(const xed_chip_enum_t p);
/// Returns the last element of the enumeration
/// @return xed_chip_enum_t The last element of the enumeration.
/// @ingroup ENUM
XED_DLL_EXPORT xed_chip_enum_t xed_chip_enum_t_last(void);
#endif
|
/* QEFormGroupBox.h
*
* This file is part of the EPICS QT Framework, initially developed at the
* Australian Synchrotron.
*
* Copyright (c) 2021 Australian Synchrotron
*
* The EPICS QT Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The EPICS QT Framework 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the EPICS QT Framework. If not, see <http://www.gnu.org/licenses/>.
*
* Author:
* Andrew Starritt
* Contact details:
* andrew.starritt@synchrotron.org.au
*/
#ifndef QE_FORM_GROUP_BOX_H
#define QE_FORM_GROUP_BOX_H
#include <QGroupBox>
#include <QHBoxLayout>
#include <QWidget>
#include <QFrame>
#include <QECommon.h>
#include <persistanceManager.h>
#include <UserMessage.h>
#include <QEGroupBox.h>
#include <QEForm.h>
#include <QEFrameworkLibraryGlobal.h>
/// This widget is a group box that contains a QEForm widget, which allows
/// arbitary ui files to be loaded - see QEForm doco and comments for details.
/// The group box is set checkable, and when un checked the group box's height
/// is set to all is tilte to be seen, but non of the contents. When checked
/// the group box will expand to accomodate the loaded ui file.
///
/// Note: this widget takes control/management of it's minimum and maximum
/// width and heights, so setting in designer will have effectively no impact.
///
class QE_FRAMEWORK_LIBRARY_SHARED_EXPORT QEFormGroupBox : public QEGroupBox
{
Q_OBJECT
public:
// The setCheckable is set and should be left true for this widget.
//
Q_PROPERTY (bool checkable READ isCheckable WRITE setCheckable DESIGNABLE false)
/// The following propeties are directly copied form QEFrom - see QEForm
/// docoumentation and code comments for details, the the exception of the
/// messageSourceId porperty which has been rebagded to formMessageSourceId
/// to avoid conflict with QEFormGroupBox own messageSourceId porperty.
// Please keep these aligned with QEFrom.
//
Q_PROPERTY (QString uiFile
READ getUiFileNameProperty WRITE setUiFileNameProperty)
Q_PROPERTY (QString variableSubstitutions
READ getVariableNameSubstitutionsProperty
WRITE setVariableNameSubstitutionsProperty)
Q_PROPERTY (bool handleGuiLaunchRequests
READ getHandleGuiLaunchRequests WRITE setHandleGuiLaunchRequests)
Q_PROPERTY (bool resizeContents
READ getResizeContents WRITE setResizeContents)
Q_PROPERTY (unsigned int formMessageSourceId
READ getMessageSourceId WRITE setMessageSourceId)
Q_PROPERTY (QEForm::MessageFilterOptions messageFormFilter
READ getMessageFormFilter WRITE setMessageFormFilter)
Q_PROPERTY (QEForm::MessageFilterOptions messageSourceFilter
READ getMessageSourceFilter WRITE setMessageSourceFilter)
// QEFormGroupBox specific properties.
/// When true, the frame shape of the inner frame widget is set to NoShape
/// provided a unique QFrame (or QEFrame/other sub classes) is found at the
/// top level of the loaded form.
//
Q_PROPERTY (bool hideInnerFrameShape
READ getHideInnerFrameShape WRITE setHideInnerFrameShape)
/// When true, the form title is extracted from the loaded form and
/// used to set the group box title.
//
Q_PROPERTY (bool useFormTitle
READ getUseFormTitle WRITE setUseFormTitle)
public:
explicit QEFormGroupBox (QWidget* parent = 0);
virtual ~QEFormGroupBox ();
QSize sizeHint () const;
// Expose access to the internal QEForm widget's set/get functions.
//
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, QString, getUiFileNameProperty, setUiFileNameProperty);
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, QString, getVariableNameSubstitutionsProperty, setVariableNameSubstitutionsProperty);
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, bool, getHandleGuiLaunchRequests, setHandleGuiLaunchRequests);
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, bool, getResizeContents , setResizeContents);
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, unsigned int, getMessageSourceId, setMessageSourceId);
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, QEForm::MessageFilterOptions, getMessageFormFilter, setMessageFormFilter);
QE_EXPOSE_INTERNAL_OBJECT_FUNCTIONS (form, QEForm::MessageFilterOptions, getMessageSourceFilter, setMessageSourceFilter);
void setHideInnerFrameShape (const bool useFormTitle);
bool getHideInnerFrameShape () const;
void setUseFormTitle (const bool useFormTitle);
bool getUseFormTitle () const;
protected:
// Override parents virtual functions.
//
void showEvent (QShowEvent* event);
void saveConfiguration (PersistanceManager* pm);
void restoreConfiguration (PersistanceManager* pm, restorePhases restorePhase);
private:
void updateBoxTitle();
void updateInnerFrameShape();
void updateBoxMinMaxSizes();
QFrame* findUniqueFrame ();
bool hideInnerFrameShape;
QFrame::Shape loadedFrameShape;
bool useFormTitle;
QString loadedFormTitle;
// Internal widgets
//
QHBoxLayout* layout;
QEForm* form;
QWidget* spacer;
private slots:
void onFormLoaded (bool);
void onGroupBoxClick (bool);
};
#endif // QE_FORM_GROUP_BOX_H
|
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation and
// any modifications thereto. Any use, reproduction, disclosure, or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA Corporation is strictly prohibited.
//
// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Information and code furnished is believed to be accurate and reliable.
// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
// information or for any infringement of patents or other rights of third parties that may
// result from its use. No license is granted by implication or otherwise under any patent
// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
// This code supersedes and replaces all information previously supplied.
// NVIDIA Corporation products are not authorized for use as critical
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
#ifndef PSFOUNDATION_PSWINDOWSINTRINSICS_H
#define PSFOUNDATION_PSWINDOWSINTRINSICS_H
#include "Ps.h"
#include "foundation/PxAssert.h"
// this file is for internal intrinsics - that is, intrinsics that are used in
// cross platform code but do not appear in the API
#if !PX_WINDOWS_FAMILY
#error "This file should only be included by Windows builds!!"
#endif
#pragma warning(push)
//'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
#pragma warning(disable : 4668)
#if PX_VC == 10
#pragma warning(disable : 4987) // nonstandard extension used: 'throw (...)'
#endif
#include <intrin.h>
#pragma warning(pop)
#pragma warning(push)
#pragma warning(disable : 4985) // 'symbol name': attributes not present on previous declaration
#include <math.h>
#pragma warning(pop)
#include <float.h>
#include <mmintrin.h>
#pragma intrinsic(_BitScanForward)
#pragma intrinsic(_BitScanReverse)
namespace physx
{
namespace shdfnd
{
/*
* Implements a memory barrier
*/
PX_FORCE_INLINE void memoryBarrier()
{
_ReadWriteBarrier();
/* long Barrier;
__asm {
xchg Barrier, eax
}*/
}
/*!
Returns the index of the highest set bit. Not valid for zero arg.
*/
PX_FORCE_INLINE uint32_t highestSetBitUnsafe(uint32_t v)
{
unsigned long retval;
_BitScanReverse(&retval, v);
return retval;
}
/*!
Returns the index of the highest set bit. Undefined for zero arg.
*/
PX_FORCE_INLINE uint32_t lowestSetBitUnsafe(uint32_t v)
{
unsigned long retval;
_BitScanForward(&retval, v);
return retval;
}
/*!
Returns the number of leading zeros in v. Returns 32 for v=0.
*/
PX_FORCE_INLINE uint32_t countLeadingZeros(uint32_t v)
{
if(v)
{
unsigned long bsr = (unsigned long)-1;
_BitScanReverse(&bsr, v);
return 31 - bsr;
}
else
return 32;
}
/*!
Prefetch aligned cache size around \c ptr+offset.
*/
#if !PX_ARM
PX_FORCE_INLINE void prefetchLine(const void* ptr, uint32_t offset = 0)
{
// cache line on X86/X64 is 64-bytes so a 128-byte prefetch would require 2 prefetches.
// However, we can only dispatch a limited number of prefetch instructions so we opt to prefetch just 1 cache line
/*_mm_prefetch(((const char*)ptr + offset), _MM_HINT_T0);*/
// We get slightly better performance prefetching to non-temporal addresses instead of all cache levels
_mm_prefetch(((const char*)ptr + offset), _MM_HINT_NTA);
}
#else
PX_FORCE_INLINE void prefetchLine(const void* ptr, uint32_t offset = 0)
{
// arm does have 32b cache line size
__prefetch(((const char*)ptr + offset));
}
#endif
/*!
Prefetch \c count bytes starting at \c ptr.
*/
#if !PX_ARM
PX_FORCE_INLINE void prefetch(const void* ptr, uint32_t count = 1)
{
const char* cp = (char*)ptr;
uint64_t p = size_t(ptr);
uint64_t startLine = p >> 6, endLine = (p + count - 1) >> 6;
uint64_t lines = endLine - startLine + 1;
do
{
prefetchLine(cp);
cp += 64;
} while(--lines);
}
#else
PX_FORCE_INLINE void prefetch(const void* ptr, uint32_t count = 1)
{
const char* cp = (char*)ptr;
uint32_t p = size_t(ptr);
uint32_t startLine = p >> 5, endLine = (p + count - 1) >> 5;
uint32_t lines = endLine - startLine + 1;
do
{
prefetchLine(cp);
cp += 32;
} while(--lines);
}
#endif
//! \brief platform-specific reciprocal
PX_CUDA_CALLABLE PX_FORCE_INLINE float recipFast(float a)
{
return 1.0f / a;
}
//! \brief platform-specific fast reciprocal square root
PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrtFast(float a)
{
return 1.0f / ::sqrtf(a);
}
//! \brief platform-specific floor
PX_CUDA_CALLABLE PX_FORCE_INLINE float floatFloor(float x)
{
return ::floorf(x);
}
#define NS_EXPECT_TRUE(x) x
#define NS_EXPECT_FALSE(x) x
} // namespace shdfnd
} // namespace physx
#endif // #ifndef PSFOUNDATION_PSWINDOWSINTRINSICS_H
|
// Created file "Lib\src\Uuid\X64\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PKEY_Calendar_ShowTimeAs, 0x5bf396d4, 0x5eb2, 0x466f, 0xbd, 0xe9, 0x2f, 0xb3, 0xf2, 0x36, 0x1d, 0x6e);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DELETEMODELPACKAGEGROUPPOLICYRESPONSE_H
#define QTAWS_DELETEMODELPACKAGEGROUPPOLICYRESPONSE_H
#include "sagemakerresponse.h"
#include "deletemodelpackagegrouppolicyrequest.h"
namespace QtAws {
namespace SageMaker {
class DeleteModelPackageGroupPolicyResponsePrivate;
class QTAWSSAGEMAKER_EXPORT DeleteModelPackageGroupPolicyResponse : public SageMakerResponse {
Q_OBJECT
public:
DeleteModelPackageGroupPolicyResponse(const DeleteModelPackageGroupPolicyRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DeleteModelPackageGroupPolicyRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DeleteModelPackageGroupPolicyResponse)
Q_DISABLE_COPY(DeleteModelPackageGroupPolicyResponse)
};
} // namespace SageMaker
} // namespace QtAws
#endif
|
/*+@@file@@----------------------------------------------------------------*//*!
\file triedcid.h
\par Description
Extension and update of headers for PellesC compiler suite.
\par Project:
PellesC Headers extension
\date Created on Sat Sep 17 12:53:34 2016
\date Modified on Sat Sep 17 12:53:34 2016
\author frankie
\*//*-@@file@@----------------------------------------------------------------*/
#ifndef __TRIEDCID_H__
#define __TRIEDCID_H__
#if __POCC__ >= 500
#pragma once
#endif
#define IDM_TRIED_NUDGE_ELEMENT 2
#define IDM_TRIED_SET_ALIGNMENT 3
#define IDM_TRIED_MAKE_ABSOLUTE 4
#define IDM_TRIED_LOCK_ELEMENT 5
#define IDM_TRIED_SEND_TO_BACK 6
#define IDM_TRIED_BRING_TO_FRONT 7
#define IDM_TRIED_SEND_BACKWARD 8
#define IDM_TRIED_BRING_FORWARD 9
#define IDM_TRIED_SEND_BELOW_TEXT 10
#define IDM_TRIED_BRING_ABOVE_TEXT 11
#define IDM_TRIED_CONSTRAIN 12
#define IDM_TRIED_ABSOLUTE_DROP_MODE 13
#define IDM_TRIED_INSERTROW 14
#define IDM_TRIED_INSERTCOL 15
#define IDM_TRIED_DELETEROWS 16
#define IDM_TRIED_DELETECOLS 17
#define IDM_TRIED_MERGECELLS 18
#define IDM_TRIED_SPLITCELL 19
#define IDM_TRIED_INSERTCELL 20
#define IDM_TRIED_DELETECELLS 21
#define IDM_TRIED_INSERTTABLE 22
#define IDM_TRIED_ACTIVATEACTIVEXCONTROLS 23
#define IDM_TRIED_ACTIVATEAPPLETS 24
#define IDM_TRIED_ACTIVATEDTCS 25
#define IDM_TRIED_BACKCOLOR 26
#define IDM_TRIED_BLOCKFMT 27
#define IDM_TRIED_BOLD 28
#define IDM_TRIED_BROWSEMODE 29
#define IDM_TRIED_COPY 30
#define IDM_TRIED_CUT 31
#define IDM_TRIED_DELETE 32
#define IDM_TRIED_EDITMODE 33
#define IDM_TRIED_FIND 34
#define IDM_TRIED_FONT 35
#define IDM_TRIED_FONTNAME 36
#define IDM_TRIED_FONTSIZE 37
#define IDM_TRIED_FORECOLOR 38
#define IDM_TRIED_GETBLOCKFMTS 39
#define IDM_TRIED_HYPERLINK 40
#define IDM_TRIED_IMAGE 41
#define IDM_TRIED_INDENT 42
#define IDM_TRIED_ITALIC 43
#define IDM_TRIED_JUSTIFYCENTER 44
#define IDM_TRIED_JUSTIFYLEFT 45
#define IDM_TRIED_JUSTIFYRIGHT 46
#define IDM_TRIED_ORDERLIST 47
#define IDM_TRIED_OUTDENT 48
#define IDM_TRIED_PASTE 50
#define IDM_TRIED_PRINT 51
#define IDM_TRIED_REDO 52
#define IDM_TRIED_REMOVEFORMAT 53
#define IDM_TRIED_SELECTALL 54
#define IDM_TRIED_SHOWBORDERS 55
#define IDM_TRIED_SHOWDETAILS 56
#define IDM_TRIED_UNDERLINE 57
#define IDM_TRIED_UNDO 58
#define IDM_TRIED_UNLINK 59
#define IDM_TRIED_UNORDERLIST 60
#define IDM_TRIED_DOVERB 61
#define IDM_TRIED_LAST_CID IDM_TRIED_DOVERB
#define IDM_TRIED_IS_1D_ELEMENT 0
#define IDM_TRIED_IS_2D_ELEMENT 1
#define IDM_TRIED_SEND_TO_FRONT IDM_TRIED_BRING_TO_FRONT
#define IDM_TRIED_SEND_FORWARD IDM_TRIED_BRING_FORWARD
#define IDM_TRIED_SEND_BEHIND_1D IDM_TRIED_SEND_BELOW_TEXT
#define IDM_TRIED_SEND_FRONT_1D IDM_TRIED_BRING_ABOVE_TEXT
#define IDM_TRIED_SET_2D_DROP_MODE IDM_TRIED_ABSOLUTE_DROP_MODE
#endif
|
// This file is part of snark, a generic and flexible library
// for robotics research.
//
// Copyright (C) 2011 The University of Sydney
//
// snark 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.
//
// snark 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 snark. If not, see <http://www.gnu.org/licenses/>.
#ifndef SNARK_GRAPHICS_APPLICATIONS_VIEWPOINTS_COLOURED_H_
#define SNARK_GRAPHICS_APPLICATIONS_VIEWPOINTS_COLOURED_H_
#include <string>
#include <Qt3D/qcolor4ub.h>
#include "./PointWithId.h"
namespace snark { namespace graphics { namespace View {
struct coloured
{
virtual ~coloured() {}
virtual QColor4ub color( const Eigen::Vector3d& point
, comma::uint32 id
, double scalar
, const QColor4ub& c ) const = 0;
};
class Fixed : public coloured
{
public:
Fixed( const std::string& name );
QColor4ub color( const Eigen::Vector3d& point
, comma::uint32 id
, double scalar
, const QColor4ub& c ) const;
private:
QColor4ub m_color;
};
struct ByHeight : public coloured // todo: refactor and merge with byscalar
{
ByHeight( double from
, double to
, const QColor4ub& from_color = QColor4ub( 255, 0, 0 )
, const QColor4ub& to_color = QColor4ub( 0, 0, 255 )
, bool cyclic = false
, bool linear = true
, bool sharp = false );
double from, to, sum, diff, middle;
QColor4ub from_color, to_color, average_color;
bool cyclic, linear, sharp;
QColor4ub color( const Eigen::Vector3d& point
, comma::uint32 id
, double scalar
, const QColor4ub& c ) const;
};
struct ByScalar : public coloured
{
ByScalar( double from = 0
, double to = 1
, const QColor4ub& from_color = QColor4ub( 255, 0, 0 )
, const QColor4ub& to_color = QColor4ub( 0, 0, 255 ) );
double from, to, diff;
QColor4ub from_color;
QColor4ub to_color;
QColor4ub color( const Eigen::Vector3d& point
, comma::uint32 id
, double scalar
, const QColor4ub& c ) const;
};
class ById : public coloured
{
public:
ById( const QColor4ub& backgroundcolour );
ById( const QColor4ub& backgroundcolour
, double from
, double to );
QColor4ub color( const Eigen::Vector3d& point
, comma::uint32 id
, double scalar
, const QColor4ub& c ) const;
private:
const QColor4ub m_background;
bool m_hasScalar;
double m_from;
double m_diff;
};
struct ByRGB : public coloured
{
QColor4ub color( const Eigen::Vector3d& point
, comma::uint32 id
, double scalar
, const QColor4ub& c ) const;
};
coloured* colourFromString( const std::string& s, const std::string& fields, const QColor4ub& backgroundcolour );
} } } // namespace snark { namespace graphics { namespace View {
#endif /*SNARK_GRAPHICS_APPLICATIONS_VIEWPOINTS_COLOURED_H_*/
|
/*
* Copyright (C) 2019 Ondrej Starek
*
* This file is part of OTest2.
*
* OTest2 is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* OTest2 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with OTest2. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OTest2__LIB_TESTMARKHASH_H_
#define OTest2__LIB_TESTMARKHASH_H_
#include <cstdint>
#include <string>
#include <otest2/testmarkhashcode.h>
namespace OTest2 {
/**
* @brief A simple generator of a testmark hash
*
* This class computes a hash value for a test mark tree. It's an attempt
* to get a simple value to compare the whole subtree.
*
* The used FNV-1 function may be a wrong choice. However, I don't need
* a strong hash function - a collision will cause no problem, just printing
* of a false test-mark difference.
*/
class TestMarkHash {
private:
TestMarkHashCode hash;
public:
/**
* @brief Ctor
*/
TestMarkHash();
/**
* @brief Move ctor
*/
TestMarkHash(
TestMarkHash&& other_) noexcept;
/**
* @brief Dtor
*/
~TestMarkHash();
/* -- avoid copying */
TestMarkHash(
const TestMarkHash&) = delete;
TestMarkHash& operator =(
const TestMarkHash&) = delete;
/**
* @brief Append piece of data
*
* @param data_ Data
* @param size_ Length of data
*/
void addData(
const std::uint8_t* data_,
std::size_t size_);
/**
* @brief Append a terminataor character into the hash
*/
void addTerminator();
/**
* @brief Append a hash code of another testmark
*/
void addHashCode(
TestMarkHashCode code_);
/**
* @brief Append a string literal
*/
void addString(
const char* string_);
/**
* @brief Get currently computed hash code
*/
TestMarkHashCode getHashCode() const noexcept;
/**
* @brief Add hash for a value of a basic type
*
* @param type_name_ Name of the type
* @param data_ Binary form of data
* @param size_ Size of data
*/
void addBasicType(
const char* type_name_,
const std::uint8_t* data_,
std::size_t size_);
/**
* @brief Add hash for a string value of a basic type
*
* @param type_name_ Name of the type
* @param value_ The value
*/
void addBasicType(
const char* type_name_,
const std::string& value_);
template<typename Type_>
static TestMarkHashCode hashBasicType(
const char* type_name_,
Type_ value_) {
TestMarkHash hash_;
hash_.addBasicType(
type_name_,
reinterpret_cast<const std::uint8_t*>(&value_),
sizeof(value_));
return hash_.getHashCode();
}
static TestMarkHashCode hashBasicType(
const char* type_name_,
const std::string& value_);
};
} /* -- namespace OTest2 */
#endif /* OTest2__LIB_TESTMARKHASH_H_ */
|
/*
* Copyright (C): 2013-2014 Department of Software Engineering, University of Szeged
*
* Authors: David Tengeri <dtengeri@inf.u-szeged.hu>
*
* This file is part of SoDA.
*
* SoDA is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SoDA 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SoDA. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SPECIALIZATIONMETRIC_H
#define SPECIALIZATIONMETRIC_H
#include "engine/CKernel.h"
namespace soda {
class SpecializationMetric : public ITestSuiteMetricPlugin
{
public:
SpecializationMetric();
virtual ~SpecializationMetric();
/**
* @brief Returns the name of the plugin.
* @return
*/
std::string getName();
/**
* @brief Returns the description of the plugin.
* @return
*/
std::string getDescription();
/**
* @brief Initialize the plugin.
* @param data The test suite data.
* @param clusterList The clusters of test cases and code elements.
* @param revisionList The revisions to consider.
*/
void init(CSelectionData *data, std::map<std::string, CClusterDefinition> *clusterList, IndexType revision);
/**
* @brief Returns the list of plugins names that the plugin depens on.
* @return List of dependencies.
*/
std::vector<std::string> getDependency();
/**
* @brief Calculates the metrics of a test suite.
* @param output The path to the output directory.
* @param results Stores the results of the metric plugin for each cluster.
*/
void calculate(rapidjson::Document &results);
private:
CSelectionData *m_data;
std::map<std::string, CClusterDefinition> *m_clusterList;
IndexType m_revision;
};
} /* namespace soda */
#endif /* SPECIALIZATIONMETRIC_H */
|
/*
Copyright (c) 2006 Michael P. Thompson <mpthompson@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
$Id$
*/
#ifndef _OS_TIMER_H_
#define _OS_TIMER_H_ 1
#include "registers.h"
static inline void timer_set(uint16_t value)
{
// Set the timer to the specified value.
registers_write_word(REG_TIMER_HI, REG_TIMER_LO, value);
}
static inline uint16_t timer_get(void)
{
// Get the timer value.
return registers_read_word(REG_TIMER_HI, REG_TIMER_LO);
}
static inline uint16_t timer_delta(uint16_t time_stamp)
{
uint16_t delta_time;
// Get the current time.
uint16_t current_time = registers_read_word(REG_TIMER_HI, REG_TIMER_LO);
// Determine the time delta from the time stamp.
if (current_time > time_stamp)
delta_time = current_time - time_stamp;
else
delta_time = 0xffff - (time_stamp - current_time) + 1;
return delta_time;
}
static inline void timer_increment(void)
{
uint16_t value;
// Read the timer value.
value = registers_read_word(REG_TIMER_HI, REG_TIMER_LO);
// Increment the timer value.
++value;
// Write the increment timer value.
registers_write_word(REG_TIMER_HI, REG_TIMER_LO, value);
// increase communication timeout counter too
registers_write_byte(REG_COMM_TIMEOUT, registers_read_byte(REG_COMM_TIMEOUT) + 1);
}
#endif // _OS_TIMER_H_
|
/*!
Copyright (C) 2014, 申瑞珉 (Ruimin Shen)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser 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/>.
*/
#pragma once
#include "Optimizer.h"
namespace otl
{
namespace optimizer
{
template <typename _TSolutionSet>
class Metaheuristic : public Optimizer<typename _TSolutionSet::value_type::TReal, typename _TSolutionSet::value_type::TDecision>
{
public:
typedef _TSolutionSet TSolutionSet;
typedef typename TSolutionSet::value_type TSolution;
typedef typename TSolution::TReal TReal;
typedef typename TSolution::TDecision TDecision;
typedef Optimizer<TReal, TDecision> TSuper;
typedef typename TSuper::TProblem TProblem;
Metaheuristic(TProblem &problem);
virtual ~Metaheuristic(void);
const TSolutionSet &GetSolutionSet(void) const;
protected:
TSolutionSet solutionSet_;
};
template <typename _TSolutionSet>
Metaheuristic<_TSolutionSet>::Metaheuristic(TProblem &problem) : TSuper(problem)
{
}
template <typename _TSolutionSet>
Metaheuristic<_TSolutionSet>::~Metaheuristic(void)
{
}
template <typename _TSolutionSet>
const _TSolutionSet &Metaheuristic<_TSolutionSet>::GetSolutionSet(void) const
{
return solutionSet_;
}
}
}
|
/*
Copyright (C) 2007 <SWGEmu>
This File is part of Core3.
This program is free software; you can redistribute
it and/or modify it under the terms of the GNU Lesser
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 Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General
Public License along with this program; if not, write to
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Linking Engine3 statically or dynamically with other modules
is making a combined work based on Engine3.
Thus, the terms and conditions of the GNU Lesser General Public License
cover the whole combination.
In addition, as a special exception, the copyright holders of Engine3
give you permission to combine Engine3 program with free software
programs or libraries that are released under the GNU LGPL and with
code included in the standard release of Core3 under the GNU LGPL
license (or modified versions of such code, with unchanged license).
You may copy and distribute such a system following the terms of the
GNU LGPL for Engine3 and the licenses of the other code concerned,
provided that you include the source code of that other code when
and as the GNU LGPL requires distribution of source code.
Note that people who make modified versions of Engine3 are not obligated
to grant this special exception for their modified versions;
it is their choice whether to do so. The GNU Lesser General Public License
gives permission to release a modified version without this exception;
this exception also makes it possible to release a modified version
which carries forward this exception.
*/
#ifndef WIPEITEMSCOMMAND_H_
#define WIPEITEMSCOMMAND_H_
#include "server/zone/objects/scene/SceneObject.h"
class WipeItemsCommand : public QueueCommand {
public:
WipeItemsCommand(const String& name, ZoneProcessServer* server)
: QueueCommand(name, server)
{
}
int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments)
{
if (!checkStateMask(creature))
return INVALIDSTATE;
if (!checkInvalidLocomotions(creature))
return INVALIDLOCOMOTION;
try {
ManagedReference<SceneObject* > object =
server->getZoneServer()->getObject(target);
ManagedReference<CreatureObject*> player = NULL;
StringTokenizer args(arguments.toString());
if (object == NULL || !object->isPlayerCreature())
{
String firstName;
if (args.hasMoreTokens()) {
args.getStringToken(firstName);
player = server->getZoneServer()->getChatManager()->getPlayer(
firstName);
}
} else
{
player = cast<CreatureObject*>( object.get());
}
if (player == NULL) {
creature->sendSystemMessage("Invalid arguments for /wipeItems. Usage: /wipeItems playerName");
return GENERALERROR;
}
Locker clocker(player, creature);
SceneObject* inventory = player->getSlottedObject("inventory");
if (inventory == NULL)
return GENERALERROR;
while (inventory->getContainerObjectsSize() > 0)
{
ManagedReference<SceneObject*> object = inventory->getContainerObject(0);
object->destroyObjectFromWorld(true);
object->destroyObjectFromDatabase(true);
}
creature->sendSystemMessage(player->getFirstName() + "'s inventory has been wiped.");
}
catch (Exception& e)
{
creature->sendSystemMessage("Invalid arguments for /wipeItems. Usage: /wipeItems playerName");
}
return SUCCESS;
}
};
#endif //WIPEITEMSCOMMAND_H_
|
/****************************************************************************
* This file is part of Liri.
*
* Copyright (C) 2019 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
*
* $BEGIN_LICENSE:GPL3+$
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $END_LICENSE$
***************************************************************************/
#ifndef MOCKWLRLAYERSHELLV1_H
#define MOCKWLRLAYERSHELLV1_H
#include <QRect>
#include <QSize>
#include <QWindow>
#include "qwayland-wlr-layer-shell-unstable-v1.h"
class MockWlrLayerSurfaceV1;
class MockWlrLayerShellV1 : public QtWayland::zwlr_layer_shell_v1
{
public:
MockWlrLayerShellV1(struct ::wl_registry *registry, uint32_t name, uint32_t version);
MockWlrLayerSurfaceV1 *createSurface(struct ::wl_surface *surface, struct ::wl_output *output,
quint32 layer, const QString &namespace_);
};
class MockWlrLayerSurfaceV1 : public QtWayland::zwlr_layer_surface_v1
{
public:
MockWlrLayerSurfaceV1(struct ::zwlr_layer_surface_v1 *object);
~MockWlrLayerSurfaceV1();
QSize size() const;
protected:
void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override;
void zwlr_layer_surface_v1_closed() override;
private:
QSize m_size;
};
#endif // MOCKWLRLAYERSHELLV1_H
|
/*<copyright>
* <year>1998-2007</year>
* <holder>Ericsson AB, All Rights Reserved</holder>
*</copyright>
*<legalnotice>
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Initial Developer of the Original Code is Ericsson AB.
*</legalnotice>
*/
#include <ic.h>
int oe_ei_encode_term(CORBA_Environment *ev, void *t) {
int size = ev->_iout;
(int) ei_encode_term(NULL, &size, t);
if (size >= ev->_outbufsz) {
char *buf = ev->_outbuf;
int bufsz = ev->_outbufsz + ev->_memchunk;
while (size >= bufsz)
bufsz += ev->_memchunk;
if ((buf = realloc(buf, bufsz)) == NULL) {
CORBA_exc_set(ev, CORBA_SYSTEM_EXCEPTION, NO_MEMORY, "End of heap memory while encoding");
return -1; /* OUT OF MEMORY */
}
ev->_outbuf = buf;
ev->_outbufsz = bufsz;
}
return ei_encode_term(ev->_outbuf, &ev->_iout, t);
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DESCRIBELOCATIONOBJECTSTORAGERESPONSE_H
#define QTAWS_DESCRIBELOCATIONOBJECTSTORAGERESPONSE_H
#include "datasyncresponse.h"
#include "describelocationobjectstoragerequest.h"
namespace QtAws {
namespace DataSync {
class DescribeLocationObjectStorageResponsePrivate;
class QTAWSDATASYNC_EXPORT DescribeLocationObjectStorageResponse : public DataSyncResponse {
Q_OBJECT
public:
DescribeLocationObjectStorageResponse(const DescribeLocationObjectStorageRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DescribeLocationObjectStorageRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DescribeLocationObjectStorageResponse)
Q_DISABLE_COPY(DescribeLocationObjectStorageResponse)
};
} // namespace DataSync
} // namespace QtAws
#endif
|
/*
The zlib/libpng License
Copyright (c) 2018 Arthur Brainville
Copyright (c) 2015 Andrew Fenn
Copyright (c) 2005-2010 Phillip Castaneda (pjcast -- www.wreckedgames.com)
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 OIS_CocoaHelpers_H
#define OIS_CocoaHelpers_H
#include "OISEvents.h"
#include "OISKeyboard.h"
#include "OISMouse.h"
// This is needed for keeping an event stack for keyboard and mouse
namespace OIS
{
// used in the eventStack to store the type
enum Mac_EventType { MAC_KEYUP = 0,
MAC_KEYDOWN = 1,
MAC_KEYREPEAT,
MAC_MOUSEDOWN,
MAC_MOUSEUP,
MAC_MOUSEMOVED,
MAC_MOUSESCROLL };
typedef enum Mac_EventType MacEventType;
}
#endif
|
/*
* Copyright 2009,2010,2011 Reality Jockey, Ltd.
* info@rjdj.me
* http://rjdj.me/
*
* This file is part of ZenGarden.
*
* ZenGarden is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZenGarden 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenGarden. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _MESSAGE_LOG_H_
#define _MESSAGE_LOG_H_
#include "MessageObject.h"
/** [log] */
class MessageLog : public MessageObject {
public:
static MessageObject *newObject(PdMessage *initMessage, PdGraph *graph);
MessageLog(PdMessage *initMessage, PdGraph *graph);
~MessageLog();
static const char *getObjectLabel();
std::string toString();
private:
void processMessage(int inletIndex, PdMessage *message);
};
inline const char *MessageLog::getObjectLabel() {
return "log";
}
inline std::string MessageLog::toString() {
return MessageLog::getObjectLabel();
}
#endif // _MESSAGE_LOG_H_
|
/*
* Jaspersoft Mobile SDK
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
* http://community.jaspersoft.com/project/mobile-sdk-ios
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of Jaspersoft Mobile SDK for iOS.
*
* Jaspersoft Mobile SDK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Jaspersoft Mobile SDK 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Jaspersoft Mobile SDK for iOS. If not, see
* <http://www.gnu.org/licenses/lgpl>.
*/
//
// JSReportExecution.h
// Jaspersoft Corporation
//
#import "JSErrorDescriptor.h"
#import "JSExecutionStatus.h"
#import <Foundation/Foundation.h>
#import "JSObjectMappingsProtocol.h"
#import "JSExportExecutionResponse.h"
/**
Represents a report execution entity for convenient XML serialization process
@author Vlad Zavadskii vzavadskii@jaspersoft.com
@author Alexey Gubarev ogubarie@tibco.com
@since 1.7
*/
@interface JSReportExecutionResponse : NSObject <JSObjectMappingsProtocol>
@property (nonatomic, retain, nullable) NSNumber *totalPages;
@property (nonatomic, retain, nonnull) NSNumber *currentPage;
@property (nonatomic, retain, nonnull) NSString *reportURI;
@property (nonatomic, retain, nonnull) NSString *requestId;
@property (nonatomic, retain, nonnull) NSArray <JSExportExecutionResponse *> *exports;
@property (nonatomic, retain, nonnull) JSExecutionStatus *status;
@property (nonatomic, retain, nullable) JSErrorDescriptor *errorDescriptor;
@end
|
#ifndef FRAMEDCLOCK_H
#define FRAMEDCLOCK_H
#include <chrono>
#include <cmath>
namespace Clock {
struct Highres
{
typedef long long rep;
typedef std::nano period;
typedef std::chrono::duration<rep, period> duration;
typedef std::chrono::time_point<Highres> time_point;
static const bool is_steady = true;
static time_point now();
};
class Framed
{
public:
std::chrono::nanoseconds update();
// float getUPS() { return m_UPS; }
float getUPS() { return m_UPS; }
auto getLastUpdateTime() { return m_timeUpdate; }
private:
float m_UPS = 0;
Highres::time_point m_timeUpdate = Highres::now();
std::chrono::nanoseconds m_updateTime = std::chrono::nanoseconds(0);
};
class Timing
{
public:
Timing(const unsigned int updateRate);
bool update();
float getUPS()
{
return 1000000000.f / m_frameLength.count();
}
Highres::time_point lastUpdate() { return m_lastUpdate; }
private:
std::chrono::nanoseconds m_accumulator = std::chrono::nanoseconds(0);
std::chrono::nanoseconds m_timestep;
std::chrono::nanoseconds m_frameLength;
Highres::time_point m_lastCall, m_lastUpdate;
};
}
#endif // FRAMEDCLOCK_H
|
#pragma once
#ifdef _MSC_VER
#pragma warning(disable:4146)
#pragma warning(disable:4800)
#endif
#include <iostream>
#include <stddef.h>
#include "Common/Defines.h"
#include "Common/Exceptions.h"
#include "mpir/mpirxx.h"
#include "mpir/mpir.h"
namespace bOPRF {
typedef mpz_class bigint;
/**********************************
* Utility Functions *
**********************************/
inline int CEIL_LOG2(int x)
{
int result = 0;
x--;
while (x > 0)
{
result++;
x >>= 1;
}
return result;
}
inline int FLOOR_LOG2(int x)
{
int result = 0;
while (x > 1)
{
result++;
x >>= 1;
}
return result;
}
// ceil(n / k)
inline int DIV_CEIL(int n, int k)
{
return (n + k - 1) / k;
}
inline int gcd(const int x, const int y)
{
bigint xx = x;
return (int)mpz_gcd_ui(NULL, xx.get_mpz_t(), y);
}
inline bigint gcd(const bigint& x, const bigint& y)
{
bigint g;
mpz_gcd(g.get_mpz_t(), x.get_mpz_t(), y.get_mpz_t());
return g;
}
inline void invMod(bigint& ans, const bigint& x, const bigint& p)
{
mpz_invert(ans.get_mpz_t(), x.get_mpz_t(), p.get_mpz_t());
}
inline int numBits(const bigint& m)
{
return (int)mpz_sizeinbase(m.get_mpz_t(), 2);
}
inline int numBits(int m)
{
bigint te = m;
return (int)mpz_sizeinbase(te.get_mpz_t(), 2);
}
inline int numBytes(const bigint& m)
{
return (int)mpz_sizeinbase(m.get_mpz_t(), 256);
}
inline int probPrime(const bigint& x)
{
gmp_randstate_t rand_state;
gmp_randinit_default(rand_state);
int ans = mpz_probable_prime_p(x.get_mpz_t(), rand_state, 40, 0);
gmp_randclear(rand_state);
return ans;
}
inline void bigintFromBytes(bigint& x, u8* mData, int len)
{
mpz_import(x.get_mpz_t(), len, 1, sizeof(u8), 0, 0, mData);
}
inline void bytesFromBigint(u8* mData, const bigint& x, unsigned int len)
{
size_t ll;
mpz_export(mData, &ll, 1, sizeof(u8), 0, 0, x.get_mpz_t());
if (ll > len)
{
throw invalid_length();
}
for (unsigned int i = (unsigned int)ll; i < len; i++)
{
mData[i] = 0;
}
}
inline int isOdd(const bigint& x)
{
return mpz_odd_p(x.get_mpz_t());
}
bigint sqrRootMod(const bigint& x, const bigint& p);
bigint powerMod(const bigint& x, const bigint& e, const bigint& p);
// Assume e>=0
int powerMod(int x, int e, int p);
}
|
/**********************************
* solution_0058.h *
**********************************/
#pragma once
#include "solution.h"
class Solution0058 : public Solution {
protected:
virtual answer_t get_answer();
public:
Solution0058();
};
|
/*
* gucefCORE: GUCEF module providing O/S abstraction and generic solutions
* Copyright (C) 2002 - 2007. Dinand Vanvelzen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef GUCEF_CORE_CSYSCONSOLECLIENT_H
#define GUCEF_CORE_CSYSCONSOLECLIENT_H
/*-------------------------------------------------------------------------//
// //
// INCLUDES //
// //
//-------------------------------------------------------------------------*/
#ifndef GUCEF_CORE_MACROS_H
#include "gucefCORE_macros.h" /* often used gucef macros */
#define GUCEF_CORE_MACROS_H
#endif /* GUCEF_CORE_MACROS_H ? */
#ifndef GUCEF_CORE_ETYPES_H
#include "ETypes.h" /* simple types used */
#define GUCEF_CORE_ETYPES_H
#endif /* GUCEF_CORE_ETYPES_H ? */
/*-------------------------------------------------------------------------//
// //
// NAMESPACE //
// //
//-------------------------------------------------------------------------*/
namespace GUCEF {
namespace CORE {
/*-------------------------------------------------------------------------//
// //
// CLASSES //
// //
//-------------------------------------------------------------------------*/
/*
* Forward declaration of classes used.
*/
class CSysConsole;
class CISysConsoleCmdHandler;
/*-------------------------------------------------------------------------*/
/**
*
*/
class GUCEF_CORE_PUBLIC_CPP CSysConsoleClient
{
protected:
typedef std::vector< CString > TStringVector;
CSysConsoleClient( void );
CSysConsoleClient( const CSysConsoleClient& src );
virtual ~CSysConsoleClient();
CSysConsoleClient& operator=( const CSysConsoleClient& src );
bool RegisterCmd( const CString& path ,
const CString& command ,
const TStringVector& arglist ,
CISysConsoleCmdHandler* cmdhandler );
void UnregisterCmd( const CString& path ,
const CString& command );
virtual bool ProcessUserInput( const CString& userInput ,
TStringVector& resultdata );
void LeaveDir( void );
bool EnterDir( const CString& dirname );
bool JumpTo( const CString& path );
const CString& GetPath( void ) const;
bool Execute( const CString& funcname ,
const TStringVector& arglist ,
TStringVector& resultdata );
TStringVector GetDirList( void ) const;
TStringVector GetCmdList( void ) const;
virtual void OnReturnData( const TStringVector& data );
private:
friend class CSysConsole;
CString _path;
private:
CSysConsole* _system;
};
/*-------------------------------------------------------------------------//
// //
// NAMESPACE //
// //
//-------------------------------------------------------------------------*/
}; /* namespace CORE */
}; /* namespace GUCEF */
/*-------------------------------------------------------------------------*/
#endif /* GUCEF_CORE_CSYSCONSOLECLIENT_H */
/*-------------------------------------------------------------------------//
// //
// Info & Changes //
// //
//-------------------------------------------------------------------------//
- 22-05-2005 :
- Applied file layout standard
--------------------------------------------------------------------------*/
|
#include "rdft.h"
plan *fftwf_mkplan_rdft2(size_t size, const plan_adt *adt, rdft2apply apply)
{
plan_rdft2 *ego;
ego = (plan_rdft2 *) fftwf_mkplan(size, adt);
ego->apply = apply;
return &(ego->super);
}
|
/*
* DataLayer.h
* WhirlyGlobeLib
*
* Created by Steve Gifford on 2/1/11.
* Copyright 2011-2013 mousebird consulting
*
* 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 <math.h>
#import <Foundation/Foundation.h>
#import "Scene.h"
/// @cond
@class WhirlyKitLayerThread;
/// @endcond
/** A WhirlyGlobe Layer is just an objective C object that
responds to a certain protocol. All you have to do is
fill in the one routine. If you want to be called at
regular intervals, you need to schedule yourself in the
run loop provided with the thread.
Layers will do things like overlay data on the globe or
respond to user input.
Layers do not have to be particularly fast. At least not
as fast as they'd have to be in the main run loop.
*/
@protocol WhirlyKitLayer
/// This is called after the layer thread kicks off.
/// Open your files and such here and then insert yourself in the run loop
/// for further processing.
- (void)startWithThread:(WhirlyKitLayerThread *)layerThread scene:(WhirlyKit::Scene *)scene;
/// Called by the layer thread to shut a layer down.
/// Clean all your stuff out of the scenegraph and so forth.
- (void)shutdown;
@optional
/// Dump logging information out to the console
- (void)log;
@end
|
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2012 EMC Corp.
//
// @filename:
// CPhysicalLeftSemiHashJoin.h
//
// @doc:
// Left semi hash join operator
//---------------------------------------------------------------------------
#ifndef GPOPT_CPhysicalLeftSemiHashJoin_H
#define GPOPT_CPhysicalLeftSemiHashJoin_H
#include "gpos/base.h"
#include "gpopt/operators/CPhysicalHashJoin.h"
namespace gpopt
{
//---------------------------------------------------------------------------
// @class:
// CPhysicalLeftSemiHashJoin
//
// @doc:
// Left semi hash join operator
//
//---------------------------------------------------------------------------
class CPhysicalLeftSemiHashJoin : public CPhysicalHashJoin
{
private:
// private copy ctor
CPhysicalLeftSemiHashJoin(const CPhysicalLeftSemiHashJoin &);
public:
// ctor
CPhysicalLeftSemiHashJoin
(
IMemoryPool *pmp,
DrgPexpr *pdrgpexprOuterKeys,
DrgPexpr *pdrgpexprInnerKeys
);
// dtor
virtual
~CPhysicalLeftSemiHashJoin();
// ident accessors
virtual
EOperatorId Eopid() const
{
return EopPhysicalLeftSemiHashJoin;
}
// return a string for operator name
virtual
const CHAR *SzId() const
{
return "CPhysicalLeftSemiHashJoin";
}
// check if required columns are included in output columns
virtual
BOOL FProvidesReqdCols(CExpressionHandle &exprhdl, CColRefSet *pcrsRequired, ULONG ulOptReq) const;
// compute required partition propagation of the n-th child
virtual
CPartitionPropagationSpec *PppsRequired
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
CPartitionPropagationSpec *pppsRequired,
ULONG ulChildIndex,
DrgPdp *pdrgpdpCtxt,
ULONG ulOptReq
);
// conversion function
static
CPhysicalLeftSemiHashJoin *PopConvert
(
COperator *pop
)
{
GPOS_ASSERT(EopPhysicalLeftSemiHashJoin == pop->Eopid());
return dynamic_cast<CPhysicalLeftSemiHashJoin*>(pop);
}
}; // class CPhysicalLeftSemiHashJoin
}
#endif // !GPOPT_CPhysicalLeftSemiHashJoin_H
// EOF
|
/*
* Copyright 2021 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 GHOST_EXPERIMENTS_ROCKSDB_LATENCY_H_
#define GHOST_EXPERIMENTS_ROCKSDB_LATENCY_H_
#include "absl/time/clock.h"
#include "experiments/rocksdb/request.h"
namespace ghost_test {
namespace latency {
struct PrintOptions {
// If true, prints the results in human-readable form. Otherwise, prints the
// results in CSV form.
bool pretty;
// If true, prints the entire distribution.
bool distribution;
// If true, prints the latencies in units of nanoseconds. If false, prints the
// latencies in units of microseconds.
bool ns;
// The output stream to send the results to. We make 'os' a pointer rather
// than a reference since a reference cannot be reassigned.
std::ostream* os;
};
void Print(const std::vector<Request>& requests, absl::Duration runtime,
PrintOptions options);
// We put these in the header rather than in latency.cc since latency_test needs
// these in order to generate the correct number of dashes for the pretty print
// prefix.
constexpr size_t kStageLen = 28;
constexpr size_t kTotalRequestsLen = 18;
constexpr size_t kThroughputLen = 22;
constexpr size_t kResultLen = 12;
// Add 8 to the end to account for the space between each column in the results.
constexpr size_t kNumDashes =
kStageLen + kTotalRequestsLen + kThroughputLen + (6 * kResultLen) + 8;
} // namespace latency
} // namespace ghost_test
#endif // GHOST_EXPERIMENTS_ROCKSDB_LATENCY_H_
|
#pragma once
typedef double FlagType;
//ñòðóêòóðà äàííûõ ñòåê
struct Stack;
//ñîçäàíèå ñòåêà
Stack *createStack();
//äîáàâëåíèå ýëåìåíòà â ñòåê
void push(Stack *&stack, FlagType value);
//ïðîâåðêà ñòåêà íà ïóñòîòó
bool isEmpty(Stack *&stack);
//óäàëåíèå ýëåìåíòà èç ñòåêà
FlagType pop(Stack *&stack, bool &isEmptyStack);
//óäàëåíèå ñòåêà
void deleteStack(Stack *&stack);
//ïå÷àòü ñòåêà
void printStack(Stack *&stack); |
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "feedoperation.h"
namespace proton {
struct NoopOperation : FeedOperation {
NoopOperation() : FeedOperation(FeedOperation::NOOP) {}
NoopOperation(SerialNum serialNum);
virtual ~NoopOperation() {}
virtual void serialize(vespalib::nbostream &) const override {}
virtual void deserialize(vespalib::nbostream &,
const document::DocumentTypeRepo &) override {}
virtual vespalib::string toString() const override;
};
} // namespace proton
|
/* Return classification value corresponding to argument.
Copyright (C) 1997, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <math.h>
#include "math_private.h"
int
__fpclassify (double x)
{
u_int32_t hx, lx;
int retval = FP_NORMAL;
EXTRACT_WORDS (hx, lx, x);
lx |= hx & 0xfffff;
hx &= 0x7ff00000;
if ((hx | lx) == 0)
retval = FP_ZERO;
else if (hx == 0)
retval = FP_SUBNORMAL;
else if (hx == 0x7ff00000)
retval = lx != 0 ? FP_NAN : FP_INFINITE;
return retval;
}
libm_hidden_def (__fpclassify)
|
// 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.
// popen.h
//
// Mark Johnson, 14th Febuary 2005
//
//! An ipstream is an istream that reads from a popen command.
//! A izstream is an istream that reads from a (possibly) compressed file
#ifndef POPEN_H
#define POPEN_H
#include <cstdio>
#include <cstring>
#ifdef __clang__
#include "fdstream.h"
#else
#include <ext/stdio_filebuf.h>
#endif
#include <iostream>
#include <string>
//! ipstream_helper{} exists so that the various file buffers get created before the istream
//! gets created.
//
struct ipstream_helper {
FILE* stdio_fp;
#ifdef __clang__
boost::fdinbuf stdio_fb;
ipstream_helper(const char* command)
: stdio_fp(popen(command, "r")), stdio_fb(fileno(stdio_fp)) { }
#else
__gnu_cxx::stdio_filebuf<char> stdio_fb;
ipstream_helper(const char* command)
: stdio_fp(popen(command, "r")), stdio_fb(stdio_fp, std::ios_base::in) { }
#endif
~ipstream_helper() { pclose(stdio_fp); } // close the popen'd stream
}; // ipstream_helper{}
//! An ipstream inherits from an istream.
//! I really can't believe that this works, but it does.
//
struct ipstream : public ipstream_helper, public std::istream {
ipstream(const char* command) //!< shell command whose output is sent to the istream
: ipstream_helper(command), std::istream(&stdio_fb) { }
ipstream(const std::string& command) //!< shell command whose output is sent to the istream
: ipstream_helper(command.c_str()), std::istream(&stdio_fb) { }
}; // ipstream{}
//! izstream_helper{} exists to compute the command that ipstream has to execute
//! while izstream is being constructed.
//
struct izstream_helper {
std::string popen_command;
izstream_helper(const char* filename)
{
const char* filesuffix = strrchr(filename, '.');
if (filesuffix == NULL)
filesuffix = "";
popen_command = (strcasecmp(filesuffix, ".bz2")
? (strcasecmp(filesuffix, ".gz") ? "cat " : "gunzip -c ")
: "bzcat ");
popen_command += filename;
}
}; // izstream_helper{}
//! An izstream popen's a set of files, running them through zcat, bzcat or cat
//! depending on the suffix of the last file.
//
struct izstream : public izstream_helper, public ipstream {
izstream(const char* filename)
: izstream_helper(filename), ipstream(popen_command.c_str()) { }
}; // izstream{}
#endif // POPEN_H
|
#include "../src/linalg.h"
#include "../src/mem.h"
#include <assert.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define M 11
#define N 5
const float A[M * N] = {
0.75120f, -1.60768f, -0.39993f, 0.64517f, -0.11946f,
1.05911f, 1.07633f, 0.37630f, 1.29926f, 0.36433f,
0.05262f, -0.03317f, -0.71406f, 0.51052f, -0.13106f,
0.43550f, -0.95293f, -0.13295f, -0.90264f, -0.00450f,
0.45933f, -0.79411f, -0.59319f, -0.26540f, -0.92404f,
0.36340f, 0.83518f, 0.71027f, 0.87006f, -0.12123f,
1.04111f, -1.45347f, -1.01267f, -1.18121f, 0.24258f,
0.79377f, -1.46045f, 0.03335f, -1.99452f, -0.73553f,
0.44600f, -2.07440f, 0.47107f, 1.02838f, -0.16369f,
-0.35393f, 1.26356f, -0.91869f, 0.55792f, -0.11723f,
0.02603f, -1.10818f, 0.85291f, 0.16045f, 0.40942f,
};
const float U[M * N] = {
-0.28031f, 0.41322f, 0.34954f, -0.06638f, 0.03357f,
0.27951f, 0.33712f, 0.20785f, 0.72423f, 0.10907f,
0.02264f, 0.06977f, 0.39958f, -0.17323f, -0.01172f,
-0.28556f, -0.09634f, -0.03057f, 0.13056f, 0.13344f,
-0.22884f, -0.01907f, 0.34352f, -0.01519f, -0.58377f,
0.22669f, 0.22046f, -0.08254f, 0.38917f, -0.31535f,
-0.44717f, -0.14222f, 0.37297f, 0.24387f, 0.54053f,
-0.51652f, -0.30451f, -0.15696f, 0.36146f, -0.39174f,
-0.29500f, 0.65146f, -0.03221f, -0.21751f, -0.15453f,
0.27997f, -0.15046f, 0.46675f, -0.17688f, -0.04636f,
-0.15916f, 0.30414f, -0.40814f, -0.06017f, 0.23905f,
};
const float S[N] = {
4.66593f, 2.97433f, 2.03381f, 1.59874f, 1.19392f,
};
const float V[N * N] = {
-0.25092f, 0.22273f, 0.34012f, 0.87832f, 0.01758f,
0.84448f, -0.41684f, 0.06486f, 0.32318f, -0.06667f,
0.09420f, 0.31296f, -0.87532f, 0.29063f, -0.20623f,
0.44906f, 0.81841f, 0.29426f, -0.19175f, -0.07210f,
0.11560f, 0.09436f, -0.16535f, 0.05364f, 0.97340f,
};
static bool
almostequal (float a, float b)
{
return fabsf (a - b) < 0.001f;
}
static bool
almostequalabs (float a, float b)
{
return almostequal (fabsf (a), fabsf (b));
}
static void
printmatrix (const char *name, float *a, size_t m, size_t n)
{
size_t i;
size_t j;
puts (name);
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++)
printf ("%12.4f", a[i * n + j]);
putchar ('\n');
}
putchar ('\n');
}
int
main (void)
{
float *u;
float *s;
float *v;
size_t i;
size_t j;
svd_full (A, M, N, &u, &s, &v);
assert (u != NULL);
assert (s != NULL);
assert (v != NULL);
printmatrix ("u", u, M, N);
printmatrix ("s", s, 1, N);
printmatrix ("v", v, N, N);
for (j = 0; j < N; j++) {
assert (almostequalabs (S[j], s[j]));
for (i = 0; i < M; i++)
assert (almostequalabs (U[i * N + j], u[i * N + j]));
for (i = 0; i < N; i++)
assert (almostequalabs (V[i * N + j], v[i * N + j]));
}
mem_free (u);
mem_free (s);
mem_free (v);
return EXIT_SUCCESS;
}
|
//
// JZMemberModel.h
// guoxiaotong
//
// Created by zxc on 16/3/19.
// Copyright © 2016年 StenpChou. All rights reserved.
//
#import "BaseModel.h"
@interface JZMemberModel : BaseModel
@property (nonatomic, strong) NSNumber *parentId;
@property (nonatomic, strong) NSNumber *relationId;
@property (nonatomic, copy) NSString *parentName;
@property (nonatomic, copy) NSString *className;
@property (nonatomic, copy) NSString *relationName;
@property (nonatomic, strong) NSNumber *studentId;
@property (nonatomic, copy) NSString *studentName;
@property (nonatomic, copy) NSString *picPath;
@property (nonatomic, strong) NSNumber *classId;
@end
|
/*
* Generated by asn1c-0.9.22.1409 (http://lionet.info/asn1c)
* From ASN.1 module "SPNEGO"
* found in "spnego.asn1"
* `asn1c -fnative-types -fskeletons-copy -fcompound-names`
*/
#include "asn_internal.h"
#include "NegTokenInit.h"
static asn_TYPE_member_t asn_MBR_NegTokenInit_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct NegTokenInit, mechTypes),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_MechTypeList,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"mechTypes"
},
{ ATF_POINTER, 3, offsetof(struct NegTokenInit, reqFlags),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_ContextFlags,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"reqFlags"
},
{ ATF_POINTER, 2, offsetof(struct NegTokenInit, mechToken),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"mechToken"
},
{ ATF_POINTER, 1, offsetof(struct NegTokenInit, mechListMIC),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"mechListMIC"
},
};
static ber_tlv_tag_t asn_DEF_NegTokenInit_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_NegTokenInit_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* mechTypes at 15 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* reqFlags at 16 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* mechToken at 17 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* mechListMIC at 18 */
};
static asn_SEQUENCE_specifics_t asn_SPC_NegTokenInit_specs_1 = {
sizeof(struct NegTokenInit),
offsetof(struct NegTokenInit, _asn_ctx),
asn_MAP_NegTokenInit_tag2el_1,
4, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_NegTokenInit = {
"NegTokenInit",
"NegTokenInit",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
0, 0, /* No PER support, use "-gen-PER" to enable */
0, /* Use generic outmost tag fetcher */
asn_DEF_NegTokenInit_tags_1,
sizeof(asn_DEF_NegTokenInit_tags_1)
/sizeof(asn_DEF_NegTokenInit_tags_1[0]), /* 1 */
asn_DEF_NegTokenInit_tags_1, /* Same as above */
sizeof(asn_DEF_NegTokenInit_tags_1)
/sizeof(asn_DEF_NegTokenInit_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_NegTokenInit_1,
4, /* Elements count */
&asn_SPC_NegTokenInit_specs_1 /* Additional specs */
};
|
/* OTB patches: replace "f2c.h" by "otb_6S_f2c.h" */
/*#include "f2c.h"*/
#include "otb_6S_f2c.h"
#ifdef KR_headers
double atan();
double d_atan(x) doublereal *x;
#else
#undef abs
#include "math.h"
#ifdef __cplusplus
extern "C" {
#endif
double d_atan(doublereal *x)
#endif
{
return( atan(*x) );
}
#ifdef __cplusplus
}
#endif
|
//
// AUTLocalUserNotification.h
// Automatic
//
// Created by Eric Horacek on 9/24/15.
// Copyright © 2015 Automatic Labs. All rights reserved.
//
@import UserNotifications;
#import <AUTUserNotifications/AUTUserNotification.h>
NS_ASSUME_NONNULL_BEGIN
/// An abstract base class representing a notification that is presented to the
/// user locally via an AUTUserNotificationsViewModel.
@interface AUTLocalUserNotification : AUTUserNotification
/// When a notification request is created for the receiver, this method is
/// invoked to build its content.
///
/// The default implementation creates a notification with the category
/// identifier populated with the result of +[AUTUserNotification
/// systemCategoryIdentifier], and the userInfo populated with the information
/// necessary to restore the receiver upon receipt.
///
/// Subclasses are encouraged to override this method if they desire to
/// customize the notification content that is created from the receiver.
///
/// @return The notification content, or nil if one could not be created and
/// request creation should fail. Upon return from this method, a copy
/// of the content is made, so subsequent mutations are not respected.
- (nullable UNMutableNotificationContent *)createNotificationContent;
/// When a notification request is created for the receiver, this method is
/// invoked to build its trigger.
///
/// By default, returns a non-repeating UNTimeIntervalNotificationTrigger with
/// an interval 0.1 seconds from now (immediately).
///
/// @return The notification trigger, or nil if one could not be created and
/// request creation should fail.
- (nullable UNNotificationTrigger *)createNotificationTrigger;
/// When a notification request is created for the receiver, this method is
/// invoked to build its identifier.
///
/// Defaults to a string NSUUID, preventing previous instances of this class
/// from being cancelled when a new instance is scheduled.
///
/// Consumers should override this method to provide a unique identifier to
/// enable automatic cancellation behavior. From the UNNotificationRequest docs:
///
/// > If you use the same identifier when scheduling a new notification, the
/// > system removes the previously scheduled notification with that identifier
/// > and replaces it with the new one.
///
/// @return The notification identifier, or nil if one could not be created and
/// request creation should fail.
- (nullable NSString *)createNotificationIdentifier;
@end
NS_ASSUME_NONNULL_END
|
/**
******************************************************************************
* @file stm32f4xx_it.h
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
*
* COPYRIGHT(c) 2017 STMicroelectronics
*
* 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 name of STMicroelectronics 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.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void SysTick_Handler(void);
void TIM3_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#include <stdio.h>
int main()
{
int count = 0;
while (1)
{
printf("Target is running:%d\n", count);
count++;
sleep(10);
}
return 0;
}
|
#include "StdAfx.h"
#ifndef ACL_PREPARE_COMPILE
#include "stdlib/acl_define.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#ifdef ACL_BCB_COMPILER
#pragma hdrstop
#endif
#include "stdlib/acl_stdlib.h"
#include "net/acl_net.h"
#include "aio/acl_aio.h"
#endif
#include "../event/events_define.h" /* just for ACL_EVENTS_STYLE_IOCP define */
#include "aio.h"
#define WRITE_SAFE_ENABLE(x, callback) do { \
if (((x)->flag & ACL_AIO_FLAG_ISWR) == 0) { \
(x)->flag |= ACL_AIO_FLAG_ISWR; \
acl_event_enable_write((x)->aio->event, (x)->stream, \
(x)->timeout, callback, (x)); \
} \
} while (0)
#define WRITE_SAFE_DIABLE(x) do { \
if (((x)->flag & ACL_AIO_FLAG_ISWR) != 0) { \
(x)->flag &= ~ACL_AIO_FLAG_ISWR; \
acl_event_disable_write((x)->aio->event, (x)->stream); \
} \
} while (0)
#ifdef ACL_WINDOWS
static void __connect_notify_callback(int event_type, ACL_EVENT *event,
ACL_VSTREAM *stream, void *context);
static void ConnectTimer(int event_type acl_unused,
ACL_EVENT *event acl_unused, void *ctx)
{
ACL_ASTREAM *astream = (ACL_ASTREAM*) ctx;
if (astream->aio->event_mode != ACL_EVENT_WMSG)
acl_msg_fatal("event_mode(%d) != ACL_EVENT_WMSG(%d)",
astream->aio->event_mode, ACL_EVENT_WMSG);
__connect_notify_callback(ACL_EVENT_RW_TIMEOUT, NULL, NULL, ctx);
}
#endif
static void __connect_notify_callback(int event_type, ACL_EVENT *event,
ACL_VSTREAM *stream acl_unused, void *context)
{
const char *myname = "__connect_notify_callback";
ACL_ASTREAM *astream = (ACL_ASTREAM *) context;
int ret, err;
socklen_t errlen;
WRITE_SAFE_DIABLE(astream);
/* ÏÈÅжÏÊÇ·ñÊdz¬Ê±µ¼Ö·µ»Ø */
if ((event_type & ACL_EVENT_RW_TIMEOUT) != 0) {
if (aio_timeout_callback(astream) < 0)
acl_aio_iocp_close(astream);
else if (astream->flag & ACL_AIO_FLAG_IOCP_CLOSE)
/* ¸ÃÁ÷Õý´¦ÓÚIOÑӳٹرÕ״̬£¬ÒòΪ±¾´ÎдIOÒѾ³É¹¦Íê³É£¬
* ËùÒÔÐèÒªÍê³ÉÁ÷µÄIOÑӳٹرչý³Ì
*/
acl_aio_iocp_close(astream);
else
acl_event_enable_write(event, astream->stream,
astream->timeout, __connect_notify_callback,
astream);
return;
}
#ifdef ACL_WINDOWS
/* Èç¹ûÊÇ»ùÓÚ win32 ´°¿ÚÏûÏ¢µÄʼþÒýÇæÔòÐèҪȡÏû֮ǰÉèÖõij¬Ê±¶¨Ê±Æ÷ */
if (astream->aio->event_mode == ACL_EVENT_WMSG)
acl_aio_cancel_timer(astream->aio, ConnectTimer, astream);
#endif
if ((event_type & ACL_EVENT_XCPT) != 0) {
acl_aio_iocp_close(astream);
return;
}
errlen = sizeof(err);
ret = getsockopt(ACL_VSTREAM_SOCK(acl_aio_vstream(astream)),
SOL_SOCKET, SO_ERROR, (char *) &err, &errlen);
if (ret >= 0)
acl_set_error(err);
#if defined(ACL_SUNOS5)
/*
* Solaris 2.4's socket emulation doesn't allow you
* to determine the error from a failed non-blocking
* connect and just returns EPIPE. Create a fake
* error message for connect. -- fenner@parc.xerox.com
*/
if (ret < 0 && errno == EPIPE)
acl_set_error(ACL_ENOTCONN);
#endif
if (errno == 0 || errno == ACL_EISCONN)
event_type = ACL_EVENT_CONNECT;
else if ((event_type & ACL_EVENT_CONNECT) == 0)
event_type |= ACL_EVENT_XCPT;
if ((event_type & ACL_EVENT_XCPT) != 0) {
astream->flag |= ACL_AIO_FLAG_DEAD;
acl_aio_iocp_close(astream);
return;
}
if ((event_type & ACL_EVENT_CONNECT) == 0)
acl_msg_fatal("%s: unknown event: %d", myname, event_type);
/* ½«ÒýÓüÆÊý¼Ó1ÒÔ·ÀÖ¹ÔÚ connect_fn ÄÚ²¿µ÷ÓÃÁ˹رչý³Ì£¬connect_fn
* ¿Éͨ¹ý·µ»Ø-1£¬Ôڻص÷·µ»ØºóÕæÕý¹Ø±Õ
*/
astream->nrefer++;
if (astream->connect_handles) {
ACL_ITER iter;
ACL_FIFO connect_handles;
/* ±ØÐ뽫¸÷¸ö»Øµ÷¾ä±ú´Ó»Øµ÷¶ÓÁÐÖÐÒ»Ò»Ìá³öÖÃÈëÒ»¸öµ¥¶À¶ÓÁÐÖÐ,
* ÒòΪ ACL_AIO Ôڻص÷¹ý³ÌÖÐÓпÉÄÜ·¢ÉúǶÌ×£¬·ÀÖ¹±»Öظ´µ÷ÓÃ
*/
acl_fifo_init(&connect_handles);
acl_foreach_reverse(iter, astream->connect_handles) {
AIO_CONNECT_HOOK *handle = (AIO_CONNECT_HOOK*) iter.data;
if (handle->disable)
continue;
acl_fifo_push(&connect_handles, handle);
}
while (1) {
AIO_CONNECT_HOOK *handle = acl_fifo_pop(&connect_handles);
if (handle == NULL)
break;
ret = handle->callback(astream, handle->ctx);
if (ret == 0)
continue;
astream->nrefer--;
if (ret < 0 || astream->flag & ACL_AIO_FLAG_IOCP_CLOSE)
acl_aio_iocp_close(astream);
return;
}
}
astream->nrefer--;
if (ret < 0)
acl_aio_iocp_close(astream);
else if ((astream->flag & ACL_AIO_FLAG_IOCP_CLOSE))
/* ֮ǰ¸ÃÁ÷ÒѾ±»ÉèÖÃÁËIOÍê³ÉÑӳٹرձê־룬
* ÔòÔÙ´ÎÆô¶¯IOÍê³ÉÑӳٹرչý³Ì
*/
acl_aio_iocp_close(astream);
}
ACL_ASTREAM *acl_aio_connect(ACL_AIO *aio, const char *addr, int timeout)
{
const char *myname = "acl_aio_connect";
ACL_ASTREAM *astream;
ACL_VSTREAM *cstream;
if (aio == NULL || addr == NULL || *addr == 0)
acl_msg_fatal("%s: input invalid", myname);
#ifdef ACL_EVENTS_STYLE_IOCP
if (aio->event_mode == ACL_EVENT_KERNEL) {
ACL_SOCKET connfd = WSASocket(AF_INET, SOCK_STREAM,
IPPROTO_TCP, 0, 0, WSA_FLAG_OVERLAPPED);
cstream = acl_vstream_fdopen(connfd, ACL_VSTREAM_FLAG_RW,
aio->rbuf_size, timeout, ACL_VSTREAM_TYPE_SOCK);
acl_assert(cstream);
acl_vstream_set_peer(cstream, addr);
} else
#endif
cstream = acl_vstream_connect(addr, ACL_NON_BLOCKING,
0, 0, aio->rbuf_size);
if (cstream == NULL) {
acl_msg_error("%s: connect addr(%s) error", myname, addr);
return (NULL);
}
cstream->flag |= ACL_VSTREAM_FLAG_CONNECTING;
astream = acl_aio_open(aio, cstream);
if (astream == NULL)
acl_msg_fatal("%s: open astream error", myname);
#ifdef ACL_WINDOWS
if (timeout > 0 && aio->event_mode == ACL_EVENT_WMSG)
acl_aio_request_timer(aio, ConnectTimer, astream,
timeout * 1000000, 0);
#endif
astream->error = acl_last_error();
acl_aio_ctl(astream, ACL_AIO_CTL_TIMEOUT, timeout, ACL_AIO_CTL_END);
WRITE_SAFE_ENABLE(astream, __connect_notify_callback);
return astream;
}
|
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#ifndef DORIS_BE_RUNTIME_SORTER_H
#define DORIS_BE_RUNTIME_SORTER_H
#include "common/status.h"
namespace doris {
class RowBatch;
class RuntimeState;
// Interface to sort rows
// 1. create one sorter
// 2. add data need be sorted through 'add_batch'
// 3. call 'input_done' when all data were added.
// 4. call 'get_next' fetch data which is sorted.
class Sorter {
public:
virtual ~Sorter() {
}
virtual Status prepare(RuntimeState* state) {
return Status::OK();
}
// Add data to be sorted.
virtual Status add_batch(RowBatch* batch) {
return Status::OK();
}
// call when all data be added
virtual Status input_done() = 0;
// fetch data already sorted,
// client must insure that call this function AFTER call input_done
virtual Status get_next(RowBatch* batch, bool* eos) = 0;
virtual Status close(RuntimeState* state) {
return Status::OK();
}
};
}
#endif
|
/*
* Copyright 2018 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.
*/
#define _GNU_SOURCE
#include <sched.h>
#include <err.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <stdint.h>
#include <signal.h>
#include "util.h"
void get_socketpair(int sv[]) {
check(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sv), "socketpair");
make_cloexec(sv[0]);
make_cloexec(sv[1]);
}
const char * const LIBRARY_PATHS[] = {
"/lib/x86_64-linux-gnu",
"/usr/lib/x86_64-linux-gnu",
};
int open_library(const char * const file) {
for (int i = 0; i < sizeof(LIBRARY_PATHS)/sizeof(LIBRARY_PATHS[0]); i++) {
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/%s", LIBRARY_PATHS[i], file);
int fd = open(buf, O_RDONLY | O_CLOEXEC);
if (fd >= 0) {
return fd;
}
}
return -1;
}
int file_broker() {
int sv[2] = {0};
get_socketpair(sv);
if (check(fork(), "fork(file_broker)") != 0) {
check(close(sv[0]), "close(file_broker_fd[0])");
return sv[1];
}
check(close(sv[1]), "close(file_broker_fd[1])");
int fd = sv[0];
while (1) {
char buf[PATH_MAX] = "";
if (recv_str(fd, buf, sizeof(buf)) == 0) {
exit(0);
}
if (strchr(buf, '/')) {
err(1, "slash in library");
}
int lib = open_library(buf);
if (lib < 0) {
err(1, "could not find library %s\n", buf);
}
send_fd(fd, lib);
}
}
void setgroups() {
int fd = check(open("/proc/self/setgroups", O_WRONLY), "open(setgroups)");
if (write(fd, "deny", 5) != 5) {
err(1, "write(setgroups)");
}
check(close(fd), "close(setgroups)");
}
void write_ugidmap(const char * const path, int ugid) {
int fd = check(open(path, O_WRONLY), "open(ugidmap)");
char buf[1024] = "";
snprintf(buf, sizeof(buf), "%d %d 1", ugid, ugid);
size_t len = strlen(buf)+1;
if (write(fd, buf, len) != len) {
err(1, "write(ugidmap)");
}
check(close(fd), "close(ugidmap)");
}
void setup_namespaces() {
int uid = getuid();
int gid = getgid();
check(unshare(CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWNET | CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWCGROUP), "unshare");
if (check(fork(), "fork(namespace setup)") != 0) {
exit(0);
}
setgroups();
write_ugidmap("/proc/self/uid_map", uid);
write_ugidmap("/proc/self/gid_map", gid);
}
void setup_chroot() {
check(mount("", "/tmp", "tmpfs", 0, ""), "mount(/tmp)");
check(mkdir("/tmp/lib", 0700), "mkdir(/lib)");
check(mkdir("/tmp/lib64", 0700), "mkdir(/lib64)");
check(mkdir("/tmp/proc", 0700), "mkdir(/proc)");
check(mount("", "/tmp/proc", "proc", 0, ""), "mount(/proc)");
copy_file(LD_PATH, "/tmp" LD_PATH);
check(symlink(LD_PATH, "/tmp/lib/ld-linux-x86-64.so.2"), "symlink(ld)");
check(syscall(SYS_pivot_root, "/tmp", "/tmp"), "pivot_root");
check(umount2("/", MNT_DETACH), "umount(/)");
check(chdir("/"), "chdir(/)");
}
int read_binary() {
int fd = check(syscall(SYS_memfd_create, "", MFD_CLOEXEC), "memfd_create");
puts("please send me a 64 bit binary to run. Format: len as uint32 LE || data");
uint32_t len = 0;
readn(STDIN_FILENO, &len, sizeof(len));
printf("reading 0x%x bytes\n", len);
copy_fd_len(STDIN_FILENO, fd, len);
return fd;
}
int sandbox(int broker_fd, int *sandbox_pid) {
int sv[2] = {0};
get_socketpair(sv);
if ((*sandbox_pid = check(fork(), "fork(sandbox)")) != 0) {
check(close(sv[0]), "close(sandbox_fd[0])");
check(close(broker_fd), "close(broker_fd)");
return sv[1];
}
check(close(sv[1]), "close(sandbox_fd[1])");
int fd = sv[0];
for (int i = 3; i < 1024; ++i){
if (i == broker_fd || i == fd) {
continue;
}
close(i);
}
setup_namespaces();
int init_fd = check(open("init", O_RDONLY | O_CLOEXEC), "open(init)");
setup_chroot();
load_libraries(broker_fd, init_fd);
check(dup2(fd, SANDBOX_FD), "dup2(sandbox_fd)");
check(dup2(broker_fd, BROKER_FD), "dup2(broker_fd)");
check(close(fd), "close(old sandbox_fd)");
check(close(broker_fd), "close(old broker_fd)");
char * const argv[] = {"init", NULL};
syscall(SYS_execveat, init_fd, "", argv, NULL, AT_EMPTY_PATH);
err(1, "execveat(init)");
}
int main(int argc, char *argv[]) {
setbuf(stdin, NULL);
setbuf(stdout, NULL);
setbuf(stderr, NULL);
int broker_fd = file_broker();
int sandbox_pid = 0;
int sandbox_fd = sandbox(broker_fd, &sandbox_pid);
puts("sandbox initialized");
while (1) {
char msg[128] = "";
int bin_fd = read_binary();
send_fd(sandbox_fd, bin_fd);
recv_str(sandbox_fd, msg, sizeof(msg));
if (strcmp(msg, "OK")) {
kill(sandbox_pid, SIGKILL);
err(1, "sandboxee msg: %s", msg);
}
}
return 0;
}
|
/*
* Copyright (c) 2016 jKool, LLC. All Rights Reserved.
*
* This software is the confidential and proprietary information of
* jKool, LLC. ("Confidential Information"). You shall not disclose
* such Confidential Information and shall use it only in accordance with
* the terms of the license agreement you entered into with jKool, LLC.
*
* JKOOL MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
* THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
* THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. JKOOL SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
* CopyrightVersion 1.0
*
*/
#import <UIKit/UIKit.h>
#import <SocketRocket/SRWebSocket.h>
#import "jKoolWebsocketCallbackHandler.h"
@interface jKoolWebsocketClient : NSObject
@property NSString *token;
@property NSString *subId;
@property NSString *subscribeUrl;
@property jKoolWebsocketCallbackHandler *sendResponse;
- (void)subscribe:(NSString *)jkQuery withMaxRows:(int) maxRows withToken:(NSString *) token withSubId:(NSString *) subId forHandler:(NSObject *) handler;
- (void)unsubscribe;
@end
|
#ifndef MPOSITION_H
#define MPOSITION_H
/**
* @package 3dogs
* @file MPosition.h
* @brief Veraenderung der Perspektive
* @author Rolf Hemmerling <hemmerling@gmx.net>
* @version 1.00,
* Entwicklungswerkzeug "Dev-C ++ 4.9.9.1",
* mit GNU-C/C++ Compiler "MinGW 3.3.1"
* @date 2015-01-01
* @copyright Apache License, Version 2.0
*
* modell/objects/MPosition.h -
* Veraenderung der Perspektive
*
* Copyright 2004-2015 Rolf Hemmerling
*
* 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.
*
* Haupt-Entwicklungszeit: 2004-03-01 - 2004-06-17
*/
#include "mtranslation1.h"
/**
* @class MPosition
* @brief Veraenderung der Z-Koordinate
* eines Objekts vom Typ ZTranslation
*/
class MPosition: public ZCmd {
public:
/**
* @fn MPosition
* @brief Konstruktur
*/
MPosition(void);
/**
* @fn MPosition(MTranslation1 *command)
* @brief Konstruktur mit Uebergabe des zu registrierenden
* Kommandos, das spaeter ausgefuehrt werden soll
* @param command
*/
MPosition(MTranslation1 *command);
/**
* @fn ~MPosition
* @brief Dekonstruktur
*/
~MPosition(void);
/**
* @fn display(OpenGL &aOpenGL)
* @brief Ausfuehren in OpenGL
* @param aOpenGL
*/
virtual void display(OpenGL &aOpenGL);
/**
* @fn update(ZCmd *aCommand)
* @brief Berechnungen durchfuehren
* @param aCommand
*/
virtual void update(ZCmd *aCommand);
protected:
/**
* @var command
* @brief Kommando, dessen Parameter geaendert
* werden sollen
*/
MTranslation1 *command;
};
#endif // MPOSITION_H
|
//
// RankNormalCell.h
// TRProject
//
// Created by RAYMOND on 2016/12/20.
// Copyright © 2016年 Tedu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RankNormalCell : UITableViewCell
@property (nonatomic) UILabel *numberLabel;
@property (nonatomic) UIImageView *iconImageView;
@property (nonatomic) UILabel *nameLabel;
@property (nonatomic) UILabel *spendSumPriceLabel;
@end
|
// UGLineSymParam.h:
#ifndef UG_LINESYMPARAM_H
#define UG_LINESYMPARAM_H
#include "Graphics/UGGraphics.h"
namespace UGC
{
class UGLineSymbolBase;
class UGMarkerSymbolLib;
class UGPen;
class UGBrush;
class UGFont;
/** ÏßÐ͵ÄÏÔʾ²ÎÊý£¬ÆäÖаüÀ¨·ç¸ñÉèÖòÎÊý(ÑÕÉ«¡¢Ïß¿í¡¢Ëõ·ÅÂÊ)
@remarks
´ÓÍⲿ¿ÉÒÔ¶ÔÏßÐͽøÐÐһЩ·ç¸ñÉèÖ㬰üÀ¨£º
1. ÏßÐÍÑÕÉ«£»
2. ÏßÐÍ¿í¶È£»
3. Ëõ·Å±ÈÀý£»
»ùÏß»æÖÆÊ±£¬¸ù¾ÝÕâЩ·ç¸ñ²ÎÊýÀ´½øÐд´½¨ÏàÓ¦µÄ»±Ê½øÐлæÖÆ£»
×¢£ºÈç¹ûÏßÐÍÄÚ²¿ÒѾ¹Ì¶¨ÁËÑÕÉ«»ò¿í¶È£¬
ÔÚ»æÖÆÊ±£¬¾ÍʹÓÃÄÚ²¿¹Ì¶¨µÄÑÕɫֵ»ò¹Ì¶¨µÄ¿í¶ÈÖµ;
¾Í²»²ÉÓÃÕâЩÍⲿÉèÖõÄÑÕÉ«»ò¿í¶È£»
*/
class SYMBOL_API UGLineSymParam
{
public:
//! »ùÏß»æÖƹý³ÌÖУ¬ÒªÊ¹Óõ½µÄGDI¶ÔÏó
struct UGGraphicsObjects
{
UGGraphicsObjects();
~UGGraphicsObjects();
void NewPen();
void NewBrush();
void NewFont();
UGPen* m_pOldPen;
UGBrush* m_pOldBrush;
UGFont* m_pOldFont;
//! UGCµÄÐéÄâÒýÇæ´´½¨(new)³öGDI¶ÔÏó£¬Ê¹ÓúóÐèÒª×Ô¼ºÀ´ÊÍ·Å
UGPen* m_pNewPen;
UGBrush* m_pNewBrush;
UGFont* m_pNewFont;
UGint m_nOldTxtAlign;
UGint m_nOldBkMode;
UGColor m_nOldTxtClr;
};
public:
UGLineSymParam();
~UGLineSymParam();
public:
void SetDefaultPen(UGPen* pDefaultPen);
UGPen* GetDefaultPen() const;
void SetPenWidth(UGint nPenWidth);
UGint GetPenWidth() const;
void SetPenColor(UGColor color);
UGColor GetPenColor() const;
void SetScale(UGdouble dScale);
UGdouble GetScale() const;
void SetHighlight(UGbool bHighlight = true);
UGbool IsHighlight() const;
UGPoints& GetPointsBuffer();
UGMarkerSymbolLib* GetMarkerSymbolLib() const;
void SetMarkerSymbolLib(UGMarkerSymbolLib *pMarkerSymLib);
//! \brief ÊÇ·ñÐèÒªÖØÐ²ÉÑù£¬Ö÷ÒªÓÃÓÚ»æÖÆÏßÐ͵Äʱºò
UGbool IsNeedSampling();
void SetNeedSampling(UGbool bNeedSampling);
UGGraphicsObjects& GetGraphicsObject();
void Release();
UGint m_nCrossroadIndex;
protected:
//! ȱʡ»±Ê(ÓÉÍⲿ´´½¨ºÃ´«µÝ½øÀ´µÄ)
UGPen* m_pDefaultPen;
//! Íⲿ¶ÔÏßÐÍÉèÖõÄÏßÑÕÉ«
UGColor m_PenClr;
//! Íⲿ¶ÔÏßÐÍÉèÖõÄÏß¿í¶È
UGint m_nPenWidth;
//! ÏßÐÍ·ûºÅËõ·ÅµÄ±ÈÀý
UGdouble m_dScale;
//! ÊÇ·ñÊǸßÁÁÏÔʾ
UGbool m_bHighlight;
//! »æÖÆÏßÐÍʱ£¬ÊÇ·ñÒª¶ÔÕÛÏß¶¥µãÊý¾Ý½øÐÐÖØ²ÉÑù
UGbool m_bNeedSampling;
//! Äڴ滺³åÇø£¬±»ÓÃÓÚÏßÐÍÏÔʾʱÁÙʱ»º´æÊ¹ÓÃ
UGPoints m_PointBuf;
//! µã·ûºÅ¿â£¬½öÓÃÓÚÏßÐ͵ÄÀ©Õ¹·ûºÅÖеÄ×Ô¶¨Òåtoken(×Ô¶¨ÒåtokenʹÓÃÒ»¸öµã·ûºÅÀ´»æÖÆ)
UGMarkerSymbolLib* m_pMarkerSymLib;
//! ÓÃÓÚÏßÐÍ·ûºÅµÄ»ùÏß»æÖƹý³ÌÖмǼд´½¨GDI¶ÔÏóºÍgraphicsÑ¡ÈëжÔÏóǰµÄÔÀ´µÄold¶ÔÏó
//! ¾²Ì¬³ÉÔ±±äÁ¿£¬Õû¸ö³ÌÐòÖй²ÏíÒ»·Ý¾Í¹»ÁË
//modified by xielin 2007-12-27 ÏÖÔÚÒªÖ§³Ö¶àỊ̈߳¬È«¾Ö¾Í²»ÐÐÁË£¬¸Äµô
UGLineSymParam::UGGraphicsObjects ms_GObjects;
};
}
#endif
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/apprunner/AppRunner_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace AppRunner
{
namespace Model
{
enum class Runtime
{
NOT_SET,
PYTHON_3,
NODEJS_12
};
namespace RuntimeMapper
{
AWS_APPRUNNER_API Runtime GetRuntimeForName(const Aws::String& name);
AWS_APPRUNNER_API Aws::String GetNameForRuntime(Runtime value);
} // namespace RuntimeMapper
} // namespace Model
} // namespace AppRunner
} // namespace Aws
|
//
// SleepingState.h
//
//
// Created by GameRisker on 2/21/16.
//
//
#import "State.h"
#import "Work.h"
#import <Foundation/Foundation.h>
@interface SleepingState : NSObject <State>
@end
|
/**
* MemoryInfo.h
*
* Copyright(c) Live2D Inc. All rights reserved.
* [[ CONFIDENTIAL ]]
*/
#pragma once
#ifndef __SKIP_DOC__
#include "../../Live2D.h"
//--------- LIVE2D NAMESPACE ------------
namespace live2d
{
class AMemoryHolder ;
#ifndef NULL
# define NULL 0
#endif
//******************************************************
class MemoryInfo
{
friend class UtMemory ;
friend class MemoryInfoSet ;
public:
MemoryInfo(void);
~MemoryInfo(void);
void dump(const char* message , l2d_size_t cur , l2d_size_t peak) ;
#ifdef L2D_DEBUG
const char* getFileName( const char* path ) ;
#endif
private:
int index ;
void* ptr ;
l2d_size_t size ;
const char* fileName ;
int lineNo ;
AMemoryHolder* allocator ;
MemoryInfo* next ;
};
}
//--------- LIVE2D NAMESPACE ------------
#endif // __SKIP_DOC__
|
//
// SDCycleScrollView.h
// SDCycleScrollView
//
// Created by aier on 15-3-22.
// Copyright (c) 2015年 GSD. All rights reserved.
//
/**
*******************************************************
* *
* 感谢您的支持, 如果下载的代码在使用过程中出现BUG或者其他问题 *
* 您可以发邮件到gsdios@126.com 或者 到 *
* https://github.com/gsdios?tab=repositories 提交问题 *
* *
*******************************************************
*/
#import <UIKit/UIKit.h>
typedef enum {
SDCycleScrollViewPageContolAlimentRight,
SDCycleScrollViewPageContolAlimentCenter
} SDCycleScrollViewPageContolAliment;
typedef enum {
SDCycleScrollViewPageContolStyleClassic, // 系统自带经典样式
SDCycleScrollViewPageContolStyleAnimated, // 动画效果pagecontrol
SDCycleScrollViewPageContolStyleNone // 不显示pagecontrol
} SDCycleScrollViewPageContolStyle;
@class SDCycleScrollView;
@protocol SDCycleScrollViewDelegate <NSObject>
@optional
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index;
@end
@interface SDCycleScrollView : UIView
// >>>>>>>>>>>>>>>>>>>>>>>>>> 数据源接口
// 本地图片数组
@property (nonatomic, strong) NSArray *localizationImagesGroup;
// 网络图片 url string 数组
@property (nonatomic, strong) NSArray *imageURLStringsGroup;
// 每张图片对应要显示的文字数组
@property (nonatomic, strong) NSArray *titlesGroup;
// >>>>>>>>>>>>>>>>>>>>>>>>> 滚动控制接口
// 自动滚动间隔时间,默认2s
@property (nonatomic, assign) CGFloat autoScrollTimeInterval;
// 是否无限循环,默认Yes
@property(nonatomic,assign) BOOL infiniteLoop;
// 是否自动滚动,默认Yes
@property(nonatomic,assign) BOOL autoScroll;
@property (nonatomic, weak) id<SDCycleScrollViewDelegate> delegate;
// >>>>>>>>>>>>>>>>>>>>>>>>> 自定义样式接口
// 是否显示分页控件
@property (nonatomic, assign) BOOL showPageControl;
// pagecontrol 样式,默认为动画样式
@property (nonatomic, assign) SDCycleScrollViewPageContolStyle pageControlStyle;
// 占位图,用于网络未加载到图片时
@property (nonatomic, strong) UIImage *placeholderImage;
// 分页控件位置
@property (nonatomic, assign) SDCycleScrollViewPageContolAliment pageControlAliment;
// 分页控件小圆标大小
@property (nonatomic, assign) CGSize pageControlDotSize;
// 分页控件小圆标颜色
@property (nonatomic, strong) UIColor *dotColor;
@property (nonatomic, strong) UIColor *titleLabelTextColor;
@property (nonatomic, strong) UIFont *titleLabelTextFont;
@property (nonatomic, strong) UIColor *titleLabelBackgroundColor;
@property (nonatomic, assign) CGFloat titleLabelHeight;
// >>>>>>>>>>>>>>>>>>>>>>>>> 清除缓存接口
- (void)clearCache;
+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imagesGroup:(NSArray *)imagesGroup;
+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageURLStringsGroup:(NSArray *)imageURLStringsGroup;
@end
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/imagebuilder/Imagebuilder_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/imagebuilder/model/ImagePipeline.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace imagebuilder
{
namespace Model
{
class AWS_IMAGEBUILDER_API GetImagePipelineResult
{
public:
GetImagePipelineResult();
GetImagePipelineResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetImagePipelineResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline const Aws::String& GetRequestId() const{ return m_requestId; }
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline void SetRequestId(const Aws::String& value) { m_requestId = value; }
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline void SetRequestId(Aws::String&& value) { m_requestId = std::move(value); }
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline void SetRequestId(const char* value) { m_requestId.assign(value); }
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline GetImagePipelineResult& WithRequestId(const Aws::String& value) { SetRequestId(value); return *this;}
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline GetImagePipelineResult& WithRequestId(Aws::String&& value) { SetRequestId(std::move(value)); return *this;}
/**
* <p>The request ID that uniquely identifies this request. </p>
*/
inline GetImagePipelineResult& WithRequestId(const char* value) { SetRequestId(value); return *this;}
/**
* <p>The image pipeline object. </p>
*/
inline const ImagePipeline& GetImagePipeline() const{ return m_imagePipeline; }
/**
* <p>The image pipeline object. </p>
*/
inline void SetImagePipeline(const ImagePipeline& value) { m_imagePipeline = value; }
/**
* <p>The image pipeline object. </p>
*/
inline void SetImagePipeline(ImagePipeline&& value) { m_imagePipeline = std::move(value); }
/**
* <p>The image pipeline object. </p>
*/
inline GetImagePipelineResult& WithImagePipeline(const ImagePipeline& value) { SetImagePipeline(value); return *this;}
/**
* <p>The image pipeline object. </p>
*/
inline GetImagePipelineResult& WithImagePipeline(ImagePipeline&& value) { SetImagePipeline(std::move(value)); return *this;}
private:
Aws::String m_requestId;
ImagePipeline m_imagePipeline;
};
} // namespace Model
} // namespace imagebuilder
} // namespace Aws
|
/*
* Copyright 2014-2020 Real Logic Limited.
*
* 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
*
* https://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 AERON_BITUTIL_H
#define AERON_BITUTIL_H
#include <assert.h>
#include <stdint.h>
#include <stddef.h>
#include "util/aeron_platform.h"
#if defined(_MSC_VER)
#include <intrin.h>
#pragma intrinsic(_BitScanForward)
#pragma intrinsic(_BitScanReverse)
#if defined(AERON_CPU_X64)
#pragma intrinsic(_BitScanForward64)
#endif
#endif
#define AERON_CACHE_LINE_LENGTH (64u)
#define AERON_ALIGN(value, alignment) (((value) + ((alignment) - 1u)) & ~((alignment) - 1u))
#define AERON_IS_POWER_OF_TWO(value) ((value) > 0 && (((value) & (~(value) + 1u)) == (value)))
#define AERON_MIN(a, b) ((a) < (b) ? (a) : (b))
#if defined(__GNUC__)
#define AERON_C_COND_EXPECT(exp, c) (__builtin_expect((exp), c))
#else
#define AERON_C_COND_EXPECT(exp, c) (exp)
#endif
inline uint8_t *aeron_cache_line_align_buffer(uint8_t *buffer)
{
size_t remainder = ((size_t)buffer) % AERON_CACHE_LINE_LENGTH;
return 0 == remainder ? buffer : (buffer + (AERON_CACHE_LINE_LENGTH - remainder));
}
/* Taken from Hacker's Delight as ntz10 at http://www.hackersdelight.org/hdcodetxt/ntz.c.txt */
inline int aeron_number_of_trailing_zeroes(int32_t value)
{
#if defined(__GNUC__)
if (0 == value)
{
return 32;
}
return __builtin_ctz(value);
#elif defined(_MSC_VER)
unsigned long r;
if (_BitScanForward(&r, (unsigned long)value))
{
return (int)r;
}
return 32;
#else
char table[32] =
{
0, 1, 2, 24, 3, 19, 6, 25,
22, 4, 20, 10, 16, 7, 12, 26,
31, 23, 18, 5, 21, 9, 15, 11,
30, 17, 8, 14, 29, 13, 28, 27
};
if (value == 0)
{
return 32;
}
uint32_t index = (uint32_t)((value & -value) * 0x04D7651F);
return table[index >> 27u];
#endif
}
inline int aeron_number_of_trailing_zeroes_u64(uint64_t value)
{
#if defined(__GNUC__)
if (0 == value)
{
return 64;
}
return __builtin_ctzll(value);
#elif defined(_MSC_VER) && defined(AERON_CPU_X64)
unsigned long r;
if (_BitScanForward64(&r, (__int64)value))
{
return (int)r;
}
return 64;
#else
int lower_tzc = aeron_number_of_trailing_zeroes((int32_t) (value & UINT64_C(0xFFFFFFFF)));
int upper_tzc = aeron_number_of_trailing_zeroes((int32_t) ((value >> 32u) & UINT64_C(0xFFFFFFFF)));
return lower_tzc == 32 ? upper_tzc + lower_tzc : lower_tzc;
#endif
}
inline int aeron_number_of_leading_zeroes(int32_t value)
{
#if defined(__GNUC__)
if (0 == value)
{
return 32;
}
return __builtin_clz(value);
#elif defined(_MSC_VER)
unsigned long r;
if (_BitScanReverse(&r, (unsigned long)value))
{
return 31 - (int)r;
}
return 32;
#else
#error "do not understand how to clz"
#endif
}
inline int32_t aeron_find_next_power_of_two(int32_t value)
{
value--;
/*
* Set all bits below the leading one using binary expansion
* http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
*/
for (size_t i = 1; i < sizeof(value) * 8; i = i * 2)
{
value |= (value >> i);
}
return value + 1;
}
int32_t aeron_randomised_int32();
#endif //AERON_BITUTIL_H
|
/*
* Copyright (c) 2010 Yahoo! Inc. 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. See accompanying
* LICENSE file.
*
* $Id$
*/
#ifndef _CL_CLSTRING_H_
#define _CL_CLSTRING_H_
namespace clusterlib {
/**
* All user available static string variables are declared here.
*/
class CLString {
public:
/**
* Registered Root name
*/
const static std::string REGISTERED_ROOT_NAME;
/**
* Registered Application name
*/
const static std::string REGISTERED_APPLICATION_NAME;
/**
* Registered Group name
*/
const static std::string REGISTERED_GROUP_NAME;
/**
* Registered Node name
*/
const static std::string REGISTERED_NODE_NAME;
/**
* Registered ProcessSlot name
*/
const static std::string REGISTERED_PROCESSSLOT_NAME;
/**
* Registered DataDistribution name
*/
const static std::string REGISTERED_DATADISTRIBUTION_NAME;
/**
* Registered PropertyList name
*/
const static std::string REGISTERED_PROPERTYLIST_NAME;
/**
* Registered Queue name
*/
const static std::string REGISTERED_QUEUE_NAME;
/**
* Default PropertyList name for a Notifyable
*/
const static std::string DEFAULT_PROPERTYLIST;
/**
* Default recv queue name for a Notifyable
*/
const static std::string DEFAULT_RECV_QUEUE;
/**
* Default response queue name for a Notifyable
*/
const static std::string DEFAULT_RESP_QUEUE;
/**
* Default completed message queue (no response queue set),
* unparseable, or debugging enabled.
*/
const static std::string DEFAULT_COMPLETED_QUEUE;
/**
* Default CLI application for issuing JSON-RPC
*/
const static std::string DEFAULT_CLI_APPLICATION;
/**
* User lock on a Notifyable object.
*/
const static std::string NOTIFYABLE_LOCK;
/**
* User lock that can denote "ownership" of a Notifyable object.
*/
const static std::string OWNERSHIP_LOCK;
/**
* User and internal lock that allows manipulation of a Notifyable
* object's children. ClusterlibS uses this lock when creating
* and removing Notifyable objects. Users are allowed to
* acquire/release this lock as well.
*/
const static std::string CHILD_LOCK;
/**
* Defined PropertyList keys (prefix PLK) and values (prefix PLV).
*/
const static std::string PLK_STATE;
const static std::string PLV_STATE_INITIAL;
const static std::string PLV_STATE_PREPARING;
const static std::string PLV_STATE_RUNNING;
const static std::string PLV_STATE_READY;
const static std::string PLV_STATE_REMOVED;
const static std::string PLV_STATE_COMPLETED;
const static std::string PLV_STATE_HALTING;
const static std::string PLV_STATE_STOPPED;
const static std::string PLV_STATE_FAILED;
const static std::string PLK_RPCMANAGER_REQ_POSTFIX;
const static std::string PLK_RPCMANAGER_REQ_STATUS_POSTFIX;
const static std::string PLK_PORT_RANGE_START;
const static std::string PLK_PORT_RANGE_END;
const static std::string PLK_USED_PORT_JSON_ARRAY;
/*
* Strings associated with clusterlib rpc methods
*/
const static std::string RPC_START_PROCESS;
const static std::string RPC_STOP_PROCESS;
const static std::string RPC_STOP_ACTIVENODE;
const static std::string RPC_GENERIC;
/*
* Known json object keys
*/
const static std::string JSONOBJECTKEY_METHOD;
const static std::string JSONOBJECTKEY_ADDENV;
const static std::string JSONOBJECTKEY_PATH;
const static std::string JSONOBJECTKEY_COMMAND;
const static std::string JSONOBJECTKEY_RESPQUEUEKEY;
const static std::string JSONOBJECTKEY_NOTIFYABLEKEY;
const static std::string JSONOBJECTKEY_SIGNAL;
const static std::string JSONOBJECTKEY_TIME;
/*
* Known state keys
*/
const static std::string STATE_SET_MSECS;
const static std::string STATE_SET_MSECS_AS_DATE;
const static std::string ZK_RUOK_STATE_KEY;
const static std::string ZK_ENVI_STATE_KEY;
const static std::string ZK_REQS_STATE_KEY;
const static std::string ZK_STAT_STATE_KEY;
const static std::string ZK_AGG_NODES_STATE_KEY;
/**
* Directory of Root objects (only one)
*/
const static std::string ROOT_DIR;
/**
* Directory of Application objects
*/
const static std::string APPLICATION_DIR;
/**
* Directory of Group objects
*/
const static std::string GROUP_DIR;
/**
* Directory of Node objects
*/
const static std::string NODE_DIR;
/**
* Directory of ProcessSlot objects
*/
const static std::string PROCESSSLOT_DIR;
/**
* Directory of DataDistribution objects
*/
const static std::string DATADISTRIBUTION_DIR;
/**
* Directory of PropertyList objects
*/
const static std::string PROPERTYLIST_DIR;
/**
* Directory of Queued objects
*/
const static std::string QUEUE_DIR;
/**
* Separates all Notifyable keys into components.
*/
const static std::string KEY_SEPARATOR;
private:
/**
* No constructing.
*/
CLString();
};
} /* End of 'namespace clusterlib' */
#endif /* !_CL_CLSTRING_H_ */
|
/* Siconos is a program dedicated to modeling, simulation and control
* of non smooth dynamical systems.
*
* Copyright 2016 INRIA.
*
* 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 NM_conversions_H
#define NM_conversions_H
/*!\file NM_conversions.h
\brief Conversion related functions for the various matrix storages in Numerics
*/
#include "SiconosConfig.h"
#include "SparseMatrix.h"
#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
extern "C"
{
#endif
/** Convert from csc to triplet (aka coo)
* \param csc the matrix to convert
* \return the matrix in triplet format
*/
CSparseMatrix* NM_csc_to_triplet(CSparseMatrix* csc);
/** Convert from triplet (aka coo) to csr
* \param triplet the matrix to convert
* \return the matrix in csr format
*/
CSparseMatrix* NM_triplet_to_csr(CSparseMatrix* triplet);
/** Convert from csr to triplet (aka coo)
* \param csr the matrix to convert
* \return the matrix in triplet format
*/
CSparseMatrix* NM_csr_to_triplet(CSparseMatrix* csr);
/** Convert from csc to csr
* \param csc the matrix to convert
* \return the matrix in csr format
*/
CSparseMatrix* NM_csc_to_csr(CSparseMatrix* csc);
/** Convert from csr to csc
* \param csr the matrix to convert
* \return the matrix in csc format
*/
CSparseMatrix* NM_csr_to_csc(CSparseMatrix* csr);
#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
}
#endif
#endif
|
#include "ogl_helper.h"
void load_shader_from_file(const char *filepath, char **content)
{
FILE *fp = fopen(filepath, "rb");
long length = -1;
if (NULL == fp) {
printf("filepath: %s doesn't exist\n", filepath);
return;
}
fseek(fp, 0, SEEK_END);
length = ftell(fp);
fseek(fp, 0, SEEK_SET);
*content = (char *)malloc(length + 1);
if (NULL == *content) {
printf("out of memory\n");
goto exit;
}
memset(*content, 0 , length +1);
if (length != fread(*content, 1, length, fp))
printf("fail to read all content\n");
exit:
fclose(fp);
}
void error_cb(int error, const char* description)
{
fputs(description, stderr);
fputs("\n", stderr);
}
void key_cb(GLFWwindow* win, int key, int scancode, int action, int mode)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(win, GL_TRUE);
}
|
/*
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_clone_prototypes.h
*/
#ifndef H_SG_CLONE_PROTOTYPES_H
#define H_SG_CLONE_PROTOTYPES_H
BEGIN_EXTERN_C;
void SG_clone__to_remote(
SG_context* pCtx,
const char* psz_existing_repo_spec,
const char* psz_username,
const char* psz_password,
const char* psz_new_repo_spec,
SG_vhash** ppvhStatus
);
void SG_clone__to_local(
SG_context* pCtx,
const char* psz_existing_repo_spec,
const char* psz_username,
const char* psz_password,
const char* psz_new_repo_spec,
struct SG_clone__params__all_to_something* p_params_ats,
struct SG_clone__params__pack* p_params_pack,
struct SG_clone__demands* p_demands
);
void SG_clone__init_demands(
SG_context* pCtx,
struct SG_clone__demands* p_demands
);
void SG_clone__validate_new_repo_name(
SG_context* pCtx,
const char* psz_new_descriptor_name
);
void SG_clone__from_fragball(
SG_context* pCtx,
const char* psz_clone_id,
const char* psz_new_repo_name,
SG_pathname* pPathStaging,
const char* pszFragballName);
void SG_clone__from_fragball__prep_usermap(
SG_context* pCtx,
const char* psz_clone_id,
const char* pszNewDescriptor,
SG_pathname** ppPathStaging,
const char* pszFragballName);
void SG_clone__prep_usermap(
SG_context* pCtx,
const char* psz_existing,
const char* psz_username,
const char* psz_password,
const char* psz_new);
void SG_clone__finish_usermap(
SG_context* pCtx,
const char* psz_descriptor_name
);
END_EXTERN_C;
#endif
|
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* OS X Server Event Handling
*
* Copyright 2012 Corey Clayton <can.of.tuna@gmail.com>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
//#include <util.h>
#include "mf_event.h"
int mf_is_event_set(mfEventQueue* event_queue)
{
fd_set rfds;
int num_set;
struct timeval time;
FD_ZERO(&rfds);
FD_SET(event_queue->pipe_fd[0], &rfds);
memset(&time, 0, sizeof(time));
num_set = select(event_queue->pipe_fd[0] + 1, &rfds, 0, 0, &time);
return (num_set == 1);
}
void mf_signal_event(mfEventQueue* event_queue)
{
int length;
length = write(event_queue->pipe_fd[1], "sig", 4);
if (length != 4)
printf("mf_signal_event: error\n");
}
void mf_set_event(mfEventQueue* event_queue)
{
int length;
length = write(event_queue->pipe_fd[1], "sig", 4);
if (length != 4)
printf("mf_set_event: error\n");
}
void mf_clear_events(mfEventQueue* event_queue)
{
int length;
while (mf_is_event_set(event_queue))
{
length = read(event_queue->pipe_fd[0], &length, 4);
if (length != 4)
printf("mf_clear_event: error\n");
}
}
void mf_clear_event(mfEventQueue* event_queue)
{
int length;
length = read(event_queue->pipe_fd[0], &length, 4);
if (length != 4)
printf("mf_clear_event: error\n");
}
void mf_event_push(mfEventQueue* event_queue, mfEvent* event)
{
pthread_mutex_lock(&(event_queue->mutex));
if (event_queue->count >= event_queue->size)
{
event_queue->size *= 2;
event_queue->events = (mfEvent**) realloc((void*) event_queue->events, sizeof(mfEvent*) * event_queue->size);
}
event_queue->events[(event_queue->count)++] = event;
pthread_mutex_unlock(&(event_queue->mutex));
mf_set_event(event_queue);
}
mfEvent* mf_event_peek(mfEventQueue* event_queue)
{
mfEvent* event;
pthread_mutex_lock(&(event_queue->mutex));
if (event_queue->count < 1)
event = NULL;
else
event = event_queue->events[0];
pthread_mutex_unlock(&(event_queue->mutex));
return event;
}
mfEvent* mf_event_pop(mfEventQueue* event_queue)
{
mfEvent* event;
pthread_mutex_lock(&(event_queue->mutex));
if (event_queue->count < 1)
return NULL;
/* remove event signal */
mf_clear_event(event_queue);
event = event_queue->events[0];
(event_queue->count)--;
memmove(&event_queue->events[0], &event_queue->events[1], event_queue->count * sizeof(void*));
pthread_mutex_unlock(&(event_queue->mutex));
return event;
}
mfEventRegion* mf_event_region_new(int x, int y, int width, int height)
{
mfEventRegion* event_region = malloc(sizeof(mfEventRegion));
if (event_region != NULL)
{
event_region->x = x;
event_region->y = y;
event_region->width = width;
event_region->height = height;
}
return event_region;
}
void mf_event_region_free(mfEventRegion* event_region)
{
free(event_region);
}
mfEvent* mf_event_new(int type)
{
mfEvent* event = malloc(sizeof(mfEvent));
event->type = type;
return event;
}
void mf_event_free(mfEvent* event)
{
free(event);
}
mfEventQueue* mf_event_queue_new()
{
mfEventQueue* event_queue = malloc(sizeof(mfEventQueue));
if (event_queue != NULL)
{
event_queue->pipe_fd[0] = -1;
event_queue->pipe_fd[1] = -1;
event_queue->size = 16;
event_queue->count = 0;
event_queue->events = (mfEvent**) malloc(sizeof(mfEvent*) * event_queue->size);
if (pipe(event_queue->pipe_fd) < 0)
printf("mf_event_queue_new: pipe failed\n");
pthread_mutex_init(&(event_queue->mutex), NULL);
}
return event_queue;
}
void mf_event_queue_free(mfEventQueue* event_queue)
{
if (event_queue->pipe_fd[0] != -1)
{
close(event_queue->pipe_fd[0]);
event_queue->pipe_fd[0] = -1;
}
if (event_queue->pipe_fd[1] != -1)
{
close(event_queue->pipe_fd[1]);
event_queue->pipe_fd[1] = -1;
}
pthread_mutex_destroy(&(event_queue->mutex));
} |
/*
* Copyright 2022 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.
*/
/* Automatically generated nanopb header */
/* Generated by nanopb-0.3.9.8 */
#ifndef PB_GOOGLE_PROTOBUF_TIMESTAMP_NANOPB_H_INCLUDED
#define PB_GOOGLE_PROTOBUF_TIMESTAMP_NANOPB_H_INCLUDED
#include <pb.h>
#include <string>
namespace firebase {
namespace firestore {
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
#endif
/* Struct definitions */
typedef struct _google_protobuf_Timestamp {
int64_t seconds;
int32_t nanos;
std::string ToString(int indent = 0) const;
/* @@protoc_insertion_point(struct:google_protobuf_Timestamp) */
} google_protobuf_Timestamp;
/* Default values for struct fields */
/* Initializer values for message structs */
#define google_protobuf_Timestamp_init_default {0, 0}
#define google_protobuf_Timestamp_init_zero {0, 0}
/* Field tags (for use in manual encoding/decoding) */
#define google_protobuf_Timestamp_seconds_tag 1
#define google_protobuf_Timestamp_nanos_tag 2
/* Struct field encoding specification for nanopb */
extern const pb_field_t google_protobuf_Timestamp_fields[3];
/* Maximum encoded size of messages (where known) */
#define google_protobuf_Timestamp_size 22
/* Message IDs (where set with "msgid" option) */
#ifdef PB_MSGID
#define TIMESTAMP_MESSAGES \
#endif
} // namespace firestore
} // namespace firebase
/* @@protoc_insertion_point(eof) */
#endif
|
//
// WelcomeViewController.h
// BangBang
//
// Created by bocai on 16/11/4.
// Copyright © 2016年 bocweb. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WelcomeViewController : UIViewController
@end
|
#ifndef RANDOM_GHOST_H
#define RANDOM_GHOST_H
#include "Ghost.h"
#include "FixedDirection.h"
#include <string>
class RandomGhost : public Ghost
{
public:
RandomGhost(int jail_time);
protected:
void UpdateDirectionVector();
FixedDirection* NextDirection();
private:
static int ghosts_created;
static string GetAlternatedName();
};
#endif
|
#ifndef __LUCENE_INDEX_FIELD_INFOS__
#define __LUCENE_INDEX_FIELD_INFOS__
#import <Foundation/Foundation.h>
#import "LCDirectory.h"
#import "LCDocument.h"
#import "LCFieldInfo.h"
#import "LCIndexInput.h"
@interface LCFieldInfos: NSObject
{
NSMutableArray *byNumber;
NSMutableDictionary *byName;
}
- (id) initWithDirectory: (id <LCDirectory>) d name: (NSString *) name;
- (void) addDocument: (LCDocument *) doc;
- (void) addIndexedCollection: (NSArray *) names
storeTermVector: (BOOL) storeTermVectors
storePositionWithTermVector: (BOOL) storePositionWithTermVector
storeOffsetWithTermVector: (BOOL) storeOffsetWithTermVector;
- (void) addCollection: (NSArray *) names isIndexed: (BOOL) isIndexed;
- (void) addName: (NSString *) name isIndexed: (BOOL) isIndexed;
- (void) addName: (NSString *) name
isIndexed: (BOOL) isIndexed
isTermVectorStored: (BOOL)isTermVectorStored;
- (void) addName: (NSString *) name
isIndexed: (BOOL) isIndexed
isTermVectorStored: (BOOL)isTermVectorStored
isStorePositionWithTermVector: (BOOL) isStorePositionWithTermVector
isStoreOffsetWithTermVector: (BOOL) isStoreOffsetWithTermVector;
- (void) addName: (NSString *) name
isIndexed: (BOOL) isIndexed
isTermVectorStored: (BOOL) storeTermVector
isStorePositionWithTermVector: (BOOL) storePositionWithTermVector
isStoreOffsetWithTermVector: (BOOL) storeOffsetWithTermVector
omitNorms: (BOOL) ons;
- (int) fieldNumber: (NSString *) fieldName;
- (LCFieldInfo *) fieldInfo: (NSString *) name;
- (NSString *) fieldName: (int) fieldNumber;
- (LCFieldInfo *) fieldInfoWithNumber: (int) number;
- (int) size;
- (BOOL) hasVectors;
- (void) write: (id <LCDirectory>) d name: (NSString *) name;
- (void) write: (LCIndexOutput *) output;
@end
#endif /* __LUCENE_INDEX_FIELD_INFOS__ */
|
//
// lmsStorePlugIn.h
// lmsmobile1
//
// Created by Macintosh User on 25/1/14.
// Copyright (c) 2014 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
#import <Cordova/CDV.h>
#import "lmsStore.h"
#import "defaults.h"
@interface LmsStorePlugIn : CDVPlugin
{
}
/*- (void) updateAccessToken:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) doLogOut:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options ;*/
- (void) updateAccessToken:(CDVInvokedUrlCommand*)command;
- (void) doLogOut:(CDVInvokedUrlCommand*)command;
- (void) doMakeNSLog:(CDVInvokedUrlCommand*) command;
- (void) getAuthInformation:(CDVInvokedUrlCommand*) command;
//(CDVInvokedUrlCommand*)command
@end |
/*
* StockAccount.h
*
* Created on: 2016年8月30日
* Author: Maibenben
*/
#ifndef GEORGE_MASTER_PLUGINS_STOCK_STOCKACCOUNT_H_
#define GEORGE_MASTER_PLUGINS_STOCK_STOCKACCOUNT_H_
#include "Observer.h"
#include "HoldingStock.h"
#include "Strategy.h"
namespace stock_logic {
class Strategy;
class StockAccount : public Observer {
public:
StockAccount();
StockAccount(std::string& birthday, Strategy* strategy, std::string& industry_name);
virtual ~StockAccount();
double getCurrentCash() const;
void setCurrentCash(double currentCash);
const std::map<std::string, HoldingStock>& getHoldingStocks() const;
void setHoldingStocks(
const std::map<std::string, HoldingStock>& holdingStocks);
Strategy* getStrategy();
void setStrategy(Strategy* strategy);
double getTotalAsset() const;
void setTotalAsset(double totalAsset);
const std::string& getBirthday() const;
void setBirthday(const std::string& birthday);
double getCurrentProfit() const;
void setCurrentProfit(double currentProfit);
double getCurrentStockAsset() const;
void setCurrentStockAsset(double currentStockAsset);
const std::string& getDeathDate() const;
void setDeathDate(const std::string& deathDate);
bool isIsDeath() const;
void setIsDeath(bool isDeath);
double getTradePosition() const;
void setTradePosition(double tradePosition);
const std::string& getCurrentTradeDate() const;
void setCurrentTradeDate(const std::string& currentTradeDate);
const std::string& getIndustryName() const;
void setIndustryName(const std::string& industryName);
std::string getAccountName();
void setAccountName(std::string account_name);
virtual void Update(int opcode, stock_logic::Subject* subject);
bool startStrategy(); //开始策略,把现金换算成股票
void endStrategy(); //结算策略,把所有股票换算成现金
void changeStrategy(); //转换策略
virtual void run();
void cycle_run();
void printSelf();
int updateTradePosition(); //计算仓位
void updateAssetInfo(); //计算资产状况
virtual void trade();
bool isShortPosition();
void addStock(std::string& stock_code, HoldingStock& stock_info);
void buyStocks();
std::string serialize();
void serializeMember(std::string& serialize_str, double member, bool hasComma);
void serializeMember(std::string& serialize_str, int member, bool hasComma);
void serializeMember(std::string& serialize_str, std::string member, bool hasComma);
void serializeStocks(std::string& serialize_str, bool hasComma);
void setDeathDateBySuspention();
void setCurrentDateBySuspention();
std::string snapshot();
double total_asset_; //总资产
double principal_; //本金
double current_cash_; //当前持有现金
double current_stock_asset_; //当前持有市值
double trade_position_; //当前仓位
double current_profit_; //持仓浮动盈亏
double current_profit_ratio_; //持仓收益率
std::string birthday_;
std::string industry_name_;
std::string death_date_;
bool is_death_;
std::map<std::string, HoldingStock> holding_stocks_; //当前持有股票
Strategy *strategy_;
std::string current_trade_date_;
std::string account_name_;
int max_hold_day_;
double stop_ratio_;
double limited_ratio_;
std::string current_date_;
int traded_day_; //已持有交易日
int hold_day_; //已持有自然日
int rank_index_; //HotRankOneHundredStrategy
int stock_count_; //
int stock_hold_cycle_;
std::multimap<std::string, HoldingStock> holding_stocks_record_;
std::string serialize_str_;
std::string transfer_day_; //调仓日
};
} /* namespace stock_logic */
#endif /* GEORGE_MASTER_PLUGINS_STOCK_STOCKACCOUNT_H_ */
|
/*
Copyright 2014 Akira Midorikawa
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 <fs.c>
#include "test.h"
#include "fs.t"
#include "page.h"
#include "mmu.h"
static void generate_path(char *str, size_t size) {
memset(str, 'a', size);
str[0] = '/';
str[size - 1] = '\0';
}
static void setup(void) {
page_init();
fs_init();
mmu_init();
mmu_enable();
}
TEST(test_fs_check_path) {
char path[PATH_MAX + 100];
setup();
generate_path(path, sizeof(path));
TEST_ASSERT(fs_create(path, O_WRONLY|O_CREAT, 0644) == -ENAMETOOLONG);
TEST_ASSERT(fs_unlink(path) == -ENAMETOOLONG);
TEST_ASSERT(fs_mkdir(path, 0755) == -ENAMETOOLONG);
TEST_ASSERT(fs_rmdir(path) == -ENAMETOOLONG);
}
TEST(test_fs_lstat64) {
struct stat64 st;
setup();
TEST_ASSERT(!fs_lstat64("/sbin", &st));
TEST_ASSERT(S_ISDIR(st.st_mode));
TEST_ASSERT(!fs_lstat64("/sbin/init", &st));
TEST_ASSERT(S_ISREG(st.st_mode));
TEST_ASSERT(fs_lstat64("/sbin/command_not_found", &st) == -ENOENT);
}
|
/* Copyright 2014 Andrew Bates
*
* 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.
*/
/**
* This hashing mechanism and related functions were adapted from
* code by Robert J. Jenkins Jr.
* See: http://burtleburtle.net/bob/hash/evahash.html
*/
#include "hash.h"
/* The whole new hash function */
hash_word_t hash(ipv4_tuple *tuple, hash_word_t initval) {
int length = sizeof(ipv4_tuple);
register hash_byte_t *k = (void *)tuple;
register hash_word_t a,b,c; /* the internal state */
hash_word_t len; /* how many key bytes still need mixing */
/* Set up the internal state */
len = length;
a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
c = initval; /* variable initialization of internal state */
/*---------------------------------------- handle most of the key */
while (len >= 12) {
a=a+(k[0]+((hash_word_t)k[1]<<8)+((hash_word_t)k[2]<<16) +((hash_word_t)k[3]<<24));
b=b+(k[4]+((hash_word_t)k[5]<<8)+((hash_word_t)k[6]<<16) +((hash_word_t)k[7]<<24));
c=c+(k[8]+((hash_word_t)k[9]<<8)+((hash_word_t)k[10]<<16)+((hash_word_t)k[11]<<24));
mix(a,b,c);
k = k+12; len = len-12;
}
/*------------------------------------- handle the last 11 bytes */
c = c+length;
/* all the case statements fall through */
switch(len) {
case 11: c=c+((hash_word_t)k[10]<<24);
case 10: c=c+((hash_word_t)k[9]<<16);
case 9 : c=c+((hash_word_t)k[8]<<8);
/* the first byte of c is reserved for the length */
case 8 : b=b+((hash_word_t)k[7]<<24);
case 7 : b=b+((hash_word_t)k[6]<<16);
case 6 : b=b+((hash_word_t)k[5]<<8);
case 5 : b=b+k[4];
case 4 : a=a+((hash_word_t)k[3]<<24);
case 3 : a=a+((hash_word_t)k[2]<<16);
case 2 : a=a+((hash_word_t)k[1]<<8);
case 1 : a=a+k[0];
/* case 0: nothing left to add */
}
mix(a,b,c);
/*-------------------------------------------- report the result */
return c;
}
|
/*
* codec.h
* Copyright 2015 John Lawson
*
* 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 _PTMPI_CODEC_H_
#define _PTMPI_CODEC_H_
#include "ptope/polytope_candidate.h"
namespace ptmpi {
class Codec {
typedef ptope::PolytopeCandidate PolytopeCandidate;
public:
/**
* Get the size of the encoded array for the gram matrix.
*/
int
size_gram(const PolytopeCandidate & p);
/**
* Get a double array representing the gram matrix.
*/
const double *
encode_gram(const PolytopeCandidate & p);
/**
* Get the size of the encoded array for the vector family.
*/
int
size_vectors(const PolytopeCandidate & p);
/**
* Get a double array representing the vector family.
*/
const double *
encode_vectors(const PolytopeCandidate & p);
/**
* Decode the passed arrays to a PolytopCandidate.
*/
PolytopeCandidate
decode(const double * gram, int g_size, const double * vectors, int v_size);
};
}
#endif
|
/*
* 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/cognito-idp/CognitoIdentityProvider_EXPORTS.h>
#include <aws/cognito-idp/CognitoIdentityProviderRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace CognitoIdentityProvider
{
namespace Model
{
/**
* <p>Represents the request to confirm user registration.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUpRequest">AWS
* API Reference</a></p>
*/
class AWS_COGNITOIDENTITYPROVIDER_API AdminConfirmSignUpRequest : public CognitoIdentityProviderRequest
{
public:
AdminConfirmSignUpRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "AdminConfirmSignUp"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline const Aws::String& GetUserPoolId() const{ return m_userPoolId; }
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline void SetUserPoolId(const Aws::String& value) { m_userPoolIdHasBeenSet = true; m_userPoolId = value; }
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline void SetUserPoolId(Aws::String&& value) { m_userPoolIdHasBeenSet = true; m_userPoolId = std::move(value); }
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline void SetUserPoolId(const char* value) { m_userPoolIdHasBeenSet = true; m_userPoolId.assign(value); }
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline AdminConfirmSignUpRequest& WithUserPoolId(const Aws::String& value) { SetUserPoolId(value); return *this;}
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline AdminConfirmSignUpRequest& WithUserPoolId(Aws::String&& value) { SetUserPoolId(std::move(value)); return *this;}
/**
* <p>The user pool ID for which you want to confirm user registration.</p>
*/
inline AdminConfirmSignUpRequest& WithUserPoolId(const char* value) { SetUserPoolId(value); return *this;}
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline const Aws::String& GetUsername() const{ return m_username; }
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline void SetUsername(const Aws::String& value) { m_usernameHasBeenSet = true; m_username = value; }
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline void SetUsername(Aws::String&& value) { m_usernameHasBeenSet = true; m_username = std::move(value); }
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline void SetUsername(const char* value) { m_usernameHasBeenSet = true; m_username.assign(value); }
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline AdminConfirmSignUpRequest& WithUsername(const Aws::String& value) { SetUsername(value); return *this;}
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline AdminConfirmSignUpRequest& WithUsername(Aws::String&& value) { SetUsername(std::move(value)); return *this;}
/**
* <p>The user name for which you want to confirm user registration.</p>
*/
inline AdminConfirmSignUpRequest& WithUsername(const char* value) { SetUsername(value); return *this;}
private:
Aws::String m_userPoolId;
bool m_userPoolIdHasBeenSet;
Aws::String m_username;
bool m_usernameHasBeenSet;
};
} // namespace Model
} // namespace CognitoIdentityProvider
} // namespace Aws
|
// Copyright 2015-2016 BigML
//
// 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 <XCTest/XCTest.h>
#import "BMLAPIConnector.h"
#import "BMLResourceProtocol.h"
#import "BMLResourceTypeIdentifier.h"
@interface bigmlObjcBaseTests : XCTestCase
@property (nonatomic, strong) BMLAPIConnector* connector;
@property (nonatomic, readonly) id<BMLResource> aSource;
@property (nonatomic, readonly) id<BMLResource> aDataset;
@property (nonatomic, readonly) id<BMLResource> altDataset;
- (void)runTest:(NSString*)name
test:(void(^)(XCTestExpectation*))test;
- (id<BMLResource>)createDatasource:(NSString*)file
options:(NSDictionary*)options;
- (id<BMLResource>)createDatasetFromDataSource:(id<BMLResource>)datasource
options:(NSDictionary*)options;
- (id<BMLResource>)createDataset:(NSString*)file
options:(NSDictionary*)options;
- (NSError*)deleteResource:(id<BMLResource>)resource;
@end
|
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* 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 elxFullSampler_h
#define elxFullSampler_h
#include "elxIncludes.h" // include first to avoid MSVS warning
#include "itkImageFullSampler.h"
namespace elastix
{
/**
* \class FullSampler
* \brief An interpolator based on the itk::ImageFullSampler.
*
* This image sampler samples all voxels in
* the InputImageRegion.
*
* This sampler does not react to the NewSamplesEveryIteration parameter.
*
* The parameters used in this class are:
* \parameter ImageSampler: Select this image sampler as follows:\n
* <tt>(ImageSampler "Full")</tt>
*
* \ingroup ImageSamplers
*/
template <class TElastix>
class ITK_TEMPLATE_EXPORT FullSampler
: public itk::ImageFullSampler<typename elx::ImageSamplerBase<TElastix>::InputImageType>
, public elx::ImageSamplerBase<TElastix>
{
public:
/** Standard ITK-stuff. */
using Self = FullSampler;
using Superclass1 = itk::ImageFullSampler<typename elx::ImageSamplerBase<TElastix>::InputImageType>;
using Superclass2 = elx::ImageSamplerBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(FullSampler, itk::ImageFullSampler);
/** Name of this class.
* Use this name in the parameter file to select this specific interpolator. \n
* example: <tt>(ImageSampler "Full")</tt>\n
*/
elxClassNameMacro("Full");
/** Typedefs inherited from the superclass. */
using typename Superclass1::DataObjectPointer;
using typename Superclass1::OutputVectorContainerType;
using typename Superclass1::OutputVectorContainerPointer;
using typename Superclass1::InputImageType;
using typename Superclass1::InputImagePointer;
using typename Superclass1::InputImageConstPointer;
using typename Superclass1::InputImageRegionType;
using typename Superclass1::InputImagePixelType;
using typename Superclass1::ImageSampleType;
using typename Superclass1::ImageSampleContainerType;
using typename Superclass1::MaskType;
using typename Superclass1::InputImageIndexType;
using typename Superclass1::InputImagePointType;
/** The input image dimension. */
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass1::InputImageDimension);
/** Typedefs inherited from Elastix. */
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using ITKBaseType = typename Superclass2::ITKBaseType;
protected:
/** The constructor. */
FullSampler() = default;
/** The destructor. */
~FullSampler() override = default;
private:
elxOverrideGetSelfMacro;
/** The deleted copy constructor. */
FullSampler(const Self &) = delete;
/** The deleted assignment operator. */
void
operator=(const Self &) = delete;
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxFullSampler.hxx"
#endif
#endif // end #ifndef elxFullSampler_h
|
//
// YCHNSavedViewController.h
// Hn
//
// Created by Douglas Blaalid on 9/26/13.
// Copyright (c) 2013 Douglas Blaalid. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface YCHNSavedViewController : UITableViewController <NSFetchedResultsControllerDelegate, UITableViewDataSource>
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@end
|
/*
Copyright 2016 Tommi M. Tykkälä
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
#define MATRIX_BLOCK_SIZE 16
#define WA (5 * MATRIX_BLOCK_SIZE) // Matrix A width
#define HA (10 * MATRIX_BLOCK_SIZE) // Matrix A height
#define WB (5 * MATRIX_BLOCK_SIZE) // Matrix B width
#define HB WA // Matrix B height
#define WC WB // Matrix C width
#define HC HA // Matrix C height
|
/* ptmacosx.c -- portable timer implementation for mac os x */
#include <stdlib.h>
#include <stdio.h>
#include <CoreAudio/HostTime.h>
#import <mach/mach.h>
#import <mach/mach_error.h>
#import <mach/mach_time.h>
#import <mach/clock.h>
#include "porttime.h"
#include "sys/time.h"
#include "pthread.h"
#define NSEC_PER_MSEC 1000000
#define THREAD_IMPORTANCE 30
static int time_started_flag = FALSE;
static UInt64 start_time;
static pthread_t pt_thread_pid;
/* note that this is static data -- we only need one copy */
typedef struct {
int id;
int resolution;
PtCallback *callback;
void *userData;
} pt_callback_parameters;
static int pt_callback_proc_id = 0;
static void *Pt_CallbackProc(void *p)
{
pt_callback_parameters *parameters = (pt_callback_parameters *) p;
int mytime = 1;
kern_return_t error;
thread_extended_policy_data_t extendedPolicy;
thread_precedence_policy_data_t precedencePolicy;
extendedPolicy.timeshare = 0;
error = thread_policy_set(mach_thread_self(), THREAD_EXTENDED_POLICY,
(thread_policy_t)&extendedPolicy,
THREAD_EXTENDED_POLICY_COUNT);
if (error != KERN_SUCCESS) {
mach_error("Couldn't set thread timeshare policy", error);
}
precedencePolicy.importance = THREAD_IMPORTANCE;
error = thread_policy_set(mach_thread_self(), THREAD_PRECEDENCE_POLICY,
(thread_policy_t)&precedencePolicy,
THREAD_PRECEDENCE_POLICY_COUNT);
if (error != KERN_SUCCESS) {
mach_error("Couldn't set thread precedence policy", error);
}
/* to kill a process, just increment the pt_callback_proc_id */
// printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id, parameters->id);
while (pt_callback_proc_id == parameters->id) {
/* wait for a multiple of resolution ms */
UInt64 wait_time;
long delay = mytime++ * parameters->resolution - Pt_Time();
if (delay < 0) delay = 0;
wait_time = AudioConvertNanosToHostTime((UInt64)delay * NSEC_PER_MSEC);
wait_time += AudioGetCurrentHostTime();
error = mach_wait_until(wait_time);
(*(parameters->callback))(Pt_Time(), parameters->userData);
}
// printf("Pt_CallbackProc exiting\n");
free(parameters);
return NULL;
}
PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
{
if (time_started_flag) return ptAlreadyStarted;
start_time = AudioGetCurrentHostTime();
if (callback) {
int res;
pt_callback_parameters *parms;
parms = (pt_callback_parameters *) malloc(sizeof(pt_callback_parameters));
if (!parms) return ptInsufficientMemory;
parms->id = pt_callback_proc_id;
parms->resolution = resolution;
parms->callback = callback;
parms->userData = userData;
res = pthread_create(&pt_thread_pid, NULL, Pt_CallbackProc, parms);
if (res != 0) return ptHostError;
}
time_started_flag = TRUE;
return ptNoError;
}
PtError Pt_Stop()
{
// printf("Pt_Stop called\n");
pt_callback_proc_id++;
time_started_flag = FALSE;
return ptNoError;
}
int Pt_Started()
{
return time_started_flag;
}
PtTimestamp Pt_Time()
{
UInt64 clock_time, nsec_time;
clock_time = AudioGetCurrentHostTime() - start_time;
nsec_time = AudioConvertHostTimeToNanos(clock_time);
return (PtTimestamp)(nsec_time / NSEC_PER_MSEC);
}
|
/*
**********************************************************************
* Copyright (C) 2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 05/11/2008 Andy Heninger Ported from Java
**********************************************************************
*/
#ifndef BRKTRANS_H
#define BRKTRANS_H
#include "unicode/utypes.h"
#if !UCONFIG_NO_TRANSLITERATION && !UCONFIG_NO_BREAK_ITERATION
#include "unicode/translit.h"
U_NAMESPACE_BEGIN
class UVector32;
/**
* A transliterator that pInserts the specified characters at word breaks.
* To restrict it to particular characters, use a filter.
* TODO: this is an internal class, and only temporary.
* Remove it once we have \b notation in Transliterator.
*/
class BreakTransliterator : public Transliterator {
public:
BreakTransliterator(const UnicodeString &ID,
UnicodeFilter *adoptedFilter,
BreakIterator *bi,
const UnicodeString &insertion);
/**
* Constructs a transliterator.
* @param adoptedFilter the filter for this transliterator.
*/
BreakTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
*/
virtual ~BreakTransliterator();
/**
* Copy constructor.
*/
BreakTransliterator(const BreakTransliterator&);
/**
* Transliterator API.
* @return A copy of the object.
*/
virtual Transliterator* clone(void) const;
virtual const UnicodeString &getInsertion() const;
virtual void setInsertsion(const UnicodeString &insertion);
/**
* Return the break iterator used by this transliterator.
* Caution, this is the live break iterator; it must not be used while
* there is any possibility that this transliterator is using it.
*/
virtual BreakIterator *getBreakIterator();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*/
virtual UClassID getDynamicClassID() const;
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*/
U_I18N_API static UClassID U_EXPORT2 getStaticClassID();
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
* @param text the buffer holding transliterated and
* untransliterated text
* @param offset the start and limit of the text, the position
* of the cursor, and the start and limit of transliteration.
* @param incremental if true, assume more text may be coming after
* pos.contextLimit. Otherwise, assume the text is complete.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
private:
BreakIterator *bi;
UnicodeString fInsertion;
UVector32 *boundaries;
UnicodeString sText; // text from handleTransliterate().
static UnicodeString replaceableAsString(Replaceable &r);
/**
* Assignment operator.
*/
BreakTransliterator& operator=(const BreakTransliterator&);
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_TRANSLITERATION */
#endif
|
/*
Copyright (c) 2011, Stig Brautaset. 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 the the author 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.
*/
#import <Foundation/Foundation.h>
@interface SBJsonUTF8Stream : NSObject {
@private
const char *_bytes;
NSMutableData *_data;
NSUInteger _length;
}
@property (assign) NSUInteger index;
- (void)appendData:(NSData*)data_;
- (BOOL)haveRemainingCharacters:(NSUInteger)chars;
- (void)skip;
- (void)skipWhitespace;
- (BOOL)skipCharacters:(const char *)chars length:(NSUInteger)len;
- (BOOL)getUnichar:(unichar*)ch;
- (BOOL)getNextUnichar:(unichar*)ch;
- (BOOL)getStringFragment:(NSString**)string;
- (NSString*)stringWithRange:(NSRange)range;
@end
|
/**
*
* Fire https://github.com/taylorwrynn/fire
*
* Copyright (C) 2017 Taylor Tang
*
* Released under the Apache license v2 http://www.apache.org/licenses/
*
*/
#import <UIKit/UIKit.h>
@interface UIViewController (TXFire)
/// Only hides navigation bar for this view controller.
@property (nonatomic, assign) BOOL tx_interactiveNavigationBarHidden;
- (void)tx_setInteractiveNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated;
@end
|
#pragma once
#include "halley/ui/ui_factory.h"
#include "halley/ui/ui_widget.h"
namespace Halley {
class UIGraphNode : public UIWidget {
public:
UIGraphNode(UIFactory& factory);
};
}
|
// -------------------------------------------------------------------------
// @FileName : NFIMysqlDriverManager.h
// @Author : eliteYang
// @Date : 2014-11-10
// @Module : NFIMysqlDriverManager
//
// -------------------------------------------------------------------------
#ifndef NFI_MYSQL_DRIVER_MANAGER_H
#define NFI_MYSQL_DRIVER_MANAGER_H
#include "NFComm/NFPluginModule/NFIMysqlDriver.h"
class NFIMysqlDriverManager
{
public:
virtual bool AddMysqlServer(const int nServerID, const std::string& strDns, const std::string& strIP, const int nPort, const std::string strDBName, const std::string strDBUser, const std::string strDBPwd, const int nRconnectTime/* = 10*/, const int nRconneCount/* = -1*/) = 0;
virtual NFIMysqlDriver* GetMysqlDriver() = 0;
virtual void CheckMysql() = 0;
};
#endif // !NFI_MYSQL_DRIVER_MANAGER_H |
//
// DRLogging.h
// DashRedirector
//
// Created by Graham Haworth on 7/4/13.
// Copyright (c) 2013 Graham Haworth. All rights reserved.
//
// This sets up the debug configuration to log using the NSLogging utility.
#import "LoggerClient.h"
typedef enum {
DRLogError = 0,
DRLogWarning = 1,
DRLogInfo = 2,
DRLogDebug = 3,
DRLogTrace = 4
} DRLogLevel;
static inline NSString* DRLogLevelText(DRLogLevel level) {
switch(level) {
case DRLogError: return @"ERROR";
case DRLogWarning: return @"WARN";
case DRLogInfo: return @"INFO";
case DRLogDebug: return @"DEBUG";
case DRLogTrace: return @"TRACE";
default: return nil;
}
}
#define LOG_ERROR(...) LOG_MESSAGE(DRLogError, __VA_ARGS__)
#define LOG_WARN(...) LOG_MESSAGE(DRLogWarning, __VA_ARGS__)
#define LOG_INFO(...) LOG_MESSAGE(DRLogInfo, __VA_ARGS__)
#define LOG_DEBUG(...) LOG_MESSAGE(DRLogDebug, __VA_ARGS__)
#define LOG_TRACE(...) LOG_MESSAGE(DRLogTrace, __VA_ARGS__)
#ifdef DEBUG
#define LOGGER_OPTIONS (kLoggerOption_BufferLogsUntilConnection | \
kLoggerOption_BrowseBonjour | \
kLoggerOption_BrowseOnlyLocalDomain | \
kLoggerOption_UseSSL)
#define LOG_SETUP() LoggerSetOptions(LoggerGetDefaultLogger(), LOGGER_OPTIONS)
#define LOG_FLUSH() LoggerFlush(NULL, NO)
#define LOG_LINE() \
do { \
LogMarker([NSString stringWithUTF8String:__FUNCTION__]); \
NSLog(@"%s", __PRETTY_FUNCTION__); \
} while(0)
#define LOG_MESSAGE(level, ...) \
do { \
LogMessageF(__FILE__, __LINE__, __FUNCTION__, DRLogLevelText(level), level, __VA_ARGS__); \
NSLog(@"%s:\n%@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]); \
} while(0)
#else
#define DO_NOTHING do {} while(0)
#define LOG_SETUP() DO_NOTHING
#define LOG_FLUSH() DO_NOTHING
#define LOG_LINE() DO_NOTHING
#define LOG_MESSAGE(...) DO_NOTHING
#endif
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/iotevents-data/IoTEventsData_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/iotevents-data/model/DetectorSummary.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace IoTEventsData
{
namespace Model
{
class AWS_IOTEVENTSDATA_API ListDetectorsResult
{
public:
ListDetectorsResult();
ListDetectorsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListDetectorsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline const Aws::Vector<DetectorSummary>& GetDetectorSummaries() const{ return m_detectorSummaries; }
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline void SetDetectorSummaries(const Aws::Vector<DetectorSummary>& value) { m_detectorSummaries = value; }
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline void SetDetectorSummaries(Aws::Vector<DetectorSummary>&& value) { m_detectorSummaries = std::move(value); }
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline ListDetectorsResult& WithDetectorSummaries(const Aws::Vector<DetectorSummary>& value) { SetDetectorSummaries(value); return *this;}
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline ListDetectorsResult& WithDetectorSummaries(Aws::Vector<DetectorSummary>&& value) { SetDetectorSummaries(std::move(value)); return *this;}
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline ListDetectorsResult& AddDetectorSummaries(const DetectorSummary& value) { m_detectorSummaries.push_back(value); return *this; }
/**
* <p>A list of summary information about the detectors (instances).</p>
*/
inline ListDetectorsResult& AddDetectorSummaries(DetectorSummary&& value) { m_detectorSummaries.push_back(std::move(value)); return *this; }
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline ListDetectorsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline ListDetectorsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>A token to retrieve the next set of results, or <code>null</code> if there
* are no additional results.</p>
*/
inline ListDetectorsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<DetectorSummary> m_detectorSummaries;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws
|
//
// AGBoxBCell.h
// AGViewModelDemo
//
// Created by JohnnyB0Y on 2017/8/20.
// Copyright © 2017年 JohnnyB0Y. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AGVMKit.h"
@interface AGBoxBCell : UICollectionViewCell
@end
|
//
// OnetabBarController.h
// One
//
// Created by akkelyn on 16-4-21.
// Copyright (c) 2016年 akkelyn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnetabBarController : UITabBarController
@end
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/rel-m-rel-xr-osx64-bld/build/xpcom/io/nsIStringStream.idl
*/
#ifndef __gen_nsIStringStream_h__
#define __gen_nsIStringStream_h__
#ifndef __gen_nsIInputStream_h__
#include "nsIInputStream.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIStringInputStream */
#define NS_ISTRINGINPUTSTREAM_IID_STR "450cd2d4-f0fd-424d-b365-b1251f80fd53"
#define NS_ISTRINGINPUTSTREAM_IID \
{0x450cd2d4, 0xf0fd, 0x424d, \
{ 0xb3, 0x65, 0xb1, 0x25, 0x1f, 0x80, 0xfd, 0x53 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIStringInputStream : public nsIInputStream {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTRINGINPUTSTREAM_IID)
/* void setData (in string data, in long dataLen); */
NS_SCRIPTABLE NS_IMETHOD SetData(const char * data, PRInt32 dataLen) = 0;
/* [noscript] void adoptData (in charPtr data, in long dataLen); */
NS_IMETHOD AdoptData(char *data, PRInt32 dataLen) = 0;
/* [noscript] void shareData (in string data, in long dataLen); */
NS_IMETHOD ShareData(const char * data, PRInt32 dataLen) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIStringInputStream, NS_ISTRINGINPUTSTREAM_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTRINGINPUTSTREAM \
NS_SCRIPTABLE NS_IMETHOD SetData(const char * data, PRInt32 dataLen); \
NS_IMETHOD AdoptData(char *data, PRInt32 dataLen); \
NS_IMETHOD ShareData(const char * data, PRInt32 dataLen);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTRINGINPUTSTREAM(_to) \
NS_SCRIPTABLE NS_IMETHOD SetData(const char * data, PRInt32 dataLen) { return _to SetData(data, dataLen); } \
NS_IMETHOD AdoptData(char *data, PRInt32 dataLen) { return _to AdoptData(data, dataLen); } \
NS_IMETHOD ShareData(const char * data, PRInt32 dataLen) { return _to ShareData(data, dataLen); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTRINGINPUTSTREAM(_to) \
NS_SCRIPTABLE NS_IMETHOD SetData(const char * data, PRInt32 dataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetData(data, dataLen); } \
NS_IMETHOD AdoptData(char *data, PRInt32 dataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->AdoptData(data, dataLen); } \
NS_IMETHOD ShareData(const char * data, PRInt32 dataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShareData(data, dataLen); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsStringInputStream : public nsIStringInputStream
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISTRINGINPUTSTREAM
nsStringInputStream();
private:
~nsStringInputStream();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsStringInputStream, nsIStringInputStream)
nsStringInputStream::nsStringInputStream()
{
/* member initializers and constructor code */
}
nsStringInputStream::~nsStringInputStream()
{
/* destructor code */
}
/* void setData (in string data, in long dataLen); */
NS_IMETHODIMP nsStringInputStream::SetData(const char * data, PRInt32 dataLen)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] void adoptData (in charPtr data, in long dataLen); */
NS_IMETHODIMP nsStringInputStream::AdoptData(char *data, PRInt32 dataLen)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] void shareData (in string data, in long dataLen); */
NS_IMETHODIMP nsStringInputStream::ShareData(const char * data, PRInt32 dataLen)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIStringStream_h__ */
|
/* 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_LIB_TRANSFORMS_PASSES_H_
#define TENSORFLOW_COMPILER_MLIR_HLO_LIB_TRANSFORMS_PASSES_H_
#include <memory>
#include "mlir/Pass/Pass.h"
namespace mlir {
//===----------------------------------------------------------------------===//
// Passes
//===----------------------------------------------------------------------===//
/// Creates a pass that reuses buffers which are already allocated.
std::unique_ptr<OperationPass<FuncOp>> createBufferReusePass();
/// Creates a pass that tries to simplify dynamic reshapes.
std::unique_ptr<OperationPass<FuncOp>> createReshapeSimplifierPass();
/// Creates a pass that merges smaller buffer into bigger buffer to optimize
/// memory consumption.
std::unique_ptr<OperationPass<FuncOp>> createBufferPackingPass(
unsigned window_size = 5);
/// Creates a pass that tests the useranges of the UserangeAnalysis.
std::unique_ptr<OperationPass<FuncOp>> createTestUserangePass();
/// Creates a pass that prints the analysis results of ShapeComponentsAnalysis.
std::unique_ptr<OperationPass<FuncOp>> createTestShapeComponentAnalysisPass();
/// Creates a pass that removes redundant operations that implement a
/// CopyOpInterface.
std::unique_ptr<OperationPass<FuncOp>> createCopyRemovalPass();
/// Creates a pass that computes the allocated memory.
std::unique_ptr<OperationPass<FuncOp>> createMemoryCountPass();
} // namespace mlir
#endif // TENSORFLOW_COMPILER_MLIR_HLO_LIB_TRANSFORMS_PASSES_H_
|
/*****************************************************************************
Copyright 2005 - 2010 The Board of Trustees of the University of Illinois.
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.
*****************************************************************************/
/*****************************************************************************
written by
Yunhong Gu, last updated 08/19/2010
*****************************************************************************/
#ifndef __SECTOR_USER_H__
#define __SECTOR_USER_H__
#include <string>
#include <vector>
#include <map>
#include <stdint.h>
#include <osportable.h>
class User
{
public:
int deserialize(std::vector<std::string>& dirs, const std::string& buf);
bool match(const std::string& path, int rwx) const;
void incUseCount();
bool decUseCount();
int getUseCount();
bool hasLoggedOut();
void setLogout(bool logout);
public:
int serialize(char*& buf, int& size);
int deserialize(const char* buf, const int& size);
public:
std::string m_strName; // user name
std::string m_strIP; // client IP address
int m_iPort; // client port (GMP)
int m_iDataPort; // data channel port
int32_t m_iKey; // client key
unsigned char m_pcKey[16]; // client crypto key
unsigned char m_pcIV[8]; // client crypto iv
int64_t m_llLastRefreshTime; // timestamp of last activity
std::vector<std::string> m_vstrReadList; // readable directories
std::vector<std::string> m_vstrWriteList; // writable directories
bool m_bExec; // permission to run Sphere application
int m_iUseCount;
bool m_bLoggedOut;
};
class UserManager
{
public:
UserManager();
~UserManager();
public:
int insert(User* u);
int checkInactiveUsers(std::vector<User*>& iu, int timeout);
int serializeUsers(int& num, std::vector<char*>& buf, std::vector<int>& size);
User* acquire(int key);
void release(User* user);
int remove(int key);
public:
std::map<int, User*> m_mActiveUsers;
CMutex m_Lock;
};
#endif
|
#import <UIKit/UIKit.h>
@interface EMHintsView : UIView
{
// array positions of spotlights
NSMutableArray* _positionArray;
// array radius of spotlights
NSMutableArray* _radiusArray;
}
- (id)initWithFrame:(CGRect)frame;
- (id)initWithFrame:(CGRect)frame forViews:(NSArray*)viewArray;
- (id)initWithFrame:(CGRect)frame withRects:(NSArray*)rectArray;
@end
|
//
// TDDropInAlertView.h
// Tendigi
//
// Created by Nick Lee on 1/12/16.
//
//
#import <Foundation/Foundation.h>
@class TDDropInAlertView;
@protocol TDDropInAlertViewDelegate <NSObject>
@optional
// Called when a button is clicked. The view will be automatically dismissed after this call returns
- (void)alertView:(nonnull TDDropInAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;
- (void)willPresentAlertView:(nonnull TDDropInAlertView *)alertView; // before animation and showing view
- (void)didPresentAlertView:(nonnull TDDropInAlertView *)alertView; // after animation
- (void)alertView:(nonnull TDDropInAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex; // before animation and hiding view
- (void)alertView:(nonnull TDDropInAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; // after animation
/*
Not implemented
// Called when we cancel a view (eg. the user clicks the Home button). This is not called when the user clicks the cancel button.
// If not defined in the delegate, we simulate a click in the cancel button
- (void)alertViewCancel:(nonnull TDDropInAlertView *)alertView;
// Called after edits in any of the default fields added by the style
- (BOOL)alertViewShouldEnableFirstOtherButton:(nonnull TDDropInAlertView *)alertView NS_DEPRECATED_IOS(2_0, 9_0);
*/
@end
@interface TDDropInAlertView : NSObject
@property (nonnull, nonatomic, strong, readonly) UIAlertController *alertController;
- (nonnull instancetype)initWithTitle:(nullable NSString *)title
message:(nullable NSString *)message
delegate:(nullable id /*<UIAlertViewDelegate>*/)delegate
cancelButtonTitle:(nullable NSString *)cancelButtonTitle
otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_DESIGNATED_INITIALIZER;
@property (nullable, nonatomic, weak) id<TDDropInAlertViewDelegate> delegate;
@property (nullable, nonatomic, copy) NSString *title;
@property (nullable, nonatomic, copy) NSString *message; // secondary explanation text
@property (nonatomic, readonly) NSInteger numberOfButtons;
@property (nonatomic, readonly) NSInteger cancelButtonIndex; // if the delegate does not implement -alertViewCancel:, we pretend this button was clicked on. default is -1
@property (nonatomic, readonly, getter=isVisible) BOOL visible;
@property (nonatomic, readonly) NSInteger firstOtherButtonIndex; // -1 if no otherButtonTitles or initWithTitle:... not used
//// adds a button with the title. returns the index (0 based) of where it was added. buttons are displayed in the order added except for the
//// cancel button which will be positioned based on HI requirements. buttons cannot be customized.
- (NSInteger)addButtonWithTitle:(nullable NSString *)title; // returns index of button. 0 based.
- (nullable NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex;
//// shows popup alert animated.
- (void)show;
//// hides alert sheet or popup. use this method when you need to explicitly dismiss the alert.
//// it does not need to be called if the user presses on a button
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;
/*
Text fields not currently implemented
- (nullable UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex NS_AVAILABLE_IOS(5_0);
@property(nonatomic,assign) UIAlertViewStyle alertViewStyle NS_AVAILABLE_IOS(5_0);
*/
@end
|
#ifndef IDT_H
#define IDT_H
#include <stdint.h>
struct IDTEntry {
uint16_t base_address_low;
uint16_t selector;
uint8_t reserved;
uint8_t type : 4;
uint8_t storage_segment : 1;
uint8_t privilege : 2;
uint8_t present : 1;
uint16_t base_address_high;
} __attribute__((packed));
struct IDTDescriptor {
uint16_t limiter;
uint32_t base_address;
} __attribute__((packed));
struct IDT {
struct IDTDescriptor descriptor;
struct IDTEntry entries[129];
} __attribute__((packed));
void idt_init(struct IDT *);
#endif
|
/*******************************************************************************
* Copyright 2015 MobileMan GmbH
* www.mobileman.com
*
* 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.
******************************************************************************/
#define NAV_MODE_FORWARD 0
#define NAV_MODE_BACK 1
#define NAV_MODE_BOTH 2
@interface NavigationView : UIView {
UIButton *backButton, *forwardButton;
UIView *centeredView;
}
- (id)initWithFrame:(CGRect)frame mode:(int)mode;
- (void) setCenteredView:(UIView *)view;
+ (CGRect)standardNavigationViewRect;
@property(readonly) UIButton *backButton, *forwardButton;
@end
|
/*
* Copyright 2020 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.
*/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@end
|
// SPDX-License-Identifier: Apache-2.0
// Copyright 2019 Eotvos Lorand University, Budapest, Hungary
#pragma once
#include <rte_cryptodev.h>
#include "dpdk_lib.h"
#include "dpdk_lib_conf_async.h"
#define MAX_SESSIONS 2048
#define NUM_MBUFS 2048
#define POOL_CACHE_SIZE 128
#define AES_CBC_IV_LENGTH 16
#define AES_CBC_KEY_LENGTH 16
#define IV_OFFSET (sizeof(struct rte_crypto_op) + \
sizeof(struct rte_crypto_sym_op))
#define DEFAULT_XFORM \
(struct rte_crypto_sym_xform) { \
.next = NULL, \
.type = RTE_CRYPTO_SYM_XFORM_CIPHER, \
.cipher = { \
.algo = RTE_CRYPTO_CIPHER_AES_CBC, \
.key = { \
.length = AES_CBC_KEY_LENGTH \
}, \
.iv = { \
.offset = IV_OFFSET, \
.length = AES_CBC_IV_LENGTH \
} \
} \
}
typedef enum {
CRYPTO_TASK_ENCRYPT,
CRYPTO_TASK_DECRYPT,
CRYPTO_TASK_MD5_HMAC
} crypto_task_type_e;
typedef struct {
crypto_task_type_e type;
struct rte_mbuf* data;
uint32_t offset;
uint32_t padding_length;
uint32_t plain_length_to_encrypt;
uint32_t original_plain_length;
} crypto_task_s;
extern struct rte_mempool *crypto_task_pool;
#define MD5_DIGEST_LEN 16
// -----------------------------------------------------------------------------
// Interface
#define CRYPTO_DEVICE_AVAILABLE (cdev_id != -1)
extern int cdev_id;
extern struct rte_cryptodev_sym_session *session_encrypt;
extern struct rte_cryptodev_sym_session *session_decrypt;
extern struct rte_mempool *rte_crypto_op_pool;
void init_crypto_devices();
void crypto_task_to_rte_crypto_op(crypto_task_s *task, struct rte_crypto_op *crypto_op);
void do_encryption_async_impl(SHORT_STDPARAMS);
void do_decryption_async_impl(SHORT_STDPARAMS);
|
/**
* \file
*
* \brief User board definition template
*
*/
/* This file is intended to contain definitions and configuration details for
* features and devices that are available on the board, e.g., frequency and
* startup time for an external crystal, external memory devices, LED and USART
* pins.
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef USER_BOARD_H
#define USER_BOARD_H
#include <conf_board.h>
/*! Board oscillator settings */
#define BOARD_FREQ_SLCK_XTAL (32768U)
#define BOARD_FREQ_SLCK_BYPASS (32768U)
#define BOARD_FREQ_MAINCK_XTAL (12000000U)
#define BOARD_FREQ_MAINCK_BYPASS (12000000U)
/*! Master clock frequency */
#define BOARD_MCK CHIP_FREQ_CPU_MAX
#define BOARD_NO_32K_XTAL
/** board main clock xtal startup time */
#define BOARD_OSC_STARTUP_US 15625
/*! Contactor Pin Definitions */
#define MAIN1_CONTACTOR_PIO PIOB
#define MAIN1_CONTACTOR_PIN PIO_PB6
#define ASTR_CONTACTOR_PIO PIOB
#define ASTR_CONTACTOR_PIN PIO_PB8
#define BSTR_CONTACTOR_PIO PIOB
#define BSTR_CONTACTOR_PIN PIO_PB9
#define PCRG_CONTACTOR_PIO PIOB
#define PCRG_CONTACTOR_PIN PIO_PB7
#define MAIN2_CONTACTOR_PIO PIOB
#define MAIN2_CONTACTOR_PIN PIO_PB10
#define CONTACTORS_PIO PIOB
#define CONTACTORS_PINS ((MAIN1_CONTACTOR_PIN)|(ASTR_CONTACTOR_PIN) \
|(BSTR_CONTACTOR_PIN)|(PCRG_CONTACTOR_PIN) \
|(MAIN2_CONTACTOR_PIN))
/*! User LED and Buzzer Pin Definitions */
#define BUZ_PIO PIOB
#define BUZ_PIN PIO_PB0
#define ULED1_PIO PIOB
#define ULED1_PIN PIO_PB1
#define ULED2_PIO PIOB
#define ULED2_PIN PIO_PB2
#define ULED3_PIO PIOB
#define ULED3_PIN PIO_PB3
#define BUZ_LED_PIO PIOB
#define BUZ_LED_PINS ((BUZ_PIN)|(ULED1_PIN)|(ULED2_PIN)|(ULED3_PIN))
#endif // USER_BOARD_H
|
/*
*
* Created on: 14/08/2011
* Author: sergio
*/
#include "stats.h"
#ifndef PROBABILITY_H_
#define PROBABILITY_H_
class Probability {
public:
Probability();
virtual double* getProbability(tp_mapint delay_fd, int **current_delay, int k) = 0;
};
#endif /* PROBABILITY_H_ */
|
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef ENABLE_LOGS_PREVIEW
# include <atomic>
# include <mutex>
# include "opentelemetry/common/spin_lock_mutex.h"
# include "opentelemetry/sdk/logs/exporter.h"
# include "opentelemetry/sdk/logs/processor.h"
OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace logs
{
/**
* The simple log processor passes all log records
* in a batch of 1 to the configured
* LogExporter.
*
* All calls to the configured LogExporter are synchronized using a
* spin-lock on an atomic_flag.
*/
class SimpleLogProcessor : public LogProcessor
{
public:
explicit SimpleLogProcessor(std::unique_ptr<LogExporter> &&exporter);
virtual ~SimpleLogProcessor() = default;
std::unique_ptr<Recordable> MakeRecordable() noexcept override;
void OnReceive(std::unique_ptr<Recordable> &&record) noexcept override;
bool ForceFlush(
std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override;
bool Shutdown(
std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override;
private:
// The configured exporter
std::unique_ptr<LogExporter> exporter_;
// The lock used to ensure the exporter is not called concurrently
opentelemetry::common::SpinLockMutex lock_;
// The atomic boolean flag to ensure the ShutDown() function is only called once
std::atomic_flag shutdown_latch_ = ATOMIC_FLAG_INIT;
};
} // namespace logs
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE
#endif
|
/*
* File: IAS-LangLib/src/lang/exception/ParseErrorException.h
*
* Copyright (C) 2015, Albert Krzymowski
*
* 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.
*/
/* ChangeLog:
*
*/
#ifndef _IAS_AS_Lang_Exception_ParseErrorException_H_
#define _IAS_AS_Lang_Exception_ParseErrorException_H_
#include <commonlib/commonlib.h>
#include "lang/tools/parser/LexerIStreamWrapper.h"
namespace IAS {
namespace Lang {
/** The class. */
class ParseErrorException : public IAS::Exception {
public:
ParseErrorException();
ParseErrorException(const String& strInfo);
ParseErrorException(const String& strInfo, const String& strFile, int iLine);
ParseErrorException(const String& strInfo, ::IAS::Lang::Tools::Parser::LexerIStreamWrapper* pLexerIStreamWrapper);
virtual ~ParseErrorException() throw();
virtual const char* getName();
};
}
}
#endif /*_IAS_AS_Lang_Exception_ParseErrorException_H_*/
|
#pragma once
class Model
{
public:
Model(void);
~Model(void);
void Render();
private:
unsigned int vboId,ibo_cube_elements;
};
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#pragma once
#include <wtf/StackBounds.h>
#include <wtf/StackStats.h>
#include <wtf/Vector.h>
namespace JSC {
class JSGlobalObject;
class VM;
class VMEntryScope {
public:
JS_EXPORT_PRIVATE VMEntryScope(VM&, JSGlobalObject*);
JS_EXPORT_PRIVATE ~VMEntryScope();
VM& vm() const { return m_vm; }
JSGlobalObject* globalObject() const { return m_globalObject; }
void addDidPopListener(std::function<void ()>);
private:
VM& m_vm;
JSGlobalObject* m_globalObject;
Vector<std::function<void ()>> m_didPopListeners;
};
} // namespace JSC
|
// Copyright (c) 2022 PaddlePaddle 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.
#pragma once
#include <string>
#include "paddle/phi/core/dense_tensor.h"
namespace phi {
template <typename T, typename Context>
void PixelShuffleKernel(const Context& ctx,
const DenseTensor& x,
int upscale_factor,
const std::string& data_format,
DenseTensor* out);
} // namespace phi
|
/**
* Weather APSHTTPClient Library
* Copyright (c) 2009-2014 by Appcelerator, 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 <Foundation/Foundation.h>
@interface APSHTTPPostForm : NSObject
@property(nonatomic, readonly) NSData *requestData;
@property(nonatomic, readonly) NSDictionary *requestHeaders;
@property(nonatomic, readonly) NSString *contentType;
-(void)setJSONData:(id)json;
-(void)setStringData:(NSString*)str;
-(void)appendData:(NSData*)data withContentType:(NSString*)contentType;
-(void)addDictionay:(NSDictionary*)dict;
-(void)addFormKey:(NSString*)key andValue:(NSString*)value;
-(void)addFormFile:(NSString*)path;
-(void)addFormFile:(NSString*)path fieldName:(NSString*)name;
-(void)addFormFile:(NSString*)path fieldName:(NSString*)name contentType:(NSString*)contentType;
-(void)addFormData:(NSData*)data;
-(void)addFormData:(NSData*)data fileName:(NSString*)fileName;
-(void)addFormData:(NSData*)data fileName:(NSString*)fileName fieldName:(NSString*)fieldName;
-(void)addFormData:(NSData*)data fileName:(NSString*)fileName fieldName:(NSString*)fieldName contentType:(NSString*)contentType;
-(void)addHeaderKey:(NSString*)key andHeaderValue:(NSString*)value;
@end
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2022 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 Andrey Abramov
/// @author Vasiliy Nabatchikov
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <atomic>
#include <string_view>
#include "Basics/Result.h"
#include "VocBase/Identifiers/DataSourceId.h"
#include "voc-types.h"
struct TRI_vocbase_t;
namespace arangodb {
namespace velocypack {
class Builder;
} // namespace velocypack
class LogicalCollection;
class LogicalView;
// A common ancestor to all database objects proving access to documents
// e.g. LogicalCollection / LogicalView
class LogicalDataSource {
public:
enum class Category : uint8_t {
kCollection = 1,
kView = 2,
};
LogicalDataSource(LogicalDataSource const& other) = delete;
LogicalDataSource& operator=(LogicalDataSource const& other) = delete;
virtual ~LogicalDataSource() = default;
Category category() const noexcept { return _category; }
bool deleted() const noexcept {
return _deleted.load(std::memory_order_relaxed);
}
virtual Result drop() = 0;
std::string const& guid() const noexcept { return _guid; }
DataSourceId id() const noexcept { return _id; }
std::string const& name() const noexcept { return _name; }
DataSourceId planId() const noexcept { return _planId; }
enum class Serialization : uint8_t {
// object properties will be shown in a list
List = 0,
// object properties will be shown
Properties,
// object will be saved in storage engine
Persistence,
// object will be saved in storage engine
PersistenceWithInProgress,
// object will be replicated or dumped/restored
Inventory
};
//////////////////////////////////////////////////////////////////////////////
/// @brief append a jSON definition of the data-source to the 'builder'
/// @param build the buffer to append to, must be an open object
/// @param ctx defines which properties to serialize
/// @param safe true only for internal, recursive, under lock, usage
/// @return success
//////////////////////////////////////////////////////////////////////////////
Result properties(velocypack::Builder& build, Serialization ctx,
bool safe = false) const;
virtual Result rename(std::string&& newName) = 0;
bool system() const noexcept { return _system; }
TRI_vocbase_t& vocbase() const noexcept { return _vocbase; }
protected:
template<typename DataSource, typename... Args>
explicit LogicalDataSource(DataSource const& /*self*/, Args&&... args)
: LogicalDataSource{DataSource::category(), std::forward<Args>(args)...} {
}
//////////////////////////////////////////////////////////////////////////////
/// @brief append implementation-specific values to the data-source definition
//////////////////////////////////////////////////////////////////////////////
virtual Result appendVPack(velocypack::Builder&, Serialization, bool) const {
return {};
}
void deleted(bool deleted) noexcept {
_deleted.store(deleted, std::memory_order_relaxed);
}
void name(std::string&& name) noexcept { _name = std::move(name); }
private:
//////////////////////////////////////////////////////////////////////////////
/// @brief constructor for a logical data-source taking configuration values
/// from 'definition'
//////////////////////////////////////////////////////////////////////////////
LogicalDataSource(Category category, TRI_vocbase_t& vocbase,
velocypack::Slice definition);
//////////////////////////////////////////////////////////////////////////////
/// @brief constructor for a logical data-source
/// @note 'id' autogenerated IFF 'id' == 0
/// @note 'planId' taken from evaluated value of 'id' IFF 'planId' == 0
/// @note 'guid' autogenerated IFF 'guid'.empty()
//////////////////////////////////////////////////////////////////////////////
LogicalDataSource(Category category, TRI_vocbase_t& vocbase, DataSourceId id,
std::string&& guid, DataSourceId planId, std::string&& name,
bool system, bool deleted);
// members ordered by sizeof(decltype(..)) except for '_guid'
std::string _name; // data-source name
TRI_vocbase_t& _vocbase; // the database where the data-source resides
DataSourceId const _id; // local data-source id (current database node)
DataSourceId const _planId; // global data-source id (cluster-wide)
// globally unique data-source id (cluster-wide) for proper
// initialization must be positioned after '_name' and '_planId'
// since they are autogenerated
std::string const _guid;
std::atomic_bool _deleted; // data-source marked as deleted
Category const _category; // the category of the logical data-source
bool const _system; // this instance represents a system data-source
};
} // namespace arangodb
|
//
// TuSDKCPComponent.h
// TuSDK
//
// Created by Clear Hu on 15/1/2.
// Copyright (c) 2015年 tusdk.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TuSDKCPViewController.h"
/**
* 组件回调结果
*
* @param result 处理结果
* @param error 错误信息
* @param controller 最后执行的控制器
*/
typedef void (^TuSDKCPComponentBlock)(TuSDKResult *result, NSError *error, UIViewController *controller);
#pragma mark - TuSDKCPComponent
/**
* 组件基础类
*/
@interface TuSDKCPComponent : NSObject<TuSDKCPComponentErrorDelegate>
/**
* 来源控制器
*/
@property (nonatomic, assign) UIViewController *sourceController;
/**
* 组件回调
*/
@property (nonatomic, strong) TuSDKCPComponentBlock callbackBlock;
/**
* 当上一个页面是NavigationController时,是否通过 pushViewController 方式打开编辑器视图 (默认:NO,默认以 presentViewController 方式打开)
* SDK 内部组件采用了一致的界面设计,会通过 push 方式打开视图。如果用户开启了该选项,在调用时可能会遇到布局不兼容问题,请谨慎处理。
*/
@property (nonatomic) BOOL autoPushViewController;
/**
* 是否在组件执行完成后自动关闭组件 (默认:NO)
*/
@property (nonatomic) BOOL autoDismissWhenCompelted;
/**
* 初始化组件
*
* @param controller 来源控制器
* @param callbackBlock 组件回调结果
*
* @return controller 组件
*/
+ (instancetype)initWithSourceController:(UIViewController *)controller callbackBlock:(TuSDKCPComponentBlock)callbackBlock;
/**
* 显示组件
*/
- (void)showComponent;
/**
* 通知处理结果
*
* @param result 返回结果
* @param error 异常信息
* @param controller 最后执行的控制器
*/
- (void)notifyResult:(TuSDKResult *)result
error:(NSError *)error
controller:(UIViewController *)controller;
@end
#pragma mark - TuSDKCPInputComponent
/**
* 组件基础类(输入内容)
*/
@interface TuSDKCPInputComponent : TuSDKCPComponent
/**
* 输入的临时文件目录 (处理优先级: inputImage > inputTempFilePath > inputAsset)
*/
@property (nonatomic, copy) NSString *inputTempFilePath;
/**
* 输入的相册图片对象 (处理优先级: inputImage > inputTempFilePath > inputAsset)
*/
@property (nonatomic, retain) id<TuSDKTSAssetInterface> inputAsset;
/**
* 输入的图片对象 (处理优先级: inputImage > inputTempFilePath > inputAsset)
*/
@property (nonatomic, retain) UIImage *inputImage;
@end
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, 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 "TiViewProxy.h"
#import "TiMapAnnotationProxy.h"
#ifdef USE_TI_MAP
@interface TiMapViewProxy : TiViewProxy {
TiMapAnnotationProxy* selectedAnnotation; // Annotation to select on initial display
NSMutableArray* annotationsToAdd; // Annotations to add on initial display
NSMutableArray* annotationsToRemove; // Annotations to remove on initial display
NSMutableArray* routesToAdd;
NSMutableArray* routesToRemove;
int zoomCount; // Number of times to zoom in/out on initial display
}
-(void)addAnnotation:(id)args;
-(void)addAnnotations:(id)args;
-(void)removeAnnotation:(id)args;
-(void)removeAnnotations:(id)args;
-(void)removeAllAnnotations:(id)args;
-(void)selectAnnotation:(id)args;
-(void)deselectAnnotation:(id)args;
-(void)zoom:(id)args;
-(void)addRoute:(id)args;
-(void)removeRoute:(id)args;
@end
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.