text stringlengths 4 6.14k |
|---|
//
// Copyright 2009 High Order Bit, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AddressBookUI/ABNewPersonViewController.h>
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
#import "ContactCacheSetter.h"
@interface ContactMgr :
NSObject
<ABNewPersonViewControllerDelegate, UIActionSheetDelegate,
ABPeoplePickerNavigationControllerDelegate>
{
IBOutlet UIViewController * tabViewController;
IBOutlet NSObject<ContactCacheSetter> * contactCacheSetter;
ABRecordRef contactToAdd;
NSString * username;
}
@property (nonatomic) ABRecordRef contactToAdd;
@property (nonatomic, copy) NSString * username;
- (void)userDidAddContact:(ABRecordRef)person forUser:(NSString *)aUsername;
@end
|
/*-*/
/********************************************************
* Name: *
* term -- compute the value of three terms *
* *
* Purpose *
* demonstrate the use of variables. *
* *
* Notes: *
* Demonstration program only, does nothing *
* very useful. *
********************************************************/
/*+*/
int term; /* term used in two expressions */
int term_2; /* twice term */
int term_3; /* three times term */
int main()
{
term = 3 * 5;
term_2 = 2 * term;
term_3 = 3 * term;
return (0);
}
|
/** @file framebuffer.c (MODIFIED)
@author Ran Bao (rba90) & Kane Williams (pkw21), Group1
@date 30 September 2014
@brief Displays on dot matrix.
*/
/**
* this is a copy of display.c and lecmat.c but using matrix instead of using bit pattern
*/
#include "system.h"
#include "framebuffer.h"
#include "pio.h"
// all matrix stuff are in system.h
static const pio_t ledmat_rows[] =
{
LEDMAT_ROW1_PIO, LEDMAT_ROW2_PIO, LEDMAT_ROW3_PIO,
LEDMAT_ROW4_PIO, LEDMAT_ROW5_PIO, LEDMAT_ROW6_PIO,
LEDMAT_ROW7_PIO
};
/** Define PIO pins driving LED matrix columns. */
static const pio_t ledmat_cols[] =
{
LEDMAT_COL1_PIO, LEDMAT_COL2_PIO, LEDMAT_COL3_PIO,
LEDMAT_COL4_PIO, LEDMAT_COL5_PIO
};
/**
* fb0: current framebuffer
* fb1: stack framebuffer
*/
static uint8_t fb0[LEDMAT_COLS_NUM];
static uint8_t fb1[LEDMAT_COLS_NUM];
void fb_init (void)
{
/* initilize all row and cols to high */
uint8_t row;
uint8_t col;
for (row = 0; row < LEDMAT_ROWS_NUM; row++)
{
/* The rows are active low so configure PIO as an initially
high output. */
pio_config_set (ledmat_rows[row], PIO_OUTPUT_HIGH);
}
for (col = 0; col < LEDMAT_COLS_NUM; col++)
{
/* The columns are active low so configure PIO as an initially
high output. */
pio_config_set (ledmat_cols[col], PIO_OUTPUT_HIGH);
}
fb_clear();
}
void fb_clear(void){
/* clear framebuffer0 */
for (uint8_t col = 0; col < LEDMAT_COLS_NUM; col++){
fb0[col] = 0x00;
}
}
void fb_set_pixel(uint8_t col, uint8_t row, uint8_t state){
if (col >= LEDMAT_COLS_NUM || row >= LEDMAT_ROWS_NUM){
return;
}
uint8_t bitmask = BIT (row);
uint8_t pattern = fb0[col] & ~bitmask;
if (state){
pattern |= bitmask;
}
fb0[col] = pattern;
}
void fb_set_col(uint8_t col, uint8_t pattern){
if (col >= LEDMAT_COLS_NUM){
return;
}
fb0[col] = pattern;
}
uint8_t fb_get_pixel(uint8_t col, uint8_t row){
if (col >= LEDMAT_COLS_NUM || row >= LEDMAT_ROWS_NUM)
return 0;
uint8_t bitmask = BIT (row);
return (fb0[col] & bitmask) != 0;
}
void __fb_flush_col(uint8_t col){
static uint8_t prev_col = 0;
uint8_t pattern = fb0[col];
/* disable previous col */
pio_output_high (ledmat_cols[prev_col]);
/* active desired row */
for (uint8_t row = 0; row < LEDMAT_ROWS_NUM; row++)
{
/* The rows are active low.
we have 7 rows
*/
if (pattern & 1)
pio_output_low (ledmat_rows[row]);
else
pio_output_high (ledmat_rows[row]);
pattern >>= 1;
}
/* active desired col */
pio_output_low (ledmat_cols[col]);
/* record prev col */
prev_col = col;
}
void fb_flush(void){
static uint8_t col = 0;
__fb_flush_col(col);
col += 1;
if (col >= LEDMAT_COLS_NUM){
col = 0;
}
}
void fb_push(void){
for (uint8_t col = 0; col < LEDMAT_COLS_NUM; col++){
fb1[col] = fb0[col];
}
}
void fb_pop(void){
for (uint8_t col = 0; col < LEDMAT_COLS_NUM; col++){
fb0[col] = fb1[col];
}
}
void fb_fill(void){
for (uint8_t col = 0; col < LEDMAT_COLS_NUM; col++){
fb0[col] = 0x7F;
}
}
|
#define PyGSL_DERIV_MODULE
#include "diff_deriv_common.c"
#define DERIV_FUNCTION(name) \
static PyObject* deriv_ ## name (PyObject *self, PyObject *args) \
{ \
PyObject *tmp = NULL; \
FUNC_MESS_BEGIN(); \
tmp = PyGSL_diff_generic(self, args, gsl_deriv_ ## name); \
if (tmp == NULL){ \
PyGSL_add_traceback(module, __FILE__, __FUNCTION__, __LINE__); \
} \
FUNC_MESS_END(); \
return tmp; \
}
DERIV_FUNCTION(backward)
DERIV_FUNCTION(forward)
DERIV_FUNCTION(central)
/* module initialization */
#define PyGSL_DIFF_USAGE "\n See module doc string for function call description."
static PyMethodDef derivMethods[] = {
{"backward", deriv_backward, METH_VARARGS,
"Computer derivative of |f| at |x| with stepsize |H| using backward differences." \
"Returns |value| and |abserr|." PyGSL_DIFF_USAGE},
{"central", deriv_central, METH_VARARGS,
"Computer derivative of |f| at |x| with stepsize |H| using central differences." \
"Returns |value| and |abserr|." PyGSL_DIFF_USAGE},
{"forward", deriv_forward, METH_VARARGS,
"Computer derivative of |f| at |x| with stepsize |H| using forward differences." \
"Returns |value| and |abserr|."PyGSL_DIFF_USAGE },
{NULL, NULL} /* Sentinel */
};
static const char deriv_module_doc[] =
"Numerical differentation \n\
\n\
This module allows to differentiate functions numerically. It provides\n\
the following functions:\n\
backward\n\
central\n\
forward\n\
\n\
All have the same usage:\n\
func(callback, x, h, [args])\n\
callback ... foo(x, args):\n\
... some calculation here ...\n\
return y\n\
x ... the position where to differentate the callback\n\
h ... initial step size used to calculate the optimal one\n\
args ... additional object to be passed to the function.\n\
It is optional. In this case None is passed as\n\
args to foo\n\
";
DL_EXPORT(void) initderiv(void)
{
PyObject *m = NULL, *dict = NULL, *item = NULL;
m = Py_InitModule("deriv", derivMethods);
init_pygsl();
if (m == NULL)
return;
dict = PyModule_GetDict(m);
if (dict == NULL)
return;
if (!(item = PyString_FromString(deriv_module_doc))){
PyErr_SetString(PyExc_ImportError,
"I could not generate module doc string!");
return;
}
if (PyDict_SetItemString(dict, "__doc__", item) != 0){
PyErr_SetString(PyExc_ImportError,
"I could not init doc string!");
return;
}
return;
}
/*
* Local Variables:
* mode: C
* c-file-style: "python"
* End:
*/
|
//
// JDataType.h
// Wall
//
// Created by HOUJ on 11-5-3.
// Copyright 2011 Shellinfo. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
//包装一个对象和一个方法
typedef struct JTarget{
__unsafe_unretained id ins;
SEL act;
}JTarget;
CG_INLINE JTarget JTargetMake(id ins,SEL act){
JTarget r={ins,act};
return r;
}
#define JTargetSelf(x) JTargetMake(self, @selector(x))
@interface TargetObject : NSObject
@property (nonatomic,assign)JTarget target;
+(TargetObject *)create:(JTarget) t;
@end
//边界
typedef struct JEdge {
CGFloat top;
CGFloat left;
CGFloat bottom;
CGFloat right;
}JEdge;
//short数组
@interface JShortArray : NSObject {
int length;
short* data;
}
@property (nonatomic, readonly) int length;
@property (nonatomic, readonly) short* data;
- (void)dealloc;
-(id)initWithLength:(int)len;
+(id)arrayWinthLength:(int)len;
@end
//===================================
//int数组
@interface JIntArray : NSObject {
int length;
int* data;
}
- (void)dealloc;
-(id)initWithLength:(int)len;
+(id)arrayWinthLength:(int)len;
@property (nonatomic, readonly) int length;
@property (nonatomic, readonly) int* data;
@end
//===================================
//long 数组
@interface JLongArray : NSObject {
int length;
long long* data;
}
- (void)dealloc;
-(id)initWithLength:(int)len;
+(id)arrayWinthLength:(int)len;
@property (nonatomic, readonly) int length;
@property (nonatomic, readonly) long long* data;
@end
//===================================
//double数组
@interface JDoubleArray : NSObject {
int length;
double* data;
}
- (void)dealloc;
-(id)initWithLength:(int)len;
+(id)arrayWinthLength:(int)len;
@property (nonatomic, readonly) int length;
@property (nonatomic, readonly) double* data;
@end
//===================================
//bool数组
@interface JBooleanArray : NSObject {
int length;
bool* data;
}
- (void)dealloc;
-(id)initWithLength:(int)len;
+(id)arrayWinthLength:(int)len;
@property (nonatomic, readonly) int length;
@property (nonatomic, readonly) bool* data;
@end
//===================================
//整数
@interface JInteger : NSObject {
int value;
}
+(JInteger*)withValue:(int)v;
-(int)intValue;
@property (nonatomic, readonly) int value;
@end
//===================================
//bool
@interface JBoolean : NSObject {
bool value;
}
+(JBoolean*)withValue:(bool)v;
@property (nonatomic, readonly) bool value;
@end
//===================================
@interface JLong : NSObject {
long long value;
}
-(int)hashCode;
+(JLong*)withValue:(long long)v;
@property (nonatomic, readonly) long long value;
@end
//===================================
@interface JDouble : NSObject {
double value;
}
-(int)hashCode;
+(JDouble*)withValue:(double)v;
@property (nonatomic, readonly) double value;
@end
//===================================
@interface JMutableString : NSString{
unichar * cs;
int len;
int count;
}
-(void)clear;
-(void)appendChar:(unichar)c;
-(void)appendString:(NSString*)s;
-(id)initWithString:(NSString*)s;
-(id)initWithCapacity:(int)n;
@end
@interface JMutableIntArray : JIntArray{
int bufLength;
}
-(void)addInt:(int)n;
-(void)remove:(int)pos len:(int)len;
@end
@interface JMutableLongArray : JLongArray{
int bufLength;
}
-(void)addLong:(long long )n;
-(void)remove:(int)pos len:(int)len;
-(void)sort;
-(bool )have:(long long )n;
-(void)clear;
@end
|
// RUN: %ocheck 8 %s
struct
{
char c;
float f;
double d;
} a[] = {
1, 2, 3,
{ 4, 5 },
6,
};
main()
{
return a[1].d + a[2].c + a->f;
}
|
//
// TLPMenuScene.h
// ThisLittlePiggy
//
// Created by Jabari on 11/7/13.
// Copyright (c) 2013 23bit. All rights reserved.
//
#import <SpriteKit/SpriteKit.h>
@interface TLPMainMenuScene : SKScene
@end
|
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include "nagbar.h"
int nagbar_init(void)
{
return 0;
}
int nagbar_nag(void)
{
int status;
pid_t pid = fork();
if (pid == 0) {
/* child */
execl("/usr/bin/i3-nagbar", "i3-nagbar", "-t", "error",
"-m", "Battery level is critical.", NULL);
perror("exec");
} else if (pid == -1) {
return -1;
}
/*
* Do not wait for the child to exit. Instead constantly check the
* battery status and kill the child if necessary.
*/
for (;;) {
if (!is_critical()) {
kill(pid, SIGTERM);
wait(NULL);
return 0;
}
/*
* If the child exited itself, close this [parent] function as
* well.
*/
waitpid(-1, &status, WNOHANG);
if (kill(pid, 0) == -1) {
return -1;
}
sleep(1);
}
return 0;
}
int nagbar_warn(void)
{
pid_t pid = fork();
if (pid == 0) {
/* child */
execl("/usr/bin/i3-nagbar", "i3-nagbar", "-t", "warning",
"-m", "Battery level is low.", NULL);
perror("exec");
} else if (pid == -1) {
perror("fork");
return -1;
}
/* close warning after X seconds */
sleep(10);
kill(pid, SIGTERM);
wait(NULL);
return 0;
}
void nagbar_cleanup(void)
{
}
struct bn_module nagbar_ops = {
.name = "nagbar",
.init = nagbar_init,
.nag = nagbar_nag,
.warn = nagbar_warn,
.cleanup = nagbar_cleanup,
};
BN_MODULE(nagbar_ops)
|
//
// ESApp+ACSettings.h
// AppComponents
//
// Created by Elf Sundae on 16/1/22.
// Copyright © 2016年 www.0x123.com. All rights reserved.
//
#import <ESFramework/ESApp.h>
#import "ACSettings.h"
FOUNDATION_EXTERN NSString *const ACAppUserSettingsIdentifierPrefix;
FOUNDATION_EXTERN NSString *const ACAppConfigIdentifier;
@interface ESApp (ACSettings)
- (ACSettings *)userSettings;
+ (NSMutableDictionary *)userSettings;
+ (id)userSettingsValue:(NSString *)keyPath;
+ (void)saveUserSettings;
- (ACSettings *)appConfig;
+ (NSMutableDictionary *)appConfig;
+ (id)appConfigValue:(NSString *)keyPath;
+ (void)saveAppConfig;
/**
* Returns settingsIdentifier for uid: "ACAppUserSettingsIdentifierPrefix + uid"
*/
- (NSString *)userSettingsIdentifierForUserID:(NSString *)uid;
@end
@interface ESApp (ACSettingsSubclass)
- (NSString *)currentUserID;
- (NSDictionary *)userSettingsDefaults;
- (NSDictionary *)appConfigDefaults;
@end
|
/*
* Copyright (c) 2016-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* 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.
*/
#ifndef ARM_COMPUTE_CLBITWISEOR_H
#define ARM_COMPUTE_CLBITWISEOR_H
#include "arm_compute/runtime/CL/ICLSimpleFunction.h"
namespace arm_compute
{
class CLCompileContext;
class ICLTensor;
/** Basic function to perform bitwise OR by running @ref CLBitwiseKernel.
*
* @note The tensor data type for the inputs must be U8.
* @note The function performs a bitwise OR operation using the two input tensors.
*/
class CLBitwiseOr : public ICLSimpleFunction
{
public:
/** Initialize the function
*
* Valid data layouts:
* - All
*
* Valid data type configurations:
* |src |dst |
* |:--------------|:--------------|
* |U8 |U8 |
*
* @param[in] input1 Input tensor. Data types supported: U8.
* @param[in] input2 Input tensor. Data types supported: U8.
* @param[out] output Output tensor. Data types supported: U8.
*/
void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output);
/** Initialize the function
*
* @param[in] compile_context The compile context to be used.
* @param[in] input1 Input tensor. Data types supported: U8.
* @param[in] input2 Input tensor. Data types supported: U8.
* @param[out] output Output tensor. Data types supported: U8.
*/
void configure(const CLCompileContext &compile_context, const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output);
};
}
#endif /* ARM_COMPUTE_CLBITWISEOR_H */
|
//
// FFYearCell.h
// FFCalendar
//
// Created by Fernanda G. Geraissate on 3/6/14.
// Copyright (c) 2014 Fernanda G. Geraissate. All rights reserved.
//
// http://fernandasportfolio.tumblr.com
//
#import <UIKit/UIKit.h>
#import "EnumClass.h"
@protocol FFYearCellProtocol <NSObject>
@required
- (void)showMonthCalendar;
@end
@interface FFYearCell : UICollectionViewCell
@property (nonatomic, strong) NSDate *date;
@property (nonatomic, strong) id<FFYearCellProtocol> protocol;
@property (nonatomic) enum DeviceType currentDeviceType;
- (void)initLayout;
@end
|
// Copyright (c) 2016 Intel Corporation. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
#ifndef _POINTING_DATA3D_H_
#define _POINTING_DATA3D_H_
#include <node.h>
#include <v8.h>
#include <string>
#include "common/geometry/point3d.h"
#include "gen/generator_helper.h"
#include "gen/array_helper.h"
class PointingData3D {
public:
PointingData3D();
PointingData3D(const PointingData3D& rhs);
~PointingData3D();
PointingData3D& operator = (const PointingData3D& rhs);
public:
Point3D* get_origin() const {
return &this->origin_;
}
Point3D* get_direction() const {
return &this->direction_;
}
void SetJavaScriptThis(v8::Local<v8::Object> obj) {
// Ignore this if you don't need it
// Typical usage: emit an event on `obj`
}
private:
mutable Point3D origin_;
mutable Point3D direction_;
friend class PersonTrackerAdapter;
};
#endif // _POINTING_DATA3D_H_
|
#ifndef CGnuPlotTimeStamp_H
#define CGnuPlotTimeStamp_H
#include <CGnuPlotTimeStampData.h>
class CGnuPlotGroup;
class CGnuPlotRenderer;
class CGnuPlotTimeStamp {
public:
typedef std::pair<CHAlignType,double> HAlignPos;
typedef std::pair<CVAlignType,double> VAlignPos;
public:
CGnuPlotTimeStamp(CGnuPlotGroup *group);
virtual ~CGnuPlotTimeStamp();
CGnuPlotGroup *group() const { return group_; }
const CGnuPlotTimeStampData &data() const { return data_; }
void setData(const CGnuPlotTimeStampData &data) { data_ = data; }
bool isTop() const { return data_.isTop(); }
void setTop(bool b) { data_.setTop(b); }
virtual void draw(CGnuPlotRenderer *renderer);
private:
CGnuPlotGroup *group_;
CGnuPlotTimeStampData data_;
};
typedef CRefPtr<CGnuPlotTimeStamp> CGnuPlotTimeStampP;
#endif
|
// »ªÇڿƼ¼°æÈ¨ËùÓÐ 2008-2022
//
// ÎļþÃû£ºItemSource.h
// ¹¦ ÄÜ£ºÏºÏÈÝÆ÷¡£
//
// ×÷ ÕߣºMPF¿ª·¢×é(ÍôÈÙ)
// ʱ ¼ä£º2010-07-02
//
// ============================================================
#ifndef __UIITEMSOURCE_H
#define __UIITEMSOURCE_H
#include <System/Tools/Array.h>
#include <System/Windows/DpObject.h>
#include <Framework/Controls/ItemCollection.h>
namespace suic
{
/// <Summary>
/// ʵÏÖĬÈϵÄItemCollection
/// </Summary>
class SUICORE_API ObservableCollection : public ItemCollection
{
public:
ObservableCollection();
ObservableCollection(int capacity);
~ObservableCollection();
bool IsEmpty();
int GetCount() const;
bool Contains(Object* item);
Object* GetItem(int index) const;
ItemEntry* GetItemEntry(int index) const;
int IndexOf(Object* value);
int IndexOf(Object* value, int startIndex);
int IndexOf(Object* value, int startIndex, int count);
int AddItem(Object* value);
void SetItem(int index, Object* value);
void MoveItem(int oriPos, int dstPos);
void SwapItem(int index1, int index2);
void InsertItem(int index, Object* value);
bool RemoveItem(Object* obj);
bool RemoveItemAt(int index);
void RemoveRange(int index, int count);
void Clear();
template<typename C>
void Sort(C* comparer, Object* flag)
{
_items.Sort<C>(comparer, flag);
}
template<typename C>
void Sort(int index, int length, C* comparer, Object* flag)
{
_items.Sort<C>(index, length, comparer, flag);
}
private:
Array<ItemEntry*, false> _items;
};
inline bool ObservableCollection::IsEmpty()
{
return (GetCount() == 0);
}
inline int ObservableCollection::GetCount() const
{
return _items.Length();
}
inline Object* ObservableCollection::GetItem(int index) const
{
return _items.GetItem(index)->GetItem();
}
}
#endif
|
// Standard libs
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#include "../aatg/essentials.h"
#include "../aatg/interrupts.h"
#include "../aatg/serial.h"
#include "../aatg/adc.h"
#include "../aatg/timers.h"
int main() {
unsigned int min = 800, max = 2000, pos = 50, width = 40000;
usart_init();
timer1_init(PWM_FAST_INPUT_CAPTURE, PWM_FAST16_NON_INVERT, PWM_FAST16_NON_INVERT, CLOCK_PRESCALER_8);
timer1_set_input_capture(width);
timer1_set_output_compare_registerA(linInterp(pos,min,max));
DDRB = 0xFF;
DDRC = 0xFF;
DDRD = 0xFF;
char buffer[256];
while(1 == 1) {
if(pos <= 100 ) {
timer1_set_output_compare_registerA(linInterp(pos,min,max));
}
if(pos <= 100 ) {
timer1_set_output_compare_registerB(linInterp(pos,min,max));
}
scanf("%s", &buffer);
printf(" => %s\r\n", buffer);
switch(buffer[0]) {
case 'm':
sscanf(buffer+1, "%d", &min);
printf(" MIN => %d\r\n", min);
break;
case 'M':
sscanf(buffer+1, "%d", &max);
printf(" MAX => %d\r\n", max);
break;
case 'p':
sscanf(buffer+1, "%d", &pos);
printf(" POS => %d\r\n", pos);
break;
case 'w':
sscanf(buffer+1, "%d", &width);
timer1_set_input_capture(width);
printf(" WIDTH => %d\r\n", width);
break;
}
}
return 0;
}
|
//
// Util.h
// LD20
//
// Created by tomek on 6/9/11.
//
#import "cocos2d.h"
#import "Consts.h"
#define SCORE [Util getInstance].score
#define PLAYER_NAME [Util getInstance].playerName
#define CUSTOM_SERVER_ADDR [Util getInstance].customServerAddr
@interface Util : NSObject {
int _score;
}
@property (nonatomic) int score;
@property (nonatomic, retain) NSString* playerName;
@property (nonatomic, retain) NSString* customServerAddr;
- (CCSprite*)createRetainSpriteWithFName:(NSString*)fname onLayer:(CCLayer*)layer withPos:(CGPoint)pos andZOrder:(int)zOrder;
+ (CGRect)scaleRect:(CGRect)rect by:(double)coef;
+ (BOOL)pointWithX:(double)x y:(double)y colidedWithObjectWithX:(double)objX y:(double)objY width:(double)objWidth andHeight:(double)objHeight;
+ (BOOL)sprite:(CCSprite*)spr1 collidesWithSprite:(CCSprite*)spr2 withTolerance:(float)tolerance;
+ (NSString*)getServerAddress;
+ (Util*)getInstance;
@end
|
#ifndef JORGE_AUDIO_H
#define JORGE_AUDIO_H
#include <string>
#include <SDL_mixer.h>
#include "file.h"
namespace jorge {
class Sound {
public:
/**
* Create sound from file
* Supports WAV, AIFF, RIFF, OGG and VOC
* @param soundPath Path to file
*/
Sound(Path soundPath);
/**
* Play the sound once
*/
void play();
/**
* Play the sound repeatedly
* Throws InvalidArgumentException if repeat argument is less than 1
* @param repeat Number of times
*/
void play(int repeat);
~Sound();
private:
Mix_Chunk* sdlSound = nullptr;
};
/**
* Background music
* You can only play one music at once, that's why pause(), stop(), resume(),
* isPlaying(), etc. are static
*/
class Music {
public:
/**
* Create music from file
* Supports WAV, MIDI, MOD, OGG, MP3, FLAC
* @param musicPath Path to file
*/
Music(Path musicPath);
/**
* Play looping the song forever
* Starts from the beginning, music must be already stopped
* Throws InvalidMusicOperationException if music isn't already stopped
* Throws InvalidArgumentException if a nullptr is given as music
* @param music Song to play
*/
static void play(Music* music);
/**
* Play repeatedly
* Starts from the beginning, music must be already stopped
* Throws InvalidArgumentException if repeat argument is less than 0
* Throws InvalidMusicOperationException if music isn't already stopped
* Throws InvalidArgumentException if a nullptr is given as music
* @param music Song to play
* @param repeat Number of times, 0 is forever
*/
static void play(Music* music, int repeat);
/**
* Pauses the song, music must be already playing
* Throws InvalidMusicOperationException if music isn't already playing
*/
static void pause();
/**
* Resumes a paused song, music must be already paused
* Throws InvalidMusicOperationException if music isn't already paused
*/
static void resume();
/**
* Stops the song, music must be playing or paused
* Throws InvalidMusicOperationException if music is already stopped
*/
static void stop();
static bool isPlaying();
/**
* Returns true only when the music is paused
* When the music is stopped returns false
*/
static bool isPaused();
/**
* Returns true only when the music is stopped
* When the music is paused returns false
*/
static bool isStopped();
~Music();
private:
Mix_Music* sdlMusic = nullptr;
};
} // namespace jorge
#endif
|
/*
This file is part of CubicVR.
Copyright (C) 2003 by Charles J. Cliffe
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.
*/
#ifndef CUBICVR_CAMERA_H
#define CUBICVR_CAMERA_H
#include <CubicVR/SceneObject.h>
#define CAMERA_FREE 0
#define CAMERA_TARGET 1
#define CAMERA_CONTROLLER_FOV 100
#define CAMERA_MOTION_FOV 100
class IMPEXP Camera : public Resource, public Controllable
{
private:
public:
unsigned short type;
float fov, aspect, nearclip, farclip;
int width, height;
static Camera *lastActive;
float projectionMatrix[16];
float viewMatrix[16];
#ifdef ARCH_PSP
float camAngle; // stored and used for env mapping on psp
#endif
#if !defined(ARCH_PSP) && !defined(OPENGL_ES) && !defined(ARCH_DC)
float dof_near, dof_far;
float dof_near_linear, dof_far_linear;
inline void setNearDOF(float dof_near_in) { dof_near=dof_near_in; dof_near_linear = dof_near/(farclip-nearclip); };
inline void setFarDOF(float dof_far_in) { dof_far=dof_far_in; dof_far_linear = dof_far/(farclip-nearclip); };
inline float getNearDOF() { return dof_near; };
inline float getFarDOF() { return dof_far; };
#endif
XYZ position, rotation, target;
Vector up,right;
SceneObject *sceneObjTarget;
Camera(int width_in, int height_in, float fov_in = 60, float nearclip_in=0.1, float farclip_in=2000.0, int type_in = CAMERA_FREE);
Camera();
~Camera();
void control(int controllerId, int motionId, float value);
void setSize(int width_in, int height_in);
void setFOV(float fov_in);
void setAspect(float aspect_in);
void setAspect(int screen_w, int screen_h);
void setPosition(const XYZ &pos);
void setRotation(const XYZ &pos);
void setTarget(const XYZ &pos);
void bindTarget(SceneObject *sceneObj);
void trackTarget(float trackingSpeed, float safeDistance);
void moveViewRelative(XYZ &pt, float xdelta, float zdelta);
btVector3 getRayTo(int x,int y);
Vector getRay(int x,int y);
void setClip(float near_in, float far_in);
void setType(int type_in);
void setup();
float distSlopeX(float z);
float distSlopeY(float z);
static void orthoNearBounds(XYZ position, float ortho_width, float ortho_height, MATRIX4X4 projMatrix, MATRIX4X4 modelMatrix, float nearClip, XYZ &aabb1, XYZ &aabb2);
static void orthoFarBounds(XYZ position, float ortho_width, float ortho_height, MATRIX4X4 projMatrix, MATRIX4X4 modelMatrix, float farClip, XYZ &aabb1, XYZ &aabb2);
};
#endif
|
/*
* Copyright (c) 2020-2022 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* 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.
*/
#ifndef ARM_COMPUTE_NEMAXUNPOOLINGLAYERKERNEL_H
#define ARM_COMPUTE_NEMAXUNPOOLINGLAYERKERNEL_H
#include "src/core/NEON/INEKernel.h"
namespace arm_compute
{
class ITensor;
/** Interface for the pooling layer kernel */
class NEMaxUnpoolingLayerKernel : public INEKernel
{
public:
const char *name() const override
{
return "NEMaxUnpoolingLayerKernel";
}
/** Default constructor */
NEMaxUnpoolingLayerKernel();
/** Prevent instances of this class from being copied (As this class contains pointers) */
NEMaxUnpoolingLayerKernel(const NEMaxUnpoolingLayerKernel &) = delete;
/** Prevent instances of this class from being copied (As this class contains pointers) */
NEMaxUnpoolingLayerKernel &operator=(const NEMaxUnpoolingLayerKernel &) = delete;
/** Allow instances of this class to be moved */
NEMaxUnpoolingLayerKernel(NEMaxUnpoolingLayerKernel &&) = default;
/** Allow instances of this class to be moved */
NEMaxUnpoolingLayerKernel &operator=(NEMaxUnpoolingLayerKernel &&) = default;
/** Default destructor */
~NEMaxUnpoolingLayerKernel() = default;
/** Set the input and output tensors.
*
* @note Output shape must be equal to the shape of the original input to pool.
*
* @param[in] input Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
* @param[in] indices Tensor containing the offset to store the input elements in the output tensor.
* @ref NEPoolingLayer with indices should precede this function in order to
* properly reconstruct the output tensor.
* The tensor shape of this tensor has to be equal to the input tensor shape. Data type supported: U32.
* @param[out] output Destination tensor. Data types supported: Same as @p input.
* @param[in] pool_info Contains pooling operation information described in @ref PoolingLayerInfo.
*/
void configure(const ITensor *input, const ITensor *indices, ITensor *output, const PoolingLayerInfo &pool_info);
/** Static function to check if given info will lead to a valid configuration of @ref NEMaxUnpoolingLayerKernel
*
* @param[in] input Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
* @param[in] output Destination tensor info. Data types supported: Same as @p input.
* @param[in] indices Tensor info of the indices of the maximal values. Data type supported: U32.
* @param[in] pool_info Contains pooling operation information described in @ref PoolingLayerInfo.
*
* @return a status
*/
static Status validate(const ITensorInfo *input, const ITensorInfo *indices, const ITensorInfo *output, const PoolingLayerInfo &pool_info);
// Inherited methods overridden:
void run(const Window &window, const ThreadInfo &info) override;
private:
/** Function to perform 2x2 pooling and compute the pooling indices. The indices can be used for max unpool.
*
* @param[in] window_input Input region on which to execute the kernel.
*/
template <typename T>
void unpooling2(const Window &window_input);
using UnpoolingFunction = void (NEMaxUnpoolingLayerKernel::*)(const Window &window);
private:
const ITensor *_input;
ITensor *_output;
const ITensor *_indices;
};
} // namespace arm_compute
#endif /*ARM_COMPUTE_NEMAXUNPOOLINGLAYERKERNEL_H */
|
//
// Asset.h
// BMITime
//
// Created by Jamal Kharrat on 4/27/13.
// Copyright (c) 2013 Jamal Kharrat. All rights reserved.
//
#import <Foundation/Foundation.h>
@class Employee;
@interface Asset : NSObject
{
NSString *label;
unsigned int resaleValue;
__weak Employee *holder;
}
@property (strong) NSString *label;
@property (weak) Employee *holder;
@property unsigned int resaleValue;
-(NSString*) description;
-(void) dealloc;
@end
|
#include "newgrp.h"
// for size_t, gid_t
#include <sys/types.h>
// for setgroups, setgrent, getgrent, endgrent
#include <grp.h>
// for NGROUPS_MAX
#include <limits.h>
// for strcmp
#include <string.h>
// for bool, true, false
#include <stdbool.h>
// for errno, ENOMEM
#include <errno.h>
// for assert
#include <assert.h>
/**
* The length of the groups buffer.
*/
#define NG_GROUPS_SIZE (NGROUPS_MAX + 1)
/**
* Checks if a user is member of a group.
*/
static bool ng_check_group_member(const char * username, struct group * ent);
int ng_initgroups(const char * user, gid_t group)
{
// initialize group list with the specified group
gid_t groups[NG_GROUPS_SIZE] = { group };
size_t num_groups = 1;
struct group * ent;
int ret = 0;
// rewind to the first group
setgrent();
// find the user in the groups file
while ((ent = getgrent()) != NULL) {
if (ng_check_group_member(user, ent)) {
if (num_groups == NG_GROUPS_SIZE) {
// too many groups
ret = -1;
errno = -ENOMEM;
goto out;
}
// add the current group
groups[num_groups++] = ent->gr_gid;
}
}
// try to set the groups
ret = setgroups(num_groups, groups);
out:
endgrent();
return ret;
}
bool ng_check_group_member(const char * user, struct group * ent)
{
// find the user in the list of users
for (char ** current_user_p = ent->gr_mem; *current_user_p; ++current_user_p) {
if (strcmp(user, *current_user_p) == 0) {
// usernames match
return true;
}
}
return false;
}
|
/* Copyright (c) <2009> <Martin Kopta, martin@kopta.eu> {{{1
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.
****************************************************************
Safestring header file for poga }}}1*/
#ifndef SRC_SAFESTRING_H_
#define SRC_SAFESTRING_H_
#include <string>
std::string safestring(std::string const &input);
#endif // SRC_SAFESTRING_H_
/* vim: set ts=2 sw=2 expandtab fdm=marker: */
/* EOF */
|
#ifndef GD_EXPLORER_SCRIPTPARSESERVICE_H
#define GD_EXPLORER_SCRIPTPARSESERVICE_H
#include "service.h"
namespace gdexplorer {
class ScriptParseService : public EditorServerService {
GDCLASS(ScriptParseService,EditorServerService);
using super = EditorServerService;
protected:
struct Error {
String message;
int row = -1;
int column = -1;
bool operator==(const Error& e) const {
return e.message == message && e.column == column && e.row == row;
}
operator Variant() const {
Dictionary d;
d["message"] = message;
d["row"] = row;
d["column"] = column;
return d;
}
};
struct Member {
String name;
int line = -1;
operator Variant() const {
Dictionary d;
d[name] = line;
return d;
}
};
struct Request {
bool valid() const;
String script_text;
String script_path;
Request(const Dictionary& dict);
};
struct Result {
bool valid = false;
bool is_tool = false;
String base_class;
String native_calss;
Vector<Error> errors;
Vector<Member> functions;
Vector<Member> members;
Vector<Member> signals;
Vector<Member> constants;
operator Dictionary() const;
};
Result parse_script(const Request& request) const;
public:
virtual Dictionary resolve(const Dictionary& _data) const override;
ScriptParseService() = default;
virtual ~ScriptParseService() = default;
};
}
#endif // GD_EXPLORER_SCRIPTPARSESERVICE_H
|
//CPP:ATLAS-TDAQ/ParameterSweeper/CmdLineParameterSweeper.cpp
#ifndef ATOMICS_ATLAS_TDAQ_PARAMETERSWEEPER_CMDLINEPARAMETERSWEEPER_H_
#define ATOMICS_ATLAS_TDAQ_PARAMETERSWEEPER_CMDLINEPARAMETERSWEEPER_H_
#include "pdevslib.h"
#include "ATLAS-TDAQ/globals.h"
#include "ATLAS-TDAQ/ParameterSweeper/IParameterSweeper.h"
class CmdLineParameterSweeper : public IParameterSweeper {
public:
CmdLineParameterSweeper(std::string simuRunVariableName, std::string parameterValuesVariableName, std::string parameterNamesVariableName) : IParameterSweeper(simuRunVariableName, parameterValuesVariableName, parameterNamesVariableName) {
// printLog(LOG_LEVEL_FULL_LOGGING, "[INIT] CmdLineParameterSweeper constructor \n");
}
/*
* Returns current run number based on the name for simuRunVariableName
*/
int getCurrentExperimentNumber();
/*
* Returns total number of runs
*/
int getTotalNumberOfExperiments();
/*
* Updates the parameters according to the currentExperimentNumber, parameterValuesVariableName and parameterNamesVariableName
*/
void UpdateParameters();
void onExit();
private:
void replaceParameterValue(std::string parameterName, std::string parameterValue);
};
#endif /* ATOMICS_ATLAS_TDAQ_PARAMETERSWEEPER_CMDLINEPARAMETERSWEEPER_H_ */
|
//
// MDKRenderer.h
// MarkdownKit
//
// Created by Safx Developer on 2015/03/20.
// Copyright (c) 2015年 Safx Developers. All rights reserved.
//
#include "document.h"
// block level callbacks
typedef void (^MDKBlockcodeBlock)(void* node, NSString* text, NSString* lang);
typedef void (^MDKBlockquoteBlock)(void* node, void* content);
typedef void (^MDKHeaderBlock)(void* node, void* content, int level);
typedef void (^MDKHruleBlock)(void* node);
typedef void (^MDKListBlock)(void* node, void* content, hoedown_list_flags flags);
typedef void (^MDKListitemBlock)(void* node, void* content, hoedown_list_flags flags);
typedef void (^MDKParagraphBlock)(void* node, void* content);
typedef void (^MDKTableBlock)(void* node, void* content);
typedef void (^MDKTable_headerBlock)(void* node, void* content);
typedef void (^MDKTable_bodyBlock)(void* node, void* content);
typedef void (^MDKTable_rowBlock)(void* node, void* content);
typedef void (^MDKTable_cellBlock)(void* node, void* content, hoedown_table_flags flags);
typedef void (^MDKFootnotesBlock)(void* node, void* content);
typedef void (^MDKFootnote_defBlock)(void* node, void* content, unsigned int num);
typedef void (^MDKBlockhtmlBlock)(void* node, NSString* text);
// span level callbacks
typedef int (^MDKAutolinkBlock)(void* node, NSString* link, hoedown_autolink_type type);
typedef int (^MDKCodespanBlock)(void* node, NSString* text);
typedef int (^MDKDouble_emphasisBlock)(void* node, void* content);
typedef int (^MDKEmphasisBlock)(void* node, void* content);
typedef int (^MDKUnderlineBlock)(void* node, void* content);
typedef int (^MDKHighlightBlock)(void* node, void* content);
typedef int (^MDKQuoteBlock)(void* node, void* content);
typedef int (^MDKImageBlock)(void* node, NSString* link, NSString* title, NSString* alt);
typedef int (^MDKLinebreakBlock)(void* node);
typedef int (^MDKLinkBlock)(void* node, void* content, NSString* link, NSString* title);
typedef int (^MDKTriple_emphasisBlock)(void* node, void* content);
typedef int (^MDKStrikethroughBlock)(void* node, void* content);
typedef int (^MDKSuperscriptBlock)(void* node, void* content);
typedef int (^MDKFootnote_refBlock)(void* node, unsigned int num);
typedef int (^MDKMathBlock)(void* node, NSString* text, int displaymode);
typedef int (^MDKRaw_htmlBlock)(void* node, NSString* text);
// low level callbacks
typedef void (^MDKEntityBlock)(void* node, NSString* text);
typedef void (^MDKNormal_textBlock)(void* node, NSString* text);
// miscellaneous callbacks
typedef void (^MDKDoc_headerBlock)(void* node, int inline_render);
typedef void (^MDKDoc_footerBlock)(void* node, int inline_render);
// MARK: Hoedown object
typedef void* (^MDKSpan_newBlock)(enum hoedown_span_type);
typedef void* (^MDKBlock_newBlock)(enum hoedown_block_type);
typedef void (^MDKSpan_freeBlock)(void* node, enum hoedown_span_type);
typedef void (^MDKBlock_freeBlock)(void* node, enum hoedown_block_type);
@interface MDKRenderer : NSObject
// block level callbacks - NULL toskips the block in pargraph or fallthrough to paragraph otherwise
@property (nonatomic, strong) MDKBlockcodeBlock blockcode;
@property (nonatomic, strong) MDKBlockquoteBlock blockquote;
@property (nonatomic, strong) MDKHeaderBlock header;
@property (nonatomic, strong) MDKHruleBlock hrule;
@property (nonatomic, strong) MDKListBlock list;
@property (nonatomic, strong) MDKListitemBlock listitem;
@property (nonatomic, strong) MDKParagraphBlock paragraph;
@property (nonatomic, strong) MDKTableBlock table;
@property (nonatomic, strong) MDKTable_headerBlock table_header;
@property (nonatomic, strong) MDKTable_bodyBlock table_body;
@property (nonatomic, strong) MDKTable_rowBlock table_row;
@property (nonatomic, strong) MDKTable_cellBlock table_cell;
@property (nonatomic, strong) MDKFootnotesBlock footnotes;
@property (nonatomic, strong) MDKFootnote_defBlock footnote_def;
@property (nonatomic, strong) MDKBlockhtmlBlock blockhtml;
// span level callbacks - NULL or return nil prints the span verbatim
@property (nonatomic, strong) MDKAutolinkBlock autolink;
@property (nonatomic, strong) MDKCodespanBlock codespan;
@property (nonatomic, strong) MDKDouble_emphasisBlock double_emphasis;
@property (nonatomic, strong) MDKEmphasisBlock emphasis;
@property (nonatomic, strong) MDKUnderlineBlock underline;
@property (nonatomic, strong) MDKHighlightBlock highlight;
@property (nonatomic, strong) MDKQuoteBlock quote;
@property (nonatomic, strong) MDKImageBlock image;
@property (nonatomic, strong) MDKLinebreakBlock linebreak;
@property (nonatomic, strong) MDKLinkBlock link;
@property (nonatomic, strong) MDKTriple_emphasisBlock triple_emphasis;
@property (nonatomic, strong) MDKStrikethroughBlock strikethrough;
@property (nonatomic, strong) MDKSuperscriptBlock superscript;
@property (nonatomic, strong) MDKFootnote_refBlock footnote_ref;
@property (nonatomic, strong) MDKMathBlock math;
@property (nonatomic, strong) MDKRaw_htmlBlock raw_html;
// low level callbacks - NULL copies input directly into the output
@property (nonatomic, strong) MDKEntityBlock entity;
@property (nonatomic, strong) MDKNormal_textBlock normal_text;
// miscellaneous callbacks
@property (nonatomic, strong) MDKDoc_headerBlock doc_header;
@property (nonatomic, strong) MDKDoc_footerBlock doc_footer;
// MARK: Hoedown object
@property (nonatomic, strong) MDKSpan_newBlock span_new;
@property (nonatomic, strong) MDKBlock_newBlock block_new;
@property (nonatomic, strong) MDKSpan_freeBlock span_free;
@property (nonatomic, strong) MDKBlock_freeBlock block_free;
- (void*)parse:(NSString*)markdownText;
- (void*)parse:(NSString*)markdownText extensions:(enum hoedown_extensions)extensions;
@end
@interface MDKHTMLRenderer : NSObject
- (instancetype)initWithFlags:(int)flags; // FIXME: use enum
- (NSString*)parse:(NSString*)markdownText;
- (NSString*)parse:(NSString*)markdownText extensions:(enum hoedown_extensions)extensions;
@end
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: android/libcore/luni/src/main/java/java/security/cert/CertPathParameters.java
//
#include "../../../J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_JavaSecurityCertCertPathParameters")
#ifdef RESTRICT_JavaSecurityCertCertPathParameters
#define INCLUDE_ALL_JavaSecurityCertCertPathParameters 0
#else
#define INCLUDE_ALL_JavaSecurityCertCertPathParameters 1
#endif
#undef RESTRICT_JavaSecurityCertCertPathParameters
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if !defined (JavaSecurityCertCertPathParameters_) && (INCLUDE_ALL_JavaSecurityCertCertPathParameters || defined(INCLUDE_JavaSecurityCertCertPathParameters))
#define JavaSecurityCertCertPathParameters_
/*!
@brief The interface specification for certification path algorithm parameters.
<p>
This interface is for grouping purposes of <code>CertPath</code> parameter
implementations.
*/
@protocol JavaSecurityCertCertPathParameters < NSCopying, NSObject, JavaObject >
/*!
@brief Clones this <code>CertPathParameters</code> instance.
@return the cloned instance.
*/
- (id)clone;
@end
J2OBJC_EMPTY_STATIC_INIT(JavaSecurityCertCertPathParameters)
J2OBJC_TYPE_LITERAL_HEADER(JavaSecurityCertCertPathParameters)
#endif
#pragma clang diagnostic pop
#pragma pop_macro("INCLUDE_ALL_JavaSecurityCertCertPathParameters")
|
#ifndef CHATROOM_H
#define CHATROOM_H
#include <QWidget>
#include <QHostAddress>
#include <QUdpSocket>
#include <room.h>
#include <peer.h>
#include <QListWidgetItem>
namespace Ui {
class chatRoom;
}
class chatRoom : public QWidget
{
Q_OBJECT
public:
chatRoom(QString mnickName,Room room,QWidget *parent = 0 );
~chatRoom();
void closeEvent(QCloseEvent *event);
signals:
/* This signal will be emitted when closeEvent slot on QWidget is executed. */
void leaveChatRoom(QString chatRoomName);
/* This signal will be emitted when on_peerList_itemDoubleClicked slot is executed. */
void emitUnicast(Peer peer);
private slots:
void processPendingDatagrams();
void on_sendBtn_clicked();
void on_peerList_itemDoubleClicked(QListWidgetItem *item);
private:
Ui::chatRoom *ui;
QUdpSocket *udpSocket;
QHostAddress groupAddress;
QString nickName;
Room m_room;
};
#endif // CHATROOM_H
|
//
// MasterViewController.h
// yeet
//
// Created by Akshay Easwaran on 1/13/15.
// Copyright (c) 2015 Akshay Easwaran. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef enum {
YTCloudServiceParse,
YTCloudServiceCloudKit
} YTCloudService;
@interface YTMainViewController : UITableViewController
-(void)refreshFriendsList;
-(instancetype)initWithCloudService:(YTCloudService)service;
@end
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
Contains all the timings for an instruments operation.
*/
@interface FBInstrumentsTimings : NSObject
#pragma mark Initializers
/**
Creates and returns a new FBInstrumentsTimings object with the provided parameters
@param terminateTimeout timeout for stopping Instruments
@param launchRetryTimeout timeout for launching Instruments
@param launchErrorTimeout timeout for the Instruments launch error message to pop up
@param operationDuration the total duration for the Instruments operation
@return a new FBInstrumentsTimings object with the specified timing values.
*/
+ (instancetype)timingsWithTerminateTimeout:(NSTimeInterval)terminateTimeout launchRetryTimeout:(NSTimeInterval)launchRetryTimeout launchErrorTimeout:(NSTimeInterval)launchErrorTimeout operationDuration:(NSTimeInterval)operationDuration;
/**
The maximum backoff time when stopping Instruments.
*/
@property (nonatomic, assign, readonly) NSTimeInterval terminateTimeout;
/**
The timeout waiting for Instruments to start properly.
*/
@property (nonatomic, assign, readonly) NSTimeInterval launchRetryTimeout;
/**
The time waiting for the Instruments launch error message to appear.
*/
@property (nonatomic, assign, readonly) NSTimeInterval launchErrorTimeout;
/**
The total operation duration for the Instruments operation.
*/
@property (nonatomic, assign, readonly) NSTimeInterval operationDuration;
@end
/**
A Value object with the information required to launch an instruments operation.
*/
@interface FBInstrumentsConfiguration : NSObject <NSCopying>
#pragma mark Initializers
/**
Creates and returns a new Configuration with the provided parameters
@param templateName the name of the template
@return a new Configuration Object with the arguments applied.
*/
+ (instancetype)configurationWithTemplateName:(NSString *)templateName targetApplication:(NSString *)targetApplication appEnvironment:(NSDictionary<NSString *, NSString *> *)appEnvironment appArguments:(NSArray<NSString *> *)appArguments toolArguments:(NSArray<NSString *> *)toolArguments timings:(FBInstrumentsTimings *)timings;
- (instancetype)initWithTemplateName:(NSString *)templateName targetApplication:(NSString *)targetApplication appEnvironment:(NSDictionary<NSString *, NSString *> *)appEnvironment appArguments:(NSArray<NSString *> *)appArguments toolArguments:(NSArray<NSString *> *)toolArguments timings:(FBInstrumentsTimings *)timings;
#pragma mark Properties
/**
The template name or path.
*/
@property (nonatomic, copy, readonly) NSString *templateName;
/**
The target application bundle id.
*/
@property (nonatomic, copy, readonly) NSString *targetApplication;
/**
The target application environment.
*/
@property (nonatomic, copy, readonly) NSDictionary<NSString *, NSString *> *appEnvironment;
/**
The arguments to the target application.
*/
@property (nonatomic, copy, readonly) NSArray<NSString *> *appArguments;
/**
Additional arguments.
*/
@property (nonatomic, copy, readonly) NSArray<NSString *> *toolArguments;
/**
All the timings for the Instruments operation.
*/
@property (nonatomic, copy, readonly) FBInstrumentsTimings *timings;
@end
NS_ASSUME_NONNULL_END
|
// copyright (c) 2009-2010 satoshi nakamoto
// copyright (c) 2009-2014 the moorecoin core developers
// distributed under the mit software license, see the accompanying
// file copying or http://www.opensource.org/licenses/mit-license.php.
/**
* utilities for converting data from/to strings.
*/
#ifndef moorecoin_utilstrencodings_h
#define moorecoin_utilstrencodings_h
#include <stdint.h>
#include <string>
#include <vector>
#define begin(a) ((char*)&(a))
#define end(a) ((char*)&((&(a))[1]))
#define ubegin(a) ((unsigned char*)&(a))
#define uend(a) ((unsigned char*)&((&(a))[1]))
#define arraylen(array) (sizeof(array)/sizeof((array)[0]))
/** this is needed because the foreach macro can't get over the comma in pair<t1, t2> */
#define pairtype(t1, t2) std::pair<t1, t2>
std::string sanitizestring(const std::string& str);
std::vector<unsigned char> parsehex(const char* psz);
std::vector<unsigned char> parsehex(const std::string& str);
signed char hexdigit(char c);
bool ishex(const std::string& str);
std::vector<unsigned char> decodebase64(const char* p, bool* pfinvalid = null);
std::string decodebase64(const std::string& str);
std::string encodebase64(const unsigned char* pch, size_t len);
std::string encodebase64(const std::string& str);
std::vector<unsigned char> decodebase32(const char* p, bool* pfinvalid = null);
std::string decodebase32(const std::string& str);
std::string encodebase32(const unsigned char* pch, size_t len);
std::string encodebase32(const std::string& str);
std::string i64tostr(int64_t n);
std::string itostr(int n);
int64_t atoi64(const char* psz);
int64_t atoi64(const std::string& str);
int atoi(const std::string& str);
/**
* convert string to signed 32-bit integer with strict parse error feedback.
* @returns true if the entire string could be parsed as valid integer,
* false if not the entire string could be parsed or when overflow or underflow occurred.
*/
bool parseint32(const std::string& str, int32_t *out);
/**
* convert string to signed 64-bit integer with strict parse error feedback.
* @returns true if the entire string could be parsed as valid integer,
* false if not the entire string could be parsed or when overflow or underflow occurred.
*/
bool parseint64(const std::string& str, int64_t *out);
/**
* convert string to double with strict parse error feedback.
* @returns true if the entire string could be parsed as valid double,
* false if not the entire string could be parsed or when overflow or underflow occurred.
*/
bool parsedouble(const std::string& str, double *out);
template<typename t>
std::string hexstr(const t itbegin, const t itend, bool fspaces=false)
{
std::string rv;
static const char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
rv.reserve((itend-itbegin)*3);
for(t it = itbegin; it < itend; ++it)
{
unsigned char val = (unsigned char)(*it);
if(fspaces && it != itbegin)
rv.push_back(' ');
rv.push_back(hexmap[val>>4]);
rv.push_back(hexmap[val&15]);
}
return rv;
}
template<typename t>
inline std::string hexstr(const t& vch, bool fspaces=false)
{
return hexstr(vch.begin(), vch.end(), fspaces);
}
/**
* format a paragraph of text to a fixed width, adding spaces for
* indentation to any added line.
*/
std::string formatparagraph(const std::string& in, size_t width = 79, size_t indent = 0);
/**
* timing-attack-resistant comparison.
* takes time proportional to length
* of first argument.
*/
template <typename t>
bool timingresistantequal(const t& a, const t& b)
{
if (b.size() == 0) return a.size() == 0;
size_t accumulator = a.size() ^ b.size();
for (size_t i = 0; i < a.size(); i++)
accumulator |= a[i] ^ b[i%b.size()];
return accumulator == 0;
}
#endif // moorecoin_utilstrencodings_h
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "UploadAFPMgrDelegate.h"
@class ShakeItemBase;
@protocol UploadTvFPMgrDelegate <UploadAFPMgrDelegate>
@optional
- (void)OnGetTvItem:(ShakeItemBase *)arg1;
@end
|
#include "keyboard.h"
void keyboard_handler(struct regs *r) {
/* KBDUS means US Keyboard Layout. This is a scancode table
* used to layout a standard US keyboard. I have left some
* comments in to give you an idea of what key is what, even
* though I set it's array index to 0. You can change that to
* whatever you want using a macro, if you wish! */
unsigned char keyboard_map[] =
{
NULL, ESC, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', BACKSPACE,
TAB, 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', ENTER, 0,
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\',
'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0, 0, 0, ' ', 0,
KF1, KF2, KF3, KF4, KF5, KF6, KF7, KF8, KF9, KF10, 0, 0,
KHOME, KUP, KPGUP,'-', KLEFT, '5', KRIGHT, '+', KEND, KDOWN, KPGDN, KINS, KDEL, 0, 0, 0, KF11, KF12 };;
unsigned char kbdusysh[128] =
{
0, 0, '!', '@', '#', '$', '%', '^', '&', '*', /* 9 */
'(', ')', '_', '+', '\b', '\t',
'Q', 'W', 'E', 'R',
'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', /* Enter key */
0, /* 29 - Control */
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 39 */
'"', '¬', 42, /* Left shift */
'\\', 'Z', 'X', 'C', 'V', 'B', 'N', /* 49 */
'M', '<', '>', '?', 0, /* Right shift */
0,
0, /* Alt */
' ', /* Space bar */
58, /* Caps lock */
0, /* 59 - F1 key ... > */
0, 0, 0, 0, 0, 0, 0, 0,
0, /* < ... F10 */
0, /* 69 - Num lock*/
0, /* Scroll Lock */
0, /* Home key */
0, /* Up Arrow */
0, /* Page Up */
'-',
0, /* Left Arrow */
0,
0, /* Right Arrow */
'+',
0, /* 79 - End key*/
0, /* Down Arrow */
0, /* Page Down */
0, /* Insert Key */
0, /* Delete Key */
0, 0, 0,
0, /* F11 Key */
0, /* F12 Key */
0, /* All other keys are undefined */
};
//keyboard_wait_outport();
while ( !(port_byte_in(0x64)&1) );
unsigned char scancode = port_byte_in(KEYBOARD_DATA_REGISTER);
struct KeyboardBuffer* keys = (struct KeyboardBuffer* )keyboard_base;
switch(scancode) {
case KRLEFT_SHIFT: case KRRIGHT_SHIFT:
keys->SHIFT = 1;
return;
case KRLEFT_ALT:
keys->ALT = 1;
return;
case KRLEFT_CTRL:
keys->CTRL = 1;
return;
case KRCAPS_LOCK:
keys->SHIFT = ~keys->SHIFT;
return;
}
unsigned char key;
if(keys->SHIFT) {
key = kbdusysh[scancode & 0x7f];
} else {
key = keyboard_map[scancode & 0x7f];
}
// char str_scancode[get_num_digits(scancode & 0x7f) + 1];
// itoa(scancode & 0x7f, str_scancode);
// print(str_scancode);
// char str_key[get_num_digits(key) + 1];
// itoa(key, str_key);
// print(str_key);
// printch('b');
// printch(key);
if(scancode & 0x80) {
//KEY UP
// print("KEY UP\n");
switch(scancode&0x7f) {
case KRLEFT_SHIFT: case KRRIGHT_SHIFT:
keys->SHIFT = 0;
break;
case KRLEFT_ALT:
keys->ALT = 0;
break;
case KRLEFT_CTRL:
keys->CTRL = 0;
break;
}
return;
}
switch(key) {
case BACKSPACE:
if(keys->i == 0) {
break;
}
keys->buffer[keys->i--] = 0;
backspace();
break;
case ENTER:
keys->buffer[keys->i++] = 0;
printch(ENTER);
runCommand(keys->buffer); //runCommand can't be blocking
clearKeys();
printCurrentDir();
break;
case '\t':
keys->buffer[keys->i++] = ' ';
keys->buffer[keys->i++] = ' ';
keys->buffer[keys->i++] = ' ';
keys->buffer[keys->i++] = ' ';
printch('\t');
break;
case KUP:
if(keys->CTRL) {
// Scroll up
if(!isTopOfScreen()) {
shiftAndUpdateAll(-MAX_COLS*2);
}
} else {
// Repeat last command up
}
break;
case KDOWN:
if(keys->CTRL) {
// Scroll down
if(!isBottomOfScreen()) {
shiftAndUpdateAll(MAX_COLS*2);
}
} else {
// Repeat last command down
}
break;
default:
keys->buffer[keys->i++] = key;
printch(key);
break;
}
}
void keyboard_install() {
//Allocate the buffer
struct KeyboardBuffer* keys = (struct KeyboardBuffer *) keyboard_base;
keys->buffer = malloc(BufferLen);
keys->i = 0;
//Install the keyboard handler to IRQ1
irq_install_handler(1, keyboard_handler);
}
void clearKeys() {
struct KeyboardBuffer* keys = (struct KeyboardBuffer *) keyboard_base;
memory_set(keys->buffer, 0x00, keys->i);
keys->i = 0;
}
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "CDStructures.h"
#import "DVTInvalidation-Protocol.h"
@class DVTDevice, DVTStackBacktrace, IDERunOperation, IDETestRunner, NSMutableArray, NSString;
@interface _IDETestResultsProcessor : NSObject <DVTInvalidation>
{
BOOL _finished;
IDETestRunner *_testRunner;
NSString *_targetArchitecture;
DVTDevice *_targetDevice;
IDERunOperation *_operation;
NSMutableArray *_validatorsStack;
}
+ (void)initialize;
@property(retain) NSMutableArray *validatorsStack; // @synthesize validatorsStack=_validatorsStack;
@property BOOL finished; // @synthesize finished=_finished;
@property(readonly) IDERunOperation *operation; // @synthesize operation=_operation;
@property(retain) DVTDevice *targetDevice; // @synthesize targetDevice=_targetDevice;
@property(retain) NSString *targetArchitecture; // @synthesize targetArchitecture=_targetArchitecture;
@property(retain) IDETestRunner *testRunner; // @synthesize testRunner=_testRunner;
- (BOOL)validateEvent:(int)arg1 error:(id *)arg2;
- (void)initializeValidatorsStack;
- (id)initWithTestRunOperation:(id)arg1 forTestRunner:(id)arg2;
- (void)primitiveInvalidate;
// Remaining properties
@property(retain) DVTStackBacktrace *creationBacktrace;
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) DVTStackBacktrace *invalidationBacktrace;
@property(readonly) Class superclass;
@property(readonly, nonatomic, getter=isValid) BOOL valid;
@end
|
//
// XRBookDetailContentCell.h
// XinranReadingGroup
//
// Created by dreamer on 15/5/12.
// Copyright (c) 2015年 SnowWolf. All rights reserved.
//
#import <UIKit/UIKit.h>
@class XRBookEntity;
@class XRBookDetailEntity;
@interface XRBookDetailContentCell : UITableViewCell
@property (nonatomic, strong) XRBookDetailEntity *data;
@property (weak, nonatomic) IBOutlet UITextView *content;
+ (CGFloat)cellHeight:(XRBookDetailEntity *)data;
@end
|
//
// GPGKSMapPointInitializer.h
// mapcache-ios
//
// Created by Brian Osborn on 8/18/15.
// Copyright (c) 2015 NGA. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GPKGMapPointInitializer.h"
#import "GPKGSMapPointDataTypes.h"
@interface GPGKSMapPointInitializer : NSObject <GPKGMapPointInitializer>
@property (nonatomic) enum GPKGSMapPointDataType pointType;
-(instancetype) initWithPointType: (enum GPKGSMapPointDataType) pointType;
@end
|
//
// AppDelegate.h
// LoginOperation
//
// Created by Sravan on 21/10/16.
// Copyright © 2016 tcs. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// MUKXMedia.h
// MpegUrlKit
//
// Created by Hinagiku Soranoba on 2017/01/14.
// Copyright © 2017年 Hinagiku Soranoba. All rights reserved.
//
#import "MUKAttributeModel.h"
#import "MUKErrorCode.h"
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, MUKXMediaType) {
MUKXMediaTypeUnknown = 0,
MUKXMediaTypeAudio = 1,
MUKXMediaTypeVideo,
MUKXMediaTypeSubtitles,
MUKXMediaTypeClosedCaptions
};
/**
* 4.3.4.1. EXT-X-MEDIA
* It is an information of rendition.
*/
@interface MUKXMedia : MUKAttributeModel <MUKAttributeSerializing>
/// Type of the Rendition.
///
/// MUKXMediaTypeUnknown MUST NOT be specified.
@property (nonatomic, assign, readonly) MUKXMediaType mediaType;
/// the URI that specified a Media Playlist file of the Rendition.
///
/// If mediaType is MUKXMediaTypeClosedCaptions, uri MUST be nil.
@property (nonatomic, nullable, copy, readonly) NSURL* uri;
/// Specified a group of Renditions.
///
/// A Group of Renditions has the same groupId and the same mediaType.
@property (nonatomic, nonnull, copy, readonly) NSString* groupId;
/// The primary language used in the Rendition.
///
/// The format is language tag (RFC5646).
@property (nonatomic, nullable, copy, readonly) NSString* language;
/// Associated language used in the Rendition.
///
/// The format is language tag (RFC5646).
@property (nonatomic, nullable, copy, readonly) NSString* associatedLanguage;
/// A Human-readable description of the Rendition.
@property (nonatomic, nonnull, copy, readonly) NSString* name;
/// The Rendition with the value YES is selected if client is not specified by the user.
@property (nonatomic, assign, readonly, getter=isDefaultRendition) BOOL defaultRendition;
/// If the value is YES, the client may automatically select when user does not specify.
///
/// The value MUST be YES, if isDefaultRendition is YES.
@property (nonatomic, assign, readonly, getter=canAutoSelect) BOOL autoSelect;
/// If this value is YES, the Rendition contains content that is considered essential to play.
///
/// If mediaType is MUKXMediaTypeSubtitles, this value MUST be NO.
@property (nonatomic, assign, readonly) BOOL forced;
/// The value specifies a Rendition within the segments in the Media Playlist.
/// If mediaType is MUKXMediaTypeClosedCaptions, this value is REQUIRED. Otherwise, it MUST be nil.
///
/// This value only support CC1, CC2 ... CC4 and SERVICE1, SERVICE2 ... SERVICE63.
@property (nonatomic, nullable, copy, readonly) NSString* instreamId;
/// Array of Uniform Type Identifiers (UTI)
@property (nonatomic, nullable, copy, readonly) NSArray<NSString*>* characteristics;
/// Audio channels.
/// This value is array of unsigned integer.
///
/// All audio rendition SHOULD have this value.
/// If a Master Playlist contains multiple renditions with the same codec but a different number of channels, this value is REQUIRED.
@property (nonatomic, nullable, copy, readonly) NSArray<NSNumber*>* channels;
#pragma mark - Lifecycle
/**
* Create an instance
* Please refer to MUKXMedia property documents.
*
* @param mediaType TYPE field. MUKXMediaTypeUnknown MUST NOT be specified.
* @param uri URI field.
* @param groupId GROUP-ID field.
* @param language LANGUAGE field.
* @param associatedLanguage ASSOC-LANGUAGE field.
* @param name NAME field.
* @param isDefaultRendition DEFAULT field.
* @param canAutoSelect AUTOSELECT field.
* @param forced FORCED field.
* @param instreamId INSTREAM-ID filed.
* @param characteristics CHARACTERISTICS filed.
* @param channels CHANNELS filed.
* @return instance
*/
- (instancetype _Nullable)initWithType:(MUKXMediaType)mediaType
uri:(NSURL* _Nullable)uri
groupId:(NSString* _Nonnull)groupId
language:(NSString* _Nullable)language
associatedLanguage:(NSString* _Nullable)associatedLanguage
name:(NSString* _Nonnull)name
isDefaultRendition:(BOOL)isDefaultRendition
canAutoSelect:(BOOL)canAutoSelect
forced:(BOOL)forced
instreamId:(NSString* _Nullable)instreamId
characteristics:(NSArray<NSString*>* _Nullable)characteristics
channels:(NSArray<NSNumber*>* _Nullable)channels;
#pragma mark - Public Methods
/**
* Convert to MUKXMediaType from NSString.
*
* @param string An enumerated-string
* @return Return MUKXMediaTypeUnknown, if the string is not supported string.
* Otherwise, return converted enumerated-value.
*/
+ (MUKXMediaType)mediaTypeFromString:(NSString* _Nonnull)string;
/**
* Convert to NSString from MUKXMediaType.
*
* @param mediaType An enumerated-value
* @return Return nil, if the method is MUKXMediaTypeUnknown (or not enumerated-value).
* Otherwise, return an enumerated-string.
*/
+ (NSString* _Nullable)mediaTypeToString:(MUKXMediaType)mediaType;
@end
|
// Includes
#include <stdio.h>
#include <string.h>
#include <CUnit/Basic.h>
#include "gbotut_data_test.h"
#include "gbstut_statemachine_test.h"
/* The suite initialization function.
* * Returns zero on success, non-zero otherwise.
* */
int init_suite1(void)
{
return 0;
}
/* The suite cleanup function.
* * Closes the temporary file used by the tests.
* * Returns zero on success, non-zero otherwise.
* */
int clean_suite1(void)
{
return 0;
}
/* The main() function for setting up and running the tests.
* * Returns a CUE_SUCCESS on successful running, another
* * CUnit error code on failure.
* */
int main()
{
CU_pSuite pSuite = NULL;
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* add a suite to the registry */
pSuite = CU_add_suite(__FILE__, init_suite1, clean_suite1);
if (NULL == pSuite) {
CU_cleanup_registry();
return CU_get_error();
}
/* add the tests to the suite */
if (
CU_ADD_TEST(pSuite, gbotut_DataInitTest) ||
CU_ADD_TEST(pSuite, gbstut_StateMachineTest) ||
CU_ADD_TEST(pSuite, gbstut_StateMachineTestFail) ||
NULL //for copy and paste above line purposes
)
{
CU_cleanup_registry();
return CU_get_error();
}
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}
|
//
// ViewController.h
// Demo
//
// Created by LiuXubin on 15/12/22.
// Copyright © 2015年 Sim Pods. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#include "../include/m_main.h"
extern int m_argc;
extern char **m_argv;
int main(int argc, char **argv)
{
m_argc = argc;
m_argv = argv;
M_gameinit();
return 0;
}
|
//
// STAudioTemporaryBuffer.h
// STRTMPAudioPlayer
//
// Created by saiten on 2015/02/14.
// Copyright (c) 2015 saiten. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface STAudioTemporaryBuffer : NSObject
@property (nonatomic, readonly) Float32 sampleRate;
- (instancetype)initWithSampleRate:(Float32)sampleRate;
- (instancetype)initWithSampleRate:(Float32)sampleRate bufferSize:(NSUInteger)bufferSize;
+ (instancetype)temporaryBufferWithSampleRate:(Float32)sampleRate;
+ (instancetype)temporaryBufferWithSampleRate:(Float32)sampleRate bufferSize:(NSUInteger)bufferSize;
- (void)pushSamples:(Float32 *)samples count:(NSUInteger)count;
@end
|
/*
* board.h
*
* Created on: Oct 1, 2014
* Author: Kyle Van Berendonck
*/
#ifndef BOARD_H_
#define BOARD_H_
#define PLAYER_ONE 0
#define PLAYER_TWO 1
#define PLAYER_COUNT 2
#define TIE (PLAYER_COUNT)
#define BOARD_WIDTH 3
#define BOARD_HEIGHT 3
/**
* Resets the playing field.
*/
void board_reset(void);
/**
* Returns a bitfield representation of the given players turns.
* @param player The player to fetch the turns for.
* @return The turns.
*/
unsigned board_getPlayerTurns(int player);
/**
* Appends a turn to the given player at the given co-ordinates.
* @param player The player to append to.
* @param x The x-position of the move (0 .. BOARD_WIDTH-1)
* @param y The y-position of the move (0 .. BOARD_HEIGHT-1)
*/
void board_appendPlayerTurn(int player, int x, int y);
/**
* Returns whether the given player has any winning combinations of moves.
* @param player The player to check.
* @return Whether the player won.
*/
int board_hasPlayerWon(int player);
/**
* Returns whether the playing field is occupied at the given position.
* @param x The x-position to check.
* @param y The y-position to check.
* @return Whether the position was occupied.
*/
int board_isOccupied(int x, int y);
/**
* Enables or disables the rendering of the cursor.
* @param visible Whether the cursor should be visible or not.
*/
void board_setCursorVisible(int visible);
/**
* Returns the left co-ordinate of the cursors position.
* @return Cursor left co-ord.
*/
int board_getCursorLeft(void);
/**
* Updates the left co-ordinate of the cursors position. Position is snapped to board.
*/
void board_setCursorLeft(int left);
/**
* Returns the top co-ordinate of the cursors position.
* @return Cursor top co-ord.
*/
int board_getCursorTop(void);
/**
* Updates the top co-ordinate of the cursors position. Position is snapped to board.
*/
void board_setCursorTop(int top);
/**
* Renders the board.
* @param background The background color to use for erasing partials.
* @param lines Whether to re-render lines.
* @param cursor Whether to re-render the cursor.
* @param moves Whether to re-render the moves.
*/
void board_render(int background, int lines, int cursor, int moves);
#endif /* BOARD_H_ */
|
//
// QPTRefreshFooter.h
// QiPinTong
//
// Created by 企聘通 on 2017/5/20.
// Copyright © 2017年 ShiJiJiaLian. All rights reserved.
//
#import <MJRefresh/MJRefresh.h>
@interface QPTRefreshFooter : MJRefreshAutoNormalFooter
@end
|
#include <stdio.h>
// [0, 1, 0, 3, 13]
// [1, 1, 1, 0]
void moveZeroes(int* nums, int numsSize) {
int *n = nums;
for (int i = 0; i < numsSize; i++) {
if (n[i] != 0)
continue;
for (int j = i + 1; j < numsSize; j++) {
if (n[j] != 0 ) {
n[i] = n[j];
n[j] = 0;
break;
}
}
}
}
int main(void) {
int a[] = {0, 1, 0, 3, 12};
moveZeroes(a, 5);
for (int i = 0; i < 5; i++) {
printf("%d ", a[i]);
}
}
|
#ifndef COORDIN_H_
#define COORDIN_H_
struct polar
{
double distance;
double angle;
};
struct rect
{
double x;
double y;
};
polar rect_to_polar(rect xypos);
void show_polar(polar dapos);
#endif |
//
// Phone.h
// 1125_week4_day2
//
// Created by zx on 11/25/14.
// Copyright (c) 2014 zx. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum {
ColorWithBlack=1,
ColorWithWhite,
ColorWithGold
}Color;
@interface Phone : NSObject
{
Color _color;
}
-(void)printColor:(Color)color;
+ (char *)colorFromEnumColor:(Color)color;
@end
|
extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
void error(void)
{
{
ERROR: __VERIFIER_error();
return;
}
}
int b0_val ;
int b0_val_t ;
int b0_ev ;
int b0_req_up ;
int b1_val ;
int b1_val_t ;
int b1_ev ;
int b1_req_up ;
int d0_val ;
int d0_val_t ;
int d0_ev ;
int d0_req_up ;
int d1_val ;
int d1_val_t ;
int d1_ev ;
int d1_req_up ;
int z_val ;
int z_val_t ;
int z_ev ;
int z_req_up ;
int comp_m1_st ;
int comp_m1_i ;
void method1(void)
{ int s1 ;
int s2 ;
int s3 ;
{
if (b0_val) {
if (d1_val) {
s1 = 0;
} else {
s1 = 1;
}
} else {
s1 = 1;
}
if (d0_val) {
if (b1_val) {
s2 = 0;
} else {
s2 = 1;
}
} else {
s2 = 1;
}
if (s2) {
s3 = 0;
} else {
if (s1) {
s3 = 0;
} else {
s3 = 1;
}
}
if (s2) {
if (s1) {
s2 = 1;
} else {
s2 = 0;
}
} else {
s2 = 0;
}
if (s2) {
z_val_t = 0;
} else {
if (s3) {
z_val_t = 0;
} else {
z_val_t = 1;
}
}
z_req_up = 1;
comp_m1_st = 2;
return;
}
}
int is_method1_triggered(void)
{ int __retres1 ;
{
if ((int )b0_ev == 1) {
__retres1 = 1;
goto return_label;
} else {
if ((int )b1_ev == 1) {
__retres1 = 1;
goto return_label;
} else {
if ((int )d0_ev == 1) {
__retres1 = 1;
goto return_label;
} else {
if ((int )d1_ev == 1) {
__retres1 = 1;
goto return_label;
} else {
}
}
}
}
__retres1 = 0;
return_label: /* CIL Label */
return (__retres1);
}
}
void update_b0(void)
{
{
if ((int )b0_val != (int )b0_val_t) {
b0_val = b0_val_t;
b0_ev = 0;
} else {
}
b0_req_up = 0;
return;
}
}
void update_b1(void)
{
{
if ((int )b1_val != (int )b1_val_t) {
b1_val = b1_val_t;
b1_ev = 0;
} else {
}
b1_req_up = 0;
return;
}
}
void update_d0(void)
{
{
if ((int )d0_val != (int )d0_val_t) {
d0_val = d0_val_t;
d0_ev = 0;
} else {
}
d0_req_up = 0;
return;
}
}
void update_d1(void)
{
{
if ((int )d1_val != (int )d1_val_t) {
d1_val = d1_val_t;
d1_ev = 0;
} else {
}
d1_req_up = 0;
return;
}
}
void update_z(void)
{
{
if ((int )z_val != (int )z_val_t) {
z_val = z_val_t;
z_ev = 0;
} else {
}
z_req_up = 0;
return;
}
}
void update_channels(void)
{
{
if ((int )b0_req_up == 1) {
{
update_b0();
}
} else {
}
if ((int )b1_req_up == 1) {
{
update_b1();
}
} else {
}
if ((int )d0_req_up == 1) {
{
update_d0();
}
} else {
}
if ((int )d1_req_up == 1) {
{
update_d1();
}
} else {
}
if ((int )z_req_up == 1) {
{
update_z();
}
} else {
}
return;
}
}
void init_threads(void)
{
{
if ((int )comp_m1_i == 1) {
comp_m1_st = 0;
} else {
comp_m1_st = 2;
}
return;
}
}
int exists_runnable_thread(void)
{ int __retres1 ;
{
if ((int )comp_m1_st == 0) {
__retres1 = 1;
goto return_label;
} else {
}
__retres1 = 0;
return_label: /* CIL Label */
return (__retres1);
}
}
void eval(void)
{ int tmp ;
int tmp___0 ;
{
{
while (1) {
while_0_continue: /* CIL Label */ ;
{
tmp___0 = exists_runnable_thread();
}
if (tmp___0) {
} else {
goto while_0_break;
}
if ((int )comp_m1_st == 0) {
{
tmp = __VERIFIER_nondet_int();
}
if (tmp) {
{
comp_m1_st = 1;
method1();
}
} else {
}
} else {
}
}
while_0_break: /* CIL Label */ ;
}
return;
}
}
void fire_delta_events(void)
{
{
if ((int )b0_ev == 0) {
b0_ev = 1;
} else {
}
if ((int )b1_ev == 0) {
b1_ev = 1;
} else {
}
if ((int )d0_ev == 0) {
d0_ev = 1;
} else {
}
if ((int )d1_ev == 0) {
d1_ev = 1;
} else {
}
if ((int )z_ev == 0) {
z_ev = 1;
} else {
}
return;
}
}
void reset_delta_events(void)
{
{
if ((int )b0_ev == 1) {
b0_ev = 2;
} else {
}
if ((int )b1_ev == 1) {
b1_ev = 2;
} else {
}
if ((int )d0_ev == 1) {
d0_ev = 2;
} else {
}
if ((int )d1_ev == 1) {
d1_ev = 2;
} else {
}
if ((int )z_ev == 1) {
z_ev = 2;
} else {
}
return;
}
}
void activate_threads(void)
{ int tmp ;
{
{
tmp = is_method1_triggered();
}
if (tmp) {
comp_m1_st = 0;
} else {
}
return;
}
}
int stop_simulation(void)
{ int tmp ;
int __retres2 ;
{
{
tmp = exists_runnable_thread();
}
if (tmp) {
__retres2 = 0;
goto return_label;
} else {
}
__retres2 = 1;
return_label: /* CIL Label */
return (__retres2);
}
}
void start_simulation(void)
{ int kernel_st ;
int tmp ;
{
{
kernel_st = 0;
update_channels();
init_threads();
fire_delta_events();
activate_threads();
reset_delta_events();
}
{
while (1) {
while_1_continue: /* CIL Label */ ;
{
kernel_st = 1;
eval();
}
{
kernel_st = 2;
update_channels();
}
{
kernel_st = 3;
fire_delta_events();
activate_threads();
reset_delta_events();
tmp = stop_simulation();
}
if (tmp) {
goto while_1_break;
} else {
}
}
while_1_break: /* CIL Label */ ;
}
return;
}
}
void init_model(void)
{
{
b0_val = 0;
b0_ev = 2;
b0_req_up = 0;
b1_val = 0;
b1_ev = 2;
b1_req_up = 0;
d0_val = 0;
d0_ev = 2;
d0_req_up = 0;
d1_val = 0;
d1_ev = 2;
d1_req_up = 0;
z_val = 0;
z_ev = 2;
z_req_up = 0;
b0_val_t = 1;
b0_req_up = 1;
b1_val_t = 1;
b1_req_up = 1;
d0_val_t = 1;
d0_req_up = 1;
d1_val_t = 1;
d1_req_up = 1;
comp_m1_i = 0;
return;
}
}
int main(void)
{ int __retres1 ;
{
{
init_model();
start_simulation();
}
if (! ((int )z_val == 0)) {
{
error();
}
} else {
}
__retres1 = 0;
return (__retres1);
}
}
|
#include "k.h"
#define GPIO_C_SET 0xB0010244
#define GPIO_C_CLEAR 0xB0010248
#define GPIO_F_SET 0xB0010544
#define GPIO_F_CLEAR 0xB0010548
#define GPIO_F_LED_PIN (1 << 15)
Sys sys;
C0 c0;
#define SYS ((Sys*)((uint)&sys | KSEG1))
void
delay_cache(int n)
{
int i;
for(i = 0; i < n; i++)
;
}
void (*delay)(int n) = (void(*)(int))((uintptr)delay_cache + 0x20000000);
void
ledloop(void)
{
for(;;){
PUT32(GPIO_F_CLEAR, GPIO_F_LED_PIN);
delay(1000000);
PUT32(GPIO_F_SET, GPIO_F_LED_PIN);
delay(1000000);
}
}
void
ledloopC(void)
{
for(;;){
PUT32(GPIO_F_CLEAR, GPIO_F_LED_PIN);
delay_cache(1000000);
PUT32(GPIO_F_SET, GPIO_F_LED_PIN);
delay_cache(1000000);
}
}
void
tlbExcept(void)
{
printf("TLB exception\n");
ledloop();
}
void
cacheExcept(void)
{
printf("cache exception\n");
ledloop();
}
enum ExcCodes
{
ExcInt,
ExcMod,
ExcTLBL,
ExcTLBS,
ExcAdEL,
ExcAdES,
ExcIBE,
ExcDBE,
ExcSys,
ExcBp,
ExcRI,
ExcCpU,
ExcOv,
ExcTr,
ExcMSAFPE,
ExcFPE,
Exc10,
Exc11,
ExcC2E,
ExcTLBRI,
ExcTLBXI,
ExcMSADis,
ExcMDMX,
ExcWatch,
ExcMCheck,
ExcThread,
ExcDSPDis,
ExcGE,
Exc1c,
Exc1d,
ExcCacheErr,
Exc1f,
};
static char *excnames[] = {
"Int",
"Mod",
"TLBL",
"TLBS",
"AdEL",
"AdES",
"IBE",
"DBE",
"Sys",
"Bp",
"RI",
"CpU",
"Ov",
"Tr",
"MSAFPE",
"FPE",
"-- 0x10",
"-- 0x11",
"C2E",
"TLBRI",
"TLBXI",
"MSADis",
"MDMX",
"WATCH",
"MCheck",
"Thread",
"DSPDis",
"GE",
"-- 0x1c",
"-- 0x1d",
"CacheErr",
"-- 0x1f",
};
void
interrupt(Context *ctx)
{
printf("interrupt\n");
printf(" %p %p %p\n", ctx->status, ctx->cause, ctx->epc);
timerint();
}
void
generalExcept(Context *ctx)
{
int exccode;
exccode = ctx->cause>>2 & 0x1F;
printf("> general exception %s\n> ", excnames[exccode]);
printf("um:%x erl:%x exl:%x ie:%x cause:%x epc:%x\n",
!!(ctx->status & 0x10),
!!(ctx->status & 0x4),
!!(ctx->status & 0x2),
!!(ctx->status & 0x1),
ctx->cause, ctx->epc);
printf("> %d\n", ctx->status>>21 & 1);
switch(exccode){
case ExcInt:
interrupt(ctx);
break;
case ExcSys:
printf(" SYSTEM CALL!\n");
ctx->epc += 4;
break;
default:
printf("> %x %x\n", c0.entryhi, c0.index);
ledloop();
}
}
int num = 0;
#define num_C (*(int*)((uint)&num | KSEG1))
void
main(void)
{
delay(10000);
inituart();
printf("highmark: %x numpages: %x\n", SYS->highmark, SYS->numpages);
printf("hello from proc %d\n", cpu->number);
printf("cache: %x tlb: %x kernelStack: %p\n", cpu->cachePolicy, cpu->TLBsize, cpu->kernelStack);
getc0regs(&c0);
printf("%p %p\n", c0.ebase, c0.intctl);
printconfig();
printsomeregs();
enableint();
timer();
dosyscall();
// startprocB();
for(;0;){
delay(100000);
printf("%d\n", num);
}
ledloop();
}
void
mainB(void)
{
printf("hello from proc %d\n", cpu->number);
printf("cache: %x tlb: %x kernelStack: %p\n", cpu->cachePolicy, cpu->TLBsize, cpu->kernelStack);
getc0regs(&c0);
printf("%p %p\n", c0.ebase, c0.intctl);
for(;;)
num++;
ledloopC();
ledloop();
}
|
#ifndef UI_FONTRENDERER_H
#define UI_FONTRENDERER_H
#include "Vajra/Engine/Ui/Definitions.h"
#include "Vajra/Common/Components/Component.h"
#include "Vajra/Engine/Components/DerivedComponents/Renderer/Renderer.h"
#include <memory>
#include <string>
// Forward Declarations:
class Object;
class Mesh;
class UiFontType;
// Not exposing this as a Component that can be added via XML since it is exposed only via the UiELement which is exposed adequately by the .uiscene files
class UiFontRenderer : public Renderer {
public:
UiFontRenderer();
UiFontRenderer(Object* object_);
virtual ~UiFontRenderer();
static inline ComponentIdType GetTypeId() { return Renderer::GetTypeId(); }
// @Override
virtual void HandleMessage(MessageChunk messageChunk);
// @Override
virtual void Draw();
inline std::string GetTextToDisplay() { return this->textToDisplay; }
inline glm::vec4 GetDiffuseColor () { return this->diffuseColor; }
inline void SetHasTransperancy(bool hasTransperancy_);
inline float GetWidth () { return this->actual_width; }
inline float GetHeight() { return this->actual_height; }
private:
void init();
void destroy();
void initTextToDisplay(std::string text, unsigned int width, unsigned int height, std::string pathToFontSpecificationFile, float fontSize_, UiFontAlignment_type fontAlignment_ = UI_FONT_ALIGNMENT_left);
void changeText(std::string text);
//
inline void setDiffuseColor (glm::vec4 color) { this->diffuseColor = color; }
// Utility Functions:
void makeText();
float makeACharacter(int charIdxInAscii, int letterIdx, float woffset);
void initVbos();
std::string textToDisplay;
GLuint vboPositions;
GLuint vboTextureCoords;
GLuint vboIndices;
unsigned int numVertices;
glm::vec3* vertices;
glm::vec2* textureCoords;
std::vector<unsigned int> indices;
glm::vec4 diffuseColor;
std::shared_ptr<UiFontType> fontType;
float actual_width;
float actual_height;
//
float required_width;
float required_height;
//
float unscaled_width;
float unscaled_height;
float fontSize;
UiFontAlignment_type fontAlignment;
// Friended to UiObject so as not to have to expose initPlane(), etc
friend class UiFontObject;
};
////////////////////////////////////////////////////////////////////////////////
// Inline functions:
void UiFontRenderer::SetHasTransperancy(bool hasTransperancy_) {
Renderer::setHasTransperancy(hasTransperancy_);
}
#endif // UI_RENDERER_H
|
//
// MLSConfigForm.h
// MinLison
//
// Created by MinLison on 2017/11/17.
// Copyright © 2017年 minlison. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "FXForms.h"
@interface MLSConfigForm : NSObject <FXForm>
@property(nonatomic, copy) NSString *serverAddress25;
@property(nonatomic, copy) NSString *serverAddress40;
@property(nonatomic, copy) NSString *serverAddressTest;
@property(nonatomic, copy) NSString *serverAddressPreProduct;
@property(nonatomic, copy) NSString *serverAddressOnline;
@property(nonatomic, assign) BOOL showDebugView;
@property(nonatomic, copy) NSString *logout;
@property(nonatomic, copy) NSString *clearCache;
@property(nonatomic, copy) NSString *gotoOnlineApp;
@end
|
#pragma once
#include <cstddef>
namespace scratch {
template<class T>
struct counted_copying_iterator {
using value_type = T;
using difference_type = ptrdiff_t;
using pointer = const T *;
using reference = const T&;
using iterator_category = random_access_iterator_tag;
explicit counted_copying_iterator() noexcept = default;
explicit counted_copying_iterator(size_t c, const T& t) noexcept : m_count(c), m_t(&t) {}
const T& operator*() const noexcept { return *m_t; }
const T *operator->() const noexcept { return m_t; }
const T& operator[](difference_type) const noexcept { return m_t; }
auto& operator+=(int i) noexcept { m_count -= i; return *this; }
auto& operator++() noexcept { return *this += 1; }
auto operator++(int) noexcept { auto old = *this; ++*this; return old; }
auto& operator-=(int i) noexcept { m_count += i; return *this; }
auto& operator--() noexcept { return *this -= 1; }
auto operator--(int) noexcept { auto old = *this; --*this; return old; }
difference_type operator-(const counted_copying_iterator& rhs) const noexcept { return rhs.m_count - m_count; }
bool operator==(const counted_copying_iterator& rhs) const noexcept { return m_count == rhs.m_count; }
bool operator!=(const counted_copying_iterator& rhs) const noexcept { return m_count != rhs.m_count; }
private:
size_t m_count = 0;
const T *m_t = nullptr;
};
template<class T> auto operator-(counted_copying_iterator<T> a, ptrdiff_t b) noexcept { a -= b; return a; }
template<class T> auto operator+(counted_copying_iterator<T> a, ptrdiff_t b) noexcept { a += b; return a; }
template<class T> auto operator+(ptrdiff_t b, counted_copying_iterator<T> a) noexcept { a += b; return a; }
} // namespace scratch
|
#import <UIKit/UIKit.h>
#import <libARDiscovery/ARDISCOVERY_BonjourDiscovery.h>
@interface CellData : NSObject
@property (nonatomic, strong) ARService* service;
@property (nonatomic, strong) NSString* name;
@end
@interface DroneListViewController : UIViewController
@end |
//
// DateCell.h
// ATNDEasy
//
// Created by sonson on 10/11/12.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "EventBaseCell.h"
@interface DateCellContent : EventBaseContent {
}
@end
@interface DateCell : EventBaseCell {
}
@end
|
#ifndef SRC_NODE_WRAP_H_
#define SRC_NODE_WRAP_H_
#include "env.h"
#include "env-inl.h"
#include "js_stream.h"
#include "pipe_wrap.h"
#include "tcp_wrap.h"
#include "tty_wrap.h"
#include "udp_wrap.h"
#include "util.h"
#include "util-inl.h"
#include "uv.h"
#include "v8.h"
namespace node {
#define WITH_GENERIC_UV_STREAM(env, obj, BODY, ELSE) \
do { \
if (env->tcp_constructor_template().IsEmpty() == false && \
env->tcp_constructor_template()->HasInstance(obj)) { \
TCPWrap* const wrap = Unwrap<TCPWrap>(obj); \
BODY \
} else if (env->tty_constructor_template().IsEmpty() == false && \
env->tty_constructor_template()->HasInstance(obj)) { \
TTYWrap* const wrap = Unwrap<TTYWrap>(obj); \
BODY \
} else if (env->pipe_constructor_template().IsEmpty() == false && \
env->pipe_constructor_template()->HasInstance(obj)) { \
PipeWrap* const wrap = Unwrap<PipeWrap>(obj); \
BODY \
} else { \
ELSE \
} \
} while (0)
#define WITH_GENERIC_STREAM(env, obj, BODY) \
do { \
WITH_GENERIC_UV_STREAM(env, obj, BODY, { \
if (env->tls_wrap_constructor_template().IsEmpty() == false && \
env->tls_wrap_constructor_template()->HasInstance(obj)) { \
TLSWrap* const wrap = Unwrap<TLSWrap>(obj); \
BODY \
} else if (env->jsstream_constructor_template().IsEmpty() == false && \
env->jsstream_constructor_template()->HasInstance(obj)) { \
JSStream* const wrap = Unwrap<JSStream>(obj); \
BODY \
} \
}); \
} while (0)
inline uv_stream_t* HandleToStream(Environment* env,
v8::Local<v8::Object> obj) {
v8::HandleScope scope(env->isolate());
WITH_GENERIC_UV_STREAM(env, obj, {
return reinterpret_cast<uv_stream_t*>(wrap->UVHandle());
}, {});
return nullptr;
}
} // namespace node
#endif // SRC_NODE_WRAP_H_
|
#ifndef _ACTIONS_H_
#define _ACTIONS_H_
extern long unsigned int GP_line;
void GP_add_xp(void *arg, int num);
void GP_add_ps(void *arg, int num);
void GP_add_vertex_i(void *arg, int v, int label);
void GP_add_vertex_f(void *arg, int v, double label);
void GP_add_vertex_s(void *arg, int v, char *label);
void GP_add_edge_i(void *arg, int type, int src, int dst, int label);
void GP_add_edge_f(void *arg, int type, int src, int dst, double label);
void GP_add_edge_s(void *arg, int type, int src, int dst, char *label);
void GP_read_graph(FILE *input);
#endif
|
//------------------------------------------------------------------------------
// <copyright project="BEmu_cpp" file="headers/HistoricalDataRequest/HistoricElementDateTime.h" company="Jordan Robinson">
// Copyright (c) 2013 Jordan Robinson. All rights reserved.
//
// The use of this software is governed by the Microsoft Public License
// which is included with this distribution.
// </copyright>
//------------------------------------------------------------------------------
#pragma once
#include "BloombergTypes/ElementPtr.h"
#include "Types/CanConvertToStringType.h"
namespace BEmu
{
namespace HistoricalDataRequest
{
class HistoricElementDateTime : public ElementPtr, public CanConvertToStringType
{
private:
Datetime _value;
public:
HistoricElementDateTime(const Datetime& value);
~HistoricElementDateTime();
virtual Name name() const;
virtual size_t numValues() const { return 1; }
virtual size_t numElements() const { return 0; }
virtual bool isNull() const { return false; }
virtual bool isArray() const { return false; }
virtual bool isComplexType() const { return false; }
virtual Datetime getValueAsDatetime(int index) const;
virtual const char * getValueAsString(int index) const;
virtual std::ostream& print(std::ostream& stream, int level, int spacesPerLevel) const;
};
}
} |
/*
**==============================================================================
**
** Copyright (c) 2003, 2004, 2005, 2006, Michael Brasher, Karl Schopmeyer
**
** 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.
**
**==============================================================================
*/
#ifndef _cimple_Time_h
#define _cimple_Time_h
#include "config.h"
/*
ATTN: get rid of this!
*/
#if defined(CIMPLE_PLATFORM_SOLARIS_SPARC_GNU)
# ifdef SEC
# undef SEC
# endif
#endif
CIMPLE_NAMESPACE_BEGIN
struct CIMPLE_CIMPLE_LINKAGE Time
{
public:
/// Static constant to define one micosecond as uint64 variable
static const uint64 USEC;
/// static constant to define one millisecond as uint64 variable
static const uint64 MSEC;
/// static constant to define one second as uint64 variable
static const uint64 SEC;
/** Returns microseconds elapsed since POSIX epoch (1970).
* @return uint64 microseconds elapsed sinc POXIX epoch
*/
static uint64 now();
/**
* Sleep the current process/thread for the time defined by the
* input variable.
* timeout_usec uint64 microseconds to sleep.
*
* EXAMPLE:
* \code
* time::sleep(time::SEC * number_of_Seconds);
* \endcode
*/
static void sleep(uint64 timeout_usec);
private:
// Private constructor to keep user from using constructor
Time(){};
};
CIMPLE_NAMESPACE_END
#endif /* _cimple_Time_h */
|
#ifndef __COMPONENTSTESTSCENE_H__
#define __COMPONENTSTESTSCENE_H__
#include "cocos2d.h"
#include "cocos-ext.h"
void runComponentsTestLayerTest();
class ComponentsTestLayer : public cocos2d::LayerColor
{
public:
ComponentsTestLayer();
~ComponentsTestLayer();
// Here's a difference. Method 'init' in cocos2d-x returns bool,
// instead of returning 'id' in cocos2d-iphone
virtual bool init();
// there's no 'id' in cpp, so we recommand to return the exactly class pointer
static cocos2d::Scene* scene();
// implement the "static node()" method manually
CREATE_FUNC(ComponentsTestLayer);
// init scene
cocos2d::Node* createGameScene();
};
#endif // __HELLOWORLD_SCENE_H__
|
/******************************************************************************
* Copyright (C) 2014-2020 Zhifeng Gong <gozfree@163.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#ifndef LIBFILEWATCHER_H
#define LIBFILEWATCHER_H
#include <dirent.h>
#include <libdict.h>
#include <libgevent.h>
#ifdef __cplusplus
extern "C" {
#endif
enum fw_type {
FW_CREATE_DIR = 0,
FW_CREATE_FILE,
FW_DELETE_DIR,
FW_DELETE_FILE,
FW_MOVE_FROM_DIR,
FW_MOVE_TO_DIR,
FW_MOVE_FROM_FILE,
FW_MOVE_TO_FILE,
FW_MODIFY_FILE,
};
typedef struct fw {
int fd;
struct gevent_base *evbase;
dict *dict_path;
void (*notify_cb)(struct fw *fw, enum fw_type type, char *path);
} fw_t;
GEAR_API struct fw *fw_init(void (notify_cb)(struct fw *fw, enum fw_type type, char *path));
GEAR_API void fw_deinit(struct fw *fw);
GEAR_API int fw_add_watch_recursive(struct fw *fw, const char *path);
GEAR_API int fw_del_watch_recursive(struct fw *fw, const char *path);
GEAR_API int fw_dispatch(struct fw *fw);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* Copyright (c) 2008-2018 SLIBIO <https://github.com/SLIBIO>
*
* 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.
*/
#pragma once
#include <slib.h>
#include "../gen/resources.h"
using namespace slib;
class MainWindow : public example::ui::MainWindow
{
public:
void onCreate() override;
};
|
// (c) 2013, Estwald
// released under GPLv3, see http://gplv3.fsf.org/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
int n, ret = 0;
char current_dir[1024];
char cmd[1024];
if(getcwd(current_dir, 1024)==0) return -1;
strcpy(cmd, argv[0]);
n= strlen(cmd);
while(n!=0 && cmd[n]!='/' && cmd[n]!='\\') n--;
cmd[n] = 0;
chdir(cmd);
strcpy(cmd, "scetool.exe");
for(n=1; n<argc; n++) {
strcat(cmd, " ");
strcat(cmd, argv[n]);
}
if(system(cmd)!=0) ret= -2;
chdir(current_dir);
return ret;
}
|
//
// ViewController.h
// WallpaperTest
//
// Created by erike on 09/06/14.
// Copyright (c) 2014 erik. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PLStaticWallpaperImageViewController.h"
@interface SaveListViewController : PLStaticWallpaperImageViewController
@end
|
/* This file includes all py3c headers, but doesn't use anything.
* This file exists to ensure we don't get any warnings about unused items.
*/
#include "all_py3c_headers.h"
|
/*!The Treasure Box Library
*
* TBox 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.
*
* TBox 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 TBox;
* If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
*
* Copyright (C) 2009 - 2015, ruki All rights reserved.
*
* @author ruki
* @file random.c
* @ingroup libc
*
*/
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "stdlib.h"
#include "../../math/math.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* interfaces
*/
tb_void_t tb_srandom(tb_size_t seed)
{
tb_random_seed(tb_random_generator(), seed);
}
tb_long_t tb_random()
{
return tb_random_value(tb_random_generator());
}
|
#import "Promise.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
@interface PMKPromise (Until)
/**
Loops until one or more promises have resolved.
Because Promises are single-shot, the block to until must return one or more promises. They are then `when`’d. If they succeed the until loop is concluded. If they fail then the @param `catch` handler is executed.
If the `catch` throws or returns an `NSError` then the loop is ended.
If the `catch` handler returns a Promise then re-execution of the loop is suspended upon resolution of that Promise. If the Promise succeeds then the loop continues. If it fails the loop ends.
An example usage is an app starting up that must get data from the Internet before the main ViewController can be shown. You can `until` the poll Promise and in the catch handler decide if the poll should be reattempted or not, perhaps returning a `UIAlertView.promise` allowing the user to choose if they continue or not.
*/
+ (PMKPromise *)until:(id(^)(void))blockReturningPromiseOrArrayOfPromises catch:(id)catchHandler;
@end
#pragma clang diagnostic pop |
//
// GhostAPI.h
// GhostAPI
//
// Created by Ilya Puchka on 17.08.15.
// Copyright © 2015 Ilya Puchka. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for GhostAPI.
FOUNDATION_EXPORT double GhostAPIVersionNumber;
//! Project version string for GhostAPI.
FOUNDATION_EXPORT const unsigned char GhostAPIVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <GhostAPI/PublicHeader.h>
|
//
// JSRefresh.h
// JSRefresh
//
// Created by ShenYj on 2016/10/25.
// Copyright © 2016年 ShenYj. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface JSRefresh : UIControl
/**
* 停止刷新
*/
- (void)endRefresh;
@end
|
//
// IPNavigationViewController+BackGround.h
// InterviewProject
//
// Created by w91379137 on 2016/4/9.
// Copyright © 2016年 w91379137. All rights reserved.
//
#import "IPNavigationViewController.h"
//http://e2ua.com/group/white-background-image/
@interface IPNavigationViewController (BackGround)
- (void)createBgImage;
@end
|
//
// UserResource.h
// JSONAPI
//
// Created by Rafael Kayumov on 13.12.15.
// Copyright © 2015 Josh Holtz. All rights reserved.
//
#import "JSONAPIResourceBase.h"
@interface UserResource : JSONAPIResourceBase
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *email;
@end
|
#ifndef __CONTROLLERACTION_H__
#define __CONTROLLERACTION_H__
#include "FairyGUIMacros.h"
#include "cocos2d.h"
NS_FGUI_BEGIN
class GController;
class ByteBuffer;
class ControllerAction
{
public:
static ControllerAction* createAction(int types);
ControllerAction();
virtual ~ControllerAction();
void run(GController* controller, const std::string& prevPage, const std::string& curPage);
virtual void setup(ByteBuffer * buffer);
std::vector<std::string> fromPage;
std::vector<std::string> toPage;
protected:
virtual void enter(GController* controller) = 0;
virtual void leave(GController* controller) = 0;
};
NS_FGUI_END
#endif
|
/* #include "algorithm_mathUnit.h" */
#ifndef __ALGORITHM_MATHUNIT_H
#define __ALGORITHM_MATHUNIT_H
#include "stm32f0xx.h"
#include "arm_math.h"
/*====================================================================================================*/
/*====================================================================================================*/
#define invSqrtf( iSq ) (1.0f/sqrtf((float)iSq))
#define squa( Sq ) (((float)Sq)*((float)Sq))
#define toRad( _mathD ) (_mathD * 0.0174532925f)
#define toDeg( _mathR ) (_mathR * 57.2957795f)
/*====================================================================================================*/
/*====================================================================================================*/
#endif
|
/*
sequencingModel.h - This file is part of the Bayesembler (v1.2.0)
The MIT License (MIT)
Copyright (c) 2015 Lasse Maretty and Jonas Andreas Sibbesen
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.
*/
#ifndef SEQUENCING_MODEL_H
#define SEQUENCING_MODEL_H
#include <utils.h>
#include <fragmentLengthModel.h>
#include <string>
#include <api/BamAux.h>
#include <vector>
using namespace std;
class SequencingModel {
public:
SequencingModel(FragmentLengthModel *, int, stringstream&);
double calculateThreePrimeProb(int, int);
double calculateLengthProb(int, int);
double getEffectiveLength(int);
private:
double lamdba;
int max_transcript_length;
vector<double> frag_length_prob;
vector<double> frag_length_cum_prob;
vector<double> three_prime_cum_prob;
};
#endif |
//
// AppDelegate.h
// SecondRound
//
// Created by Eugene Lin on 13-04-16.
// Copyright (c) 2013 S5 Software. All rights reserved.
//
//TODO: Work on login. When user first use the system, we record the user.
//If the user satisfies certain criteria (such as number of FB friends), we mark the user
//as valid. Otherwise, we mark the user as pending. If the user is valid, we give access immediately.
//In the future as user tries to login, we need to check the users table. If don't exist, it's
//first time user. If exist, we give acccess only if user is valid. This way, we can control
//user access
#import <UIKit/UIKit.h>
#import <KiipSDK/KiipSDK.h>
#import "IIViewDeckController.h"
#define PARSE_APP_ID @"YOUR PARSE APP ID"
#define PARSE_CLIENT_KEY @"YOUR PARSE CLIENT KEY"
#define FOURSQUARE_CLIENT_ID @"YOUR FOURSQUARE CLIENT ID"
#define FOURSQUARE_CLIENT_SECRET @"YOUR FOURSQUARE CLIENT SECRET"
#define KIIP_APP_KEY @"YOUR KIIP APP KEY"
#define KIIP_APP_SECRET @"YOUR KIIP APP SECRET"
#define CHECK_QUALIFICATION 0
#define DEFAULT_RED 0.60
#define DEFAULT_GREEN 0.96
#define DEFAULT_BLUE 1.0
#define DEFAULT_ALPHA 1.0
// Deep Sky Blue
#define SECOND_RED 0.0
#define SECOND_GREEN 0.75
#define SECOND_BLUE 1.0
#define SECOND_ALPHA 1.0
#define DEFAULT_PLAYER_RATING_COMMENT @"Some comments?"
#define DEFAULT_CHECKIN_MESSAGE @"Powered by Foursquare"
#define PLEASE_CHECKIN @"Please go to Map to checkin before adding new game."
#define NETWORK_ERROR @"The Internet connection appears to be offline."
#define NO_LOCATION_SERVICE_ALERT_TITLE @"Location Service Unavailable"
#define NO_LOCATION_SERVICE_ALERT_MESSAGE @"Go to Settings -> Privacy -> Location Services to enable service for Half Court."
#define NO_LOCATION_SERVICE_ALERT_SYSTEM_MESSAGE @"Device does not support location service"
#define NO_LOCATION_SERVICE_ALERT_CANCEL_BUTTON_TITLE @"OK"
#define MIN_FRIEND_CRITERIA 50
#define POINTS_CHECKIN 1
#define POINTS_RATING 1
#define POINTS_WIN 1
#define CODE_CHECKIN @"CHECKIN"
#define CODE_RATING @"RATE"
#define CODE_SKILLS @"SKILL"
#define CODE_WIN @"WIN"
#define LOGIN_TIMEOUT 7.0
#define PRIVACY_URL @"http://www.secondroundsports.com/app/privacy.html"
@interface AppDelegate : UIResponder <UIApplicationDelegate, KiipDelegate>
@property (strong, nonatomic) UIWindow *window;
#pragma mark - Facebook
extern NSString *const FBSessionStateChangedNotification;
- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI;
- (void)closeSession;
@end
|
//
// ArrayEnumerator.h
// FractionCalculateEngine
//
// Created by lmsgsendnilself on 16/5/22.
// Copyright © 2016年 p. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ArrayEnumerator : NSEnumerator
- (instancetype)initWithArray:(NSArray *)array;
- (id)peekNextObject;
@end
|
#ifndef ossimPredatorLoader_HEADER
#define ossimPredatorLoader_HEADER
#include "ossimPredatorApi.h"
#include <ossimPredator/ossimPredatorExport.h>
#include <ossim/base/Thread.h>
class OSSIMPREDATOR_DLL ossimPredatorLoader : public ossim::Thread
{
public:
protected:
};
#endif
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
class DynamicType : public Type
{
#if DBG
friend class JavascriptFunction;
#endif
friend class DynamicObject;
friend class DynamicTypeHandler;
friend class CrossSite;
friend class TypePath;
friend class PathTypeHandlerBase;
friend class SimplePathTypeHandler;
friend class PathTypeHandler;
friend class ES5ArrayType;
friend class JavascriptOperators;
template <typename TPropertyIndex, typename TMapKey, bool IsNotExtensibleSupported>
friend class SimpleDictionaryTypeHandlerBase;
private:
Field(DynamicTypeHandler *) typeHandler;
Field(bool) isLocked;
Field(bool) isShared;
Field(bool) hasNoEnumerableProperties;
#if DBG
Field(bool) isCachedForChangePrototype;
#endif
protected:
DynamicType(DynamicType * type) : Type(type), typeHandler(type->typeHandler), isLocked(false), isShared(false) {}
DynamicType(DynamicType * type, DynamicTypeHandler *typeHandler, bool isLocked, bool isShared);
DynamicType(ScriptContext* scriptContext, TypeId typeId, RecyclableObject* prototype, JavascriptMethod entryPoint, DynamicTypeHandler * typeHandler, bool isLocked, bool isShared);
public:
DynamicTypeHandler * GetTypeHandler() const { return typeHandler; }
void SetPrototype(RecyclableObject* newPrototype) { this->prototype = newPrototype; }
bool GetIsLocked() const { return this->isLocked; }
bool GetIsShared() const { return this->isShared; }
#if DBG
bool GetIsCachedForChangePrototype() const { return this->isCachedForChangePrototype; }
void SetIsCachedForChangePrototype() { this->isCachedForChangePrototype = true; }
#endif
void SetEntryPoint(JavascriptMethod method) { entryPoint = method; }
BOOL AllPropertiesAreEnumerable() { return typeHandler->AllPropertiesAreEnumerable(); }
bool LockType();
bool ShareType();
bool LockTypeOnly();
bool GetHasNoEnumerableProperties() const { return hasNoEnumerableProperties; }
bool SetHasNoEnumerableProperties(bool value);
bool PrepareForTypeSnapshotEnumeration();
static bool Is(TypeId typeId);
static bool Is(const Type *type) { return DynamicType::Is(type->GetTypeId()); }
static DynamicType * New(ScriptContext* scriptContext, TypeId typeId, RecyclableObject* prototype, JavascriptMethod entryPoint, DynamicTypeHandler * typeHandler, bool isLocked = false, bool isShared = false);
static uint32 GetOffsetOfTypeHandler() { return offsetof(DynamicType, typeHandler); }
static uint32 GetOffsetOfIsShared() { return offsetof(DynamicType, isShared); }
static uint32 GetOffsetOfHasNoEnumerableProperties() { return offsetof(DynamicType, hasNoEnumerableProperties); }
private:
void SetIsLocked() { Assert(this->GetTypeHandler()->GetIsLocked()); this->isLocked = true; }
void SetIsShared() { Assert(this->GetIsLocked() && this->GetTypeHandler()->GetIsShared()); this->isShared = true; }
void SetIsLockedAndShared() { SetIsLocked(); SetIsShared(); }
};
};
|
/*!
\file format.h
\brief Format string definition
\author Ivan Shynkarenka
\date 16.09.2016
\copyright MIT License
*/
#ifndef CPPCOMMON_STRING_FORMAT_H
#define CPPCOMMON_STRING_FORMAT_H
#if defined(__clang__)
#pragma clang system_header
#elif defined(__GNUC__)
#pragma GCC system_header
#elif defined(_MSC_VER)
#pragma system_header
#endif
#include <fmt/args.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/xchar.h>
namespace CppCommon {
//! Format string
/*!
Format string with the help of {fmt} library (http://fmtlib.net)
Thread-safe.
\param pattern - Format string pattern
\param args - Format arguments
\return Formatted string
*/
template <typename... T>
std::string format(fmt::format_string<T...> pattern, T&&... args);
//! Format string and print it into the std::cout
/*!
Format string with the help of {fmt} library (http://fmtlib.net)
Thread-safe.
\param pattern - Format string pattern
\param args - Format arguments
*/
template <typename... T>
void print(fmt::format_string<T...> pattern, T&&... args);
//! Format string and print it into the given std::ostream
/*!
Format string with the help of {fmt} library (http://fmtlib.net)
Thread-safe.
\param stream - Output stream
\param pattern - Format string pattern
\param args - Format arguments
*/
template <typename TOutputStream, typename... T>
void print(TOutputStream& stream, fmt::format_string<T...> pattern, T&&... args);
/*! \example string_format.cpp Format string example */
} // namespace CppCommon
#include "format.inl"
#endif // CPPCOMMON_STRING_FORMAT_H
|
// Copyright (c) 2014 The Doucoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef DOUCOIN_CRYPTO_HMAC_SHA256_H
#define DOUCOIN_CRYPTO_HMAC_SHA256_H
#include "crypto/sha256.h"
#include <stdint.h>
#include <stdlib.h>
/** A hasher class for HMAC-SHA-512. */
class CHMAC_SHA256
{
private:
CSHA256 outer;
CSHA256 inner;
public:
static const size_t OUTPUT_SIZE = 32;
CHMAC_SHA256(const unsigned char* key, size_t keylen);
CHMAC_SHA256& Write(const unsigned char* data, size_t len)
{
inner.Write(data, len);
return *this;
}
void Finalize(unsigned char hash[OUTPUT_SIZE]);
};
#endif // DOUCOIN_CRYPTO_HMAC_SHA256_H
|
//
// DrawMap.h
// tetris
//
// Created by 王冬晓 on 14/12/10.
//
//
#ifndef __tetris__DrawMap__
#define __tetris__DrawMap__
#include <cocos2d.h>
#include <string>
class DrawMap: public cocos2d::Layer
{
public:
//initialize:
virtual bool init();
static cocos2d:: Scene* createScene();
CREATE_FUNC(DrawMap);
void init_map(cocos2d::Vector<cocos2d::Sprite *>&);
void freshMap( std::map<int,std::string>,cocos2d::Vector<cocos2d::Sprite *>&a);
void menuCallback(Ref * sender, cocos2d::Vector<cocos2d::Sprite *>,const int TYPE);
void update(float dt);
};
#endif /* defined(__tetris__DrawMap__) */
|
//
// GameSceneManager.h
// Flight
//
// Created by Akihito OKUHATA on 2015/07/15.
//
//
#ifndef __Flight__GameSceneManager__
#define __Flight__GameSceneManager__
#include "GameScene.h"
#include "SceneData.h"
class ResultScene;
class ParameterScene;
class GameSceneManager
{
public:
static GameSceneManager* getInstance();
void showGameScene();
void showResultScene(const GameScene::GameScore& score);
void resetScene();
void setSceneData(SceneData sceneData);
SceneData getSceneData() const;
void clearSceneData();
static std::map<Sphere::Type, int> calculateScore(const std::vector<AchievedSphereInfo>& achievedSphereInfoList);
static int calculateTotalSphereScore(const std::vector<AchievedSphereInfo>& achievedSphereInfoList);
static int calculateTimeBonus(float elapsedTime);
void receivedData(const AirplaneInfoNetworkPacket& data);
void receivedData(const GameScoreNetworkPacket& data);
const cocos2d::Vec3 getCameraPosition() const;
const cocos2d::Vec3 getCameraEye() const;
bool isSinglePlay() const {
return sceneData.mode == SceneData::Mode::SINGLE;
};
bool isMultiplayMaster() const {
return sceneData.mode == SceneData::Mode::MULTI_MASTER;
};
bool isMultiplaySlave() const {
return sceneData.mode == SceneData::Mode::MULTI_SLAVE;
}
private:
GameScene* gameScene;
int sceneCount;
SceneData sceneData;
GameSceneManager();
~GameSceneManager();
};
#endif /* defined(__Flight__GameSceneManager__) */
|
//
// ExtensionDelegate.h
// iHouseRemoteWatch Extension
//
// Created by Benjamin Völker on 04/01/2017.
// Copyright © 2017 Benjamin Völker. All rights reserved.
//
#import <WatchKit/WatchKit.h>
@interface ExtensionDelegate : NSObject <WKExtensionDelegate>
@end
|
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_MultiThread.h"
#include "NumberThread.h"
class QLineEdit;
class QPushButton;
class MultiThread : public QMainWindow
{
Q_OBJECT
public:
MultiThread(QWidget *parent = Q_NULLPTR);
public slots:
void onValueChanged(int value);
void onStartClicked();
void onStopClicked();
private:
// Ui::MultiThreadClass ui;
QPushButton* btnStart;
QPushButton* btnStop;
QLineEdit* editNumber;
NumberThread threadNumber;
};
|
/* Defines the standard integer types that are used in code */
/* for the x86 processor and Borland Compiler */
#ifndef _STDINT_H
#define _STDINT_H
#include <stddef.h>
//typedef unsigned char uint8_t; /* 1 byte 0 to 255 */
//typedef signed char int8_t; /* 1 byte -127 to 127 */
//typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */
//typedef signed short int16_t; /* 2 bytes -32767 to 32767 */
///*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */
//typedef unsigned uint32_t; /* 4 bytes 0 to 4294967295 */
//typedef int int32_t; /* 4 bytes -2147483647 to 2147483647 */
//typedef signed long long int64_t;
//typedef unsigned long long uint64_t;
//
//#define INT8_MIN (-128)
//#define INT16_MIN (-32768)
//#define INT32_MIN (-2147483647 - 1)
//
//#define INT8_MAX 127
//#define INT16_MAX 32767
//#define INT32_MAX 2147483647
//
//#define UINT8_MAX 0xff /* 255U */
//#define UINT16_MAX 0xffff /* 65535U */
//#define UINT32_MAX 0xffffffff /* 4294967295U */
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef signed char int_least8_t;
typedef short int_least16_t;
typedef int int_least32_t;
typedef long long int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;
typedef unsigned long long uint_least64_t;
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef int int_fast32_t;
typedef long long int_fast64_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef unsigned long long uint_fast64_t;
typedef long long intmax_t;
typedef unsigned long long uintmax_t;
// These macros must exactly match those in the Windows SDK's intsafe.h.
#define INT8_MIN (-127i8 - 1)
#define INT16_MIN (-32767i16 - 1)
#define INT32_MIN (-2147483647i32 - 1)
#define INT64_MIN (-9223372036854775807i64 - 1)
#define INT8_MAX 127i8
#define INT16_MAX 32767i16
#define INT32_MAX 2147483647i32
#define INT64_MAX 9223372036854775807i64
#define UINT8_MAX 0xffui8
#define UINT16_MAX 0xffffui16
#define UINT32_MAX 0xffffffffui32
#define UINT64_MAX 0xffffffffffffffffui64
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
#ifdef _WIN64
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#else
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX
#endif
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
#define PTRDIFF_MIN INTPTR_MIN
#define PTRDIFF_MAX INTPTR_MAX
#ifndef SIZE_MAX
#define SIZE_MAX UINTPTR_MAX
#endif
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
#define WCHAR_MIN 0x0000
#define WCHAR_MAX 0xffff
#define WINT_MIN 0x0000
#define WINT_MAX 0xffff
#define INT8_C(x) (x)
#define INT16_C(x) (x)
#define INT32_C(x) (x)
#define INT64_C(x) (x ## LL)
#define UINT8_C(x) (x)
#define UINT16_C(x) (x)
#define UINT32_C(x) (x ## U)
#define UINT64_C(x) (x ## ULL)
#define INTMAX_C(x) INT64_C(x)
#define UINTMAX_C(x) UINT64_C(x)
#endif /* STDINT_H */
|
#if defined(JS_ENGINE_V8) or defined(JS_ENGINE_MOZJS) or \
defined(JS_ENGINE_CHAKRA)
#ifndef LD_BATCH_H
#define LD_BATCH_H
#include <vector>
#include <node.h>
#include <leveldb/write_batch.h>
#include "database.h"
#include "jx_persistent_store.h"
namespace leveldown {
class Batch : public node::ObjectWrap {
public:
static jxcore::ThreadStore<JS_PERSISTENT_FUNCTION_TEMPLATE> jx_persistent;
INIT_NAMED_CLASS_MEMBERS(Batch, Batch) {
int id = com->threadId;
JS_NEW_PERSISTENT_FUNCTION_TEMPLATE(jx_persistent.templates[id],
constructor);
SET_INSTANCE_METHOD("put", Batch::Put, 0);
SET_INSTANCE_METHOD("del", Batch::Del, 0);
SET_INSTANCE_METHOD("clear", Batch::Clear, 0);
SET_INSTANCE_METHOD("write", Batch::Write, 0);
}
END_INIT_NAMED_MEMBERS(Batch)
static JS_HANDLE_VALUE NewInstance(JS_HANDLE_OBJECT_REF database,
JS_HANDLE_OBJECT_REF optionsObj);
Batch(leveldown::Database* database, bool sync);
~Batch();
leveldb::Status Write();
private:
leveldown::Database* database;
leveldb::WriteOptions* options;
leveldb::WriteBatch* batch;
bool hasData; // keep track of whether we're writing data or not
static DEFINE_JS_METHOD(New);
static DEFINE_JS_METHOD(Put);
static DEFINE_JS_METHOD(Del);
static DEFINE_JS_METHOD(Clear);
static DEFINE_JS_METHOD(Write);
};
} // namespace leveldown
#endif
#endif
|
//
// UIButton+LMJBlock.h
// PLMMPRJK
//
// Created by HuXuPeng on 2017/4/14.
// Copyright © 2017年 GoMePrjk. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIButton (LMJBlock)
/**设置点击时间间隔*/
@property (nonatomic, assign) NSTimeInterval timeInterval;
@end
|
#include "Component.h"
#include "MathGeoLib/MathGeoLib.h"
class ResourceMesh;
class GameObject;
class cMesh : public Component
{
public:
cMesh(GameObject* _gameObject);
~cMesh();
ResourceMesh* resource;
void RealUpdate();
void DrawUI();
void DrawAABB(AABB aabbBox);
bool aabbTransform = false;
uint Serialize(char* &buffer);
uint DeSerialize(char* &buffer, GameObject* parent);
private:
bool aabbActive = false;
}; |
/* Definitions of target machine for GNU compiler. ISI 68000/68020 version.
Intended only for use with GAS, and not ISI's assembler, which is buggy
Copyright (C) 1988 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "tm-m68k.h"
/* See tm-m68k.h. 7 means 68020 with 68881. */
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT 7
#endif
#if TARGET_DEFAULT & 2
/* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
This will control the use of inline 68881 insns in certain macros. */
#define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__}"
/* If the 68881 is used, link must load libmc.a instead of libc.a */
#define LIB_SPEC "%{msoft-float:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}%{!msoft-float:%{!p:%{!pg:-lmc}}%{p:-lmc_p}%{pg:-lmc_p}}"
#else
/* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
This will control the use of inline 68881 insns in certain macros. */
#define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
/* If the 68881 is used, link must load libmc.a instead of libc.a */
#define LIB_SPEC "%{!m68881:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}%{m68881:%{!p:%{!pg:-lmc}}%{p:-lmc_p}%{pg:-lmc_p}}"
#endif
/* Names to predefine in the preprocessor for this target machine. */
#if !defined (QDOS) && !defined (XTC68)
#define CPP_PREDEFINES "-Dunix -Dmc68000 -Dis68k"
#else
#define CPP_PREDEFINES "-DMC68000 -DQDOS -DC68"
#endif
/* This is BSD, so it wants DBX format. */
#define DBX_DEBUGGING_INFO
/* Override parts of tm-m68000.h to fit the ISI 68k machine. */
#undef FUNCTION_VALUE
#undef LIBCALL_VALUE
#undef FUNCTION_VALUE_REGNO_P
#undef ASM_FILE_START
/* If TARGET_68881, return SF and DF values in f0 instead of d0. */
#define FUNCTION_VALUE(VALTYPE,FUNC) LIBCALL_VALUE (TYPE_MODE (VALTYPE))
#define LIBCALL_VALUE(MODE) \
gen_rtx (REG, (MODE), ((TARGET_68881 && ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0))
/* 1 if N is a possible register number for a function value.
D0 may be used, and F0 as well if -m68881 is specified. */
#define FUNCTION_VALUE_REGNO_P(N) \
((N) == 0 || (TARGET_68881 && (N) == 16))
/* Also output something to cause the correct _doprnt to be loaded. */
#define ASM_FILE_START(FILE) fprintf (FILE, "#NO_APP\n%s\n", TARGET_68881 ? ".globl fltused" : "")
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: fileio.h
* Author: Samuele Colombo
*
* Created on 15 febbraio 2016, 20.37
*/
#ifndef FILEIO_H
#define FILEIO_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include "../dtable/d_cell.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* FILEIO_H */
|
#ifndef _BLUEBLOCKTOPRIGHTBMP_H_
#define _BLUEBLOCKTOPRIGHTBMP_H_
#include <bitmapwrapper.h>
class BlueBlockTopRightBmp : public WoopsiGfx::BitmapWrapper {
public:
BlueBlockTopRightBmp();
};
#endif
|
#pragma once
#include "Meta/Type.h"
#include "Meta/EachField.h"
#include "Concepts/Range.h"
#include "Concepts/RangeOf.h"
#include "Utils/StringView.h"
#include "Range/Operations.h"
#include "Range/ForwardDecls.h"
#include "Range/Generators/Count.h"
#include "Range/Generators/Repeat.h"
#include "Range/Mutation/Copy.h"
#include "ToStringArithmetic.h"
namespace Intra { namespace Range {
INTRA_PUSH_DISABLE_REDUNDANT_WARNINGS
/*template<typename R, typename Char, size_t N> forceinline Meta::EnableIf<
IsOutputCharRange<R>::_ &&
Meta::IsCharType<Char>::_,
R&&> operator<<(R&& dst, const Char(&str)[N])
{
WriteTo(str, dst);
return Cpp::Forward<R>(dst);
}*/
template<typename R, typename Char> forceinline Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Meta::IsCharType<Char>::_,
R&&> operator<<(R&& dst, const Char* str)
{
ToString(dst, str);
return Cpp::Forward<R>(dst);
}
template<typename R, typename X> forceinline Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
!Meta::IsCharType<X>::_ &&
Meta::IsArithmeticType<X>::_,
R&&> operator<<(R&& dst, X number)
{
ToString(dst, number);
return Cpp::Forward<R>(dst);
}
template<typename R, typename Char> forceinline Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Meta::IsCharType<Char>::_,
R&&> operator<<(R&& dst, Char ch)
{
dst.Put(ch);
return Cpp::Forward<R>(dst);
}
template<typename R, typename SRC,
typename AsSRC = Concepts::RangeOfType<SRC>
> forceinline Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Concepts::IsConsumableRange<AsSRC>::_ &&
Meta::IsCharType<Concepts::ValueTypeOf<AsSRC>>::_,
R&&> operator<<(R&& dst, SRC&& src)
{
WriteTo(Range::Forward<SRC>(src), dst);
return Cpp::Forward<R>(dst);
}
namespace D {
template<typename Range, typename CR> struct TupleAppender
{
bool First;
Range& DstRange;
const CR& Separator;
TupleAppender(bool first, Range& dstRange, const CR& elementSeparator):
First(first), DstRange(dstRange), Separator(elementSeparator) {}
TupleAppender& operator=(const TupleAppender&) = delete;
template<typename V> void operator()(const V& value);
};
}
template<typename R, typename Tuple> Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Meta::HasForEachField<Tuple>::_ &&
!Concepts::IsAsConsumableRange<Tuple>::_,
R&&> operator<<(R&& dst, Tuple&& tuple)
{
dst.Put('[');
StringView sep = ", ";
D::TupleAppender<R, StringView> appender(true, dst, sep);
Meta::ForEachField(Cpp::Forward<Tuple>(tuple), appender);
dst.Put(']');
return Cpp::Forward<R>(dst);
}
template<typename R, typename Tuple, typename SR, typename LR, typename RR> Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Meta::HasForEachField<Tuple>::_ &&
!Concepts::IsAsConsumableRange<Tuple>::_ &&
Concepts::IsAsCharRange<SR>::_ &&
Concepts::IsAsCharRange<LR>::_ &&
Concepts::IsAsCharRange<RR>::_
> ToString(R&& dst, Tuple&& tuple, SR&& separator, LR&& lBracket, RR&& rBracket)
{
WriteTo(Range::Forward<LR>(lBracket), dst);
auto sep = Range::Forward<SR>(separator);
D::TupleAppender<R, Concepts::RangeOfTypeNoCRef<SR>> appender(true, dst, sep);
Meta::ForEachField(Cpp::Forward<Tuple>(tuple), appender);
WriteTo(Range::Forward<RR>(rBracket), dst);
}
template<typename R, typename VR, typename SR, typename LR, typename RR> Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Concepts::IsAsConsumableRange<VR>::_ &&
!Meta::IsCharType<Concepts::ValueTypeOfAs<VR>>::_ &&
Concepts::IsAsForwardCharRange<SR>::_ &&
Concepts::IsAsCharRange<LR>::_ &&
Concepts::IsAsCharRange<RR>::_
> ToString(R&& dst, VR&& r, SR&& separator, LR&& lBracket, RR&& rBracket)
{
auto range = Range::Forward<VR>(r);
WriteTo(Range::Forward<LR>(lBracket), dst);
if(!range.Empty())
{
dst << range.First();
range.PopFirst();
}
while(!range.Empty())
{
WriteTo(separator, dst);
dst << range.First();
range.PopFirst();
}
WriteTo(Range::Forward<RR>(rBracket), dst);
}
template<typename R, typename VR> Meta::EnableIf<
Concepts::IsOutputCharRange<R>::_ &&
Concepts::IsAsConsumableRange<VR>::_ &&
!Meta::IsCharType<Concepts::ValueTypeOfAs<VR>>::_,
R&&> operator<<(R&& dst, VR&& r)
{
ToString(dst, Range::Forward<VR>(r),
StringView(", "), StringView("["), StringView("]"));
return Cpp::Forward<R>(dst);
}
namespace D {
template<typename Range, typename CR> template<typename V>
void TupleAppender<Range, CR>::operator()(const V& value)
{
if(!First) WriteTo(Separator, DstRange);
DstRange << value;
First = false;
}
}
template<typename OR, typename T> forceinline Meta::EnableIf<
Concepts::IsOutputCharRange<OR>::_ &&
!Meta::IsArithmeticType<T>::_
> ToString(OR&& dst, T&& v) {dst << Cpp::Forward<T>(v);}
INTRA_WARNING_POP
}}
|
//
// Copyright (c) 2013 Acts Media. All rights reserved.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to UWTopContainer.h instead.
#import <CoreData/CoreData.h>
extern const struct UWTopContainerAttributes {
__unsafe_unretained NSString *slug;
__unsafe_unretained NSString *sortOrder;
__unsafe_unretained NSString *title;
} UWTopContainerAttributes;
extern const struct UWTopContainerRelationships {
__unsafe_unretained NSString *languages;
} UWTopContainerRelationships;
extern const struct UWTopContainerFetchedProperties {
} UWTopContainerFetchedProperties;
@class UWLanguage;
@interface _UWTopContainer : NSManagedObject {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
+ (NSString*)entityName;
+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
@property (nonatomic, strong) NSString* slug;
//- (BOOL)validateSlug:(id*)value_ error:(NSError**)error_;
@property (nonatomic, strong) NSNumber* sortOrder;
@property int32_t sortOrderValue;
- (int32_t)sortOrderValue;
- (void)setSortOrderValue:(int32_t)value_;
//- (BOOL)validateSortOrder:(id*)value_ error:(NSError**)error_;
@property (nonatomic, strong) NSString* title;
//- (BOOL)validateTitle:(id*)value_ error:(NSError**)error_;
@property (nonatomic, strong) NSSet* languages;
- (NSMutableSet*)languagesSet;
@end
@interface _UWTopContainer (CoreDataGeneratedAccessors)
- (void)addLanguages:(NSSet*)value_;
- (void)removeLanguages:(NSSet*)value_;
- (void)addLanguagesObject:(UWLanguage*)value_;
- (void)removeLanguagesObject:(UWLanguage*)value_;
@end
@interface _UWTopContainer (CoreDataGeneratedPrimitiveAccessors)
- (NSString*)primitiveSlug;
- (void)setPrimitiveSlug:(NSString*)value;
- (NSNumber*)primitiveSortOrder;
- (void)setPrimitiveSortOrder:(NSNumber*)value;
- (int32_t)primitiveSortOrderValue;
- (void)setPrimitiveSortOrderValue:(int32_t)value_;
- (NSString*)primitiveTitle;
- (void)setPrimitiveTitle:(NSString*)value;
- (NSMutableSet*)primitiveLanguages;
- (void)setPrimitiveLanguages:(NSMutableSet*)value;
@end |
//
// SYLJScanner.h
// SYLJQRCode
//
// Created by 刘俊 on 2017/1/15.
// Copyright © 2017年 刘俊. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
二维码/条码扫描器
*/
@interface SYLJScanner : NSObject
/**
使用视图实例化扫描器,扫描预览窗口会添加到指定视图中
@param scanView 指定的视图
@param scanRect 扫描范围
@param completion 完成回调
@return 扫描器
*/
+ (instancetype)scanQRCodeWithScanView:(UIView *)scanView scanRect:(CGRect)scanRect completion:(void (^)(NSString *stringValue))completion;
/**
开始扫描
*/
- (void)startScan;
/**
停止扫描
*/
- (void)stopScan;
/// 扫描图像
///
/// @param image 包含二维码的图像
/// @remark 目前只支持 64 位的 iOS 设备
+ (void)scanImage:(UIImage *)image completion:(void (^)(NSArray *values))completion;
@end
|
#pragma once
#include "winrt/Microsoft.ReactNative.h"
namespace winrt::react_native_windows::implementation
{
struct ReactPackageProvider : winrt::implements<ReactPackageProvider, winrt::Microsoft::ReactNative::IReactPackageProvider>
{
public: // IReactPackageProvider
void CreatePackage(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept;
};
} // namespace winrt::react_native_windows::implementation
|
#pragma once
#include "ofMain.h"
#include "DeckLinkController.h"
class VideoFrame : public IDeckLinkVideoFrame, public ofBaseHasPixels {
private:
ofPixels pixels;
unsigned char* data;
//override these methods for virtual
virtual long GetWidth (void);
virtual long GetHeight (void);
virtual long GetRowBytes (void);
virtual BMDPixelFormat GetPixelFormat (void);
virtual BMDFrameFlags GetFlags (void);
virtual HRESULT GetBytes (/* out */ void **buffer);
//Dummy implementations of remaining virtual methods
virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) { return E_NOINTERFACE; };
virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) { return E_NOINTERFACE; } ;
// IUnknown interface (dummy implementation)
virtual HRESULT QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG AddRef () {return 1;}
virtual ULONG Release () {return 1;}
public:
VideoFrame(long width, long height);
virtual ~VideoFrame();
void allocate(int width, int height);
void deallocate();
void copyFromFrame(IDeckLinkVideoFrame*);
int getWidth();
int getHeight();
std::timed_mutex lock;
unsigned char* getData();
const ofPixels & getPixels() const;
ofPixels & getPixels();
};
|
/**
* @file
* @brief Vector multiplication.
* @author Brett Gronholz
*
*/
#ifndef XMULT_H_
#define XMULT_H_
#include <stddef.h>
#include "xdefs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Complex/complex array multiplication.
*
* @param src1 A pointer to a complex source array.
* @param src2 A pointer to a complex source array.
* @param dst A pointer to the complex destination array.
* @param n The number of samples in the arrays.
*
* @note The computation may be in-place (i.e., src1 = dst or src2 = dst).
*/
void xmult_cc(const xcfloat src1[], const xcfloat src2[], xcfloat dst[], size_t n);
/**
* Complex/real array multiplication.
*
* @param src1 A pointer to a complex source array.
* @param src2 A pointer to a real source array.
* @param dst A pointer to the complex destination array.
* @param n The number of samples in the arrays.
*
* @note The computation may be in-place (i.e., src1 = dst).
*/
void xmult_cr(const xcfloat src1[], const float src2[], xcfloat dst[], size_t n);
/**
* Real/real array multiplication.
*
* @param src1 A pointer to a real source array.
* @param src2 A pointer to a real source array.
* @param dst A pointer to the real destination array.
* @param n The number of samples in the arrays.
*
* @note The computation may be in-place (i.e., src1 = dst or src2 = dst).
*/
void xmult_rr(const float src1[], const float src2[], float dst[], size_t n);
/**
* Real array multiplication with a real constant.
*
* @param src A pointer to a real source array.
* @param val The real constant.
* @param dst A pointer to the real destination array.
* @param n The number of samples in the arrays.
*
* @note The computation may be in-place (i.e., src = dst).
*/
void xmultc_rr(const float src[], float val, float dst[], size_t n);
#ifdef __cplusplus
}
#endif
#endif /* XMULT_H_ */
|
/**
******************************************************************************
* @file CAN/CAN_Networking/main.h
* @author MCD Application Team
* @version V1.8.0
* @date 04-November-2016
* @brief Header for main.c module
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx.h"
#if defined (USE_STM324xG_EVAL)
#include "stm324xg_eval.h"
#elif defined (USE_STM324x7I_EVAL)
#include "stm324x7i_eval.h"
#elif defined (USE_STM324x9I_EVAL)
#include "stm324x9i_eval.h"
#else
#error "Please select first the Evaluation board used in your application (in Project Options)"
#endif
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
#if defined (USE_STM324xG_EVAL)
#define CANx CAN1
#define CAN_CLK RCC_APB1Periph_CAN1
#define CAN_RX_PIN GPIO_Pin_0
#define CAN_TX_PIN GPIO_Pin_1
#define CAN_GPIO_PORT GPIOD
#define CAN_GPIO_CLK RCC_AHB1Periph_GPIOD
#define CAN_AF_PORT GPIO_AF_CAN1
#define CAN_RX_SOURCE GPIO_PinSource0
#define CAN_TX_SOURCE GPIO_PinSource1
#endif /* USE_STM324xG_EVAL */
#if defined (USE_STM324x7I_EVAL)
#define CANx CAN1
#define CAN_CLK RCC_APB1Periph_CAN1
#define CAN_RX_PIN GPIO_Pin_0
#define CAN_TX_PIN GPIO_Pin_1
#define CAN_GPIO_PORT GPIOD
#define CAN_GPIO_CLK RCC_AHB1Periph_GPIOD
#define CAN_AF_PORT GPIO_AF_CAN1
#define CAN_RX_SOURCE GPIO_PinSource0
#define CAN_TX_SOURCE GPIO_PinSource1
#endif /* USE_STM324x7I_EVAL */
#if defined (USE_STM324x9I_EVAL)
#define CANx CAN1
#define CAN_CLK RCC_APB1Periph_CAN1
#define CAN_RX_PIN GPIO_Pin_11
#define CAN_TX_PIN GPIO_Pin_12
#define CAN_GPIO_PORT GPIOA
#define CAN_GPIO_CLK RCC_AHB1Periph_GPIOA
#define CAN_AF_PORT GPIO_AF_CAN1
#define CAN_RX_SOURCE GPIO_PinSource11
#define CAN_TX_SOURCE GPIO_PinSource12
#endif /* USE_STM324x9I_EVAL */
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void LED_Display(uint8_t Ledstatus);
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//
// JWAppDelegate.h
// JWMTADataFeed
//
// Created by CocoaPods on 08/30/2014.
// Copyright (c) 2014 Jerry Wong. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface JWAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/********************************************************************************
* The MIT License (MIT) *
* *
* Copyright (C) 2016 Alex Nolasco *
* *
*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 "HL7SummaryEntry.h"
#import "HL7Enums.h"
@class HL7DateRange;
@class HL7CodeSummary;
@interface HL7SocialHistorySummaryEntry : HL7SummaryEntry <NSCopying, NSCoding>
- (HL7CodeSummary *_Nullable)codeSummary;
- (HL7DateRange *_Nullable)dateRange;
- (NSString *_Nullable)quantityNarrative;
- (NSString *_Nullable)templateId;
- (HL7XSIType)dataType;
@end
|
#pragma once
#include <vector>
#include <Year3Engine\GameComponent.h>
#include <Year3Engine\StateMachine.h>
#include "Player.h"
#include "SupportSpotCalculator.h"
class SoccerMatch; // Forward Declaration
class FieldPlayer;
class Team : public GameComponent
{
friend class Radar;
public:
Team(SoccerMatch* match, bool human, bool home, std::string name, GLfloat r = 1, GLfloat g = 1, GLfloat b = 1, GLfloat a = 1);
~Team(void);
void LoadContent();
void Update(float deltaTime);
void Reset();
// Finds the closest player to the ball and gives him control
void CalcClosestPlayerToBall();
// Finds a player to pass to given the players current direction,
// returns a player to pass to or NULL if none
Player* FindPlayerToPassTo(Player* player);
// Gets the direction between the player and the value returned
// from FindPlayerToPassTo and kicks the ball in theat direction
void Pass(Player* player);
int score;
SoccerMatch* match;
//bool inPossession; // is any of the players in possession of the ball
GLfloat teamColor[4]; // The color of the team (R,G,B,A)
bool const Home() const { return home; }
bool const Human() const { return human; }
//calling this changes the state of all field players to that of
//ReturnToHomeRegion. Mainly used when a goal keeper has
//possession
void ReturnAllFieldPlayersToHome();
void SetOpponents (Team* opponents) { this->opponents = opponents; }
Team* const Opponents() const { return opponents; }
const std::vector<std::tr1::shared_ptr<Player>>& Members()const { return players; }
//test if a pass from positions 'from' to 'target' kicked with force
//'PassingForce'can be intercepted by an opposing player
bool isPassSafeFromOpponent(b2Vec2 from, b2Vec2 target, const Player* const receiver,
const Player* const opp, double PassingForce)const;
//tests a pass from position 'from' to position 'target' against each member
//of the opposing team. Returns true if the pass can be made without
//getting intercepted
bool isPassSafeFromAllOpponents(b2Vec2 from, b2Vec2 target,
const Player* const receiver, double PassingForce)const;
//returns true if player has a clean shot at the goal and sets ShotTarget
//to a normalized vector pointing in the direction the shot should be
//made. Else returns false and sets heading to a zero vector
bool CanShoot(b2Vec2 BallPos, double power, b2Vec2& ShotTarget = b2Vec2())const;
bool AllPlayersAtHome() const;
void SetPlayerHomeRegion(int plyr, int region)const;
void UpdateTargetsOfWaitingPlayers()const;
Player* DetermineBestSupportingAttacker();
bool isOpponentWithinRadius(b2Vec2 position, double radius);
//The best pass is considered to be the pass that cannot be intercepted
//by an opponent and that is as far forward of the receiver as possible
//If a pass is found, the receiver's address is returned in the
//reference, 'receiver' and the position the pass will be made to is
//returned in the reference 'PassTarget'
bool FindPass(const Player*const passer,
Player*& receiver,
b2Vec2& PassTarget,
double power,
double MinPassingDistance)const;
//Three potential passes are calculated. One directly toward the receiver's
//current position and two that are the tangents from the ball position
//to the circle of radius 'range' from the receiver.
//These passes are then tested to see if they can be intercepted by an
//opponent and to make sure they terminate within the playing area. If
//all the passes are invalidated the function returns false. Otherwise
//the function returns the pass that takes the ball closest to the
//opponent's goal area.
bool GetBestPassToReceiver(const Player* const passer,
const Player* const receiver,
b2Vec2& PassTarget,
const double power)const;
inline b2Vec2 Perp(b2Vec2 vector) const
{
return b2Vec2(-vector.y, vector.x);
}
SupportSpotCalculator* SupportSpotCalc() { return supportSpotCalc; }
Player* ControllingPlayer() const { return controllingPlayer; }
void SetControllingPlayer(Player* player)
{
controllingPlayer = player;
if(player != NULL)
Opponents()->LostControl();
}
bool InControl()const
{
if(controllingPlayer)
return true;
else
return false;
}
void LostControl() { controllingPlayer = NULL; }
Player* Closestplayer() { return closestPlayer; }
void SetClosestPlayer(Player* player){ closestPlayer = player; }
Player* SupportingPlayer() { return supportingPlayer; }
void SetSupportingPlayer(Player* player){ supportingPlayer = player; }
Player* Receiver() { return receiver; }
void SetReceiver(Player* player){ receiver = player; }
b2Vec2 GetSupportSpot()const { return supportSpotCalc->GetBestSupportingSpot(); }
void DetermineBestSupportingPosition()const { supportSpotCalc->DetermineBestSupportingPosition(); }
StateMachine<Team>* GetFSM() const { return stateMachine; }
double ClosestDistToBallSq()const { return distSqToBallOfClosestPlayer; }
//this tests to see if a pass is possible between the requester and
//the controlling player. If it is possible a message is sent to the
//controlling player to pass the ball asap.
void RequestPass(FieldPlayer* requester)const;
private:
bool home; // Used to select which way we play
bool human; // Indicates whether this team is human controlled
std::vector<std::tr1::shared_ptr<Player>> players;
std::vector<std::tr1::shared_ptr<Player>>::iterator playerIter;
Team* opponents;
Player* closestPlayer; // The closest player to the ball
Player* controllingPlayer;
Player* supportingPlayer;
Player* receiver;
StateMachine<Team>* stateMachine;
//players use this to determine strategic positions on the playing field
SupportSpotCalculator* supportSpotCalc;
double distSqToBallOfClosestPlayer;
};
|
//
// UIForLumberjack.h
// UIForLumberjack
//
// Created by Kamil Burczyk on 15.01.2014.
// Copyright (c) 2014 Sigmapoint. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
@interface UIForLumberjack : NSObject <DDLogger>
+ (instancetype)sharedInstance;
@property (nonatomic, readonly) UITableView *tableView;
- (void)showLogInView:(UIView *)view;
- (void)hideLog;
- (void)clearLog;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.