text
stringlengths 4
6.14k
|
|---|
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
char *str;
unsigned int pad0[ 3 ];
char *fmt;
unsigned int pad1[ 3 ];
va_list ap;
} c99_vsprintf_t;
int
_DEFUN (vsprintf, (str, fmt, ap),
char *str _AND
_CONST char *fmt _AND
va_list ap)
{
int* ret;
c99_vsprintf_t args;
ret = (int*) &args;
args.str = str;
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
return *ret;
}
|
/*
* QEMU/MIPS pseudo-board
*
* emulates a simple machine with ISA-like bus.
* ISA IO space mapped to the 0x14000000 (PHYS) and
* ISA memory at the 0x10000000 (PHYS, 16Mb in size).
* All peripherial devices are attached to this "bus" with
* the standard PC ISA addresses.
*/
/* Unicorn Emulator Engine */
/* By Nguyen Anh Quynh, 2015 */
#include "hw/hw.h"
#include "hw/mips/mips.h"
#include "hw/mips/cpudevs.h"
#include "hw/mips/bios.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "exec/address-spaces.h"
static int mips_r4k_init(struct uc_struct *uc, MachineState *machine)
{
const char *cpu_model = machine->cpu_model;
/* init CPUs */
if (cpu_model == NULL) {
#ifdef TARGET_MIPS64
cpu_model = "R4000";
#else
cpu_model = "24Kf";
#endif
}
uc->cpu = (void*) cpu_mips_init(uc, cpu_model);
if (uc->cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
return -1;
}
return 0;
}
void mips_machine_init(struct uc_struct *uc)
{
static QEMUMachine mips_machine = {
.name = "mips",
.init = mips_r4k_init,
.is_default = 1,
.arch = UC_ARCH_MIPS,
};
qemu_register_machine(uc, &mips_machine, TYPE_MACHINE, NULL);
}
|
/* This file is part of the KDE project
* Copyright (c) 2010 Jan Hambrecht <jaham@gmx.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef IMAGEEFFECT_H
#define IMAGEEFFECT_H
#include "KoFilterEffect.h"
#include <QImage>
#define ImageEffectId "feImage"
/// An image offset effect
class ImageEffect : public KoFilterEffect
{
public:
ImageEffect();
/// Returns the image
QImage image() const;
/// Sets the image
void setImage(const QImage &image);
/// reimplemented from KoFilterEffect
virtual QImage processImage(const QImage &image, const KoFilterEffectRenderContext &context) const;
/// reimplemented from KoFilterEffect
virtual bool load(const KoXmlElement &element, const KoFilterEffectLoadingContext &context);
/// reimplemented from KoFilterEffect
virtual void save(KoXmlWriter &writer);
private:
QImage m_image;
QRectF m_bound;
};
#endif // IMAGEEFFECT_H
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2003 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef LABELOUT_H_INCLUDED
#define LABELOUT_H_INCLUDED
typedef struct { int readOut[2], readErr[2]; } IOLabelSetup;
void IOLabelSetDefault( int flag );
int IOLabelSetupFDs( IOLabelSetup * );
int IOLabelSetupInClient( IOLabelSetup * );
int IOLabelSetupFinishInServer( IOLabelSetup *, ProcessState * );
int IOLabelCheckEnv( void );
#endif
|
/*
* Copyright (C) 2005 James Livingston <doclivingston@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The Rhythmbox authors hereby grant permission for non-GPL compatible
* GStreamer plugins to be used and distributed together with GStreamer
* and Rhythmbox. This permission is above and beyond the permissions granted
* by the GPL license by which Rhythmbox is covered. If you modify this code
* you may extend this exception to your version of the code, but you are not
* obligated to do so. If you do not wish to do so, delete this exception
* statement from your version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef __RB_GENERIC_PLAYER_SOURCE_H
#define __RB_GENERIC_PLAYER_SOURCE_H
#include "rb-shell.h"
#include "rb-media-player-source.h"
#include "rhythmdb.h"
#include "mediaplayerid.h"
#include <totem-pl-parser.h>
G_BEGIN_DECLS
#define RB_TYPE_GENERIC_PLAYER_SOURCE (rb_generic_player_source_get_type ())
#define RB_GENERIC_PLAYER_SOURCE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_GENERIC_PLAYER_SOURCE, RBGenericPlayerSource))
#define RB_GENERIC_PLAYER_SOURCE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_GENERIC_PLAYER_SOURCE, RBGenericPlayerSourceClass))
#define RB_IS_GENERIC_PLAYER_SOURCE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_GENERIC_PLAYER_SOURCE))
#define RB_IS_GENERIC_PLAYER_SOURCE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_GENERIC_PLAYER_SOURCE))
#define RB_GENERIC_PLAYER_SOURCE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_GENERIC_PLAYER_SOURCE, RBGenericPlayerSourceClass))
typedef struct
{
RBMediaPlayerSource parent;
} RBGenericPlayerSource;
typedef struct
{
RBMediaPlayerSourceClass parent;
char * (*get_mount_path) (RBGenericPlayerSource *source);
void (*load_playlists) (RBGenericPlayerSource *source);
char * (*uri_from_playlist_uri) (RBGenericPlayerSource *source, const char *uri);
char * (*uri_to_playlist_uri) (RBGenericPlayerSource *source, const char *uri, TotemPlParserType playlist_type);
/* used for track transfer - returns the filename relative to the audio folder on the device */
char * (*build_filename) (RBGenericPlayerSource *source, RhythmDBEntry *entry);
} RBGenericPlayerSourceClass;
GType rb_generic_player_source_get_type (void);
char * rb_generic_player_source_get_mount_path (RBGenericPlayerSource *source);
char * rb_generic_player_source_uri_from_playlist_uri (RBGenericPlayerSource *source,
const char *uri);
char * rb_generic_player_source_uri_to_playlist_uri (RBGenericPlayerSource *source,
const char *uri,
TotemPlParserType playlist_type);
void rb_generic_player_source_set_supported_formats (RBGenericPlayerSource *source,
TotemPlParser *parser);
TotemPlParserType rb_generic_player_source_get_playlist_format (RBGenericPlayerSource *source);
char * rb_generic_player_source_get_playlist_path (RBGenericPlayerSource *source);
gboolean rb_generic_player_is_mount_player (GMount *mount, MPIDDevice *device_info);
void rb_generic_player_source_delete_entries (RBGenericPlayerSource *source,
GList *entries);
/* for subclasses */
void rb_generic_player_source_add_playlist (RBGenericPlayerSource *source,
RBShell *shell,
RBSource *playlist);
void _rb_generic_player_source_register_type (GTypeModule *module);
G_END_DECLS
#endif /* __RB_GENERIC_PLAYER_SOURCE_H */
|
/**
*
* \file
*
* \brief Programmer APIs.
*
* Copyright (c) 2016-2017 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
#ifndef FIRMWARE_PROGRAMMER_APIS_H_INCLUDED
#define FIRMWARE_PROGRAMMER_APIS_H_INCLUDED
#include "common/include/nm_common.h"
#include "programmer/programmer.h"
#include "spi_flash/include/spi_flash_map.h"
#define programmer_write_cert_image(buff) programmer_write((uint8*)buff, M2M_TLS_FLASH_ROOTCERT_CACHE_OFFSET, M2M_TLS_FLASH_ROOTCERT_CACHE_SIZE)
#define programmer_read_cert_image(buff) programmer_read((uint8*)buff, M2M_TLS_FLASH_ROOTCERT_CACHE_OFFSET, M2M_TLS_FLASH_ROOTCERT_CACHE_SIZE)
#define programmer_erase_cert_image() programmer_erase(M2M_TLS_FLASH_ROOTCERT_CACHE_OFFSET, M2M_TLS_FLASH_ROOTCERT_CACHE_SIZE)
#define programmer_write_firmware_image(buff,offSet,sz) programmer_write((uint8*)buff, offSet, sz)
#define programmer_read_firmware_image(buff,offSet,sz) programmer_read((uint8*)buff, offSet, sz)
#define programmer_erase_all() programmer_erase(0, programmer_get_flash_size())
#endif /* FIRMWARE_PROGRAMMER_APIS_H_INCLUDED */
|
/*
Copyright 2010 OpenRTMFP
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License received along this program for more
details (or else see http://www.gnu.org/licenses/).
This file is a part of Cumulus.
*/
#pragma once
#include "SocketManager.h"
#include "Poco/Net/ServerSocket.h"
class TCPServer : private Cumulus::SocketHandler {
public:
TCPServer(Cumulus::SocketManager& manager);
virtual ~TCPServer();
bool start(Poco::UInt16 port);
bool running();
Poco::UInt16 port();
void stop();
protected:
Cumulus::SocketManager& manager;
private:
virtual void clientHandler(Poco::Net::StreamSocket& socket)=0;
void onReadable(Poco::Net::Socket& socket);
void onError(const Poco::Net::Socket& socket,const std::string& error);
Poco::Net::ServerSocket* _pSocket;
Poco::UInt16 _port;
};
inline bool TCPServer::running() {
return _pSocket?true:false;
}
inline Poco::UInt16 TCPServer::port() {
return _port;
}
|
#ifndef SRC_COMMON_STATS_H_
#define SRC_COMMON_STATS_H_
/*
* TODO (fine) Caller review needed.
* Make sure there's a counter for every worthwhile event,
* and also check the ICMP errors that sometimes need to be appended to them.
*/
/**
* NOTE THAT ANY MODIFICATIONS MADE TO THIS STRUCTURE NEED TO BE CASCADED TO
* jstat_metadatas.
*/
enum jool_stat_id {
JSTAT_RECEIVED6 = 1,
JSTAT_RECEIVED4,
JSTAT_SUCCESS,
JSTAT_BIB_ENTRIES,
JSTAT_SESSIONS,
JSTAT_ENOMEM,
JSTAT_XLATOR_DISABLED,
JSTAT_POOL6_UNSET,
JSTAT_SKB_SHARED,
JSTAT_L3HDR_OFFSET,
JSTAT_SKB_TRUNCATED,
JSTAT_FRAGMENTED_PING,
JSTAT_HDR6,
JSTAT_HDR4,
JSTAT_UNKNOWN_L4_PROTO,
JSTAT_UNKNOWN_ICMP6_TYPE,
JSTAT_UNKNOWN_ICMP4_TYPE,
JSTAT_DOUBLE_ICMP6_ERROR,
JSTAT_DOUBLE_ICMP4_ERROR,
JSTAT_UNKNOWN_PROTO_INNER,
JSTAT_HAIRPIN_LOOP,
JSTAT_POOL6_MISMATCH,
JSTAT_POOL4_MISMATCH,
JSTAT_ICMP6_FILTER,
JSTAT_UNTRANSLATABLE_DST6,
JSTAT_UNTRANSLATABLE_DST4,
JSTAT_6056_F,
JSTAT_MASK_DOMAIN_NOT_FOUND,
JSTAT_BIB6_NOT_FOUND,
JSTAT_BIB4_NOT_FOUND,
JSTAT_SESSION_NOT_FOUND,
JSTAT_ADF,
JSTAT_V4_SYN,
JSTAT_SYN6_EXPECTED,
JSTAT_SYN4_EXPECTED,
JSTAT_TYPE1PKT,
JSTAT_TYPE2PKT,
JSTAT_SO_EXISTS,
JSTAT_SO_FULL,
JSTAT64_SRC,
JSTAT64_DST,
JSTAT64_PSKB_COPY,
JSTAT64_6791_ENOENT,
JSTAT64_ICMP_CSUM,
JSTAT64_UNTRANSLATABLE_PARAM_PROB_PTR,
JSTAT64_TTL,
JSTAT64_FRAG_THEN_EXT,
JSTAT64_SEGMENTS_LEFT,
JSTAT46_SRC,
JSTAT46_DST,
JSTAT46_PSKB_COPY,
JSTAT46_6791_ENOENT,
JSTAT46_ICMP_CSUM,
JSTAT46_UNTRANSLATABLE_PARAM_PROBLEM_PTR,
JSTAT46_TTL,
JSTAT46_SRC_ROUTE,
JSTAT46_FRAGMENTED_ZERO_CSUM,
JSTAT46_BAD_MTU,
JSTAT_FAILED_ROUTES,
JSTAT_PKT_TOO_BIG,
JSTAT_DST_OUTPUT,
JSTAT_ICMP6ERR_SUCCESS,
JSTAT_ICMP6ERR_FAILURE,
JSTAT_ICMP4ERR_SUCCESS,
JSTAT_ICMP4ERR_FAILURE,
JSTAT_ICMPEXT_SMALL,
JSTAT_ICMPEXT_BIG,
/* These 3 need to be last, and in this order. */
JSTAT_UNKNOWN, /* "WTF was that" errors only. */
JSTAT_PADDING,
JSTAT_COUNT,
#define JSTAT_MAX (JSTAT_COUNT - 1)
};
#endif /* SRC_COMMON_STATS_H_ */
|
/*
This file is part of Darling.
Copyright (C) 2017 Lubos Dolezel
Darling 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.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@interface AVFigEndpointUIAgentOutputDeviceAuthorizationRequestImpl : NSObject
@end
|
/*
* Copyleft RIME Developers
* License: GPLv3
*
* 2011-12-04 GONG Chen <chen.sst@gmail.com>
*/
#ifndef RIME_VERSION_H_
#define RIME_VERSION_H_
#define RIME_VERSION "1.2.0"
#endif // RIME_VERSION_H_
|
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim 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, 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.
*/
/** \file
* \brief Board specific LED driver header for the Atmel EVK1100.
* \copydetails Group_LEDs_EVK1100
*
* \note This file should not be included directly. It is automatically included as needed by the LEDs driver
* dispatch header located in LUFA/Drivers/Board/LEDs.h.
*/
/** \ingroup Group_LEDs
* \defgroup Group_LEDs_EVK1100 EVK1100
* \brief Board specific LED driver header for the Atmel EVK1100.
*
* Board specific LED driver header for the Atmel EVK1100.
*
* @{
*/
#ifndef __LEDS_EVK1100_H__
#define __LEDS_EVK1100_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
#define LEDS_PORT 1
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** LED mask for the first LED on the board. */
#define LEDS_LED1 (1UL << 19)
/** LED mask for the second LED on the board. */
#define LEDS_LED2 (1UL << 20)
/** LED mask for the third LED on the board. */
#define LEDS_LED3 (1UL << 21)
/** LED mask for the fourth LED on the board. */
#define LEDS_LED4 (1UL << 22)
/** LED mask for the fifth LED on the board. */
#define LEDS_LED5 (1UL << 27)
/** LED mask for the sixth LED on the board. */
#define LEDS_LED6 (1UL << 28)
/** LED mask for the seventh LED on the board. */
#define LEDS_LED7 (1UL << 29)
/** LED mask for the eighth LED on the board. */
#define LEDS_LED8 (1UL << 30)
/** LED mask for all the LEDs on the board. */
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4 \
LEDS_LED5 | LEDS_LED6 | LEDS_LED7 | LEDS_LED8)
/** LED mask for the none of the board LEDs */
#define LEDS_NO_LEDS 0
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
AVR32_GPIO.port[LEDS_PORT].gpers = LEDS_ALL_LEDS;
AVR32_GPIO.port[LEDS_PORT].oders = LEDS_ALL_LEDS;
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS;
}
static inline void LEDs_Disable(void)
{
AVR32_GPIO.port[LEDS_PORT].gperc = LEDS_ALL_LEDS;
AVR32_GPIO.port[LEDS_PORT].oderc = LEDS_ALL_LEDS;
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDS_ALL_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask)
{
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask;
}
static inline void LEDs_TurnOffLEDs(const uint32_t LEDMask)
{
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDMask;
}
static inline void LEDs_SetAllLEDs(const uint32_t LEDMask)
{
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS;
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask;
}
static inline void LEDs_ChangeLEDs(const uint32_t LEDMask, const uint32_t ActiveMask)
{
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDMask;
AVR32_GPIO.port[LEDS_PORT].ovrc = ActiveMask;
}
static inline void LEDs_ToggleLEDs(const uint32_t LEDMask)
{
AVR32_GPIO.port[LEDS_PORT].ovrt = LEDMask;
}
static inline uint32_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint32_t LEDs_GetLEDs(void)
{
return (~AVR32_GPIO.port[LEDS_PORT].ovr & LEDS_ALL_LEDS);
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
|
/*
This file is part of Darling.
Copyright (C) 2017 Lubos Dolezel
Darling 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.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@interface CIPortraitFaceMask : NSObject
@end
|
/* vim: set expandtab ts=4 sw=4: */
/*
* You may redistribute this program and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Node_H
#define Node_H
#include "dht/Address.h"
#include <stdint.h>
#include <stdbool.h>
/** A network address for reaching a peer, in the format which is sent over the wire. */
struct Node
{
/**
* The reach of the node (how big/fast/close it is).
* Since reach is a fraction, the reach number represents a percentage where 0xFFFFFFFF = 100%
*/
uint32_t reach;
/** The version of the node, must be synchronized with NodeHeader */
uint32_t version;
/** The address of the node. */
struct Address address;
/**
* If we lookup a node and the current time is later than this, ping it.
* In ms, as per Time_currentTimeMilliseconds.
*/
uint64_t timeOfNextPing;
/**
* Used to count the number of consecutive missed pings when testing reach.
* Not allowing 1 or 2 before penalizing was causing us to switch paths too often,
* leading to latency spikes.
*/
uint8_t missedPings;
};
#endif
|
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
bool Entity_IsLight( entity_t *e );
void Light_OnKeyValueChanged( entity_t *e, const char *key, const char* value );
void DrawLight( entity_t* e, int nGLState, int pref, int nViewType );
|
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
/**
* The users privacy preference for what kind of content to show in lock screen notifications.
*/
typedef NS_ENUM(NSUInteger, NotificationType) {
NotificationNoNameNoPreview,
NotificationNameNoPreview,
NotificationNamePreview,
};
// Used when migrating logging to NSUserDefaults.
extern NSString *const PropertyListPreferencesSignalDatabaseCollection;
extern NSString *const PropertyListPreferencesKeyEnableDebugLog;
@interface PropertyListPreferences : NSObject
#pragma mark - Helpers
- (nullable id)tryGetValueForKey:(NSString *)key;
- (void)setValueForKey:(NSString *)key toValue:(nullable id)value;
- (void)clear;
#pragma mark - Specific Preferences
- (NSTimeInterval)getCachedOrDefaultDesiredBufferDepth;
- (void)setCachedDesiredBufferDepth:(double)value;
- (BOOL)getHasSentAMessage;
- (void)setHasSentAMessage:(BOOL)enabled;
- (BOOL)getHasArchivedAMessage;
- (void)setHasArchivedAMessage:(BOOL)enabled;
+ (BOOL)loggingIsEnabled;
+ (void)setLoggingEnabled:(BOOL)flag;
- (BOOL)screenSecurityIsEnabled;
- (void)setScreenSecurity:(BOOL)flag;
- (NotificationType)notificationPreviewType;
- (void)setNotificationPreviewType:(NotificationType)type;
- (NSString *)nameForNotificationPreviewType:(NotificationType)notificationType;
- (BOOL)soundInForeground;
- (void)setSoundInForeground:(BOOL)enabled;
- (BOOL)hasRegisteredVOIPPush;
- (void)setHasRegisteredVOIPPush:(BOOL)enabled;
+ (nullable NSString *)lastRanVersion;
+ (NSString *)setAndGetCurrentVersion;
- (BOOL)hasDeclinedNoContactsView;
- (void)setHasDeclinedNoContactsView:(BOOL)value;
#pragma mark - Calling
#pragma mark Callkit
- (BOOL)isCallKitEnabled;
- (void)setIsCallKitEnabled:(BOOL)flag;
// Returns YES IFF isCallKitEnabled has been set by user.
- (BOOL)isCallKitEnabledSet;
- (BOOL)isCallKitPrivacyEnabled;
- (void)setIsCallKitPrivacyEnabled:(BOOL)flag;
// Returns YES IFF isCallKitPrivacyEnabled has been set by user.
- (BOOL)isCallKitPrivacySet;
#pragma mark direct call connectivity (non-TURN)
- (BOOL)doCallsHideIPAddress;
- (void)setDoCallsHideIPAddress:(BOOL)flag;
#pragma mark - Block on Identity Change
- (BOOL)shouldBlockOnIdentityChange;
- (void)setShouldBlockOnIdentityChange:(BOOL)value;
#pragma mark - Push Tokens
- (void)setPushToken:(NSString *)value;
- (nullable NSString *)getPushToken;
- (void)setVoipToken:(NSString *)value;
- (nullable NSString *)getVoipToken;
@end
NS_ASSUME_NONNULL_END
|
/*********************************************************************
CombLayer : MCNP(X) Input builder
* File: physicsInc/PWTControl.h
*
* Copyright (c) 2004-2015 by Stuart Ansell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
****************************************************************************/
#ifndef physicsSystem_PWTControl_h
#define physicsSystem_PWTControl_h
namespace physicsSystem
{
/*!
\class PWTControl
\version 2.0
\date April 2015
\author S.Ansell
\brief Process Photon Weight
*/
class PWTControl
{
private:
typedef MapSupport::Range<int> RTYPE; ///< Range type
typedef std::map<RTYPE,double> MTYPE; ///< Master type
/// cells : Exp card values
std::map<MapSupport::Range<int>,double> MapItem;
/// maps NEW -> OLD
std::map<int,int> renumberMap;
public:
PWTControl();
PWTControl(const PWTControl&);
PWTControl& operator=(const PWTControl&);
virtual ~PWTControl();
void clear();
void setUnit(const MapSupport::Range<int>&,
const double);
void setUnit(const int,const double);
void renumberCell(const int,const int);
void write(std::ostream&,const std::vector<int>&,
const std::set<int>&) const;
};
}
#endif
|
/*
* Header file for the flow6 tool
*
*/
#define QUERY_TIMEOUT 65
|
#ifndef UFW_KCM_H
#define UFW_KCM_H
/*
* UFW KControl Module
*
* Copyright 2011 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <KDE/KCModule>
#include <kauth.h>
#include <QtCore/QSet>
#include <QtCore/QMap>
#include <QtGui/QMenu>
#include <QtGui/QAction>
#include <QtGui/QCheckBox>
#include "types.h"
#include "rule.h"
#include "profile.h"
#include "blocker.h"
#include "ui_ufw.h"
class QDomNode;
using namespace KAuth;
namespace UFW
{
class LogViewer;
class RuleDialog;
class Kcm : public KCModule, public Ui::Ufw
{
Q_OBJECT
public:
explicit Kcm(QWidget *parent=NULL, const QVariantList &list=QVariantList());
virtual ~Kcm();
bool addRules(const QList<Rule> &rules);
void createRule(const Rule &rule);
void editRule(Rule rule);
void editRuleDescr(const Rule &rule);
bool ipV6Enabled() { return ipv6Enabled->isChecked(); }
bool isActive() { return blocker->isActive(); }
Q_SIGNALS:
void status(const QString &msg);
void error(const QString &msg);
protected Q_SLOTS:
void defaults();
void queryStatus(bool readDefaults=true, bool listProfiles=true);
void setStatus();
void setIpV6();
void createRules();
void editRule();
void removeRule();
void moveRuleUp();
void moveRuleDown();
void moveTo(const QTreeWidgetItem *item);
void setLogLevel();
void setDefaultIncomingPolicy();
void setDefaultOutgoingPolicy();
void queryPerformed(ActionReply reply);
void modifyPerformed(ActionReply reply);
void ruleSelectionChanged();
void ruleDoubleClicked(QTreeWidgetItem *item , int col);
void moduleClicked(QTreeWidgetItem *item , int col);
void saveProfile();
void loadProfile(QAction *profile);
void removeProfile(QAction *profile);
void importProfile();
void exportProfile();
void loadMenuShown();
void deleteMenuShown();
void displayLog();
private:
QString getNewProfileName(const QString ¤tName, bool isImport);
void listUserProfiles();
QAction * getAction(const QString &name);
QAction * getCurrentProfile();
void saveProfile(const QString &name, const Profile &profile);
void refreshProfiles(const QMap<QString, QVariant> &profileList);
bool profileExists(const QString &name);
void addProfile(const QString &name, const Profile &profile, bool sort=true);
void sortActions();
void deleteProfile(QAction *profile, bool updateState=true);
void deleteProfile(const QString &name);
void moveRulePos(int offset);
void moveRule(int from, int to);
void showCurrentStatus();
void setupWidgets();
void setupActions();
void addModules();
void setStatus(const Profile &profile);
void setDefaults(const Profile &profile);
void setModules(const Profile &profile);
void setRules(const Profile &profile);
QSet<QString> modules();
private:
RuleDialog *addDialog,
*editDialog;
Action queryAction,
modifyAction;
QList<Rule> currentRules;
QSet<QString> otherModules;
unsigned int moveToPos;
QMenu *loadMenu,
*deleteMenu;
QAction *noProfilesAction;
QMap<QAction *, Profile> profiles;
bool loadMenuWasShown;
QString loadedProfile;
bool activeAction;
Blocker *blocker;
QSet<QString> existingProfiles;
LogViewer *logViewer;
};
}
#endif
|
//
// THGraphTextView.h
// TangoHapps
//
// Created by Juan Haladjian on 11/02/14.
// Copyright (c) 2014 Technische Universität München. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface THGraphTextView : UIView
@property (nonatomic) float maxAxisY;
@property (nonatomic) float minAxisY;
- (id)initWithFrame:(CGRect)frame maxAxisY:(float) maxAxisY minAxisY:(float) minAxisY ;
@end
|
/*
* $Id: b_put.c,v 1.11 2007/05/29 17:39:15 bostic Exp $
*/
#include "bench.h"
int usage(void);
int s(DB *, const DBT *, const DBT *, DBT *);
int
main(int argc, char *argv[])
{
DB_ENV *dbenv = NULL;
DB *dbp, **second;
DBTYPE type;
DBT key, data;
db_recno_t recno;
size_t dsize;
int ch, i, count, secondaries;
char *ts, buf[64];
cleanup_test_dir();
count = 100000;
ts = "Btree";
type = DB_BTREE;
dsize = 20;
secondaries = 0;
while ((ch = getopt(argc, argv, "c:d:s:t:")) != EOF)
switch (ch) {
case 'c':
count = atoi(optarg);
break;
case 'd':
dsize = atoi(optarg);
break;
case 's':
secondaries = atoi(optarg);
break;
case 't':
switch (optarg[0]) {
case 'B': case 'b':
ts = "Btree";
type = DB_BTREE;
break;
case 'H': case 'h':
ts = "Hash";
type = DB_HASH;
break;
case 'Q': case 'q':
ts = "Queue";
type = DB_QUEUE;
break;
case 'R': case 'r':
ts = "Recno";
type = DB_RECNO;
break;
default:
return (usage());
}
break;
case '?':
default:
return (usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (usage());
#if DB_VERSION_MAJOR < 3 || DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 3
/*
* Secondaries were added after DB 3.2.9.
*/
if (secondaries)
return (0);
#endif
/* Create the environment. */
DB_BENCH_ASSERT(db_env_create(&dbenv, 0) == 0);
dbenv->set_errfile(dbenv, stderr);
DB_BENCH_ASSERT(
dbenv->set_cachesize(dbenv, 0, 1048576 /* 1MB */, 0) == 0);
#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 1
DB_BENCH_ASSERT(dbenv->open(dbenv, "TESTDIR",
NULL, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE, 0666) == 0);
#else
DB_BENCH_ASSERT(dbenv->open(dbenv, "TESTDIR",
DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE, 0666) == 0);
#endif
/*
* Create the database.
* Optionally set the record length for Queue.
*/
DB_BENCH_ASSERT(db_create(&dbp, dbenv, 0) == 0);
if (type == DB_QUEUE)
DB_BENCH_ASSERT(dbp->set_re_len(dbp, dsize) == 0);
#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
DB_BENCH_ASSERT(
dbp->open(dbp, NULL, "a", NULL, type, DB_CREATE, 0666) == 0);
#else
DB_BENCH_ASSERT(dbp->open(dbp, "a", NULL, type, DB_CREATE, 0666) == 0);
#endif
/* Optionally create the secondaries. */
if (secondaries != 0) {
DB_BENCH_ASSERT(
(second = calloc(sizeof(DB *), secondaries)) != NULL);
for (i = 0; i < secondaries; ++i) {
DB_BENCH_ASSERT(db_create(&second[i], dbenv, 0) == 0);
snprintf(buf, sizeof(buf), "%d.db", i);
#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
DB_BENCH_ASSERT(second[i]->open(second[i], NULL,
buf, NULL, DB_BTREE, DB_CREATE, 0600) == 0);
#else
DB_BENCH_ASSERT(second[i]->open(second[i],
buf, NULL, DB_BTREE, DB_CREATE, 0600) == 0);
#endif
#if DB_VERSION_MAJOR > 3 || DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 3
#if DB_VERSION_MAJOR > 3 && DB_VERSION_MINOR > 0
/*
* The DB_TXN argument to Db.associate was added in
* 4.1.25.
*/
DB_BENCH_ASSERT(
dbp->associate(dbp, NULL, second[i], s, 0) == 0);
#else
DB_BENCH_ASSERT(
dbp->associate(dbp, second[i], s, 0) == 0);
#endif
#endif
}
}
/* Store a key/data pair. */
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
switch (type) {
case DB_BTREE:
case DB_HASH:
key.data = "01234567890123456789";
key.size = 10;
break;
case DB_QUEUE:
case DB_RECNO:
recno = 1;
key.data = &recno;
key.size = sizeof(recno);
break;
case DB_UNKNOWN:
abort();
break;
}
DB_BENCH_ASSERT((data.data = malloc(data.size = dsize)) != NULL);
/* Store the key/data pair count times. */
TIMER_START;
for (i = 0; i < count; ++i)
DB_BENCH_ASSERT(dbp->put(dbp, NULL, &key, &data, 0) == 0);
TIMER_STOP;
if (type == DB_BTREE || type == DB_HASH)
printf(
"# %d %s database put of 10 byte key, %lu byte data",
count, ts, (u_long)dsize);
else
printf("# %d %s database put of key, %lu byte data",
count, ts, (u_long)dsize);
if (secondaries)
printf(" with %d secondaries", secondaries);
printf("\n");
TIMER_DISPLAY(count);
return (0);
}
int
s(dbp, pkey, pdata, skey)
DB *dbp;
const DBT *pkey, *pdata;
DBT *skey;
{
skey->data = pkey->data;
skey->size = pkey->size;
return (0);
}
int
usage()
{
(void)fprintf(stderr,
"usage: b_put [-c count] [-d bytes] [-s secondaries] [-t type]\n");
return (EXIT_FAILURE);
}
|
/**
* This file is part of meta.
*
* Author(s): Jens Finkhaeuser <jens@finkhaeuser.de>
*
* Copyright (c) 2014-2015 Unwesen Ltd.
* Copyright (c) 2016-2017 Jens Finkhaeuser.
*
* This software is licensed under the terms of the GNU GPLv3 for personal,
* educational and non-profit use. For all other uses, alternative license
* options are available. Please contact the copyright holder for additional
* information, stating your intended usage.
*
* You can find the full text of the GPLv3 in the COPYING file in this code
* distribution.
*
* This software is distributed on an "AS IS" BASIS, WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
**/
#ifndef META_DETAIL_CONTAINER_RESTRICTIONS_H
#define META_DETAIL_CONTAINER_RESTRICTIONS_H
#ifndef __cplusplus
#error You are trying to include a C++ only header file
#endif
#include <meta/meta.h>
namespace meta {
namespace restrictions {
namespace container {
/**
* Enforces non-empty container types, where any valueT that has an empty()
* function that returns true when the value is empty is considered a container
* type.
**/
struct non_empty
{
template <
typename valueT
>
static inline bool check(valueT const & value)
{
return !value.empty();
}
};
/**
* Enforces empty container types, where any valueT that has an empty() function
* that returns true when the value is empty is considered a container type.
**/
struct empty
{
template <
typename valueT
>
static inline bool check(valueT const & value)
{
return value.empty();
}
};
}}} // namespace meta::restrictions::container
#endif // guard
|
//
// BAGEL - Brilliantly Advanced General Electronic Structure Library
// Filename: soecpbatch.h
// Copyright (C) 2014 Toru Shiozaki
//
// Author: Hai-Anh Le <anh@u.northwestern.edu>
// Maintainer: Shiozaki group
//
// This file is part of the BAGEL package.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef __SRC_INTEGRAL_ECP_SOECPBATCH_H
#define __SRC_INTEGRAL_ECP_SOECPBATCH_H
#include <src/util/parallel/resources.h>
#include <src/molecule/molecule.h>
#include <src/integral/integral.h>
#include <src/integral/ecp/soangularbatch.h>
namespace bagel {
class SOECPBatch : public Integral {
protected:
int max_iter_;
double integral_thresh_;
std::array<std::shared_ptr<const Shell>,2> basisinfo_;
std::shared_ptr<const Molecule> mol_;
bool spherical_;
double* data_;
double* data1_;
double* data2_;
int ang0_, ang1_, cont0_, cont1_;
int asize_final_, asize_;
bool swap01_;
size_t size_block_, size_alloc_;
double* stack_save_;
bool allocated_here_;
std::shared_ptr<StackMem> stack_;
void common_init();
void get_data(const double* intermediate, double* data) const;
public:
SOECPBatch(const std::array<std::shared_ptr<const Shell>,2>& info, const std::shared_ptr<const Molecule> mol,
std::shared_ptr<StackMem> = nullptr);
~SOECPBatch();
const double* data() const { return data_; }
virtual double* data(const int i) override { assert(i == 0); return data_; }
const double* data1() const { return data1_; }
const double* data2() const { return data2_; }
bool swap01() const { return swap01_; }
void compute() override;
};
}
#endif
|
/*
* AnnMatch2.h
* libKPM
*
* Disclaimer: IMPORTANT: This Daqri software is supplied to you by Daqri
* LLC ("Daqri") in consideration of your agreement to the following
* terms, and your use, installation, modification or redistribution of
* this Daqri software constitutes acceptance of these terms. If you do
* not agree with these terms, please do not compile, install, use, or
* redistribute this Daqri software.
*
* In consideration of your agreement to abide by the following terms, and
* subject to these terms, Daqri grants you a personal, non-exclusive,
* non-transferable license, under Daqri's copyrights in this original Daqri
* software (the "Daqri Software"), to compile, install and execute Daqri Software
* exclusively in conjunction with the ARToolKit software development kit version 5.2
* ("ARToolKit"). The allowed usage is restricted exclusively to the purposes of
* two-dimensional surface identification and camera pose extraction and initialisation,
* provided that applications involving automotive manufacture or operation, military,
* and mobile mapping are excluded.
*
* You may reproduce and redistribute the Daqri Software in source and binary
* forms, provided that you redistribute the Daqri Software in its entirety and
* without modifications, and that you must retain this notice and the following
* text and disclaimers in all such redistributions of the Daqri Software.
* Neither the name, trademarks, service marks or logos of Daqri LLC may
* be used to endorse or promote products derived from the Daqri Software
* without specific prior written permission from Daqri. Except as
* expressly stated in this notice, no other rights or licenses, express or
* implied, are granted by Daqri herein, including but not limited to any
* patent rights that may be infringed by your derivative works or by other
* works in which the Daqri Software may be incorporated.
*
* The Daqri Software is provided by Daqri on an "AS IS" basis. DAQRI
* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE, REGARDING THE DAQRI SOFTWARE OR ITS USE AND
* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
*
* IN NO EVENT SHALL DAQRI BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
* MODIFICATION AND/OR DISTRIBUTION OF THE DAQRI SOFTWARE, HOWEVER CAUSED
* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
* STRICT LIABILITY OR OTHERWISE, EVEN IF DAQRI HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Copyright 2015 Daqri, LLC. All rights reserved.
* Copyright 2006-2015 ARToolworks, Inc. All rights reserved.
* Author(s): Hirokazu Kato, Philip Lamb
*
*/
#ifndef KPM_AnnMatch2_h
#define KPM_AnnMatch2_h
#include <opencv2/core/core.hpp>
#include <opencv2/flann/flann.hpp>
#include <KPM/kpmType.h>
#define Ann2Thresh 0.2
class CAnnMatch2
{
public:
CAnnMatch2(void);
~CAnnMatch2(void);
protected:
float annThresh;
cv::flann::Index* flann_index1;
cv::flann::Index* flann_index2;
cv::Mat features1;
cv::Mat features2;
int *index1;
int *index2;
public:
void Construct (FeatureVector* fv);
void Match (FeatureVector* fv, int knn, int *result);
};
#endif
|
//
// FontSizeView.h
// MierMilitaryNews
//
// Created by 李响 on 16/7/26.
// Copyright © 2016年 miercn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FontSizeView : UIView
@property (nonatomic , copy ) void (^changeBlock)(NSInteger);
@end
|
#undef _LARGEFILE_SOURCE
#undef _FILE_OFFSET_BITS
#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
#if defined(__PPC__) && !defined(__powerpc__)
#define __powerpc__ 1
#endif
#if defined (GRUB_UTIL) || !defined (GRUB_MACHINE)
#include <config-util.h>
#define NESTED_FUNC_ATTR
#else
/* Define if C symbols get an underscore after compilation. */
#define HAVE_ASM_USCORE 0
/* Define it to \"addr32\" or \"addr32;\" to make GAS happy. */
#define ADDR32 addr32
/* Define it to \"data32\" or \"data32;\" to make GAS happy. */
#define DATA32 data32
/* Define it to one of __bss_start, edata and _edata. */
#define BSS_START_SYMBOL __bss_start
/* Define it to either end or _end. */
#define END_SYMBOL end
/* Name of package. */
#define PACKAGE "grub"
/* Version number of package. */
#define VERSION "2.00"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GRUB 2.00"
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.00"
/* Define to the full name of this package. */
#define PACKAGE_NAME "GRUB"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-grub@gnu.org"
/* Default boot directory name" */
#define GRUB_BOOT_DIR_NAME "boot"
/* Default grub directory name */
#define GRUB_DIR_NAME "grub"
/* Define to 1 if GCC generates calls to __enable_execute_stack(). */
#define NEED_ENABLE_EXECUTE_STACK 0
/* Define to 1 if GCC generates calls to __register_frame_info(). */
#define NEED_REGISTER_FRAME_INFO 0
/* Define to 1 to enable disk cache statistics. */
#define DISK_CACHE_STATS 0
#define GRUB_TARGET_CPU "i386"
#define GRUB_PLATFORM "pc"
#define RE_ENABLE_I18N 1
#if defined(__i386__)
#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
#else
#define NESTED_FUNC_ATTR
#endif
#endif
|
#ifndef __utils_getline_h__
#define __utils_getline_h__
#define _getlineOK 0
#define _getlineNO_INPUT 1
#define _getlineTOO_LONG 2
int getLine (char *prmpt, char *buff, size_t sz) ;
#endif
|
/* DO NOT EDIT THIS FILE DIRECTLY */
/**********************************************************************
id.h -
$Author: nobu $
created at: Sun Oct 19 21:12:51 2008
Copyright (C) 2007 Koichi Sasada
**********************************************************************/
#ifndef RUBY_ID_H
#define RUBY_ID_H
#define ID_SCOPE_SHIFT 3
#define ID_SCOPE_MASK 0x07
#define ID_LOCAL 0x00
#define ID_INSTANCE 0x01
#define ID_GLOBAL 0x03
#define ID_ATTRSET 0x04
#define ID_CONST 0x05
#define ID_CLASS 0x06
#define ID_JUNK 0x07
#define ID_INTERNAL ID_JUNK
#ifdef USE_PARSE_H
#include "parse.h"
#endif
#define symIFUNC ID2SYM(idIFUNC)
#define symCFUNC ID2SYM(idCFUNC)
#if !defined tLAST_TOKEN && defined YYTOKENTYPE
#define tLAST_TOKEN tLAST_TOKEN
#endif
enum ruby_method_ids {
#ifndef tLAST_TOKEN
tUPLUS = 321,
tUMINUS = 322,
tPOW = 323,
tCMP = 324,
tEQ = 325,
tEQQ = 326,
tNEQ = 327,
tGEQ = 328,
tLEQ = 329,
tANDOP = 330,
tOROP = 331,
tMATCH = 332,
tNMATCH = 333,
tDOT2 = 334,
tDOT3 = 335,
tAREF = 336,
tASET = 337,
tLSHFT = 338,
tRSHFT = 339,
tLAMBDA = 352,
idNULL = 365,
idRespond_to = 366,
idIFUNC = 367,
idCFUNC = 368,
idThrowState = 369,
id_core_set_method_alias = 370,
id_core_set_variable_alias = 371,
id_core_undef_method = 372,
id_core_define_method = 373,
id_core_define_singleton_method = 374,
id_core_set_postexe = 375,
tLAST_TOKEN = 376,
#endif
idPLUS = '+',
idMINUS = '-',
idMULT = '*',
idDIV = '/',
idMOD = '%',
idLT = '<',
idLTLT = tLSHFT,
idLE = tLEQ,
idGT = '>',
idGE = tGEQ,
idEq = tEQ,
idEqq = tEQQ,
idNeq = tNEQ,
idNot = '!',
idBackquote = '`',
idEqTilde = tMATCH,
idAREF = tAREF,
idASET = tASET,
idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
tIntern,
tMethodMissing,
tLength,
tGets,
tSucc,
tEach,
tLambda,
tSend,
t__send__,
tInitialize,
#if SUPPORT_JOKE
tBitblt,
tAnswer,
#endif
tLAST_ID,
#define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
#if SUPPORT_JOKE
TOKEN2ID(Bitblt),
TOKEN2ID(Answer),
#endif
TOKEN2ID(Intern),
TOKEN2ID(MethodMissing),
TOKEN2ID(Length),
TOKEN2ID(Gets),
TOKEN2ID(Succ),
TOKEN2ID(Each),
TOKEN2ID(Lambda),
TOKEN2ID(Send),
TOKEN2ID(__send__),
TOKEN2ID(Initialize)
};
#ifdef tLAST_TOKEN
struct ruby_method_ids_check {
#define ruby_method_id_check_for(name, value) \
int checking_for_##name[name == value ? 1 : -1]
ruby_method_id_check_for(tUPLUS, 321);
ruby_method_id_check_for(tUMINUS, 322);
ruby_method_id_check_for(tPOW, 323);
ruby_method_id_check_for(tCMP, 324);
ruby_method_id_check_for(tEQ, 325);
ruby_method_id_check_for(tEQQ, 326);
ruby_method_id_check_for(tNEQ, 327);
ruby_method_id_check_for(tGEQ, 328);
ruby_method_id_check_for(tLEQ, 329);
ruby_method_id_check_for(tANDOP, 330);
ruby_method_id_check_for(tOROP, 331);
ruby_method_id_check_for(tMATCH, 332);
ruby_method_id_check_for(tNMATCH, 333);
ruby_method_id_check_for(tDOT2, 334);
ruby_method_id_check_for(tDOT3, 335);
ruby_method_id_check_for(tAREF, 336);
ruby_method_id_check_for(tASET, 337);
ruby_method_id_check_for(tLSHFT, 338);
ruby_method_id_check_for(tRSHFT, 339);
ruby_method_id_check_for(tLAMBDA, 352);
ruby_method_id_check_for(idNULL, 365);
ruby_method_id_check_for(idRespond_to, 366);
ruby_method_id_check_for(idIFUNC, 367);
ruby_method_id_check_for(idCFUNC, 368);
ruby_method_id_check_for(idThrowState, 369);
ruby_method_id_check_for(id_core_set_method_alias, 370);
ruby_method_id_check_for(id_core_set_variable_alias, 371);
ruby_method_id_check_for(id_core_undef_method, 372);
ruby_method_id_check_for(id_core_define_method, 373);
ruby_method_id_check_for(id_core_define_singleton_method, 374);
ruby_method_id_check_for(id_core_set_postexe, 375);
ruby_method_id_check_for(tLAST_TOKEN, 376);
};
#endif
#endif /* RUBY_ID_H */
|
/*
demac - A Monkey's Audio decoder
$Id$
Copyright (C) Dave Chapman 2007
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
#ifndef _APE_WAVWRITE_H
#define _APE_WAVWRITE_H
#include "parser.h"
int open_wav(struct ape_ctx_t* ape_ctx, char* filename);
#endif
|
/***********************************************************************
filename: MacCEGuiRendererSelector.h
created: Tue Mar 17 2009
author: Paul D Turner
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
*
* 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 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.
***************************************************************************/
#ifndef _MacCEGuiRendererSelector_h_
#define _MacCEGuiRendererSelector_h_
#include "CEGuiRendererSelector.h"
#include <string>
//! RendererSelector for Apple Mac via Carbon
class MacCEGuiRendererSelector : public CEGuiRendererSelector
{
public:
MacCEGuiRendererSelector();
~MacCEGuiRendererSelector();
// Implement CEGuiRendererSelector interface.
bool invokeDialog();
private:
//! Load the dialog window from the nib file.
void loadDialogWindow();
//! Add entries for available renderers. returns the number of renderers.
int populateRendererMenu();
OSStatus commandHandler(UInt32 command);
//! function that will dispatch events back into the object for handling.
static OSStatus eventDispatcher(EventHandlerCallRef, EventRef, void*);
//! array of CEGuiRendererTypes that map to entries in the pop up.
CEGuiRendererType d_rendererTypes[4];
//! the main dialog window.
WindowRef d_dialog;
//! The popup button holding the renderer choices.
HIViewRef d_rendererPopup;
//! true if user cancelled the dialog
bool d_cancelled;
};
#endif // end of guard _MacCEGuiRendererSelector_h_
|
/*
* (C) 2003-2006 Gabest
* (C) 2006-2012 see Authors.txt
*
* This file is part of MPC-HC.
*
* MPC-HC 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.
*
* MPC-HC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "DX7AllocatorPresenter.h"
#include "realmedia/pntypes.h"
#include "realmedia/pnwintyp.h"
#include "realmedia/pncom.h"
#include "realmedia/rmavsurf.h"
namespace DSObjects
{
class CRM7AllocatorPresenter
: public CDX7AllocatorPresenter
, public IRMAVideoSurface
{
CComPtr<IDirectDrawSurface7> m_pVideoSurfaceOff;
CComPtr<IDirectDrawSurface7> m_pVideoSurfaceYUY2;
RMABitmapInfoHeader m_bitmapInfo;
RMABitmapInfoHeader m_lastBitmapInfo;
protected:
HRESULT AllocSurfaces();
void DeleteSurfaces();
public:
CRM7AllocatorPresenter(HWND hWnd, HRESULT& hr);
DECLARE_IUNKNOWN
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
// IRMAVideoSurface
STDMETHODIMP Blt(UCHAR* pImageData, RMABitmapInfoHeader* pBitmapInfo, REF(PNxRect) inDestRect, REF(PNxRect) inSrcRect);
STDMETHODIMP BeginOptimizedBlt(RMABitmapInfoHeader* pBitmapInfo);
STDMETHODIMP OptimizedBlt(UCHAR* pImageBits, REF(PNxRect) rDestRect, REF(PNxRect) rSrcRect);
STDMETHODIMP EndOptimizedBlt();
STDMETHODIMP GetOptimizedFormat(REF(RMA_COMPRESSION_TYPE) ulType);
STDMETHODIMP GetPreferredFormat(REF(RMA_COMPRESSION_TYPE) ulType);
};
}
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Driver for the Philips PCA9632 LED driver.
* Written by Robert Mendon Feb 2017.
*/
struct LEDColor;
typedef LEDColor LEDColor;
void pca9632_set_led_color(const LEDColor &color);
#if ENABLED(PCA9632_BUZZER)
#include <stdint.h>
void pca9632_buzz(const long, const uint16_t);
#endif
|
/*
* LibrePCB - Professional EDA for everyone!
* Copyright (C) 2013 Urban Bruhin
* http://librepcb.org/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBREPCB_PROJECT_BI_VIA_H
#define LIBREPCB_PROJECT_BI_VIA_H
/*****************************************************************************************
* Includes
****************************************************************************************/
#include <QtCore>
#include "bi_base.h"
#include <librepcbcommon/fileio/if_xmlserializableobject.h>
#include <librepcbcommon/uuid.h>
#include "../graphicsitems/bgi_via.h"
/*****************************************************************************************
* Namespace / Forward Declarations
****************************************************************************************/
class QGraphicsItem;
namespace librepcb {
class BoardLayer;
namespace project {
class NetSignal;
class BI_NetPoint;
class ErcMsg;
/*****************************************************************************************
* Class BI_Via
****************************************************************************************/
/**
* @brief The BI_Via class
*/
class BI_Via final : public BI_Base, public IF_XmlSerializableObject
{
Q_OBJECT
public:
// Public Types
enum class Shape {Round, Square, Octagon};
// Constructors / Destructor
BI_Via() = delete;
BI_Via(const BI_Via& other) = delete;
BI_Via(Board& board, const BI_Via& other) throw (Exception);
BI_Via(Board& board, const XmlDomElement& domElement) throw (Exception);
BI_Via(Board& board, const Point& position, BI_Via::Shape shape,
const Length& size, const Length& drillDiameter, NetSignal* netsignal) throw (Exception);
~BI_Via() noexcept;
// Getters
const Uuid& getUuid() const noexcept {return mUuid;}
Shape getShape() const noexcept {return mShape;}
const Length& getDrillDiameter() const noexcept {return mDrillDiameter;}
const Length& getSize() const noexcept {return mSize;}
NetSignal* getNetSignal() const noexcept {return mNetSignal;}
const QMap<int, BI_NetPoint*>& getNetPoints() const noexcept {return mRegisteredNetPoints;}
BI_NetPoint* getNetPointOfLayer(int layerId) const noexcept {return mRegisteredNetPoints.value(layerId, nullptr);}
bool isUsed() const noexcept {return (mRegisteredNetPoints.count() > 0);}
bool isOnLayer(int layerId) const noexcept;
QPainterPath toQPainterPathPx(const Length& clearance, bool hole) const noexcept;
bool isSelectable() const noexcept override;
// Setters
void setNetSignal(NetSignal* netsignal) throw (Exception);
void setPosition(const Point& position) noexcept;
void setShape(Shape shape) noexcept;
void setSize(const Length& size) noexcept;
void setDrillDiameter(const Length& diameter) noexcept;
// General Methods
void addToBoard(GraphicsScene& scene) throw (Exception) override;
void removeFromBoard(GraphicsScene& scene) throw (Exception) override;
void registerNetPoint(BI_NetPoint& netpoint) throw (Exception);
void unregisterNetPoint(BI_NetPoint& netpoint) throw (Exception);
void updateNetPoints() const noexcept;
/// @copydoc IF_XmlSerializableObject#serializeToXmlDomElement()
XmlDomElement* serializeToXmlDomElement() const throw (Exception) override;
// Inherited from SI_Base
Type_t getType() const noexcept override {return BI_Base::Type_t::Via;}
const Point& getPosition() const noexcept override {return mPosition;}
bool getIsMirrored() const noexcept override {return false;}
QPainterPath getGrabAreaScenePx() const noexcept override;
void setSelected(bool selected) noexcept override;
// Operator Overloadings
BI_Via& operator=(const BI_Via& rhs) = delete;
bool operator==(const BI_Via& rhs) noexcept {return (this == &rhs);}
bool operator!=(const BI_Via& rhs) noexcept {return (this != &rhs);}
private:
void init() throw (Exception);
void boardAttributesChanged();
/// @copydoc IF_XmlSerializableObject#checkAttributesValidity()
bool checkAttributesValidity() const noexcept override;
// General
QScopedPointer<BGI_Via> mGraphicsItem;
// Attributes
Uuid mUuid;
Point mPosition;
Shape mShape;
Length mSize;
Length mDrillDiameter;
NetSignal* mNetSignal;
// Registered Elements
QMap<int, BI_NetPoint*> mRegisteredNetPoints; ///< key: layer ID
};
/*****************************************************************************************
* End of File
****************************************************************************************/
} // namespace project
} // namespace librepcb
#endif // LIBREPCB_PROJECT_BI_VIA_H
|
/*
* This file is part of x48, an emulator of the HP-48sx Calculator.
* Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Log: device.h,v $
* Revision 1.7 1995/01/11 18:20:01 ecd
* major update to support HP48 G/GX
*
* Revision 1.6 1994/11/28 02:19:22 ecd
* played with the out register
*
* Revision 1.6 1994/11/28 02:19:22 ecd
* played with the out register
*
* Revision 1.5 1994/11/02 14:51:27 ecd
* added some function declarations
*
* Revision 1.4 1994/10/05 08:33:22 ecd
* remove addr queue
*
* Revision 1.3 1994/09/30 12:32:49 ecd
* added DISP_INSTR_OFF for faster and better display
*
* Revision 1.2 1994/09/13 16:58:42 ecd
* changed to plain X11
*
* Revision 1.1 1994/08/26 11:09:18 ecd
* Initial revision
*
*
*
* $Id: device.h,v 1.7 1995/01/11 18:20:01 ecd Exp ecd $
*/
#ifndef _DEVICE_H
#define _DEVICE_H 1
#include "global.h"
#define DISP_INSTR_OFF 0x10
#define ANN_LEFT 0x81
#define ANN_RIGHT 0x82
#define ANN_ALPHA 0x84
#define ANN_BATTERY 0x88
#define ANN_BUSY 0x90
#define ANN_IO 0xa0
typedef struct device_t {
int display_touched;
char contrast_touched;
char disp_test_touched;
char crc_touched;
char power_status_touched;
char power_ctrl_touched;
char mode_touched;
char ann_touched;
char baud_touched;
char card_ctrl_touched;
char card_status_touched;
char ioc_touched;
char tcs_touched;
char rcs_touched;
char rbr_touched;
char tbr_touched;
char sreq_touched;
char ir_ctrl_touched;
char base_off_touched;
char lcr_touched;
char lbr_touched;
char scratch_touched;
char base_nibble_touched;
char unknown_touched;
char t1_ctrl_touched;
char t2_ctrl_touched;
char unknown2_touched;
char t1_touched;
char t2_touched;
int speaker_counter;
} device_t;
extern device_t device;
extern void check_devices __ProtoType__((void));
#if 0
extern void check_out_register __ProtoType__((void));
#endif
extern void update_display __ProtoType__((void));
extern void redraw_display __ProtoType__((void));
extern void disp_draw_nibble __ProtoType__((word_20 addr, word_4 val));
extern void menu_draw_nibble __ProtoType__((word_20 addr, word_4 val));
extern void draw_annunc __ProtoType__((void));
extern void redraw_annunc __ProtoType__((void));
#endif /* !_DEVICE_H */
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: mods/deathmatch/logic/packets/CPlayerNetworkStatusPacket.h
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#pragma once
class CPlayerNetworkStatusPacket : public CPacket
{
public:
virtual bool RequiresSourcePlayer() const { return true; }
ePacketID GetPacketID() const { return PACKET_ID_PLAYER_NETWORK_STATUS; };
unsigned long GetFlags() const
{
assert(0);
return 0;
};
bool Read(NetBitStreamInterface& BitStream);
uchar m_ucType;
uint m_uiTicks;
};
|
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// DESCRIPTION:
// Endianess handling, swapping 16bit and 32bit.
//
//-----------------------------------------------------------------------------
#ifndef __M_SWAP__
#define __M_SWAP__
// Endianess handling.
// WAD files are stored little endian.
#ifdef __BIG_ENDIAN__
short SwapSHORT(short);
long SwapLONG(long);
#define SHORT(x) ((short)SwapSHORT((unsigned short) (x)))
#define LONG(x) ((long)SwapLONG((unsigned long) (x)))
#else
#define SHORT(x) (x)
#define LONG(x) (x)
#endif
#endif
//-----------------------------------------------------------------------------
//
// $Log:$
//
//-----------------------------------------------------------------------------
|
// This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include <cstdint>
#include <string>
#include "anh/byte_buffer.h"
#include "MessageLib/messages/base_swg_message.h"
namespace swganh
{
namespace messages
{
struct ChatServerStatus : public BaseSwgMessage
{
uint16_t Opcount() const
{
return 2;
}
uint32_t Opcode() const
{
return 0x7102B15F;
}
uint8_t status;
ChatServerStatus(uint8_t status_)
: status(status_)
{}
void OnSerialize(swganh::ByteBuffer& buffer) const
{
buffer.write<uint8_t>(status);
}
void OnDeserialize(swganh::ByteBuffer& buffer)
{
status = buffer.read<uint8_t>();
}
};
}
} // namespace swganh::messages
|
#ifndef _SIMTK_BITVIEW_H
#define _SIMTK_BITVIEW_H
#include <stdint.h>
#include <rbtree.h>
#define SIMTK_BITVIEW_DEFAULT_COLOR_MSB OPAQUE (RGB (0, 0xff, 0))
#define SIMTK_BITVIEW_DEFAULT_COLOR_LSB OPAQUE (RGB (0, 0x7f, 0))
#define SIMTK_BITVIEW_DEFAULT_SELECT_MSB OPAQUE (RGB (0xff, 0, 0))
#define SIMTK_BITVIEW_DEFAULT_SELECT_LSB OPAQUE (RGB (0x7f, 0, 0))
#define SIMTK_BITVIEW_DEFAULT_MARK_MSB OPAQUE (RGB (0xff, 0xff, 0))
#define SIMTK_BITVIEW_DEFAULT_MARK_LSB OPAQUE (RGB (0x7f, 0x7f, 0))
#define SIMTK_BITVIEW_DEFAULT_BACKGROUND DEFAULT_BACKGROUND
#define SIMTK_BITVIEW_MARK_BACKGROUND DEFAULT_BACKGROUND
#define SIMTK_BITVIEW_DEFAULT_BYTE_ORIENTATION SIMTK_HORIZONTAL
#define SIMTK_BITVIEW_DEFAULT_WIDGET_ORIENTATION SIMTK_VERTICAL
enum simtk_orientation
{
SIMTK_HORIZONTAL,
SIMTK_VERTICAL
};
struct simtk_bitview_properties
{
SDL_mutex *lock;
uint32_t map_size;
uint32_t start;
int rows, cols;
uint32_t sel_start;
uint32_t sel_size;
uint32_t mark_start;
uint32_t mark_size;
union
{
const void *map;
const uint8_t *bytes;
};
enum simtk_orientation byte_orientation;
enum simtk_orientation widget_orientation;
uint32_t color_msb;
uint32_t color_lsb;
uint32_t select_msb;
uint32_t select_lsb;
uint32_t background;
uint32_t mark_msb;
uint32_t mark_lsb;
uint32_t mark_background;
rbtree_t *regions;
void *opaque;
};
struct simtk_bitview_properties *simtk_bitview_properties_new (int, int, const void *, uint32_t);
void simtk_bitview_properties_lock (const struct simtk_bitview_properties *);
void simtk_bitview_properties_unlock (const struct simtk_bitview_properties *);
void simtk_bitview_properties_destroy (struct simtk_bitview_properties *);
void simtk_bitview_clear_regions (const simtk_widget_t *);
int simtk_bitview_mark_region_noflip (const simtk_widget_t *,
const char *,
uint64_t,
uint64_t,
uint32_t,
uint32_t);
int simtk_bitview_mark_region (simtk_widget_t *,
const char *,
uint64_t,
uint64_t,
uint32_t,
uint32_t);
struct simtk_bitview_properties *simtk_bitview_get_properties (const simtk_widget_t *);
void *simtk_bitview_get_opaque (const simtk_widget_t *);
void simtk_bitview_set_opaque (simtk_widget_t *, void *);
void simtk_bitview_render_bits (simtk_widget_t *);
int simtk_bitview_create (enum simtk_event_type, simtk_widget_t *, struct simtk_event *);
int simtk_bitview_destroy (enum simtk_event_type, simtk_widget_t *, struct simtk_event *);
void simtk_bitview_scroll_to (simtk_widget_t *, uint32_t, int);
void simtk_bitview_scroll_to_noflip (simtk_widget_t *, uint32_t, int);
simtk_widget_t *simtk_bitview_new (struct simtk_container *, int, int, int, int, enum simtk_orientation, enum simtk_orientation, const void *, uint32_t, int);
#endif /* _SIMTK_BITVIEW_H */
|
/*
-----------------------------------------------------------------------
Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp
2014-2015, CWI, Amsterdam
Contact: astra@uantwerpen.be
Website: http://sf.net/projects/astra-toolbox
This file is part of the ASTRA Toolbox.
The ASTRA Toolbox 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.
The ASTRA Toolbox 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 the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------
$Id$
*/
#ifndef _CUDA_SIRT3D_H
#define _CUDA_SIRT3D_H
#include "util3d.h"
#include "algo3d.h"
namespace astraCUDA3d {
class _AstraExport SIRT : public ReconAlgo3D {
public:
SIRT();
~SIRT();
// bool setConeGeometry(const SDimensions3D& dims, const SConeProjection* projs);
bool enableVolumeMask();
bool enableSinogramMask();
// init should be called after setting all geometry
bool init();
// setVolumeMask should be called after init and before iterate,
// but only if enableVolumeMask was called before init.
// It may be called again after iterate.
bool setVolumeMask(cudaPitchedPtr& D_maskData);
// setSinogramMask should be called after init and before iterate,
// but only if enableSinogramMask was called before init.
// It may be called again after iterate.
bool setSinogramMask(cudaPitchedPtr& D_smaskData);
// setBuffers should be called after init and before iterate.
// It may be called again after iterate.
bool setBuffers(cudaPitchedPtr& D_volumeData,
cudaPitchedPtr& D_projData);
// set Min/Max constraints. They may be called at any time, and will affect
// any iterate() calls afterwards.
bool setMinConstraint(float fMin);
bool setMaxConstraint(float fMax);
// iterate should be called after init and setBuffers.
// It may be called multiple times.
bool iterate(unsigned int iterations);
// Compute the norm of the difference of the FP of the current reconstruction
// and the sinogram. (This performs one FP.)
// It can be called after iterate.
float computeDiffNorm();
protected:
void reset();
bool precomputeWeights();
bool useVolumeMask;
bool useSinogramMask;
bool useMinConstraint;
bool useMaxConstraint;
float fMinConstraint;
float fMaxConstraint;
cudaPitchedPtr D_maskData;
cudaPitchedPtr D_smaskData;
// Input/output
cudaPitchedPtr D_sinoData;
cudaPitchedPtr D_volumeData;
// Temporary buffers
cudaPitchedPtr D_projData;
cudaPitchedPtr D_tmpData;
// Geometry-specific precomputed data
cudaPitchedPtr D_lineWeight;
cudaPitchedPtr D_pixelWeight;
};
bool doSIRT(cudaPitchedPtr D_volumeData, unsigned int volumePitch,
cudaPitchedPtr D_projData, unsigned int projPitch,
cudaPitchedPtr D_maskData, unsigned int maskPitch,
const SDimensions3D& dims, const SConeProjection* projs,
unsigned int iterations);
}
#endif
|
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
*
* Calamares is Free Software: see the License-Identifier above.
*
*
*/
#ifndef UTILS_ENTROPY_H
#define UTILS_ENTROPY_H
#include "DllMacro.h"
#include <QByteArray>
namespace CalamaresUtils
{
/// @brief Which entropy source was actually used for the entropy.
enum class EntropySource
{
None, ///< Buffer is empty, no random data
URandom, ///< Read from /dev/urandom
Twister ///< Generated by pseudo-random
};
/** @brief Fill buffer @p b with exactly @p size random bytes
*
* The array is cleared and resized, then filled with 0xcb
* "just in case", after which it is filled with random
* bytes from a suitable source. Returns which source was used.
*/
DLLEXPORT EntropySource getEntropy( int size, QByteArray& b );
/** @brief Fill string @p s with exactly @p size random printable ASCII characters
*
* The characters are picked from a set of 64 (2^6). The string
* contains 6 * size bits of entropy. * Returns which source was used.
* @see getEntropy
*/
DLLEXPORT EntropySource getPrintableEntropy( int size, QString& s );
} // namespace CalamaresUtils
#endif
|
/**
******************************************************************************
* @file Demonstrations/Inc/main.h
* @author MCD Application Team
* @version V1.0.1
* @date 17-February-2017
* @brief Header for main.c module
******************************************************************************
* @attention
*
* <h2><center>© Copyright © 2017 STMicroelectronics International N.V.
* All rights reserved.</center></h2>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of other
* contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
* 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
* 5. Redistribution and use of this software other than as permitted under
* this license is void and will automatically terminate your rights under
* this license.
*
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_nucleo_144.h"
#include "stm32_adafruit_sd.h"
#include "stm32_adafruit_lcd.h"
#include <stdio.h>
#include <stdlib.h>
/* FatFs includes component */
#include "ff_gen_drv.h"
#include "sd_diskio.h"
#include "fatfs_storage.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
#define MAX_BMP_FILES 25
#define MAX_BMP_FILE_NAME 11
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//
// CustomView1.h
// Demo1
//
// Created by ljj on 14-8-19.
// Copyright (c) 2014年 ljj. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomView1 : UIView
@end
|
/*
Copyright (C) 2010,2011,2012,2013 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
This file is part of ESPResSo.
ESPResSo 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.
ESPResSo 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/>.
*/
/* This is the default myconfig.h-file. If no other myconfig-file is
found, this file is used.
*/
/* global features */
#define PARTIAL_PERIODIC
#define ELECTROSTATICS
#define EXTERNAL_FORCES
#define CONSTRAINTS
#define MASS
#define EXCLUSIONS
#define COMFORCE
#define COMFIXED
#define NPT
/* potentials */
#define TABULATED
#define LENNARD_JONES
#define LENNARD_JONES_GENERIC
#define MORSE
#define LJCOS
#define LJCOS2
#define BUCKINGHAM
#define SOFT_SPHERE
#define BOND_ANGLE
#define MPI_CORE
#define FORCE_CORE
|
/**
* WarfaceBot, a blind XMPP client for Warface (FPS)
* Copyright (C) 2015-2017 Levak Borok <levak92@gmail.com>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wb_lang.h>
#include <stdarg.h>
#include <stdio.h>
struct lang lang = {
#define XLANG(Name) { .value = "@" #Name, .is_set = 0 },
LANG_LIST
#undef XLANG
};
inline char *lang_get(const char *fmt, ...)
{
size_t len;
char *s;
va_list ap;
va_list ap2;
va_start(ap, fmt);
va_copy(ap2, ap);
len = vsnprintf(NULL, 0, fmt, ap);
s = malloc(len + 1);
vsnprintf(s, len + 1, fmt, ap2);
va_end(ap);
va_end(ap2);
return s;
}
|
#ifndef TELEPORT_NOTARYRPC_H
#define TELEPORT_NOTARYRPC_H
#include <jsonrpccpp/client.h>
#include <jsonrpccpp/client/connectors/httpclient.h>
#include <test/teleport_tests/node/Data.h>
#include <test/teleport_tests/node/config/TeleportConfig.h>
#include "define.h"
#include "string_functions.h"
class NotaryRPC
{
public:
int64_t port;
std::string host;
std::string currency_code;
jsonrpc::HttpClient *http_client{NULL};
jsonrpc::Client *client{NULL};
TeleportConfig &config;
NotaryRPC(std::string currency_code, TeleportConfig &config):
currency_code(currency_code), config(config)
{
port = string_to_int(Info("notaryrpcport"));
host = Info("notaryrpchost");
if (host == "")
host = "127.0.0.1";
http_client = new jsonrpc::HttpClient("http://" + host + ":" + ToString(port));
client = new jsonrpc::Client(*http_client);
}
std::string Info(std::string key)
{
return config[currency_code + "-" + key];
}
Json::Value ExecuteCommand(std::string command)
{
std::string method;
std::vector<std::string> params;
if (!GetMethodAndParamsFromCommand(method, params, command))
return Json::Value();
// Json::Value converted_params = ConvertParameterTypes(method, params);
Json::Value json_params;
for (auto param : params)
json_params.append(param);
auto reply = client->CallMethod(method, json_params);
return reply;
}
};
#endif //TELEPORT_NOTARYRPC_H
|
#pragma once
#include "augs/templates/settable_as_current_op.h"
namespace augs {
template <class derived, bool always_force_set = false>
class settable_as_current_mixin {
static derived* marked_instance;
static derived* previous_instance;
static derived* current_instance;
static constexpr bool is_const = std::is_const_v<derived>;
static void push_instance(derived* const n) {
previous_instance = current_instance;
current_instance = n;
}
template <class... Args>
static void set_current_to(derived* const which, Args&&... args) {
if (which == nullptr) {
set_current_to_none(std::forward<Args>(args)...);
}
which->settable_as_current_mixin::set_as_current(std::forward<Args>(args)...);
}
protected:
settable_as_current_mixin() = default;
settable_as_current_mixin(settable_as_current_mixin&& b) noexcept {
if (b.is_current()) {
current_instance = static_cast<derived*>(this);
}
}
settable_as_current_mixin& operator=(settable_as_current_mixin&& b) noexcept {
unset_if_current();
if (b.is_current()) {
current_instance = static_cast<derived*>(this);
}
return *this;
}
public:
static derived& get_current() {
return *current_instance;
}
static derived* find_current() {
return current_instance;
}
static void mark_current() {
marked_instance = current_instance;
}
template <class... Args>
static void set_current_to_none(Args&&... args) {
derived::set_current_to_none_impl(std::forward<Args>(args)...);
push_instance(nullptr);
}
template <class... Args>
static void set_current_to_previous(Args&&... args) {
set_current_to(previous_instance, std::forward<Args>(args)...);
}
template <class... Args>
static void set_current_to_marked(Args&&... args) {
set_current_to(marked_instance, std::forward<Args>(args)...);
}
static bool current_exists() {
return current_instance != nullptr;
}
template <class... Args>
void unset_if_current(Args&&... args) const {
if (is_current()) {
set_current_to_none(std::forward<Args>(args)...);
}
}
bool is_current() const {
const auto& self = static_cast<const derived&>(*this);
return current_instance == std::addressof(self);
}
template <class... Args, bool C = !is_const, class = std::enable_if_t<C>>
bool set_as_current(Args&&... args) {
auto& self = static_cast<derived&>(*this);
if (!is_current() || always_force_set) {
push_instance(std::addressof(self));
return self.set_as_current_impl(std::forward<Args>(args)...);
}
return true;
}
template <class... Args, bool C = is_const, class = std::enable_if_t<C>>
bool set_as_current(Args&&... args) const {
const auto& self = static_cast<derived&>(*this);
if (!is_current() || always_force_set) {
push_instance(std::addressof(self));
return self.set_as_current_impl(std::forward<Args>(args)...);
}
return true;
}
};
template <class T, bool A>
T* settable_as_current_mixin<T, A>::current_instance = nullptr;
template <class T, bool A>
T* settable_as_current_mixin<T, A>::previous_instance = nullptr;
template <class T, bool A>
T* settable_as_current_mixin<T, A>::marked_instance = nullptr;
}
|
/* This file is part of VoltDB.
* Copyright (C) 2008-2014 VoltDB Inc.
*
* This file contains original code and/or modifications of original code.
* Any modifications made by VoltDB Inc. are licensed under the following
* terms and conditions:
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VoltDB. If not, see <http://www.gnu.org/licenses/>.
*/
/* Copyright (C) 2008 by H-Store Project
* Brown University
* Massachusetts Institute of Technology
* Yale University
*
* 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 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.
*/
#ifndef HSTOREIDS_H
#define HSTOREIDS_H
#include <stdint.h>
#include <string>
//
// ID type definitions.
// NOTE: Use only SIGNED int8_t / int16_t / int32_t / int64_t for portability.
// We use Java/C++ side by side.
// DO NOT USE UNSIGNED TYPES!!
//
namespace voltdb {
// ==================================================================
// CATALOGS
// ==================================================================
// ------------------------------------------------------------------
// CatalogId
// This just needs to be a unique indentifier for a Catalog
// ------------------------------------------------------------------
typedef int32_t CatalogId;
// ==================================================================
// EXECUTION
// ==================================================================
// ------------------------------------------------------------------
// StoredProcedureId
// This just needs to be a unique indentifier for a store procedure
// ------------------------------------------------------------------
typedef int64_t StoredProcedureId;
// ------------------------------------------------------------------
// TransactionId
// An active stored procedure instance is referred to a a transaction
// It is a combination of the ExeuteNodeId and the timestamp of the
// stored procedure runner: <CatalogId><timestamp>
// ------------------------------------------------------------------
typedef int64_t TransactionId;
}
#endif
|
/*
* Copyright RedHat Inc. 2008
*
* Authors: Vivek Goyal <vgoyal@redhat.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <errno.h>
#include <grp.h>
#include <libcgroup.h>
#include <limits.h>
#include <pwd.h>
#include <search.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "tools-common.h"
static struct option longopts[] = {
{"sticky", no_argument, NULL, 's'},
{"help", no_argument, NULL, 'h'},
{0, 0, 0, 0}
};
static void usage(int status, const char *program_name)
{
if (status != 0)
fprintf(stderr, "Wrong input parameters,"
" try %s --help' for more information.\n",
program_name);
else {
printf("Usage: %s [-h] [-g <controllers>:<path>] "
"[--sticky] command [arguments] ...\n",
program_name);
}
}
int main(int argc, char *argv[])
{
int ret = 0, i;
int cg_specified = 0;
int flag_child = 0;
uid_t uid;
gid_t gid;
pid_t pid;
int c;
struct cgroup_group_spec *cgroup_list[CG_HIER_MAX];
memset(cgroup_list, 0, sizeof(cgroup_list));
while ((c = getopt_long(argc, argv, "+g:sh", longopts, NULL)) > 0) {
switch (c) {
case 'g':
ret = parse_cgroup_spec(cgroup_list, optarg,
CG_HIER_MAX);
if (ret) {
fprintf(stderr, "cgroup controller and path"
"parsing failed\n");
return -1;
}
cg_specified = 1;
break;
case 's':
flag_child |= CGROUP_DAEMON_UNCHANGE_CHILDREN;
break;
case 'h':
usage(0, argv[0]);
exit(0);
default:
usage(1, argv[0]);
exit(1);
}
}
/* Executable name */
if (!argv[optind]) {
usage(1, argv[0]);
exit(1);
}
/* Initialize libcg */
ret = cgroup_init();
if (ret) {
fprintf(stderr, "libcgroup initialization failed: %s\n",
cgroup_strerror(ret));
return ret;
}
/* Just for debugging purposes. */
uid = geteuid();
gid = getegid();
cgroup_dbg("My euid and eguid is: %d,%d\n", (int) uid, (int) gid);
uid = getuid();
gid = getgid();
pid = getpid();
ret = cgroup_register_unchanged_process(pid, flag_child);
if (ret) {
fprintf(stderr, "registration of process failed\n");
return ret;
}
/*
* 'cgexec' command file needs the root privilege for executing
* a cgroup_register_unchanged_process() by using unix domain
* socket, and an euid/egid should be changed to the executing user
* from a root user.
*/
if (setresuid(uid, uid, uid)) {
fprintf(stderr, "%s", strerror(errno));
return -1;
}
if (setresgid(gid, gid, gid)) {
fprintf(stderr, "%s", strerror(errno));
return -1;
}
if (cg_specified) {
/*
* User has specified the list of control group and
* controllers
* */
for (i = 0; i < CG_HIER_MAX; i++) {
if (!cgroup_list[i])
break;
ret = cgroup_change_cgroup_path(cgroup_list[i]->path,
pid,
(const char*const*) cgroup_list[i]->controllers);
if (ret) {
fprintf(stderr,
"cgroup change of group failed\n");
return ret;
}
}
} else {
/* Change the cgroup by determining the rules based on uid */
ret = cgroup_change_cgroup_flags(uid, gid,
argv[optind], pid, 0);
if (ret) {
fprintf(stderr, "cgroup change of group failed\n");
return ret;
}
}
/* Now exec the new process */
ret = execvp(argv[optind], &argv[optind]);
if (ret == -1) {
fprintf(stderr, "%s", strerror(errno));
return -1;
}
return 0;
}
|
/*
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Mutex context switch benchmark
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*
* @}
*/
#include <stdio.h>
#include "macros/units.h"
#include "mutex.h"
#include "thread.h"
#include "xtimer.h"
#ifndef TEST_DURATION
#define TEST_DURATION (1000000U)
#endif
volatile unsigned _flag = 0;
static char _stack[THREAD_STACKSIZE_MAIN];
static mutex_t _mutex = MUTEX_INIT;
static void _timer_callback(void*arg)
{
(void)arg;
_flag = 1;
}
static void *_second_thread(void *arg)
{
(void)arg;
while(1) {
mutex_lock(&_mutex);
}
return NULL;
}
int main(void)
{
printf("main starting\n");
thread_create(_stack,
sizeof(_stack),
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
_second_thread,
NULL,
"second_thread");
/* lock the mutex, then yield to second_thread */
mutex_lock(&_mutex);
thread_yield_higher();
xtimer_t timer;
timer.callback = _timer_callback;
uint32_t n = 0;
xtimer_set(&timer, TEST_DURATION);
while(!_flag) {
mutex_unlock(&_mutex);
n++;
}
printf("{ \"result\" : %"PRIu32, n);
#ifdef CLOCK_CORECLOCK
printf(", \"ticks\" : %"PRIu32,
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
#endif
puts(" }");
return 0;
}
|
/* This file is part of P^nMPI.
*
* Copyright (c)
* 2008-2019 Lawrence Livermore National Laboratories, United States of America
* 2011-2016 ZIH, Technische Universitaet Dresden, Federal Republic of Germany
* 2013-2019 RWTH Aachen University, Federal Republic of Germany
*
*
* P^nMPI 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 version 2.1 dated February 1999.
*
* P^nMPI 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 P^nMPI; if not, write to the
*
* Free Software Foundation, Inc.
* 51 Franklin St, Fifth Floor
* Boston, MA 02110, USA
*
*
* Written by Martin Schulz, schulzm@llnl.gov.
*
* LLNL-CODE-402774
*/
#ifndef _PNMPI_MOD_STATUS
#define _PNMPI_MOD_STATUS
#include <mpi.h>
/*------------------------------------------------------------*/
/* Note: this module must be loaded into the stack before
any module using it (i.e., must be instantiated between
any user and the application). Also, any call to its
services must occur after calling PMPI_Init and services
are only available to modules requesting it during
MPI_Init */
/*------------------------------------------------------------*/
/* Additional storage in requests */
#define PNMPI_MODULE_STATUS "status-storage"
/*..........................................................*/
/* Access macros */
#define STATUS_STORAGE(status, offset, type) \
STATUS_STORAGE_ARRAY(status, offset, 0, type, 1, 0)
#define STATUS_STORAGE_ARRAY(status, offset, total, type, count, num) \
(*((type *)(((char *)(status)) + count * sizeof(MPI_Status) + num * total + \
offset)))
#define PNMPIMOD_STATUS_TAG 0x3e1f9
/*..........................................................*/
/* Request additional memory in the status object
This must be called from within MPI_Init (after
calling PMPI_Init)
IN: size = number of bytes requested
(if 0, just storage of standard parameters
OUT: >=0: offset of new storage relative to request pointer
<0: error message
*/
typedef int (*PNMPIMOD_Status_RequestStorage_t)(int);
int PNMPIMOD_Status_RequestStorage(int size);
#endif /* _PNMPI_MOD_STATUS */
|
/***
This file is part of catta.
catta is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
catta 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 catta; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <catta/domain.h>
#include <catta/malloc.h>
int main(CATTA_GCC_UNUSED int argc, CATTA_GCC_UNUSED char *argv[]) {
char *s;
char t[256], r[256];
const char *p;
size_t size;
char name[64], type[CATTA_DOMAIN_NAME_MAX], domain[CATTA_DOMAIN_NAME_MAX];
printf("%s\n", s = catta_normalize_name_strdup("foo.foo\\046."));
catta_free(s);
printf("%s\n", s = catta_normalize_name_strdup("foo.foo\\.foo."));
catta_free(s);
printf("%s\n", s = catta_normalize_name_strdup("fo\\\\o\\..f oo."));
catta_free(s);
printf("%i\n", catta_domain_equal("\\065aa bbb\\.\\046cc.cc\\\\.dee.fff.", "Aaa BBB\\.\\.cc.cc\\\\.dee.fff"));
printf("%i\n", catta_domain_equal("A", "a"));
printf("%i\n", catta_domain_equal("a", "aaa"));
printf("%u = %u\n", catta_domain_hash("ccc\\065aa.aa\\.b\\\\."), catta_domain_hash("cccAaa.aa\\.b\\\\"));
catta_service_name_join(t, sizeof(t), "foo.foo.foo \\.", "_http._tcp", "test.local");
printf("<%s>\n", t);
catta_service_name_split(t, name, sizeof(name), type, sizeof(type), domain, sizeof(domain));
printf("name: <%s>; type: <%s>; domain <%s>\n", name, type, domain);
catta_service_name_join(t, sizeof(t), NULL, "_http._tcp", "one.two\\. .local");
printf("<%s>\n", t);
catta_service_name_split(t, NULL, 0, type, sizeof(type), domain, sizeof(domain));
printf("name: <>; type: <%s>; domain <%s>\n", type, domain);
p = "--:---\\\\\\123\\065_äöü\\064\\.\\\\sjöödfhh.sdfjhskjdf";
printf("unescaped: <%s>, rest: %s\n", catta_unescape_label(&p, t, sizeof(t)), p);
size = sizeof(r);
s = r;
printf("escaped: <%s>\n", catta_escape_label(t, strlen(t), &s, &size));
p = r;
printf("unescaped: <%s>\n", catta_unescape_label(&p, t, sizeof(t)));
assert(catta_is_valid_service_type_generic("_foo._bar._waldo"));
assert(!catta_is_valid_service_type_strict("_foo._bar._waldo"));
assert(!catta_is_valid_service_subtype("_foo._bar._waldo"));
assert(catta_is_valid_service_type_generic("_foo._tcp"));
assert(catta_is_valid_service_type_strict("_foo._tcp"));
assert(!catta_is_valid_service_subtype("_foo._tcp"));
assert(!catta_is_valid_service_type_generic("_foo._bar.waldo"));
assert(!catta_is_valid_service_type_strict("_foo._bar.waldo"));
assert(!catta_is_valid_service_subtype("_foo._bar.waldo"));
assert(!catta_is_valid_service_type_generic(""));
assert(!catta_is_valid_service_type_strict(""));
assert(!catta_is_valid_service_subtype(""));
assert(catta_is_valid_service_type_generic("_foo._sub._bar._tcp"));
assert(!catta_is_valid_service_type_strict("_foo._sub._bar._tcp"));
assert(catta_is_valid_service_subtype("_foo._sub._bar._tcp"));
printf("%s\n", catta_get_type_from_subtype("_foo._sub._bar._tcp"));
assert(!catta_is_valid_host_name("sf.ooo."));
assert(catta_is_valid_host_name("sfooo."));
assert(catta_is_valid_host_name("sfooo"));
assert(catta_is_valid_domain_name("."));
assert(catta_is_valid_domain_name(""));
assert(catta_normalize_name(".", t, sizeof(t)));
assert(catta_normalize_name("", t, sizeof(t)));
assert(!catta_is_valid_fqdn("."));
assert(!catta_is_valid_fqdn(""));
assert(!catta_is_valid_fqdn("foo"));
assert(catta_is_valid_fqdn("foo.bar"));
assert(catta_is_valid_fqdn("foo.bar."));
assert(catta_is_valid_fqdn("gnurz.foo.bar."));
assert(!catta_is_valid_fqdn("192.168.50.1"));
assert(!catta_is_valid_fqdn("::1"));
assert(!catta_is_valid_fqdn(".192.168.50.1."));
return 0;
}
|
/*
Copyright (C) 2009 William Hart
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
#include "flint.h"
#include "ulong_extras.h"
int main(void)
{
int result;
ulong i;
FLINT_TEST_INIT(state);
flint_printf("divrem2_precomp....");
fflush(stdout);
for (i = 0; i < 100000 * flint_test_multiplier(); i++)
{
mp_limb_t d, n, r1, r2, q1, q2;
double dpre;
d = n_randtest(state);
if (d == UWORD(0)) d++;
n = n_randtest(state);
dpre = n_precompute_inverse(d);
r1 = n_divrem2_precomp(&q1, n, d, dpre);
r2 = n%d;
q2 = n/d;
result = ((r1 == r2) && (q1 == q2));
if (!result)
{
flint_printf("FAIL:\n");
flint_printf("n = %wu, d = %wu, dpre = %f\n", n, d, dpre);
flint_printf("q1 = %wu, q2 = %wu, r1 = %wu, r2 = %wu\n", q1, q2, r1, r2);
abort();
}
}
FLINT_TEST_CLEANUP(state);
flint_printf("PASS\n");
return 0;
}
|
/*
* Copyright (C) 2005 Tommi Maekitalo
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* As a special exception, you may use this file as part of a free
* software library without restriction. Specifically, if other files
* instantiate templates or use macros or inline functions from this
* file, or you compile this file and link it with other files to
* produce an executable, this file does not by itself cause the
* resulting executable to be covered by the GNU General Public
* License. This exception does not however invalidate any other
* reasons why the executable file might be covered by the GNU Library
* General Public License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef TNTDB_MYSQL_BINDVALUES_H
#define TNTDB_MYSQL_BINDVALUES_H
#include <mysql.h>
#include <string>
#include <tntdb/decimal.h>
#include <tntdb/mysql/bindutils.h>
namespace tntdb
{
namespace mysql
{
class BindValues
{
unsigned valuesSize;
MYSQL_BIND* values;
struct BindAttributes
{
unsigned long length;
my_bool isNull;
std::string name;
BindAttributes()
: length(0),
isNull(true)
{ }
}* bindAttributes;
// non copyable
BindValues(const BindValues&);
BindValues& operator=(const BindValues&);
public:
explicit BindValues(unsigned n);
BindValues();
~BindValues();
MYSQL_BIND* getMysqlBind() const { return values; }
void setSize(unsigned n);
unsigned getSize() const { return valuesSize; }
void setNull(unsigned n)
{ mysql::setNull(values[n]); }
void setBool(unsigned n, bool data)
{ mysql::setBool(values[n], data); }
void setShort(unsigned n, short data)
{ mysql::setShort(values[n], data); }
void setInt(unsigned n, int data)
{ mysql::setInt(values[n], data); }
void setLong(unsigned n, int data)
{ mysql::setLong(values[n], data); }
void setUnsignedShort(unsigned n, unsigned short data)
{ mysql::setUnsignedShort(values[n], data); }
void setUnsigned(unsigned n, unsigned data)
{ mysql::setUnsigned(values[n], data); }
void setUnsignedLong(unsigned n, unsigned data)
{ mysql::setUnsignedLong(values[n], data); }
void setInt32(unsigned n, int32_t data)
{ mysql::setInt32(values[n], data); }
void setUnsigned32(unsigned n, uint32_t data)
{ mysql::setUnsigned32(values[n], data); }
void setInt64(unsigned n, int64_t data)
{ mysql::setInt64(values[n], data); }
void setUnsigned64(unsigned n, uint64_t data)
{ mysql::setUnsigned64(values[n], data); }
void setDecimal(unsigned n, const Decimal& data)
{ mysql::setDecimal(values[n], bindAttributes[n].length, data); }
void setFloat(unsigned n, float data)
{ mysql::setFloat(values[n], data); }
void setDouble(unsigned n, double data)
{ mysql::setDouble(values[n], data); }
void setChar(unsigned n, char data)
{ mysql::setChar(values[n], bindAttributes[n].length, data); }
void setString(unsigned n, const char* data)
{ mysql::setString(values[n], bindAttributes[n].length, data); }
void setString(unsigned n, const std::string& data)
{ mysql::setString(values[n], bindAttributes[n].length, data); }
void setBlob(unsigned n, const Blob& data)
{ mysql::setBlob(values[n], bindAttributes[n].length, data); }
void setDate(unsigned n, const Date& data)
{ mysql::setDate(values[n], data); }
void setTime(unsigned n, const Time& data)
{ mysql::setTime(values[n], data); }
void setDatetime(unsigned n, const Datetime& data)
{ mysql::setDatetime(values[n], data); }
bool isNull(unsigned n) const
{ return mysql::isNull(values[n]); }
bool getBool(unsigned n) const
{ return mysql::getBool(values[n]); }
int getInt(unsigned n) const
{ return mysql::getInt(values[n]); }
unsigned getUnsigned(unsigned n) const
{ return mysql::getUnsigned(values[n]); }
int32_t getInt32(unsigned n) const
{ return mysql::getInt32(values[n]); }
uint32_t getUnsigned32(unsigned n) const
{ return mysql::getUnsigned32(values[n]); }
int64_t getInt64(unsigned n) const
{ return mysql::getInt64(values[n]); }
uint64_t getUnsigned64(unsigned n) const
{ return mysql::getUnsigned64(values[n]); }
Decimal getDecimal(unsigned n) const
{ return mysql::getDecimal(values[n]); }
long getLong(unsigned n) const
{ return mysql::getLong(values[n]); }
float getFloat(unsigned n) const
{ return mysql::getFloat(values[n]); }
double getDouble(unsigned n) const
{ return mysql::getDouble(values[n]); }
char getChar(unsigned n) const
{ return mysql::getChar(values[n]); }
void getString(unsigned n, std::string& ret) const
{ mysql::getString(values[n], ret); }
const std::string& getName(unsigned n) const
{ return bindAttributes[n].name; }
void initOutBuffer(unsigned n, MYSQL_FIELD& f);
void clear();
};
}
}
#endif // TNTDB_MYSQL_BINDVALUES_H
|
/*
Copyright (C) 2013 Mike Hansen
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include "fq_zech_mat.h"
#ifdef T
#undef T
#endif
#define T fq_zech
#define CAP_T FQ_ZECH
#include "fq_mat_templates/neg.c"
#undef CAP_T
#undef T
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef COMPUTERESIDUALTHREAD_H
#define COMPUTERESIDUALTHREAD_H
#include "ThreadedElementLoop.h"
// libMesh includes
#include "libmesh/elem_range.h"
// Forward declarations
class FEProblemBase;
class NonlinearSystemBase;
class MaterialPropertyStorage;
class MaterialData;
class Assembly;
class ComputeMaterialsObjectThread : public ThreadedElementLoop<ConstElemRange>
{
public:
ComputeMaterialsObjectThread(FEProblemBase & fe_problem,
std::vector<std::shared_ptr<MaterialData>> & material_data,
std::vector<std::shared_ptr<MaterialData>> & bnd_material_data,
std::vector<std::shared_ptr<MaterialData>> & neighbor_material_data,
MaterialPropertyStorage & material_props,
MaterialPropertyStorage & bnd_material_props,
std::vector<Assembly *> & assembly);
// Splitting Constructor
ComputeMaterialsObjectThread(ComputeMaterialsObjectThread & x, Threads::split split);
virtual ~ComputeMaterialsObjectThread();
virtual void post() override;
virtual void subdomainChanged() override;
virtual void onElement(const Elem * elem) override;
virtual void onBoundary(const Elem * elem, unsigned int side, BoundaryID bnd_id) override;
virtual void onInternalSide(const Elem * elem, unsigned int side) override;
void join(const ComputeMaterialsObjectThread & /*y*/);
protected:
FEProblemBase & _fe_problem;
NonlinearSystemBase & _nl;
std::vector<std::shared_ptr<MaterialData>> & _material_data;
std::vector<std::shared_ptr<MaterialData>> & _bnd_material_data;
std::vector<std::shared_ptr<MaterialData>> & _neighbor_material_data;
MaterialPropertyStorage & _material_props;
MaterialPropertyStorage & _bnd_material_props;
/// Reference to the Material object warehouses
const MaterialWarehouse & _materials;
const MaterialWarehouse & _discrete_materials;
std::vector<Assembly *> & _assembly;
bool _need_internal_side_material;
const bool _has_stateful_props;
const bool _has_bnd_stateful_props;
};
#endif // COMPUTERESIDUALTHREAD_H
|
/*
Copyright (C) 2014 Fredrik Johansson
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include "acb_modular.h"
int main()
{
slong iter;
flint_rand_t state;
flint_printf("psl2z_inv....");
fflush(stdout);
flint_randinit(state);
for (iter = 0; iter < 10000 * arb_test_multiplier(); iter++)
{
psl2z_t f, g, h, i;
psl2z_init(f);
psl2z_init(g);
psl2z_init(h);
psl2z_init(i);
psl2z_randtest(f, state, n_randint(state, 100));
psl2z_randtest(g, state, n_randint(state, 100));
psl2z_randtest(h, state, n_randint(state, 100));
psl2z_inv(g, f);
psl2z_mul(h, f, g);
psl2z_one(i);
if (!psl2z_equal(h, i) || !psl2z_is_correct(g))
{
flint_printf("FAIL\n");
flint_printf("f = "); psl2z_print(f); flint_printf("\n");
flint_printf("g = "); psl2z_print(g); flint_printf("\n");
flint_printf("h = "); psl2z_print(h); flint_printf("\n");
flint_printf("i = "); psl2z_print(i); flint_printf("\n");
flint_abort();
}
psl2z_inv(f, f);
if (!psl2z_equal(f, g) || !psl2z_is_correct(f))
{
flint_printf("FAIL (aliasing)\n");
flint_printf("f = "); psl2z_print(f); flint_printf("\n");
flint_printf("g = "); psl2z_print(g); flint_printf("\n");
flint_abort();
}
psl2z_clear(f);
psl2z_clear(g);
psl2z_clear(h);
psl2z_clear(i);
}
flint_randclear(state);
flint_cleanup();
flint_printf("PASS\n");
return EXIT_SUCCESS;
}
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QNEARFIELDTAGTYPE3SYMBIAN_H
#define QNEARFIELDTAGTYPE3SYMBIAN_H
#include <qnearfieldtagtype3.h>
#include "symbian/nearfieldtagimpl_symbian.h"
#include "symbian/nearfieldndeftarget_symbian.h"
QT_BEGIN_HEADER
QTM_BEGIN_NAMESPACE
class QNearFieldTagType3Symbian : public QNearFieldTagType3, private QNearFieldTagImpl<QNearFieldTagType3Symbian>
{
Q_OBJECT
public:
explicit QNearFieldTagType3Symbian(CNearFieldNdefTarget *tag, QObject *parent = 0);
~QNearFieldTagType3Symbian();
virtual QByteArray uid() const;
void setAccessMethods(const QNearFieldTarget::AccessMethods& accessMethods)
{
_setAccessMethods(accessMethods);
}
QNearFieldTarget::AccessMethods accessMethods() const
{
return _accessMethods();
}
bool hasNdefMessage();
RequestId readNdefMessages();
RequestId writeNdefMessages(const QList<QNdefMessage> &messages);
#if 0
quint16 systemCode();
QList<quint16> services();
int serviceMemorySize(quint16 serviceCode);
RequestId serviceData(quint16 serviceCode);
RequestId writeServiceData(quint16 serviceCode, const QByteArray &data);
#endif
RequestId check(const QMap<quint16, QList<quint16> > &serviceBlockList);
RequestId update(const QMap<quint16, QList<quint16> > &serviceBlockList,
const QByteArray &data);
bool isProcessingCommand() const { return _isProcessingRequest(); }
RequestId sendCommand(const QByteArray &command);
RequestId sendCommands(const QList<QByteArray> &commands);
bool waitForRequestCompleted(const RequestId &id, int msecs = 5000);
private:
const QByteArray& getIDm();
QByteArray serviceBlockList2CmdParam(const QMap<quint16, QList<quint16> > &serviceBlockList, quint8& numberOfBlocks, bool isCheckCommand);
QMap<quint16, QList<quint16> > cmd2ServiceBlockList(const QByteArray& cmd);
QMap<quint16, QByteArray> checkResponse2ServiceBlockList(const QMap<quint16, QList<quint16> > &serviceBlockList, const QByteArray& response);
void handleTagOperationResponse(const RequestId &id, const QByteArray &command, const QByteArray &response, bool emitRequestCompleted);
QVariant decodeResponse(const QByteArray & command, const QByteArray &response);
private:
QByteArray mIDm;
friend class QNearFieldTagImpl<QNearFieldTagType3Symbian>;
};
QTM_END_NAMESPACE
typedef QMap<quint16,QByteArray> checkResponseType;
Q_DECLARE_METATYPE(checkResponseType)
QT_END_HEADER
#endif // QNEARFIELDTAGTYPE3SYMBIAN_H
|
/*****************************************************************************
* This file is part of Kvazaar HEVC encoder.
*
* Copyright (C) 2013-2015 Tampere University of Technology and others (see
* COPYING file).
*
* Kvazaar is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* Kvazaar 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 Kvazaar. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "strategies/sse41/picture-sse41.h"
#if COMPILE_INTEL_SSE41
#include <immintrin.h>
#include <stdlib.h>
#include "kvazaar.h"
#include "strategyselector.h"
unsigned kvz_reg_sad_sse41(const kvz_pixel * const data1, const kvz_pixel * const data2,
const int width, const int height, const unsigned stride1, const unsigned stride2)
{
int y, x;
unsigned sad = 0;
__m128i sse_inc = _mm_setzero_si128 ();
long long int sse_inc_array[2];
for (y = 0; y < height; ++y) {
for (x = 0; x <= width-16; x+=16) {
const __m128i a = _mm_loadu_si128((__m128i const*) &data1[y * stride1 + x]);
const __m128i b = _mm_loadu_si128((__m128i const*) &data2[y * stride2 + x]);
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a,b));
}
{
const __m128i a = _mm_loadu_si128((__m128i const*) &data1[y * stride1 + x]);
const __m128i b = _mm_loadu_si128((__m128i const*) &data2[y * stride2 + x]);
switch (((width - (width%2)) - x)/2) {
case 0:
break;
case 1:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x01)));
break;
case 2:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x03)));
break;
case 3:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x07)));
break;
case 4:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x0f)));
break;
case 5:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x1f)));
break;
case 6:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x3f)));
break;
case 7:
sse_inc = _mm_add_epi32(sse_inc, _mm_sad_epu8(a, _mm_blend_epi16(a, b, 0x7f)));
break;
default:
//Should not happen
assert(0);
}
x = (width - (width%2));
}
for (; x < width; ++x) {
sad += abs(data1[y * stride1 + x] - data2[y * stride2 + x]);
}
}
_mm_storeu_si128((__m128i*) sse_inc_array, sse_inc);
sad += sse_inc_array[0] + sse_inc_array[1];
return sad;
}
#endif //COMPILE_INTEL_SSE41
int kvz_strategy_register_picture_sse41(void* opaque, uint8_t bitdepth) {
bool success = true;
#if COMPILE_INTEL_SSE41
if (bitdepth == 8){
success &= kvz_strategyselector_register(opaque, "reg_sad", "sse41", 20, &kvz_reg_sad_sse41);
}
#endif
return success;
}
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#ifndef QGRAPHICSBSPTREEINDEX_H
#define QGRAPHICSBSPTREEINDEX_H
#include <QtCore/qglobal.h>
#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
#include "qgraphicssceneindex_p.h"
#include "qgraphicsitem_p.h"
#include "qgraphicsscene_bsp_p.h"
#include <QtCore/qrect.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
static const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT = 2000;
class QGraphicsScene;
class QGraphicsSceneBspTreeIndexPrivate;
class Q_AUTOTEST_EXPORT QGraphicsSceneBspTreeIndex : public QGraphicsSceneIndex
{
Q_OBJECT
Q_PROPERTY(int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth)
public:
QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = 0);
~QGraphicsSceneBspTreeIndex();
QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const;
QList<QGraphicsItem *> estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const;
QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const;
int bspTreeDepth();
void setBspTreeDepth(int depth);
protected Q_SLOTS:
void updateSceneRect(const QRectF &rect);
protected:
bool event(QEvent *event);
void clear();
void addItem(QGraphicsItem *item);
void removeItem(QGraphicsItem *item);
void prepareBoundingRectChange(const QGraphicsItem *item);
void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value);
private :
Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex)
Q_DISABLE_COPY(QGraphicsSceneBspTreeIndex)
Q_PRIVATE_SLOT(d_func(), void _q_updateSortCache())
Q_PRIVATE_SLOT(d_func(), void _q_updateIndex())
friend class QGraphicsScene;
friend class QGraphicsScenePrivate;
};
class QGraphicsSceneBspTreeIndexPrivate : public QGraphicsSceneIndexPrivate
{
Q_DECLARE_PUBLIC(QGraphicsSceneBspTreeIndex)
public:
QGraphicsSceneBspTreeIndexPrivate(QGraphicsScene *scene);
QGraphicsSceneBspTree bsp;
QRectF sceneRect;
int bspTreeDepth;
int indexTimerId;
bool restartIndexTimer;
bool regenerateIndex;
int lastItemCount;
QList<QGraphicsItem *> indexedItems;
QList<QGraphicsItem *> unindexedItems;
QList<QGraphicsItem *> untransformableItems;
QList<int> freeItemIndexes;
bool purgePending;
QSet<QGraphicsItem *> removedItems;
void purgeRemovedItems();
void _q_updateIndex();
void startIndexTimer(int interval = QGRAPHICSSCENE_INDEXTIMER_TIMEOUT);
void resetIndex();
void _q_updateSortCache();
bool sortCacheEnabled;
bool updatingSortCache;
void invalidateSortCache();
void addItem(QGraphicsItem *item, bool recursive = false);
void removeItem(QGraphicsItem *item, bool recursive = false, bool moveToUnindexedItems = false);
QList<QGraphicsItem *> estimateItems(const QRectF &, Qt::SortOrder, bool b = false);
static void climbTree(QGraphicsItem *item, int *stackingOrder);
static inline bool closestItemFirst_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
{
return item1->d_ptr->globalStackingOrder < item2->d_ptr->globalStackingOrder;
}
static inline bool closestItemLast_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
{
return item1->d_ptr->globalStackingOrder >= item2->d_ptr->globalStackingOrder;
}
static void sortItems(QList<QGraphicsItem *> *itemList, Qt::SortOrder order,
bool cached, bool onlyTopLevelItems = false);
};
static inline bool QRectF_intersects(const QRectF &s, const QRectF &r)
{
qreal xp = s.left();
qreal yp = s.top();
qreal w = s.width();
qreal h = s.height();
qreal l1 = xp;
qreal r1 = xp;
if (w < 0)
l1 += w;
else
r1 += w;
qreal l2 = r.left();
qreal r2 = r.left();
if (w < 0)
l2 += r.width();
else
r2 += r.width();
if (l1 >= r2 || l2 >= r1)
return false;
qreal t1 = yp;
qreal b1 = yp;
if (h < 0)
t1 += h;
else
b1 += h;
qreal t2 = r.top();
qreal b2 = r.top();
if (r.height() < 0)
t2 += r.height();
else
b2 += r.height();
return !(t1 >= b2 || t2 >= b1);
}
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSBSPTREEINDEX_H
|
#ifndef FOREST_EXTRACTOR_RUNNER_H__
#define FOREST_EXTRACTOR_RUNNER_H__
namespace travatar {
class ConfigForestExtractorRunner;
// A class to build features for the filterer
class ForestExtractorRunner {
public:
ForestExtractorRunner() { }
~ForestExtractorRunner() { }
// Run the model
void Run(const ConfigForestExtractorRunner & config);
private:
};
}
#endif
|
/*
cencoder.c - c source to a base64 encoding algorithm implementation
This is part of the libb64 project, and has been placed in the public domain.
For details, see http://sourceforge.net/projects/libb64
*/
#include <cencode.h>
const int CHARS_PER_LINE = 72;
void base64_init_encodestate(base64_encodestate* state_in)
{
state_in->step = step_A;
state_in->result = 0;
state_in->stepcount = 0;
}
char base64_encode_value(char value_in)
{
static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
if (value_in > 63) return '=';
return encoding[(int)value_in];
}
int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in)
{
const char* plainchar = plaintext_in;
const char* const plaintextend = plaintext_in + length_in;
char* codechar = code_out;
char result;
char fragment;
result = state_in->result;
switch (state_in->step)
{
while (1)
{
case step_A:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_A;
return codechar - code_out;
}
fragment = *plainchar++;
result = (fragment & 0x0fc) >> 2;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x003) << 4;
case step_B:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_B;
return codechar - code_out;
}
fragment = *plainchar++;
result |= (fragment & 0x0f0) >> 4;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x00f) << 2;
case step_C:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_C;
return codechar - code_out;
}
fragment = *plainchar++;
result |= (fragment & 0x0c0) >> 6;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x03f) >> 0;
*codechar++ = base64_encode_value(result);
++(state_in->stepcount);
/* Needed to modify this library to not insert newlines every 72
* characters.
*/
// if (state_in->stepcount == CHARS_PER_LINE/4)
// {
// *codechar++ = '\n';
// state_in->stepcount = 0;
// }
}
}
/* control should not reach here */
return codechar - code_out;
}
int base64_encode_blockend(char* code_out, base64_encodestate* state_in)
{
char* codechar = code_out;
switch (state_in->step)
{
case step_B:
*codechar++ = base64_encode_value(state_in->result);
*codechar++ = '=';
*codechar++ = '=';
break;
case step_C:
*codechar++ = base64_encode_value(state_in->result);
*codechar++ = '=';
break;
case step_A:
break;
}
*codechar++ = '\n';
return codechar - code_out;
}
|
#include <stdio.h>
#include "lame.h"
int main(int argc, char **argv) {
printf("get_lame_version(): %s\n", get_lame_version());
return 0;
}
|
/*--------------------------------------------------------------------
(C) Copyright 2006-2012 Barcelona Supercomputing Center
Centro Nacional de Supercomputacion
This file is part of Mercurium C/C++ source-to-source compiler.
See AUTHORS file in the top level directory for information
regarding developers and contributors.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
Mercurium C/C++ source-to-source compiler 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 Mercurium C/C++ source-to-source compiler; if
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
--------------------------------------------------------------------*/
#ifndef MCXX_REFCOUNT_H
#define MCXX_REFCOUNT_H
#include <stdlib.h>
#include <stddef.h>
typedef
enum _mcxx_ref_colour_tag
{
_MCXX_BLACK = 0, // In use or free
_MCXX_GRAY = 1, // Possible member of cycle
_MCXX_WHITE = 2, // Member of garbage cycle
_MCXX_PURPLE = 3, // Possible root of cycle
} _mcxx_ref_colour_t;
typedef void (*_mcxx_children_fun)(void *, void (*)(void*));
// We can keep up to 536,870,912 (2^29) references per object which should be enough
// for almost every application. This way MCXX_REFCOUNT_OBJECT payload is just 8 bytes
// in 32-bit and 12 in 64-bit
#define MCXX_REFCOUNT_OBJECT \
_mcxx_children_fun _mcxx_children; \
int _mcxx_refcount:29; \
char _mcxx_buffered:1; \
_mcxx_ref_colour_t _mcxx_colour:2 \
typedef
struct _mcxx_base_refcount_tag
{
MCXX_REFCOUNT_OBJECT;
} *_p_mcxx_base_refcount_t, _mcxx_base_refcount_t;
#define LIBUTILS_EXTERN
LIBUTILS_EXTERN void *_mcxx_calloc(size_t nmemb, size_t size);
LIBUTILS_EXTERN void _mcxx_increment(void *p);
LIBUTILS_EXTERN void _mcxx_decrement(void *p);
LIBUTILS_EXTERN void _mcxx_collectcycles(void);
LIBUTILS_EXTERN _mcxx_children_fun *_mcxx_children(void *p);
#define MCXX_CHILDREN(x) (*_mcxx_children(x))
#define MCXX_REF(x) ({ _mcxx_increment(x); x; })
#define MCXX_UNREF(x) _mcxx_decrement(x)
#define MCXX_NEW(_type_name) \
({ void* p = _mcxx_calloc(1, sizeof(_type_name)); \
((_p_mcxx_base_refcount_t)p)->_mcxx_children = _type_name##_children; \
_mcxx_increment(p); \
(_type_name*)p; })
// Sets 'x' to point 'y'
#define MCXX_UPDATE_TO(x, y) \
do { \
if ((x) != NULL) \
{ \
MCXX_UNREF(x); \
} \
(x) = MCXX_REF(y); \
} while (0)
// Fixed arrays
typedef
struct mcxx_refcount_array_tag
{
MCXX_REFCOUNT_OBJECT;
unsigned int num_items;
void *data[];
} mcxx_refcount_array_t;
void mcxx_refcount_array_t_children(void*, void(*)(void*));
#define MCXX_NEW_VEC(_type_name, _num_items) \
({ mcxx_refcount_array_t* p = calloc(1, sizeof(mcxx_refcount_array_t) + (_num_items * sizeof(void*))); \
((_p_mcxx_base_refcount_t)p)->_mcxx_children = mcxx_refcount_array_t_children; \
_mcxx_increment(p); \
fprintf(stderr, "NEW -> %p\n", p); \
p->num_items = _num_items; \
int _; \
for (_ = 0; _ < p->num_items; _++) \
{ p->data[_] = MCXX_NEW(_type_name); } \
(_type_name**)(p->data); })
#define MCXX_UNREF_VEC(x) \
({ void * p = ((char*)x) - offsetof(mcxx_refcount_array_t, data); \
fprintf(stderr, "DELETE -> %p\n", p); \
MCXX_UNREF(p); })
#endif // MCXX_REFCOUNT_H
|
/*
Copyright (C) 2000-2012 Novell, Inc
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) version 3.0 of the License. This library
is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details. You should have received a copy of the GNU
Lesser General Public License along with this library; if not, write
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor, Boston, MA 02110-1301 USA
*/
/*-/
File: NCPopupTextEntry.h
Author: Michael Andres <ma@suse.de>
/-*/
#ifndef NCPopupTextEntry_h
#define NCPopupTextEntry_h
#include <iosfwd>
#include "NCPopup.h"
#include "NCInputField.h"
class NCPopupTextEntry : public NCPopup
{
private:
NCPopupTextEntry & operator=( const NCPopupTextEntry & );
NCPopupTextEntry( const NCPopupTextEntry & );
NCInputField * wtext;
virtual bool postAgain();
public:
NCPopupTextEntry( const wpos at,
const std::string & label,
const std::string & text,
unsigned maxInput = 0,
unsigned maxFld = 0,
NCInputField::FTYPE t = NCInputField::PLAIN );
virtual ~NCPopupTextEntry();
void setValue( const std::string & ntext ) { wtext->setValue( ntext ); }
std::string value() { return wtext->value(); }
};
#endif // NCPopupTextEntry_h
|
#ifndef ENINIT_H
#define ENINIT_H
#include <platform_types.h>
#ifdef __cplusplus
extern "C" {
#endif
/// @addtogroup Initialisation
/// @{
/** Initialises the MapCore library.
This function should be called once prior to calling any other MapCore function.
This function <b>must not</b> be called when unloading or reloading maps.
@return TRUE if initialisation was successful. */
extern MAPCORE_API BOOL8 engine_init(void);
/** Shuts down the MapCore library. */
extern MAPCORE_API void engine_shutdown(void);
/// @}
#ifdef __cplusplus
}
#endif
#endif
|
#pragma once
#include "CScanner.h"
#include "CToken.h"
class CLexer
{
public:
CLexer();
~CLexer();
void SetCharacters(CCharacter* pCharacter, int nCharacters);
CToken* GetTokens();
int GetTokenCount();
unsigned int ProcessCharacters();
private:
unsigned int ConstructToken(int& index);
char* GetTokenType(char* tokenString);
CCharacter* m_pCharacter;
CToken* m_pToken;
int m_nTokens;
int m_nCharacters;
};
|
#include "geogrid_index.h"
#include "geogrid_tiles.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const int GEO_DEBUG=1;
void print_usage(FILE* f,const char* name) {
fprintf(f,"Usage: %s [OPTIONS]\n",name);
fprintf(f,"\n");
fprintf(f,"Converts geotiff file `FileName' into geogrid binary format\n");
fprintf(f,"into the current directory.\n");
fprintf(f,"\n");
fprintf(f,"Options:\n");
fprintf(f,"-h : Show this help message and exit\n");
fprintf(f,"-c NUM : Indicates categorical data (NUM = number of categories)\n");
fprintf(f,"-b NUM : Tile border width (default 3)\n");
fprintf(f,"-w [1,2,4] : Word size in output in bytes (default 2)\n");
fprintf(f,"-z : Indicates unsigned data (default FALSE)\n");
fprintf(f,"-t NUM : Output tile size (default 100)\n");
fprintf(f,"-s SCALE : Scale factor in output (default 1.)\n");
fprintf(f,"-m MISSING : Missing value in output (default 0., ignored for categorical data)\n");
fprintf(f,"-u UNITS : Units of the data (default \"NO UNITS\")\n");
fprintf(f,"-d DESC : Description of data set (default \"NO DESCRIPTION\")\n");
}
int main (int argc, char * argv[]) {
int c;
int categorical_range,border_width,word_size,isigned,tile_size;
float scale,missing,missing0;
GeogridIndex idx;
char units[STRING_LENGTH],description[STRING_LENGTH];
float *buffer;
int i,j,ix,iy;
unsigned char v;
/* set up defaults */
border_width=3;
word_size=2;
isigned=1;
scale=1.;
strcpy(units,"\"NO UNITS\"");
strcpy(description,"\"NO DESCRIPTION\"");
categorical_range=0;
tile_size=100;
missing0=0.;
/* parse options */
while ( (c = getopt(argc, argv, "hzs:c:b:w:t:m:u:d:") ) != -1) {
switch (c) {
case 'c':
if(sscanf(optarg,"%i",&categorical_range) != 1 ||
categorical_range <= 0)
{
fprintf(stderr,"Invalid argument to -c.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
break;
case 'b':
if(sscanf(optarg,"%i",&border_width) != 1 ||
border_width < 0)
{
fprintf(stderr,"Invalid argument to -b.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
break;
case 'w':
if(sscanf(optarg,"%i",&word_size) != 1 ||
word_size != 1 && word_size != 2 && word_size != 3 && word_size != 4)
{
fprintf(stderr,"Invalid argument to -w.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
break;
case 'z':
isigned=0;
break;
case 't':
if(sscanf(optarg,"%i",&tile_size) != 1 ||
tile_size <= 0)
{
fprintf(stderr,"Invalid argument to -t.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
break;
case 's':
if(sscanf(optarg,"%f",&scale) != 1 ||
scale != 0.)
{
fprintf(stderr,"Invalid argument to -s.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
break;
case 'm':
if(sscanf(optarg,"%f",&missing) != 1)
{
fprintf(stderr,"Invalid argument to -m.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
break;
case 'u':
sprintf(units,"\"%s\"",optarg);
break;
case 'd':
sprintf(description,"\"%s\"",optarg);
break;
case 'h':
print_usage(stdout,argv[0]);
exit(EXIT_SUCCESS);
break;
default:
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
}
if(optind != argc) {
fprintf(stderr,"No positional arguments used.\n");
print_usage(stderr,argv[0]);
exit(EXIT_FAILURE);
}
idx.nx=128;
idx.ny=256;
idx.nz=1;
/* set index options given from command line */
strcpy(idx.description,description);
strcpy(idx.units,units);
idx.missing=missing;
if(categorical_range) {
idx.categorical=1;
idx.cat_max=categorical_range;
idx.cat_min=1;
idx.missing=0.;
}
else {
idx.categorical=0;
}
idx.tile_bdr=border_width;
idx.wordsize=word_size;
idx.isigned=isigned;
idx.tx=tile_size;
idx.ty=tile_size;
idx.scalefactor=scale;
/* check if the data set is too large for geogrid format */
if (idx.nx > 99999 - idx.tx || idx.ny > 99999 - idx.ty) {
fprintf(stderr,"The data set is too large for geogrid format!\n");
exit(EXIT_FAILURE);
}
/* write index file to disk */
write_index_file("index",idx);
buffer=NULL;
convert_from_f(idx,buffer);
free((void*)buffer);
}
|
//
// LocationDtoInfo.h
// TestAFNetWorking
//
// Created by Linh.Nguyen on 8/30/14.
// Copyright (c) 2014 CSC. All rights reserved.
//
#import <Foundation/Foundation.h>
/*
"address": "ỉ : 117/128/7 nguyá»…n hữu cảnh , p22 ,quáºn bình Thạnh",
"lat": 43.1938516,
"lng": -71.5723953
*/
@interface LocationDtoInfo : NSObject
@property (nonatomic, copy)NSString* address;
@property (nonatomic, assign)double lat;
@property (nonatomic, assign)double lng;
+ (LocationDtoInfo*)setDictInfo:(NSDictionary*)info;
@end
|
/*
* Copyright (C) 2016-2017 Authors of Cilium
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <node_config.h>
#include <netdev_config.h>
#include <bpf/api.h>
#include <stdint.h>
#include <stdio.h>
#include "lib/utils.h"
#include "lib/common.h"
#include "lib/maps.h"
#include "lib/ipv6.h"
#include "lib/eth.h"
#include "lib/dbg.h"
#include "lib/l3.h"
#include "lib/geneve.h"
#include "lib/drop.h"
#include "lib/policy.h"
static inline int handle_ipv6(struct __sk_buff *skb)
{
void *data_end = (void *) (long) skb->data_end;
void *data = (void *) (long) skb->data;
struct ipv6hdr *ip6 = data + ETH_HLEN;
struct bpf_tunnel_key key = {};
struct endpoint_info *ep;
int l4_off, l3_off = ETH_HLEN;
if (data + sizeof(*ip6) + l3_off > data_end)
return DROP_INVALID;
if (unlikely(skb_get_tunnel_key(skb, &key, sizeof(key), 0) < 0))
return DROP_NO_TUNNEL_KEY;
cilium_trace(skb, DBG_DECAP, key.tunnel_id, key.tunnel_label);
#ifdef ENCAP_GENEVE
if (1) {
uint8_t buf[MAX_GENEVE_OPT_LEN] = {};
struct geneveopt_val geneveopt_val = {};
int ret;
if (unlikely(skb_get_tunnel_opt(skb, buf, sizeof(buf)) < 0))
return DROP_NO_TUNNEL_OPT;
ret = parse_geneve_options(&geneveopt_val, buf);
if (IS_ERR(ret))
return ret;
}
#endif
/* Lookup IPv6 address in list of local endpoints */
if ((ep = lookup_ip6_endpoint(ip6)) != NULL) {
/* Let through packets to the node-ip so they are
* processed by the local ip stack */
if (ep->flags & ENDPOINT_F_HOST)
goto to_host;
__u8 nexthdr = ip6->nexthdr;
l4_off = l3_off + ipv6_hdrlen(skb, l3_off, &nexthdr);
return ipv6_local_delivery(skb, l3_off, l4_off, key.tunnel_id, ip6, nexthdr, ep);
} else {
return DROP_NON_LOCAL;
}
to_host:
#ifdef HOST_IFINDEX
if (1) {
union macaddr host_mac = HOST_IFINDEX_MAC;
union macaddr router_mac = NODE_MAC;
int ret;
cilium_trace(skb, DBG_TO_HOST, is_policy_skip(skb), 0);
ret = ipv6_l3(skb, ETH_HLEN, (__u8 *) &router_mac.addr, (__u8 *) &host_mac.addr);
if (ret != TC_ACT_OK)
return ret;
cilium_trace_capture(skb, DBG_CAPTURE_DELIVERY, HOST_IFINDEX);
return redirect(HOST_IFINDEX, 0);
}
#else
return TC_ACT_OK;
#endif
}
#ifdef ENABLE_IPV4
static inline int handle_ipv4(struct __sk_buff *skb)
{
void *data_end = (void *) (long) skb->data_end;
void *data = (void *) (long) skb->data;
struct iphdr *ip4 = data + ETH_HLEN;
struct endpoint_info *ep;
struct bpf_tunnel_key key = {};
int l4_off;
if (data + sizeof(*ip4) + ETH_HLEN > data_end)
return DROP_INVALID;
if (unlikely(skb_get_tunnel_key(skb, &key, sizeof(key), 0) < 0))
return DROP_NO_TUNNEL_KEY;
l4_off = ETH_HLEN + ipv4_hdrlen(ip4);
/* Lookup IPv4 address in list of local endpoints */
if ((ep = lookup_ip4_endpoint(ip4)) != NULL) {
/* Let through packets to the node-ip so they are
* processed by the local ip stack */
if (ep->flags & ENDPOINT_F_HOST)
goto to_host;
return ipv4_local_delivery(skb, ETH_HLEN, l4_off, key.tunnel_id, ip4, ep);
} else {
return DROP_NON_LOCAL;
}
to_host:
#ifdef HOST_IFINDEX
if (1) {
union macaddr host_mac = HOST_IFINDEX_MAC;
union macaddr router_mac = NODE_MAC;
int ret;
cilium_trace(skb, DBG_TO_HOST, is_policy_skip(skb), 0);
ret = ipv4_l3(skb, ETH_HLEN, (__u8 *) &router_mac.addr, (__u8 *) &host_mac.addr, ip4);
if (ret != TC_ACT_OK)
return ret;
cilium_trace_capture(skb, DBG_CAPTURE_DELIVERY, HOST_IFINDEX);
return redirect(HOST_IFINDEX, 0);
}
#else
return TC_ACT_OK;
#endif
}
__section_tail(CILIUM_MAP_CALLS, CILIUM_CALL_IPV4) int tail_handle_ipv4(struct __sk_buff *skb)
{
int ret = handle_ipv4(skb);
if (IS_ERR(ret))
return send_drop_notify_error(skb, ret, TC_ACT_SHOT);
return ret;
}
#endif
__section("from-overlay")
int from_overlay(struct __sk_buff *skb)
{
int ret;
bpf_clear_cb(skb);
cilium_trace_capture(skb, DBG_CAPTURE_FROM_OVERLAY, skb->ingress_ifindex);
switch (skb->protocol) {
case bpf_htons(ETH_P_IPV6):
/* This is considered the fast path, no tail call */
ret = handle_ipv6(skb);
break;
case bpf_htons(ETH_P_IP):
#ifdef ENABLE_IPV4
ep_tail_call(skb, CILIUM_CALL_IPV4);
ret = DROP_MISSED_TAIL_CALL;
#else
ret = DROP_UNKNOWN_L3;
#endif
break;
default:
/* Pass unknown traffic to the stack */
ret = TC_ACT_OK;
}
if (IS_ERR(ret))
return send_drop_notify_error(skb, ret, TC_ACT_SHOT);
else
return ret;
}
struct bpf_elf_map __section_maps POLICY_MAP = {
.type = BPF_MAP_TYPE_HASH,
.size_key = sizeof(__u32),
.size_value = sizeof(struct policy_entry),
.pinning = PIN_GLOBAL_NS,
.max_elem = 1024,
};
__section_tail(CILIUM_MAP_RES_POLICY, SECLABEL) int handle_policy(struct __sk_buff *skb)
{
__u32 src_label = skb->cb[CB_SRC_LABEL];
int ifindex = skb->cb[CB_IFINDEX];
if (policy_can_access(&POLICY_MAP, skb, src_label, 0, NULL) != TC_ACT_OK) {
return send_drop_notify(skb, src_label, SECLABEL, 0,
ifindex, TC_ACT_SHOT);
} else {
cilium_trace_capture(skb, DBG_CAPTURE_DELIVERY, ifindex);
/* ifindex 0 indicates passing down to the stack */
if (ifindex == 0)
return TC_ACT_OK;
else
return redirect(ifindex, 0);
}
}
BPF_LICENSE("GPL");
|
#ifndef WORLD_H
#define WORLD_H
#include <string>
#include <vector>
#include "vec.h"
class World
{
public:
World(const std::string& filename);
virtual ~World();
void LoadFromFile(const std::string& filename);
virtual void Draw();
public:
enum ShapeType {SPHERE, GROUND, CUBE, CYLINDER};
class Shape
{
public:
vec3 pos;
ShapeType GetType() const { return type; }
protected:
Shape(ShapeType t) : type(t), pos(0,0,0) {}
ShapeType type;
};
class Ground : public Shape
{
public:
Ground() : Shape(GROUND) {}
};
class Sphere : public Shape
{
public:
Sphere() : Shape(SPHERE), r(1.0) {}
double r;
};
class Cube : public Shape
{
public:
Cube() : Shape(CUBE), hx(0.5), hy(0.5), hz(0.5) {}
double hx, hy, hz;
};
class Cylinder : public Shape
{
public:
Cylinder() : Shape(CYLINDER), r(1.0) {}
vec3 start, end;
double r;
};
std::vector<Shape*> m_shapes;
};
#endif
|
//
// ETAppDelegate.h
// EasyTimelineExample
//
// Created by Mohammed Islam on 2/26/14.
// Copyright (c) 2014 KSI Technology. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ETAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* Copyright 2011 Red Hat, Inc.
*
* 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.
*/
/* Stub implementation of module loading for MIT krb5 bundled libverto. */
#include <string.h>
int
module_symbol_is_present(const char *modname, const char *symbname)
{
return 0;
}
int
module_get_filename_for_symbol(void *addr, char **filename)
{
return 0;
}
void
module_close(void *dll)
{
}
char *
module_load(const char *filename, const char *symbname,
int (*shouldload)(void *symb, void *misc, char **err), void *misc,
void **dll, void **symb)
{
if (dll)
*dll = NULL;
if (symb)
*symb = NULL;
return strdup("module loading disabled");
}
|
/***************************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the License); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* Copyright 1999-2007 Rogue Wave Software, Inc.
*
**************************************************************************/
template <class T>
struct S
{
T foo (T t) const { return t; }
T bar (T);
};
template <class T>
T foo (S<T>, T);
template <class T>
T bar (S<T>, T);
|
#if !defined(AFX_VIDEOSETDLG_H__664275CD_D25D_4617_BDF9_55BBFFF58C78__INCLUDED_)
#define AFX_VIDEOSETDLG_H__664275CD_D25D_4617_BDF9_55BBFFF58C78__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// VideoSetDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// VideoSetDlg dialog
class VideoSetDlg : public CDialog
{
// Construction
public:
void initDlg();
void refreshDevice();
VideoSetDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(VideoSetDlg)
enum { IDD = IDD_DIALOG_VIDEOSET };
CComboBox m_playDevice;
CComboBox m_videoDevice;
CComboBox m_resolution;
CComboBox m_quality;
CComboBox m_preparam;
CComboBox m_frameRate;
CComboBox m_bitRate;
CComboBox m_audioMode;
CComboBox m_audioDevice;
BOOL m_enableAGC;
BOOL m_enableEcho;
BOOL m_enableNS;
BOOL m_enableVAD;
BOOL m_serverPriority;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(VideoSetDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(VideoSetDlg)
afx_msg void OnCheckAGC();
afx_msg void OnCheckEcho();
afx_msg void OnCheckNS();
afx_msg void OnCheckVAD();
afx_msg void OnCheckServerPriority();
afx_msg void OnSelAudioDevice();
afx_msg void OnSelAudioMode();
afx_msg void OnSelBitRate();
afx_msg void OnSelFrameRate();
afx_msg void OnSelPreParam();
afx_msg void OnSelVideoQuality();
afx_msg void OnSelResolution();
afx_msg void OnSelVideodevice();
virtual BOOL OnInitDialog();
afx_msg void OnSelPlayDevice();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VIDEOSETDLG_H__664275CD_D25D_4617_BDF9_55BBFFF58C78__INCLUDED_)
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/storagegateway/StorageGateway_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/storagegateway/model/FileSystemAssociationInfo.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace StorageGateway
{
namespace Model
{
class AWS_STORAGEGATEWAY_API DescribeFileSystemAssociationsResult
{
public:
DescribeFileSystemAssociationsResult();
DescribeFileSystemAssociationsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
DescribeFileSystemAssociationsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline const Aws::Vector<FileSystemAssociationInfo>& GetFileSystemAssociationInfoList() const{ return m_fileSystemAssociationInfoList; }
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline void SetFileSystemAssociationInfoList(const Aws::Vector<FileSystemAssociationInfo>& value) { m_fileSystemAssociationInfoList = value; }
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline void SetFileSystemAssociationInfoList(Aws::Vector<FileSystemAssociationInfo>&& value) { m_fileSystemAssociationInfoList = std::move(value); }
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline DescribeFileSystemAssociationsResult& WithFileSystemAssociationInfoList(const Aws::Vector<FileSystemAssociationInfo>& value) { SetFileSystemAssociationInfoList(value); return *this;}
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline DescribeFileSystemAssociationsResult& WithFileSystemAssociationInfoList(Aws::Vector<FileSystemAssociationInfo>&& value) { SetFileSystemAssociationInfoList(std::move(value)); return *this;}
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline DescribeFileSystemAssociationsResult& AddFileSystemAssociationInfoList(const FileSystemAssociationInfo& value) { m_fileSystemAssociationInfoList.push_back(value); return *this; }
/**
* <p>An array containing the <code>FileSystemAssociationInfo</code> data type of
* each file system association to be described. </p>
*/
inline DescribeFileSystemAssociationsResult& AddFileSystemAssociationInfoList(FileSystemAssociationInfo&& value) { m_fileSystemAssociationInfoList.push_back(std::move(value)); return *this; }
private:
Aws::Vector<FileSystemAssociationInfo> m_fileSystemAssociationInfoList;
};
} // namespace Model
} // namespace StorageGateway
} // namespace Aws
|
static char* test_sym_structure()
{
//A matrix data
QDLDL_int Ap[] = {0, 2, 4};
QDLDL_int Ai[] = {0, 1, 0, 1};
QDLDL_float Ax[] = {5.0,1.0,1.0,5.0};
QDLDL_int An = 2;
// RHS for Ax = b
QDLDL_float b[] = {1,1};
//x replaces b during solve
int status = ldl_factor_solve(An,Ap,Ai,Ax,b);
mu_assert("Fully symmetric input not detected", status < 0);
return 0;
}
|
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// 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.
#import <Foundation/Foundation.h>
@class ADTokenCacheItem;
@class ADAuthenticationError;
typedef enum
{
/*! Everything went ok. The result object can be used directly. */
AD_SUCCEEDED,
/*! User cancelled the action to supply credentials. */
AD_USER_CANCELLED,
/*! Some error occurred. See the "error" field for details.*/
AD_FAILED,
} ADAuthenticationResultStatus;
/*!
Represent the authentication result pass to the asynchronous handlers of any operation.
*/
@interface ADAuthenticationResult : NSObject
{
@protected
//See the corresponding properties for details.
ADTokenCacheItem* _tokenCacheItem;
ADAuthenticationResultStatus _status;
ADAuthenticationError* _error;
NSUUID* _correlationId;
BOOL _multiResourceRefreshToken;
BOOL _extendedLifeTimeToken;
}
/*! See the ADAuthenticationResultStatus details */
@property (readonly) ADAuthenticationResultStatus status;
/*! A valid access token, if the results indicates success. The property is
calculated from the tokenCacheItem one. The property is nil, in
case of error.*/
@property (readonly) NSString* accessToken;
@property (readonly) ADTokenCacheItem* tokenCacheItem;
/*! The error that occurred or nil, if the operation was successful */
@property (readonly) ADAuthenticationError* error;
/*! Set to YES, if part of the result contains a refresh token, which is a multi-resource
refresh token. */
@property (readonly) BOOL multiResourceRefreshToken;
/*! The correlation ID of the request(s) that get this result. */
@property (readonly) NSUUID* correlationId;
/*! Some access tokens have extended lifetime when server is in an unavailable state.
This property indicates whether the access token is returned in such a state. */
@property (readonly) BOOL extendedLifeTimeToken;
@end
|
#pragma once
#include <Configuration/provider.h>
#include <Graphics/vulkan_debugger.h>
#include <Graphics/vulkan_device.h>
#include <Graphics/vulkan_instance.h>
#include <Graphics/vulkan_gpu.h>
#include <Graphics/vulkan_window.h>
#include <Graphics/vulkan_render_pass.h>
#include <Graphics/uniform_buffer.h>
#include <Input/handler.h>
namespace Phyre {
namespace Graphics {
class DrawCube : public Input::Handler {
public:
//---------------------- Type Definitions -------------------------
typedef Handler BaseClass;
//---------------------- Construction/Destruction -----------------
static std::shared_ptr<DrawCube> Create(int argc, const char* argv[]);
~DrawCube();
//---------------------- Base Class Overrides ---------------------
void OnFramebufferResize(int width, int height) override;
void OnMousePositionUpdate(double x, double y) override;
void OnKeyRelease(Input::Key key, int mods) override;
void OnMousePress(Input::Mouse mouse_button, int mods) override;
//---------------------- Interface --------------------------------
// Run the game loop
bool Run() const;
// Render a frame
void Draw();
// Repare to render a frame
void BeginRender() const;
// Signals that we have finished rendering a frame
void EndRender();
// Gracefully clean up the application by waiting for
// all the rendering operations to finish
void Stop() const;
// Records the FPS
static void LogFPS();
// Get the input window
Input::Window* input_window() const { return p_vk_window_->window(); }
private:
// TODO This could be refactored into some factory pattern such that we can
// only create shared_ptrs from this class.
DrawCube(int argc, const char* argv[]);
struct VertexBuffer {
vk::Buffer buffer;
vk::DeviceMemory memory;
};
// ------------------- Type Definitions ---------------------
typedef std::vector<vk::CommandBuffer> CommandBuffers;
// ------------------- Render System Stages -----------------
// This will only be enabled in debug mode and when the debug layers are active
void StartDebugger();
void LoadGPUs();
void LoadWindow(float width, float height, const std::string& title);
void LoadDevice();
void LoadCommandPool();
void LoadCommandBuffers();
void ExecuteBeginCommandBuffer(size_t command_buffer_index);
void LoadSwapchain();
void LoadShaderModules();
void LoadVertexBuffer();
void LoadUniformBuffer();
void UpdateUniformBuffers() const;
void LoadRenderPass();
void LoadFrameBuffers();
void LoadDescriptorPool();
void LoadDescriptorSets();
void LoadPipelineCache();
void LoadPipelineLayout();
void LoadPipeline();
void LoadSemaphores();
// Loads all of the previous steps
void LoadGraphics();
// ------------------- Cleanup Stages ----------------------
void DestroyShaderModules();
void DestroyVertexBuffer() const;
void DestroyFramebuffers();
// ------------------- Event-Driven Stages ------------------
void ReloadSwapchain();
// ---------------------- Data Types ------------------------
VulkanInstance instance_;
VulkanDebugger debugger_;
std::vector<VulkanGPU> gpus_;
// Points to one of the GPUs in the GPU vector, so its lifetime depends on the GPU vector
VulkanGPU* p_active_gpu_;
// Points to a window where we present our rendered data to
std::shared_ptr<VulkanWindow> p_vk_window_;
// Points to a logical device which can be used to access queues to which we submit command buffers
VulkanDevice* p_device_;
// The command pools from which we may allocate command buffers from
vk::CommandPool command_pool_;
// A single command buffer to which we may send commands to
CommandBuffers command_buffers_;
// A swapchain which helps manage image buffers
std::unique_ptr<VulkanSwapchain> p_swapchain_;
// The shaders which end up getting plugged into the pipeline
std::array<vk::PipelineShaderStageCreateInfo, 2> shader_stages_;
// The uniform buffer
std::unique_ptr<UniformBuffer> p_uniform_buffer_;
// The vertex buffer which we will be binding
VertexBuffer vertex_buffer_;
vk::VertexInputBindingDescription vertex_input_binding_description_;
std::array<vk::VertexInputAttributeDescription, 2> vertex_input_attributes_;
// The render pass used in the graphics pipeline
std::unique_ptr<VulkanRenderPass> p_render_pass_;
// Memory attachments used by the render pass instance such as the color image buffer
// and the depth image buffer.
// In other words, the framebuffers connect these resources to the render pass
std::vector<vk::Framebuffer> framebuffers_;
// Descriptors allow the shaders to access the image and buffer resources
vk::DescriptorPool descriptor_pool_;
// Describes the content of a list of descriptor sets
// Informs the GPU how the data contained in the uniform buffer
// is mapped to the shader program's uniform variables
vk::DescriptorSetLayout descriptor_set_layout_;
// This is what we attach to the pipeline
std::vector<vk::DescriptorSet> descriptor_sets_;
// This object is referenced so that the pipeline does not get
// recreated from scratch all the time
vk::PipelineCache pipeline_cache_;
// The graphics pipeline and its layout
vk::PipelineLayout pipeline_layout_;
vk::Pipeline pipeline_;
// Signals when the command buffers have finished executing
vk::Semaphore render_finished_semaphore_;
// The configuration provider for loading resources
std::unique_ptr<Configuration::Provider> p_provider_;
// The the name of this application
std::string target_;
// ---------------------- Logging ---------------------------
static const std::string kWho;
};
}
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/iotwireless/IoTWireless_EXPORTS.h>
#include <aws/iotwireless/model/LogLevel.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/iotwireless/model/WirelessGatewayLogOption.h>
#include <aws/iotwireless/model/WirelessDeviceLogOption.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace IoTWireless
{
namespace Model
{
class AWS_IOTWIRELESS_API GetLogLevelsByResourceTypesResult
{
public:
GetLogLevelsByResourceTypesResult();
GetLogLevelsByResourceTypesResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetLogLevelsByResourceTypesResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
inline const LogLevel& GetDefaultLogLevel() const{ return m_defaultLogLevel; }
inline void SetDefaultLogLevel(const LogLevel& value) { m_defaultLogLevel = value; }
inline void SetDefaultLogLevel(LogLevel&& value) { m_defaultLogLevel = std::move(value); }
inline GetLogLevelsByResourceTypesResult& WithDefaultLogLevel(const LogLevel& value) { SetDefaultLogLevel(value); return *this;}
inline GetLogLevelsByResourceTypesResult& WithDefaultLogLevel(LogLevel&& value) { SetDefaultLogLevel(std::move(value)); return *this;}
inline const Aws::Vector<WirelessGatewayLogOption>& GetWirelessGatewayLogOptions() const{ return m_wirelessGatewayLogOptions; }
inline void SetWirelessGatewayLogOptions(const Aws::Vector<WirelessGatewayLogOption>& value) { m_wirelessGatewayLogOptions = value; }
inline void SetWirelessGatewayLogOptions(Aws::Vector<WirelessGatewayLogOption>&& value) { m_wirelessGatewayLogOptions = std::move(value); }
inline GetLogLevelsByResourceTypesResult& WithWirelessGatewayLogOptions(const Aws::Vector<WirelessGatewayLogOption>& value) { SetWirelessGatewayLogOptions(value); return *this;}
inline GetLogLevelsByResourceTypesResult& WithWirelessGatewayLogOptions(Aws::Vector<WirelessGatewayLogOption>&& value) { SetWirelessGatewayLogOptions(std::move(value)); return *this;}
inline GetLogLevelsByResourceTypesResult& AddWirelessGatewayLogOptions(const WirelessGatewayLogOption& value) { m_wirelessGatewayLogOptions.push_back(value); return *this; }
inline GetLogLevelsByResourceTypesResult& AddWirelessGatewayLogOptions(WirelessGatewayLogOption&& value) { m_wirelessGatewayLogOptions.push_back(std::move(value)); return *this; }
inline const Aws::Vector<WirelessDeviceLogOption>& GetWirelessDeviceLogOptions() const{ return m_wirelessDeviceLogOptions; }
inline void SetWirelessDeviceLogOptions(const Aws::Vector<WirelessDeviceLogOption>& value) { m_wirelessDeviceLogOptions = value; }
inline void SetWirelessDeviceLogOptions(Aws::Vector<WirelessDeviceLogOption>&& value) { m_wirelessDeviceLogOptions = std::move(value); }
inline GetLogLevelsByResourceTypesResult& WithWirelessDeviceLogOptions(const Aws::Vector<WirelessDeviceLogOption>& value) { SetWirelessDeviceLogOptions(value); return *this;}
inline GetLogLevelsByResourceTypesResult& WithWirelessDeviceLogOptions(Aws::Vector<WirelessDeviceLogOption>&& value) { SetWirelessDeviceLogOptions(std::move(value)); return *this;}
inline GetLogLevelsByResourceTypesResult& AddWirelessDeviceLogOptions(const WirelessDeviceLogOption& value) { m_wirelessDeviceLogOptions.push_back(value); return *this; }
inline GetLogLevelsByResourceTypesResult& AddWirelessDeviceLogOptions(WirelessDeviceLogOption&& value) { m_wirelessDeviceLogOptions.push_back(std::move(value)); return *this; }
private:
LogLevel m_defaultLogLevel;
Aws::Vector<WirelessGatewayLogOption> m_wirelessGatewayLogOptions;
Aws::Vector<WirelessDeviceLogOption> m_wirelessDeviceLogOptions;
};
} // namespace Model
} // namespace IoTWireless
} // namespace Aws
|
//
// Copyright 2012 jordi domenech <jordi@iamyellow.net>
//
// 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 "TiViewProxy.h"
@interface NetIamyellowTikeyboardlistenerViewProxy : TiViewProxy {
}
@end
|
/*
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <lvgl.h>
#include "lvgl_color.h"
#if CONFIG_LVGL_BITS_PER_PIXEL == 1
static void zephyr_disp_flush(s32_t x1, s32_t y1, s32_t x2, s32_t y2,
const lv_color_t *color_p)
{
u16_t w = x2 - x1 + 1;
u16_t h = y2 - y1 + 1;
struct display_capabilities cap;
struct display_buffer_descriptor desc;
display_get_capabilities(lvgl_display_dev, &cap);
desc.buf_size = (w * h)/8U;
desc.width = w;
desc.pitch = w;
desc.height = h;
display_write(lvgl_display_dev, x1, y1, &desc, (void *) color_p);
if (cap.screen_info & SCREEN_INFO_DOUBLE_BUFFER) {
display_write(lvgl_display_dev, x1, y1, &desc,
(void *) color_p);
}
lv_flush_ready();
}
void zephyr_vdb_write(u8_t *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t color, lv_opa_t opa)
{
u8_t *buf_xy;
u8_t bit;
struct display_capabilities cap;
display_get_capabilities(lvgl_display_dev, &cap);
if (cap.screen_info & SCREEN_INFO_MONO_VTILED) {
buf_xy = buf + x + y/8 * buf_w;
if (cap.screen_info & SCREEN_INFO_MONO_MSB_FIRST) {
bit = 7 - y%8;
} else {
bit = y%8;
}
} else {
buf_xy = buf + x/8 + y * buf_w/8;
if (cap.screen_info & SCREEN_INFO_MONO_MSB_FIRST) {
bit = 7 - x%8;
} else {
bit = x%8;
}
}
if (cap.current_pixel_format == PIXEL_FORMAT_MONO10) {
if (color.full == 0) {
*buf_xy &= ~BIT(bit);
} else {
*buf_xy |= BIT(bit);
}
} else {
if (color.full == 0) {
*buf_xy |= BIT(bit);
} else {
*buf_xy &= ~BIT(bit);
}
}
}
void zephyr_round_area(lv_area_t *a)
{
struct display_capabilities cap;
display_get_capabilities(lvgl_display_dev, &cap);
if (cap.screen_info & SCREEN_INFO_MONO_VTILED) {
a->y1 &= ~0x7;
a->y2 |= 0x7;
} else {
a->x1 &= ~0x7;
a->x2 |= 0x7;
}
}
#else
#error "Unsupported pixel format conversion"
#endif /* CONFIG_LVGL_BITS_PER_PIXEL */
void *get_disp_flush(void)
{
return zephyr_disp_flush;
}
void *get_vdb_write(void)
{
return zephyr_vdb_write;
}
void *get_round_func(void)
{
return zephyr_round_area;
}
|
/*
* Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
*
* 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 _gmxtrajectoryreader_H
#define _gmxtrajectoryreader_H
#ifndef HAVE_NO_CONFIG
#include <votca_config.h>
#endif
#include <string>
#include <votca/csg/trajectoryreader.h>
#include "gmx_version_check.h"
#if GMX == 50
#include <gromacs/fileio/trxio.h>
#elif GMX == 45
#include <gromacs/statutil.h>
#include <gromacs/typedefs.h>
#include <gromacs/smalloc.h>
#include <gromacs/vec.h>
#include <gromacs/copyrite.h>
#include <gromacs/statutil.h>
#include <gromacs/tpxio.h>
#elif GMX == 40
extern "C"
{
#include <statutil.h>
#include <typedefs.h>
#include <smalloc.h>
#include <vec.h>
#include <copyrite.h>
#include <statutil.h>
#include <tpxio.h>
}
#else
#error Unsupported GMX version
#endif
// this one is needed because of bool is defined in one of the headers included by gmx
#undef bool
namespace votca { namespace csg {
using namespace votca::tools;
using namespace std;
/**
\brief class for reading gromacs trajectory files
This class provides the TrajectoryReader interface and encapsulates the trajectory reading function of gromacs
*/
class GMXTrajectoryReader : public TrajectoryReader
{
public:
GMXTrajectoryReader() {
gmx::CheckVersion();
}
/// open a trejectory file
bool Open(const string &file);
/// read in the first frame
bool FirstFrame(Topology &top);
/// read in the next frame
bool NextFrame(Topology &top);
void Close();
private:
string _filename;
// gmx status used in read_first_frame and _read_next_frame;
#if GMX == 50
t_trxstatus* _gmx_status;
#elif GMX == 45
t_trxstatus* _gmx_status;
#elif GMX == 40
int _gmx_status;
#else
#error Unsupported GMX version
#endif
/// gmx frame
t_trxframe _gmx_frame;
};
}}
#endif /* _gmxtrajectoryreader_H */
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2017 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Daniel H. Larkin
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_REST_HANDLER_REST_VIEW_HANDLER_H
#define ARANGOD_REST_HANDLER_REST_VIEW_HANDLER_H 1
#include "Basics/Common.h"
#include "RestHandler/RestVocbaseBaseHandler.h"
namespace arangodb {
////////////////////////////////////////////////////////////////////////////////
/// @brief view request handler
////////////////////////////////////////////////////////////////////////////////
class RestViewHandler : public RestVocbaseBaseHandler {
public:
RestViewHandler(GeneralRequest*, GeneralResponse*);
public:
virtual RestStatus execute() override;
char const* name() const override final { return "RestViewHandler"; }
protected:
void createView();
void modifyView(bool partialUpdate);
void deleteView();
void getViews();
void getSingleView(std::string const&);
void getViewProperties(std::string const&);
void getListOfViews();
};
}
#endif
|
/*
* Copyright 2010-2012 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.
*/
#import "SNSResponse.h"
#import "../AmazonServiceExceptionUnmarshaller.h"
#import "SNSNotFoundException.h"
#import "SNSAuthorizationErrorException.h"
#import "SNSInternalErrorException.h"
#import "SNSInvalidParameterException.h"
/**
* Get Topic Attributes Result
*
* \ingroup SNS
*/
@interface SNSGetTopicAttributesResponse:SNSResponse
{
NSMutableDictionary *attributes;
}
-(void)setException:(AmazonServiceException *)theException;
/**
* Default constructor for a new object. Callers should use the
* property methods to initialize this object after creating it.
*/
-(id)init;
/**
* A map of the topic's attributes. Attributes in this map include the
* following: <ul> <li>TopicArn -- the topic's ARN</li> <li>Owner -- the
* AWS account ID of the topic's owner</li> <li>Policy -- the JSON
* serialization of the topic's access control policy</li>
* <li>DisplayName -- the human-readable name used in the "From" field
* for notifications to email and email-json endpoints</li>
* <li>SubscriptionsPending -- the number of subscriptions pending
* confirmation on this topic</li> <li>SubscriptionsConfirmed -- the
* number of confirmed subscriptions on this topic</li>
* <li>SubscriptionsDeleted -- the number of deleted subscriptions on
* this topic</li> <li>DeliveryPolicy -- the JSON serialization of the
* topic's delivery policy</li> <li>EffectiveDeliveryPolicy -- the JSON
* serialization of the effective delivery policy which takes into
* account system defaults</li> </ul>
*/
@property (nonatomic, retain) NSMutableDictionary *attributes;
/**
* Returns a value from the attributes dictionary for the specified key.
*/
-(NSString *)attributesValueForKey:(NSString *)theKey;
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*/
-(NSString *)description;
@end
|
/**
* \file RMF/internal/SharedData.h
* \brief Handle read/write of Model data from/to files.
*
* Copyright 2007-2022 IMP Inventors. All rights reserved.
*
*/
#ifndef RMF_INTERNAL_IO_H
#define RMF_INTERNAL_IO_H
#include <boost/shared_ptr.hpp>
#include <string>
#include "RMF/BufferConstHandle.h"
#include "RMF/BufferHandle.h"
#include "RMF/config.h"
#include "RMF/infrastructure_macros.h"
#include "RMF/internal/SharedData.h"
namespace RMF {
class BufferConstHandle;
class BufferHandle;
namespace internal {
class SharedData;
} // namespace internal
} // namespace RMF
RMF_ENABLE_WARNINGS
namespace RMF {
namespace backends {
struct IO {
virtual void save_loaded_frame(internal::SharedData *shared_data) = 0;
virtual void load_loaded_frame(internal::SharedData *shared_data) = 0;
virtual void save_static_frame(internal::SharedData *shared_data) = 0;
virtual void load_static_frame(internal::SharedData *shared_data) = 0;
/** @} */
/** \name File
- description
- producer
- format
- version
@{ */
virtual void load_file(internal::SharedData *shared_data) = 0;
virtual void save_file(const internal::SharedData *shared_data) = 0;
/** @} */
/** \name Node Hierarchy
@{ */
virtual void load_hierarchy(internal::SharedData *shared_data) = 0;
virtual void save_hierarchy(const internal::SharedData *shared_data) = 0;
/** @} */
virtual void flush() = 0;
virtual ~IO() {}
};
RMFEXPORT boost::shared_ptr<IO> create_file(const std::string &name);
RMFEXPORT boost::shared_ptr<IO> create_buffer(BufferHandle buffer);
RMFEXPORT boost::shared_ptr<IO> read_file(const std::string &name);
RMFEXPORT boost::shared_ptr<IO> read_buffer(BufferConstHandle buffer);
} // namespace internal
} /* namespace RMF */
RMF_DISABLE_WARNINGS
#endif /* RMF_INTERNAL_IO_H */
|
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_CHECKPOINT_ELIMINATION_H_
#define V8_COMPILER_CHECKPOINT_ELIMINATION_H_
#include "src/compiler/graph-reducer.h"
namespace v8 {
namespace internal {
namespace compiler {
// Performs elimination of redundant checkpoints within the graph.
class CheckpointElimination final : public AdvancedReducer {
public:
explicit CheckpointElimination(Editor* editor);
~CheckpointElimination() final {}
Reduction Reduce(Node* node) final;
private:
Reduction ReduceCheckpoint(Node* node);
Reduction ReduceReturn(Node* node);
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_CHECKPOINT_ELIMINATION_H_
|
////////////////////////////////////////////////////////////////////////////
// Module : data_storage_double_linked_list.h
// Created : 21.03.2002
// Modified : 26.02.2004
// Author : Dmitriy Iassenev
// Description : Double linked list data storage
////////////////////////////////////////////////////////////////////////////
#pragma once
#include "data_storage_single_linked_list.h"
template <bool sorted = false>
struct CDataStorageDoubleLinkedList {
template <template <typename _T> class T1>
struct DoubleLinkedList {
template <typename T2>
struct _vertex : public T1<T2> {
T2* _prev;
IC T2*& prev() { return (_prev); }
};
};
template <typename _data_storage, template <typename _T> class _vertex = CEmptyClassTemplate>
class CDataStorage : public CDataStorageSingleLinkedList<sorted>::CDataStorage<
_data_storage, DoubleLinkedList<_vertex>::_vertex> {
public:
typedef typename CDataStorageSingleLinkedList<sorted>::CDataStorage<
_data_storage, DoubleLinkedList<_vertex>::_vertex>
inherited;
typedef typename inherited::inherited inherited_base;
typedef typename inherited::CGraphVertex CGraphVertex;
typedef typename CGraphVertex::_dist_type _dist_type;
typedef typename CGraphVertex::_index_type _index_type;
protected:
_dist_type m_switch_factor;
public:
IC CDataStorage(const u32 vertex_count,
const _dist_type _max_distance = _dist_type(u32(-1)));
virtual ~CDataStorage();
IC void init();
IC void set_switch_factor(const _dist_type _switch_factor);
IC void add_opened(CGraphVertex& vertex);
IC void decrease_opened(CGraphVertex& vertex, const _dist_type value);
IC void remove_best_opened();
IC CGraphVertex& get_best() const;
};
};
#include "data_storage_double_linked_list_inline.h"
|
/*
Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <UIKit/UIKit.h>
@interface UICollectionViewController (MDCCardReordering) <UIGestureRecognizerDelegate>
/**
This method should be called when using a UICollectionViewController and want to have
the reorder or drag and drop visuals. Please see
https://developer.apple.com/documentation/uikit/uicollectionviewcontroller/1623979-installsstandardgestureforintera
for more information. It will make sure that the underlying longPressGestureRecognizer
doesn't cancel the ink tap visual causing the ink to disappear once the reorder begins.
*/
- (void)mdc_setupCardReordering;
@end
|
//
// 参考文件.h
// UISearchBar自定义效果
//
// Created by huangchengdu on 15/12/9.
// Copyright © 2015年 huangchengdu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ____ : NSObject
@end
|
/*=========================================================================
*
* Copyright RTK Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __rtkRayBoxIntersectionFunction_h
#define __rtkRayBoxIntersectionFunction_h
#include <itkNumericTraits.h>
#include <vector>
#include <itkImageBase.h>
namespace rtk
{
/** \class RayBoxIntersectionFunction
* \brief Compute the intersection between a ray and a box.
*
* The box is defined by two corners and is assumed to be parallel to the
* image coordinate system. The ray origin must be set first. The direction
* of the ray is then passed to the Evaluate function. It returns false if
* there is no intersection. It returns true otherwise and the nearest and
* farthest distance/point may be accessed. Nearest and farthest distance are
* defined such that NearestDistance < FarthestDistance.
*
* The default behavior of the function is to return the intersection between
* the line defined by the origin and direction. You need to modify the
* nearest and farthest distance if you want to account for the position of the
* source and the detector along the ray.
*
* \author Simon Rit
*
* \ingroup Functions
*/
template <
class TCoordRep = double,
unsigned int VBoxDimension=3
>
class ITK_EXPORT RayBoxIntersectionFunction:
public itk::LightObject
{
public:
/** Standard class typedefs. */
typedef RayBoxIntersectionFunction Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef typename itk::ImageBase<VBoxDimension>::ConstPointer ImageBaseConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Useful defines. */
typedef itk::Vector<TCoordRep, VBoxDimension> VectorType;
/** Evaluate the intersection points */
bool Evaluate( const VectorType& input );
/** Set the box information (Min/Max corners) from an itk image.
* \warning this method caches image information.
* If the image information has changed, user must call
* SetBoxFromImage again to update cached values. */
void SetBoxFromImage( ImageBaseConstPointer img );
/** Get / Set the box inferior corner. Every coordinate must be inferior to
* those of the superior corner. */
virtual VectorType GetBoxMin() { return this->m_BoxMin; }
virtual void SetBoxMin(const VectorType _arg) { m_BoxMin = _arg; }
/** Get / Set the box superior corner. Every coordinate must be superior to
* those of the inferior corner. */
virtual VectorType GetBoxMax() { return this->m_BoxMax; }
virtual void SetBoxMax(const VectorType _arg) { m_BoxMax = _arg; }
/** Get / Set the ray origin. */
virtual VectorType GetRayOrigin() { return this->m_RayOrigin; }
virtual void SetRayOrigin(const VectorType _arg) { m_RayOrigin = _arg; }
/** Get the distance with the nearest intersection.
* \warning Only relevant if called after Evaluate. */
virtual TCoordRep GetNearestDistance() { return this->m_NearestDistance; }
virtual void SetNearestDistance(const TCoordRep _arg) { m_NearestDistance = _arg; }
/** Get the distance with the farthest intersection.
* \warning Only relevant if called after Evaluate. */
virtual TCoordRep GetFarthestDistance() { return this->m_FarthestDistance; }
virtual void SetFarthestDistance(const TCoordRep _arg) { m_FarthestDistance = _arg; }
/** Get the nearest point coordinates.
* \warning Only relevant if called after Evaluate. */
virtual VectorType GetNearestPoint()
{
return m_RayOrigin + m_NearestDistance * m_RayDirection;
}
/** Get the farthest point coordinates.
* \warning Only relevant if called after Evaluate. */
virtual VectorType GetFarthestPoint()
{
return m_RayOrigin + m_FarthestDistance * m_RayDirection;
}
protected:
/// Constructor
RayBoxIntersectionFunction();
/// Destructor
~RayBoxIntersectionFunction(){};
/// The focal point or position of the ray source
VectorType m_FocalPoint;
/** Corners of the image box */
VectorType m_BoxMin;
VectorType m_BoxMax;
VectorType m_RayOrigin;
VectorType m_RayDirection;
TCoordRep m_NearestDistance;
TCoordRep m_FarthestDistance;
private:
RayBoxIntersectionFunction( const Self& ); //purposely not implemented
void operator=( const Self& ); //purposely not implemented
};
} // namespace rtk
#ifndef ITK_MANUAL_INSTANTIATION
#include "rtkRayBoxIntersectionFunction.txx"
#endif
#endif
|
/***
* ==++==
*
* Copyright (c) Microsoft Corporation. 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.
*
* ==--==
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* App.xaml.h - Declaration of the App class.
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/
#pragma once
#include "App.g.h"
namespace BlackjackClient
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
ref class App sealed
{
public:
App();
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args) override;
private:
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
};
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/timestream-write/TimestreamWrite_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/timestream-write/model/RejectedRecord.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TimestreamWrite
{
namespace Model
{
/**
* <p> WriteRecords would throw this exception in the following cases: </p> <ul>
* <li> <p> Records with duplicate data where there are multiple records with the
* same dimensions, timestamps, and measure names but different measure values.
* </p> </li> <li> <p> Records with timestamps that lie outside the retention
* duration of the memory store </p> </li> <li> <p> Records with dimensions or
* measures that exceed the Timestream defined limits. </p> </li> </ul> <p> For
* more information, see <a
* href="https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html">Access
* Management</a> in the Timestream Developer Guide. </p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/timestream-write-2018-11-01/RejectedRecordsException">AWS
* API Reference</a></p>
*/
class AWS_TIMESTREAMWRITE_API RejectedRecordsException
{
public:
RejectedRecordsException();
RejectedRecordsException(Aws::Utils::Json::JsonView jsonValue);
RejectedRecordsException& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline RejectedRecordsException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline RejectedRecordsException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline RejectedRecordsException& WithMessage(const char* value) { SetMessage(value); return *this;}
inline const Aws::Vector<RejectedRecord>& GetRejectedRecords() const{ return m_rejectedRecords; }
inline bool RejectedRecordsHasBeenSet() const { return m_rejectedRecordsHasBeenSet; }
inline void SetRejectedRecords(const Aws::Vector<RejectedRecord>& value) { m_rejectedRecordsHasBeenSet = true; m_rejectedRecords = value; }
inline void SetRejectedRecords(Aws::Vector<RejectedRecord>&& value) { m_rejectedRecordsHasBeenSet = true; m_rejectedRecords = std::move(value); }
inline RejectedRecordsException& WithRejectedRecords(const Aws::Vector<RejectedRecord>& value) { SetRejectedRecords(value); return *this;}
inline RejectedRecordsException& WithRejectedRecords(Aws::Vector<RejectedRecord>&& value) { SetRejectedRecords(std::move(value)); return *this;}
inline RejectedRecordsException& AddRejectedRecords(const RejectedRecord& value) { m_rejectedRecordsHasBeenSet = true; m_rejectedRecords.push_back(value); return *this; }
inline RejectedRecordsException& AddRejectedRecords(RejectedRecord&& value) { m_rejectedRecordsHasBeenSet = true; m_rejectedRecords.push_back(std::move(value)); return *this; }
private:
Aws::String m_message;
bool m_messageHasBeenSet;
Aws::Vector<RejectedRecord> m_rejectedRecords;
bool m_rejectedRecordsHasBeenSet;
};
} // namespace Model
} // namespace TimestreamWrite
} // namespace Aws
|
/* $NetBSD: startdaemon.c,v 1.15 2007/05/16 20:45:45 christos Exp $ */
/*
* Copyright (c) 1983, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)startdaemon.c 8.2 (Berkeley) 4/17/94";
#else
__RCSID("$NetBSD: startdaemon.c,v 1.15 2007/05/16 20:45:45 christos Exp $");
#endif
#endif /* not lint */
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <err.h>
#include "lp.h"
#include "pathnames.h"
extern uid_t uid, euid;
/*
* Tell the printer daemon that there are new files in the spool directory.
*/
int
startdaemon(const char *pname)
{
struct sockaddr_un un;
int s;
int n;
char buf[BUFSIZ];
s = socket(AF_LOCAL, SOCK_STREAM, 0);
if (s < 0) {
warn("socket");
return(0);
}
memset(&un, 0, sizeof(un));
un.sun_family = AF_LOCAL;
strncpy(un.sun_path, _PATH_SOCKETNAME, sizeof(un.sun_path) - 1);
#ifndef SUN_LEN
#define SUN_LEN(unp) (strlen((unp)->sun_path) + 2)
#endif
seteuid(euid);
if (connect(s, (const struct sockaddr *)&un,
(int)SUN_LEN(&un)) < 0) {
seteuid(uid);
warn("connect");
(void)close(s);
return(0);
}
seteuid(uid);
n = snprintf(buf, sizeof(buf), "\1%s\n", pname);
if (write(s, buf, n) != n) {
warn("write");
(void)close(s);
return(0);
}
if (read(s, buf, 1) == 1) {
if (buf[0] == '\0') { /* everything is OK */
(void)close(s);
return(1);
}
putchar(buf[0]);
}
while ((n = read(s, buf, sizeof(buf))) > 0)
fwrite(buf, 1, n, stdout);
(void)close(s);
return(0);
}
|
/*
* Copyright (C) 2013 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <mach/hardware.h>
#include <asm/uaccess.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <mach/sci.h>
#include <mach/sci_glb_regs.h>
static ssize_t syssleep_read_proc(struct file *file, char __user *buffer,
size_t count, loff_t *data)
{
return 0;
}
static ssize_t syssleep_write_proc(struct file *file, const char __user *buffer,
size_t count, loff_t *data)
{
sci_glb_write(REG_PMU_APB_PD_CP0_ARM9_0_CFG, BIT(24) | BIT(25), -1UL);
sci_glb_write(REG_PMU_APB_PD_CP0_HU3GE_CFG, BIT(24) | BIT(25), -1UL);
sci_glb_write(REG_PMU_APB_PD_CP0_GSM_CFG, BIT(24) | BIT(25), -1UL);
sci_glb_write(REG_PMU_APB_PD_CP0_L1RAM_CFG, BIT(24) | BIT(25), -1UL);
sci_glb_write(REG_PMU_APB_PD_CP0_SYS_CFG, BIT(25) | BIT(28), -1UL);
//sci_glb_write(REG_PMU_APB_CP_SOFT_RST,0x7,-1UL);
//msleep(1000);
//sci_glb_write(REG_PMU_APB_CP_SOFT_RST,0x6,-1UL);
return count;
}
static const struct file_operations syssleep_proc_fops = {
.owner = THIS_MODULE,
.read = syssleep_read_proc,
.write = syssleep_write_proc,
};
static int __init syssleep_init(void)
{
printk("syssleep_init \n");
proc_create("syssleep", 0777, NULL, &syssleep_proc_fops);
return 0;
}
module_init(syssleep_init);
|
/*
* 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/dms/DatabaseMigrationService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/dms/model/ReplicationTask.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace DatabaseMigrationService
{
namespace Model
{
/**
* <p/><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasksResponse">AWS
* API Reference</a></p>
*/
class AWS_DATABASEMIGRATIONSERVICE_API DescribeReplicationTasksResult
{
public:
DescribeReplicationTasksResult();
DescribeReplicationTasksResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
DescribeReplicationTasksResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline const Aws::String& GetMarker() const{ return m_marker; }
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline void SetMarker(const Aws::String& value) { m_marker = value; }
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline void SetMarker(Aws::String&& value) { m_marker = std::move(value); }
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline void SetMarker(const char* value) { m_marker.assign(value); }
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline DescribeReplicationTasksResult& WithMarker(const Aws::String& value) { SetMarker(value); return *this;}
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline DescribeReplicationTasksResult& WithMarker(Aws::String&& value) { SetMarker(std::move(value)); return *this;}
/**
* <p> An optional pagination token provided by a previous request. If this
* parameter is specified, the response includes only records beyond the marker, up
* to the value specified by <code>MaxRecords</code>. </p>
*/
inline DescribeReplicationTasksResult& WithMarker(const char* value) { SetMarker(value); return *this;}
/**
* <p>A description of the replication tasks.</p>
*/
inline const Aws::Vector<ReplicationTask>& GetReplicationTasks() const{ return m_replicationTasks; }
/**
* <p>A description of the replication tasks.</p>
*/
inline void SetReplicationTasks(const Aws::Vector<ReplicationTask>& value) { m_replicationTasks = value; }
/**
* <p>A description of the replication tasks.</p>
*/
inline void SetReplicationTasks(Aws::Vector<ReplicationTask>&& value) { m_replicationTasks = std::move(value); }
/**
* <p>A description of the replication tasks.</p>
*/
inline DescribeReplicationTasksResult& WithReplicationTasks(const Aws::Vector<ReplicationTask>& value) { SetReplicationTasks(value); return *this;}
/**
* <p>A description of the replication tasks.</p>
*/
inline DescribeReplicationTasksResult& WithReplicationTasks(Aws::Vector<ReplicationTask>&& value) { SetReplicationTasks(std::move(value)); return *this;}
/**
* <p>A description of the replication tasks.</p>
*/
inline DescribeReplicationTasksResult& AddReplicationTasks(const ReplicationTask& value) { m_replicationTasks.push_back(value); return *this; }
/**
* <p>A description of the replication tasks.</p>
*/
inline DescribeReplicationTasksResult& AddReplicationTasks(ReplicationTask&& value) { m_replicationTasks.push_back(std::move(value)); return *this; }
private:
Aws::String m_marker;
Aws::Vector<ReplicationTask> m_replicationTasks;
};
} // namespace Model
} // namespace DatabaseMigrationService
} // namespace Aws
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkVectorIndexSelectionCastImageFilter_h
#define __itkVectorIndexSelectionCastImageFilter_h
#include "itkUnaryFunctorImageFilter.h"
namespace itk
{
namespace Functor
{
template< class TInput, class TOutput >
class VectorIndexSelectionCast
{
public:
VectorIndexSelectionCast() { m_Index = 0; }
~VectorIndexSelectionCast() {}
unsigned int GetIndex() const { return m_Index; }
void SetIndex(unsigned int i) { m_Index = i; }
bool operator!=(const VectorIndexSelectionCast & other) const
{
if ( m_Index != other.m_Index )
{
return true;
}
return false;
}
bool operator==(const VectorIndexSelectionCast & other) const
{
return !( *this != other );
}
inline TOutput operator()(const TInput & A) const
{
return static_cast< TOutput >( A[m_Index] );
}
private:
unsigned int m_Index;
};
}
/** \class VectorIndexSelectionCastImageFilter
*
* \brief Extracts the selected index of the vector that is the input
* pixel type
*
* This filter is templated over the input image type and
* output image type.
*
* The filter expect the input image pixel type to be a vector and
* the output image pixel type to be a scalar. The only requirement on
* the type used for representing the vector is that it must provide an
* operator[].
*
* \ingroup IntensityImageFilters MultiThreaded
* \ingroup ITKImageIntensity
*
* \wiki
* \wikiexample{VectorImages/VectorIndexSelectionCastImageFilter,Extract a component of an itkVectorImage}
* \endwiki
*/
template< class TInputImage, class TOutputImage >
class ITK_EXPORT VectorIndexSelectionCastImageFilter:
public
UnaryFunctorImageFilter< TInputImage, TOutputImage,
Functor::VectorIndexSelectionCast< typename TInputImage::PixelType,
typename TOutputImage::PixelType > >
{
public:
/** Standard class typedefs. */
typedef VectorIndexSelectionCastImageFilter Self;
typedef UnaryFunctorImageFilter<
TInputImage, TOutputImage,
Functor::VectorIndexSelectionCast< typename TInputImage::PixelType,
typename TOutputImage::PixelType > >
Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Runtime information support. */
itkTypeMacro(VectorIndexSelectionCastImageFilter,
UnaryFunctorImageFilter);
/** Get/Set methods for the index */
void SetIndex(unsigned int i)
{
if ( i != this->GetFunctor().GetIndex() )
{
this->GetFunctor().SetIndex(i);
this->Modified();
}
}
unsigned int GetIndex(void) const
{
return this->GetFunctor().GetIndex();
}
#ifdef ITK_USE_CONCEPT_CHECKING
/** Begin concept checking */
itkConceptMacro( InputHasNumericTraitsCheck,
( Concept::HasNumericTraits< typename TInputImage::PixelType::ValueType > ) );
/** End concept checking */
#endif
protected:
VectorIndexSelectionCastImageFilter() {}
virtual ~VectorIndexSelectionCastImageFilter() {}
virtual void BeforeThreadedGenerateData()
{
const unsigned int index = this->GetIndex();
const TInputImage *image = this->GetInput();
const unsigned int numberOfRunTimeComponents =
image->GetNumberOfComponentsPerPixel();
typedef typename TInputImage::PixelType PixelType;
typedef typename itk::NumericTraits< PixelType >::RealType
PixelRealType;
typedef typename itk::NumericTraits< PixelType >::ScalarRealType
PixelScalarRealType;
const unsigned int numberOfCompileTimeComponents =
sizeof( PixelRealType ) / sizeof( PixelScalarRealType );
unsigned int numberOfComponents = numberOfRunTimeComponents;
if ( numberOfCompileTimeComponents > numberOfRunTimeComponents )
{
numberOfComponents = numberOfCompileTimeComponents;
}
if ( index >= numberOfComponents )
{
itkExceptionMacro(
<< "Selected index = " << index
<< " is greater than the number of components = "
<< numberOfComponents);
}
}
private:
VectorIndexSelectionCastImageFilter(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
};
} // end namespace itk
#endif
|
/*
* Copyright (C) 2013 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:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WorkerCrypto_h
#define WorkerCrypto_h
#include "bindings/v8/ScriptWrappable.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
class WorkerCrypto : public ScriptWrappable, public RefCounted<WorkerCrypto> {
public:
static PassRefPtr<WorkerCrypto> create() { return adoptRef(new WorkerCrypto()); }
private:
WorkerCrypto();
};
}
#endif
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_StorageChild_h
#define mozilla_dom_StorageChild_h
#include "mozilla/dom/PStorageChild.h"
#include "nsDOMStorage.h"
#include "nsCycleCollectionParticipant.h"
namespace mozilla {
namespace dom {
class StorageChild : public PStorageChild
, public DOMStorageBase
, public nsSupportsWeakReference
{
public:
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(StorageChild, nsIPrivacyTransitionObserver)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSIPRIVACYTRANSITIONOBSERVER
StorageChild(nsDOMStorage* aOwner);
StorageChild(nsDOMStorage* aOwner, StorageChild& aOther);
virtual void InitAsSessionStorage(nsIURI* aDomainURI, bool aPrivate);
virtual void InitAsLocalStorage(nsIURI* aDomainURI, bool aCanUseChromePersist, bool aPrivate);
virtual bool CacheStoragePermissions();
virtual nsTArray<nsString>* GetKeys(bool aCallerSecure);
virtual nsresult GetLength(bool aCallerSecure, PRUint32* aLength);
virtual nsresult GetKey(bool aCallerSecure, PRUint32 aIndex, nsAString& aKey);
virtual nsIDOMStorageItem* GetValue(bool aCallerSecure, const nsAString& aKey,
nsresult* rv);
virtual nsresult SetValue(bool aCallerSecure, const nsAString& aKey,
const nsAString& aData, nsAString& aOldValue);
virtual nsresult RemoveValue(bool aCallerSecure, const nsAString& aKey,
nsAString& aOldValue);
virtual nsresult Clear(bool aCallerSecure, PRInt32* aOldCount);
virtual bool CanUseChromePersist();
virtual nsresult GetDBValue(const nsAString& aKey,
nsAString& aValue,
bool* aSecure);
virtual nsresult SetDBValue(const nsAString& aKey,
const nsAString& aValue,
bool aSecure);
virtual nsresult SetSecure(const nsAString& aKey, bool aSecure);
virtual nsresult CloneFrom(bool aCallerSecure, DOMStorageBase* aThat);
void AddIPDLReference();
void ReleaseIPDLReference();
private:
void InitRemote();
// Unimplemented
StorageChild(const StorageChild&);
nsCOMPtr<nsIDOMStorageObsolete> mStorage;
bool mIPCOpen;
};
}
}
#endif
|
/*
* Copyright (c) 2017 RnDity Sp. z o.o.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _STM32F0X_SOC_REGISTERS_H_
#define _STM32F0X_SOC_REGISTERS_H_
/* include register mapping headers */
#include "flash_registers.h"
#endif /* _STM32F0X_SOC_REGISTERS_H_ */
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/medialive/MediaLive_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace MediaLive
{
namespace Model
{
enum class WebvttDestinationStyleControl
{
NOT_SET,
NO_STYLE_DATA,
PASSTHROUGH
};
namespace WebvttDestinationStyleControlMapper
{
AWS_MEDIALIVE_API WebvttDestinationStyleControl GetWebvttDestinationStyleControlForName(const Aws::String& name);
AWS_MEDIALIVE_API Aws::String GetNameForWebvttDestinationStyleControl(WebvttDestinationStyleControl value);
} // namespace WebvttDestinationStyleControlMapper
} // namespace Model
} // namespace MediaLive
} // namespace Aws
|
/*
Copyright (c) 2014, Hookflash Inc. / Hookflash 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
#pragma once
#include <ortc/types.h>
namespace ortc
{
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#pragma mark
#pragma mark IORTC
#pragma mark
interaction IORTC
{
typedef zsLib::Log Log;
static void setup(IMessageQueuePtr defaultDelegateMessageQueue);
#ifdef WINRT
static void setup(Windows::UI::Core::CoreDispatcher ^dispatcher);
#endif //WINRT
static Milliseconds ntpServerTime();
static void ntpServerTime(const Milliseconds &value);
static void setDefaultLogLevel(Log::Level level);
static void setLogLevel(const char *componenet, Log::Level level);
static void setDefaultEventingLevel(Log::Level level);
static void setEventingLevel(const char *componenet, Log::Level level);
static void startMediaTracing();
static void stopMediaTracing();
static bool isMediaTracing();
static bool saveMediaTrace(String filename);
static bool saveMediaTrace(String host, int port);
static bool isMRPInstalled();
virtual ~IORTC() {} // make polymorphic
};
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.