text
stringlengths 4
6.14k
|
|---|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_ZKTwitterBarAnimation_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ZKTwitterBarAnimation_ExampleVersionString[];
|
//
// HKSlideMenu3DController
// SlideMenu3D
//
// Created by Edgar on 4/6/15.
// Copyright (c) 2015 hunk. All rights reserved.
//
typedef enum {
MenuLeft,
MenuRight,
} Menu3DSide;
#import <UIKit/UIKit.h>
@class HKSlideMenu3DController;
@protocol HKSlideMenu3DControllerDelegate <NSObject>
@optional
-(void)willOpenMenu;
-(void)didOpenMenu;
//close
-(void)willCloseMenu;
-(void)didCloseMenu;
@end
@interface HKSlideMenu3DController : UIViewController<UIGestureRecognizerDelegate>
#pragma mark - Managed View Controllers
@property (nonatomic, weak) id<HKSlideMenu3DControllerDelegate> delegate;
@property (nonatomic, strong) UIViewController *menuViewController;
@property (nonatomic, strong) UIViewController *mainViewController;
@property (nonatomic, strong) UIImage *backgroundImage;
@property (nonatomic) UIViewContentMode backgroundImageContentMode;
@property (nonatomic, assign) BOOL enablePan;
@property (nonatomic) Menu3DSide sideMenu3D;
@property (nonatomic, assign) CGFloat distanceOpenMenu;
- (void)toggleMenu;
@end
|
#include "config.h"
short web_render_file(const char* uri, struct evbuffer *evb, s_config *conf);
|
#ifndef _ANT_ALLOCATOR_H_
#define _ANT_ALLOCATOR_H_
#define MIN_FRAG 64 // bytes, block overhead is 40 bytes
typedef enum { false, true } bool;
typedef struct block_hdr_s {
unsigned int id; // check for corruption
size_t user_mem_sz; // size of usable memory
bool free; // true if free block
struct block_hdr_s *next;
struct block_hdr_s *prev;
} block_hdr_t;
typedef struct allocator_s {
block_hdr_t *head; // points to start of first block in list
block_hdr_t *tail; // last block in the list (before wilderness)
size_t sys_mem_sz; // size of memory grabbed from system
void *sys_mem; // pointer to grabbed system memory
void *wilderness; // will change
size_t wilderness_sz; // shrinks
} allocator_t;
// GLOBAL
size_t BLOCK_HDR_SZ;// Not ideal - but otherwise multiple calls to sizeof()
void allocator_create (allocator_t *alloc, size_t s);
void allocator_destroy(allocator_t *alloc);
void * ant_alloc (allocator_t *alloc, size_t user_mem_sz);
void ant_free (allocator_t *alloc, void *p);
void check_heap (allocator_t *alloc);
void dump_heap (allocator_t *alloc);
#endif
|
#ifndef DUNGEON_FEATUREOPTIONS_H
#define DUNGEON_FEATUREOPTIONS_H
#include <functional>
#include <vector>
namespace dungeon
{
class Feature;
typedef std::function<Feature(int,int)> FeatureFunction;
//! Dungeon Options
/*!
* Options for controlling the parameters of dungeon generation
*/
class FeatureOptions
{
public:
FeatureOptions();
// setup
FeatureOptions& addFeature(FeatureFunction function, double weight = 1.0);
FeatureOptions& size(unsigned width, unsigned height);
FeatureOptions& minWidth(int width);
FeatureOptions& maxWidth(int width);
FeatureOptions& minHeight(int height);
FeatureOptions& maxHeight(int height);
FeatureOptions& iterations(unsigned iterations);
Feature createRandom() const;
inline unsigned width() const { return mWidth; }
inline unsigned height() const { return mHeight; }
inline unsigned iterations() const { return mIterations; }
private:
std::vector<FeatureFunction> mFeatures;
std::vector<double> mIntervals;
std::vector<double> mWeights;
unsigned mWidth;
unsigned mHeight;
int mMinW;
int mMaxW;
int mMinH;
int mMaxH;
unsigned mIterations;
};
}
#endif
|
/*
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#import "ARDAppClient.h"
#import "WebRTC/RTCPeerConnection.h"
#import "ARDRoomServerClient.h"
#import "ARDSignalingChannel.h"
#import "ARDTURNClient.h"
@class RTCPeerConnectionFactory;
@interface ARDAppClient () <ARDSignalingChannelDelegate, RTCPeerConnectionDelegate>
// All properties should only be mutated from the main queue.
@property(nonatomic, strong) id<ARDRoomServerClient> roomServerClient;
@property(nonatomic, strong) id<ARDSignalingChannel> channel;
@property(nonatomic, strong) id<ARDSignalingChannel> loopbackChannel;
@property(nonatomic, strong) id<ARDTURNClient> turnClient;
@property(nonatomic, strong) RTCPeerConnection *peerConnection;
@property(nonatomic, strong) RTCPeerConnectionFactory *factory;
@property(nonatomic, strong) NSMutableArray *messageQueue;
@property(nonatomic, assign) BOOL isTurnComplete;
@property(nonatomic, assign) BOOL hasReceivedSdp;
@property(nonatomic, readonly) BOOL hasJoinedRoomServerRoom;
@property(nonatomic, strong) NSString *roomId;
@property(nonatomic, strong) NSString *clientId;
@property(nonatomic, assign) BOOL isInitiator;
@property(nonatomic, strong) NSMutableArray *iceServers;
@property(nonatomic, strong) NSURL *webSocketURL;
@property(nonatomic, strong) NSURL *webSocketRestURL;
@property(nonatomic, readonly) BOOL isLoopback;
@property(nonatomic, strong) RTCMediaConstraints *defaultPeerConnectionConstraints;
- (instancetype)initWithRoomServerClient:(id<ARDRoomServerClient>)rsClient
signalingChannel:(id<ARDSignalingChannel>)channel
turnClient:(id<ARDTURNClient>)turnClient
delegate:(id<ARDAppClientDelegate>)delegate;
@end
|
/*
-----------------------------------------------------------------------------
This source file is part of fastbird engine
For the latest info, see http://www.jungwan.net/
Copyright (c) 2013-2015 Jungwan Byun
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 comment(lib, "libogg.lib")
#pragma comment(lib, "libtheora.lib")
#include "FBCommonHeaders/platform.h"
#if defined(_PLATFORM_WINDOWS_)
#define FB_DLL_VIDEOPLAYER __declspec(dllexport)
#define FB_DLL_AUDIOPLAYER __declspec(dllimport)
#define FB_DLL_RENDERER __declspec(dllimport)
#define FB_DLL_TIMER __declspec(dllimport)
#define FB_DLL_FILESYSTEM __declspec(dllimport)
#else
#define FB_DLL_AUDIOPLAYER
#endif
#include <assert.h>
#include "FBDebugLib/Logger.h"
#include "FBStringLib/StringLib.h"
namespace fb{
void Error(const char* szFmt, ...);
void Log(const char* szFmt, ...);
}
|
//
// ModelChat.h
// Talkfun_demo
//
// Created by moruiquan on 16/1/26.
// Copyright © 2016年 talk-fun. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface TalkfunChatModel : NSObject
//头像
@property (nonatomic ,copy ) NSString *avatar;
@property (nonatomic ,strong ) NSDictionary *chat;
@property (nonatomic ,strong ) NSNumber *gender;
@property (nonatomic ,copy ) NSString *msg;
@property (nonatomic ,copy ) NSString *nickname;
@property (nonatomic ,copy ) NSString *role;
@property (nonatomic ,strong ) NSNumber *time;
@property (nonatomic ,copy ) NSString *sendtime;
@property (nonatomic ,copy ) NSString *uid;
@property (nonatomic ,copy ) NSString *vid;
@property (nonatomic ,copy ) NSString *isShow;
@property (nonatomic ,strong ) NSNumber *amount;
@property (nonatomic ,copy ) NSString *starttime;
@property (nonatomic ,copy ) NSString *startTime;
@end
|
/* Ferdinand Saufler <mail@saufler.de>
* 25.09.2016
* this program prints information about the current used kernel. */
#include <stdio.h>
#include <stdlib.h>
#include <file.h>
#include <kernel.h>
int main()
{
struct KernelVersionInfo kvi;
GetKernelVersion(&kvi);
printf("Sysname: %s\n", kvi.Sysname);
printf("VersionString: %s\n", kvi.VersionString);
printf("MajorVersion: %d\n", kvi.MajorVersion);
printf("MinorVersion: %d\n", kvi.MinorVersion);
printf("PatchVersion: %d\n", kvi.PatchVersion);
return 0;
}
|
// C++ for the Windows Runtime v1.0.161012.5
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Devices.Sensors.Custom.2.h"
WINRT_EXPORT namespace winrt {
namespace Windows::Devices::Sensors::Custom {
struct WINRT_EBO CustomSensor :
Windows::Devices::Sensors::Custom::ICustomSensor
{
CustomSensor(std::nullptr_t) noexcept {}
static hstring GetDeviceSelector(GUID interfaceId);
static Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Custom::CustomSensor> FromIdAsync(hstring_ref sensorId);
};
struct WINRT_EBO CustomSensorReading :
Windows::Devices::Sensors::Custom::ICustomSensorReading
{
CustomSensorReading(std::nullptr_t) noexcept {}
};
struct WINRT_EBO CustomSensorReadingChangedEventArgs :
Windows::Devices::Sensors::Custom::ICustomSensorReadingChangedEventArgs
{
CustomSensorReadingChangedEventArgs(std::nullptr_t) noexcept {}
};
}
}
|
// Copyright 2012 Rui Ueyama. Released under the MIT license.
// @wgtcc: passed
#include <float.h>
#include <stdarg.h>
#include <stdint.h>
#include "test.h"
float tf1(float a) { return a; }
float tf2(double a) { return a; }
float tf3(int a) { return a; }
double td1(float a) { return a; }
double td2(double a) { return a; }
double td3(int a) { return a; }
double recursive(double a) {
if (a < 10) return a;
return recursive(3.33);
}
char *fmt(char *fmt, ...) {
static char buf[128];
va_list args;
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
return buf;
}
char *fmtint(int x) { return fmt("%d", x); }
char *fmtdbl(double x) { return fmt("%a", x); }
void std() {
expect_string("21", fmtint(DECIMAL_DIG));
expect_string("0", fmtint(FLT_EVAL_METHOD));
expect_string("2", fmtint(FLT_RADIX));
expect_string("1", fmtint(FLT_ROUNDS));
expect_string("6", fmtint(FLT_DIG));
expect_string("0x1p-23", fmtdbl(FLT_EPSILON));
expect_string("24", fmtint(FLT_MANT_DIG));
expect_string("0x1.fffffep+127", fmtdbl(FLT_MAX));
expect_string("38", fmtint(FLT_MAX_10_EXP));
expect_string("128", fmtint(FLT_MAX_EXP));
expect_string("0x1p-126", fmtdbl(FLT_MIN));
expect_string("-37", fmtint(FLT_MIN_10_EXP));
expect_string("-125", fmtint(FLT_MIN_EXP));
expectd(*(float *)&(uint32_t){1}, FLT_TRUE_MIN);
expect_string("0x1p-149", fmtdbl(FLT_TRUE_MIN));
expect_string("15", fmtint(DBL_DIG));
expect_string("0x1p-52", fmtdbl(DBL_EPSILON));
expect_string("53", fmtint(DBL_MANT_DIG));
expect_string("0x1.fffffffffffffp+1023", fmtdbl(DBL_MAX));
expect_string("308", fmtint(DBL_MAX_10_EXP));
expect_string("1024", fmtint(DBL_MAX_EXP));
expect_string("0x1p-1022", fmtdbl(DBL_MIN));
expect_string("-307", fmtint(DBL_MIN_10_EXP));
expect_string("-1021", fmtint(DBL_MIN_EXP));
expectd(*(double *)&(uint64_t){1}, DBL_TRUE_MIN);
expect_string("0x0.0000000000001p-1022", fmtdbl(DBL_TRUE_MIN));
#ifdef __8cc__
expect_string("15", fmtint(LDBL_DIG));
expect_string("0x1p-52", fmtdbl(LDBL_EPSILON));
expect_string("53", fmtint(LDBL_MANT_DIG));
expect_string("0x1.fffffffffffffp+1023", fmtdbl(LDBL_MAX));
expect_string("308", fmtint(LDBL_MAX_10_EXP));
expect_string("1024", fmtint(LDBL_MAX_EXP));
expect_string("0x1p-1022", fmtdbl(LDBL_MIN));
expect_string("-307", fmtint(LDBL_MIN_10_EXP));
expect_string("-1021", fmtint(LDBL_MIN_EXP));
expectd(*(double *)&(uint64_t){1}, LDBL_TRUE_MIN);
expect_string("0x0.0000000000001p-1022", fmtdbl(LDBL_TRUE_MIN));
#endif
}
int main() {
std();
expect(0.7, .7);
float v1 = 10.0;
float v2 = v1;
expectf(10.0, v1);
expectf(10.0, v2);
//return;
double v3 = 20.0;
double v4 = v3;
expectd(20.0, v3);
expectd(20.0, v4);
expectf(1.0, 1.0);
expectf(1.5, 1.0 + 0.5);
expectf(0.5, 1.0 - 0.5);
expectf(2.0, 1.0 * 2.0);
expectf(0.25, 1.0 / 4.0);
expectf(3.0, 1.0 + 2);
expectf(2.5, 5 - 2.5);
expectf(2.0, 1.0 * 2);
expectf(0.25, 1.0 / 4);
expectf(10.5, tf1(10.5));
expectf(10.0, tf1(10));
// 10.6 is double
// tf2(10.6) is float
// GCC fails too
//expectf(10.6, tf2(10.6));
expectf(10.0, tf2(10));
expectf(10.0, tf3(10.7));
expectf(10.0, tf3(10));
expectd(1.0, tf1(1.0));
expectd(10.0, tf1(10));
expectd(2.0, tf2(2.0));
expectd(10.0, tf2(10));
expectd(11.0, tf3(11.5));
expectd(10.0, tf3(10));
expectd(3.33, recursive(100));
return 0;
}
|
#pragma once
#include "types.h"
typedef struct {
char* data;
uint capacity;
uint nStrings;
} StringBuffer;
StringBuffer* StringBuffer_init(uint initialCapacity);
void StringBuffer_init_local(uint initialCapacity, StringBuffer* pResult);
void StringBuffer_term(StringBuffer* pBuffer);
void StringBuffer_append(StringBuffer* pBuffer, char ch);
void StringBuffer_appendString(StringBuffer* pBuffer, char* string);
void StringBuffer_clear(StringBuffer* pBuffer);
char* StringBuffer_copyData(StringBuffer* pBuffer);
char* duplicate_string(const char* source);
|
#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and eurocoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 996
#define CLIENT_VERSION_BUILD 0
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2013
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
#endif // CLIENTVERSION_H
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class NSDictionary;
@interface SBScrollViewLayoutInfos : NSObject
{
NSDictionary *_indexPathsToFrames;
NSDictionary *_sectionToNumberOfItems;
NSDictionary *_sectionToPlaceholderFrames;
double _contentWidth;
double _presentationOffset;
long long _numberOfSections;
}
@property(nonatomic) long long numberOfSections; // @synthesize numberOfSections=_numberOfSections;
@property(nonatomic) double presentationOffset; // @synthesize presentationOffset=_presentationOffset;
@property(nonatomic) double contentWidth; // @synthesize contentWidth=_contentWidth;
@property(retain, nonatomic) NSDictionary *sectionToPlaceholderFrames; // @synthesize sectionToPlaceholderFrames=_sectionToPlaceholderFrames;
@property(retain, nonatomic) NSDictionary *sectionToNumberOfItems; // @synthesize sectionToNumberOfItems=_sectionToNumberOfItems;
@property(retain, nonatomic) NSDictionary *indexPathsToFrames; // @synthesize indexPathsToFrames=_indexPathsToFrames;
- (id)indexPathsOfVisibleItemsInBounds:(struct CGRect)arg1;
- (struct CGRect)frameForSectionPlaceholder:(long long)arg1;
- (struct CGRect)frameForIndexPath:(id)arg1;
- (unsigned long long)indexOfLastItemInSection:(unsigned long long)arg1;
- (unsigned long long)numberOfItemsInSection:(unsigned long long)arg1;
- (void)dealloc;
@end
|
//
// AKTCategory.h
// Pursue
//
// Created by YaHaoo on 16/4/8.
// Copyright © 2016年 YaHaoo. All rights reserved.
//
#ifndef AKTCategory_h
#define AKTCategory_h
#import "NSFileManager+AKTFileManager.h"
#import "NSObject+AKT.h"
#import "NSString+AKTFilePath.h"
#import "UILabel+Akt.h"
#import "UIView+AKT.h"
#import "UIImage+AKT.h"
#endif /* AKTCategory_h */
|
//
// UIAlertController+Extended.h
// CocoaExtendedKit
//
// Created by Michael Reneer on 4/6/16.
// Copyright © 2016 Michael Reneer. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIAlertController (Extended)
+ (instancetype)alertControllerWithError:(NSError *)error;
@end
NS_ASSUME_NONNULL_END
|
/* Definition of available OpenCL devices.
Copyright (c) 2011 Universidad Rey Juan Carlos and
2012 Pekka Jääskeläinen / Tampere University of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <unistd.h>
#include <string.h>
#include "devices.h"
#include "common.h"
#include "basic/basic.h"
#include "pthread/pocl-pthread.h"
#if defined(BUILD_SPU)
#include "cellspu/cellspu.h"
#endif
#if defined(TCE_AVAILABLE)
#include "tce/ttasim/ttasim.h"
#endif
/* the enabled devices */
struct _cl_device_id* pocl_devices = NULL;
int pocl_num_devices = 0;
#ifdef TCE_AVAILABLE
#define POCL_NUM_DEVICE_TYPES 4
#else
#define POCL_NUM_DEVICE_TYPES 3
#endif
/* All device drivers available to the pocl. */
static struct _cl_device_id pocl_device_types[POCL_NUM_DEVICE_TYPES] = {
POCL_DEVICES_PTHREAD,
POCL_DEVICES_BASIC,
#if defined(BUILD_SPU)
POCL_DEVICES_CELLSPU,
#endif
#if defined(TCE_AVAILABLE)
POCL_DEVICES_TTASIM,
#endif
};
void
pocl_init_devices()
{
const char *device_list;
char *ptr, *tofree, *token, *saveptr;
int i, devcount;
if (pocl_num_devices > 0)
return;
if (getenv(POCL_DEVICES_ENV) != NULL)
{
device_list = getenv(POCL_DEVICES_ENV);
}
else
{
device_list = "pthread";
}
ptr = tofree = strdup(device_list);
while ((token = strtok_r (ptr, " ", &saveptr)) != NULL)
{
++pocl_num_devices;
ptr = NULL;
}
free (tofree);
pocl_devices = malloc (pocl_num_devices * sizeof *pocl_devices);
ptr = tofree = strdup(device_list);
devcount = 0;
while ((token = strtok_r (ptr, " ", &saveptr)) != NULL)
{
struct _cl_device_id* device_type = NULL;
for (i = 0; i < POCL_NUM_DEVICE_TYPES; ++i)
{
if (strcmp(pocl_device_types[i].name, token) == 0)
{
/* Check if there are device-specific parameters set in the
POCL_DEVICEn_PARAMETERS env. */
char env_name[1024];
if (snprintf (env_name, 1024, "POCL_DEVICE%d_PARAMETERS", devcount) < 0)
POCL_ABORT("Unable to generate the env string.");
device_type = &pocl_device_types[i];
memcpy (&pocl_devices[devcount], device_type, sizeof(struct _cl_device_id));
pocl_devices[devcount].init(&pocl_devices[devcount], getenv(env_name));
pocl_devices[devcount].dev_id = devcount;
devcount++;
break;
}
}
if (device_type == NULL)
POCL_ABORT("device type not found\n");
ptr = NULL;
}
free (tofree);
}
|
/*
*
* QueryFilter
* ledger-core
*
* Created by Pierre Pollastri on 28/06/2017.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* 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 LEDGER_CORE_QUERYFILTER_H
#define LEDGER_CORE_QUERYFILTER_H
#include <api/QueryFilter.hpp>
#include <soci.h>
namespace ledger {
namespace core {
enum class QueryFilterOperator {
OP_AND, OP_OR, OP_AND_NOT, OP_OR_NOT
};
class QueryFilter;
struct QueryFilterLink {
std::shared_ptr<QueryFilter> previous;
std::shared_ptr<QueryFilter> next;
QueryFilterOperator op;
};
class QueryFilter : public api::QueryFilter, public std::enable_shared_from_this<QueryFilter> {
public:
std::shared_ptr<api::QueryFilter> op_and(const std::shared_ptr<api::QueryFilter> &filter) override;
std::shared_ptr<api::QueryFilter> op_or(const std::shared_ptr<api::QueryFilter> &filter) override;
std::shared_ptr<api::QueryFilter> op_and_not(const std::shared_ptr<api::QueryFilter> &filter) override;
std::shared_ptr<api::QueryFilter> op_or_not(const std::shared_ptr<api::QueryFilter> &filter) override;
virtual std::string toString() const {
std::stringstream ss;
toString(ss);
return ss.str();
};
virtual void toString(std::stringstream& ss) const = 0;
virtual void bindValue(soci::details::prepare_temp_type& statement) const = 0;
int32_t getSiblingsCount() const;
std::shared_ptr<QueryFilter> getHead() const;
std::shared_ptr<QueryFilter> getTail() const;
bool isTail() const;
bool isHead() const;
std::shared_ptr<QueryFilter> getNext() const;
std::shared_ptr<QueryFilter> getPrevious() const;
QueryFilterOperator getOperatorForNextFilter() const;
private:
std::shared_ptr<api::QueryFilter> link(const std::shared_ptr<api::QueryFilter> &filter, QueryFilterOperator op);
private:
QueryFilterLink _siblings;
};
}
}
#endif //LEDGER_CORE_QUERYFILTER_H
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/HUD.h"
#include "CppFirstPersonGameHUD.generated.h"
UCLASS()
class ACppFirstPersonGameHUD : public AHUD
{
GENERATED_BODY()
public:
ACppFirstPersonGameHUD();
/** Primary draw call for the HUD */
virtual void DrawHUD() override;
private:
/** Crosshair asset pointer */
class UTexture2D* CrosshairTex;
};
|
//
// STHTTPNetTaskQueueHandler.h
// Sth4Me
//
// Created by Kevin Lin on 29/11/14.
// Copyright (c) 2014 Sth4Me. All rights reserved.
//
#import "STNetTaskQueue.h"
@interface STHTTPNetTaskQueueHandler : NSObject<STNetTaskQueueHandler>
- (instancetype)initWithBaseURL:(NSURL *)baseURL;
- (instancetype)initWithBaseURL:(NSURL *)baseURL configuration:(NSURLSessionConfiguration *)configuration;
@end
|
// Author: Trenton Taylor
// Purpose: Prints a date in legal format
// Date 9/6/2015
#include <stdio.h>
// Obviously given up on messing with thigns other than OTB
// LLAP OTB
int main(void)
{
int month, day, year;
printf("Date (mm/dd/yy): ");
scanf("%d / %d / %d", &month, &day, &year);
// I don't like that yyyy format years will mess it up, so I'm going to
// mess with having it turn years greater than 99 into a correct date. I
// could just take it in as yyyy, or get ahead and figure out do while, but
// this seemed to try and practice last chapters skills well.
// Yay this gets rid of anything in excess of 99. FIRST TRY TOO!
if (year > 99) {
year %= 100;
}
printf("Dated this %d", day);
switch (day) {
case 1: case 21: case 31:
printf("st");
break;
case 2: case 22:
printf("nd");
break;
case 3: case 23:
printf("rd");
break;
default:
printf("th");
break;
}
printf(" day of ");
switch (month) {
case 1: printf("January"); break;
case 2: printf("February"); break;
case 3: printf("March"); break;
case 4: printf("April"); break;
case 5: printf("May"); break;
case 6: printf("June"); break;
case 7: printf("July"); break;
case 8: printf("August"); break;
case 9: printf("September"); break;
case 10: printf("October"); break;
case 11: printf("November"); break;
case 12: printf("December"); break;
}
// I love that this is how y2k happened and the book is like lol do this
printf(", 20%.2d.\n", year);
return 0;
}
|
// gcc 4.7.2 +
// gcc -std=gnu99 -Wall -g -o helloworld_c helloworld_c.c -lpthread
#include <pthread.h>
#include <stdio.h>
/*
main:
global shared int i = 0
spawn thread_1
spawn thread_2
join all threads
print i
thread_1:
do 1_000_000 times:
i++
thread_2:
do 1_000_000 times:
i--
*/
long int g_i = 0;
// Note the return type: void*
void* thread_1(){
long i;
for( i = 0; i < 1000000; i++)
g_i++;
return NULL;
}
void* thread_2(){
long i;
for( i = 0; i < 1000000; i++)
g_i--;
return NULL;
}
int main(){
pthread_t td[2];
pthread_create(&td[0], NULL, thread_1, NULL);
pthread_create(&td[1], NULL, thread_2, NULL);
// Arguments to a thread would be passed here ---------^
pthread_join(td[0], NULL);
pthread_join(td[1], NULL);
printf("Hello from main! the g_i is %ld\n", g_i);
return 0;
}
|
//
// Pictures.h
// Aspose_Cloud_SDK_For_iOS
//
// Created by Muhammad Sohail Ismail on 11/24/14.
// Copyright (c) 2014 Muhammad Sohail Ismail. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ASPOSECPicturesResponse.h"
/**
* Using 'ASPOSECPictures' class you can get a specific picture from a worksheet, Convert a picture to designated format,
* Add a picture to a worksheet, Update a specific picture from a worksheet and Delete pictures from a worksheet.
*/
@interface ASPOSECPictures : NSObject
- (instancetype) initWithFileName:(NSString *) fileName andWorksheetName:(NSString *) worksheetName;
/**
Get a specific picture from a worksheet.
@param pictureIndex Picture index.
@return An object that contains attributes of picture
*/
- (ASPOSECPicturesResponse *) getPictureFromAWorksheet:(int) pictureIndex;
/**
Convert a picture to image.
@param pictureIndex Picture index.
@param designatedFormat Convert image to this specified format.
@param outputFileName Converted image will save on device with this name.
@return Path to converted picture saved on device
*/
- (NSString *) convertPictureToImage:(int) pictureIndex format:(NSString *) designatedFormat andSaveAs:(NSString *) outputFileName;
/**
Add a picture to a worksheet.
@param upperLeftRow New image left row position.
@param upperLeftColumn New image left column position.
@param lowerRightRow New image right row position.
@param lowerRightColumn New image right column position.
@param picturePath The picture file path at storage.
@return An object that contains picture attributes
*/
- (ASPOSECPicturesResponse *) addPicturesToExcelWorksheetAtUpperLeftRowIndex:(int) upperLeftRow upperLeftColumn:(int) upperLeftColumn lowerRightRow:(int) lowerRightRow lowerRightColumn:(int) lowerRightColumn picturePath:(NSString *) picturePath;
/**
Update a specific picture from a worksheet.
@param pictureIndex Picture index.
@param pictureRequest Request for picture.
@return An object that contains picture attributes
*/
- (ASPOSECPicturesResponse *) updateASpecificPictureFromExcelWorksheet:(int) pictureIndex pictureRequest:(ASPOSECPicturesResponse *) pictureRequest;
/**
Delete all pictures from a worksheet.
@return Boolean variable that indicates whether all pictures deleted successfully from a worksheet
*/
- (BOOL) deleteAllPicturesFromExcelWorksheet;
/**
Delete a specific picture from a worksheet.
@param pictureIndex Picture index
@return Boolean variable that indicates whether a picture deleted successfully from a worksheet
*/
- (BOOL) deleteASpecificPictureFromExcelWorksheet:(int) pictureIndex;
@end
|
#pragma once
#include <vector>
#include <queue>
#include <string>
#include <climits>
#include <cmath>
#include <stack>
#include <set>
#include <sstream>
#include <algorithm>
using namespace std;
class Solution {
public:
int findPeakElement(vector<int>& nums) {
int left = 0, right = nums.size() - 1;
int mid = 0;
while (left <= right) {
mid = (left + right) / 2;
if (left == right) return left;
if (nums[mid] < nums[mid + 1]) {
left = mid + 1;
} else {
right = mid;
}
}
return mid;
}
};
|
//
// UIColor+ExploreColors.h
// Explore Prototype
//
// Created by Alex Shepard on 10/20/14.
// Copyright (c) 2014 iNaturalist. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (ExploreColors)
+ (UIColor *)inatGreen;
// iconic taxa
+ (UIColor *)colorForIconicTaxon:(NSString *)iconicTaxon;
// notices
+ (UIColor *)colorForResearchGradeNotice;
+ (UIColor *)colorForIdPleaseNotice;
+ (UIColor *)secondaryColorForResearchGradeNotice;
+ (UIColor *)secondaryColorForIdPleaseNotice;
+ (UIColor *)inatBlack;
+ (UIColor *)inatGray;
+ (UIColor *)inatRed;
+ (UIColor *)mapOverlayColor;
- (UIColor *)lighterColor;
- (UIColor *)darkerColor;
@end
|
/*
* Copyright (c) 2010-2014 OTClient <https://github.com/edubart/otclient>
*
* 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 STDEXT_PACKEDVECTOR_H
#define STDEXT_PACKEDVECTOR_H
#include <algorithm>
namespace stdext {
// disable memory alignment
#pragma pack(push,1)
template<class T, class U = uint8_t>
class packed_vector
{
public:
typedef U size_type;
typedef T* iterator;
typedef const T* const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
packed_vector() : m_size(0), m_data(nullptr) { }
packed_vector(size_type size) : m_size(size), m_data(new T[size]) { }
packed_vector(size_type size, const T& value) : m_size(size), m_data(new T[size]) { std::fill(begin(), end(), value); }
template <class InputIterator>
packed_vector(InputIterator first, InputIterator last) : m_size(last - first), m_data(new T[m_size]) { std::copy(first, last, m_data); }
packed_vector(const packed_vector<T>& other) : m_size(other.m_size), m_data(new T[other.m_size]) { std::copy(other.begin(), other.end(), m_data); }
~packed_vector() { if(m_data) delete[] m_data; }
packed_vector<T,U>& operator=(packed_vector<T,U> other) { other.swap(*this); return *this; }
iterator begin() { return m_data; }
const_iterator begin() const { return m_data; }
const_iterator cbegin() const { return m_data; }
iterator end() { return m_data + m_size; }
const_iterator end() const { return m_data + m_size; }
const_iterator cend() const { return m_data + m_size; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
size_type size() const { return m_size; }
bool empty() const { return m_size == 0; }
T& operator[](size_type i) { return m_data[i]; }
const T& operator[](size_type i) const { return m_data[i]; }
T& at(size_type i) { return m_data[i]; }
const T& at(size_type i) const { return m_data[i]; }
T& front() { return m_data[0]; }
const T& front() const { return m_data[0]; }
T& back() { return m_data[m_size-1]; }
const T& back() const { return m_data[m_size-1]; }
T *data() { return m_data; }
const T *data() const { return m_data; }
void clear() {
if(m_data) {
delete[] m_data;
m_data = nullptr;
}
m_size = 0;
}
void resize(size_type size) {
clear();
if(size > 0) {
m_data = new T[size];
m_size = size;
}
}
void push_back(const T& x) {
T *tmp = new T[m_size+1];
std::copy(m_data, m_data + m_size, tmp);
tmp[m_size] = x;
delete[] m_data;
m_data = tmp;
m_size++;
}
void pop_back() {
if(m_size == 1) {
clear();
return;
}
T *tmp = new T[m_size-1];
std::copy(m_data, m_data + m_size - 1, tmp);
delete[] m_data;
m_data = tmp;
m_size--;
}
iterator insert(const_iterator position, const T& x) {
T *tmp = new T[m_size+1];
size_type i = position - m_data;
std::copy(m_data, m_data + i, tmp);
tmp[i] = x;
std::copy(m_data + i, m_data + m_size, tmp + i + 1);
delete[] m_data;
m_data = tmp;
m_size++;
return tmp + i;
}
iterator erase(const_iterator position) {
T *tmp = new T[m_size-1];
size_type i = position - m_data;
std::copy(m_data, m_data + i, tmp);
std::copy(m_data + i + 1, m_data + m_size, tmp + i);
delete[] m_data;
m_data = tmp;
m_size--;
return tmp + i;
}
void swap(packed_vector<T,U>& other) { std::swap(m_size, other.m_size); std::swap(m_data, other.m_data); }
operator std::vector<T>() const { return std::vector<T>(begin(), end()); }
private:
size_type m_size;
T* m_data;
};
// restore memory alignment
#pragma pack(pop)
}
namespace std {
template<class T, class U> void swap(stdext::packed_vector<T,U>& lhs, stdext::packed_vector<T,U>& rhs) { lhs.swap(rhs); }
}
#endif
|
#ifndef VARIANTSCORES_H
#define VARIANTSCORES_H
#include "cppNGS_global.h"
#include "VariantList.h"
#include "BedFile.h"
#include "Phenotype.h"
//Variant scoring/ranking class.
class CPPNGSSHARED_EXPORT VariantScores
{
public:
//Result of the scoring
struct Result
{
//Algorithm name
QString algorithm;
//Scores per variant. Scores below 0 indicate that no score was calculated for the variant.
QList<double> scores;
//Score explainations per variant.
QList<QStringList> score_explainations;
//Ranks per variant. Ranks below 0 indicate that no rank was calculated for the variant.
QList<int> ranks;
//General warnings.
QStringList warnings;
};
//Default constructor
VariantScores();
//Returns the list of algorithms
static QStringList algorithms();
//Returns the algorithm description.
static QString description(QString algorithm);
//Returns a variant scores. Throws an error if the input is invalid.
static Result score(QString algorithm, const VariantList& variants, QHash<Phenotype, BedFile> phenotype_rois, const QList<Variant>& blacklist);
//Annotates a variant list with the scoring result. Returns the number of variants that were scored.
static int annotate(VariantList& variants, const Result& result, bool add_explainations = false);
//Returns the variant blackist from the settings file.
static QList<Variant> blacklist();
private:
static Result score_GSvar_V1(const VariantList& variants, QHash<Phenotype, BedFile> phenotype_rois, const QList<Variant>& blacklist);
static Result score_GSvar_V1_noNGSD(const VariantList& variants, QHash<Phenotype, BedFile> phenotype_rois, const QList<Variant>& blacklist);
};
#endif // VARIANTSCORES_H
|
#ifndef ASSERTS_H
#define ASSERTS_H
#include <iostream>
#include <cstdarg>
#include <utility>
#ifdef _WIN32
#include <intrin.h>
#define AssertBreakForce(expr) ((expr) ? 1 : ((void)__debugbreak(), 0))
#else
#include <signal.h>
#define AssertBreakForce(expr) ((expr) ? 1 : ((void)raise_with_expr(#expr, SIGTRAP), 0))
#endif
#ifndef NDEBUG
#define AssertBreak(expr) AssertBreakForce(expr)
#define AssertOnly(e) e
#else
#define AssertBreak(expr) ((void)0)
#define AssertOnly(e)
#endif
#define AssertBreakMessage(message) AssertBreak(!message)
static inline void DebugMessageOut()
{
}
template<typename T1>
void DebugMessageOut(T1&& arg)
{
std::cerr << std::forward<T1>(arg);
}
template<typename T1, typename ...T>
void DebugMessageOut(T1&& arg, T&& ...args)
{
std::cerr << std::forward<T1>(arg);
DebugMessageOut(std::forward<T>(args)...);
}
template<typename ...T>
void DebugMessage(T&& ...args)
{
DebugMessageOut(std::forward<T>(args)...);
if (sizeof...(args) > 0)
std::cerr << std::endl;
}
static inline void raise_with_expr(char const* expr, int trap)
{
std::cerr << "Assertion failed: " << expr << std::endl;
raise(trap);
}
static inline void DebugMessagev_C(const char *msg, va_list ap)
{
vfprintf(stderr, msg, ap);
}
static inline void DebugMessage_C(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
DebugMessagev_C(msg, ap);
va_end(ap);
}
#ifndef _countof
#define _countof(x) ((sizeof(x))/sizeof(*(x)))
#endif
class AssertCompare
{
public:
template<typename T1, typename T2>
static void cmp(T1 a, T2 b, char const* oper, char const*file, int line);
};
template<typename T1, typename T2>
void AssertCompare::cmp(T1 a, T2 b, char const* oper, char const*file, int line)
{
std::cout << file << "(" << line << "): Assertion failed (" << a << ") " << oper << " (" << b << ")" << std::endl;
raise(SIGTRAP);
}
#define ASSERTS_FORCE
#if !defined(NDEBUG) || defined(ASSERTS_FORCE)
#define AssertBreakNotEqual(a, b) ((a) != (b) ? (void)0 : AssertCompare::cmp((a), (b), "!=", __FILE__, __LINE__))
#define AssertBreakEqual(a, b) ((a) == (b) ? (void)0 : AssertCompare::cmp((a), (b), "==", __FILE__, __LINE__))
#define AssertBreakGreater(a, b) ((a) > (b) ? (void)0 : AssertCompare::cmp((a), (b), ">", __FILE__, __LINE__))
#define AssertBreakLess(a, b) ((a) < (b) ? (void)0 : AssertCompare::cmp((a), (b), "<", __FILE__, __LINE__))
#define AssertBreakGEqual(a, b) ((a) >= (b) ? (void)0 : AssertCompare::cmp((a), (b), ">=", __FILE__, __LINE__))
#define AssertBreakLEqual(a, b) ((a) <= (b) ? (void)0 : AssertCompare::cmp((a), (b), "<=", __FILE__, __LINE__))
#else
#define AssertBreakNotEqual(a, b) ((void)0)
#define AssertBreakEqual(a, b) ((void)0)
#define AssertBreakGreater(a, b) ((void)0)
#define AssertBreakLess(a, b) ((void)0)
#define AssertBreakGEqual(a, b) ((void)0)
#define AssertBreakLEqual(a, b) ((void)0)
#endif
#endif // ASSERTS_H
|
/*
* Best: O(n^2)
* Worst: O(n^2)
* Average: O(n^2)
*
* Online: No
* In Place:Yes
* Adaptive:No
* Stable: No
*/
#ifndef __SELECTION_H_
#define __SELECTION_H_
#include <iostream>
#include "sort.h"
template <typename T>
class SelectionSort : public Sort<T>
{
public:
virtual void sort(typename std::vector<T>::iterator start, typename std::vector<T>::iterator end)
{
std::cout << "Selection Sorting..." << std::endl;
if(start == end)
return;
typename std::vector<T>::iterator i = start;
while(i != (end-1)) {
typename std::vector<T>::iterator j = i + 1;
typename std::vector<T>::iterator min = i;
while(j != end) {
if(this->less(*j, *min))
min = j;
j++;
}
this->swap(*i, *min);
i++;
}
}
};
#endif
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
# error This header can only be compiled as C++.
#endif
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
#include "serialize.h"
#include "netbase.h"
#include <string>
#include "uint256.h"
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 43421 : 42070;
}
extern unsigned char pchMessageStart[4];
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
IMPLEMENT_SERIALIZE
(
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
)
// TODO: make private (improves encapsulation)
public:
enum {
MESSAGE_START_SIZE=sizeof(::pchMessageStart),
COMMAND_SIZE=12,
MESSAGE_SIZE_SIZE=sizeof(int),
CHECKSUM_SIZE=sizeof(int),
MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE,
HEADER_SIZE=MESSAGE_START_SIZE+COMMAND_SIZE+MESSAGE_SIZE_SIZE+CHECKSUM_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
NODE_BLOOM = (1 << 1),
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64 nServicesIn=NODE_NETWORK);
void Init();
IMPLEMENT_SERIALIZE
(
CAddress* pthis = const_cast<CAddress*>(this);
CService* pip = (CService*)pthis;
if (fRead)
pthis->Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*pip);
)
void print() const;
// TODO: make private (improves encapsulation)
public:
uint64 nServices;
// disk and network only
unsigned int nTime;
// memory only
int64 nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
IMPLEMENT_SERIALIZE
(
READWRITE(type);
READWRITE(hash);
)
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
const char* GetCommand() const;
std::string ToString() const;
void print() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
enum
{
MSG_TX = 1,
MSG_BLOCK,
// Nodes may always request a MSG_FILTERED_BLOCK in a getdata, however,
// MSG_FILTERED_BLOCK should not appear in any invs except as a part of getdata.
MSG_FILTERED_BLOCK,
};
#endif // __INCLUDED_PROTOCOL_H__
|
#ifndef MULTILOBEFIT_1931_H
#define MULTILOBEFIT_1931_H
#include "xyzAbstract.h"
class XYZMultiLobeFit1931 : public XYZAbstract
{
public:
XYZMultiLobeFit1931() { strcpy( name, "Multi-Lobe Fit (Sec 2.2) to CIE 1931" ); }
virtual ~XYZMultiLobeFit1931() {}
virtual float X( float wavelen );
virtual float Y( float wavelen );
virtual float Z( float wavelen );
};
#endif
|
//
// DialogViewController.h
// ARIS
//
// Created by Kevin Harris on 09/11/17.
// Copyright Studio Tectorum 2009. All rights reserved.
//
#import "ARISViewController.h"
#import "InstantiableViewControllerProtocol.h"
#import "GamePlayTabBarViewControllerProtocol.h"
@protocol DialogViewControllerDelegate <InstantiableViewControllerDelegate, GamePlayTabBarViewControllerDelegate>
@end
@class Instance;
@class Tab;
@interface DialogViewController : ARISViewController <InstantiableViewControllerProtocol, GamePlayTabBarViewControllerProtocol>
- (id) initWithInstance:(Instance *)i delegate:(id<DialogViewControllerDelegate>)d;
- (id) initWithTab:(Tab *)t delegate:(id<DialogViewControllerDelegate>)d;
@end
|
//
// KYNoteView.h
// KuaiYiSuper
//
// Created by WZZ on 16/4/28.
// Copyright © 2016年 WZZ. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface KYNoteView : UIView
@property(nonatomic,strong)void(^loginBlcok)();
@end
|
//
// ZBManualReminderList.h
// Books
//
// Created by Balasankar J on 26/02/14.
// Copyright (c) 2014 Balasankar J. All rights reserved.
//
/**
\addtogroup List
*@{
*/
#import <Foundation/Foundation.h>
#import "ZBPageContext.h"
/**
ZBManualReminderList interface has array of ZBManualReminder object.\n
It is extended from NSMutableArray, so you can use all the properties and methods from NSMutableArray.
*/
@interface ZBManualReminderList : NSMutableArray
{
NSMutableArray *manualReminders;
}
/**
This property has the page context information from the server response.
@accessors \e \c getPageContext, \e \c setPageContext
*/
@property(nonatomic, retain, getter = getPageContext) ZBPageContext *pageContext;
-(id)init;
-(NSUInteger)count;
-(id)objectAtIndex:(NSUInteger)index;
-(void)insertObject:(id)anObject atIndex:(NSUInteger)index;
-(void)removeObjectAtIndex:(NSUInteger)index;
-(void)addObject:(id)anObject;
-(void)removeLastObject;
-(void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
@end
/** @}*/
|
//
// 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"
@class NSBox, NSTextField;
@interface IDEDistributionTableCellView : NSTableCellView
{
NSBox *_bottomBorder;
NSTextField *_titleField;
}
@property(retain) NSTextField *titleField; // @synthesize titleField=_titleField;
@property(retain) NSBox *bottomBorder; // @synthesize bottomBorder=_bottomBorder;
- (double)heightAccomodatingTextFieldWrappingWithColumnWidth:(double)arg1;
@end
|
/*
* The MIT License
*
* Copyright 2020 The OpenNARS authors.
*
* 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 RULETABLE_H
#define RULETABLE_H
/////////////////
// RuleTable //
/////////////////
//The rule table which .c is generated at compile time
//by NAL_GenerateRuleTable
//References//
//----------//
#include "NAL.h"
//Methods//
//-------//
void RuleTable_Apply(Term term1, Term term2, Truth truth1, Truth truth2, long conclusionOccurrence, Stamp conclusionStamp,
long currentTime, double parentPriority, double conceptPriority, bool doublePremise, Concept *validation_concept, long validation_cid);
Term RuleTable_Reduce(Term term1, bool doublePremise);
#endif
|
#ifndef ESMB_H_
#define ESMB_H_
void para_esmb_ini( struct config_t* cfg, struct parameters *ps );
void para_esmb_del( struct parameters *ps );
void para_esmb_update( long i_esmb, struct parameters *ps );
#endif
|
/* --------------------------------------------------------------------------
*
* File GameArea2D.h
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft. All rights reserved.
*
* --------------------------------------------------------------------------
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#ifndef __GameArea2D_h__
#define __GameArea2D_h__
#include "GameObject.h"
#include "DebugDrawNode.h"
enum
{
GO_TAG_WALL = 0,
GO_TAG_ACTOR = 1,
};
class GameArea2D : public Recipe
{
public :
GameArea2D ( KDvoid );
virtual ~GameArea2D ( KDvoid );
public :
virtual KDbool init ( KDvoid );
virtual KDvoid step ( KDfloat fDelta );
virtual KDvoid handleCollisionWithObjA ( GameObject* pObjectA, GameObject* pObjectB );
virtual KDvoid handleZMissWithObjA ( GameObject* pObjectA, GameObject* pObjectB );
virtual KDvoid showDebugDraw ( KDvoid );
virtual KDvoid showMinimalDebugDraw ( KDvoid );
virtual KDvoid hideDebugDraw ( KDvoid );
virtual KDvoid initDebugDraw ( KDvoid );
virtual KDvoid swapDebugDraw ( CCObject* pSender = KD_NULL );
virtual KDvoid addDebugButton ( KDvoid );
virtual KDvoid addLevelBoundaries ( KDvoid );
virtual KDvoid addRandomPolygons ( KDint nNum );
virtual KDvoid addRandomBoxes ( KDint nNum );
virtual KDvoid addPolygonAtPoint ( CCPoint tPoint );
virtual KDvoid addBoxAtPoint ( CCPoint tPoint, const CCSize& tSize );
virtual KDvoid markBodyForDestruction ( GameObject* pObject );
virtual KDvoid destroyBodies ( KDvoid );
virtual KDvoid markBodyForCreation ( GameObject* pObject );
virtual KDvoid createBodies ( KDvoid );
virtual KDvoid runQueuedActions ( KDvoid );
// Drawing
virtual KDvoid drawLayer ( KDvoid );
// Camera
virtual KDbool checkCameraBoundsWithFailPosition ( CCPoint* pFailPosition );
virtual KDbool checkCameraBounds ( KDvoid );
virtual KDvoid setCameraPosition ( const CCPoint& tPosition );
virtual CCPoint convertCamera ( const CCPoint& tPosition );
virtual KDvoid setCameraZoom ( KDfloat fZoom );
virtual KDvoid zoomTo ( KDfloat fZoom, KDfloat fSpeed );
virtual KDvoid processZoomStep ( KDvoid );
virtual CCPoint convertTouchCoord ( const CCPoint& tTouchPoint );
virtual CCPoint convertGameCoord ( const CCPoint& tGamePoint );
virtual KDvoid centerCameraOnGameCoord ( const CCPoint& tGamePoint );
// Touches
virtual KDvoid ccTouchesBegan ( CCSet* pTouches, CCEvent* pEvent );
virtual KDvoid ccTouchesMoved ( CCSet* pTouches, CCEvent* pEvent );
virtual KDvoid ccTouchesEnded ( CCSet* pTouches, CCEvent* pEvent );
virtual KDbool hudBegan ( CCSet* pTouches, CCEvent* pEvent );
virtual KDbool hudMoved ( CCSet* pTouches, CCEvent* pEvent );
virtual KDbool hudEnded ( CCSet* pTouches, CCEvent* pEvent );
virtual KDvoid tapWithPoint ( const CCPoint& tPoint );
// Misc
virtual KDfloat distanceP1 ( const CCPoint& tFirstTouch, const CCPoint& tSecondTouch );
protected :
b2World* m_pWorld;
CCBox2DDebugDraw* m_pDebugDraw;
KDbool m_bDebugDraw;
CCNode* m_pGameNode;
DebugDrawNode* m_pDebugDrawNode;
GameObject* m_pLevelBoundary;
CCArray* m_pBodiesToDestroy;
CCArray* m_pPostDestructionCallbacks;
CCArray* m_pBodiesToCreate;
CCArray* m_pQueuedActions;
CCSize m_tGameAreaSize;
KDfloat m_fCameraZoom; // Starts at 1.0f. Smaller means more zoomed out.
KDfloat m_fCameraZoomTo;
KDfloat m_fCameraZoomSpeed; // Must be greater than 0 but less than 1
KDfloat m_fLastMultiTouchZoomDistance; // How far apart your fingers were last time
CCPoint m_tDraggedToPoint; // How far we dragged from initial touch
CCPoint m_tLastTouchedPoint; // Where we last touched
KDint m_nCameraState; // What is the camera currently doing?
CCDictionary* m_pAllTouches;
};
#endif // __GameArea2D_h__
|
/*
RFC - KScopedStructPointer.h
Copyright (C) 2013-2019 CrownSoft
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _RFC_KSCOPED_STRUCT_POINTER_H_
#define _RFC_KSCOPED_STRUCT_POINTER_H_
#include <malloc.h>
#include <Objbase.h>
template<class StructType>
class KReleaseUsingFree
{
public:
static void Release(StructType* structPtr)
{
::free(structPtr);
}
};
template<class StructType>
class KReleaseUsingTaskMemFree
{
public:
static void Release(StructType* memory)
{
::CoTaskMemFree(memory);
}
};
/**
This class holds a pointer to the struct which is automatically freed when this object goes
out of scope.
*/
template<class StructType, class ReleaseMethod = KReleaseUsingFree<StructType>>
class KScopedStructPointer
{
private:
StructType* structPointer;
// Prevent heap allocation
void* operator new(size_t);
void* operator new[](size_t);
void operator delete(void*);
void operator delete[](void*);
public:
inline KScopedStructPointer()
{
structPointer = NULL;
}
inline KScopedStructPointer(StructType* structPointer)
{
this->structPointer = structPointer;
}
KScopedStructPointer(KScopedStructPointer& structPointerToTransferFrom)
{
this->structPointer = structPointerToTransferFrom.structPointer;
structPointerToTransferFrom.structPointer = NULL;
}
bool IsNull()
{
return (structPointer == NULL);
}
/**
Removes the current struct pointer from this KScopedStructPointer without freeing it.
This will return the current struct pointer, and set the KScopedStructPointer to a null pointer.
*/
StructType* Detach()
{
StructType* m = structPointer;
structPointer = NULL;
return m;
}
~KScopedStructPointer()
{
if (structPointer)
ReleaseMethod::Release(structPointer);
}
/**
Changes this KScopedStructPointer to point to a new struct.
If this KScopedStructPointer already points to a struct, that struct
will first be freed.
The pointer that you pass in may be a nullptr.
*/
KScopedStructPointer& operator= (StructType* const newStructPointer)
{
if (structPointer != newStructPointer)
{
StructType* const oldStructPointer = structPointer;
structPointer = newStructPointer;
if (oldStructPointer)
ReleaseMethod::Release(oldStructPointer);
}
return *this;
}
inline StructType** operator&() { return &structPointer; }
/** Returns the struct pointer that this KScopedStructPointer refers to. */
inline operator StructType*() const { return structPointer; }
/** Returns the struct pointer that this KScopedStructPointer refers to. */
inline StructType& operator*() const { return *structPointer; }
/** Lets you access properties of the struct that this KScopedStructPointer refers to. */
inline StructType* operator->() const { return structPointer; }
};
#endif
|
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Lake Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_BITCOINUNITS_H
#define BITCOIN_QT_BITCOINUNITS_H
#include "amount.h"
#include <QAbstractListModel>
#include <QString>
// U+2009 THIN SPACE = UTF-8 E2 80 89
#define REAL_THIN_SP_CP 0x2009
#define REAL_THIN_SP_UTF8 "\xE2\x80\x89"
#define REAL_THIN_SP_HTML " "
// U+200A HAIR SPACE = UTF-8 E2 80 8A
#define HAIR_SP_CP 0x200A
#define HAIR_SP_UTF8 "\xE2\x80\x8A"
#define HAIR_SP_HTML " "
// U+2006 SIX-PER-EM SPACE = UTF-8 E2 80 86
#define SIXPEREM_SP_CP 0x2006
#define SIXPEREM_SP_UTF8 "\xE2\x80\x86"
#define SIXPEREM_SP_HTML " "
// U+2007 FIGURE SPACE = UTF-8 E2 80 87
#define FIGURE_SP_CP 0x2007
#define FIGURE_SP_UTF8 "\xE2\x80\x87"
#define FIGURE_SP_HTML " "
// QMessageBox seems to have a bug whereby it doesn't display thin/hair spaces
// correctly. Workaround is to display a space in a small font. If you
// change this, please test that it doesn't cause the parent span to start
// wrapping.
#define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>"
// Define THIN_SP_* variables to be our preferred type of thin space
#define THIN_SP_CP REAL_THIN_SP_CP
#define THIN_SP_UTF8 REAL_THIN_SP_UTF8
#define THIN_SP_HTML HTML_HACK_SP
/** Lake unit definitions. Encapsulates parsing and formatting
and serves as list model for drop-down selection boxes.
*/
class BitcoinUnits: public QAbstractListModel
{
Q_OBJECT
public:
explicit BitcoinUnits(QObject *parent);
/** Lake units.
@note Source: https://en.bitcoin.it/wiki/Units . Please add only sensible ones
*/
enum Unit
{
LAKE,
mLAKE,
uLAKE,
duffs
};
enum SeparatorStyle
{
separatorNever,
separatorStandard,
separatorAlways
};
//! @name Static API
//! Unit conversion and formatting
///@{
//! Get list of units, for drop-down box
static QList<Unit> availableUnits();
//! Is unit ID valid?
static bool valid(int unit);
//! Short name
static QString name(int unit);
//! Longer description
static QString description(int unit);
//! Number of Satoshis (1e-8) per unit
static qint64 factor(int unit);
//! Number of decimals left
static int decimals(int unit);
//! Format as string
static QString format(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
static QString simpleFormat(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
//! Format as string (with unit)
static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
//! Format as HTML string (with unit)
static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
//! Format as string (with unit) but floor value up to "digits" settings
static QString floorWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
static QString floorHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
//! Parse string to coin amount
static bool parse(int unit, const QString &value, CAmount *val_out);
//! Gets title for amount column including current display unit if optionsModel reference available */
static QString getAmountColumnTitle(int unit);
///@}
//! @name AbstractListModel implementation
//! List model for unit drop-down selection box.
///@{
enum RoleIndex {
/** Unit identifier */
UnitRole = Qt::UserRole
};
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
///@}
static QString removeSpaces(QString text)
{
text.remove(' ');
text.remove(QChar(THIN_SP_CP));
#if (THIN_SP_CP != REAL_THIN_SP_CP)
text.remove(QChar(REAL_THIN_SP_CP));
#endif
return text;
}
//! Return maximum number of base units (Satoshis)
static CAmount maxMoney();
private:
QList<BitcoinUnits::Unit> unitlist;
};
typedef BitcoinUnits::Unit BitcoinUnit;
#endif // BITCOIN_QT_BITCOINUNITS_H
|
/* $Id: resample.h 3553 2011-05-05 06:14:19Z nanang $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __PJMEDIA_RESAMPLE_H__
#define __PJMEDIA_RESAMPLE_H__
/**
* @file resample.h
* @brief Sample rate converter.
*/
#include <VialerPJSIP/pjmedia/types.h>
#include <VialerPJSIP/pjmedia/port.h>
/**
* @defgroup PJMEDIA_RESAMPLE Resampling Algorithm
* @ingroup PJMEDIA_FRAME_OP
* @brief Sample rate conversion algorithm
* @{
*
* This section describes the base resampling functions. In addition to this,
* application can use the @ref PJMEDIA_RESAMPLE_PORT which provides
* media port abstraction for the base resampling algorithm.
*/
PJ_BEGIN_DECL
/*
* This file declares two types of API:
*
* Application can use #pjmedia_resample_create() and #pjmedia_resample_run()
* to convert a frame from source rate to destination rate. The inpuit frame
* must have a constant length.
*
* Alternatively, application can create a resampling port with
* #pjmedia_resample_port_create() and connect the port to other ports to
* change the sampling rate of the samples.
*/
/**
* Opaque resample session.
*/
typedef struct pjmedia_resample pjmedia_resample;
/**
* Create a frame based resample session.
*
* @param pool Pool to allocate the structure and buffers.
* @param high_quality If true, then high quality conversion will be
* used, at the expense of more CPU and memory,
* because temporary buffer needs to be created.
* @param large_filter If true, large filter size will be used.
* @param channel_count Number of channels.
* @param rate_in Clock rate of the input samples.
* @param rate_out Clock rate of the output samples.
* @param samples_per_frame Number of samples per frame in the input.
* @param p_resample Pointer to receive the resample session.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_resample_create(pj_pool_t *pool,
pj_bool_t high_quality,
pj_bool_t large_filter,
unsigned channel_count,
unsigned rate_in,
unsigned rate_out,
unsigned samples_per_frame,
pjmedia_resample **p_resample);
/**
* Use the resample session to resample a frame. The frame must have the
* same size and settings as the resample session, or otherwise the
* behavior is undefined.
*
* @param resample The resample session.
* @param input Buffer containing the input samples.
* @param output Buffer to store the output samples.
*/
PJ_DECL(void) pjmedia_resample_run( pjmedia_resample *resample,
const pj_int16_t *input,
pj_int16_t *output );
/**
* Get the input frame size of a resample session.
*
* @param resample The resample session.
*
* @return The frame size, in number of samples.
*/
PJ_DECL(unsigned) pjmedia_resample_get_input_size(pjmedia_resample *resample);
/**
* Destroy the resample.
*
* @param resample The resample session.
*/
PJ_DECL(void) pjmedia_resample_destroy(pjmedia_resample *resample);
/**
* @}
*/
/**
* @defgroup PJMEDIA_RESAMPLE_PORT Resample Port
* @ingroup PJMEDIA_PORT
* @brief Audio sample rate conversion
* @{
*
* This section describes media port abstraction for @ref PJMEDIA_RESAMPLE.
*/
/**
* Option flags that can be specified when creating resample port.
*/
enum pjmedia_resample_port_options
{
/**
* Do not use high quality resampling algorithm, but use linear
* algorithm instead.
*/
PJMEDIA_RESAMPLE_USE_LINEAR = 1,
/**
* Use small filter workspace when high quality resampling is
* used.
*/
PJMEDIA_RESAMPLE_USE_SMALL_FILTER = 2,
/**
* Do not destroy downstream port when resample port is destroyed.
*/
PJMEDIA_RESAMPLE_DONT_DESTROY_DN = 4
};
/**
* Create a resample port. This creates a bidirectional resample session,
* which will resample frames when the port's get_frame() and put_frame()
* is called.
*
* When the resample port's get_frame() is called, this port will get
* a frame from the downstream port and resample the frame to the target
* clock rate before returning it to the caller.
*
* When the resample port's put_frame() is called, this port will resample
* the frame to the downstream port's clock rate before giving the frame
* to the downstream port.
*
* @param pool Pool to allocate the structure and buffers.
* @param dn_port The downstream port, which clock rate is to
* be converted to the target clock rate.
* @param clock_rate Target clock rate.
* @param options Flags from #pjmedia_resample_port_options.
* When this flag is zero, the default behavior
* is to use high quality resampling with
* large filter, and to destroy downstream port
* when resample port is destroyed.
* @param p_port Pointer to receive the resample port instance.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_resample_port_create( pj_pool_t *pool,
pjmedia_port *dn_port,
unsigned clock_rate,
unsigned options,
pjmedia_port **p_port );
PJ_END_DECL
/**
* @}
*/
#endif /* __PJMEDIA_RESAMPLE_H__ */
|
#ifndef __FRINGE_CONTEXT_BASE_H__
#define __FRINGE_CONTEXT_BASE_H__
template <class T>
class FringeContextBase {
public:
T *dut = NULL;
std::string path = "";
FringeContextBase(std::string p) {
path = p;
}
virtual void load() = 0;
virtual uint64_t malloc(size_t bytes) = 0;
virtual void free(uint64_t buf) = 0;
virtual void memcpy(uint64_t devmem, void* hostmem, size_t size) = 0;
virtual void memcpy(void* hostmem, uint64_t devmem, size_t size) = 0;
virtual void run() = 0;
virtual void writeReg(uint32_t reg, uint64_t data) = 0;
virtual uint64_t readReg(uint32_t reg) = 0;
virtual uint64_t getArg(uint32_t arg, bool isIO) = 0;
virtual uint64_t getArg64(uint32_t arg, bool isIO) = 0;
virtual void setArg(uint32_t arg, uint64_t data, bool isIO) = 0;
virtual void setNumArgIns(uint32_t number) = 0;
virtual void setNumArgIOs(uint32_t number) = 0;
virtual void setNumArgOutInstrs(uint32_t number) = 0;
virtual void setNumArgOuts(uint32_t number) = 0;
virtual void setNumEarlyExits(uint32_t number) = 0;
virtual void flushCache(uint32_t kb) = 0;
~FringeContextBase() {
delete dut;
}
};
// Fringe error codes
// Fringe APIs - implemented only for simulation
void fringeInit(int argc, char **argv);
#endif
|
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// DataBindingLib
#define COCOAPODS_POD_AVAILABLE_DataBindingLib
#define COCOAPODS_VERSION_MAJOR_DataBindingLib 0
#define COCOAPODS_VERSION_MINOR_DataBindingLib 1
#define COCOAPODS_VERSION_PATCH_DataBindingLib 0
|
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2008, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
#ifndef HSMC4_H
#define HSMC4_H
//------------------------------------------------------------------------------
// Headers
//------------------------------------------------------------------------------
#include <board.h>
//------------------------------------------------------------------------------
// Definitions
//------------------------------------------------------------------------------
#define NFC_SRAM_BASE_ADDRESS 0x20100000
#ifndef BOARD_NF_COMMAND_ADDR
#define CMD_BASE_ADDR 0x60000000
#else
#define CMD_BASE_ADDR BOARD_NF_COMMAND_ADDR
#endif
//------------------------------------------------------------------------------
// Exported functions
//------------------------------------------------------------------------------
extern void HSMC4_SendCommand (unsigned int cmd, unsigned int addressCycle, unsigned int cycle0);
extern unsigned char HSMC4_isHostBusy(void);
extern unsigned char HSMC4_TransferComplete(void);
extern unsigned char HSMC4_isReadyBusy(void);
extern unsigned char HSMC4_isNfcBusy(void);
extern unsigned char HSMC4_isEccReady(void);
extern void HSMC4_SetMode(unsigned int mode);
extern void HSMC4_ResetNfc(void);
extern void HSMC4_EnableNfc(void);
extern void HSMC4_EnableNfcHost(void);
extern void HSMC4_EnableSpareRead(void);
extern void HSMC4_DisableSpareRead(void);
extern void HSMC4_EnableSpareWrite(void);
extern void HSMC4_DisableSpareWrite(void);
extern unsigned char HSMC4_isSpareRead(void);
extern unsigned char HSMC4_isSpareWrite(void);
extern unsigned int HSMC4_GetStatus(void);
#endif //#ifndef HSMC4_H
|
// The MIT License (MIT)
// Copyright (c) 2013 lailongwei<lailongwei@126.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 __LLBC_COMM_IPROTOCOL_FILTER_H__
#define __LLBC_COMM_IPROTOCOL_FILTER_H__
#include "llbc/common/Common.h"
#include "llbc/core/Core.h"
__LLBC_NS_BEGIN
/**
* \brief The protocol filter class encapsulation.
*/
class LLBC_EXPORT LLBC_IProtocolFilter
{
public:
virtual ~LLBC_IProtocolFilter() { }
public:
/**
* When packet send, will call this filter method to filter packet.
* @param[in] packet - packet.
* @return int - return 0 tell service send this packet, if return -1, this packet will discard.
*/
virtual int FilterSend(const LLBC_Packet &packet) = 0;
/**
* When packet received, will call this filter method to filter packet.
* @param[in] packet - packet.
* @return int - return 0 if want to receive this packet, if return -1, this packet will discard.
*/
virtual int FilterRecv(const LLBC_Packet &packet) = 0;
/**
* When one connection established, will call this filter method to filter packet.
* @param[in] local - the local socket address.
* @param[in] peer - the peer socket address.
* @return int - return 0 if want to accept this connect, if return -1, will close this connection.
*/
virtual int FilterConnect(const LLBC_SockAddr_IN &local, const LLBC_SockAddr_IN &peer) = 0;
};
__LLBC_NS_END
#endif // !__LLBC_COMM_IPROTOCOL_FILTER_H__
|
//----------------------------------------------------------------
// File: patReadNetworkFromXml.h
// Author: Michel Bierlaire
// Creation: Thu Oct 30 12:06:29 2008
//----------------------------------------------------------------
#ifndef patReadNetworkFromXml_h
#define patReadNetworkFromXml_h
#include "patString.h"
#include "patType.h"
#include "patError.h"
#include "patNetwork.h"
class patReadNetworkFromXml {
public:
// If ctn is TRUE, the network is cleaned, that is useless nodes are
// removed, unconnected nodes as well. It means that some ids may be
// changed. If ctn is FALSE, nothing is done, and the ids defined
// in the file are maintained.
patReadNetworkFromXml(patString fName);
patBoolean readFile(patError*& err) ;
patNetwork getNetwork() ;
private:
patString fileName ;
patNetwork theNetwork ;
patULong multiplierForTwoWaysIds ;
patBoolean cleanTheNetwork ;
};
#endif
|
#ifndef _AFE_Hardware_rainmeter_h
#define _AFE_Hardware_rainmeter_h
#define AFE_HARDWARE_RAINMETER_DEFAULT_BOUNCING 1
#define AFE_HARDWARE_RAINMETER_DEFAULT_INTERVAL 60
#if defined(AFE_DEVICE_iECS_WHEATER_STATION_20) || defined(AFE_DEVICE_iECS_WHEATER_STATION_21)
#define AFE_HARDWARE_RAINMETER_DEFAULT_GPIO 13
#define AFE_HARDWARE_RAINMETER_DEFAULT_RESOLUTION 172.5
#else
#define AFE_HARDWARE_RAINMETER_DEFAULT_GPIO 13
#define AFE_HARDWARE_RAINMETER_DEFAULT_RESOLUTION 172.5
#endif
#define AFE_CONFIG_API_JSON_RAINMETER_DATA_LENGTH 160 // Orginal 150 added 10
#endif // _AFE_Hardware_rainmeter_h
|
#import <Foundation/Foundation.h>
#import "XMPPCoreDataStorage.h"
#import "XMPPMessageArchiving.h"
#import "XMPPMessageArchiving_Message_CoreDataObject.h"
#import "XMPPMessageArchiving_Contact_CoreDataObject.h"
@interface XMPPMessageArchivingCoreDataStorage : XMPPCoreDataStorage <XMPPMessageArchivingStorage>
{
/* Inherited protected variables from XMPPCoreDataStorage
NSString *databaseFileName;
NSUInteger saveThreshold;
dispatch_queue_t storageQueue;
*/
}
/**
* Convenience method to get an instance with the default database name.
*
* IMPORTANT:
* You are NOT required to use the sharedInstance.
*
* If your application uses multiple xmppStreams, and you use a sharedInstance of this class,
* then all of your streams share the same database store. You might get better performance if you create
* multiple instances of this class instead (using different database filenames), as this way you can have
* concurrent writes to multiple databases.
**/
+ (XMPPMessageArchivingCoreDataStorage *)sharedInstance;
@property (strong) NSString *messageEntityName;
@property (strong) NSString *contactEntityName;
- (NSEntityDescription *)messageEntity:(NSManagedObjectContext *)moc;
- (NSEntityDescription *)contactEntity:(NSManagedObjectContext *)moc;
- (XMPPMessageArchiving_Contact_CoreDataObject *)contactForMessage:(XMPPMessageArchiving_Message_CoreDataObject *)msg;
- (XMPPMessageArchiving_Contact_CoreDataObject *)contactWithJid:(XMPPJID *)contactJid
streamJid:(XMPPJID *)streamJid
managedObjectContext:(NSManagedObjectContext *)moc;
- (XMPPMessageArchiving_Contact_CoreDataObject *)contactWithBareJidStr:(NSString *)contactBareJidStr
streamBareJidStr:(NSString *)streamBareJidStr
managedObjectContext:(NSManagedObjectContext *)moc;
/* Inherited from XMPPCoreDataStorage
* Please see the XMPPCoreDataStorage header file for extensive documentation.
- (id)initWithDatabaseFilename:(NSString *)databaseFileName;
- (id)initWithInMemoryStore;
@property (readonly) NSString *databaseFileName;
@property (readwrite) NSUInteger saveThreshold;
@property (readonly) NSManagedObjectModel *managedObjectModel;
@property (readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (readonly) NSManagedObjectContext *mainThreadManagedObjectContext;
*/
@end
|
//-----------------------------------------------------------------------------
// VST Plug-Ins SDK
// VSTGUI: Graphical User Interface Framework for VST plugins :
//
// Version 4.2
//
//-----------------------------------------------------------------------------
// VSTGUI LICENSE
// (c) 2013, Steinberg Media Technologies, All Rights Reserved
//-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Steinberg Media Technologies nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
#ifndef __uiopenglview__
#define __uiopenglview__
#include "../../iplatformopenglview.h"
#if TARGET_OS_IPHONE
#if VSTGUI_OPENGL_SUPPORT
#ifdef __OBJC__
@class UIView, GLKView, NSRecursiveLock;
#else
struct GLKView;
struct UIView;
struct NSRecursiveLock;
#endif
namespace VSTGUI {
//------------------------------------------------------------------------------------
class GLKitOpenGLView : public IPlatformOpenGLView
{
public:
GLKitOpenGLView (UIView* parent);
~GLKitOpenGLView ();
virtual bool init (IOpenGLView* view, PixelFormat* pixelFormat = 0) VSTGUI_OVERRIDE_VMETHOD;
virtual void remove () VSTGUI_OVERRIDE_VMETHOD;
virtual void invalidRect (const CRect& rect) VSTGUI_OVERRIDE_VMETHOD;
virtual void viewSizeChanged (const CRect& visibleSize) VSTGUI_OVERRIDE_VMETHOD;
virtual bool makeContextCurrent () VSTGUI_OVERRIDE_VMETHOD;
virtual bool lockContext () VSTGUI_OVERRIDE_VMETHOD;
virtual bool unlockContext () VSTGUI_OVERRIDE_VMETHOD;
virtual void swapBuffers () VSTGUI_OVERRIDE_VMETHOD;
void doDraw (const CRect& r);
//------------------------------------------------------------------------------------
protected:
UIView* parent;
GLKView* platformView;
IOpenGLView* view;
NSRecursiveLock* lock;
PixelFormat pixelFormat;
};
} // namespace
#endif // VSTGUI_OPENGL_SUPPORT
#endif // TARGET_OS_IPHONE
#endif // __uiopenglview__
|
#ifndef CLIENTGUI_H
#define CLIENTGUI_H
#include <QMainWindow>
#include "login.h"
namespace Ui {
class client;
}
class client : public QMainWindow
{
Q_OBJECT
public:
Client* m_client;
login* m_loginWindow;
explicit client(QWidget *parent = 0);
~client();
private slots:
void on_ConnectButton_clicked();
void on_LocalButton_clicked();
private:
int m_pipe[2];
Ui::client* m_ui;
void printError();
};
#endif // CLIENTGUI_H
|
#ifndef GINGER_GSEARCH_GSCORE_H_
#define GINGER_GSEARCH_GSCORE_H_
#include <iostream>
#include <seqan/sequence.h>
#include <seqan/align.h>
#include <seqan/index.h>
#include <seqan/GStructs/GFastaRecord.h>
using namespace seqan;
using namespace std;
// LocalAlignmentEnumerator
template<typename TScore, typename TSequence, typename TScoringScheme>
int GScore(TScore &score, GFastaRecord<TSequence> &newRecord, GFastaRecord<TSequence> &clusterRecord,
TScoringScheme &scoringScheme, string &scoreMode)
{
// LOCAL_ALIGNMENT_MODE
if (scoreMode=="LOCAL_ALIGNMENT_MODE") {
score=0;
LocalAlignmentEnumerator<SimpleScore, Unbanded> enumerator(scoringScheme, 1);
Align < String<Dna5> > align;
resize(rows(align), 2);
assignSource(row(align, 0), newRecord.seq);
assignSource(row(align, 1), clusterRecord.seq);
while (nextLocalAlignment(align, enumerator))
{
score +=getScore(enumerator);
::std::cout << score << ::std::endl;
::std::cout << align << ::std::endl;
}
//::std::cout << score << ::std::endl;
//for(int i=0;i<length(rows(align));i++)
//{::std::cout << rows(align)[i]<< "\n" << ::std::endl;}
return 0;
}
// COMMON_QGRAM_MODE
if (scoreMode=="COMMON_QGRAM_MODE") {
typedef StringSet<TSequence > TSet;
typedef Index< TSet, IndexQGram<UngappedShape<2> > > TIndex;
TSet mySet;
appendValue(mySet, clusterRecord.seq);
appendValue(mySet, newRecord.seq);
TIndex myIndex(mySet);
String<double> distMat;
getKmerSimilarityMatrix(myIndex,distMat);
score=(int) (distMat[1]*1000);
return 0;
}
// NO_MODE
cerr << "Unknown score mode: " << scoreMode << endl;
return 1;
}
#endif // GINGER_GSEARCH_GSCORE_H_
|
#ifndef _CFL_TYPED_PROGRAM_H_
#define _CFL_TYPED_PROGRAM_H_
#include "cfl_typed_program.types.h"
#include "cfl_ast.h"
#include "cfl_type.types.h"
bool cfl_is_free_in_typed_node(char* name, cfl_typed_node* node);
cfl_typed_node* cfl_create_typed_node(cfl_node_type node_type,
cfl_type* resulting_type,
unsigned int number_of_children,
void* data,
cfl_typed_node** children);
void cfl_free_typed_node(cfl_typed_node* node);
void cfl_free_typed_node_list(cfl_typed_node_list* list);
void cfl_free_typed_definition_list(cfl_typed_definition_list* list);
void cfl_free_typed_program(cfl_typed_program* program);
void cfl_print_typed_program(cfl_typed_program* program);
#endif
|
// Copyright (c) 2018-2021 The Dash Core developers
// Copyright (c) 2021 The PIVX Core developers
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef PIVX_PROVIDERTX_H
#define PIVX_PROVIDERTX_H
#include "bls/bls_wrapper.h"
#include "primitives/transaction.h"
#include "netaddress.h"
#include <univalue.h>
// Provider-Register tx payload
class ProRegPL
{
public:
static const uint16_t CURRENT_VERSION = 1;
public:
uint16_t nVersion{CURRENT_VERSION}; // message version
uint16_t nType{0}; // only 0 supported for now
uint16_t nMode{0}; // only 0 supported for now
COutPoint collateralOutpoint{UINT256_ZERO, (uint32_t)-1}; // if hash is null, we refer to a ProRegTx output
CService addr;
CKeyID keyIDOwner;
CBLSPublicKey pubKeyOperator;
CKeyID keyIDVoting;
CScript scriptPayout;
uint16_t nOperatorReward{0};
CScript scriptOperatorPayout;
uint256 inputsHash; // replay protection
std::vector<unsigned char> vchSig;
public:
SERIALIZE_METHODS(ProRegPL, obj)
{
READWRITE(obj.nVersion);
READWRITE(obj.nType);
READWRITE(obj.nMode);
READWRITE(obj.collateralOutpoint);
READWRITE(obj.addr);
READWRITE(obj.keyIDOwner);
READWRITE(obj.pubKeyOperator);
READWRITE(obj.keyIDVoting);
READWRITE(obj.scriptPayout);
READWRITE(obj.nOperatorReward);
READWRITE(obj.scriptOperatorPayout);
READWRITE(obj.inputsHash);
if (!(s.GetType() & SER_GETHASH)) {
READWRITE(obj.vchSig);
}
}
// When signing with the collateral key, we don't sign the hash but a generated message instead
// This is needed for HW wallet support which can only sign text messages as of now
std::string MakeSignString() const;
std::string ToString() const;
void ToJson(UniValue& obj) const;
};
// Provider-Update-Service tx payload
class ProUpServPL
{
public:
static const uint16_t CURRENT_VERSION = 1;
public:
uint16_t nVersion{CURRENT_VERSION}; // message version
uint256 proTxHash{UINT256_ZERO};
CService addr;
CScript scriptOperatorPayout;
uint256 inputsHash; // replay protection
CBLSSignature sig;
public:
SERIALIZE_METHODS(ProUpServPL, obj)
{
READWRITE(obj.nVersion, obj.proTxHash, obj.addr, obj.scriptOperatorPayout, obj.inputsHash);
if (!(s.GetType() & SER_GETHASH)) {
READWRITE(obj.sig);
}
}
public:
std::string ToString() const;
void ToJson(UniValue& obj) const;
};
// Provider-Update-Registrar tx payload
class ProUpRegPL
{
public:
static const uint16_t CURRENT_VERSION = 1;
public:
uint16_t nVersion{CURRENT_VERSION}; // message version
uint256 proTxHash;
uint16_t nMode{0}; // only 0 supported for now
CBLSPublicKey pubKeyOperator;
CKeyID keyIDVoting;
CScript scriptPayout;
uint256 inputsHash; // replay protection
std::vector<unsigned char> vchSig;
public:
SERIALIZE_METHODS(ProUpRegPL, obj)
{
READWRITE(obj.nVersion, obj.proTxHash, obj.nMode, obj.pubKeyOperator, obj.keyIDVoting, obj.scriptPayout, obj.inputsHash);
if (!(s.GetType() & SER_GETHASH)) {
READWRITE(obj.vchSig);
}
}
public:
std::string ToString() const;
void ToJson(UniValue& obj) const;
};
// Provider-Update-Revoke tx payload
class ProUpRevPL
{
public:
static const uint16_t CURRENT_VERSION = 1;
// these are just informational and do not have any effect on the revocation
enum RevocationReason {
REASON_NOT_SPECIFIED = 0,
REASON_TERMINATION_OF_SERVICE = 1,
REASON_COMPROMISED_KEYS = 2,
REASON_CHANGE_OF_KEYS = 3,
REASON_LAST = REASON_CHANGE_OF_KEYS
};
public:
uint16_t nVersion{CURRENT_VERSION}; // message version
uint256 proTxHash;
uint16_t nReason{REASON_NOT_SPECIFIED};
uint256 inputsHash; // replay protection
CBLSSignature sig;
public:
SERIALIZE_METHODS(ProUpRevPL, obj)
{
READWRITE(obj.nVersion, obj.proTxHash, obj.nReason, obj.inputsHash);
if (!(s.GetType() & SER_GETHASH)) {
READWRITE(obj.sig);
}
}
public:
std::string ToString() const;
void ToJson(UniValue& obj) const;
};
// If tx is a ProRegTx, return the collateral outpoint in outRet.
bool GetProRegCollateral(const CTransactionRef& tx, COutPoint& outRet);
#endif //PIVX_PROVIDERTX_H
|
/* --------------------------------------------------------------------------
*
* File GameOver.h
* Created By Project B team
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2013 XMsoft. All rights reserved.
*
* --------------------------------------------------------------------------
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#ifndef __GameOver_h__
#define __GameOver_h__
class GameOver : public CCLayer, public CCIMEDelegate
{
public :
CREATE_FUNC ( GameOver );
protected :
virtual KDbool init ( KDvoid );
virtual KDbool ccTouchBegan ( CCTouch* pTouch, CCEvent* pEvent );
KDvoid onSaveClick ( CCObject* pSender ); // ÀúÀå¹öư Ŭ¸¯
KDvoid onHttpRequestCompleted ( CCNode* pSender, KDvoid* pData ); // ¼¹öÀü¼Û ¿Ï·á
KDvoid insertData ( KDfloat fDelta ); // ½ÇÁ¦ ¼¹öÀÔ·Â
public :
KDvoid setGameScore ( KDint nScore ); // Á¡¼ö ¼³Á¤
private :
CCTextFieldTTF* m_pTextField; // ´Ð³×ÀÓ ÀÔ·Â
CCLabelTTF* m_pScoreField; // Á¡¼ö
CCProgressTimer* m_pLoading; // ·ÎµùÀ̹ÌÁö
};
#endif //__GameOver_h__
|
#ifndef STRATEGY_H_
#define STRATEGY_H_
struct strategy_ops;
struct strategy {
struct strategy_ops *ops;
};
struct strategy_ops {
void (*justify) (struct strategy *, char *line); /* virtual */
};
void strategy_init(struct strategy *);
static inline
void strategy_justify(struct strategy *strat, char *line)
{
strat->ops->justify(strat, line);
}
#endif /* STRATEGY_H_ */
|
#ifndef __MAUS_H
#define __MAUS_H
#include "config.h"
#include <glib.h>
typedef struct {
gchar *shutdown_command;
gint shutdown_delay;
gint pin_in;
gint pin_out;
} MausPrivate;
#define DIRECTION_IN "in"
#define DIRECTION_OUT "out"
#define WHEN_TO_RETURN "both"
typedef enum { VALUE_LOW = 0, VALUE_HIGH = 1 } MausGpioValue;
gboolean maus_setup_gpio(MausPrivate *priv);
int maus_gpio_direction_in(gint pin);
int maus_gpio_direction_out(gint pin);
int maus_gpio_export(gint pin);
int maus_gpio_interrupt(gint pin);
int maus_gpio_unexport(gint pin);
int maus_gpio_wait(gint pin);
int maus_gpio_write(gint pin, gint value);
void maus_load_config(MausPrivate *priv);
void maus_print_config(MausPrivate *priv);
#endif
|
//
// XFSubControl2Presenter.h
// XFLegoVIPERExample
//
// Created by Yizzuide on 2016/10/4.
// Copyright © 2016年 Yizzuide. All rights reserved.
//
#import "XFPresenter.h"
#import "XFSubControl2EventHandlerPort.h"
@interface XFSubControl2Presenter : XFPresenter <XFSubControl2EventHandlerPort>
@property (nonatomic, strong) RACCommand *collectCommand;
@property (nonatomic, strong) RACCommand *worksCommand;
@end
|
/*
* Test interface for the character encoding toolkit.
*
* Copyright (C) 1999-2020 J.M. Heisz. All Rights Reserved.
* See the LICENSE file accompanying the distribution your rights to use
* this software.
*/
#include "encoding.h"
#include "log.h"
/**
* Main testing entry point. Just a bunch of test instances.
*/
int main(int argc, char **argv) {
WXBuffer buffer;
/* At some point, put the MTraq testcase identifiers in here */
WXBuffer_Init(&buffer, 0);
/* JSON */
buffer.length = 0;
if ((WXJSON_EscapeString(&buffer, "abc", 3) == NULL) ||
(buffer.length != 3) ||
(strncmp((char *) buffer.buffer, "abc", 3) != 0)) {
(void) fprintf(stderr, "Incorrect JSON encoding of standard text\n");
exit(1);
}
buffer.length = 0;
if ((WXJSON_EscapeString(&buffer, "\"\\/\b\f\n\r\t", -1) == NULL) ||
(buffer.length != 16) ||
(strncmp((char *) buffer.buffer,
"\\\"\\\\\\/\\b\\f\\n\\r\\t", 16) != 0)) {
(void) fprintf(stderr, "Incorrect JSON encoding of control text\n");
exit(1);
}
buffer.length = 0;
if ((WXJSON_EscapeString(&buffer,
"\x07\xD1\xB2\xE4\xB8\x9D", -1) == NULL) ||
(buffer.length != 18) ||
(strncmp((char *) buffer.buffer,
"\\u0007\\u0472\\u4E1D", 18) != 0)) {
(void) fprintf(stderr, "Incorrect JSON encoding of unicode text\n");
exit(1);
}
/* XML */
buffer.length = 0;
if ((WXML_EscapeAttribute(&buffer, "a<b&c>d'e\"f", -1, FALSE) == NULL) ||
(buffer.length != 31) ||
(strncmp((char *) buffer.buffer,
"a<b&c>d'e"f", 31) != 0)) {
(void) fprintf(stderr, "Incorrect XML encoding of attribute text\n");
exit(1);
}
buffer.length = 0;
if ((WXML_EscapeContent(&buffer, "a<b&c>d'e\"f", -1, FALSE) == NULL) ||
(buffer.length != 21) ||
(strncmp((char *) buffer.buffer,
"a<b&c>d'e\"f", 21) != 0)) {
(void) fprintf(stderr, "Incorrect XML encoding of content\n");
exit(1);
}
/* URL */
buffer.length = 0;
if ((WXURL_EscapeURI(&buffer, "?a-z%A_Z!0.9 ", -1) == NULL) ||
(buffer.length != 21) ||
(strncmp((char *) buffer.buffer,
"%3Fa-z%25A_Z%210.9%20", 21) != 0)) {
(void) fprintf(stderr, "Incorrect URI encoding of special chars\n");
exit(1);
}
}
|
//
// UITextField+HLHExtend.h
// HLHKitDemo
//
// Created by lihuiHan on 16/9/28.
// Copyright © 2016年 Lottery. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITextField (HLHExtend)
/**
Set all text selected.
*/
- (void)selectAllText;
/**
Set text in range selected.
@param range The range of selected text in a document.
*/
- (void)setSelectedRange:(NSRange)range;
@end
|
void init_terminal(void)
{
const char str[] = "CynOS - 1.0";
unsigned int str_index = 0;
char *VIDEO_MEM = (char*)0x000b8000; //VGA Memory begins here
//VGA memory is stored in words.
// So we have to skip by 2 to access the char at c+0 and the attrib at c+1
for(int row = 0; row < 25; row++) {
for(int column = 0; column < 80; column++) { //We have to start at 1 so we have no 0 case.
if(str_index < sizeof(str)) {
*VIDEO_MEM = str[str_index];
str_index++;
} else {
*VIDEO_MEM = ' ';
}
*(VIDEO_MEM+1) = 0x03;
VIDEO_MEM+=2;
}
}
return;
}
|
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: (null)
*/
#import "AWSMobileAnalyticsSessionClientState.h"
#import <XXUnknownSuperclass.h> // Unknown library
@class NSString;
@interface AWSMobileAnalyticsInactiveSessionState : XXUnknownSuperclass <AWSMobileAnalyticsSessionClientState> {
}
@property(readonly, copy) NSString* debugDescription;
@property(readonly, copy) NSString* description;
@property(readonly, assign) unsigned hash;
@property(readonly, assign) Class superclass;
- (void)enterStateWithSessionClient:(id)sessionClient;
- (void)exitStateWithSessionClient:(id)sessionClient;
- (void)pauseWithSessionClient:(id)sessionClient;
- (void)resumeWithSessionClient:(id)sessionClient;
- (void)startWithSessionClient:(id)sessionClient;
- (void)stopWithSessionClient:(id)sessionClient;
@end
|
// Copyright (c) 2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_UTIL_TRACE_H
#define SYSCOIN_UTIL_TRACE_H
#ifdef ENABLE_TRACING
#include <sys/sdt.h>
#define TRACE(context, event) DTRACE_PROBE(context, event)
#define TRACE1(context, event, a) DTRACE_PROBE1(context, event, a)
#define TRACE2(context, event, a, b) DTRACE_PROBE2(context, event, a, b)
#define TRACE3(context, event, a, b, c) DTRACE_PROBE3(context, event, a, b, c)
#define TRACE4(context, event, a, b, c, d) DTRACE_PROBE4(context, event, a, b, c, d)
#define TRACE5(context, event, a, b, c, d, e) DTRACE_PROBE5(context, event, a, b, c, d, e)
#define TRACE6(context, event, a, b, c, d, e, f) DTRACE_PROBE6(context, event, a, b, c, d, e, f)
#define TRACE7(context, event, a, b, c, d, e, f, g) DTRACE_PROBE7(context, event, a, b, c, d, e, f, g)
#define TRACE8(context, event, a, b, c, d, e, f, g, h) DTRACE_PROBE8(context, event, a, b, c, d, e, f, g, h)
#define TRACE9(context, event, a, b, c, d, e, f, g, h, i) DTRACE_PROBE9(context, event, a, b, c, d, e, f, g, h, i)
#define TRACE10(context, event, a, b, c, d, e, f, g, h, i, j) DTRACE_PROBE10(context, event, a, b, c, d, e, f, g, h, i, j)
#define TRACE11(context, event, a, b, c, d, e, f, g, h, i, j, k) DTRACE_PROBE11(context, event, a, b, c, d, e, f, g, h, i, j, k)
#define TRACE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l) DTRACE_PROBE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l)
#else
#define TRACE(context, event)
#define TRACE1(context, event, a)
#define TRACE2(context, event, a, b)
#define TRACE3(context, event, a, b, c)
#define TRACE4(context, event, a, b, c, d)
#define TRACE5(context, event, a, b, c, d, e)
#define TRACE6(context, event, a, b, c, d, e, f)
#define TRACE7(context, event, a, b, c, d, e, f, g)
#define TRACE8(context, event, a, b, c, d, e, f, g, h)
#define TRACE9(context, event, a, b, c, d, e, f, g, h, i)
#define TRACE10(context, event, a, b, c, d, e, f, g, h, i, j)
#define TRACE11(context, event, a, b, c, d, e, f, g, h, i, j, k)
#define TRACE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l)
#endif
#endif // SYSCOIN_UTIL_TRACE_H
|
//
// RunPython.h
// Calendarize
//
// Created by Percich Michele (UniCredit Business Integrated Solutions) on 27/01/17.
// Copyright © 2017 Michele Percich. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RunPython : NSObject
+ (NSString*)runPythonCode:(NSString*)code withPythonPath:(NSString*)path;
@end
|
#pragma once
#include <string>
#include "wangSet.h"
#include "sample.h"
#include "pixelArray.h"
struct parameters {
int nT = 0; // Define length of tile width
int nO = 0; // Defines width of sample overlap
int nS = 0; // Define length of sample width
double tileScale = 2.0 / sqrt(2.0);
};
void load_JSON_setting(std::string inFile, wangSet & tileSet, parameters & inParameters, std::vector<sample> & inSamples);
void save_JSON_results(std::string & outFile, std::string & date, double duration, double quiltError);
pixelArray convert_lightnessMap_to_pixelArray(std::vector<double> & lightnessMap, int nTx, int nTy);
|
#ifndef README_H
#define README_H
/*
* Architecture of module:
*
* -> IOHandler
* /
* /
* /
* (www) -> TcpServer ----> IOHandler
* \
* \
* \
* -> IOHandler
*
*
* TcpServer and IOHandlers lives in separate threads.
* TcpServer shares one epoll_fd between all IOHandlers.
* Each IOHandler accept a new incoming connection and add it to his array of events
* to watch over it. Thereby all incomming data from one peer will be processed
* in the same IOHadler.
* Business logic is processed in IOHandlers::onEvent() method.
*
*
*
*/
#endif // README_H
|
// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、または
// 参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル
// を記述します。
//
#pragma once
#include "targetver.h"
#define STRICT
#define WIN32_LEAN_AND_MEAN // Windows ヘッダーから使用されていない部分を除外します。
// Windows ヘッダー ファイル:
#include <windows.h>
|
#pragma once
#include <stdbool.h>
typedef const char* (*pPluginOpSupported)();
typedef bool (*pPluginPerformOp)(char op, int a, int b, int *res);
const char* PluginOpSupported();
bool PluginPerformOp(char op, int a, int b, int *res);
|
/* ch09-pipedemo.c --- demonstrate I/O with a pipe. */
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
/* main --- create a pipe, write to it, and read from it. */
int main(int argc, char **argv)
{
static const char mesg[] = "Don't Panic!"; /* a famous message */
char buf[BUFSIZ];
ssize_t rcount, wcount;
int pipefd[2];
size_t l;
if (pipe(pipefd) < 0) {
fprintf(stderr, "%s: pipe failed: %s\n", argv[0],
strerror(errno));
exit(1);
}
printf("Read end = fd %d, write end = fd %d\n",
pipefd[0], pipefd[1]);
l = strlen(mesg);
if ((wcount = write(pipefd[1], mesg, l)) != l) {
fprintf(stderr, "%s: write failed: %s\n", argv[0],
strerror(errno));
exit(1);
}
if ((rcount = read(pipefd[0], buf, BUFSIZ)) != wcount) {
fprintf(stderr, "%s: read failed: %s\n", argv[0],
strerror(errno));
exit(1);
}
buf[rcount] = '\0';
printf("Read <%s> from pipe\n", buf);
(void) close(pipefd[0]);
(void) close(pipefd[1]);
return 0;
}
|
// The MIT License (MIT)
//
// Copyright(c) 2015 huan.wang
//
// 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 "net/socket/Socket.h"
#include "net/socket/StreamSocket.h"
namespace net {
class ServerSocket :
public Socket
{
public:
ServerSocket();
ServerSocket(const Socket& socket);
ServerSocket(const SocketAddress& address, int backlog = 64);
ServerSocket(uint16_t port, int backlog = 64);
virtual ~ServerSocket();
ServerSocket& operator = (const Socket& socket);
virtual bool Bind(const SocketAddress& address, bool bReuse = false);
virtual bool Bind(uint16_t port, bool bReuse = false);
virtual bool Listen(int backlog = 64);
virtual std::shared_ptr<StreamSocket> Accept();
};
} //!net
|
//
// ViewController.h
// ZLSwitchCityController
//
// Created by zhaoliang on 15/12/16.
// Copyright © 2015年 zhao. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
/**************************************************************************/
/*!
@file uart.c
@author K. Townsend
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, K. Townsend (microBuilder.eu)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************/
#include <string.h>
#include "uart.h"
void uart0_init(uint32_t baudRate) {
uint32_t clk;
const uint32_t UARTCLKDIV=1;
/* Setup the clock and reset UART0 */
LPC_SYSCON->UARTCLKDIV = UARTCLKDIV;
NVIC_DisableIRQ(UART0_IRQn);
LPC_SYSCON->SYSAHBCLKCTRL |= UART0_CLK_ENABLE;
LPC_SYSCON->PRESETCTRL &= ~UART0_RST_N;
LPC_SYSCON->PRESETCTRL |= UART0_RST_N;
/* Configure UART0 */
clk = __MAIN_CLOCK/UARTCLKDIV;
LPC_USART0->CFG = UART_DATA_LENGTH_8 | UART_PARITY_NONE | UART_STOP_BIT_1;
LPC_USART0->BRG = clk / 16 / baudRate - 1;
LPC_SYSCON->UARTFRGDIV = 0xFF;
LPC_SYSCON->UARTFRGMULT = (((clk / 16) * (LPC_SYSCON->UARTFRGDIV + 1)) /
(baudRate * (LPC_USART0->BRG + 1))) - (LPC_SYSCON->UARTFRGDIV + 1);
/* Clear the status bits */
LPC_USART0->STAT = UART_STATUS_CTSDEL | UART_STATUS_RXBRKDEL;
/* Enable UART0 interrupt */
NVIC_EnableIRQ(UART0_IRQn);
/* Enable UART0 */
LPC_USART0->CFG |= UART_ENABLE;
}
void uart1_init(uint32_t baudRate) {
uint32_t clk;
const uint32_t UARTCLKDIV=1;
/* Setup the clock and reset UART1 */
LPC_SYSCON->UARTCLKDIV = UARTCLKDIV;
NVIC_DisableIRQ(UART1_IRQn);
LPC_SYSCON->SYSAHBCLKCTRL |= UART1_CLK_ENABLE;
LPC_SYSCON->PRESETCTRL &= ~UART1_RST_N;
LPC_SYSCON->PRESETCTRL |= UART1_RST_N;
/* Configure UART1 */
clk = __MAIN_CLOCK/UARTCLKDIV;
LPC_USART1->CFG = UART_DATA_LENGTH_8 | UART_PARITY_NONE | UART_STOP_BIT_1;
LPC_USART1->BRG = clk / 16 / baudRate - 1;
LPC_SYSCON->UARTFRGDIV = 0xFF;
LPC_SYSCON->UARTFRGMULT = (((clk / 16) * (LPC_SYSCON->UARTFRGDIV + 1)) /
(baudRate * (LPC_USART0->BRG + 1))) - (LPC_SYSCON->UARTFRGDIV + 1);
/* Clear the status bits */
LPC_USART1->STAT = UART_STATUS_CTSDEL | UART_STATUS_RXBRKDEL;
/* Enable UART1 interrupt */
NVIC_EnableIRQ(UART1_IRQn);
/* Enable UART1 */
LPC_USART1->CFG |= UART_ENABLE;
}
void uart2_init(uint32_t baudRate) {
uint32_t clk;
const uint32_t UARTCLKDIV=1;
/* Setup the clock and reset UART2 */
LPC_SYSCON->UARTCLKDIV = UARTCLKDIV;
NVIC_DisableIRQ(UART2_IRQn);
LPC_SYSCON->SYSAHBCLKCTRL |= UART2_CLK_ENABLE;
LPC_SYSCON->PRESETCTRL &= ~UART2_RST_N;
LPC_SYSCON->PRESETCTRL |= UART2_RST_N;
/* Configure UART2 */
clk = __MAIN_CLOCK/UARTCLKDIV;
LPC_USART2->CFG = UART_DATA_LENGTH_8 | UART_PARITY_NONE | UART_STOP_BIT_1;
LPC_USART2->BRG = clk / 16 / baudRate - 1;
LPC_SYSCON->UARTFRGDIV = 0xFF;
LPC_SYSCON->UARTFRGMULT = (((clk / 16) * (LPC_SYSCON->UARTFRGDIV + 1)) /
(baudRate * (LPC_USART0->BRG + 1))) - (LPC_SYSCON->UARTFRGDIV + 1);
/* Clear the status bits */
LPC_USART2->STAT = UART_STATUS_CTSDEL | UART_STATUS_RXBRKDEL;
/* Enable UART1 interrupt */
NVIC_EnableIRQ(UART2_IRQn);
/* Enable UART2 */
LPC_USART2->CFG |= UART_ENABLE;
}
void uart0_snd_chr(char buffer) {
/* Wait until we're ready to send */
while (!(LPC_USART0->STAT & UART_STATUS_TXRDY));
LPC_USART0->TXDATA = buffer;
}
void uart0_snd(char *buffer, uint32_t length) {
while (length != 0) {
uart0_snd_chr(*buffer);
buffer++;
length--;
}
}
void uart1_snd_chr(char buffer) {
/* Wait until we're ready to send */
while (!(LPC_USART1->STAT & UART_STATUS_TXRDY));
LPC_USART1->TXDATA = buffer;
}
void uart1_snd(char *buffer, uint32_t length) {
while (length != 0) {
uart1_snd_chr(*buffer);
buffer++;
length--;
}
}
void uart2_snd_chr(char buffer) {
/* Wait until we're ready to send */
while (!(LPC_USART2->STAT & UART_STATUS_TXRDY));
LPC_USART2->TXDATA = buffer;
}
void uart2_snd(char *buffer, uint32_t length) {
while (length != 0) {
uart2_snd_chr(*buffer);
buffer++;
length--;
}
}
|
#import "MOBProjection.h"
@interface MOBProjectionEPSG4588 : MOBProjection
@end
|
/* spmchk: see if there is a portmaster running on the specified machine
* by attempting to open a Socket on it. If the attempt fails, return 1,
* otherwise 0.
*
* XTDIO_USAGE: spmchk [machine]
*
* This can be used in a script like so:
*
* spmchk || Spm
*
* -or-
*
* spmchk || (nohup Spm > /dev/null)&
*
* to avoid having Spm print out an error message if it is already
* running.
*
* Author: Marty Olevitch, Dec 1993
* (This routine is placed into the public domain.)
*/
#include <stdio.h>
#include <string.h>
#include "sockets.h"
/* ---------------------------------------------------------------------
* Definitions:
*/
#define BUFSIZE 256
/* ---------------------------------------------------------------------
* Prototypes:
*/
#ifdef __PROTOTYPE__
int main(int, char **);
#else
extern main();
#endif
/* ---------------------------------------------------------------------
* Source Code:
*/
#ifdef __PROTOTYPE__
int main(
int argc,
char **argv)
#else
int main(argc, argv)
int argc;
char **argv;
#endif
{
char hostnm[BUFSIZE];
Socket *s;
Sinit();
if(argc > 1) strcpy(hostnm, argv[1]);
else gethostname(hostnm,BUFSIZE);
s = Sopen_clientport(hostnm, "PMClient", PORTMASTER);
if (!s) {
exit(2);
}
Sclose(s);
#ifdef vms
exit(1);
#else
exit(0);
#endif
}
/* --------------------------------------------------------------------- */
|
#ifndef QUESTEXPUSERINFO_H
#define QUESTEXPUSERINFO_H
#include "QuestExpDefine.h"
#pragma once
class UserQuestAskInfo {
public:
UserQuestAskInfo() {
Init();
}
~UserQuestAskInfo() {
}
void Init() {
this->m_iQuestType = 0;
this->m_bComplete = false;
this->m_iValue = 0;
this->m_iIndexID = 0;
}
void Clear() {
this->m_iQuestType = 0;
this->m_bComplete = false;
this->m_iValue = 0;
this->m_iIndexID = 0;
}
int GetQuestType() { return this->m_iQuestType; }
void SetQuestType(int iQuestType) { this->m_iQuestType = iQuestType; }
bool IsComplete() { return this->m_bComplete; }
void SetComplete(bool bComplete) { this->m_bComplete = bComplete; }
int GetValue() { return this->m_iValue; }
void SetValue(int iValue) { this->m_iValue = iValue; }
int GetIndexID() { return this->m_iIndexID; }
void SetIndexID(int iIndexID) { this->m_iIndexID = iIndexID; }
protected:
int m_iQuestType;
bool m_bComplete;
int m_iValue;
int m_iIndexID;
};
class UserQuestReward {
public:
UserQuestReward() {
this->m_iQuestRewardType = 0;
this->m_iValue = 0;
this->m_iIndexID = 0;
}
~UserQuestReward() {
}
int GetQuestRewardType() { return this->m_iQuestRewardType; }
void SetQuestRewardType(int iQuestRewardType) { this->m_iQuestRewardType = iQuestRewardType; }
int GetValue() { return this->m_iValue; }
void SetValue(int iValue) { this->m_iValue = iValue; }
int GetIndexID() { return this->m_iIndexID; }
void SetIndexID(int iIndexID) { this->m_iIndexID = iIndexID; }
protected:
int m_iQuestRewardType;
int m_iValue;
int m_iIndexID;
};
class UserQuestInfo {
public:
UserQuestInfo() {
this->Init();
}
~UserQuestInfo() {
}
void Init();
void Clear();
void QuestAskInfoClear();
bool SetEpisode(int iEp);
int GetEpisode();
bool SetQuestSwitch(int iQS);
int GetQuestSwitch();
void SetAskCnt(int iAskCnt);
int GetAskCnt();
void SetStartDate(time_t iStartDate);
time_t GetStartDate();
void SetEndDate(time_t iEndDate);
time_t GetEndDate();
void SetQuestProgState(WORD wProgState);
WORD GetQuestProgState();
UserQuestAskInfo m_UserQuestAskInfo[MAX_QUESTEXP_ASK_INFO];
private:
int m_iEp;
int m_iQS;
int m_iAskCnt;
WORD m_wProgState;
time_t m_lStartDate;
time_t m_lEndDate;
};
#endif
|
#ifndef CQChartsViewPlotObj_h
#define CQChartsViewPlotObj_h
#include <CQChartsObj.h>
#include <CQChartsRect.h>
#include <CQChartsPosition.h>
#include <CQChartsLength.h>
#include <CQChartsLineDash.h>
#include <CQChartsFillPattern.h>
#include <CQChartsTextOptions.h>
class CQChartsView;
class CQChartsPlot;
class CQChartsEditHandles;
class CQChartsPaintDevice;
class CQChartsObjRef;
struct CQChartsPenBrush;
class CQChartsPenData;
class CQChartsBrushData;
/*!
* \brief Object which could be on a view or a plot
* \ingroup Charts
*/
class CQChartsViewPlotObj : public CQChartsObj,
public CQChartsSelectableIFace, public CQChartsEditableIFace {
Q_OBJECT
public:
using View = CQChartsView;
using Plot = CQChartsPlot;
using DrawType = CQChartsObjDrawType;
using EditHandles = CQChartsEditHandles;
using Position = CQChartsPosition;
using Length = CQChartsLength;
using Rect = CQChartsRect;
using PenBrush = CQChartsPenBrush;
using PenData = CQChartsPenData;
using BrushData = CQChartsBrushData;
using Alpha = CQChartsAlpha;
using FillPattern = CQChartsFillPattern;
using LineDash = CQChartsLineDash;
using Font = CQChartsFont;
using PaintDevice = CQChartsPaintDevice;
using TextOptions = CQChartsTextOptions;
using ResizeSide = CQChartsResizeSide;
using ObjRef = CQChartsObjRef;
using Polygon = CQChartsGeom::Polygon;
using RMinMax = CQChartsGeom::RMinMax;
using BBox = CQChartsGeom::BBox;
using Point = CQChartsGeom::Point;
public:
CQChartsViewPlotObj(View *view);
CQChartsViewPlotObj(Plot *plot);
virtual ~CQChartsViewPlotObj();
//---
CQCharts *charts() const;
View *view() const;
Plot *plot() const { return plot_; }
//---
//! get edit handles
EditHandles *editHandles() const override;
void drawEditHandles(PaintDevice *device) const override;
virtual void setEditHandlesBBox() const;
//---
// set pen/brush
void setPenBrush(PenBrush &penBrush, const PenData &penData, const BrushData &brushData) const;
void setPen(PenBrush &penBrush, const PenData &penData) const;
void updatePenBrushState(PenBrush &penBrush, DrawType drawType=DrawType::BOX) const;
//---
// text utilities
QFont calcFont(const Font &font) const;
void setPainterFont(PaintDevice *painter, const Font &font) const;
void adjustTextOptions(TextOptions &textOptions) const;
//---
// conversion utilities
Point positionToParent(const ObjRef &objRef, const Position &pos) const;
Point positionToPixel (const ObjRef &objRef, const Position &pos) const;
Position positionFromParent(const ObjRef &objRef, const Position &pos) const;
Point positionToParent(const Position &pos) const;
Point positionToPixel (const Position &pos) const;
Point intersectObjRef(const ObjRef &objRef, const Point &p1, const Point &p2) const;
bool objectRect(const ObjRef &objRef, CQChartsObj* &obj, BBox &bbox) const;
//---
double lengthParentWidth (const Length &len) const;
double lengthParentHeight(const Length &len) const;
double lengthParentSignedWidth (const Length &len) const;
double lengthParentSignedHeight(const Length &len) const;
double lengthWindowWidth(const Length &len) const;
double lengthPixelWidth (const Length &len) const;
double lengthPixelHeight(const Length &len) const;
Point windowToPixel(const Point &w) const;
BBox windowToPixel(const BBox &w) const;
Point pixelToWindow(const Point &w) const;
BBox pixelToWindow(const BBox &w) const;
double pixelToWindowWidth (double pw) const;
double pixelToWindowHeight(double ph) const;
double windowToPixelWidth(double w) const;
//---
QColor backgroundColor() const;
//---
static Length makeLength(View *view, Plot *plot, double len);
static Position makePosition(View *view, Plot *plot, double x, double y);
static Rect makeRect(View *view, Plot *plot, double x1, double y1, double x2, double y2);
static Rect makeRect(View *view, Plot *plot, const Position &start, const Position &end);
protected:
using EditHandlesP = std::unique_ptr<EditHandles>;
View* view_ { nullptr }; //!< parent view
Plot* plot_ { nullptr }; //!< parent plot
EditHandlesP editHandles_; //!< edit handles
};
#endif
|
//
// IVVMoneyStorage.h
// AwesomeCurrencyConverter
//
// Created by Vladimir Ignatov on 06/03/2017.
// Copyright © 2017 Ignatov inc. All rights reserved.
//
#import "IVVCurrencyConstants.h"
@protocol IVVMoneyStorage <NSObject>
- (BOOL)addMoney:(NSDecimalNumber *)amount
forCurrency:(IVVCurrencyType)currency;
- (BOOL)subtractMoney:(NSDecimalNumber *)amount
forCurrency:(IVVCurrencyType)currency;
- (NSDecimalNumber *)getMoneyAmountForCurrency:(IVVCurrencyType)currency;
// inital initialization
- (void)setMoneyAmount:(NSDecimalNumber *)amount
forCurrency:(IVVCurrencyType)currency;
@end
|
//
// QYTableViewController.h
// 03-UITableViewControllerDemo
//
// Created by qingyun on 15/12/1.
// Copyright (c) 2015年 河南青云信息技术有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface QYTableViewController : UITableViewController
@end
|
#ifndef _CC4784251B4CDC4192BF4863D8B38C61_GUARD_
#define _CC4784251B4CDC4192BF4863D8B38C61_GUARD_
#include "JsonCommon.h"
namespace Json
{
struct Value;
struct StringNode;
struct ListNode : NonCopyable
{
ListNode(const Value &value);
ListNode(StringNode *key);
ListNode(StringNode *key, const Value &value);
~ListNode();
static ListNode *clone(const ListNode *list, size_t *countPtr = NULL);
static void destroy(ListNode *list);
StringNode *m_key;
Value *m_value;
ListNode *m_next;
};
}
#endif
|
#ifndef VIDEOGAME_H
#define VIDEOGAME_H
#include "EntertainmentItem.h"
/**
* @class Videogame
*/
class Videogame : public EntertainmentItem {
private:
///
unsigned long long esrbRating;
///
unsigned long long platform;
public:
/**
* @enum ESRBRating
*/
enum ESRBRating {
RATING_INVALID = 0,
RATING_EVERYONE = 1,
RATING_EVERYONE_10 = 3,
RATING_TEEN = 4,
RATING_MATURE = 5
};
/**
* @enum GamePlatform
*/
enum GamePlatform {
GAME_PLATFORM_INVALID = 0,
GAME_PLATFORM_3DS = 1,
GAME_PLATFORM_DS = 2
};
///
Videogame();
///
Videogame(const string & title, const string & genre,
const string & publisher, unsigned year,
unsigned long long esrbRating,
unsigned long long platform);
///
virtual ~Videogame();
///
unsigned long long getEsrbRating() const;
///
unsigned long long getPlatform() const;
///
void setEsrbRating(unsigned long long esrbRating);
///
void setPlatform(unsigned long long platform);
///
static string getRatingString(unsigned long long esrbRating);
///
static string getPlatformString(unsigned long long platform);
};
#endif /// Not VIDEOGAME_H
|
//
// WSPPhotoImageView.h
// WSPNews
//
// Created by auto on 16/3/4.
// Copyright © 2016年 auto. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol WSPTapDetectingImageViewDelegate;
@interface WSPPhotoImageView : UIImageView
@property (nonatomic, weak) id <WSPTapDetectingImageViewDelegate> tapDelegate;
@end
@protocol WSPTapDetectingImageViewDelegate <NSObject>
@optional
/** 单点击 */
- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch;
/** 双点击 */
- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch;
- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch;
@end
|
#ifndef STDAFX_H
#define STDAFX_H
#include "../SDK/Platform.h"
#include <time.h>
#pragma comment(lib, "Math_Win32_Debug")
#endif // STDAFX_H
|
/****************************************************************************************
Copyright (C) 2012 Autodesk, Inc.
All rights reserved.
Use of this software is subject to the terms of the Autodesk license agreement
provided at the time of installation or download, or which otherwise accompanies
this software in either electronic or hard copy form.
****************************************************************************************/
//! \file fbxscopedloadingdirectory.h
#ifndef _FBXSDK_CORE_SCOPED_LOADING_DIRECTORY_H_
#define _FBXSDK_CORE_SCOPED_LOADING_DIRECTORY_H_
#include <fbxsdk/fbxsdk_def.h>
#include <fbxsdk/core/fbxloadingstrategy.h>
#include <fbxsdk/core/fbxmodule.h>
#include <fbxsdk/fbxsdk_nsbegin.h>
class FbxPluginHandle;
/**
* A plug-in loading strategy that loads all DLLs with a specific extension from a specific directory.
* When this class is destroyed all of the plug-ins are unloaded.
*/
class FBXSDK_DLL FbxScopedLoadingDirectory : public FbxLoadingStrategy
{
public:
/**
*\name Public interface
*/
//@{
/** Constructor. Load plug-ins.
* \param pDirectoryPath The directory path.
* \param pPluginExtension The plug-in extension.
*/
FbxScopedLoadingDirectory(const char* pDirectoryPath, const char* pPluginExtension);
/** Destructor. Unload plug-ins.
*/
virtual ~FbxScopedLoadingDirectory();
//@}
/*****************************************************************************************************************************
** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
*****************************************************************************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
virtual bool SpecificLoad(FbxPluginData& pData);
virtual void SpecificUnload();
FbxString mDirectoryPath;
FbxString mExtension;
typedef FbxIntrusiveList<FbxPluginHandle> FbxPluginHandleList;
FbxPluginHandleList mPluginHandles;
#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
};
/*****************************************************************************************************************************
** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
*****************************************************************************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class FbxPluginHandle
{
FBXSDK_INTRUSIVE_LIST_NODE(FbxPluginHandle, 1);
public:
FbxPluginHandle(FbxModule pInstance=NULL) : mInstance(pInstance){}
FbxModule mInstance;
};
#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
#include <fbxsdk/fbxsdk_nsend.h>
#endif /* _FBXSDK_CORE_SCOPED_LOADING_DIRECTORY_H_ */
|
#include <stdio.h>
#include <stdlib.h>
#include "mh.h"
void display_progress(int completed, int total, int cmp_mod)
{
/* clear line */
/*printf("\33[2K\r");*/
if(completed % cmp_mod == 0)
{
double pct_complete = 100* ((double)completed / (double)total);
printf("%d of %d (%.2f%%) Completed.\n", completed, total, pct_complete);
}
}
int print_path(double* path, int nt)
{
/* print path */
printf("---- CURRENT PATH VALUES ---- \n");
for(int i = 0; i<nt; i++)
{
printf("%f\n", path[i]);
}
printf("\n");
return 0;
}
int write_to_csv(char* fname, double* data, int n_data)
{
FILE *outfile;
outfile = fopen(fname, "w");
int i;
if(outfile != NULL)
{
for(i = 0; i<n_data; i++)
{
fprintf(outfile, "%f,", data[i]);
}
}
fclose(outfile);
return 0;
}
int write_paths_to_csv(char* fname, double** paths, int n_paths, int nt)
{
FILE *outfile;
outfile = fopen(fname, "w");
int i, j;
if(outfile != NULL)
{
for(i = 0; i<n_paths; i++)
{
for(j = 0; j<nt; j++)
{
fprintf(outfile, "%f,", paths[i][j]);
}
fprintf(outfile, "\n");
}
}
fclose(outfile);
return 0;
}
|
//
// JavaInterface.h
// Chilli Source
// Created by Ian Copland on 09/08/2012.
//
// The MIT License (MIT)
//
// Copyright (c) 2012 Tag Games Limited
//
// 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.
//
#ifdef CS_TARGETPLATFORM_ANDROID
#ifndef _CHILLISOURCE_PLATFORM_ANDROID_JAVAINTERFACE_JAVAINTERFACE_H_
#define _CHILLISOURCE_PLATFORM_ANDROID_JAVAINTERFACE_JAVAINTERFACE_H_
#include <CSBackend/Platform/Android/Main/JNI/ForwardDeclarations.h>
#include <ChilliSource/Core/Base/QueryableInterface.h>
#include <jni.h>
#include <map>
namespace CSBackend
{
namespace Android
{
//========================================================
/// Java Interface Manager
///
/// Handles all of the java interfaces and provides an
/// interface to access them.
//========================================================
class IJavaInterface : public CSCore::QueryableInterface
{
public:
//--------------------------------------------------------
/// Constructor
//--------------------------------------------------------
IJavaInterface();
//--------------------------------------------------------
/// Destructor
//--------------------------------------------------------
virtual ~IJavaInterface();
protected:
//--------------------------------------------------------
/// Create Native Interface
///
/// Creates the Native Interface on the Java side.
///
/// @param the name of the native interface.
//--------------------------------------------------------
void CreateNativeInterface(const std::string& instrInterfaceName);
//--------------------------------------------------------
/// Create Method Reference
///
/// Creates a reference to a method in the created native
/// interface.
///
/// @param the name of the native interface.
//--------------------------------------------------------
void CreateMethodReference(const std::string& instrMethodName, const std::string& instrMethodSignature);
//--------------------------------------------------------
/// Get Java Object
///
/// @return the Java Object
//--------------------------------------------------------
jobject GetJavaObject() const;
//--------------------------------------------------------
/// Get Method ID
///
/// @param the method name
/// @return the method id.
//--------------------------------------------------------
jmethodID GetMethodID(const std::string& instrMethodName) const;
private:
jobject mpJavaObject;
std::map<std::string, jmethodID> mMethodReferenceMap;
};
}
}
#endif
#endif
|
#import <UIKit/UIKit.h>
@interface HomeViewController : UIViewController
@end
|
//
// contactUsViewController.h
// SendMyGift
//
// Created by sendmygift on 29/07/16.
// Copyright © 2016 venkataramana. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface contactUsViewController : UIViewController
@property (nonatomic, assign) BOOL slideOutAnimationEnabled;
@end
|
///
/// @file
/// @details A simple base class for each of the components of the drive-train that have rotating bodies.
///
/// <!-- This file is made available under the terms of the MIT license(see LICENSE.md) -->
/// <!-- Copyright (c) 2017 Contributers: Tim Beaudet, -->
///-----------------------------------------------------------------------------------------------------------------///
#ifndef _Racecar_RotatingBody_h_
#define _Racecar_RotatingBody_h_
#include "racecar.h"
#include <vector>
namespace Racecar
{
template<typename Type> constexpr Type PercentTo(const Type& value) { return value / Type(100); }
Real RevolutionsMinuteToRadiansSecond(const Real& revolutionsMinute);
Real RadiansSecondToRevolutionsMinute(const Real& radiansSecond);
extern Real kGravityConstant;
class RacecarControllerInterface;
class RotatingBody
{
public:
RotatingBody(const Real& momentOfInertia);
virtual ~RotatingBody(void);
///
///
///
inline const RotatingBody* const GetInputSource(void) const { return mInputSource; }
///
///
///
void SetInputSource(RotatingBody* inputSource);
///
///
///
bool IsOutputSource(const RotatingBody& source) const;
///
///
///
size_t GetNumberOfOutputSources(void) const;
///
///
///
void AddOutputSource(RotatingBody* outputSource);
///
/// @details Should be called whenever the racecar controller changes.
///
void ControllerChange(const RacecarControllerInterface& racecarController);
///
///
///
void Simulate(const Real& fixedTime = kFixedTimeStep);
///
/// @details Applies a torque in Newton-meters, Nm, to the body.
///
void ApplyDownstreamAngularImpulse(const Real& angularImpulse);
void ApplyUpstreamAngularImpulse(const Real& angularImpulse);
///
/// @details Returns the angular velocity of the body in degrees/second.
///
inline Real GetAngularVelocity(void) const { return mAngularVelocity; }
///
/// @details Immediately sets the angular velocity of the rotating body, no forces involved and this
/// may ignore the angular velocities of those components upstream and downstream from this body.
///
void SetAngularVelocity(const Real& angularVelocity);
inline Real GetInertia(void) const { return mInertia; }
///
///
///
virtual Real ComputeDownstreamInertia(void) const;
///
///
///
virtual Real ComputeUpstreamInertia(void) const;
protected:
///
/// @details Set the inertia of the body in kg-m^2.
///
void SetInertia(const Real& inertia);
virtual void OnControllerChange(const RacecarControllerInterface& racecarController);
virtual void OnSimulate(const Real& fixedTime);
///
/// @details Changes the bodies acceleration.
///
/// @param changeInAcceleration should be in deg/sec/sec
///
//TODO: DriveTrain: FIX: HACK: These methods should be protected, they are not so that the differential can work.
public: virtual void OnDownstreamAngularVelocityChange(const Real& changeInAngularVelocity);
public: virtual void OnUpstreamAngularVelocityChange(const Real& changeInAngularVelocity);
protected:
///
/// @details Returns the input source for the rotating body, in a way that forces can be transmitted back.
///
const RotatingBody& GetExpectedInputSource(void) const;
RotatingBody& GetExpectedInputSource(void);
inline RotatingBody* GetInputSource(void) { return mInputSource; }
const RotatingBody& GetExpectedOutputSource(const size_t& sourceIndex) const;
RotatingBody& GetExpectedOutputSource(const size_t& sourceIndex);
const std::vector<RotatingBody*>& GetOutputSources(void) const;
std::vector<RotatingBody*>& GetOutputSources(void);
private:
RotatingBody* mInputSource;
std::vector<RotatingBody*> mOutputSources;
Real mInertia; //Rotating inertia of all components in engine include flywheel and pressure plate.
Real mAngularVelocity; //Radians / Second
};
}; /* namespace Racecar */
#endif /* _Racecar_RotatingBody_h_ */
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma once
namespace signalr
{
enum class connection_state
{
connecting,
connected,
reconnecting,
disconnecting,
disconnected
};
}
|
/*
* << Haru Free PDF Library >> -- hpdf_destination.c
*
* URL: http://libharu.org
*
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
*/
#ifndef _HPDF_DESTINATION_H
#define _HPDF_DESTINATION_H
#include "hpdf_objects.h"
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------------------------*/
/*----- HPDF_Destination -----------------------------------------------------*/
HPDF_Destination HPDF_Destination_New(HPDF_MMgr mmgr, HPDF_Page target, HPDF_Xref xref);
HPDF_BOOL
HPDF_Destination_Validate(HPDF_Destination dst);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _HPDF_DESTINATION_H */
|
//
// QuickFile-Bridging-Header.h
// QuickFile
//
// Created by Yurii Boiko on 9/25/17.
// Copyright © 2017 Yurii Boiko. All rights reserved.
//
#ifndef QuickFile_Bridging_Header_h
#define QuickFile_Bridging_Header_h
#import "MJRefreshAutoFooter.h"
#import "MJRefreshBackFooter.h"
#import "MJRefreshComponent.h"
#import "MJRefreshFooter.h"
#import "MJRefreshHeader.h"
#import "MJRefreshAutoGifFooter.h"
#import "MJRefreshAutoNormalFooter.h"
#import "MJRefreshAutoStateFooter.h"
#import "MJRefreshBackGifFooter.h"
#import "MJRefreshBackNormalFooter.h"
#import "MJRefreshBackStateFooter.h"
#import "MJRefreshGifHeader.h"
#import "MJRefreshNormalHeader.h"
#import "MJRefreshStateHeader.h"
#import "MJRefresh.h"
#import "MJRefreshConst.h"
#import "NSBundle+MJRefresh.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
#import "UIView+MJExtension.h"
#endif /* QuickFile_Bridging_Header_h */
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07.c
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.label.xml
Template File: sources-sink-07.tmpl.c
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Set data pointer to the bad buffer
* GoodSource: Set data pointer to the good buffer
* Sink: memcpy
* BadSink : Copy twoIntsStruct array to data using memcpy
* Flow Variant: 07 Control flow: if(staticFive==5) and if(staticFive!=5)
*
* */
#include "std_testcase.h"
/* The variable below is not declared "const", but is never assigned
* any other value so a tool should be able to identify that reads of
* this will always give its initialized value.
*/
static int staticFive = 5;
#ifndef OMITBAD
void CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07_bad()
{
twoIntsStruct * data;
twoIntsStruct dataBadBuffer[50];
twoIntsStruct dataGoodBuffer[100];
if(staticFive==5)
{
/* FLAW: Set a pointer to a "small" buffer. This buffer will be used in the sinks as a destination
* buffer in various memory copying functions using a "large" source buffer. */
data = dataBadBuffer;
}
{
twoIntsStruct source[100];
{
size_t i;
/* Initialize array */
for (i = 0; i < 100; i++)
{
source[i].intOne = 0;
source[i].intOne = 0;
}
}
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
memcpy(data, source, 100*sizeof(twoIntsStruct));
printStructLine(&data[0]);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B1() - use goodsource and badsink by changing the staticFive==5 to staticFive!=5 */
static void goodG2B1()
{
twoIntsStruct * data;
twoIntsStruct dataBadBuffer[50];
twoIntsStruct dataGoodBuffer[100];
if(staticFive!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Set a pointer to a "large" buffer, thus avoiding buffer overflows in the sinks. */
data = dataGoodBuffer;
}
{
twoIntsStruct source[100];
{
size_t i;
/* Initialize array */
for (i = 0; i < 100; i++)
{
source[i].intOne = 0;
source[i].intOne = 0;
}
}
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
memcpy(data, source, 100*sizeof(twoIntsStruct));
printStructLine(&data[0]);
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if statement */
static void goodG2B2()
{
twoIntsStruct * data;
twoIntsStruct dataBadBuffer[50];
twoIntsStruct dataGoodBuffer[100];
if(staticFive==5)
{
/* FIX: Set a pointer to a "large" buffer, thus avoiding buffer overflows in the sinks. */
data = dataGoodBuffer;
}
{
twoIntsStruct source[100];
{
size_t i;
/* Initialize array */
for (i = 0; i < 100; i++)
{
source[i].intOne = 0;
source[i].intOne = 0;
}
}
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
memcpy(data, source, 100*sizeof(twoIntsStruct));
printStructLine(&data[0]);
}
}
void CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07_good()
{
goodG2B1();
goodG2B2();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
// Copyright (c) 2009-2016 The Oakcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CHECKPOINTS_H
#define BITCOIN_CHECKPOINTS_H
#include "uint256.h"
#include <map>
class CBlockIndex;
struct CCheckpointData;
/**
* Block-chain checkpoints are compiled-in sanity checks.
* They are updated every release or three.
*/
namespace Checkpoints
{
//! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
CBlockIndex* GetLastCheckpoint(const CCheckpointData& data);
} //namespace Checkpoints
#endif // BITCOIN_CHECKPOINTS_H
|
//
// SecondViewController.h
// Connect
//
// Created by Zhiyong Yang on 4/1/15.
// Copyright (c) 2015 Andrew Yang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController
@end
|
#pragma once
#include "object.h"
#include "collision.hpp"
namespace rt {
class Plane : public Object {
private:
Vec3 normal;
public:
Plane( Vec3 point, Vec3 _normal, Material * mat )
: Object( point, mat )
, normal( _normal )
{}
~Plane() {}
inline gml::Plane toGMLPlane() {
return gml::Plane( normal, Vec3( transform.tx, transform.ty, transform.tz ) );
}
inline bool intersects( gml::Ray r, float& t, Vec3& pt, Vec3& normal ) override {
return gml::Collision::IntersectRayPlane( r, toGMLPlane(), t, pt, normal );
}
};
}
|
//
// YPBannerManager.h
// YPBannerDemo
//
// Created by yupao on 12/25/15.
// Copyright © 2015 yupao. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "YPBannerItem.h"
@class YPBannerManager;
@protocol YPBannerManagerDelegate<NSObject>
@required
- (void)YPBannerManager:(YPBannerManager *)manager addItem:(YPBannerItem *)item;
@optional
- (void)YPBannerManager:(YPBannerManager *)manager deleteItem:(YPBannerItem *)item;
- (void)YPBannerManager:(YPBannerManager *)manager removeAllItemsWithPlaceholdItem:(BOOL)flag;
- (void)YPBannerManager:(YPBannerManager *)manager updateItem:(YPBannerItem *)item;
@end
@interface YPBannerManager : NSObject
@property (nonatomic, weak) id<YPBannerManagerDelegate> delegate;
@property (nonatomic, assign) NSInteger countOfItems;
@property (nonatomic, strong) UIImage *placeholderImg;
- (void)addItem:(YPBannerItem *)item;
- (void)addItems:(NSArray <YPBannerItem *> *)itemArray;
- (void)deleteItem:(YPBannerItem *)item;
- (void)removeAllItemsWithPlaceholderItem:(BOOL)flag;
- (YPBannerItem *)itemAtIndex:(NSInteger)index;
@end
|
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void aLine(int x1, int y1, int x2, int y2, string shape);
//void drawCurve(float pointNumber, float startPointX, float startPointY, float endPointX, float endPointY, float ctrlPointX1, float ctrlPointY1, float ctrlPointX2, float ctrlPointY2);
void drawCircleGroup(float circleNumber, float circleX, float circleY, float circleR, bool vertical, bool fill, bool randomColor);
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
ofColor bgColorTop, bgColorBottom,
TriaColor;
ofPath angleArc = ofPath();
float angle, random, rotate;
// float circX, circY;
};
|
//
// SLCAppDelegate.h
// IntroToCocoapods
//
// Created by Vinayak Ram on 7/1/14.
// Copyright (c) 2014 Slalom Consulting. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SLCAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
// MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License
#pragma once
#include "mx/core/ForwardDeclare.h"
#include "mx/core/AttributesInterface.h"
#include "mx/core/Color.h"
#include "mx/core/CommaSeparatedText.h"
#include "mx/core/Decimals.h"
#include "mx/core/Enums.h"
#include "mx/core/FontSize.h"
#include "mx/core/Integers.h"
#include <iosfwd>
#include <memory>
#include <vector>
namespace mx
{
namespace core
{
MX_FORWARD_DECLARE_ATTRIBUTES( KeyAttributes )
struct KeyAttributes : public AttributesInterface
{
public:
KeyAttributes();
virtual bool hasValues() const;
virtual std::ostream& toStream( std::ostream& os ) const;
StaffNumber number;
TenthsValue defaultX;
TenthsValue defaultY;
TenthsValue relativeX;
TenthsValue relativeY;
CommaSeparatedText fontFamily;
FontStyle fontStyle;
FontSize fontSize;
FontWeight fontWeight;
Color color;
YesNo printObject;
bool hasNumber;
bool hasDefaultX;
bool hasDefaultY;
bool hasRelativeX;
bool hasRelativeY;
bool hasFontFamily;
bool hasFontStyle;
bool hasFontSize;
bool hasFontWeight;
bool hasColor;
bool hasPrintObject;
private:
virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement );
};
}
}
|
/* IHLPOS Copyright (c) 2017 Peter M.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#include <stdarg.h>
#include "kcurses.h"
#include "math.h"
static size_t term_row = 0;
static size_t term_col = 0;
static uint8_t term_color = 7; /* Color white */
static uint16_t *term_buff = (uint16_t *) 0xB8000; /* Location of buffer in absolute memory */
static void
newline(void)
{
term_row++;
if (term_row == VGA_HEIGHT)
term_row = 0;
term_col = 0;
}
static inline uint16_t
vga_entry(unsigned char uc)
{
return (uint16_t) uc | (uint16_t) term_color << 8;
}
static void
kcurses_yxaddch(uint8_t y, uint8_t x, char ch)
{
term_buff[CELL(y, x)] = vga_entry(ch);
}
void
kcurses_move(int32_t y, int32_t x)
{
if (y < 0)
y = term_row;
else if (y > 25)
y = 25;
if (x < 0)
x = term_col;
else if (x > 80)
x = 80;
term_row = y;
term_col = x;
}
void
kcurses_clear_from(int32_t sy, int32_t sx)
{
for (size_t y = sy; y < VGA_HEIGHT; y++)
for (size_t x = sx; x < VGA_WIDTH; x++)
kcurses_yxaddch(y, x, ' ');
term_row = sy;
term_col = sx;
}
void
kcurses_addch(char ch)
{
switch (ch) {
case '\n':
newline();
return;
default:
kcurses_yxaddch(term_row, term_col, ch);
break;
}
term_col++;
if (term_col == VGA_WIDTH)
newline();
}
void
kcurses_addstr(const char *str)
{
while (*str)
kcurses_addch(*str++);
}
void
kcurses_printf(char *str, ...)
{
va_list va;
char tmpstr[11];
char *fsptr;
uint32_t fnum;
va_start(va, str);
while (*str) {
if (*str != '%') {
kcurses_addch(*str++);
continue;
}
switch (*++str) {
case 'x':
fnum = va_arg(va, uint32_t);
hex2str(tmpstr, fnum);
fsptr = tmpstr;
break;
case 'u':
fnum = va_arg(va, uint32_t);
int2str(tmpstr, fnum);
fsptr = tmpstr;
break;
case 's':
fsptr = va_arg(va, char *);
break;
default:
tmpstr[0] = '%';
tmpstr[1] = *str;
tmpstr[2] = 0;
fsptr = tmpstr;
}
kcurses_addstr(fsptr);
str++;
}
}
|
// RUN: %ucc -fsyntax-only %s
// RUN: %check --only -e %s -DERROR
const void f() // CHECK: warning: function has qualified void return type (const)
{
}
double h(void);
const double h(void); // CHECK: warning: const qualification on return type has no effect
main()
{
double (*hp)(void) = h;
double const (*hpc)(void) = hp; // no (relevant) warnings, qualifiers on return types are ignored in the type system
// CHECK: ^warning: const qualification on return type has no effect
}
#ifdef ERROR
int x = _Generic(&h,
double (*)(void): 1,
double const (*)(void): 2 // CHECK: error: duplicate type in _Generic: double (*)(void)
// CHECK: ^warning: const qualification on return type has no effect
);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.