text stringlengths 4 6.14k |
|---|
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtOrganizer module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QORGANIZERITEMPARENT_H
#define QORGANIZERITEMPARENT_H
#include <QtOrganizer/qorganizeritemdetail.h>
#include <QtOrganizer/qorganizeritemid.h>
QT_FORWARD_DECLARE_CLASS(QDate)
QT_BEGIN_NAMESPACE_ORGANIZER
class QOrganizerItemId;
/* Leaf class */
class Q_ORGANIZER_EXPORT QOrganizerItemParent : public QOrganizerItemDetail
{
public:
#ifndef Q_QDOC
Q_DECLARE_CUSTOM_ORGANIZER_DETAIL(QOrganizerItemParent, QOrganizerItemDetail::TypeParent)
#endif
enum ParentField {
FieldParentId = TypeParent + 1,
FieldOriginalDate
};
void setParentId(const QOrganizerItemId &parentId);
QOrganizerItemId parentId() const;
void setOriginalDate(const QDate &date);
QDate originalDate() const;
};
QT_END_NAMESPACE_ORGANIZER
#endif // QORGANIZERITEMPARENT_H
|
/* vPFS: Virtualized Parallel File System:
* Performance Virtualization of Parallel File Systems
* Copyright (C) 2009-2012 Yiqi Xu Florida International University
* Laboratory of Virtualized Systems, Infrastructure and Applications (VISA)
*
* 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/>.
*
* See COPYING in top-level directory.
*/
#ifndef SCHEDULER_VDSFQ2_H_
#define SCHEDULER_VDSFQ2_H_
#define __STATIC_SCHEDULER_VDSFQ2__ 1
#include "llist.h"
#include "scheduler_main.h"
#define VDSFQ2_SCHEDULER "VDSFQ2"
#define DEFAULT_VDSFQ2_PROXY_PORT 3336
extern int vdsfq2_depth;
extern int vdsfq2_num_apps;
struct vproxy_message2
{
//int msg_index; //message sequence number
int app_index; //application identifier
int period_count; //periodical sum of bytes transfered for this application in the last period
};
struct vproxy_queue2
{
PINT_llist_p messages;
int size;
};
struct vdsfq2_statistics
{
int request_receive_queue;
int vdsfq_delay_values;
int vdsfq_delay_value_bitmap;
int vdsfq_last_applied_delay;
int vdsfq_last_applied_item_ids;
int vdsfq_app_dispatch;
};
int list_pmsg_print_all(void * item);
extern struct heap *vdsfq2_heap_queue;
struct vdsfq2_queue_item
{
int request_socket;
int start_tag;
int finish_tag;
int delay_value;
int weight;
int last_finish_tag;
int virtual_time;
int delay_applied;
int data_port; //internal forwarding parameter
char* data_ip;
int data_socket;
int socket_tag; //internal forwarding parameter (tag used by pvfs)
int app_index;//differentiates streams, now differentiated by ip
int stream_id;//for identifying previously finished time.
int task_size;
int complete_size;
int got_size;
char* buffer; //request message buffer
int io_type;
int buffer_size;
int unlock_index;
};
struct generic_queue_item * vdsfq2_dequeue(struct dequeue_reason r);
#endif /* SCHEDULER_vDSFQ_H_ */
|
/*
* 2012+ Copyright (c) Alexey Ivanov <rbtz@ph34r.me>
* All rights reserved.
*
* This file is part of Eblob.
*
* Eblob 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.
*
* Eblob 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 General Public License
* along with Eblob. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EBLOB_STAT_H
#define __EBLOB_STAT_H
#include <assert.h>
#include <limits.h>
#include <pthread.h>
#include "eblob/blob.h"
#include "atomic.h"
#define EBLOB_STAT_SIZE_MAX 4096
/* TODO: Add pre-request stats and replace eblob_disk_search_stat with it */
struct eblob_stat_entry {
const char *name;
uint32_t id;
atomic_t value;
};
struct eblob_stat {
struct eblob_stat_entry entry[0];
};
static const struct eblob_stat_entry eblob_stat_default_global[] = {
{
"MIN",
EBLOB_GST_MIN,
{0}
},
{
"datasort_start_time",
EBLOB_GST_DATASORT_START_TIME,
{0}
},
{
"read_copy_updates",
EBLOB_GST_READ_COPY_UPDATE,
{0}
},
{
"prepare_reused",
EBLOB_GST_PREPARE_REUSED,
{0}
},
{
"memory_index_tree",
EBLOB_GST_CACHED,
{0}
},
{
"lookup_reads_number",
EBLOB_GST_LOOKUP_READS_NUMBER,
{0}
},
{
"data_reads_number",
EBLOB_GST_DATA_READS_NUMBER,
{0}
},
{
"writes_number",
EBLOB_GST_WRITES_NUMBER,
{0}
},
{
"reads_size",
EBLOB_GST_READS_SIZE,
{0}
},
{
"writes_size",
EBLOB_GST_WRITES_SIZE,
{0}
},
{
"index_files_reads_number",
EBLOB_GST_INDEX_READS,
{0}
},
{
"datasort_completion_time",
EBLOB_GST_DATASORT_COMPLETION_TIME,
{0}
},
{
"datasort_completion_status",
EBLOB_GST_DATASORT_COMPLETION_STATUS,
{0}
},
{
"MAX",
EBLOB_GST_MAX,
{0}
},
};
static const struct eblob_stat_entry eblob_stat_default_local[] = {
{
"MIN",
EBLOB_LST_MIN,
{0}
},
{
"records_total",
EBLOB_LST_RECORDS_TOTAL,
{0}
},
{
"records_removed",
EBLOB_LST_RECORDS_REMOVED,
{0}
},
{
"records_removed_size",
EBLOB_LST_REMOVED_SIZE,
{0}
},
{
"records_corrupted",
EBLOB_LST_INDEX_CORRUPTED_ENTRIES,
{0}
},
{
"base_size",
EBLOB_LST_BASE_SIZE,
{0}
},
{
"memory_bloom_filter",
EBLOB_LST_BLOOM_SIZE,
{0}
},
{
"memory_index_blocks",
EBLOB_LST_INDEX_BLOCKS_SIZE,
{0}
},
{
"want_defrag",
EBLOB_LST_WANT_DEFRAG,
{0}
},
{
"is_sorted",
EBLOB_LST_IS_SORTED,
{0}
},
{
"MAX",
EBLOB_LST_MAX,
{0}
},
};
static inline
int eblob_stat_init(struct eblob_stat *s, uint32_t id, int64_t value)
{
assert(s != NULL);
assert(id == s->entry[id].id);
return atomic_init(&s->entry[id].value, value);
}
/*!
* Adds \a value to stat with id == \a id
* + Helpers for common case of +/- 1
*/
static inline
void eblob_stat_add(struct eblob_stat *s, uint32_t id, int64_t value)
{
assert(s != NULL);
atomic_add(&s->entry[id].value, value);
}
static inline
void eblob_stat_sub(struct eblob_stat *s, uint32_t id, int64_t value)
{
eblob_stat_add(s, id, -1 * value);
}
static inline
void eblob_stat_inc(struct eblob_stat *s, uint32_t id)
{
eblob_stat_add(s, id, 1);
}
static inline
void eblob_stat_dec(struct eblob_stat *s, uint32_t id)
{
eblob_stat_add(s, id, -1);
}
/*!
* Sets stat with id == \a id value to \a value
*/
static inline
void eblob_stat_set(struct eblob_stat *s, uint32_t id, int64_t value)
{
assert(s != NULL);
assert(id == s->entry[id].id);
atomic_set(&s->entry[id].value, value);
}
/*!
* Returns stat's value by it's \a id
*/
static inline
int64_t eblob_stat_get(struct eblob_stat *s, uint32_t id)
{
assert(s != NULL);
return atomic_read(&s->entry[id].value);
}
void eblob_stat_destroy(struct eblob_stat *s);
int eblob_stat_init_backend(struct eblob_backend *b, const char *path);
int eblob_stat_init_base(struct eblob_base_ctl *bctl);
int eblob_stat_init_local(struct eblob_stat **s);
const char *eblob_stat_get_name(struct eblob_stat *s, uint32_t id);
void eblob_stat_summary_update(struct eblob_backend *b);
int eblob_stat_commit(struct eblob_backend *b);
int eblob_stat_io_get(struct eblob_backend *b, char **stat, uint32_t *size);
#endif /* __EBLOB_STAT_H */
|
#ifndef MY_MULTIBODY_CREATOR
#define MY_MULTIBODY_CREATOR
#include "MultiBodyCreationInterface.h"
#include "LinearMath/btAlignedObjectArray.h"
struct GUIHelperInterface;
class btMultiBody;
class MyMultiBodyCreator : public MultiBodyCreationInterface
{
btMultiBody* m_bulletMultiBody;
struct GUIHelperInterface* m_guiHelper;
public:
btAlignedObjectArray<int> m_mb2urdfLink;
MyMultiBodyCreator(GUIHelperInterface* guiHelper);
virtual ~MyMultiBodyCreator() {}
virtual void createRigidBodyGraphicsInstance(int linkIndex, class btRigidBody* body, const btVector3& colorRgba, int graphicsIndex) ;
///optionally create some graphical representation from a collision object, usually for visual debugging purposes.
virtual void createCollisionObjectGraphicsInstance(int linkIndex, class btCollisionObject* col, const btVector3& colorRgba);
virtual class btMultiBody* allocateMultiBody(int urdfLinkIndex, int totalNumJoints,btScalar mass, const btVector3& localInertiaDiagonal, bool isFixedBase, bool canSleep, bool multiDof);
virtual class btRigidBody* allocateRigidBody(int urdfLinkIndex, btScalar mass, const btVector3& localInertiaDiagonal, const btTransform& initialWorldTrans, class btCollisionShape* colShape);
virtual class btGeneric6DofSpring2Constraint* allocateGeneric6DofSpring2Constraint(int urdfLinkIndex, btRigidBody& rbA /*parent*/, btRigidBody& rbB, const btTransform& offsetInA, const btTransform& offsetInB, int rotateOrder=0);
virtual class btMultiBodyLinkCollider* allocateMultiBodyLinkCollider(int urdfLinkIndex, int mbLinkIndex, btMultiBody* body);
virtual void addLinkMapping(int urdfLinkIndex, int mbLinkIndex);
btMultiBody* getBulletMultiBody();
};
#endif //MY_MULTIBODY_CREATOR
|
// Created file "Lib\src\MMC\ndmgriid"
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(CLSID_ComCacheCleanup, 0xf7a4f1da, 0x96c3, 0x4bcf, 0xbe, 0xb3, 0x1d, 0x9f, 0xfd, 0xe8, 0x9e, 0xe9);
|
/*
*
* Copyright (C) 2015 Miroslav Krajicek (https://github.com/kaajo).
* All Rights Reserved.
*
* This file is part of WebCamCap.
*
* WebCamCap is free software: you can redistribute it and/or modify
* it under the terms of the GNU LGPL version 3 as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* WebCamCap 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 LGPL version 3
* along with WebCamCap. If not, see <http://www.gnu.org/licenses/lgpl-3.0.txt>.
*
*/
#ifndef MARKER_H
#define MARKER_H
#include "webcamcapprimitives_global.h"
#include <QVector3D>
/**
* @author Miroslav Krajicek <mirokrajicek@gmail.com>
* @class Marker marker.h
* @brief Represents Point in 3D space with unique ID.
* This class can be used also for 2D points, z axis has then zero value.
* @date 2015
*/
class WEBCAMCAPPRIMITIVESSHARED_EXPORT Marker
{
int m_id = -1;
QVector3D m_position;
public:
/**
* @brief Marker Constructs Marker with default values (Used for void QVector::reserve(int size) )
*/
Marker();
/**
* @brief Marker constructor
* @param id unique ID of Marker
* @param positionVector position of Marker
*/
Marker(int id, QVector3D positionVector);
QVariantMap toVariantMap() const;
bool fromVariantMap(QVariantMap map);
QVector3D position() const;
void setPosition(const QVector3D &position);
int id() const;
void setId(int id);
///operators
Marker operator -(Marker &point);
Marker operator *(float &val);
Marker operator +(Marker &point);
};
#endif // MARKER_H
|
/*
* The CLFS block definition
*
* Copyright (C) 2010-2021, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* 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 Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined( _FSCLFS_BLOCK_H )
#define _FSCLFS_BLOCK_H
#include <common.h>
#include <types.h>
#if defined( __cplusplus )
extern "C" {
#endif
typedef struct fsclfs_block_header fsclfs_block_header_t;
struct fsclfs_block_header
{
/* The signature
* Consists of 2 bytes
* Contains: 0x15 0x00
*/
uint8_t signature[ 2 ];
/* The fix-up place holder value
* Consists of 1 byte
*/
uint8_t fixup_place_holder;
/* The stream number
* Consists of 1 byte
*/
uint8_t stream_number;
/* The number of sectors
* Consists of 2 bytes
*/
uint8_t number_of_sectors[ 2 ];
/* The copy of the number of sectors
* Consists of 2 bytes
*/
uint8_t number_of_sectors_copy[ 2 ];
/* Unknown
* Consists of 4 bytes
*/
uint8_t unknown1[ 4 ];
/* The checksum
* Consists of 4 bytes
*/
uint8_t checksum[ 4 ];
/* The format version
* Consists of 4 bytes
*/
uint8_t format_version[ 4 ];
/* Unknown
* Consists of 4 bytes
*/
uint8_t unknown2[ 4 ];
/* The physical LSN
* Consists of 8 bytes
*/
uint8_t physical_lsn[ 8 ];
/* The next block LSN
* Consists of 8 bytes
*/
uint8_t next_block_lsn[ 8 ];
/* The record data offset
* Consists of 4 bytes
* The offset is relative to the start of the block
*/
uint8_t record_data_offset[ 4 ];
/* The sector mapping array offset
* Consists of 4 bytes
* The offset is relative to the start of the block
*/
uint8_t sector_mapping_array_offset[ 4 ];
/* The virtual log range array offset
* Consists of 4 bytes
* The offset is relative to the start of the block
*/
uint8_t virtual_log_range_array_offset[ 4 ];
/* Unknown
* Consists of 8 bytes
*/
uint8_t unknown4[ 8 ];
/* Unknown
* Consists of 44 bytes
*/
uint8_t unknown5[ 44 ];
/* The fix-up values offset
* Consists of 4 bytes
* The offset is relative to the start of the block
*/
uint8_t fixup_values_offset[ 4 ];
/* Unknown
* Consists of 4 bytes
*/
uint8_t unknown6[ 4 ];
};
#if defined( __cplusplus )
}
#endif
#endif /* !defined( _FSCLFS_BLOCK_H ) */
|
/**************************************************************************//**
* @file drv_trimmer.h
* @brief Trimmer driver.
* @author A. Filyanov
******************************************************************************/
#ifndef _DRV_TRIMMER_H_
#define _DRV_TRIMMER_H_
//-----------------------------------------------------------------------------
extern HAL_DriverItf drv_trimmer;
#endif // _DRV_TRIMMER_H_ |
// ============================================================================
//
// = LIBRARY
// ULib - c++ library
//
// = FILENAME
// mod_soap.h
//
// = AUTHOR
// Stefano Casazza
//
// ============================================================================
#ifndef U_MOD_SOAP_H
#define U_MOD_SOAP_H 1
#include <ulib/net/server/server_plugin.h>
class USOAPParser;
class U_EXPORT USoapPlugIn : public UServerPlugIn {
public:
// Check for memory error
U_MEMORY_TEST
// COSTRUTTORI
USoapPlugIn();
virtual ~USoapPlugIn();
// define method VIRTUAL of class UServerPlugIn
// Server-wide hooks
virtual int handlerConfig(UFileConfig& cfg) U_DECL_FINAL;
virtual int handlerInit() U_DECL_FINAL;
// Connection-wide hooks
virtual int handlerRequest() U_DECL_FINAL;
// DEBUG
#if defined(U_STDCPP_ENABLE) && defined(DEBUG)
const char* dump(bool reset) const;
#endif
protected:
static USOAPParser* soap_parser;
private:
#ifdef U_COMPILER_DELETE_MEMBERS
USoapPlugIn(const USoapPlugIn&) = delete;
USoapPlugIn& operator=(const USoapPlugIn&) = delete;
#else
USoapPlugIn(const USoapPlugIn&) : UServerPlugIn() {}
USoapPlugIn& operator=(const USoapPlugIn&) { return *this; }
#endif
};
#endif
|
//
// UIView+PYUIKit.h
// PYUIKit
//
// Created by Push Chen on 7/30/13.
// Copyright (c) 2013 Push Lab. All rights reserved.
//
/*
LGPL V3 Lisence
This file is part of cleandns.
PYUIKit 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.
PYData 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 cleandns. If not, see <http://www.gnu.org/licenses/>.
*/
/*
LISENCE FOR IPY
COPYRIGHT (c) 2013, Push Chen.
ALL RIGHTS RESERVED.
REDISTRIBUTION AND USE IN SOURCE AND BINARY
FORMS, WITH OR WITHOUT MODIFICATION, ARE
PERMITTED PROVIDED THAT THE FOLLOWING CONDITIONS
ARE MET:
YOU USE IT, AND YOU JUST USE IT!.
WHY NOT USE THIS LIBRARY IN YOUR CODE TO MAKE
THE DEVELOPMENT HAPPIER!
ENJOY YOUR LIFE AND BE FAR AWAY FROM BUGS.
*/
#import <UIKit/UIKit.h>
@interface UIView (PYUIKit)
/* Search for all sub views to find the first responsder */
- (UIView *)findFirstResponsder;
/* From the subview, to get the frame in specified superview */
- (CGPoint)originInSuperview:(UIView *)specifiedSuperview;
/* Capture the screen */
+ (UIImage *)captureScreen;
// Corner Radius
@property (nonatomic, assign) CGFloat cornerRadius;
// Border
@property (nonatomic, assign) CGFloat borderWidth;
@property (nonatomic, strong) UIColor *borderColor;
// Drop Shadow
@property (nonatomic, strong) UIColor *dropShadowColor;
@property (nonatomic, assign) CGFloat dropShadowRadius;
@property (nonatomic, assign) CGFloat dropShadowOpacity;
@property (nonatomic, assign) CGSize dropShadowOffset;
@property (nonatomic, assign) UIBezierPath *dropShadowPath;
// Add sub layer or sub view.
- (void)addChild:(id)child;
@end
// @littlepush
// littlepush@gmail.com
// PYLab
|
/*
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_LISTCUSTOMVERIFICATIONEMAILTEMPLATESREQUEST_P_H
#define QTAWS_LISTCUSTOMVERIFICATIONEMAILTEMPLATESREQUEST_P_H
#include "sesrequest_p.h"
#include "listcustomverificationemailtemplatesrequest.h"
namespace QtAws {
namespace SES {
class ListCustomVerificationEmailTemplatesRequest;
class ListCustomVerificationEmailTemplatesRequestPrivate : public SesRequestPrivate {
public:
ListCustomVerificationEmailTemplatesRequestPrivate(const SesRequest::Action action,
ListCustomVerificationEmailTemplatesRequest * const q);
ListCustomVerificationEmailTemplatesRequestPrivate(const ListCustomVerificationEmailTemplatesRequestPrivate &other,
ListCustomVerificationEmailTemplatesRequest * const q);
private:
Q_DECLARE_PUBLIC(ListCustomVerificationEmailTemplatesRequest)
};
} // namespace SES
} // namespace QtAws
#endif
|
/*
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_CREATESERVERREQUEST_P_H
#define QTAWS_CREATESERVERREQUEST_P_H
#include "transferrequest_p.h"
#include "createserverrequest.h"
namespace QtAws {
namespace Transfer {
class CreateServerRequest;
class CreateServerRequestPrivate : public TransferRequestPrivate {
public:
CreateServerRequestPrivate(const TransferRequest::Action action,
CreateServerRequest * const q);
CreateServerRequestPrivate(const CreateServerRequestPrivate &other,
CreateServerRequest * const q);
private:
Q_DECLARE_PUBLIC(CreateServerRequest)
};
} // namespace Transfer
} // namespace QtAws
#endif
|
/*
Copyright (C) 2007-2010 Kasidit Yusuf.
This file is part of WMouseXP.
WMouseXP 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.
WMouseXP 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 WMouseXP. If not, see <http://www.gnu.org/licenses/>.
*/
// WidcommFoundDevice.h: interface for the CWidcommFoundDevice class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_WIDCOMMFOUNDDEVICE_H__24572E76_361A_48DA_B11D_571BCE081807__INCLUDED_)
#define AFX_WIDCOMMFOUNDDEVICE_H__24572E76_361A_48DA_B11D_571BCE081807__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "btifdefinitions.h"
class CWidcommFoundDevice
{
public:
CWidcommFoundDevice(BD_ADDR addr, BD_NAME name);
virtual ~CWidcommFoundDevice();
BD_ADDR iAddr;
BD_NAME iName;
UINT8 iWMouseXPscn;
};
#endif // !defined(AFX_WIDCOMMFOUNDDEVICE_H__24572E76_361A_48DA_B11D_571BCE081807__INCLUDED_)
|
/*
* Copyright (C) 2017 Université Clermont Auvergne, CNRS/IN2P3, LPC
* Author: Valentin NIESS (niess@in2p3.fr)
*
* Topographic Utilities for tRansporting parTicules over Long rangEs (TURTLE)
*
* 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 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, see <http://www.gnu.org/licenses/>
*/
/*
* Turtle projection map handle for managing local maps.
*/
#ifndef TURTLE_MAP_H
#define TURTLE_MAP_H
/* C89 standard library */
#include <stdint.h>
/* Turtle library */
#include "turtle/list.h"
#include "turtle/projection.h"
/* Callbacks for getting and setting elevation data */
struct turtle_map;
typedef double turtle_map_getter_t(
const struct turtle_map * map, int ix, int iy);
typedef void turtle_map_setter_t(
struct turtle_map * map, int ix, int iy, double z);
/* Header container for map meta data */
struct turtle_map_meta {
/* Map meta data */
int nx, ny;
double x0, y0, z0;
double dx, dy, dz;
/* Callbacks for getting and setting elevation data */
turtle_map_getter_t * get_z;
turtle_map_setter_t * set_z;
/* Data encoding format */
char encoding[8];
/* Projection */
struct turtle_projection projection;
};
/* Container for a map */
struct turtle_map {
struct turtle_list_element element;
/* Meta data */
struct turtle_map_meta meta;
/* Stack data */
struct turtle_stack * stack;
int clients;
/* Placeholder for raw elevation data */
uint16_t data[];
};
enum turtle_return turtle_map_elevation_(const struct turtle_map * map,
double x, double y, double * z, int * inside,
struct turtle_error_context * error_);
enum turtle_return turtle_map_load_(struct turtle_map ** map, const char * path,
struct turtle_error_context * error_);
#endif
|
#pragma once
#include "Opcode.h"
namespace AISCRIPT
{
class Order_Region : public Opcode
{
public:
// Ctor
Order_Region(AISCRIPT::Enum::Enum n) : Opcode(n) {};
// Execute
virtual bool execute(aithread &thread) const;
};
}
|
#define QUEUE_ITEM_T int
#include <assert.h>
#define FSQLF_QUEUE_INIT_CAPACITY (1)
#include "queue.h"
#include "queue.c"
void test_queue()
{
QUEUE_ITEM_T item1 = 11;
QUEUE_ITEM_T item2 = 22;
QUEUE_ITEM_T item3 = 33;
QUEUE_ITEM_T item4 = 44;
QUEUE_ITEM_T tmp;
struct FSQLF_queue tq;
// At first
FSQLF_queue_init(&tq, sizeof(int));
// ..queue should be empty.
assert(FSQLF_queue_empty(&tq));
// After adding one item
FSQLF_queue_push_back(&tq, &item1);
// .. queue should become non-empty
// .. and length should be 1.
assert(!FSQLF_queue_empty(&tq));
assert((tq.length) == 1);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 11);
// Push_back some more items
FSQLF_queue_push_back(&tq, &item2);
FSQLF_queue_push_back(&tq, &item3);
FSQLF_queue_push_back(&tq, &item4);
// .. and do the checks again.
assert(!FSQLF_queue_empty(&tq));
assert(tq.length==4);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 11);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 22);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 3) == 44);
// Now drop_head and push_back couple of times repeatedly.
// (to check if wrapping works correctly)
FSQLF_queue_drop_head(&tq);
assert(tq.length==3);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 22);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 44);
FSQLF_queue_push_back(&tq, &item3);
assert(tq.length==4);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 22);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 44);
assert(*(int*)FSQLF_queue_peek_n(&tq, 3) == 33);
FSQLF_queue_drop_head(&tq);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 44);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 33);
FSQLF_queue_push_back(&tq, &item2);
assert(tq.length==4);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 44);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 3) == 22);
FSQLF_queue_drop_head(&tq);
assert(tq.length==3);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 44);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 22);
FSQLF_queue_push_back(&tq, &item1);
assert(tq.length==4);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 44);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 22);
assert(*(int*)FSQLF_queue_peek_n(&tq, 3) == 11);
FSQLF_queue_push_back(&tq, &item2);
FSQLF_queue_push_back(&tq, &item1);
FSQLF_queue_push_back(&tq, &item3);
FSQLF_queue_push_back(&tq, &item4);
assert(tq.length==8);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 44);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 2) == 22);
assert(*(int*)FSQLF_queue_peek_n(&tq, 3) == 11);
assert(*(int*)FSQLF_queue_peek_n(&tq, 4) == 22);
assert(*(int*)FSQLF_queue_peek_n(&tq, 5) == 11);
assert(*(int*)FSQLF_queue_peek_n(&tq, 6) == 33);
assert(*(int*)FSQLF_queue_peek_n(&tq, 7) == 44);
// Now dropp till it's empty.
FSQLF_queue_drop_head(&tq); assert(tq.length == 7);
FSQLF_queue_drop_head(&tq); assert(tq.length == 6);
FSQLF_queue_drop_head(&tq); assert(tq.length == 5);
FSQLF_queue_drop_head(&tq); assert(tq.length == 4);
FSQLF_queue_drop_head(&tq); assert(tq.length == 3);
FSQLF_queue_drop_head(&tq); assert(tq.length == 2);
FSQLF_queue_drop_head(&tq); assert(tq.length == 1);
FSQLF_queue_drop_head(&tq); assert(tq.length == 0);
assert(FSQLF_queue_empty(&tq));
}
void test_queue_internals()
{
struct FSQLF_queue tq;
FSQLF_queue_init(&tq, sizeof(int));
FSQLF_queue_push_back(&tq, &(int){0});
FSQLF_queue_push_back(&tq, &(int){1});
assert(tq.start == 0);
assert(tq.length == 2);
assert(tq.capacity == 2);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 0);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 1);
FSQLF_queue_drop_head(&tq);
FSQLF_queue_push_back(&tq, &(int){2});
assert(tq.start == 1);
assert(tq.length == 2);
assert(tq.capacity == 2);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 1);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 2);
FSQLF_queue_drop_head(&tq);
FSQLF_queue_push_back(&tq, &(int){3});
assert(tq.start == 0);
assert(tq.length == 2);
assert(tq.capacity == 2);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 2);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 3);
FSQLF_queue_drop_head(&tq);
FSQLF_queue_push_back(&tq, &(int){4});
assert(tq.start == 1);
assert(tq.length == 2);
assert(tq.capacity == 2);
assert(*(int*)FSQLF_queue_peek_n(&tq, 0) == 3);
assert(*(int*)FSQLF_queue_peek_n(&tq, 1) == 4);
}
void test_queue_array_pos()
{
size_t i;
for (i = 0; i < 10; i++) assert(queue_array_pos(i, 0, 10) == i);
// Lets imagine internal array of capacity 5
// and queue that starts at element 2 in internal array:
// 0 1 2 3 4 <- internal array positions
// 3 4 0 1 2 <- queue elements
assert(queue_array_pos(0, 2, 5) == 2);
assert(queue_array_pos(1, 2, 5) == 3);
assert(queue_array_pos(2, 2, 5) == 4);
assert(queue_array_pos(3, 2, 5) == 0);
assert(queue_array_pos(4, 2, 5) == 1);
}
int main()
{
test_queue_array_pos();
test_queue_internals();
test_queue();
return 0;
}
|
/*
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_MODIFYSNAPSHOTSCHEDULEREQUEST_P_H
#define QTAWS_MODIFYSNAPSHOTSCHEDULEREQUEST_P_H
#include "redshiftrequest_p.h"
#include "modifysnapshotschedulerequest.h"
namespace QtAws {
namespace Redshift {
class ModifySnapshotScheduleRequest;
class ModifySnapshotScheduleRequestPrivate : public RedshiftRequestPrivate {
public:
ModifySnapshotScheduleRequestPrivate(const RedshiftRequest::Action action,
ModifySnapshotScheduleRequest * const q);
ModifySnapshotScheduleRequestPrivate(const ModifySnapshotScheduleRequestPrivate &other,
ModifySnapshotScheduleRequest * const q);
private:
Q_DECLARE_PUBLIC(ModifySnapshotScheduleRequest)
};
} // namespace Redshift
} // namespace QtAws
#endif
|
//
// Created by cub3d on 14/07/2018.
//
#ifndef UNKNOWN_DEVELOPMENT_TOOL_SOUND_H
#define UNKNOWN_DEVELOPMENT_TOOL_SOUND_H
#include <SDL_mixer.h>
namespace Unknown
{
class Sound
{
int channel = -1;
protected:
Mix_Chunk *chunk;
public:
Sound(Mix_Chunk *chunk);
void play(int loops);
void playSingle();
bool isPlaying() const;
virtual void init();
virtual ~Sound();
};
}
#endif //UNKNOWN_DEVELOPMENT_TOOL_SOUND_H
|
#ifndef _CTYPE_H
#define _CTYPE_H
#define _UPPER 0x0001
#define _LOWER 0x0002
#define _DIGIT 0x0004
#define _SPACE 0x0008
#define _PUNCT 0x0010
#define _CNTRL 0x0020
#define _BLANK 0x0040
#define _XDIGIT 0x0080
#define _ALPHA (0x0100 | _UPPER | _LOWER)
#define _ALNUM (_ALPHA | _DIGIT)
#define _GRAPH (_ALNUM | _PUNCT)
#define _PRINT (_GRAPH | _BLANK)
#define isalnum(c) ((int) (_ptype[(int) (c)] & _ALNUM))
#define isalpha(c) ((int) (_ptype[(int) (c)] & _ALPHA))
#define iscntrl(c) ((int) (_ptype[(int) (c)] & _CNTRL))
#define isdigit(c) ((int) (_ptype[(int) (c)] & _DIGIT))
#define isgraph(c) ((int) (_ptype[(int) (c)] & _GRAPH))
#define islower(c) ((int) (_ptype[(int) (c)] & _LOWER))
#define isprint(c) ((int) (_ptype[(int) (c)] & _PRINT))
#define ispunct(c) ((int) (_ptype[(int) (c)] & _PUNCT))
#define isspace(c) ((int) (_ptype[(int) (c)] & _SPACE))
#define isupper(c) ((int) (_ptype[(int) (c)] & _UPPER))
#define isxdigit(c) ((int) (_ptype[(int) (c)] & _XDIGIT))
#define tolower(c) ((int) (_plmap[(int) (c)]))
#define toupper(c) ((int) (_pumap[(int) (c)]))
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern const unsigned short int *_ptype;
extern const short int *_plmap;
extern const short int *_pumap;
int (isalnum)(int);
int (isalpha)(int);
int (iscntrl)(int);
int (isdigit)(int);
int (isgraph)(int);
int (islower)(int);
int (isprint)(int);
int (ispunct)(int);
int (isspace)(int);
int (isupper)(int);
int (isxdigit)(int);
int (tolower)(int);
int (toupper)(int);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _CTYPE_H */
|
#include "artemis.h"
#include <assert.h>
static void *
handle_path(void *data) {
assert(data);
/* workers just crawl paths, for now */
entry_crawl((char *) data, &state_enter);
return data;
}
#include <stdlib.h>
#include <stdio.h>
#define MAX_THREADS 4
static void
print_usage(char *name)
{
fprintf(stderr, "[NOTE] MAX_THREADS = %d\n", MAX_THREADS);
fprintf(stderr, "[USAGE] %s filepath...\n", name);
}
#include <stdarg.h>
#include <time.h>
#define BUFFER_SIZE 1024
static void
print_stamp(FILE *target, const char *format, ...)
{
time_t time_stamp;
/* format arguments */
va_list arguments;
char buffer[BUFFER_SIZE];
assert(target && format);
va_start(arguments, format);
vsnprintf(buffer, BUFFER_SIZE, format, arguments);
va_end(arguments);
buffer[BUFFER_SIZE - 1] = '\0';
/* dump a time-stamped log event */
(void) time(&time_stamp);
fprintf(target, "[ARTEMIS] said '%s' at %s", buffer, ctime(&time_stamp));
fflush(target);
}
#define LOG_FILE "artemis.log"
static FILE *
stdlog = NULL;
static void *
handle_event(void *data)
{
assert(data);
print_stamp(stdlog, (const char *) data);
return data;
}
static void
hunt(FILE *, char **, int);
int
main(int argc, char *argv[])
{
/* sanity-check arguments */
if (argc < 2 || argc - 1 > MAX_THREADS) {
print_usage(argv[0]);
return EXIT_SUCCESS;
}
/* log diagnostics to file */
if (!(stdlog = fopen(LOG_FILE, "a+"))) {
return EXIT_FAILURE;
}
/* use a thread pool to manage work */
if (!tpool(MAX_THREADS, &handle_event)) {
print_stamp(stdlog, "the hunt is on");
hunt(stdlog, argv + 1, argc - 1);
print_stamp(stdlog, "we will bury them");
}
/* halt logging */
if (fclose(stdlog)) {
/* FIXME(teh) fclose failed */
}
/* print debug info */
state_dump(stdout);
return EXIT_SUCCESS;
}
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#define GLYPHS "/-\\|"
static void
hunt(FILE *log, char *argv[], int argc)
{
int i, n;
struct stat info;
if (!log) log = stderr;
/* queue everything as a work units, separate threads */
for (i = n = 0; i < argc; ++i) {
if (lstat(argv[i], &info)) {
/* FIXME lstat failed, pass on invalid path */
fprintf(log, "[WARNING] %s (skipped invalid path)\n", argv[i]);
} else { /* FIXME can read? */
n += tpool_queue(&handle_path, argv[i], &tpool_bijection);
fprintf(stderr, "[DEBUG] queued %d jobs(s)\n", n);
}
}
/* block here until n jobs have finished */
while (tpool_flush(n)) {
fprintf(stderr,
"[%c] crawl found %lu entries so far (currently using %d jobs)\r",
GLYPHS[++i % (sizeof(GLYPHS) - 1)],
(unsigned long) state_count(),
MAX_THREADS - tpool_slots());
sleep(100000);
}
}
|
/* mpfr_get_flt -- convert a mpfr_t to a machine single precision float
Copyright 2009-2019 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
The GNU MPFR 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 3 of the License, or (at your
option) any later version.
The GNU MPFR 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 MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <float.h> /* for FLT_MIN */
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
#include "ieee_floats.h"
#define FLT_NEG_ZERO ((float) DBL_NEG_ZERO)
#define MPFR_FLT_INFM ((float) MPFR_DBL_INFM)
#define MPFR_FLT_INFP ((float) MPFR_DBL_INFP)
float
mpfr_get_flt (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
{
int negative;
mpfr_exp_t e;
float d;
/* in case of NaN, +Inf, -Inf, +0, -0, the conversion from double to float
is exact */
if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (src)))
return (float) mpfr_get_d (src, rnd_mode);
e = MPFR_GET_EXP (src);
negative = MPFR_IS_NEG (src);
if (MPFR_UNLIKELY(rnd_mode == MPFR_RNDA))
rnd_mode = negative ? MPFR_RNDD : MPFR_RNDU;
/* FIXME: The code below assumes the IEEE-754 binary32 format
with subnormal support. Fix it by converting to double, then
to float, and in case of binary radix (for which we want
correct rounding), handle double-rounding issues somewhere
in the code? */
/* the smallest positive normal float number is 2^(-126) = 0.5*2^(-125),
and the smallest positive subnormal number is 2^(-149) = 0.5*2^(-148) */
if (MPFR_UNLIKELY (e < -148))
{
/* |src| < 2^(-149), i.e., |src| is smaller than the smallest positive
subnormal number.
In round-to-nearest mode, 2^(-150) is rounded to zero.
*/
d = negative ?
(rnd_mode == MPFR_RNDD ||
(rnd_mode == MPFR_RNDN && mpfr_cmp_si_2exp (src, -1, -150) < 0)
? -FLT_MIN : FLT_NEG_ZERO) :
(rnd_mode == MPFR_RNDU ||
(rnd_mode == MPFR_RNDN && mpfr_cmp_si_2exp (src, 1, -150) > 0)
? FLT_MIN : 0.0);
if (d != 0.0) /* we multiply FLT_MIN = 2^(-126) by FLT_EPSILON = 2^(-23)
to get +-2^(-149) */
d *= FLT_EPSILON;
}
/* the largest normal number is 2^128*(1-2^(-24)) = 0.111...111e128 */
else if (MPFR_UNLIKELY (e > 128))
{
d = negative ?
(rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDU ?
-FLT_MAX : MPFR_FLT_INFM) :
(rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDD ?
FLT_MAX : MPFR_FLT_INFP);
}
else /* -148 <= e <= 127 */
{
int nbits;
mp_size_t np, i;
mp_limb_t tp[MPFR_LIMBS_PER_FLT];
int carry;
double dd;
nbits = IEEE_FLT_MANT_DIG; /* 24 */
if (MPFR_UNLIKELY (e < -125))
/*In the subnormal case, compute the exact number of significant bits*/
{
nbits += (125 + e);
MPFR_ASSERTD (nbits >= 1);
}
np = MPFR_PREC2LIMBS (nbits);
MPFR_ASSERTD(np <= MPFR_LIMBS_PER_FLT);
carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative,
nbits, rnd_mode);
/* we perform the reconstruction using the 'double' type here,
knowing the result is exactly representable as 'float' */
if (MPFR_UNLIKELY(carry))
dd = 1.0;
else
{
/* The following computations are exact thanks to the previous
mpfr_round_raw. */
dd = (double) tp[0] / MP_BASE_AS_DOUBLE;
for (i = 1 ; i < np ; i++)
dd = (dd + tp[i]) / MP_BASE_AS_DOUBLE;
/* dd is the mantissa (between 1/2 and 1) of the argument rounded
to 24 bits */
}
dd = mpfr_scale2 (dd, e);
if (negative)
dd = -dd;
/* convert (exactly) to float */
d = (float) dd;
}
return d;
}
|
/*****************************************************************************
The Dark Mod GPL Source Code
This file is part of the The Dark Mod Source Code, originally based
on the Doom 3 GPL Source Code as published in 2011.
The Dark Mod Source Code 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. For details, see LICENSE.TXT.
Project: The Dark Mod (http://www.thedarkmod.com/)
$Revision$ (Revision of last commit)
$Date$ (Date of last commit)
$Author$ (Author of last commit)
******************************************************************************/
#ifndef _MISSION_DOWNLOAD_MANAGER_H_
#define _MISSION_DOWNLOAD_MANAGER_H_
#include <map>
#include "Download.h"
/**
* The class handling the actual mission downloads.
*/
class CDownloadManager {
private:
// Ongoing downloads
typedef std::map<int, CDownloadPtr> Downloads;
Downloads _downloads;
int _nextAvailableId;
bool _allDownloadsDone;
public:
CDownloadManager();
void ProcessDownloads();
void ClearDownloads();
int AddDownload( const CDownloadPtr &download );
void RemoveDownload( int id );
CDownloadPtr GetDownload( int id );
// Returns true if there is a download already in progress
bool DownloadInProgress();
};
typedef boost::shared_ptr<CDownloadManager> CDownloadManagerPtr;
#endif /* _MISSION_DOWNLOAD_MANAGER_H_ */
|
/*
* piGlow.c:
* Easy access to the Pimoroni PiGlow board.
*
* Copyright (c) 2013 Gordon Henderson.
***********************************************************************
* This file is part of wiringPi:
* https://projects.drogon.net/raspberry-pi/wiringpi/
*
* wiringPi 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.
*
* wiringPi 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 wiringPi. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************
*/
#include <wiringPi.h>
#include <sn3218.h>
#include "piGlow.h"
#define PIGLOW_BASE 577
static int leg0 [6] = { 6, 7, 8, 5, 4, 9 } ;
static int leg1 [6] = { 17, 16, 15, 13, 11, 10 } ;
static int leg2 [6] = { 0, 1, 2, 3, 14, 12 } ;
/*
* piGlow1:
* Light up an individual LED
*********************************************************************************
*/
void piGlow1 (const int leg, const int ring, const int intensity)
{
int *legLeds ;
if ((leg < 0) || (leg > 2)) return ;
if ((ring < 0) || (ring > 5)) return ;
/**/ if (leg == 0)
legLeds = leg0 ;
else if (leg == 1)
legLeds = leg1 ;
else
legLeds = leg2 ;
analogWrite (PIGLOW_BASE + legLeds [ring], intensity) ;
}
/*
* piGlowLeg:
* Light up all 6 LEDs on a leg
*********************************************************************************
*/
void piGlowLeg (const int leg, const int intensity)
{
int i ;
int *legLeds ;
if ((leg < 0) || (leg > 2))
return ;
/**/ if (leg == 0)
legLeds = leg0 ;
else if (leg == 1)
legLeds = leg1 ;
else
legLeds = leg2 ;
for (i = 0 ; i < 6 ; ++i)
analogWrite (PIGLOW_BASE + legLeds [i], intensity) ;
}
/*
* piGlowRing:
* Light up 3 LEDs in a ring. Ring 0 is the outermost, 5 the innermost
*********************************************************************************
*/
void piGlowRing (const int ring, const int intensity)
{
if ((ring < 0) || (ring > 5))
return ;
analogWrite (PIGLOW_BASE + leg0 [ring], intensity) ;
analogWrite (PIGLOW_BASE + leg1 [ring], intensity) ;
analogWrite (PIGLOW_BASE + leg2 [ring], intensity) ;
}
/*
* piGlowSetup:
* Initialise the board & remember the pins we're using
*********************************************************************************
*/
void piGlowSetup (int clear)
{
sn3218Setup (PIGLOW_BASE) ;
if (clear)
{
piGlowLeg (0, 0) ;
piGlowLeg (1, 0) ;
piGlowLeg (2, 0) ;
}
}
|
#include "tlpi_hdr.h"
#include <signal.h>
static void handler(int signum) {
char buf[64];
snprintf(buf, 63, "Caught signal %d (%s)\n", signum, strsignal(signum));
buf[63] = '\0';
write(STDOUT_FILENO, buf, strlen(buf));
}
int main(int argc, char *argv[]) {
struct sigaction sa;
sigemptyset(&sa.sa_mask);
sa.sa_handler = handler;
sa.sa_flags = 0;
if (sigaction(SIGCHLD, &sa, NULL) == -1)
errExit("sigaction error");
printf("Before system()\n");
if (system("sleep 1") == -1)
errExit("system error");
printf("After system()\n");
sleep(1);
return 0;
}
|
/*****************************************************************************
The Dark Mod GPL Source Code
This file is part of the The Dark Mod Source Code, originally based
on the Doom 3 GPL Source Code as published in 2011.
The Dark Mod Source Code 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. For details, see LICENSE.TXT.
Project: The Dark Mod Updater (http://www.thedarkmod.com/)
$Revision$ (Revision of last commit)
$Date$ (Date of last commit)
$Author$ (Author of last commit)
******************************************************************************/
#pragma once
#include <boost/program_options.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "Http/HttpConnection.h"
#include "TraceLog.h"
namespace bpo = boost::program_options;
namespace tdm
{
class ProgramOptions
{
protected:
bpo::options_description _desc;
bpo::variables_map _vm;
// The command line arguments for reference
std::vector<std::string> _cmdLineArgs;
public:
virtual ~ProgramOptions()
{}
void ParseFromCommandLine(int argc, char* argv[])
{
try
{
bpo::store(bpo::parse_command_line(argc, argv, _desc), _vm);
bpo::notify(_vm);
}
catch (bpo::unknown_option& o)
{
TraceLog::WriteLine(LOG_STANDARD, " " + std::string(o.what()));
}
}
void Set(const std::string& key)
{
_vm.insert(std::make_pair(key, bpo::variable_value()));
_cmdLineArgs.push_back("--" + key);
}
void Set(const std::string& key, const std::string& value)
{
_vm.insert(std::make_pair(key, bpo::variable_value(value, false)));
_cmdLineArgs.push_back("--" + key + "=" + value);
}
void Unset(const std::string& key)
{
_vm.erase(key);
for (std::vector<std::string>::iterator i = _cmdLineArgs.begin();
i != _cmdLineArgs.end(); ++i)
{
if (boost::algorithm::starts_with(*i, "--" + key))
{
_cmdLineArgs.erase(i);
break;
}
}
}
bool Empty() const
{
return _vm.empty();
}
bool IsSet(const std::string& key) const
{
return _vm.count(key) > 0;
}
std::string Get(const std::string& key) const
{
return _vm.count(key) > 0 ? _vm[key].as<std::string>() : "";
}
const std::vector<std::string>& GetRawCmdLineArgs() const
{
return _cmdLineArgs;
}
virtual void PrintHelp()
{
std::ostringstream stream;
_desc.print(stream);
TraceLog::WriteLine(LOG_STANDARD, " " + stream.str());
}
protected:
/**
* Subclasses should implement this method to populate the available options
* and call it in their constructors.
*/
virtual void SetupDescription() = 0;
};
}
|
/*
* Copyright CEA/DAM/DIF 2010
* Author: Philippe Deniel (philippe.deniel@cea.fr)
*
* --------------------------
*
* 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
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef _SOLARIS
#include "solaris_port.h"
#endif
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/file.h> /* for having FNDELAY */
#include "HashData.h"
#include "HashTable.h"
#include "rpc.h"
#include "log.h"
#include "stuff_alloc.h"
#include "nfs23.h"
#include "nfs4.h"
#include "nfs_core.h"
#include "cache_inode.h"
#include "cache_content.h"
#include "nfs_exports.h"
#include "nfs_creds.h"
#include "nfs_tools.h"
#include "mount.h"
#include "rquota.h"
#include "nfs_proto_functions.h"
/**
* rquota_Null: The Rquota ount proc null function, for all versions.
*
* The RQUOTA proc null function, for all versions.
*
* @param parg [IN] ignored
* @param pexportlist [IN] ignored
* @param pcontextp [IN] ignored
* @param pclient [INOUT] ignored
* @param ht [INOUT] ignored
* @param preq [IN] ignored
* @param pres [OUT] ignored
*
*/
int rquota_Null(nfs_arg_t * parg /* IN */ ,
exportlist_t * pexport /* IN */ ,
fsal_op_context_t * pcontext /* IN */ ,
cache_inode_client_t * pclient /* INOUT */ ,
hash_table_t * ht /* INOUT */ ,
struct svc_req *preq /* IN */ ,
nfs_res_t * pres /* OUT */ )
{
LogFullDebug(COMPONENT_NFSPROTO, "REQUEST PROCESSING: Calling rquota_Null");
/* 0 is success */
return 0;
}
/**
* rquota_Null_Free: Frees the result structure allocated for rquota_Null
*
* Frees the result structure allocated for rquota_Null. Does Nothing in fact.
*
* @param pres [INOUT] Pointer to the result structure.
*
*/
void rquota_Null_Free(nfs_res_t * pres)
{
return;
}
|
/*
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_DESCRIBERESERVEDNODEOFFERINGSRESPONSE_H
#define QTAWS_DESCRIBERESERVEDNODEOFFERINGSRESPONSE_H
#include "redshiftresponse.h"
#include "describereservednodeofferingsrequest.h"
namespace QtAws {
namespace Redshift {
class DescribeReservedNodeOfferingsResponsePrivate;
class QTAWSREDSHIFT_EXPORT DescribeReservedNodeOfferingsResponse : public RedshiftResponse {
Q_OBJECT
public:
DescribeReservedNodeOfferingsResponse(const DescribeReservedNodeOfferingsRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DescribeReservedNodeOfferingsRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DescribeReservedNodeOfferingsResponse)
Q_DISABLE_COPY(DescribeReservedNodeOfferingsResponse)
};
} // namespace Redshift
} // namespace QtAws
#endif
|
/*
** Copyright (C) 2009-2014 Mischa Sandberg <mischasan@gmail.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License Version as
** published by the Free Software Foundation. You may not use, modify or
** distribute this program under any other version of the GNU Lesser General
** Public License.
**
** 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "msutil.h"
#include "_acism.h"
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#ifndef MAP_NOCORE
# define MAP_NOCORE 0
#endif
void
acism_save(FILE *fp, ACISM const*psp)
{
ACISM ps = *psp;
// Overwrite pointers with magic signature.
assert(8 <= sizeof ps.tranv + sizeof ps.hashv);
memcpy(&ps, "ACMischa", 8);
ps.flags &= ~IS_MMAP;
fwrite(&ps, sizeof(ACISM), 1, fp);
fwrite(psp->tranv, p_size(psp), 1, fp);
}
ACISM*
acism_load(FILE *fp)
{
ACISM *psp = calloc(sizeof(ACISM), 1);
if (fread(psp, sizeof(ACISM), 1, fp) == 1
&& !memcmp(psp, "ACMischa", 8)
&& (set_tranv(psp, malloc(p_size(psp))), 1)
&& fread(psp->tranv, p_size(psp), 1, fp)) {
return psp;
}
acism_destroy(psp);
return NULL;
}
ACISM*
acism_mmap(FILE *fp)
{
ACISM *mp = mmap(0, lseek(fileno(fp), 0L, 2), PROT_READ,
MAP_SHARED|MAP_NOCORE, fileno(fp), 0);
if (mp == MAP_FAILED) return NULL;
ACISM *psp = malloc(sizeof*psp);
*psp = *(ACISM*)mp;
psp->flags |= IS_MMAP;
if (memcmp(psp, "ACMischa", 8)) {
acism_destroy(psp);
return NULL;
}
set_tranv(psp, ((char *)mp) + sizeof(ACISM));
return psp;
}
void
acism_destroy(ACISM *psp)
{
if (!psp) return;
if (psp->flags & IS_MMAP)
munmap((char*)psp->tranv - sizeof(ACISM),
sizeof(ACISM) + p_size(psp));
else free(psp->tranv);
free(psp);
}
//EOF
|
//
// ViewController.h
// MovieDb
//
// Created by Saqib Saud on 13/02/2015.
// Copyright (c) 2015 Saqib Saud. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MDMFetchedResultsTableDataSource.h"
@interface PopularMoviesViewController : UITableViewController <UITabBarControllerDelegate, MDMFetchedResultsTableDataSourceDelegate>
@end
|
#pragma once
#include <string>
class GameEntity
{
public:
GameEntity(int x, int y);
int x() const {return _x;}
int y() const {return _y;}
std::string coords() const;
private:
int _x;
int _y;
};
|
#pragma once
#include <string>
#include <file.h>
namespace erebus {
/**
* The interface for the model.
*/
class IModel {
public:
/**
* Destructor.
*/
virtual ~IModel() {}
/**
* Loads a file.
*
* @param path the path to read the file from.
*/
virtual void loadFile(std::string path)=0;
/**
* Returns a pointer to the file.
*
* The pointer may be a nullptr.
*
* @return a pointer to the file
*/
virtual File* getFile() const=0;
};
}//namespace erebus
|
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_BASE_FILE_H
#define ANDROID_BASE_FILE_H
#include <sys/stat.h>
#include <string>
#if !defined(_WIN32) && !defined(O_BINARY)
#define O_BINARY 0
#endif
namespace android {
namespace base {
bool ReadFdToString(int fd, std::string* content);
bool ReadFileToString(const std::string& path, std::string* content);
bool WriteStringToFile(const std::string& content, const std::string& path);
bool WriteStringToFd(const std::string& content, int fd);
#if !defined(_WIN32)
bool WriteStringToFile(const std::string& content, const std::string& path,
mode_t mode, uid_t owner, gid_t group);
#endif
bool ReadFully(int fd, void* data, size_t byte_count);
bool WriteFully(int fd, const void* data, size_t byte_count);
bool RemoveFileIfExists(const std::string& path, std::string* err = nullptr);
} // namespace base
} // namespace android
#endif // ANDROID_BASE_FILE_H
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/quicksight/QuickSight_EXPORTS.h>
#include <aws/quicksight/QuickSightRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Http
{
class URI;
} //namespace Http
namespace QuickSight
{
namespace Model
{
/**
*/
class AWS_QUICKSIGHT_API DeleteAccountCustomizationRequest : public QuickSightRequest
{
public:
DeleteAccountCustomizationRequest();
// 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 "DeleteAccountCustomization"; }
Aws::String SerializePayload() const override;
void AddQueryStringParameters(Aws::Http::URI& uri) const override;
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline const Aws::String& GetAwsAccountId() const{ return m_awsAccountId; }
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline bool AwsAccountIdHasBeenSet() const { return m_awsAccountIdHasBeenSet; }
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline void SetAwsAccountId(const Aws::String& value) { m_awsAccountIdHasBeenSet = true; m_awsAccountId = value; }
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline void SetAwsAccountId(Aws::String&& value) { m_awsAccountIdHasBeenSet = true; m_awsAccountId = std::move(value); }
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline void SetAwsAccountId(const char* value) { m_awsAccountIdHasBeenSet = true; m_awsAccountId.assign(value); }
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline DeleteAccountCustomizationRequest& WithAwsAccountId(const Aws::String& value) { SetAwsAccountId(value); return *this;}
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline DeleteAccountCustomizationRequest& WithAwsAccountId(Aws::String&& value) { SetAwsAccountId(std::move(value)); return *this;}
/**
* <p>The ID for the Amazon Web Services account that you want to delete Amazon
* QuickSight customizations from in this Amazon Web Services Region.</p>
*/
inline DeleteAccountCustomizationRequest& WithAwsAccountId(const char* value) { SetAwsAccountId(value); return *this;}
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline const Aws::String& GetNamespace() const{ return m_namespace; }
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; }
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline void SetNamespace(const Aws::String& value) { m_namespaceHasBeenSet = true; m_namespace = value; }
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline void SetNamespace(Aws::String&& value) { m_namespaceHasBeenSet = true; m_namespace = std::move(value); }
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline void SetNamespace(const char* value) { m_namespaceHasBeenSet = true; m_namespace.assign(value); }
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline DeleteAccountCustomizationRequest& WithNamespace(const Aws::String& value) { SetNamespace(value); return *this;}
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline DeleteAccountCustomizationRequest& WithNamespace(Aws::String&& value) { SetNamespace(std::move(value)); return *this;}
/**
* <p>The Amazon QuickSight namespace that you're deleting the customizations
* from.</p>
*/
inline DeleteAccountCustomizationRequest& WithNamespace(const char* value) { SetNamespace(value); return *this;}
private:
Aws::String m_awsAccountId;
bool m_awsAccountIdHasBeenSet;
Aws::String m_namespace;
bool m_namespaceHasBeenSet;
};
} // namespace Model
} // namespace QuickSight
} // namespace Aws
|
/*
* Copyright 2010-2013 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.
*/
#ifdef AWS_MULTI_FRAMEWORK
#import <AWSRuntime/AmazonServiceRequest.h>
#else
#import "AmazonServiceRequest.h"
#endif
#import "EC2Request.h"
#import "EC2ActivateLicenseRequest.h"
/**
* Activate License Request Marshaller
*/
@interface EC2ActivateLicenseRequestMarshaller:NSObject {
}
+(AmazonServiceRequest *)createRequest:(EC2ActivateLicenseRequest *)activateLicenseRequest;
@end
|
//
// MapView.h
// MU Bus Tracking
//
// Created by Jake Gregg on 2/24/14.
// Copyright (c) 2014 Jake Gregg. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import "Route.h"
#import "SidebarViewController.h"
@interface MapView : UIView
@property (nonatomic, strong) NSArray* routes;
@property (nonatomic, strong) NSArray* buses;
@property (nonatomic, strong) NSArray* stops;
@property (nonatomic, strong) NSString* routeName;
@property (nonatomic) CLLocationCoordinate2D center;
@property (nonatomic) float zoom;
@property (nonatomic, strong) GMSMapView *mapView_;
@property (nonatomic) BOOL favorites;
- (id)initWithRoutes:(NSArray*)route withCenter:(CLLocationCoordinate2D)center withZoom:(float)zoom;
-(id)initWithRoutes:(NSArray*)route withBuses:(NSArray*)buses withName:(NSObject*)object withSidebar:(SidebarViewController*)sidebarViewController withIndexPath:(NSIndexPath*)path;
@end
|
/* -*- c++ -*- */
/*
* Copyright 2016 <+YOU OR YOUR COMPANY+>.
*
* This 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, or (at your option)
* any later version.
*
* This software 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_AUTOJAM_AUTOTUNE_H
#define INCLUDED_AUTOJAM_AUTOTUNE_H
#include <autojam/api.h>
#include <gnuradio/sync_block.h>
namespace gr {
namespace autojam {
/*!
* \brief <+description of block+>
* \ingroup autojam
*
*/
class AUTOJAM_API autotune : virtual public gr::sync_block
{
public:
typedef boost::shared_ptr<autotune> sptr;
/*!
* \brief Return a shared_ptr to a new instance of autojam::autotune.
*
* To avoid accidental use of raw pointers, autojam::autotune's
* constructor is in a private implementation
* class. autojam::autotune::make is the public interface for
* creating new instances.
*/
static sptr make(int sample_rate, int fft_size, int output_size);
};
} // namespace autojam
} // namespace gr
#endif /* INCLUDED_AUTOJAM_AUTOTUNE_H */
|
/*
* Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
*
* 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 OPS_OFPROTO_H
#define OPS_OFPROTO_H 1
#include "ofproto/ofproto.h"
#ifdef __cplusplus
extern "C" {
#endif
struct bfd_cfg;
struct cfm_settings;
struct cls_rule;
struct netdev;
struct netdev_stats;
struct ofport;
struct ofproto;
struct shash;
struct simap;
/* FIXME: Use MAX_NEXTHOPS_PER_ROUTE from common header */
#define OFPROTO_MAX_NH_PER_ROUTE 32 /* maximum number of nexthops per route.
only consider non-weighted ECMP now */
enum ofproto_route_family {
OFPROTO_ROUTE_IPV4,
OFPROTO_ROUTE_IPV6
};
enum ofproto_route_action {
OFPROTO_ROUTE_ADD,
OFPROTO_ROUTE_DELETE,
OFPROTO_ROUTE_DELETE_NH
};
enum ofproto_nexthop_state {
OFPROTO_NH_UNRESOLVED,
OFPROTO_NH_RESOLVED
};
enum ofproto_nexthop_type {
OFPROTO_NH_IPADDR,
OFPROTO_NH_PORT
};
struct ofproto_route_nexthop {
char *id; /* IP address or Port name */
enum ofproto_nexthop_type type;
enum ofproto_nexthop_state state; /* is arp resolved for this next hop */
int rc; /* rc = 0 means success */
const char *err_str; /* set if rc != 0 */
int l3_egress_id;
};
struct ofproto_route {
enum ofproto_route_family family;
char *prefix;
uint8_t n_nexthops; /* number of nexthops */
struct ofproto_route_nexthop nexthops[OFPROTO_MAX_NH_PER_ROUTE]; /* nexthops */
};
/* ECMP hash bit-fields */
#define OFPROTO_ECMP_HASH_SRCPORT 0x1 /* destination L4 port */
#define OFPROTO_ECMP_HASH_DSTPORT 0x2 /* source L4 port */
#define OFPROTO_ECMP_HASH_SRCIP 0x4 /* source IP v4/v6 */
#define OFPROTO_ECMP_HASH_DSTIP 0x8 /* source IP v4/v6 */
enum ofproto_host_action {
OFPROTO_HOST_ADD,
OFPROTO_HOST_DELETE,
OFPROTO_NEIGHBOR_ADD,
OFPROTO_NEIGHBOR_MODIFY,
OFPROTO_NEIGHBOR_DELETE
};
struct ofproto_l3_host {
bool family; /* Type of host */
char *ip_address; /* V4/6 IP address (prefix/len)*/
int rc; /* rc = 0 means success */
const char *err_str; /* set if rc != 0 */
char *mac; /* These are for neighbor, mac */
int l3_egress_id; /* Egress ID in case if we need */
};
/* Port option configuration list */
enum port_option_args {
/* Port vlan configuration option change */
PORT_OPT_VLAN,
/* Port Bond (LAG) configuration option change */
PORT_OPT_BOND,
/* hw_config driven mostly by l3portd */
PORT_HW_CONFIG,
/* Array size */
PORT_OPT_MAX
};
/* Indicate whether port primary/secondary v4/v6 ip is changed */
#define PORT_PRIMARY_IPv4_CHANGED 0x1
#define PORT_PRIMARY_IPv6_CHANGED 0x2
#define PORT_SECONDARY_IPv4_CHANGED 0x4
#define PORT_SECONDARY_IPv6_CHANGED 0x8
/* Configuration of bundles. */
struct ops_ofproto_bundle_settings {
struct ofproto_bundle_settings _base;
const struct smap *port_options[PORT_OPT_MAX]; /* Port options list */
bool hw_bond_should_exist; /* Indicates if a bond should exist in h/w
for this bundle. If hw_bond_handle exists
but this variable is false, it indicates
the h/w bond should be deleted. */
bool bond_handle_alloc_only; /* Allocate a bond hanlde and return.
This flag is set to true when a bond
entry is initially created without
active slave members. */
ofp_port_t *slaves_tx_enable; /* OpenFlow port numbers for slaves in
tx_enable state. */
size_t n_slaves_tx_enable; /* Number of slaves in tx_enable state. */
size_t slaves_entered; /* Number of slaves entered while adding a bond*/
int ip_change;
char *ip4_address;
char *ip6_address;
size_t n_ip4_address_secondary;
char **ip4_address_secondary; /* List of secondary IP address */
size_t n_ip6_address_secondary;
char **ip6_address_secondary; /* List of secondary IPv6 address */
bool enable; /* Port enable */
};
int ofproto_bundle_get(struct ofproto *, void *aux, int *bundle_handle);
/* Configuration of VLANs. */
int ofproto_set_vlan(struct ofproto *, int vid, bool add);
int ofproto_add_l3_host_entry(struct ofproto *ofproto, void *aux,
bool is_ipv6_addr, char *ip_addr,
char *next_hop_mac_addr, int *l3_egress_id);
int ofproto_delete_l3_host_entry(struct ofproto *ofproto, void *aux,
bool is_ipv6_addr, char *ip_addr,
int *l3_egress_id);
int ofproto_get_l3_host_hit(struct ofproto *ofproto, void *aux,
bool addr_type, char *ip_addr, bool *hit_bit);
int ofproto_l3_route_action(struct ofproto *ofproto,
enum ofproto_route_action action,
struct ofproto_route *route);
int ofproto_l3_ecmp_set(struct ofproto *ofproto, bool enable);
int ofproto_l3_ecmp_hash_set(struct ofproto *ofproto, unsigned int hash,
bool enable);
#ifdef __cplusplus
}
#endif
#endif /* ops-ofproto.h */
|
// UGGroup.h: interface for the UGGroup class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(UGGROUP_H)
#define UGGROUP_H
#include "Graphics3D/UGGraphics3DHeaders.h"
#include "Graphics3D/UGNode.h"
namespace UGC{
typedef UGArray<UGNode*>NodeList;
class GRAPHICS3D_API UGGroup:public UGNode
{
public:
UGGroup();
virtual ~UGGroup();
public:
virtual void Traverse(UGNodeVisitor& nv);
UGbool AdChild( UGNode *child );
UGbool IsertChild( UGuint index, UGNode *child );
UGbool RemoveChild( UGNode *child );
UGbool RemoveChild(UGuint npos,UGuint nChildrenToRemove=1);
UGbool ReplaceChild( UGNode *pOrigChild, UGNode* pNewChild );
inline UGuint getNumChildren() const { return m_Children.GetSize(); }
UGbool SetChild( UGint i, UGNode* node );
inline UGNode* GetChild( UGint i ) { return m_Children[i]; }
inline const UGNode* GetChild( UGuint i ) const { return m_Children[i]; }
inline UGbool ContainsNode( const UGNode* node ) const;
inline UGint GetChildIndex( const UGNode* node ) const;
protected:
NodeList m_Children;
};
}
#endif // !defined(AFX_UGGROUP_H__03E1B5A6_6300_4380_9B08_3F75CAF98D19__INCLUDED_)
|
//
// LJBaseZhongViewController.h
// meishimeike
//
// Created by zhenglong duan on 20/03/2017.
// Copyright © 2017 zhenglong duan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LJcateStartViewController.h"
@interface LJBaseZhongViewController : UIViewController
@property (nonatomic,strong) NSArray *arr;
@end
|
//
// ResultViewController.h
// ConnectObjective-CSampleApp
//
// Created by Tapas Behera on 8/8/17.
// Copyright © 2017 Acuant. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ViewController.h"
#import <AcuantMobileSDK/AcuantMobileSDKController.h>
@interface ResultViewController : UIViewController
@property(nonatomic,weak) id<ResultCancelDelegate> cancelDelegate;
@property(nonatomic,strong) NSDictionary* cardData;
@property(nonatomic) AcuantCardType cardType;
@property(nonatomic,strong) NSString* separator;
@property(nonatomic,strong) NSString* username;
@property(nonatomic,strong) NSString* password;
@end
|
//
// Created by k.leyfer on 11.09.2017.
//
#ifndef TOUCHLOGGER_DIRTY_POINTERCOORDS_H
#define TOUCHLOGGER_DIRTY_POINTERCOORDS_H
#include <stdint.h>
#include "../common.h"
#include "BitSet.h"
/*
* Pointer coordinate data.
*/
struct PointerCoords
{
enum
{
MAX_AXES = 30
}; // 30 so that sizeof(PointerCoords) == 128
// Bitfield of axes that are present in this structure.
uint64_t bits __attribute__((aligned(8)));
// Values of axes that are stored in this structure packed in order by axis id
// for each axis that is present in the structure according to 'bits'.
float values[MAX_AXES];
inline void clear()
{
BitSet64::clear(bits);
}
bool isEmpty() const
{
return BitSet64::isEmpty(bits);
}
float getAxisValue(uint32_t axis) const;
status_t setAxisValue(uint32_t axis, float value);
void scale(float scale);
void applyOffset(float xOffset, float yOffset);
inline float getX() const
{
return getAxisValue(AMOTION_EVENT_AXIS_X);
}
inline float getY() const
{
return getAxisValue(AMOTION_EVENT_AXIS_Y);
}
bool operator==(const PointerCoords &other) const;
inline bool operator!=(const PointerCoords &other) const
{
return !(*this == other);
}
void copyFrom(const PointerCoords &other);
private:
void tooManyAxes(int axis);
};
#endif //TOUCHLOGGER_DIRTY_POINTERCOORDS_H
|
//
// ViewControl ler.h
// MyChat
//
// Created by Mac on 15/8/29.
// Copyright (c) 2015年 Zeng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
//
@end
|
//
// lcl_config_components.h
// RestKit
//
// Created by Blake Watters on 6/8/11.
// Copyright (c) 2009-2012 RestKit. 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.
//
//
// The lcl_config_components.h file is used to define the application's log
// components.
//
// Use the code
//
// _lcl_component(<identifier>, <header>, <name>)
//
// for defining a log component, where
//
// - <identifier> is the unique name of a log component which is used in calls
// to lcl_log etc. A symbol 'lcl_c<identifier>' is automatically created for
// each log component.
//
// - <header> is a C string in UTF-8 which should be used by a logging back-end
// when writing a log message for the log component. The header is a technical
// key for identifying a log component's messages. It is recommended to use
// a 'Reverse ICANN' naming scheme when the header contains grouping
// information, e.g. 'example.main.component1'.
//
// - <name> is a C string in UTF-8 which contains the name of the log component
// and its grouping information in a non-technical, human-readable way
// which could be used by a user interface. Groups should be separated by the
// path separator '/', e.g. 'Example/Main/Component 1'.
//
//
// RestKit Logging Components
//
_lcl_component(RestKit, "restkit", "RestKit")
_lcl_component(RestKitNetwork, "restkit.network", "RestKit/Network")
_lcl_component(RestKitNetworkCache, "restkit.network.cache", "RestKit/Network/Cache")
_lcl_component(RestKitNetworkQueue, "restkit.network.queue", "RestKit/Network/Queue")
_lcl_component(RestKitNetworkReachability, "restkit.network.reachability", "RestKit/Network/Reachability")
_lcl_component(RestKitObjectMapping, "restkit.object_mapping", "RestKit/ObjectMapping")
_lcl_component(RestKitCoreData, "restkit.core_data", "RestKit/CoreData")
_lcl_component(RestKitCoreDataSearchEngine, "restkit.core_data.search_engine", "RestKit/CoreData/SearchEngine")
_lcl_component(RestKitSupport, "restkit.support", "RestKit/Support")
_lcl_component(RestKitSupportParsers, "restkit.support.parsers", "RestKit/Support/Parsers")
_lcl_component(RestKitThree20, "restkit.three20", "RestKit/Three20")
_lcl_component(RestKitUI, "restkit.ui", "RestKit/UI")
_lcl_component(RestKitTesting, "restkit.testing", "RestKit/Testing")
_lcl_component(App, "app", "App")
|
/***************************************************************
*
* Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* 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.
*
***************************************************************/
//******************************************************************************
// parser.h
//
// Parse() converts a string expression into an expression tree. If an error
// is encountered, the partially parsed tree is preserved and the number of
// characters parsed is returned; Otherwise 0 is returned.
//
//******************************************************************************
#ifndef _PARSER_H
#define _PARSER_H
#if !defined(WANT_OLD_CLASSADS)
#include "compat_classad.h"
#include "compat_classad_list.h"
#include "compat_classad_util.h"
using namespace compat_classad;
#else
#include "condor_ast.h"
// Parse an assignment expression, i.e. variable = expression
// On success, 0 is returned, name is set to the attribute name and tree
// is set to the ExprTree of the attribute value.
// On failure, non-0 is returned, tree is set to NULL, and if pos is
// non-NULL, the location it points to is set to the position at which
// the error occurred.
int Parse(const char*s, MyString&name, ExprTree*&tree, int *pos = NULL);
// parse an rval (i.e. anything that could appear on the rhs of an assignment)
// On success, 0 is returned and tree is set to the resulting ExprTree.
// On failure, non-0 is returned, tree is set to NULL, and if pos is
// non-NULL, the location it points to is set to the position at which
// the error occurred.
int ParseClassAdRvalExpr(const char*s, ExprTree*&tree, int *pos = NULL);
#endif /* !defined(WANT_OLD_CLASSADS) */
#endif /* _PARSER_H */
|
//
// Person.h
// SNCommon
//
// Created by sam on 15/6/24.
// Copyright (c) 2015年 sam. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SNCommon.h"
@interface Person : NSObject
SingletonH
@property (nonatomic, strong) NSString *name;
@end
|
//
// MKVehicleAnnotation.h
// iTrash
//
// Created by biid on 25/4/15.
// Copyright (c) 2015 shibboleth. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MKVehicleAnnotation : NSObject <MKAnnotation>
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
- (id)initWithLocation:(CLLocationCoordinate2D)location;
- (MKAnnotationView *)annotationView;
@end
|
//
// OtherCell.h
// PetsMarket
//
// Created by tarena46 on 16/7/25.
// Copyright © 2016年 IOS1604GroupA. All rights reserved.
// 推荐界面下部单种宠物section的item
#import <UIKit/UIKit.h>
@interface OtherCell : UICollectionViewCell
@property(nonatomic)UIImageView *headIV;
@property(nonatomic)UILabel *titleLb;
@property(nonatomic)UILabel *timeLb;
@property(nonatomic)UILabel *moneyLb;
@end
|
//
// Udpproxy2.h
// SmartlinkLib
//
// Created by wangmeng on 15/4/15.
// Copyright (c) 2015年 HF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "HFSmartLinkDeviceInfo.h"
@interface Udpproxy2 : NSObject
+(instancetype)shareInstence;
-(void)CreateBindSocket;
-(void)send:(char*)shit;
-(void)sendMCast:(char*)shit withAddr:(char *)addr andSN:(int)sn;
-(void)sendSmartLinkFind;
-(HFSmartLinkDeviceInfo*)recv;
-(void)close;
@end
|
/*
Menu callbacks and placeholders
by: Connor Douthat
2/18/2016
*/
void MenuExit(const char *key);
void MenuCreateVault(const char *key)
{
char db_path[256] = {0};
if(BrowseForOutput(FILE_TYPE_DB, db_path))
{
OpenVaultDialog(0, db_path);
}
}
void MenuBrowseVault(const char *key)
{
char db_path[256] = {0};
if(BrowseForInput(FILE_TYPE_DB, db_path))
{
OpenVaultDialog(0, db_path);
}
}
void MenuSwitchVault(const char *key)
{
OpenVaultDialog(atoi(key));
}
void MenuExportVault(const char *key)
{
ExportVaultDialog(atoi(key));
}
void MenuChangeVaultPass(const char *key)
{
ChangeVaultPassDialog();
}
void MenuCloseVault(const char *key)
{
CloseVaultDialog(atoi(key));
}
void MenuCloseAllVaults(const char *key)
{
CloseAllVaultsDialog();
}
void MenuCreateEntry(const char *key)
{
CreateEntryDialog();
}
void MenuRecallEntry(const char *key)
{
if(!vaults.topOpen()) return;
VaultEntry entry(vaults.top(), key);
RecallEntryDialog(&entry);
}
void MenuRemoveEntry(const char *key)
{
if(!vaults.topOpen()) return;
VaultEntry entry(vaults.top(), key);
RemoveEntryDialog(&entry);
}
void MenuChangeEntry(const char *key)
{
if(!vaults.topOpen()) return;
VaultEntry entry(vaults.top(), key);
ChangeEntryDialog(&entry);
}
void MenuPreferences(const char *key)
{
PreferencesDialog();
}
|
//
// ClearCacheTableViewCell.h
// 百思
//
// Created by 赵博 on 16/7/24.
// Copyright © 2016年 赵博. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ClearCacheTableViewCell : UITableViewCell
@end
|
#ifndef __PLDA__LDAModel__
#define __PLDA__LDAModel__
#include <string>
#include <vector>
#include <node.h>
namespace lda
{
class LDAModel : public node::ObjectWrap
{
public:
static void Init(v8::Handle<v8::Object> exports);
static v8::Handle<v8::Value> NewInstance(const v8::Arguments& args);
private:
~LDAModel();
std::vector<std::string> _corpus;
std::vector<std::string> _inference;
static v8::Handle<v8::Value> New(const v8::Arguments& args);
static v8::Persistent<v8::Function> constructor;
LDAModel();
};
}
#endif |
/* Carrot -- Copyright (C) 2012 GoCarrot Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
#import "CarrotCache.h"
#import "CarrotRequest.h"
@class Carrot;
@interface CarrotRequestThread : NSObject
@property (nonatomic, readonly) BOOL isRunning;
@property (nonatomic) NSUInteger maxRetryCount; // 0 = infinite
@property (strong, nonatomic, readonly) CarrotCache* cache;
- (id)initWithCarrot:(Carrot*)carrot;
- (BOOL)addRequestForService:(CarrotRequestServiceType)serviceType atEndpoint:(NSString*)endpoint usingMethod:(NSString*)method withPayload:(NSDictionary*)payload;
- (BOOL)addRequestForService:(CarrotRequestServiceType)serviceType atEndpoint:(NSString*)endpoint usingMethod:(NSString*)method withPayload:(NSDictionary*)payload callback:(CarrotRequestResponse)callback;
- (BOOL)addRequestForService:(CarrotRequestServiceType)serviceType atEndpoint:(NSString*)endpoint usingMethod:(NSString*)method withPayload:(NSDictionary*)payload callback:(CarrotRequestResponse)callback atFront:(BOOL)atFront;
- (void)start;
- (void)stop;
- (void)signal;
- (void)processRequest:(CarrotRequest*)request;
- (void)performDiscovery;
- (void)addRequestInQueue:(CarrotRequest*)request atFront:(BOOL)atFront;
@end
|
//
// ViewController.h
// DEMO
//
// Created by kylin on 16/10/21.
// Copyright © 2016年 kylin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
/**
https://github.com/BeamOfLight/shape_representation_models.git
resampling_chain_code.h
@author Denis Borisoglebskiy
@version 1.0 2016-10-04
*/
#pragma once
#ifndef SHAPE_REPRESENTATION_MODELS_RESAMPLING_CHAIN_CODE_H
#define SHAPE_REPRESENTATION_MODELS_RESAMPLING_CHAIN_CODE_H
#include <shape_representation_models/abstract_contour_model.h>
namespace ShapeRepresentationModels {
class ResamplingChainCode : public AbstractContourModel
{
protected:
bool use4pin; // флаг использования 4-связного кода Фримана
size_t resamplingLevel;
int getPinCount();
cv::Size getOptimalSize(cv::Size objectSize);
unsigned char getNPointValue(const cv::Mat &object, cv::Point pt);
AbstractContourRepresentation* getNewContourRepresentation();
AbstractRepresentation* encodeSingleObject(const cv::Mat &object);
public:
struct ContourRepresentation : public AbstractContourRepresentation
{
cv::Point firstPoint;
std::vector < unsigned char > chainCodes;
bool use4pin;
size_t resamplingLevel;
ContourRepresentation(bool use4pin, size_t resamplingLevel);
std::vector < cv::Point > convert2Points();
void initFromPoints(const std::vector < cv::Point > &points);
};
ResamplingChainCode(size_t contoursCountSize, size_t pointsCountSize, size_t pointRepresentationSize, bool use4pin, size_t resamplingLevel);
std::string getMethodName();
int getObjectRepresentationSize(AbstractRepresentation* encodedObject);
};
}
#endif
|
#include <sys/eventfd.h>
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
/* Makefile
all:
g++ -g -o eventfd_test main.cc -DHAVE_EVENTFD -lpthread
g++ -g -o pthread_cond_test main.cc -lpthread
clean:
rm -rf *.o
rm -rf *_test
*/
#include <pthread.h>
#include <stdlib.h>
class LogNotify
{
public:
LogNotify();
void signal(void);
void wait(void);
void lock(void);
void unlock(void);
~LogNotify();
private:
#if defined(HAVE_EVENTFD)
int m_efd;
#else
pthread_cond_t m_cond;
pthread_mutex_t m_mutex;
#endif
};
LogNotify::LogNotify()
{
#if defined(HAVE_EVENTFD)
m_efd = eventfd(0, 0);
assert(m_efd != -1);
#else
pthread_cond_init(&m_cond, NULL);
pthread_mutex_init(&m_mutex, NULL);
#endif
}
void
LogNotify::signal(void)
{
#if defined(HAVE_EVENTFD)
ssize_t nr;
uint64_t value = 1;
nr = write(m_efd, &value, sizeof(uint64_t));
assert(nr == sizeof(uint64_t));
#else
pthread_cond_signal(&m_cond);
#endif
}
void
LogNotify::wait(void)
{
#if defined(HAVE_EVENTFD)
ssize_t nr;
uint64_t value = 0;
nr = read(m_efd, &value, sizeof(uint64_t));
assert(nr == sizeof(uint64_t));
#else
pthread_cond_wait(&m_cond, &m_mutex);
#endif
}
void
LogNotify::lock(void)
{
#if defined(HAVE_EVENTFD)
// do nothing
#else
pthread_mutex_lock(&m_mutex);
#endif
}
void
LogNotify::unlock(void)
{
#if defined(HAVE_EVENTFD)
// do nothing
#else
pthread_mutex_unlock(&m_mutex);
#endif
}
LogNotify::~LogNotify()
{
#if defined(HAVE_EVENTFD)
close(m_efd);
#else
pthread_cond_destroy(&m_cond);
pthread_mutex_destroy(&m_mutex);
#endif
}
#define nr_producer 10
int consumer_loop_times = 100000;
LogNotify notify;
void *producer(void *)
{
while (true) {
notify.signal();
}
}
void *consumer(void *)
{
int i = 0;
notify.lock();
while (i++ < consumer_loop_times) {
notify.wait();
}
notify.unlock();
exit(0);
}
int main(int argc, char **argv)
{
int i;
pthread_t pid[nr_producer];
if (argc > 1) {
consumer_loop_times = atoi(argv[1]);
}
for (i = 0; i < nr_producer; i++) {
pthread_create(&pid[i], NULL, producer, (void*)NULL);
}
consumer(NULL);
return 0;
}
/*
TS-2137
[eventfd_vs_pthread_cond_benchmark]$ ls
main.cc Makefile
[eventfd_vs_pthread_cond_benchmark]$ make
g++ -g -o eventfd_test main.cc -DHAVE_EVENTFD -lpthread
g++ -g -o pthread_cond_test main.cc -lpthread
[eventfd_vs_pthread_cond_benchmark]$ ls
eventfd_test main.cc Makefile pthread_cond_test
[eventfd_vs_pthread_cond_benchmark]$ time ./eventfd_test 1000000
real 0m11.644s
user 0m1.517s
sys 1m31.179s
[eventfd_vs_pthread_cond_benchmark]$ time ./pthread_cond_test 1000000
real 0m57.438s
user 0m30.152s
sys 6m7.289s
*/
|
#ifndef _INCLUDED_ASW_SHIELDBUG_H
#define _INCLUDED_ASW_SHIELDBUG_H
#ifdef _WIN32
#pragma once
#endif
#include "asw_alien_shover.h"
DECLARE_AUTO_LIST( IShieldbugAutoList )
class CASW_Shieldbug : public CASW_Alien_Shover, public IShieldbugAutoList
{
DECLARE_CLASS( CASW_Shieldbug, CASW_Alien_Shover );
public:
DECLARE_SERVERCLASS();
DECLARE_DATADESC();
IMPLEMENT_AUTO_LIST_GET( );
CASW_Shieldbug();
virtual ~CASW_Shieldbug();
void Spawn();
void Precache();
virtual void NPCThink();
virtual int DrawDebugTextOverlays();
float GetIdealSpeed() const;
float GetIdealAccel( ) const;
float GetSequenceGroundSpeed( int iSequence );
int MeleeAttack1Conditions( float flDot, float flDist );
int MeleeAttack2Conditions ( float flDot, float flDist );
void MeleeAttack( float distance, float damage, QAngle &viewPunch, Vector &shove );
float MaxYawSpeed( void );
void HandleAnimEvent( animevent_t *pEvent );
Class_T Classify( void ) { return (Class_T) CLASS_ASW_SHIELDBUG; }
bool CorpseGib( const CTakeDamageInfo &info );
void BuildScheduleTestBits( void );
void GatherEnemyConditions( CBaseEntity *pEnemy );
void StartTask(const Task_t *pTask);
void RunTask( const Task_t *pTask );
int SelectSchedule();
int TranslateSchedule( int scheduleType );
bool OverrideMoveFacing( const AILocalMoveGoal_t &move, float flInterval );
void SetTurnActivity();
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon = NULL );
virtual bool ShouldDefend();
float m_fNextHeadhitAttack;
float m_fLastHurtTime;
bool m_bLastShouldDefend;
int m_nExtraHeath;
virtual Activity NPC_TranslateActivity( Activity baseAct );
bool ShouldGib( const CTakeDamageInfo &info ) ;
virtual void PrescheduleThink();
virtual void PainSound( const CTakeDamageInfo &info );
virtual void AlertSound();
virtual void DeathSound( const CTakeDamageInfo &info );
virtual void AttackSound();
virtual void IdleSound();
virtual void Event_Killed( const CTakeDamageInfo &info );
virtual bool HasDeadBodyGroup() { return true; };
virtual void GatherConditions();
virtual bool CanBreak ( void ) { return true; };
virtual Activity GetDeathActivity( void );
bool m_bDefending;
float m_fNextFlinchTime;
virtual bool CanFlinch();
virtual int OnTakeDamage_Alive( const CTakeDamageInfo &info );
virtual bool BlockedDamage( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
virtual void Bleed( const CTakeDamageInfo &info, const Vector &vecPos, const Vector &vecDir, trace_t *ptr );
void CheckForShieldbugHint( const CTakeDamageInfo &info );
virtual float GetMaxShoverObjectMass() { return 200.0f; }
virtual void SetHealthByDifficultyLevel();
virtual int GetMoneyCount( const CTakeDamageInfo &info );
virtual Vector BodyTarget( const Vector &posSrc, bool bNoisy = true );
float m_fMarineBlockCounter;
float m_fLastMarineBlockTime;
float m_flDefendDuration;
static float s_fNextSpottedChatterTime;
enum
{
COND_SHIELDBUG_CHANGE_DEFEND = BaseClass::NEXT_CONDITION,
NEXT_CONDITION,
};
bool m_bHasBeenHurt;
protected:
DEFINE_CUSTOM_AI;
};
enum
{
SCHED_SHIELDBUG_FLINCH_LEFT = LAST_ASW_ALIEN_SHOVER_SHARED_SCHEDULE,
SCHED_SHIELDBUG_FLINCH_RIGHT = LAST_ASW_ALIEN_SHOVER_SHARED_SCHEDULE+1,
SCHED_ASW_SHIELDBUG_MELEE_ATTACK1 = LAST_ASW_ALIEN_SHOVER_SHARED_SCHEDULE+2,
SCHED_ASW_SHIELDBUG_MELEE_ATTACK2 = LAST_ASW_ALIEN_SHOVER_SHARED_SCHEDULE+3,
SCHED_SHIELDBUG_START_DEFENDING,
SCHED_SHIELDBUG_LEAVE_DEFENDING,
LAST_ASW_SHIELDBUG_SHARED_SCHEDULE,
};
extern int ACT_START_DEFENDING;
extern int ACT_LEAVE_DEFENDING;
extern int ACT_RUN_DEFEND;
extern int ACT_IDLE_DEFEND;
extern int ACT_FLINCH_LEFTARM_DEFEND;
extern int ACT_FLINCH_RIGHTARM_DEFEND;
extern int ACT_MELEE_ATTACK1_DEFEND;
extern int ACT_TURN_LEFT_DEFEND;
extern int ACT_TURN_RIGHT_DEFEND;
extern int ACT_ALIEN_SHOVER_ROAR_DEFEND;
//enum
//{
//TASK_SHIELDBUG_FLINCH = LAST_ASW_ALIEN_SHARED_TASK,
//LAST_ASW_SHIELDBUG_SHARED_TASK,
//};
#endif // _INCLUDED_ASW_SHIELDBUG_H
|
//
// SFBuyShopItem.h
// SFE
//
// Created by ma c on 16/8/31.
// Copyright © 2016年 shifei. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SFBuyShopItem : NSObject
/**商品ID*/
@property (copy, nonatomic) NSString *GoodsId;
/**商品缩略图*/
@property (copy, nonatomic) NSString *ImgView;
/**商品标题*/
@property (copy, nonatomic) NSString *GoodsTitle;
/**商品数量*/
@property (assign, nonatomic) NSInteger GoodsCount;
/**价格*/
@property (assign, nonatomic) CGFloat Price;
/**商品标记*/
@property (copy, nonatomic) NSString *UUID;
/**商品重量*/
@property (assign, nonatomic) CGFloat Weight;
// 自己添加的,用来判断是否选中该商品
/**判断是否选中该商品*/
@property (assign, nonatomic) BOOL isSelected;
@end
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is an internal atomic implementation, use base/atomicops.h instead.
#ifndef BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_
#define BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_
#include <windows.h>
namespace base {
namespace subtle {
} // namespace base::subtle
} // namespace base
#endif // BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ |
// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬
// »òÊǾ³£Ê¹Óõ«²»³£¸ü¸ÄµÄ
// ÌØ¶¨ÓÚÏîÄ¿µÄ°üº¬Îļþ
//
#pragma once
#define WIN32_LEAN_AND_MEAN // ´Ó Windows Í·ÖÐÅųý¼«ÉÙʹÓõÄ×ÊÁÏ
#include <stdio.h>
#include <tchar.h>
#include <stdlib.h>
#include "C:\\Python27\\include\\python.h"
#pragma comment(lib, "C:\\Python27\\libs\\python27.lib")
#include <pcap.h>
#include "tcp.h"
#include "sendTcpDataToPython.h"
#include "readIniFile.h"
// TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÐèÒªµÄÆäËûÍ·Îļþ
|
/*
* 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/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{
/**
* <p>The Diffie-Hellmann group number for phase 2 IKE negotiations.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Phase2DHGroupNumbersListValue">AWS
* API Reference</a></p>
*/
class AWS_EC2_API Phase2DHGroupNumbersListValue
{
public:
Phase2DHGroupNumbersListValue();
Phase2DHGroupNumbersListValue(const Aws::Utils::Xml::XmlNode& xmlNode);
Phase2DHGroupNumbersListValue& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>The Diffie-Hellmann group number.</p>
*/
inline int GetValue() const{ return m_value; }
/**
* <p>The Diffie-Hellmann group number.</p>
*/
inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
/**
* <p>The Diffie-Hellmann group number.</p>
*/
inline void SetValue(int value) { m_valueHasBeenSet = true; m_value = value; }
/**
* <p>The Diffie-Hellmann group number.</p>
*/
inline Phase2DHGroupNumbersListValue& WithValue(int value) { SetValue(value); return *this;}
private:
int m_value;
bool m_valueHasBeenSet;
};
} // namespace Model
} // namespace EC2
} // namespace Aws
|
//
// Macros.h
// ZJCommonProject
//
// Created by jyd on 16/1/27.
// Copyright © 2016年 jyd. All rights reserved.
//
// 自定义宏
//中文字体
#define CHINESE_FONT_NAME @"Heiti SC"
#define CHINESE_SYSTEM(x) [UIFont fontWithName:CHINESE_FONT_NAME size:x]
#define UNICODETOUTF16(x) (((((x - 0x10000) >>10) | 0xD800) << 16) | (((x-0x10000)&3FF) | 0xDC00))
#define MULITTHREEBYTEUTF16TOUNICODE(x,y) (((((x ^ 0xD800) << 2) | ((y ^ 0xDC00) >> 8)) << 8) | ((y ^ 0xDC00) & 0xFF)) + 0x10000
//获取View的属性
#define GetViewWidth(view) view.frame.size.width
#define GetViewHeight(view) view.frame.size.height
#define GetViewX(view) view.frame.origin.x
#define GetViewY(view) view.frame.origin.y
//导航栏高度
#define TopBarHeight 64.5
// 字体大小(常规/粗体)
#define BOLDSYSTEMFONT(FONTSIZE)[UIFont boldSystemFontOfSize:FONTSIZE]
#define SYSTEMFONT(FONTSIZE) [UIFont systemFontOfSize:FONTSIZE]
#define FONT(NAME, FONTSIZE) [UIFont fontWithName:(NAME) size:(FONTSIZE)]
// 当前版本
#define FSystemVersion ([[[UIDevice currentDevice] systemVersion] floatValue])
#define DSystemVersion ([[[UIDevice currentDevice] systemVersion] doubleValue])
#define SSystemVersion ([[UIDevice currentDevice] systemVersion])
// 是否IOS7
#define isIOS7 ([[[UIDevice currentDevice]systemVersion]floatValue] >= 7.0)
// 是否IOS6
#define isIOS6 ([[[UIDevice currentDevice]systemVersion]floatValue] < 7.0)
//
#define isIOS8 ([[[UIDevice currentDevice]systemVersion]floatValue] >=8.0)
#define isIOS9 ([[[UIDevice currentDevice]systemVersion]floatValue] >=9.0)
#define isIOS10 ([[[UIDevice currentDevice]systemVersion]floatValue] >=10.0)
// 是否iPad
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
//获得RGB颜色
#define ZJColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define ZJColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
//随机颜色
#define ZJRandomColor [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1]
//3.自定义Log
#ifdef DEBUG
//#define ZJLog(...) NSLog(__VA_ARGS__)
#define ZJLog(...) NSLog(@"%s %d \n %@\n\n",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__])
#else
#define ZJLog(...)
#endif
//4.输出frame(frame是结构体,没法%@)
#define ZJLogSize(size) ZJLog(@"[%s]:{%.2f, %.2f}", (#size), size.width, size.height);
#define ZJLogRect(f) NSLog(@"\nx:%f\ny:%f\nwidth:%f\nheight:%f\n",f.origin.x,f.origin.y,f.size.width,f.size.height)
//手机型号判别
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))
#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)
//屏幕的分辨率 当结果为1时,显示的是普通屏幕,结果为2时,显示的是Retian屏幕
#define MainScreenScale [[UIScreen mainScreen]scale]
// App Frame Height&Width
#define Application_Frame [[UIScreen mainScreen] applicationFrame] //除去信号区的屏幕的frame
#define APP_Frame_Height [[UIScreen mainScreen] applicationFrame].size.height //应用程序的屏幕高度
#define App_Frame_Width [[UIScreen mainScreen] applicationFrame].size.width //应用程序的屏幕宽度
/*** MainScreen Height Width */
#define App_Main_Screen_Height [[UIScreen mainScreen] bounds].size.height //主屏幕的高度
#define App_Main_Screen_Width [[UIScreen mainScreen] bounds].size.width //主屏幕的宽度
// 是否空对象
#define IS_NULL_CLASS(OBJECT) [OBJECT isKindOfClass:[NSNull class]]
//色值
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define RGB(r,g,b) RGBA(r,g,b,1.0f)
#define HEXCOLOR(hex) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 green:((float)((hex & 0xFF00) >> 8)) / 255.0 blue:((float)(hex & 0xFF)) / 255.0 alpha:1]
#define COLOR_RGB(rgbValue,a) [UIColor colorWithRed:((float)(((rgbValue) & 0xFF0000) >> 16))/255.0 green:((float)(((rgbValue) & 0xFF00)>>8))/255.0 blue: ((float)((rgbValue) & 0xFF))/255.0 alpha:(a)]
//App版本号
#define appMPVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
//AppDelegate对象
#define AppDelegateInstance [[UIApplication sharedApplication] delegate]
//获取图片资源
#define GetImage(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
//在Main线程上运行
#define DISPATCH_ON_MAIN_THREAD(mainQueueBlock) dispatch_async(dispatch_get_main_queue(), mainQueueBlock);
//主线程上Demo
//DISPATCH_ON_MAIN_THREAD(^{
//更新UI
//})
//在Global Queue上运行
#define DISPATCH_ON_GLOBAL_QUEUE_HIGH(globalQueueBlocl) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), globalQueueBlocl);
#define DISPATCH_ON_GLOBAL_QUEUE_DEFAULT(globalQueueBlocl) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), globalQueueBlocl);
#define DISPATCH_ON_GLOBAL_QUEUE_LOW(globalQueueBlocl) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), globalQueueBlocl);
#define DISPATCH_ON_GLOBAL_QUEUE_BACKGROUND(globalQueueBlocl) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), globalQueueBlocl);
//Global Queue
//DISPATCH_ON_GLOBAL_QUEUE_DEFAULT(^{
//异步耗时任务
//})
//DDLog等级
#ifdef DEBUG
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
#else
static const int ddLogLevel = LOG_LEVEL_ERROR;
#endif
|
#import <Foundation/Foundation.h>
#import "ACObject.h"
/**
* ARTIK Cloud API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
@protocol ACExportNormalizedMessagesResponse
@end
@interface ACExportNormalizedMessagesResponse : ACObject
@property(nonatomic) NSNumber* csvHeaders;
@property(nonatomic) NSNumber* endDate;
@property(nonatomic) NSString* exportId;
@property(nonatomic) NSString* format;
@property(nonatomic) NSString* order;
@property(nonatomic) NSString* sdid;
@property(nonatomic) NSString* sdids;
@property(nonatomic) NSNumber* startDate;
@property(nonatomic) NSString* stdids;
@property(nonatomic) NSString* trialId;
@property(nonatomic) NSString* uid;
@property(nonatomic) NSString* uids;
@property(nonatomic) NSString* url;
@end
|
//
// YYHMainViewController.h
// XiaoChengJia
//
// Created by yyh2016 on 16/8/27.
// Copyright © 2016年 yyh2016. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YYHMainViewController : UITabBarController
@end
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by count, 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>
#import "TiProxy.h"
#import "Tibuffer.h"
#import "KrollCallback.h"
// This is meant to be a largely "virtual" class which defines the following behaviors:
// 1. Interprets read()/write() calls to the appropriate interal function
// 2. Provide protocol defining necessary internal functions; read/write, asynch read/write, readAll,
@protocol TiStreamInternal <NSObject>
@required
// DEFINED BEHAVIOR: callback != nil indicates an asynch operation. length==0 indicates to read all available data into
// the buffer (and grow it if necessary). These methods MAY be called by classes other than the TiStreamProxy ducktype (i.e. Ti.Stream module methods)
-(int)readToBuffer:(TiBuffer*)buffer offset:(int)offset length:(int)length callback:(KrollCallback*)callback;
-(int)writeFromBuffer:(TiBuffer*)buffer offset:(int)offset length:(int)length callback:(KrollCallback*)callback;
// Used for writeStream/pumping
-(int)writeToStream:(id<TiStreamInternal>)output chunkSize:(int)size callback:(KrollCallback*)callback;
-(void)pumpToCallback:(KrollCallback*)callback chunkSize:(int)size asynch:(BOOL)asynch;
// Public API : No defined behavior
-(NSNumber*)isReadable:(id)_void; // PUBLIC API FUNCTION
-(NSNumber*)isWritable:(id)_void; // PUBLIC API FUNCTION
-(void)close:(id)_void; // PUBLIC API FUNCTION
@end
// TODO: We absolutely MUST discuss public/private API separation and how it interacts with ducktypes.
@interface TiStreamProxy : TiProxy<TiStreamInternal> {
}
// Public API
-(NSNumber*)read:(id)args;
-(NSNumber*)write:(id)write;
@end
|
//
// ViewController.h
// testGit
//
// Created by tarena on 15/12/1.
// Copyright © 2015年 tarena. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
//
// TOS_ExportTranslator.h
// SDKtopoos
//
/**
* Copyright 2014-present topoos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
@interface TOS_ExportTranslator : NSObject
@end
|
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Benchmark `rad2deg`.
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#define NAME "rad2deg"
#define ITERATIONS 1000000
#define REPEATS 3
/**
* Prints the TAP version.
*/
void print_version() {
printf( "TAP version 13\n" );
}
/**
* Prints the TAP summary.
*
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
printf( "# pass %d\n", passing );
printf( "#\n" );
printf( "# ok\n" );
}
/**
* Prints benchmarks results.
*
* @param elapsed elapsed time in seconds
*/
void print_results( double elapsed ) {
double rate = (double)ITERATIONS / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", ITERATIONS );
printf( " elapsed: %0.9f\n", elapsed );
printf( " rate: %0.9f\n", rate );
printf( " ...\n" );
}
/**
* Returns a clock time.
*
* @return clock time
*/
double tic() {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}
/**
* Generates a random number on the interval [0,1].
*
* @return random number
*/
double rand_double() {
int r = rand();
return (double)r / ( (double)RAND_MAX + 1.0 );
}
/**
* Converts radians to degrees.
*
* @param x radians
* @return degrees
*/
double rad2deg( double x ) {
return x * 57.29577951308232;
}
/**
* Runs a benchmark.
*
* @return elapsed time in seconds
*/
double benchmark() {
double elapsed;
double x;
double y;
double t;
int i;
t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
x = ( 2.0*rand_double()*3.14 ) - 0.0;
y = rad2deg( x );
if ( y != y ) {
printf( "should not return NaN\n" );
break;
}
}
elapsed = tic() - t;
if ( y != y ) {
printf( "should not return NaN\n" );
}
return elapsed;
}
/**
* Main execution sequence.
*/
int main( void ) {
double elapsed;
int i;
// Use the current time to seed the random number generator:
srand( time( NULL ) );
print_version();
for ( i = 0; i < REPEATS; i++ ) {
printf( "# c::%s\n", NAME );
elapsed = benchmark();
print_results( elapsed );
printf( "ok %d benchmark finished\n", i+1 );
}
print_summary( REPEATS, REPEATS );
}
|
//===--- DerivedConformances.h - Derived protocol conformance ---*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines entry points to synthesize compiler-derived conformances
// to certain known protocols.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SEMA_DERIVEDCONFORMANCES_H
#define SWIFT_SEMA_DERIVEDCONFORMANCES_H
#include <utility>
namespace swift {
class Decl;
class FuncDecl;
class NominalTypeDecl;
class Type;
class TypeChecker;
class ValueDecl;
namespace DerivedConformance {
/// Determine the derivable requirement that would satisfy the given
/// requirement, if there is one.
///
/// \param nominal The nominal type for which we are determining whether to
/// derive a witness.
///
/// \param requirement The requirement for which we are checking for a
/// derivation. This requirement need not be within a derivable protocol,
/// because derivable requirements can get restated in inherited unrelated or
/// unrelated protocols.
///
/// \returns The requirement whose witness could be derived to potentially
/// satisfy this given requirement, or NULL if there is no such requirement.
ValueDecl *getDerivableRequirement(NominalTypeDecl *nominal,
ValueDecl *requirement);
/// Derive a RawRepresentable requirement for an enum, if it has a valid
/// raw type and raw values for all of its cases.
///
/// \returns the derived member, which will also be added to the type.
ValueDecl *deriveRawRepresentable(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *type,
ValueDecl *requirement);
/// Derive a RawRepresentable type witness for an enum, if it has a valid
/// raw type and raw values for all of its cases.
///
/// \returns the derived member, which will also be added to the type.
Type deriveRawRepresentable(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *type,
AssociatedTypeDecl *assocType);
/// Derive an Equatable requirement for a type.
///
/// Currently this is only implemented for enums without associated values.
/// Obvious generalizations would be to enums with all-Hashable payloads and to
/// structs with all-Hashable stored properties.
///
/// \returns the derived member, which will also be added to the type.
ValueDecl *deriveEquatable(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *type,
ValueDecl *requirement);
/// Derive a Hashable requirement for a type.
///
/// Currently this is only implemented for enums without associated values.
/// Obvious generalizations would be to enums with all-Hashable payloads and to
/// structs with all-Hashable stored properties.
///
/// \returns the derived member, which will also be added to the type.
ValueDecl *deriveHashable(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *type,
ValueDecl *requirement);
/// Derive a _BridgedNSError requirement for an @objc enum type.
///
/// \returns the derived member, which will also be added to the type.
ValueDecl *deriveBridgedNSError(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *type,
ValueDecl *requirement);
/// Declare a getter for a derived property.
FuncDecl *declareDerivedPropertyGetter(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *typeDecl,
Type propertyInterfaceType,
Type propertyContextType,
bool isStatic,
bool isFinal);
/// Declare a read-only property with an existing getter.
std::pair<VarDecl *, PatternBindingDecl *>
declareDerivedReadOnlyProperty(TypeChecker &tc,
Decl *parentDecl,
NominalTypeDecl *typeDecl,
Identifier name,
Type propertyInterfaceType,
Type propertyContextType,
FuncDecl *getterDecl,
bool isStatic,
bool isFinal);
/// Build a reference to the 'self' decl of a derived function.
DeclRefExpr *createSelfDeclRef(AbstractFunctionDecl *fn);
}
}
#endif
|
/**
@file BNCURLFilter.h
@package Branch-SDK
@brief Manages a list of sensitive URLs such as login data that should not be handled by Branch.
@author Edward Smith
@date February 14, 2018
@copyright Copyright © 2018 Branch. All rights reserved.
*/
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
@interface BNCURLFilter : NSObject
/**
@brief Checks if a given URL should be ignored.
@param url The URL to be checked.
@return Returns true if the provided URL should be ignored.
*/
- (BOOL) shouldIgnoreURL:(NSURL*_Nullable)url;
/**
@brief Returns the pattern that matches a URL, if any.
@param url The URL to be checked.
@return Returns the pattern matching the URL or `nil` if no patterns match.
*/
- (NSString*_Nullable) patternMatchingURL:(NSURL*_Nullable)url;
/// Refreshes the list of ignored URLs from the server.
- (void) updatePatternListWithCompletion:(void (^_Nullable) (NSError*_Nullable error, NSArray*_Nullable list))completion;
/// Is YES if the listed has already been updated from the server.
@property (assign, readonly) BOOL hasUpdatedPatternList;
@property (strong) NSArray<NSString*>*_Nullable patternList;
@end
|
//
// NSArray+MASAdditions.h
//
//
// Created by Daniel Hammond on 11/26/13.
//
//
#import "MASUtilities.h"
#import "MASConstraintMaker.h"
#import "MASViewAttribute.h"
@interface NSArray (MASAdditions)
/**
* Creates a MASConstraintMaker with each view in the callee.
* Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view
*
* @param block scope within which you can build up the constraints which you wish to apply to each view.
*
* @return Array of created MASConstraints
*/
- (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block;
/**
* Creates a MASConstraintMaker with each view in the callee.
* Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
* If an existing constraint exists then it will be updated instead.
*
* @param block scope within which you can build up the constraints which you wish to apply to each view.
*
* @return Array of created/updated MASConstraints
*/
- (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block;
/**
* Creates a MASConstraintMaker with each view in the callee.
* Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
* All constraints previously installed for the views will be removed.
*
* @param block scope within which you can build up the constraints which you wish to apply to each view.
*
* @return Array of created/updated MASConstraints
*/
- (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block;
@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com |
/* Copyright 2015 Samsung Electronics Co., LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/***************************************************************************
* Texture made by a bitmap.
***************************************************************************/
#ifndef BASE_TEXTURE_H_
#define BASE_TEXTURE_H_
#include <string>
#include <android/bitmap.h>
#include "objects/textures/texture.h"
#include "util/gvr_log.h"
namespace gvr {
class BaseTexture: public Texture {
public:
explicit BaseTexture(JNIEnv* env, jobject bitmap) :
Texture(new GLTexture(TARGET)) {
int ret;
if (bitmap == NULL) {
std::string error =
"new BaseTexture() failed! Input bitmap is NULL.";
throw error;
}
if ((ret = AndroidBitmap_getInfo(env, bitmap, &info_)) < 0) {
std::string error = "AndroidBitmap_getInfo () failed! error = "
+ ret;
throw error;
}
env_ = env;
bitmapRef_ = env->NewGlobalRef(bitmap);
pending_gl_task_ = GL_TASK_INIT_BITMAP;
}
explicit BaseTexture(int width, int height, const unsigned char* pixels,
int* texture_parameters) :
Texture(new GLTexture(TARGET, texture_parameters)),
pixels_(pixels)
{
width_ = width;
height_ = height;
pending_gl_task_ = GL_TASK_INIT_PIXELS_PARAMS;
}
explicit BaseTexture(int* texture_parameters) :
Texture(new GLTexture(TARGET, texture_parameters)), pending_gl_task_(GL_TASK_NONE) {
}
virtual ~BaseTexture() {
switch (pending_gl_task_) {
case GL_TASK_INIT_BITMAP:
env_->DeleteGlobalRef(bitmapRef_);
break;
default:
break;
}
}
bool update(int width, int height, void* data) {
glBindTexture(GL_TEXTURE_2D, gl_texture_->id());
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0,
GL_LUMINANCE, GL_UNSIGNED_BYTE, data);
glGenerateMipmap (GL_TEXTURE_2D);
return (glGetError() == 0) ? 1 : 0;
}
GLenum getTarget() const {
return TARGET;
}
virtual void runPendingGL() {
Texture::runPendingGL();
switch (pending_gl_task_) {
case GL_TASK_NONE:
return;
case GL_TASK_INIT_BITMAP: {
int ret;
if ((ret = AndroidBitmap_lockPixels(env_, bitmapRef_, (void**)&pixels_)) < 0) {
std::string error = "AndroidBitmap_lockPixels () failed! error = "
+ ret;
throw error;
}
glBindTexture(GL_TEXTURE_2D, gl_texture_->id());
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, info_.width, info_.height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, pixels_);
glGenerateMipmap(GL_TEXTURE_2D);
AndroidBitmap_unlockPixels(env_, bitmapRef_);
env_->DeleteGlobalRef(bitmapRef_);
break;
}
case GL_TASK_INIT_PIXELS_PARAMS: {
glBindTexture(GL_TEXTURE_2D, gl_texture_->id());
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width_, height_, 0, GL_RGBA,
GL_UNSIGNED_BYTE, pixels_);
glGenerateMipmap (GL_TEXTURE_2D);
break;
}
} // switch
pending_gl_task_ = GL_TASK_NONE;
}
private:
BaseTexture(const BaseTexture& base_texture);
BaseTexture(BaseTexture&& base_texture);
BaseTexture& operator=(const BaseTexture& base_texture);
BaseTexture& operator=(BaseTexture&& base_texture);
private:
static const GLenum TARGET = GL_TEXTURE_2D;
// Enum for pending GL tasks. Keep a comma with each line
// for easier merging.
enum {
GL_TASK_NONE = 0,
GL_TASK_INIT_BITMAP,
GL_TASK_INIT_PIXELS_PARAMS,
GL_TASK_INIT_PARAMS,
};
int pending_gl_task_;
JNIEnv* env_;
jobject bitmapRef_;
AndroidBitmapInfo info_;
const unsigned char* pixels_;
int width_;
int height_;
};
}
#endif
|
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkWebpCodec_DEFINED
#define SkWebpCodec_DEFINED
#include "SkCodec.h"
#include "SkColorSpace.h"
#include "SkEncodedFormat.h"
#include "SkImageInfo.h"
#include "SkTypes.h"
class SkStream;
static const size_t WEBP_VP8_HEADER_SIZE = 30;
class SkWebpCodec final : public SkCodec {
public:
// Assumes IsWebp was called and returned true.
static SkCodec* NewFromStream(SkStream*);
static bool IsWebp(const void*, size_t);
protected:
Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*, int*)
override;
SkEncodedFormat onGetEncodedFormat() const override { return kWEBP_SkEncodedFormat; }
SkISize onGetScaledDimensions(float desiredScale) const override;
bool onDimensionsSupported(const SkISize&) override;
bool onGetValidSubset(SkIRect* /* desiredSubset */) const override;
private:
SkWebpCodec(int width, int height, const SkEncodedInfo&, SkStream*);
typedef SkCodec INHERITED;
};
#endif // SkWebpCodec_DEFINED
|
/* Simple example for Teensy USB Development Board
* http://www.pjrc.com/teensy/
* Copyright (c) 2008 PJRC.COM, LLC
*
* 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.
*/
#include <avr/io.h>
//#include <avr/pgmspace.h>
#include <util/delay.h>
#include "usb_serial.h"
#include "sampling.h"
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
#define CPU_16MHz 0x00
#define CPU_125kHz 0x07
#define HEX(n) (((n) < 10) ? ((n) + '0') : ((n) + 'A' - 10))
// Teensy 2.0: LED is active high
#if defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB1286__)
#define LED_ON (PORTD |= (1<<6))
#define LED_OFF (PORTD &= ~(1<<6))
#define LED_TOGGLE (PORTD ^= (1<<6))
#endif
#define LED_CONFIG (DDRD |= (1<<6))
void blink_n_times(int v) {
LED_OFF;
v *= 2;
while (v-- > 0) {
_delay_ms(100);
LED_TOGGLE;
}
_delay_ms(100);
}
int main(void)
{
uint16_t val;
char buf[4];
CPU_PRESCALE(CPU_125kHz);
_delay_ms(1); // allow slow power supply startup
CPU_PRESCALE(CPU_16MHz); // set for 16 MHz clock
// CPU_PRESCALE(0);
LED_CONFIG;
LED_OFF;
// initialize the USB, and then wait for the host
// to set configuration. If the Teensy is powered
// without a PC connected to the USB port, this
// will wait forever.
usb_init();
// while (!usb_configured()) /* wait */ ;
_delay_ms(1000);
adc_start(ADC_MUX_PIN_F1, ADC_REF_POWER);
while (1) {
// read the next ADC sample, and send it as ascii hex
val = adc_read();
//_delay_ms(500);//DEBUG
LED_TOGGLE;
buf[0] = HEX((val >> 8) & 15);
buf[1] = HEX((val >> 4) & 15);
buf[2] = HEX(val & 15);
buf[3] = ' ';
int v = usb_serial_write((unsigned char *)buf, 4);
if (v) {
blink_n_times(0-v);
}
}
}
|
/*
** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
**
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of version 2 of the GNU Library General
** Public License as published by the Free Software Foundation.
**
** 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
** Library General Public License for more details. To obtain a
** copy of the GNU Library General Public License, write to the Free
** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Any permitted reproduction of these routines, in whole or in part,
** must bear this legend.
**
**
** types.h
**
** Data type definitions
** $Id: noftypes.h,v 1.1 2001/04/27 14:37:11 neil Exp $
*/
#ifndef _TYPES_H_
#define _TYPES_H_
/* Define this if running on little-endian (x86) systems */
#define HOST_LITTLE_ENDIAN
#ifdef __GNUC__
#define INLINE static inline
#define ZERO_LENGTH 0
#elif defined(WIN32)
#define INLINE static __inline
#define ZERO_LENGTH 0
#else /* crapintosh? */
#define INLINE static
#define ZERO_LENGTH 1
#endif
/* quell stupid compiler warnings */
#define UNUSED(x) ((x) = (x))
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
#ifndef __cplusplus
typedef enum
{
false = 0,
true = 1
} bool;
#ifndef NULL
#define NULL ((void *) 0)
#endif
#endif /* !__cplusplus */
#include <memguard.h>
#include <log.h>
#ifdef NOFRENDO_DEBUG
#define ASSERT(expr) log_assert((int) (expr), __LINE__, __FILE__, NULL)
#define ASSERT_MSG(msg) log_assert(false, __LINE__, __FILE__, (msg))
#else /* !NOFRENDO_DEBUG */
#define ASSERT(expr)
#define ASSERT_MSG(msg)
#endif /* !NOFRENDO_DEBUG */
#endif /* _TYPES_H_ */
/*
** $Log: noftypes.h,v $
** Revision 1.1 2001/04/27 14:37:11 neil
** wheeee
**
** Revision 1.1.1.1 2001/04/27 07:03:54 neil
** initial
**
** Revision 1.15 2000/11/05 16:37:18 matt
** rolled rgb.h into bitmap.h
**
** Revision 1.14 2000/10/17 03:22:16 matt
** safe UNUSED
**
** Revision 1.13 2000/10/10 13:58:14 matt
** stroustrup squeezing his way in the door
**
** Revision 1.12 2000/10/10 13:03:54 matt
** Mr. Clean makes a guest appearance
**
** Revision 1.11 2000/08/11 01:44:05 matt
** cosmeses
**
** Revision 1.10 2000/07/31 04:28:47 matt
** one million cleanups
**
** Revision 1.9 2000/07/24 04:30:17 matt
** ASSERTs should have been calling log_shutdown
**
** Revision 1.8 2000/07/17 01:52:28 matt
** made sure last line of all source files is a newline
**
** Revision 1.7 2000/07/04 04:46:44 matt
** moved INLINE define from osd.h
**
** Revision 1.6 2000/06/09 15:12:25 matt
** initial revision
**
*/
|
/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "bionic/bionic.h"
#if defined(BIONIC_NEED_STRLCAT)
#include <sys/types.h>
#include <string.h>
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
size_t
strlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return(dlen + strlen(s));
while (*s != '\0') {
if (n != 1) {
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}
#endif /* BIONIC_NEED_STRLCAT */
|
// Copyright 2012-2016 Google
// 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.
// IndexReader and IndexBuilder
// * reads/writes feature levels and scalings of a specific feature family
// for all observations.
// * are interfaces for parameter updaters.
// * The "back-end" storage for these indexers are undefined, can be memory or
// disk based.
#ifndef EMRE_INDEXERS_INDEXER_H_ // NOLINT
#define EMRE_INDEXERS_INDEXER_H_
#include <memory>
#include <vector>
#include "feature_index.h" // NOLINT
#include "vector_storage.h" // NOLINT
#include "base/integral_types.h"
namespace emre {
class IndexReader {
public:
virtual ~IndexReader() {}
// The feature family this IndexReader handles.
virtual const std::string GetFeatureFamily() const = 0;
// Num of levels of the feature family.
virtual int GetNumLevels() const = 0;
// Num of observations.
virtual int GetNumObservations() const = 0;
// Get level iterator.
// Note: This call invalidates all previous iterators.
virtual VectorReader<int32>::Iterator GetLevelIterator() = 0;
// Get scaling iterator.
// Note: This call invalidates all previous iterators.
virtual VectorReader<double>::Iterator GetScalingIterator() = 0;
// FillFeatureLevel is based on the VectorReader interface,
// it reads through its elements sequentially, hence we need to
// reset it with 'ResetFeatureLevel' before actual use.
virtual void ResetFeatureLevel() = 0;
virtual void FillFeatureLevel(FeatureData* data) = 0;
};
// IndexReader whose all scalings equal 1.0
class IndexReaderWithDefaultScaling : public IndexReader {
public:
explicit IndexReaderWithDefaultScaling(int num_rows)
: const_scaling_reader_(1.0, num_rows) {}
VectorReader<double>::Iterator GetScalingIterator() override {
return const_scaling_reader_.GetIterator();
}
private:
ConstVectorReader<double> const_scaling_reader_;
};
class IndexBuilder {
public:
IndexBuilder() {}
virtual ~IndexBuilder() {}
// The feature family that this IndexWriter handles.
virtual const std::string GetFeatureFamily() const = 0;
// Process one observation.
virtual void ProcessData(const FeatureData& data) = 0;
// Move to IndexReader. Note: Do not use this object after move.
virtual std::unique_ptr<IndexReader> MoveToReader() = 0;
// Get feature level ID of the observation.
virtual int GetFeatureLevelId(const FeatureData& data) const = 0;
};
} // namespace emre
#endif // EMRE_INDEXERS_INDEXER_H_ // NOLINT
|
//
// UserSettingInfo+CoreDataClass.h
// Sharp Time
//
// Created by power on 2017/5/19.
// Copyright © 2017年 powertorque. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class UserRecord;
NS_ASSUME_NONNULL_BEGIN
@interface UserSettingInfo : NSManagedObject
@end
NS_ASSUME_NONNULL_END
#import "UserSettingInfo+CoreDataProperties.h"
|
/** @file etk_spinner.h */
#ifndef _ETK_SPINNER_H_
#define _ETK_SPINNER_H_
#include "etk_range.h"
#include <Ecore.h>
#include "etk_types.h"
/**
* @defgroup Etk_Spinner Etk_Spinner
* @brief A spinner is a widget that allows the user to set the value of a setting
* @{
*/
/** Gets the type of a spinner */
#define ETK_SPINNER_TYPE (etk_spinner_type_get())
/** Casts the object to an Etk_Spinner */
#define ETK_SPINNER(obj) (ETK_OBJECT_CAST((obj), ETK_SPINNER_TYPE, Etk_Spinner))
/** Checks if the object is an Etk_Spinner */
#define ETK_IS_SPINNER(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_SPINNER_TYPE))
/**
* @brief @widget A widget that allows the user to set the value of a setting
* @structinfo
*/
struct Etk_Spinner
{
/* private: */
/* Inherit from Etk_Range */
Etk_Range range;
Evas_Object *editable_object;
Etk_Bool selection_dragging;
int digits;
char value_format[16];
Etk_Bool snap_to_ticks;
Etk_Bool wrap;
int successive_steps;
Ecore_Timer *step_timer;
};
Etk_Type *etk_spinner_type_get(void);
Etk_Widget *etk_spinner_new(double lower, double upper, double value, double step_increment, double page_increment);
void etk_spinner_digits_set(Etk_Spinner *spinner, int digits);
int etk_spinner_digits_get(Etk_Spinner *spinner);
void etk_spinner_snap_to_ticks_set(Etk_Spinner *spinner, Etk_Bool snap_to_ticks);
Etk_Bool etk_spinner_snap_to_ticks_get(Etk_Spinner *spinner);
void etk_spinner_wrap_set(Etk_Spinner *spinner, Etk_Bool wrap);
Etk_Bool etk_spinner_wrap_get(Etk_Spinner *spinner);
/** @} */
#endif
|
/*
tau - http://github.com/cwestin/tau
Copyright 2013 Chris Westin
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 PXALIGN_H
#define PXALIGN_H
#ifndef PX_STDLIB_H
#include <stdlib.h>
#define PX_STDLIB_H
#endif
/*
We use the local compiler in order to determine memory alignment requirements
on the local host. We use several C standards and truisms to do this:
(1) truism: A union must be as badly aligned as its worst aligned member
(2) standard: The address of union members must all be the same as the address
of the union itself
(3) standard: The address of the first member of a structure must be the same
as the address of the union itself
In order to determine what alignment is required, we declare a union that
contains one of every basic type; this union must then have worst-case
alignment.
We can add that union to a structure that begins with a byte. The compiler
is then forced to align the union by adding pad bytes between the byte and
the union, and we can count those bytes using offsetof().
*/
struct pxAlignUnknown;
typedef union
{
char c;
short s;
long l;
int i;
float f;
double d;
struct pxAlignUnknown *pU;
void *p;
} pxAlignAll;
typedef struct
{
char c;
pxAlignAll alignAll;
} pxAligner;
/*
This assumes that worst alignment must be a power of 2, which seems
reasonable, given hardware bus layout requirements.
*/
#define PXALIGN_WORST offsetof(pxAligner, alignAll)
#define PXALIGN_WORST_MASK (PXALIGN_WORST - 1)
/*
Return the aligned size for a size. That is, add enough padding to the
argument that it could be used to create an array of items of this size,
with each one beginning on the appropriate boundary.
*/
#define PXALIGN_SIZE(p) \
(((p) + PXALIGN_WORST_MASK) & (~PXALIGN_WORST_MASK))
#endif // PXALIGN_H
|
#include <X11/Xlib.h>
#include <X11/Xcursor/Xcursor.h>
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
|
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. 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.
*/
#ifndef RTCDataChannelHandler_h
#define RTCDataChannelHandler_h
#include "core/platform/mediastream/RTCDataChannelHandler.h"
#include "core/platform/mediastream/RTCDataChannelHandlerClient.h"
#include "public/platform/WebRTCDataChannelHandler.h"
#include "public/platform/WebRTCDataChannelHandlerClient.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
namespace WebCore {
class RTCDataChannelHandlerClient;
class RTCDataChannelHandler : public WebKit::WebRTCDataChannelHandlerClient {
public:
static PassOwnPtr<RTCDataChannelHandler> create(WebKit::WebRTCDataChannelHandler*);
virtual ~RTCDataChannelHandler();
void setClient(RTCDataChannelHandlerClient*);
String label() const;
// DEPRECATED
bool isReliable() const;
bool ordered() const;
unsigned short maxRetransmitTime() const;
unsigned short maxRetransmits() const;
String protocol() const;
bool negotiated() const;
unsigned short id() const;
unsigned long bufferedAmount();
bool sendStringData(const String&);
bool sendRawData(const char*, size_t);
void close();
// WebKit::WebRTCDataChannelHandlerClient implementation.
virtual void didChangeReadyState(ReadyState) const OVERRIDE;
virtual void didReceiveStringData(const WebKit::WebString&) const OVERRIDE;
virtual void didReceiveRawData(const char*, size_t) const OVERRIDE;
virtual void didDetectError() const OVERRIDE;
private:
explicit RTCDataChannelHandler(WebKit::WebRTCDataChannelHandler*);
OwnPtr<WebKit::WebRTCDataChannelHandler> m_webHandler;
RTCDataChannelHandlerClient* m_client;
};
} // namespace WebCore
#endif // RTCDataChannelHandler_h
|
int main()
{
int a = 2, b = 3, c;
int d[2] = {4, 2};
float m[2] = {1.5, 2.5};
char m2[2] = { 'a', 'b' };
c = a>=b;
print ("c 0");
printid(c);
c = d[0]>=d[1];
print ("c 1");
printid(c);
c = d[0]>=m[0];
print ("c 1");
printid(c);
c = m[0]>=m[1];
print ("c 0");
printid(c);
m[1] = 2.0;
c = m[1]>=d[1];
print ("c 1");
printid(c);
c = m2[1] >= m2[0];
print ("c 1");
printid(c);
c = m2[0] >= m2[1];
print ("c 0");
printid(c);
m2[0]=m2[1];
c = m2[1] >= m2[0];
print ("c 1");
printid(c);
return 0;
} |
/*
* 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/dynamodb/DynamoDB_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/dynamodb/model/ScalarAttributeType.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace DynamoDB
{
namespace Model
{
/**
* <p>Represents an attribute for describing the key schema for the table and
* indexes.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/AttributeDefinition">AWS
* API Reference</a></p>
*/
class AWS_DYNAMODB_API AttributeDefinition
{
public:
AttributeDefinition();
AttributeDefinition(Aws::Utils::Json::JsonView jsonValue);
AttributeDefinition& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>A name for the attribute.</p>
*/
inline const Aws::String& GetAttributeName() const{ return m_attributeName; }
/**
* <p>A name for the attribute.</p>
*/
inline bool AttributeNameHasBeenSet() const { return m_attributeNameHasBeenSet; }
/**
* <p>A name for the attribute.</p>
*/
inline void SetAttributeName(const Aws::String& value) { m_attributeNameHasBeenSet = true; m_attributeName = value; }
/**
* <p>A name for the attribute.</p>
*/
inline void SetAttributeName(Aws::String&& value) { m_attributeNameHasBeenSet = true; m_attributeName = std::move(value); }
/**
* <p>A name for the attribute.</p>
*/
inline void SetAttributeName(const char* value) { m_attributeNameHasBeenSet = true; m_attributeName.assign(value); }
/**
* <p>A name for the attribute.</p>
*/
inline AttributeDefinition& WithAttributeName(const Aws::String& value) { SetAttributeName(value); return *this;}
/**
* <p>A name for the attribute.</p>
*/
inline AttributeDefinition& WithAttributeName(Aws::String&& value) { SetAttributeName(std::move(value)); return *this;}
/**
* <p>A name for the attribute.</p>
*/
inline AttributeDefinition& WithAttributeName(const char* value) { SetAttributeName(value); return *this;}
/**
* <p>The data type for the attribute, where:</p> <ul> <li> <p> <code>S</code> -
* the attribute is of type String</p> </li> <li> <p> <code>N</code> - the
* attribute is of type Number</p> </li> <li> <p> <code>B</code> - the attribute is
* of type Binary</p> </li> </ul>
*/
inline const ScalarAttributeType& GetAttributeType() const{ return m_attributeType; }
/**
* <p>The data type for the attribute, where:</p> <ul> <li> <p> <code>S</code> -
* the attribute is of type String</p> </li> <li> <p> <code>N</code> - the
* attribute is of type Number</p> </li> <li> <p> <code>B</code> - the attribute is
* of type Binary</p> </li> </ul>
*/
inline bool AttributeTypeHasBeenSet() const { return m_attributeTypeHasBeenSet; }
/**
* <p>The data type for the attribute, where:</p> <ul> <li> <p> <code>S</code> -
* the attribute is of type String</p> </li> <li> <p> <code>N</code> - the
* attribute is of type Number</p> </li> <li> <p> <code>B</code> - the attribute is
* of type Binary</p> </li> </ul>
*/
inline void SetAttributeType(const ScalarAttributeType& value) { m_attributeTypeHasBeenSet = true; m_attributeType = value; }
/**
* <p>The data type for the attribute, where:</p> <ul> <li> <p> <code>S</code> -
* the attribute is of type String</p> </li> <li> <p> <code>N</code> - the
* attribute is of type Number</p> </li> <li> <p> <code>B</code> - the attribute is
* of type Binary</p> </li> </ul>
*/
inline void SetAttributeType(ScalarAttributeType&& value) { m_attributeTypeHasBeenSet = true; m_attributeType = std::move(value); }
/**
* <p>The data type for the attribute, where:</p> <ul> <li> <p> <code>S</code> -
* the attribute is of type String</p> </li> <li> <p> <code>N</code> - the
* attribute is of type Number</p> </li> <li> <p> <code>B</code> - the attribute is
* of type Binary</p> </li> </ul>
*/
inline AttributeDefinition& WithAttributeType(const ScalarAttributeType& value) { SetAttributeType(value); return *this;}
/**
* <p>The data type for the attribute, where:</p> <ul> <li> <p> <code>S</code> -
* the attribute is of type String</p> </li> <li> <p> <code>N</code> - the
* attribute is of type Number</p> </li> <li> <p> <code>B</code> - the attribute is
* of type Binary</p> </li> </ul>
*/
inline AttributeDefinition& WithAttributeType(ScalarAttributeType&& value) { SetAttributeType(std::move(value)); return *this;}
private:
Aws::String m_attributeName;
bool m_attributeNameHasBeenSet;
ScalarAttributeType m_attributeType;
bool m_attributeTypeHasBeenSet;
};
} // namespace Model
} // namespace DynamoDB
} // namespace Aws
|
/*
* BMKMapManager.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKGeneralDelegate.h"
#import <UIKit/UIKit.h>
#import "BMKTypes.h"
enum EN_PERMISSION_STATUS
{
E_PERMISSION_OK = 0, // 授权验证通过
E_PERMISSION_SERVER_ERROR = -200, //服务端数据错误,无法解析服务端返回数据
E_PERMISSION_NETWORK_ERROR = -300, //无法建立与服务端的连接
};
//地图模块枚举
typedef enum {
BMKMapModuleTile = 0, //瓦片图模块
}BMKMapModule;
///主引擎类
@interface BMKMapManager : NSObject
/**
*百度地图SDK所有接口均支持百度坐标(BD09LL)和国测局坐标(GCJ02),用此方法设置您使用的坐标类型.
*默认是BD09LL(BMK_COORDTYPE_BD09LL)坐标.
*如果需要使用GCJ02坐标,需要设置CoordinateType为:BMK_COORDTYPE_COMMON.
*/
+ (BOOL)setCoordinateTypeUsedInBaiduMapSDK:(BMK_COORD_TYPE) coorType;
/**
*获取百度地图SDK当前使用的经纬度类型
*@return 经纬度类型
*/
+ (BMK_COORD_TYPE)getCoordinateTypeUsedInBaiduMapSDK;
/**
*是否开启打印某模块的log,默认不打印log
*debug时,建议打开,有利于调试程序;release时建议关闭
*@param enable 是否开启
*@param mapModule 地图模块
*/
+ (void)logEnable:(BOOL) enable module:(BMKMapModule) mapModule;
/**
*启动引擎
*@param key 申请的有效key
*/
-(BOOL)start:(NSString*)key generalDelegate:(id<BMKGeneralDelegate>)delegate;
/**
*获取所有在线服务消耗的发送流量,单位:字节
*/
-(int)getTotalSendFlaxLength;
/**
*获取所有在线服务消耗的接收流量,单位:字节
*/
-(int)getTotalRecvFlaxLength;
/**
*停止引擎
*/
-(BOOL)stop;
@end
|
// Copyright 2005-2017 Michel Fortin
//
// 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;
@interface AboutController : UITableViewController
@property (nonatomic, weak) IBOutlet UITableViewCell *websiteCell;
@property (nonatomic, weak) IBOutlet UITableViewCell *feedbackCell;
@property (nonatomic, weak) IBOutlet UITableViewCell *appStoreCell;
@property (nonatomic, weak) IBOutlet UITableViewCell *redStripeCell;
@property (nonatomic, weak) IBOutlet UITableViewCell *aboutCell;
@property (nonatomic, readonly) NSIndexPath *aboutIndexPath;
@property (nonatomic, weak) IBOutlet UITableViewCell *creditsCell;
@property (nonatomic, readonly) NSIndexPath *creditsIndexPath;
@property (nonatomic, readonly) NSURL *localizedWebsiteURL;
@property (nonatomic, readonly) NSString *localizedFeedbackEmailAddress;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/codestar-notifications/CodeStarNotifications_EXPORTS.h>
#include <aws/codestar-notifications/CodeStarNotificationsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace CodeStarNotifications
{
namespace Model
{
/**
*/
class AWS_CODESTARNOTIFICATIONS_API UnsubscribeRequest : public CodeStarNotificationsRequest
{
public:
UnsubscribeRequest();
// 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 "Unsubscribe"; }
Aws::String SerializePayload() const override;
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline const Aws::String& GetArn() const{ return m_arn; }
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline UnsubscribeRequest& WithArn(const Aws::String& value) { SetArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline UnsubscribeRequest& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the notification rule.</p>
*/
inline UnsubscribeRequest& WithArn(const char* value) { SetArn(value); return *this;}
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline const Aws::String& GetTargetAddress() const{ return m_targetAddress; }
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline bool TargetAddressHasBeenSet() const { return m_targetAddressHasBeenSet; }
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline void SetTargetAddress(const Aws::String& value) { m_targetAddressHasBeenSet = true; m_targetAddress = value; }
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline void SetTargetAddress(Aws::String&& value) { m_targetAddressHasBeenSet = true; m_targetAddress = std::move(value); }
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline void SetTargetAddress(const char* value) { m_targetAddressHasBeenSet = true; m_targetAddress.assign(value); }
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline UnsubscribeRequest& WithTargetAddress(const Aws::String& value) { SetTargetAddress(value); return *this;}
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline UnsubscribeRequest& WithTargetAddress(Aws::String&& value) { SetTargetAddress(std::move(value)); return *this;}
/**
* <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
*/
inline UnsubscribeRequest& WithTargetAddress(const char* value) { SetTargetAddress(value); return *this;}
private:
Aws::String m_arn;
bool m_arnHasBeenSet;
Aws::String m_targetAddress;
bool m_targetAddressHasBeenSet;
};
} // namespace Model
} // namespace CodeStarNotifications
} // namespace Aws
|
/* $NetBSD: hdaudio_mixer.h,v 1.3 2009/09/07 11:49:27 jmcneill Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support@precedence.co.uk>
* Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca>
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Precedence Technologies Ltd
*
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _HDAUDIO_MIXER_H
#define _HDAUDIO_MIXER_H
/* From src/lib/libossaudio/soundcard.h */
#define HDAUDIO_MIXER_NRDEVICES 25
#define HDAUDIO_MIXER_VOLUME 0
#define HDAUDIO_MIXER_BASS 1
#define HDAUDIO_MIXER_TREBLE 2
#define HDAUDIO_MIXER_SYNTH 3
#define HDAUDIO_MIXER_PCM 4
#define HDAUDIO_MIXER_SPEAKER 5
#define HDAUDIO_MIXER_LINE 6
#define HDAUDIO_MIXER_MIC 7
#define HDAUDIO_MIXER_CD 8
#define HDAUDIO_MIXER_IMIX 9
#define HDAUDIO_MIXER_ALTPCM 10
#define HDAUDIO_MIXER_RECLEV 11
#define HDAUDIO_MIXER_IGAIN 12
#define HDAUDIO_MIXER_OGAIN 13
#define HDAUDIO_MIXER_LINE1 14
#define HDAUDIO_MIXER_LINE2 15
#define HDAUDIO_MIXER_LINE3 16
#define HDAUDIO_MIXER_DIGITAL1 17
#define HDAUDIO_MIXER_DIGITAL2 18
#define HDAUDIO_MIXER_DIGITAL3 19
#define HDAUDIO_MIXER_PHONEIN 20
#define HDAUDIO_MIXER_PHONEOUT 21
#define HDAUDIO_MIXER_VIDEO 22
#define HDAUDIO_MIXER_RADIO 23
#define HDAUDIO_MIXER_MONITOR 24
#define HDAUDIO_MASK(x) (1 << (HDAUDIO_MIXER_##x))
#define HDAUDIO_DEVICE_NAMES { \
AudioNmaster, AudioNbass, AudioNtreble, AudioNfmsynth, AudioNdac, \
"beep", AudioNline, AudioNmicrophone, AudioNcd, \
AudioNrecord, AudioNdac"2", "reclvl", AudioNinput, AudioNoutput, \
AudioNline"1", AudioNline"2", AudioNline"3", \
"dig1", "dig2", "dig3", "phin", "phout", \
AudioNvideo, "radio", AudioNmonitor \
}
#endif /* !_HDAUDIO_MIXER_H */
|
#ifndef __CALLSTACK_H__
#define __CALLSTACK_H__
typedef struct {
void *stackptr;
void *funcaddr;
void *calladdr;
} callstack_t;
#define CALLSTACK_MAX_DEPTH 1024
static callstack_t __callstack[CALLSTACK_MAX_DEPTH];
static int __callstack_depth = 0;
static inline void callstack_push(int tid, void *stackptr, void *funcaddr, void *calladdr) {
(void)tid;
assert(__callstack_depth >= 0 && __callstack_depth < CALLSTACK_MAX_DEPTH);
__callstack_depth++;
__callstack[__callstack_depth - 1].stackptr = stackptr;
__callstack[__callstack_depth - 1].funcaddr = funcaddr;
__callstack[__callstack_depth - 1].calladdr = calladdr;
}
static inline void callstack_pop(int tid, void *stackptr, void **funcaddr, void **calladdr) {
(void)tid;
assert(__callstack_depth >= 0 && __callstack_depth < CALLSTACK_MAX_DEPTH);
while (__callstack_depth > 0 && __callstack[__callstack_depth - 1].stackptr != stackptr) {
__callstack_depth--;
}
assert(__callstack_depth >= 0 && __callstack_depth < CALLSTACK_MAX_DEPTH);
if (__callstack_depth > 0 && __callstack[__callstack_depth - 1].stackptr == stackptr) {
*calladdr = __callstack[__callstack_depth - 1].calladdr;
*funcaddr = __callstack[__callstack_depth - 1].funcaddr;
__callstack_depth--;
} else {
*calladdr = *funcaddr = NULL;
}
return;
}
static inline void callstack_top(int tid, void **funcaddr, void **calladdr) {
(void)tid;
assert(__callstack_depth >= 0 && __callstack_depth < CALLSTACK_MAX_DEPTH);
if (__callstack_depth > 0) {
*calladdr = __callstack[__callstack_depth - 1].calladdr;
*funcaddr = __callstack[__callstack_depth - 1].funcaddr;
} else {
*calladdr = *funcaddr = NULL;
}
return;
}
static inline void *callstack_top_funcaddr(int tid) {
(void)tid;
assert(__callstack_depth >= 0 && __callstack_depth < CALLSTACK_MAX_DEPTH);
if (__callstack_depth > 0) {
return __callstack[__callstack_depth - 1].funcaddr;
} else {
return NULL;
}
}
static inline int callstack_depth(int tid) {
(void)tid;
assert(__callstack_depth >= 0 && __callstack_depth < CALLSTACK_MAX_DEPTH);
return __callstack_depth;
}
#endif
|
/*
ChibiOS/NIL - Copyright (C) 2013,2014 Giovanni Di Sirio.
This file is part of ChibiOS/NIL.
ChibiOS/NIL 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.
ChibiOS/NIL 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/>.
*/
/**
* @file templates/nilcore.c
* @brief Port code.
*
* @addtogroup NIL_CORE
* @{
*/
#include "nil.h"
/*===========================================================================*/
/* Module local definitions. */
/*===========================================================================*/
/*===========================================================================*/
/* Module exported variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Module local types. */
/*===========================================================================*/
/*===========================================================================*/
/* Module local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Module local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Module exported functions. */
/*===========================================================================*/
/**
* @brief Performs a context switch between two threads.
* @details This is the most critical code in any port, this function
* is responsible for the context switch between 2 threads.
* @note The implementation of this code affects <b>directly</b> the context
* switch performance so optimize here as much as you can.
*/
#if !defined(__DOXYGEN__)
__attribute__((naked))
#endif
void port_dummy1(void) {
asm (".global _port_switch");
asm ("_port_switch:");
asm ("subi %sp, %sp, 80"); /* Size of the intctx structure. */
asm ("mflr %r0");
asm ("stw %r0, 84(%sp)"); /* LR into the caller frame. */
asm ("mfcr %r0");
asm ("stw %r0, 0(%sp)"); /* CR. */
asm ("stmw %r14, 4(%sp)"); /* GPR14...GPR31. */
asm ("stw %sp, 0(%r4)"); /* Store swapped-out stack. */
asm ("lwz %sp, 0(%r3)"); /* Load swapped-in stack. */
asm ("lmw %r14, 4(%sp)"); /* GPR14...GPR31. */
asm ("lwz %r0, 0(%sp)"); /* CR. */
asm ("mtcr %r0");
asm ("lwz %r0, 84(%sp)"); /* LR from the caller frame. */
asm ("mtlr %r0");
asm ("addi %sp, %sp, 80"); /* Size of the intctx structure. */
asm ("blr");
}
/**
* @brief Start a thread by invoking its work function.
* @details If the work function returns @p chThdExit() is automatically
* invoked.
*/
#if !defined(__DOXYGEN__)
__attribute__((naked))
#endif
void port_dummy2(void) {
asm (".global _port_thread_start");
asm ("_port_thread_start:");
chSysUnlock();
asm ("mr %r3, %r31"); /* Thread parameter. */
asm ("mtctr %r30");
asm ("bctrl"); /* Invoke thread function. */
asm ("li %r0, 0");
asm ("bl chSysHalt"); /* Thread termination on exit. */
}
/** @} */
|
// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H
#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H
#include <grpc/support/port_platform.h>
#include <memory>
#include "src/core/lib/matchers/matchers.h"
namespace grpc_core {
// Represents Envoy RBAC Proto. [See
// https://github.com/envoyproxy/envoy/blob/release/v1.17/api/envoy/config/rbac/v3/rbac.proto]
struct Rbac {
enum class Action {
kAllow,
kDeny,
};
struct CidrRange {
CidrRange() = default;
CidrRange(std::string address_prefix, uint32_t prefix_len);
CidrRange(CidrRange&& other) noexcept;
CidrRange& operator=(CidrRange&& other) noexcept;
std::string ToString() const;
std::string address_prefix;
uint32_t prefix_len;
};
// TODO(ashithasantosh): Support for destination_port_range.
struct Permission {
enum class RuleType {
kAnd,
kOr,
kNot,
kAny,
kHeader,
kPath,
kDestIp,
kDestPort,
kMetadata,
kReqServerName,
};
static Permission MakeAndPermission(
std::vector<std::unique_ptr<Permission>> permissions);
static Permission MakeOrPermission(
std::vector<std::unique_ptr<Permission>> permissions);
static Permission MakeNotPermission(Permission permission);
static Permission MakeAnyPermission();
static Permission MakeHeaderPermission(HeaderMatcher header_matcher);
static Permission MakePathPermission(StringMatcher string_matcher);
static Permission MakeDestIpPermission(CidrRange ip);
static Permission MakeDestPortPermission(int port);
// All the other fields in MetadataMatcher are ignored except invert.
static Permission MakeMetadataPermission(bool invert);
static Permission MakeReqServerNamePermission(StringMatcher string_matcher);
Permission() = default;
Permission(Permission&& other) noexcept;
Permission& operator=(Permission&& other) noexcept;
std::string ToString() const;
RuleType type = RuleType::kAnd;
HeaderMatcher header_matcher;
StringMatcher string_matcher;
CidrRange ip;
int port;
// For type kAnd/kOr/kNot. For kNot type, the vector will have only one
// element.
std::vector<std::unique_ptr<Permission>> permissions;
// For kMetadata
bool invert = false;
};
struct Principal {
enum class RuleType {
kAnd,
kOr,
kNot,
kAny,
kPrincipalName,
kSourceIp,
kDirectRemoteIp,
kRemoteIp,
kHeader,
kPath,
kMetadata,
};
static Principal MakeAndPrincipal(
std::vector<std::unique_ptr<Principal>> principals);
static Principal MakeOrPrincipal(
std::vector<std::unique_ptr<Principal>> principals);
static Principal MakeNotPrincipal(Principal principal);
static Principal MakeAnyPrincipal();
static Principal MakeAuthenticatedPrincipal(StringMatcher string_matcher);
static Principal MakeSourceIpPrincipal(CidrRange ip);
static Principal MakeDirectRemoteIpPrincipal(CidrRange ip);
static Principal MakeRemoteIpPrincipal(CidrRange ip);
static Principal MakeHeaderPrincipal(HeaderMatcher header_matcher);
static Principal MakePathPrincipal(StringMatcher string_matcher);
// All the other fields in MetadataMatcher are ignored except invert.
static Principal MakeMetadataPrincipal(bool invert);
Principal() = default;
Principal(Principal&& other) noexcept;
Principal& operator=(Principal&& other) noexcept;
std::string ToString() const;
RuleType type = RuleType::kAnd;
HeaderMatcher header_matcher;
StringMatcher string_matcher;
CidrRange ip;
// For type kAnd/kOr/kNot. For kNot type, the vector will have only one
// element.
std::vector<std::unique_ptr<Principal>> principals;
// For kMetadata
bool invert = false;
};
struct Policy {
Policy() = default;
Policy(Permission permissions, Principal principals);
Policy(Policy&& other) noexcept;
Policy& operator=(Policy&& other) noexcept;
std::string ToString() const;
Permission permissions;
Principal principals;
};
Rbac() = default;
Rbac(Rbac::Action action, std::map<std::string, Policy> policies);
Rbac(Rbac&& other) noexcept;
Rbac& operator=(Rbac&& other) noexcept;
std::string ToString() const;
Action action;
std::map<std::string, Policy> policies;
};
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H */
|
/*
*
* Copyright (C) 2011 Colin Patrick McCabe <cmccabe@alumni.cmu.edu>
*
* This is licensed under the Apache License, Version 2.0. See file COPYING.
*/
#ifndef DUTILS_UTIL_PLATFORM_SOCKET_DOT_H
#define DUTILS_UTIL_PLATFORM_SOCKET_DOT_H
enum {
WANT_O_CLOEXEC = 0x1,
WANT_TCP_NODELAY = 0x2,
};
/** Similar to the traditional POSIX socket(2) call, but hides some
* platform-specific stuff.
*
* @param domain socket domain
* @param type socket type
* @param proto socket proto
* @param flags daemon utils socket flags
*
* @return A socket on success; or a negative error code on error.
*/
extern int do_socket(int domain, int type, int proto, int flags);
#endif
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by ScoreKeeper, 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>
#import "TiProxy.h"
#import "TiBlob.h"
// TODO: Support array-style access of bytes
/**
The class represents a buffer of bytes.
*/
@interface TiBuffer : TiProxy {
NSMutableData* data;
NSNumber* byteOrder;
}
/**
Provides access to raw data.
*/
@property(nonatomic, retain) NSMutableData* data;
// Public API
-(NSNumber*)append:(id)args;
-(NSNumber*)insert:(id)args;
-(NSNumber*)copy:(id)args;
-(TiBuffer*)clone:(id)args;
-(void)fill:(id)args;
-(void)clear:(id)_void;
-(void)release:(id)_void;
-(TiBlob*)toBlob:(id)_void;
-(NSString*)toString:(id)_void;
/**
Provides access to the buffer length.
*/
@property(nonatomic,assign) NSNumber* length;
/**
Provides access to the data byte order.
The byte order values are: 1 - little-endian, 2 - big-endian.
*/
@property(nonatomic,retain) NSNumber* byteOrder;
// SPECIAL NOTES:
// Ti.Buffer objects have an 'overloaded' Ti.Buffer[x] operation for x==int (making them behave like arrays).
// See the code for how this works.
@end
|
/* Copyright 2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/******************************************************************************
* Copyright 2013-2014 Espressif Systems (Wuxi)
*
* FileName: user_main.c
*
* Description: entry file of user application
*
* Modification history:
* 2014/12/1, v1.0 create this file.
*******************************************************************************/
#include "esp_common.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "user_config.h"
#include "esp8266_uart.h"
//-----------------------------------------------------------------------------
void show_free_mem(int idx) {
size_t res = xPortGetFreeHeapSize();
printf("dbg free memory(%d): %d\r\n", idx, res);
}
//-----------------------------------------------------------------------------
#include "jerry_targetjs.h"
static int jerry_task_init(void) {
int retcode;
int src;
DECLARE_JS_CODES;
/* run main.js */
show_free_mem(2);
retcode = js_entry(js_codes[0].source, js_codes[0].length);
if (retcode != 0) {
printf("js_entry failed code(%d) [%s]\r\n", retcode, js_codes[0].name);
return -1;
}
/* run rest of the js files */
show_free_mem(3);
for (src=1; js_codes[src].source; src++) {
retcode = js_eval(js_codes[src].source, js_codes[src].length);
if (retcode != 0) {
printf("js_eval failed code(%d) [%s]\r\n", retcode, js_codes[src].name);
return -2;
}
}
show_free_mem(4);
return 0;
}
void jerry_task(void *pvParameters) {
const portTickType xDelay = 100 / portTICK_RATE_MS;
uint32_t ticknow = 0;
if (jerry_task_init() == 0) {
for (;;) {
vTaskDelay(xDelay);
js_loop(ticknow);
if (!ticknow) {
show_free_mem(5);
}
ticknow++;
}
}
js_exit();
}
//-----------------------------------------------------------------------------
/*
* This is entry point for user code
*/
void ICACHE_FLASH_ATTR user_init(void)
{
const portTickType onesec = 1000 / portTICK_RATE_MS;
uart_div_modify(UART0, UART_CLK_FREQ / (BIT_RATE_115200));
show_free_mem(0);
wifi_softap_dhcps_stop();
show_free_mem(1);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0); // GPIO 0
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_GPIO2); // GPIO 2
xTaskCreate(jerry_task, "jerry", JERRY_STACK_SIZE, NULL, 2, NULL);
}
|
/* Copyright 2008 Justin Erenkrantz and Greg Stein
*
* 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 <apr.h>
#include <apr_pools.h>
#include <apr_strings.h>
#include "serf.h"
#include "serf_bucket_types.h"
#include "test_serf.h"
#if defined(WIN32) && defined(_DEBUG)
/* Include this file to allow running a Debug build of serf with a Release
build of OpenSSL. */
#include <openssl/applink.c>
#endif
/* Test that loading a custom CA certificate file works. */
static void test_ssl_load_cert_file(CuTest *tc)
{
serf_ssl_certificate_t *cert = NULL;
apr_status_t status = serf_ssl_load_cert_file(&cert, "test/serftestca.pem",
test_pool);
CuAssertIntEquals(tc, APR_SUCCESS, status);
CuAssertPtrNotNull(tc, cert);
}
/* Test that reading a custom CA certificate file works. */
static void test_ssl_cert_subject(CuTest *tc)
{
apr_pool_t *subpool;
apr_hash_t *subject;
serf_ssl_certificate_t *cert = NULL;
apr_status_t status;
apr_pool_create(&subpool, test_pool);
status = serf_ssl_load_cert_file(&cert, "test/serftestca.pem", subpool);
CuAssertIntEquals(tc, APR_SUCCESS, status);
CuAssertPtrNotNull(tc, cert);
subject = serf_ssl_cert_subject(cert, subpool);
CuAssertStrEquals(tc, "Test Suite",
apr_hash_get(subject, "OU", APR_HASH_KEY_STRING));
CuAssertStrEquals(tc, "In Serf we trust, Inc.",
apr_hash_get(subject, "O", APR_HASH_KEY_STRING));
CuAssertStrEquals(tc, "Mechelen",
apr_hash_get(subject, "L", APR_HASH_KEY_STRING));
CuAssertStrEquals(tc, "Antwerp",
apr_hash_get(subject, "ST", APR_HASH_KEY_STRING));
CuAssertStrEquals(tc, "BE",
apr_hash_get(subject, "C", APR_HASH_KEY_STRING));
CuAssertStrEquals(tc, "serf@example.com",
apr_hash_get(subject, "E", APR_HASH_KEY_STRING));
apr_pool_destroy(subpool);
}
CuSuite *test_ssl(void)
{
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_ssl_load_cert_file);
SUITE_ADD_TEST(suite, test_ssl_cert_subject);
return suite;
}
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* 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 file serves as a helper for bridging folly::future and python
* asyncio.future.
*/
#pragma once
#include <Python.h>
#include <folly/Executor.h>
#include <folly/futures/Future.h>
#include <folly/python/AsyncioExecutor.h>
#include <folly/python/executor.h>
namespace folly {
namespace python {
template <typename T>
void bridgeFuture(
folly::Executor* executor,
folly::Future<T>&& futureFrom,
folly::Function<void(folly::Try<T>&&, PyObject*)> callback,
PyObject* userData) {
// We are handing over a pointer to a python object to c++ and need
// to make sure it isn't removed by python in that time.
Py_INCREF(userData);
auto guard = folly::makeGuard([=] { Py_DECREF(userData); });
// Handle the lambdas for cython
// run callback from our Q
futureFrom.via(executor).then(
[callback = std::move(callback), userData, guard = std::move(guard)](
folly::Try<T>&& res) mutable {
// This will run from inside the gil, called by the asyncio add_reader
callback(std::move(res), userData);
// guard goes out of scope here, and its stored function is called
});
}
template <typename T>
void bridgeFuture(
folly::Future<T>&& futureFrom,
folly::Function<void(folly::Try<T>&&, PyObject*)> callback,
PyObject* userData) {
bridgeFuture(
getExecutor(), std::move(futureFrom), std::move(callback), userData);
}
template <typename T>
void bridgeSemiFuture(
folly::Executor* executor,
folly::SemiFuture<T>&& semiFutureFrom,
folly::Function<void(folly::Try<T>&&, PyObject*)> callback,
PyObject* userData) {
folly::Future<T> futureFrom = std::move(semiFutureFrom).via(executor);
bridgeFuture(executor, std::move(futureFrom), std::move(callback), userData);
}
template <typename T>
void bridgeSemiFuture(
folly::SemiFuture<T>&& semiFutureFrom,
folly::Function<void(folly::Try<T>&&, PyObject*)> callback,
PyObject* userData) {
bridgeSemiFuture(
getExecutor(), std::move(semiFutureFrom), std::move(callback), userData);
}
} // namespace python
} // namespace folly
|
/*
* 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/config/ConfigService_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_CONFIGSERVICE_API ConfigServiceErrorMarshaller : public Client::AWSErrorMarshaller
{
public:
ConfigServiceErrorMarshaller() {}
virtual ~ConfigServiceErrorMarshaller() {}
virtual Client::AWSError<Client::CoreErrors> FindErrorByName(const char* exceptionName) const;
};
} // namespace ConfigService
} // namespace Aws |
#ifndef CONNECTION_H
#define CONNECTION_H
class CConnnction
{
public:
CConnection();
virtual ~CConnection();
protected:
int connect() = 0;
void disconnect() = 0;
};
#endif /* CONNECTION_H */
|
//
// UIImage+Utility.h
//
// Created by sho yakushiji on 2013/05/17.
// Copyright (c) 2013年 CALACULU. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Utility)
+ (UIImage*)visitor_fastImageWithData:(NSData*)data;
+ (UIImage*)visitor_fastImageWithContentsOfFile:(NSString*)path;
- (UIImage*)visitor_deepCopy;
- (UIImage*)visitor_resize:(CGSize)size;
- (UIImage*)visitor_aspectFit:(CGSize)size;
- (UIImage*)visitor_aspectFill:(CGSize)size;
- (UIImage*)visitor_aspectFill:(CGSize)size offset:(CGFloat)offset;
- (UIImage*)visitor_crop:(CGRect)rect;
- (UIImage*)visitor_maskedImage:(UIImage*)maskImage;
- (UIImage*)visitor_gaussBlur:(CGFloat)blurLevel; // {blurLevel | 0 ≤ t ≤ 1}
+ (UIImage *)visitor_imageWithColor:(UIColor *)color size:(CGSize)size;
- (UIImage*)visitor_imageByScalingAndCroppingForSize:(CGSize)targetSize;
@end
|
/****************************************************************************
*
* Copyright 2016 Samsung Electronics 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.
*
****************************************************************************/
/************************************************************************
* libc/math/lib_fabsl.c
*
* This file is a part of NuttX:
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Ported by: Darcy Gong
*
* It derives from the Rhombs OS math library by Nick Johnson which has
* a compatibile, MIT-style license:
*
* Copyright (C) 2009, 2010 Nick Johnson <nickbjohnson4224 at gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
************************************************************************/
/************************************************************************
* Included Files
************************************************************************/
#include <math.h>
/************************************************************************
* Public Functions
************************************************************************/
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double fabsl(long double x)
{
return ((x < 0) ? -x : x);
}
#endif
|
//---------------------------------------------------------------------------
#ifndef MNVertexH
#define MNVertexH
#include <math.h>
//---------------------------------------------------------------------------
class MNVertex{
private:
double x;
double y;
double bulge; /*
angle= atan(|bulge|)*4
if(bulge<0)
clockwise
else
anticlockwise
bulge value is for an arc between this vertex
and next vertex
*/
public:
void setX(double value);
double getX();
void setY(double value);
double getY();
void setBulge(double value);
double getBulge();
MNVertex(double x, double y, double bulge);
MNVertex* clone();
void setToGrid(double dx, double dy);
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.