text stringlengths 4 6.14k |
|---|
#ifndef MEDIANTEST_H
#define MEDIANTEST_H
#include <vector>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
class MedianTest: public CPPUNIT_NS::TestFixture
{
public:
MedianTest(){}
CPPUNIT_TEST_SUITE (MedianTest);
CPPUNIT_TEST (quickMedianTest);
CPPUNIT_TEST (quickSelectMedianTest);
CPPUNIT_TEST (streamHeapMedianTest);
CPPUNIT_TEST (streamInsertionMedianTest);
CPPUNIT_TEST_SUITE_END ();
public:
void setUp();
void tearDown();
protected:
void quickMedianTest();
void quickSelectMedianTest();
void streamHeapMedianTest();
void streamInsertionMedianTest();
private:
void gen_data(std::vector<int> &vec, int start);
private:
std::vector<int> vec10;
std::vector<int> vec11;
using vec10_type = std::remove_reference<decltype(vec10[0])>::type;
using vec11_type = std::remove_reference<decltype(vec11[0])>::type;
};
#endif // MEDIANTEST_H
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UIActivityItemProvider.h"
@class SKUIClientContext, SKUIProductPageItem;
@interface SKUIImageActivityItemProvider : UIActivityItemProvider
{
SKUIProductPageItem *_item;
SKUIClientContext *_clientContext;
}
- (void).cxx_destruct;
- (id)item;
- (id)initWithProductPageItem:(id)arg1 clientContext:(id)arg2;
@end
|
/***** includes *****/
#include "lfds700_queue_internal.h"
/****************************************************************************/
void lfds700_queue_init_valid_on_current_logical_core( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe_dummy, struct lfds700_misc_prng_state *ps, void *user_state )
{
LFDS700_PAL_ASSERT( qs != NULL );
LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qs->enqueue % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 );
LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qs->dequeue % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 );
LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qs->user_state % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 );
LFDS700_PAL_ASSERT( qe_dummy != NULL );
LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) qe_dummy->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 );
LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qe_dummy->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 );
LFDS700_PAL_ASSERT( ps != NULL );
// TRD : user_state can be UNLL
/* TRD : qe_dummy is a dummy element, needed for init
the qs->enqueue and qs->dequeue counters do not need to be initialized
but it does no harm to do so, and stops a valgrind complaint
*/
qs->enqueue[POINTER] = qe_dummy;
qs->enqueue[COUNTER] = (struct lfds700_queue_element *) 0;
qs->dequeue[POINTER] = qe_dummy;
qs->dequeue[COUNTER] = (struct lfds700_queue_element *) 0;
qe_dummy->next[POINTER] = NULL;
qe_dummy->next[COUNTER] = (struct lfds700_queue_element *) LFDS700_MISC_PRNG_GENERATE( ps );
qe_dummy->value = NULL;
qs->user_state = user_state;
LFDS700_MISC_BARRIER_STORE;
lfds700_misc_force_store();
return;
}
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSArray.h"
@interface NSArray (IBToolOutputCoercion)
- (id)ibCoerceToDescriptivePListWithStrictness:(long long)arg1;
@end
|
//
// XMLImageContainerParser.h
// Xmls
//
// Created by malczak on 31/01/15.
// Copyright (c) 2015 piratcat. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "XMLObjectParser.h"
@interface XMLImageContainerParser : XMLObjectParser
@end
|
#ifndef AC_BRBETRAV_H
#define AC_BRBETRAV_H 1
//
// Copyright 2014 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.
//
// DESCRIPTION:
//
// The AcBrBrepEdgeTraverser class is the interface class for brep
// edge traversers. All the functionality supported by this class
// is implemented by the class AcBrImpBrepEdgeTraverser.
//
// This class defines the functions that are pertinent to an edge
// in the global context of a brep. It is used to traverse all of
// the unique edges in a brep.
//
// The default constructor instantiates an uninitialised object. The
// function isNull() returns kTrue on an object created this way. To set
// an AcBrBrepEdgeTraverser, call setBrep() and/or setEdge() using valid,
// previously instantiated brep and edge objects.
//
// The setBrepAndEdge() list initialiser is used to set this traverser
// to a specific brep edge list and starting position. This initialises
// a traverser instantiated with the default constructor, and resets
// the criteria for the eBrepChanged error as well as the criteria
// for next() and done(). It also sets the validation level to match
// that of the edge. The brep list owner is inferred from the edge,
// as it is unique. If the edge reference object is uninitialised, or
// if the associated AutoCAD object has been modified since the edge
// reference object was last set, Acad::eInvalidInput is returned. In
// the event of an error, this traverser's brep edge list is unchanged.
//
// The setBrep() list owner initialiser is used to set this traverser
// to a specific brep edge list, starting at the first edge in the
// list. This initialises a traverser instantiated with the default
// constructor, and resets the criteria for the eBrepChanged error
// as well as the criteria for next() and done(). It also sets the
// validation level to match that of the brep. If the brep reference
// object is uninitialised, or if the associated AutoCAD object has
// been modified since the brep reference object was last set,
// Acad::eInvalidInput is returned. If the brep is not edge-bounded
// (e.g., a wireframe or an empty/deleted/unsurfaced model),
// eDegenerateTopology is returned. In the event of an error, this
// traverser's brep edge list is unchanged.
//
// The getBrep() list owner query returns the brep owner of the edge
// list. The brep object is instantiated by the caller and passed
// by reference for getBrep() to set. If this traverser object is
// uninitialised, eUninitialisedObject is returned. If the associated
// AutoCAD object has been modified since the traverser was last
// set, eBrepChanged is returned. In the event of an error, the
// brep reference object is unchanged and is thus likely to be
// uninitialised.
//
// The setEdge() list position initialiser is used to set this
// traverser's starting position to a specific edge in the brep edge
// list, which resets the criteria for next() and done(). If this
// traverser object is uninitialised, eUninitialisedObject is returned.
// If the associated AutoCAD object has been modified since the
// traverser was last set, eBrepChanged is returned. If the edge
// reference object is uninitialised, or if the associated AutoCAD
// object has been modified since the edge reference object was last
// set, Acad::eInvalidInput is returned. If the edge is not in the
// brep edge list or is associated with a different AutoCAD object
// or revision, Acad::eWrongDatabase is returned. In the event of
// an error, this traverser's brep edge list is unchanged.
//
// The getEdge() list position query returns the edge at the current
// position in the brep edge list. The edge object is instantiated by
// the caller and passed by reference for getEdge() to set. If this
// traverser object is uninitialised, eUninitialisedObject is returned.
// If the associated AutoCAD object has been modified since the traverser
// was last set, eBrepChanged is returned. If the edge is missing,
// Acad::eWrongDatabase is returned. If the edge fails to map to a valid
// subentity ID, Acad::eNotInDatabase is returned. In the event of an
// error, the edge reference object is unchanged and is thus likely
// to be uninitialised.
#include "adesk.h"
#include "rxobject.h"
#include "rxboiler.h"
#include "brgbl.h"
#include "brtrav.h"
// forward class declarations
class AcBrBrep;
class AcBrEdge;
class AcBrBrepEdgeTraverser : public AcBrTraverser
{
public:
ACRX_DECLARE_MEMBERS(AcBrBrepEdgeTraverser);
AcBrBrepEdgeTraverser();
AcBrBrepEdgeTraverser(const AcBrBrepEdgeTraverser& src);
~AcBrBrepEdgeTraverser();
// Assignment operator
AcBrBrepEdgeTraverser& operator = (const AcBrBrepEdgeTraverser& src);
// Queries & Initialisers
AcBr::ErrorStatus setBrepAndEdge (const AcBrEdge& edge);
AcBr::ErrorStatus setBrep (const AcBrBrep& brep);
AcBr::ErrorStatus getBrep (AcBrBrep& brep) const;
AcBr::ErrorStatus setEdge (const AcBrEdge& edge);
AcBr::ErrorStatus getEdge (AcBrEdge& edge) const;
};
#endif
|
#ifndef BerTlv_h
#define BerTlv_h
#include <vector>
#include <string>
class BerTlv
{
public:
BerTlv() { _TlvStruct = std::vector<unsigned char>(0); }
~BerTlv() { _TlvStruct.clear(); }
std::vector<unsigned char> GetTlv() { return _TlvStruct; }
void SetTlv(std::vector<unsigned char> TlvStruct) { _TlvStruct = TlvStruct; }
short Add(std::string Tag, std::vector<unsigned char> Value);
short GetValue(std::string Tag, std::vector<unsigned char> *ValueOfTag, bool CheckNestedTags);
void SetTwoBytesTags(std::vector<std::string> Tags);
void SetThreeBytesTags(std::vector<std::string> Tags);
void SetFourBytesTags(std::vector<std::string> Tags);
void SetNestedTags(std::vector<std::string> Tags) { _NestedTags = Tags; }
short DumpAllTagsAndValues(std::string *Output, bool ParseNestedTags);
private:
std::vector<unsigned char> _TlvStruct;
std::vector<unsigned char> _TwoBytesTags;
std::vector<unsigned char> _ThreeBytesTags;
std::vector<unsigned char> _FourBytesTags;
std::vector<std::string> _NestedTags;
std::vector<unsigned char> CalcSizeOfValue(std::vector<unsigned char> Value);
short GetSizeOfValue(size_t StartPosition, int *SizeOfValue);
short GetTagLength(size_t StartPosition);
short DumpTlvInsideTag(size_t StartPosition, int Length, std::string *Output);
bool IsTagNested(size_t StartPosition, short TagSize);
short GetValueFromTlv(size_t StartPosition, int Length, std::vector<unsigned char> Tag, std::vector<unsigned char> *Output);
};
#endif /* BerTlv_h */
|
#ifndef __GLSL_PROGRAM_H__
#define __GLSL_PROGRAM_H__
#pragma warning( disable : 4290 )
#include <string>
#include <map>
#include <GL/glew.h>
#include <string>
#include <stdexcept>
#include <vector>
#include <glm/glm.hpp>
#include "mcpp.h"
/////////////////////////////////////////////////////////////////////////////
class GLSLProgramException : public std::runtime_error
{
public:
GLSLProgramException(const std::string & msg) :
std::runtime_error(msg) {}
};
/////////////////////////////////////////////////////////////////////////////
class GLSLProgram
{
public:
enum GLSLShaderType
{
VERTEX = GL_VERTEX_SHADER,
FRAGMENT = GL_FRAGMENT_SHADER,
GEOMETRY = GL_GEOMETRY_SHADER,
TESS_CONTROL = GL_TESS_CONTROL_SHADER,
TESS_EVALUATION = GL_TESS_EVALUATION_SHADER,
COMPUTE = GL_COMPUTE_SHADER
};
GLSLProgram();
void compileShader(
const std::string &source,
GLSLProgram::GLSLShaderType type);
void compileShaderFromFile(
const std::string &fileName,
GLSLProgram::GLSLShaderType type);
void compileShaderFromPath(
const std::string& path,
const std::vector<std::string>& arguments = {});
void link();
void use();
void unUse();
void bindAttribLocation(GLuint location, const char *name);
GLuint getUniformLocation(const char *name);
void setUniform(const char *name, const glm::mat4 &m);
void setUniform(const char *name, const glm::mat3 &m);
void setUniform(const char *name, const glm::vec4 &v);
void setUniform(const char *name, float x, float y, float z);
void setUniform(const char *name, float f);
GLuint getHandle();
bool isLinked();
bool isBound();
private:
GLuint m_uiHandle;
bool m_bLinked;
bool m_bBound;
};
/////////////////////////////////////////////////////////////////////////////
#endif // __GLSL_PROGRAM_H__
|
//
// Header.h
// 项目A_汽车之家
//
// Created by zyana on 15/11/17.
// Copyright © 2015年 zyana. All rights reserved.
//
#ifndef Header_h
#define Header_h
#define CAROUSELURL @"http://app.api.autohome.com.cn/autov4.2/news/newslist-a2-pm1-v4.2.0-c0-nt0-p1-s30-l0.html"
#define CULTUREURL @"http://app.api.autohome.com.cn/autov5.0.0/news/newslist-pm1-c0-nt97-p1-s30-l0.json"
#define NEWSURL @"http://app.api.autohome.com.cn/autov4.2/news/newslist-a2-pm1-v4.2.0-c0-nt1-p1-s30-l0.html"
#define EVALUATEURL @"http://app.api.autohome.com.cn/autov4.2/news/newslist-a2-pm1-v4.2.0-c0-nt3-p1-s30-l0.html"
#define TECHNOLOGYURL @"http://app.api.autohome.com.cn/autov4.2/news/newslist-a2-pm1-v4.2.0-c0-nt102-p1-s30-l0.html"
#define VIDEOURL @"http://app.api.autohome.com.cn/autov5.0.0/news/videolist-pm1-vt0-s30-lastid0.json"
#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height
#define BARHEIGHT 64
#define CAROUSELHEIGHT [UIScreen mainScreen].bounds.size.height / 4
#define CAROUSELTAG 50
#define HEADERSCROLL_TAG 100
#define VIDEOX 10
#define VIDEOY [UIScreen mainScreen].bounds.size.height / 3 + 20
#define VIDEOWIDTH [UIScreen mainScreen].bounds.size.width - 20
#define VIDEOHEIGHT [UIScreen mainScreen].bounds.size.height / 10
#endif /* Header_h */
|
//
// KiiRTransfer.h
// KiiSDK-Private
//
// Created by Syah Riza on 3/26/13.
// Copyright (c) 2013 Kii Corporation. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "KiiRTransferInfo.h"
#import "KiiFile.h"
#import "FileHolder.h"
@protocol KiiRTransfer;
typedef void(^KiiRTransferBlock)(id<KiiRTransfer> transferObject, NSError *error);
/** Protocol to encapsulate Resumable transfer process. Resumable transfer process consist of Download and Upload.
*/
@protocol KiiRTransfer <NSObject>
/** @name Resumable transfer process */
/** Synchronously get transfer process information. This is blocking method.
@return KiiRTransferInfo an object contains information regarding transfer process.
*/
-(KiiRTransferInfo*) info;
/** Synchronously proceed transfer process. This is blocking method.
KiiRTransferBlock is a block defined as: typedef void(^KiiRTransferBlock)(id<KiiRTransfer> transferObject, NSError *error);
NSError *error = nil;
[aTransfer transferWithProgressBlock:^(id <KiiRTransfer> transferObject, NSError *error) {
if (nil == error) {
KiiRTransferInfo *info = [transferObject info];
NSLog(@"%d", [info completedSizeInBytes]);
}
} andError:&error];
if (error == nil) {
NSLog(@"Transfer is completed.");
}
@param KiiRTransferBlock progress block, can be nil.
@param error An NSError object, set to nil, to test for errors.
@warning This API access to server. Should not be executed in UI/Main thread.
*/
-(void) transferWithProgressBlock:(KiiRTransferBlock) progress andError:(NSError**) error;
/** Asynchronously proceed transfer process using block.
This is non-blocking method.
KiiRTransferBlock is a block defined as: typedef void(^KiiRTransferBlock)(id<KiiRTransfer> transferObject, NSError *error);
[aTransfer transferWithProgressBlock:^(id <KiiRTransfer> transferObject, NSError *error) {
if (nil == error) {
KiiRTransferInfo *info = [transferObject info];
NSLog(@"%d", [info completedSizeInBytes]);
}
} andCompletionBlock:^(id <KiiRTransfer> transferObject, NSError *error) {
if (nil == error) {
NSLog(@"Transfer is completed");
}
}];
@param KiiRTransferBlock progress block. This can be nil.
@param KiiRTransferBlock completion block to handle after process completed. This can be nil.
*/
-(void) transferWithProgressBlock:(KiiRTransferBlock) progress andCompletionBlock:(KiiRTransferBlock) completion;
/** Suspend transfer process.
Does not blocks until the completion of suspend.
Completion of suspend is notified in completion block. If the transfer is on the way of sending a chunk, that chunk will be transferred and progress block is called before suspend notified.
@param error An NSError object, set to nil, to test for errors.
*/
-(void) suspend:(NSError**) error;
/** Synchronously terminate transfer process.
This is blocking method.
@param error An NSError object, set to nil, to test for errors.
*/
-(void) terminate:(NSError**) error;
/** Get the File Holder instance which this transfer is bounded.
@return fileHolder a KiiObject or KiiFile instance which this transfer is bounded.
*/
-(id<FileHolder>) fileHolder;
@end
|
//
// NHDiscoveryVCR.h
// NHNaviSwipeBackPro
//
// Created by hu jiaju on 15/11/23.
// Copyright © 2015年 hu jiaju. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "NHViewController.h"
@interface NHDiscoveryVCR : NHViewController
@end
|
//
// ProductDetailModel.h
// WJXC
//
// Created by gaomeng on 15/7/8.
// Copyright (c) 2015年 lcw. All rights reserved.
//
//商品详细model
#import "BaseModel.h"
@interface ProductDetailModel : BaseModel
@property(nonatomic,strong)NSString *product_id;
@property(nonatomic,strong)NSString *product_name;
@property(nonatomic,strong)NSString *original_price;
@property(nonatomic,strong)NSString *current_price;
@property(nonatomic,strong)NSString *comment_num;
@property(nonatomic,strong)NSString *good_comment_num;
@property(nonatomic,strong)NSString *normal_comment_num;
@property(nonatomic,strong)NSString *bad_comment_num;
@property(nonatomic,strong)NSArray *product_desc;
@property(nonatomic,strong)NSArray *image;
@property(nonatomic,strong)NSString *add_time;
@property(nonatomic,strong)NSString *discount;
@property(nonatomic,strong)NSString *cover_pic;
@property(nonatomic,strong)NSString *is_favor;
@property(nonatomic,strong)NSString *merchant_phone;//联系电话
@property(nonatomic,retain)NSDictionary *seckill_info;//秒杀信息 end_time
@property(nonatomic,retain)NSString *is_seckill;//是否是秒杀
@property(nonatomic,retain)NSArray *multi_cover;//多张图
@property(nonatomic,strong)NSArray *coupon_list;//优惠券数组
@end
|
/**
* @file
*
* @author jeff.daily@pnnl.gov
*
* Copyright (c) 2015 Battelle Memorial Institute.
*
* This file was converted to C code from the raw file found at
* ftp://ftp.cbi.pku.edu.cn/pub/software/blast/matrices/BLOSUM65, the
* Center for Bioinformatics, Peking University, China.
*/
#ifndef _PARASAIL_BLOSUM65_H_
#define _PARASAIL_BLOSUM65_H_
#include "parasail.h"
#include "blosum_map.h"
#ifdef __cplusplus
extern "C" {
#endif
/* # Matrix made by matblas from blosum65.iij */
/* # * column uses minimum score */
/* # BLOSUM Clustered Scoring Matrix in 1/2 Bit Units */
/* # Blocks Database = /data/blocks_5.0/blocks.dat */
/* # Cluster Percentage: >= 65 */
/* # Entropy = 0.7576, Expected = -0.5675 */
static const int parasail_blosum65_[] = {
/* A R N D C Q E G H I L K M F P S T W Y V B Z X * */
/* A */ 4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -2, -1, -1, -2, -1, 1, 0, -3, -2, 0, -2, -1, -1, -5,
/* R */ -1, 6, 0, -2, -4, 1, 0, -2, 0, -3, -2, 2, -2, -3, -2, -1, -1, -3, -2, -3, -1, 0, -1, -5,
/* N */ -2, 0, 6, 1, -3, 0, 0, -1, 1, -3, -4, 0, -2, -3, -2, 1, 0, -4, -2, -3, 3, 0, -1, -5,
/* D */ -2, -2, 1, 6, -4, 0, 2, -1, -1, -3, -4, -1, -3, -4, -2, 0, -1, -5, -3, -3, 4, 1, -1, -5,
/* C */ 0, -4, -3, -4, 9, -3, -4, -3, -3, -1, -1, -3, -2, -2, -3, -1, -1, -2, -2, -1, -3, -4, -2, -5,
/* Q */ -1, 1, 0, 0, -3, 6, 2, -2, 1, -3, -2, 1, 0, -3, -1, 0, -1, -2, -2, -2, 0, 3, -1, -5,
/* E */ -1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2, -3, 1, 4, -1, -5,
/* G */ 0, -2, -1, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -3, -3, -3, -1, -2, -2, -5,
/* H */ -2, 0, 1, -1, -3, 1, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, 2, -3, 0, 0, -1, -5,
/* I */ -1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -2, -1, 3, -3, -3, -1, -5,
/* L */ -2, -2, -4, -4, -1, -2, -3, -4, -3, 2, 4, -3, 2, 0, -3, -3, -1, -2, -1, 1, -4, -3, -1, -5,
/* K */ -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -3, 5, -2, -3, -1, 0, -1, -3, -2, -2, 0, 1, -1, -5,
/* M */ -1, -2, -2, -3, -2, 0, -2, -3, -2, 1, 2, -2, 6, 0, -3, -2, -1, -2, -1, 1, -3, -2, -1, -5,
/* F */ -2, -3, -3, -4, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, 3, -1, -3, -3, -2, -5,
/* P */ -1, -2, -2, -2, -3, -1, -1, -2, -2, -3, -3, -1, -3, -4, 8, -1, -1, -4, -3, -2, -2, -1, -2, -5,
/* S */ 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -3, 0, -2, -2, -1, 4, 1, -3, -2, -2, 0, 0, -1, -5,
/* T */ 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -3, -2, 0, -1, -1, -1, -5,
/* W */ -3, -3, -4, -5, -2, -2, -3, -3, -2, -2, -2, -3, -2, 1, -4, -3, -3, 10, 2, -3, -4, -3, -2, -5,
/* Y */ -2, -2, -2, -3, -2, -2, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7, -1, -3, -2, -1, -5,
/* V */ 0, -3, -3, -3, -1, -2, -3, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4, -3, -2, -1, -5,
/* B */ -2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3, -3, 4, 1, -1, -5,
/* Z */ -1, 0, 0, 1, -4, 3, 4, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2, -2, 1, 4, -1, -5,
/* X */ -1, -1, -1, -1, -2, -1, -1, -2, -1, -1, -1, -1, -1, -2, -2, -1, -1, -2, -1, -1, -1, -1, -1, -5,
/* * */ -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 1
};
static const parasail_matrix_t parasail_blosum65 = {
"blosum65",
parasail_blosum65_,
parasail_blosum_map,
24,
10,
-5,
0
};
#ifdef __cplusplus
}
#endif
#endif /* _PARASAIL_BLOSUM65_H_ */
|
#import <UIKit/UIKit.h>
@interface UIFont (Cambay)
+ (instancetype)cambayBoldFontOfSize:(CGFloat)size;
+ (instancetype)cambayBoldItalicFontOfSize:(CGFloat)size;
+ (instancetype)cambayItalicFontOfSize:(CGFloat)size;
+ (instancetype)cambayRegularFontOfSize:(CGFloat)size;
@end
|
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/*
* Copyright (c) 2010 Havoc Pennington
*
* 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 __HRT_TASK_RUNNER_H__
#define __HRT_TASK_RUNNER_H__
#include <glib-object.h>
G_BEGIN_DECLS
typedef enum {
HRT_EVENT_LOOP_GLIB,
HRT_EVENT_LOOP_EV
} HrtEventLoopType;
typedef struct HrtEventLoop HrtEventLoop;
typedef struct HrtTask HrtTask;
typedef struct HrtWatcher HrtWatcher;
typedef struct HrtInvoker HrtInvoker;
typedef enum {
HRT_WATCHER_FLAG_NONE = 0,
HRT_WATCHER_FLAG_READ = 1,
HRT_WATCHER_FLAG_WRITE = 2
} HrtWatcherFlags;
typedef gboolean (* HrtWatcherCallback) (HrtTask *task,
HrtWatcherFlags flags,
void *data);
typedef struct HrtTaskRunner HrtTaskRunner;
typedef struct HrtTaskRunnerClass HrtTaskRunnerClass;
#define HRT_TYPE_TASK_RUNNER (hrt_task_runner_get_type ())
#define HRT_TASK_RUNNER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), HRT_TYPE_TASK_RUNNER, HrtTaskRunner))
#define HRT_TASK_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HRT_TYPE_TASK_RUNNER, HrtTaskRunnerClass))
#define HRT_IS_TASK_RUNNER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), HRT_TYPE_TASK_RUNNER))
#define HRT_IS_TASK_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HRT_TYPE_TASK_RUNNER))
#define HRT_TASK_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HRT_TYPE_TASK_RUNNER, HrtTaskRunnerClass))
GType hrt_task_runner_get_type (void) G_GNUC_CONST;
HrtTask* hrt_task_runner_create_task (HrtTaskRunner *runner);
HrtTask* hrt_task_runner_pop_completed (HrtTaskRunner *runner);
G_END_DECLS
#endif /* __HRT_TASK_RUNNER_H__ */
|
/* -------------------------------------------------------------------------------------
** This software is implemented as part of the course
** Algorithms in Bioinformatics - Sequences Q1/2015
** at Aarhus Univerity Denmark.
**
** performance.h
** performance file
**
** Author: Martin Storgaard, Konstantinos Mampentzidis and Henrik McQuoid Jespersen
** -----------------------------------------------------------------------------------*/
#ifndef BIOSEQ_PROJECT2_PERFORMANCE_H
#define BIOSEQ_PROJECT2_PERFORMANCE_H
#ifndef PERFORMANCE_RUNS
// This can be overwritten at compile time
#define PERFORMANCE_RUNS 10
#endif
#include "common.h"
#include <unistd.h> //< syscall, read
#include <string.h> //< memset
#include <fstream> //< lots of output stuff
#include <vector> //< vector
/* perf */
#include <sys/ioctl.h>
#include <linux/perf_event.h>
#include <asm/unistd.h>
struct e {
uint64_t type, config;
e() {
type = 0;
config = 0;
};
e(uint64_t init_type, uint64_t init_config) {
type = init_type;
config = init_config;
};
};
class Performance {
private:
int perf_size;
int events;
int fd;
e *order;
void _add(perf_type_id type, uint64_t config);
long long _get(perf_type_id type, long long config);
public:
virtual void run(std::vector<Common *> &algorithms, const char *file1, const char *file2);
Performance() {
this->perf_size = 1;
this->events = 0;
this->fd = -1;
this->order = new e[perf_size];
// This reports the CPU clock, a high-resolution per-CPU timer.
// [https://lkml.org/lkml/2009/7/1/198] states it is nanoseconds.
_add(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK);
}
~Performance() {
delete[] order;
}
};
#endif //BIOSEQ_PROJECT2_PERFORMANCE_H
|
#ifndef SLIST_H
#define SLIST_H
#include "slist_types.h"
#include "slist_context.h"
#include "slist_parser.h"
#include "slist_eval.h"
#include "slist_log.h"
#endif |
#ifndef TEXTURE_H
#define TEXTURE_H
#include <string>
#include <GL/glew.h>
class Texture
{
public:
Texture(GLenum TextureTarget, const std::string& FileName);
bool Load();
void Bind(GLenum TextureUnit);
private:
std::string m_fileName;
GLenum m_textureTarget;
GLuint m_textureObj;
};
#endif /* TEXTURE_H */
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
#import "TKVibrationPickerStyleProvider-Protocol.h"
@class UIColor, UIFont;
@interface ABFaceTimeVibrationPickerStyleProvider : NSObject <TKVibrationPickerStyleProvider>
{
UIFont *_vibrationPickerCellTextFont;
UIColor *_vibrationPickerCellHighlightedTextColor;
UIFont *_vibrationPickerHeaderTextFont;
UIColor *_vibrationPickerHeaderTextShadowColor;
struct UIOffset _vibrationPickerHeaderTextShadowOffset;
struct UIEdgeInsets _vibrationPickerHeaderTextPaddingInsets;
}
@property(readonly, nonatomic) struct UIEdgeInsets vibrationPickerHeaderTextPaddingInsets; // @synthesize vibrationPickerHeaderTextPaddingInsets=_vibrationPickerHeaderTextPaddingInsets;
@property(readonly, nonatomic) struct UIOffset vibrationPickerHeaderTextShadowOffset; // @synthesize vibrationPickerHeaderTextShadowOffset=_vibrationPickerHeaderTextShadowOffset;
@property(readonly, nonatomic) UIColor *vibrationPickerHeaderTextShadowColor; // @synthesize vibrationPickerHeaderTextShadowColor=_vibrationPickerHeaderTextShadowColor;
@property(readonly, nonatomic) UIFont *vibrationPickerHeaderTextFont; // @synthesize vibrationPickerHeaderTextFont=_vibrationPickerHeaderTextFont;
@property(readonly, nonatomic) UIColor *vibrationPickerCellHighlightedTextColor; // @synthesize vibrationPickerCellHighlightedTextColor=_vibrationPickerCellHighlightedTextColor;
@property(readonly, nonatomic) UIFont *vibrationPickerCellTextFont; // @synthesize vibrationPickerCellTextFont=_vibrationPickerCellTextFont;
- (id)newAccessoryDisclosureIndicatorViewForVibrationPickerCell;
- (id)newBackgroundViewForSelectedVibrationPickerCell:(_Bool)arg1;
@property(readonly, nonatomic) _Bool wantsCustomVibrationPickerHeaderView;
@property(readonly, nonatomic) UIColor *vibrationPickerCellBackgroundColor;
@property(readonly, nonatomic) UIColor *vibrationPickerHeaderTextColor;
@property(readonly, nonatomic) UIColor *vibrationPickerCellTextColor;
@property(readonly, nonatomic) long long vibrationPickerTableViewSeparatorStyle;
@property(readonly, nonatomic) _Bool vibrationPickerUsesOpaqueBackground;
@end
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_SquareMealsTestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_SquareMealsTestsVersionString[];
|
//
// PXLMenuControllerAnimator.h
// Example
//
// Created by Jason Silberman on 8/13/14.
// Copyright (c) 2014 Jason Silberman. All rights reserved.
//
@import Foundation;
@interface PXLMenuControllerAnimator : NSObject <UIViewControllerAnimatedTransitioning>
/*
If the animation is reversed.
*/
@property (nonatomic) BOOL reverse;
@end
|
//
// XYDerivativeFilter.h
// ofxFilterLibraryExample
//
// Created by Matthew Fargo on 2014/06/27.
//
//
#ifndef __ofxFilterLibraryExample__XYDerivativeFilter__
#define __ofxFilterLibraryExample__XYDerivativeFilter__
#include "SobelEdgeDetectionFilter.h"
class XYDerivativeFilter : public SobelEdgeDetectionFilter {
public:
XYDerivativeFilter(float width, float height, float edgeStrength=1.f);
virtual ~XYDerivativeFilter();
protected:
virtual string _getFragSrc();
};
#endif /* defined(__ofxFilterLibraryExample__XYDerivativeFilter__) */
|
//
// HomePageViewController.h
// BXIOSPacker
//
// Created by Leppard on 7/21/15.
// Copyright (c) 2015 Leppard. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface HomePageViewController : NSViewController<NSTextFieldDelegate>
@property (weak) IBOutlet NSTextField *filePath;
- (IBAction)filePathSelectBtnPressed:(id)sender;
- (IBAction)packProjectBtnPressed:(id)sender;
- (IBAction)uploadProjectBtnPressed:(id)sender;
@end
|
// Copyright 2010 Google Inc. All Rights Reserved.
//
// This code is licensed under the same terms as WebM:
// Software License Agreement: http://www.webmproject.org/license/software/
// Additional IP Rights Grant: http://www.webmproject.org/license/additional/
// -----------------------------------------------------------------------------
//
// Quantizer initialization
//
// Author: Skal (pascal.massimino@gmail.com)
#include "./vp8i.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
static WEBP_INLINE int clip(int v, int M) {
return v < 0 ? 0 : v > M ? M : v;
}
// Paragraph 14.1
static const uint8_t kDcTable[128] = {
4, 5, 6, 7, 8, 9, 10, 10,
11, 12, 13, 14, 15, 16, 17, 17,
18, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 25, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36,
37, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 76, 77, 78, 79, 80, 81,
82, 83, 84, 85, 86, 87, 88, 89,
91, 93, 95, 96, 98, 100, 101, 102,
104, 106, 108, 110, 112, 114, 116, 118,
122, 124, 126, 128, 130, 132, 134, 136,
138, 140, 143, 145, 148, 151, 154, 157
};
static const uint16_t kAcTable[128] = {
4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 60,
62, 64, 66, 68, 70, 72, 74, 76,
78, 80, 82, 84, 86, 88, 90, 92,
94, 96, 98, 100, 102, 104, 106, 108,
110, 112, 114, 116, 119, 122, 125, 128,
131, 134, 137, 140, 143, 146, 149, 152,
155, 158, 161, 164, 167, 170, 173, 177,
181, 185, 189, 193, 197, 201, 205, 209,
213, 217, 221, 225, 229, 234, 239, 245,
249, 254, 259, 264, 269, 274, 279, 284
};
//------------------------------------------------------------------------------
// Paragraph 9.6
void VP8ParseQuant(VP8Decoder* const dec) {
VP8BitReader* const br = &dec->br_;
const int base_q0 = VP8GetValue(br, 7);
const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const VP8SegmentHeader* const hdr = &dec->segment_hdr_;
int i;
for (i = 0; i < NUM_MB_SEGMENTS; ++i) {
int q;
if (hdr->use_segment_) {
q = hdr->quantizer_[i];
if (!hdr->absolute_delta_) {
q += base_q0;
}
} else {
if (i > 0) {
dec->dqm_[i] = dec->dqm_[0];
continue;
} else {
q = base_q0;
}
}
{
VP8QuantMatrix* const m = &dec->dqm_[i];
m->y1_mat_[0] = kDcTable[clip(q + dqy1_dc, 127)];
m->y1_mat_[1] = kAcTable[clip(q + 0, 127)];
m->y2_mat_[0] = kDcTable[clip(q + dqy2_dc, 127)] * 2;
// For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16.
// The smallest precision for that is '(x*6349) >> 12' but 16 is a good
// word size.
m->y2_mat_[1] = (kAcTable[clip(q + dqy2_ac, 127)] * 101581) >> 16;
if (m->y2_mat_[1] < 8) m->y2_mat_[1] = 8;
m->uv_mat_[0] = kDcTable[clip(q + dquv_dc, 117)];
m->uv_mat_[1] = kAcTable[clip(q + dquv_ac, 127)];
m->uv_quant_ = q + dquv_ac; // for dithering strength evaluation
}
}
}
//------------------------------------------------------------------------------
#if defined(__cplusplus) || defined(c_plusplus)
} // extern "C"
#endif
|
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
//
// MainViewController.h
// fawave_mobile
//
// Created by JacksonTian on 12-5-25.
// Copyright __MyCompanyName__ 2012年. All rights reserved.
//
#ifdef CORDOVA_FRAMEWORK
#import <Cordova/CDVViewController.h>
#else
#import "CDVViewController.h"
#endif
@interface MainViewController : CDVViewController
@end
|
#include "../jnc_ct_ControlFlowMgr/jnc_ct_ControlFlowMgr.h"
|
// Prob 1-5
#include <stdio.h>
#include <math.h>
main(){
int x, y;
scanf("%d\n",&x);
scanf("%d",&y);
printf("%d", x+y);
}
|
//
// DBCrashReportsExampleViewController.h
// DBDebugToolkit
//
// Created by Dariusz Bukowski on 05.06.2017.
// Copyright © 2017 Dariusz Bukowski. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DBCrashReportsExampleViewController : UIViewController
@end
|
//
// NSDictionary+ObjectiveSugar.h
// SampleProject
//
// Created by Marin Usalj on 11/23/12.
// Copyright (c) 2012 @supermarin | supermar.in. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDictionary (ObjectiveSugar)
- (void)each:(void (^)(id key, id value))block;
- (void)eachKey:(void (^)(id key))block;
- (void)eachValue:(void (^)(id value))block;
- (NSArray *)map:(id (^)(id key, id value))block;
- (BOOL)hasKey:(id)key;
- (NSDictionary *)pick:(NSArray *)keys;
- (NSDictionary *)omit:(NSArray *)keys;
- (NSDictionary *)merge:(NSDictionary *)dictionary;
- (NSDictionary *)merge:(NSDictionary *)dictionary block:(id(^)(id key, id oldVal, id newVal))block;
- (NSDictionary *)invert;
@end
|
#ifndef RPCCONSOLE_H
#define RPCCONSOLE_H
#include <QDialog>
/* Object for executing console RPC commands in a separate thread.
*/
class RPCExecutor: public QObject
{
Q_OBJECT
public slots:
void start();
void request(const QString &command);
signals:
void reply(int category, const QString &command);
};
namespace Ui {
class RPCConsole;
}
class ClientModel;
/** Local Bitcoin RPC console. */
class RPCConsole: public QDialog
{
Q_OBJECT
public:
explicit RPCConsole(QWidget *parent = 0);
~RPCConsole();
void setClientModel(ClientModel *model);
enum MessageClass {
MC_ERROR,
MC_DEBUG,
CMD_REQUEST,
CMD_REPLY,
CMD_ERROR
};
protected:
// virtual bool eventFilter(QObject* obj, QEvent *event);
private slots:
void on_tabWidget_currentChanged(int index);
/** open the debug.log from the current datadir */
void on_openDebugLogfileButton_clicked();
/** display messagebox with program parameters (same as magi-qt --help) */
void on_showCLOptionsButton_clicked();
public slots:
/** Set number of connections shown in the UI */
void setNumConnections(int count);
/** Set number of blocks shown in the UI */
void setNumBlocks(int count, int countOfPeers);
signals:
// For RPC command executor
void stopExecutor();
void cmdRequest(const QString &command);
private:
Ui::RPCConsole *ui;
ClientModel *clientModel;
QStringList history;
int historyPtr;
void startExecutor();
};
#endif // RPCCONSOLE_H
|
//
// RecruitmentTableViewCell.h
// Noder
//
// Created by alienware on 2017/6/6.
// Copyright © 2017年 Apress. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "JobDataModel.h"
@interface RecruitmentTableViewCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong)UIImageView *topImage;
@property (nonatomic, strong) UIImageView *image_view;
@property (nonatomic, strong) UIWebView *webView;
@property (nonatomic, strong) UIImageView *eyeImageView;
@property (nonatomic, strong) UIImageView *messageIamgeView;
@property (nonatomic, strong) UILabel *watchLabel;
@property (nonatomic, strong) UILabel *messageLabel;
@property (nonatomic, strong) UILabel *durationLabel;//时长
- (void)configWithItem:(JobDataModel *)jobModel;
@end
|
/**
* \file
* \brief Implementation of the necessary initialization for the 4th order (3rd order embedded) Rosenbrock Solver
*
* \author Nicholas Curtis
* \date 03/09/2015
*
*/
#include "rational_approximant.h"
#ifdef GENERATE_DOCS
namespace exprb43 {
#endif
/*!
\fn init_solver_log()
\brief Initializes the Krylov subspace logging files (if LOG_OUTPUT is defined)
@see solver_options.cuh
*/
void init_solver_log() {
#ifdef LOG_OUTPUT
//file for krylov logging
FILE* logFile;
//open and clear
const char* f_name = solver_name();
int len = strlen(f_name);
char out_name[len + 17];
sprintf(out_name, "log/%s-kry-log.txt", f_name);
logFile = fopen(out_name, "w");
char out_reject_name[len + 23];
sprintf(out_reject_name, "log/%s-kry-reject.txt", f_name);
//file for krylov logging
FILE* rFile;
//open and clear
rFile = fopen(out_reject_name, "w");
fclose(logFile);
fclose(rFile);
#endif
}
void solver_log() {}
/*! \fn void initialize_solver(int num_threads)
\brief
\param num_threads Unused
*/
void initialize_solver(int num_threads) {
//Solves for the poles and residuals used for the Rational Approximants in the Krylov subspace methods
find_poles_and_residuals();
}
/*!
\fn char* solver_name()
\brief Returns a descriptive solver name
*/
const char* solver_name() {
const char* name = "exprb43-int";
return name;
}
void cleanup_solver(int num_threads) {
}
#ifdef GENERATE_DOCS
}
#endif |
//
// NFLog.h
// NFBeeController
//
// Created by jiangpengcheng on 11/7/16.
// Copyright © 2016年 ninefivefly. All rights reserved.
//
#ifndef NFLog_h
#define NFLog_h
// Add Log Macro
#define NFLog(FORMAT, ...) NSLog([NSString stringWithFormat:@"[%s:%d]%@", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, FORMAT], ## __VA_ARGS__, nil);
#define LogLevelVerbose 1
#define LogLevelDebug 2
#define LogLevelInfo 3
#define LogLevelError 4
#define LogLevelHigh 5
#ifdef DEBUG
#define LogLevel LogLevelVerbose
#else
#define LogLevel LogLevelHigh
#endif
#if (LogLevel >= LogLevelHigh)
#define NFLogError(FORMAT, ...)
#define NFLogInfo(FORMAT, ...)
#define NFLogDebug(FORMAT, ...)
#define NFLogVerbose(FORMAT, ...)
#elif (LogLevel >= LogLevelError)
#define NFLogError(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogInfo(FORMAT, ...)
#define NFLogDebug(FORMAT, ...)
#define NFLogVerbose(FORMAT, ...)
#elif (LogLevel >= LogLevelInfo)
#define NFLogError(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogInfo(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogDebug(FORMAT, ...)
#define NFLogVerbose(FORMAT, ...)
#elif (LogLevel >= LogLevelDebug)
#define NFLogError(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogInfo(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogDebug(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogVerbose(FORMAT, ...)
#elif (LogLevel >= LogLevelVerbose)
#define NFLogError(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogInfo(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogDebug(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#define NFLogVerbose(FORMAT, ...) NFLog(FORMAT, ##__VA_ARGS__)
#endif
#endif /* NFLog_h */
|
/* --------------------------------------------------------------------------
*
* File SimpleAnimObject.h
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* Created By Nate Burba
* Contact Cocos2dCookbook@gmail.com
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft.
* Copyright (c) 2011 COCOS2D COOKBOOK. 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 __SimpleAnimObject_h__
#define __SimpleAnimObject_h__
class SimpleAnimObject : public CCSprite
{
public :
static SimpleAnimObject* create ( KDvoid );
static SimpleAnimObject* create ( const KDchar* szFilePath );
static SimpleAnimObject* createWithBatchNode ( CCSpriteBatchNode* pBatchNode, const CCRect& tRect );
static SimpleAnimObject* createWithSpriteFrame ( CCSpriteFrame* pSpriteFrame );
static SimpleAnimObject* createWithSpriteFrameName ( const KDchar* szSpriteFrameName );
public :
virtual KDvoid update ( KDfloat fDelta );
virtual CCRect rect ( KDvoid );
virtual KDint getAnimationType ( KDvoid );
virtual KDvoid setAnimationType ( KDint nAnimationType );
virtual const CCPoint& getVelocity ( KDvoid );
virtual KDvoid setVelocity ( const CCPoint& tVelocity );
protected :
KDint m_nAnimationType;
CCPoint m_tVelocity;
};
#endif // __SimpleAnimObject_h__
|
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
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 __APP_DELEGATE_H__
#define __APP_DELEGATE_H__
#include "cocos2d.h"
/**
@brief The cocos2d Application.
Private inheritance here hides part of interface from Director.
*/
class AppDelegate : private cocos2d::Application
{
public:
AppDelegate();
virtual ~AppDelegate();
virtual void initGLContextAttrs();
/**
@brief Implement Director and Scene init code here.
@return true Initialize success, app continue.
@return false Initialize failed, app terminate.
*/
virtual bool applicationDidFinishLaunching();
/**
@brief Called when the application moves to the background
@param the pointer of the application
*/
virtual void applicationDidEnterBackground();
/**
@brief Called when the application reenters the foreground
@param the pointer of the application
*/
virtual void applicationWillEnterForeground();
};
#endif // __APP_DELEGATE_H__
|
/*
----- kmain.c -----
Description..: Kernel main. The first function called after
the bootloader. Initialization of hardware, system
structures, devices, and initial processes happens here.
*/
#include <stdint.h>
#include <string.h>
#include <system.h>
#include <core/io.h>
#include <core/serial.h>
#include <core/tables.h>
#include <core/interrupts.h>
#include <core/queue.h>
#include <core/comHandler.h>
#include <mem/heap.h>
#include <mem/paging.h>
#include <mem/memoryControl.h>
#include <modules/mpx_supt.h>
void kmain(void) {
extern uint32_t magic;
// Uncomment if you want to access the multiboot header
// extern void *mbd;
// char *boot_loader_name = (char*)((long*)mbd)[16];
// Set up the heap.
initializeHeap(500000);
sys_set_malloc(allocateMemory);
sys_set_free(deallocateMemory);
// 0) Initialize Serial I/O and call mpx_init
init_serial(COM1);
set_serial_in(COM1);
set_serial_out(COM1);
mpx_init(MODULE_R5);
klogv("Starting MPX boot sequence...");
klogv("Initialized serial I/O on COM1 device...");
// 1) Check that the boot was successful and correct when using grub
// Comment this when booting the kernel directly using QEMU, etc.
if (magic != 0x2BADB002) {
//kpanic("Boot was not error free. Halting.");
}
// 2) Descriptor Tables
klogv("Initializing descriptor tables...");
init_idt(); // Initialize the interrupt descriptor table
init_gdt(); // Initialize the global descriptor table
init_irq(); // Initialize the interrupt handlers
sti(); // Enable interrupts
// 4) Virtual Memory
klogv("Initializing virtual memory...");
init_paging();
// 5) Call Commhand
klogv("Transferring control to commhand...");
// Create the process for the command handler
pcb *commHand = setupPCB("CommandHandler", 1, 1);
context *commHandCp = (context *)(commHand->stackTop);
memset(commHandCp, 0, sizeof(struct context));
commHandCp->fs = 0x10;
commHandCp->gs = 0x10;
commHandCp->ds = 0x10;
commHandCp->es = 0x10;
commHandCp->cs = 0x8;
commHandCp->ebp = (u32int)(commHand->stackBottom);
commHandCp->esp = (u32int)(commHand->stackTop);
commHandCp->eip = (u32int) initCommandHandler;
commHandCp->eflags = 0x202;
// Create the process for the idle process
pcb *idleProc = setupPCB("Idle", 0, 0);
context *idleCp = (context *)(idleProc->stackTop);
memset(idleCp, 0, sizeof(struct context));
idleCp->fs = 0x10;
idleCp->gs = 0x10;
idleCp->ds = 0x10;
idleCp->es = 0x10;
idleCp->cs = 0x8;
idleCp->ebp = (u32int)(idleProc->stackBottom);
idleCp->esp = (u32int)(idleProc->stackTop);
idleCp->eip = (u32int) idle;
idleCp->eflags = 0x202;
// Inserts the processes into the queue
insertPCB(commHand);
insertPCB(idleProc);
// Triggers software interrupt to start process dispatching
asm volatile("int $60");
// 11) System Shutdown
klogv("Starting system shutdown procedure...");
/* Shutdown Procedure */
klogv("Shutdown complete. You may now turn off the machine. (QEMU: CTRL+a then x)");
hlt();
}
|
#ifndef IMAGE_H
#define IMAGE_H
#include "math/vec2.h"
#include "math/vec4.h"
#include "common/shared.h"
#include <vector>
class ShaderProgram;
class RenderState;
class Image : public Shared
{
public:
typedef SharedPtr< Image > Ptr;
Image( int width, int height, int channels, void *data );
uchar4 get( int x, int y );
uchar4 get( int2 p ) { return get( p.x, p.y ); }
int width() const { return m_width; }
int height() const { return m_height; }
int channels() const { return m_channels; }
private:
int m_channels;
int m_width;
int m_height;
std::vector< unsigned char > m_data;
};
#endif // IMAGE_H
|
#ifndef LOG_MANAGER_IMPLEMENTATION_H
#define LOG_MANAGER_IMPLEMENTATION_H
#include <memory>
#include <mutex>
#include <vector>
#include "utility/logging/Logger.h"
class LogManagerImplementation
{
public:
LogManagerImplementation();
// Must be implemented because std::mutex is non-copyable, see
// http://stackoverflow.com/questions/14263836/why-does-stdmutex-create-a-c2248-when-used-in-a-struct-with-windows-socket
// for more details
LogManagerImplementation(const LogManagerImplementation& other);
void operator=(const LogManagerImplementation& other);
~LogManagerImplementation();
void addLogger(std::shared_ptr<Logger> logger);
void removeLogger(std::shared_ptr<Logger> logger);
void removeLoggersByType(const std::string& type);
int getLoggerCount() const;
void logInfo(
const std::string& message,
const std::string& file,
const std::string& function,
const unsigned int line
);
void logWarning(
const std::string& message,
const std::string& file,
const std::string& function,
const unsigned int line
);
void logError(
const std::string& message,
const std::string& file,
const std::string& function,
const unsigned int line
);
private:
tm getTime();
std::vector<std::shared_ptr<Logger> > m_loggers;
mutable std::mutex m_loggerMutex;
};
#endif // LOG_MANAGER_IMPLEMENTATION_H
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <Message/MFAuthScheme.h>
@interface MFCRAM_MD5AuthScheme : MFAuthScheme
{
}
- (_Bool)canAuthenticateAccountClass:(Class)arg1 connection:(id)arg2;
- (_Bool)hasEncryption;
- (_Bool)sendsPlainTextPasswords;
- (id)humanReadableName;
- (id)name;
- (Class)authenticatorClass;
@end
|
#ifndef _ALVISION_VEC_INT_H_
#define _ALVISION_VEC_INT_H_
#include "../../alvision.h"
namespace VecIntInit {
void Register(Handle<Object> target, std::shared_ptr<overload_resolution> overload);
void Init(Handle<Object> target, std::shared_ptr<overload_resolution> overload);
}
#endif |
/*
* c-periphery
* https://github.com/vsergeev/c-periphery
* License: MIT
*/
#include <stddef.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "mmio.h"
struct mmio_handle {
uintptr_t base, aligned_base;
size_t size, aligned_size;
void *ptr;
struct {
int c_errno;
char errmsg[96];
} error;
};
static int _mmio_error(mmio_t *mmio, int code, int c_errno, const char *fmt, ...) {
va_list ap;
mmio->error.c_errno = c_errno;
va_start(ap, fmt);
vsnprintf(mmio->error.errmsg, sizeof(mmio->error.errmsg), fmt, ap);
va_end(ap);
/* Tack on strerror() and errno */
if (c_errno) {
char buf[64];
strerror_r(c_errno, buf, sizeof(buf));
snprintf(mmio->error.errmsg+strlen(mmio->error.errmsg), sizeof(mmio->error.errmsg)-strlen(mmio->error.errmsg), ": %s [errno %d]", buf, c_errno);
}
return code;
}
mmio_t *mmio_new(void) {
return calloc(1, sizeof(mmio_t));
}
void mmio_free(mmio_t *mmio) {
free(mmio);
}
int mmio_open(mmio_t *mmio, uintptr_t base, size_t size) {
return mmio_open_advanced(mmio, base, size, "/dev/mem");
}
int mmio_open_advanced(mmio_t *mmio, uintptr_t base, size_t size, const char *path) {
int fd;
memset(mmio, 0, sizeof(mmio_t));
mmio->base = base;
mmio->size = size;
mmio->aligned_base = mmio->base - (mmio->base % sysconf(_SC_PAGESIZE));
mmio->aligned_size = mmio->size + (mmio->base - mmio->aligned_base);
/* Open memory */
if ((fd = open(path, O_RDWR | O_SYNC)) < 0)
return _mmio_error(mmio, MMIO_ERROR_OPEN, errno, "Opening %s", path);
/* Map memory */
if ((mmio->ptr = mmap(0, mmio->aligned_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, mmio->aligned_base)) == MAP_FAILED) {
int errsv = errno;
close(fd);
return _mmio_error(mmio, MMIO_ERROR_OPEN, errsv, "Mapping memory");
}
/* Close memory */
if (close(fd) < 0) {
int errsv = errno;
munmap(mmio->ptr, mmio->aligned_size);
mmio->ptr = 0;
return _mmio_error(mmio, MMIO_ERROR_OPEN, errsv, "Closing %s", path);
}
return 0;
}
void *mmio_ptr(mmio_t *mmio) {
return (void *)((uint8_t *)mmio->ptr + (mmio->base - mmio->aligned_base));
}
/* WARNING: These functions may trigger a bus fault on some CPUs if an
* unaligned address is accessed! */
int mmio_read32(mmio_t *mmio, uintptr_t offset, uint32_t *value) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+4) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
*value = *(volatile uint32_t *)(((volatile uint8_t *)mmio->ptr) + offset);
return 0;
}
int mmio_read16(mmio_t *mmio, uintptr_t offset, uint16_t *value) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+2) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
*value = *(volatile uint16_t *)(((volatile uint8_t *)mmio->ptr) + offset);
return 0;
}
int mmio_read8(mmio_t *mmio, uintptr_t offset, uint8_t *value) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+1) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
*value = *(volatile uint8_t *)(((volatile uint8_t *)mmio->ptr) + offset);
return 0;
}
int mmio_read(mmio_t *mmio, uintptr_t offset, uint8_t *buf, size_t len) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+len) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
memcpy((void *)buf, (const void *)(((volatile uint8_t *)mmio->ptr) + offset), len);
return 0;
}
int mmio_write32(mmio_t *mmio, uintptr_t offset, uint32_t value) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+4) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
*(volatile uint32_t *)(((volatile uint8_t *)mmio->ptr) + offset) = value;
return 0;
}
int mmio_write16(mmio_t *mmio, uintptr_t offset, uint16_t value) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+2) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
*(volatile uint16_t *)(((volatile uint8_t *)mmio->ptr) + offset) = value;
return 0;
}
int mmio_write8(mmio_t *mmio, uintptr_t offset, uint8_t value) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+1) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
*(volatile uint8_t *)(((volatile uint8_t *)mmio->ptr) + offset) = value;
return 0;
}
int mmio_write(mmio_t *mmio, uintptr_t offset, const uint8_t *buf, size_t len) {
offset += (mmio->base - mmio->aligned_base);
if ((offset+len) > mmio->aligned_size)
return _mmio_error(mmio, MMIO_ERROR_ARG, 0, "Offset out of bounds");
memcpy((void *)(((volatile uint8_t *)mmio->ptr) + offset), (const void *)buf, len);
return 0;
}
int mmio_close(mmio_t *mmio) {
if (!mmio->ptr)
return 0;
/* Unmap memory */
if (munmap(mmio->ptr, mmio->aligned_size) < 0)
return _mmio_error(mmio, MMIO_ERROR_CLOSE, errno, "Unmapping memory");
mmio->ptr = 0;
return 0;
}
int mmio_tostring(mmio_t *mmio, char *str, size_t len) {
return snprintf(str, len, "MMIO 0x%08zx (ptr=%p, size=%zu)", mmio->base, mmio->ptr, mmio->size);
}
const char *mmio_errmsg(mmio_t *mmio) {
return mmio->error.errmsg;
}
int mmio_errno(mmio_t *mmio) {
return mmio->error.c_errno;
}
uintptr_t mmio_base(mmio_t *mmio) {
return mmio->base;
}
size_t mmio_size(mmio_t *mmio) {
return mmio->size;
}
|
#ifndef __MEMORY_POOL_H__
#define __MEMORY_POOL_H__
#include <iostream>
#include <stdint.h>
const int MEMORY_UNIT_SIZE = 8 * 1024 * 1024;
/*************************************************************************************************
* ÀàÃû£ºCMemoryPool
* ¹¦ÄÜ£ºÄÚ´æ³Ø»ù±¾µ¥ÔªÄ£¿é£¬ÓÃÓÚÒµÎñͳ¼ÆÊý¾ÝµÄ»º´æ
* ***********************************************************************************************/
class CMemoryPool
{
public:
CMemoryPool():m_iFreeSize(0), m_iCapacity(0),m_pszHead(NULL),m_pszFree(NULL),m_bFree(false)
{
}
CMemoryPool(int iSize):m_iFreeSize(0), m_iCapacity(0),m_pszHead(NULL),m_pszFree(NULL),m_bFree(false)
{
SetMemoryPoolSize(iSize);
}
~CMemoryPool()
{
DestroyMemoryPool();
}
/******************************************************************************************
* º¯Êý£ºFree
* ¹¦ÄÜ£ºÅжϸÃÄÚ´æ³Øµ¥ÔªÊÇ·ñÈÔÓпÕÏпռä¿ÉÓÃ
* ²ÎÊý£ºÎÞ
* ·µ»ØÖµ£ºtrue ±íʾÈÔÓпռä¿ÉÓã¬false±íʾ¸ÃÄÚ´æ³Øµ¥Ôª¿Õ¼äÒÑÂú
* ****************************************************************************************/
bool Free()const
{
return m_bFree;
}
/*****************************************************************************************
* º¯Êý£ºSetFree
* ¹¦ÄÜ£ºÉèÖÃÄÚ´æ³Øµ¥ÔªµÄ¿ÉÓÃ״̬
* ²ÎÊý£º
* ÊäÈë²ÎÊý bFree : false ²»×ö²Ù×÷£¬true ±íÊ¾ÖØÖøÃÄÚ´æ³Øµ¥ÔªÎª¿Õ
* ·µ»ØÖµ£ºÎÞ
*******************************************************************************************/
void SetFree(bool bFree)
{
if(m_bFree == true)
{
m_iFreeSize = m_iCapacity;
m_pszFree = m_pszHead;
}
m_bFree = bFree;
}
/*****************************************************************************************
* º¯Êý£ºAddElement
* ¹¦ÄÜ£ºÍùÄÚ´æ³ØÖÐдÈë´óСΪiLenµÄÊý¾Ý¿épszElement
* ²ÎÊý£º
* ÊäÈë²ÎÊý pszElement : ±íʾ´ýдÈëµÄÊý¾ÝÖ¸Õë
* iLen : ±íʾ´ýдÈëµÄÊý¾Ý³¤¶È
* ·µ»ØÖµ£º·µ»ØÊý¾ÝдÈëºóÔÚÄÚ´æ³Øµ¥ÔªÖÐµÄÆðʼָÕ룬Èô¸ÃÄÚ´æ³Øµ¥Ôª¿Õ¼ä²»¹»£¬Ôò·µ»ØNULL
* ****************************************************************************************/
const char * AddElement(const char *pszElement, int iLen)
{
if(iLen < m_iFreeSize && pszElement != NULL)
{
const char *pszElementHead = m_pszFree;
memcpy((void *)pszElementHead, (const void *)pszElement, iLen);
m_pszFree += iLen;
*m_pszFree = '\0';
m_pszFree += 1;
m_iFreeSize -= (iLen + 1);
return pszElementHead;
}
else
return NULL;
}
/*****************************************************************************************
* º¯Êý£ºDestroyMemory
* ¹¦ÄÜ£ºÇå³ý¸ÃÄÚ´æ³Øµ¥ÔªµÄÄÚ´æ¿Õ¼ä
* ²ÎÊý£º ÎÞ
* ·µ»ØÖµ£ºÎÞ
* ***************************************************************************************/
void DestroyMemoryPool()
{
if(m_pszHead != NULL)
{
delete [] m_pszHead;
m_pszHead = NULL;
}
}
/****************************************************************************************
* º¯Êý£ºSetMemoryPoolSize
* ¹¦ÄÜ£º³õʼ»¯ÉèÖÃÄÚ´æ³Øµ¥Ôª´óС£¬²¢¿ª±ÙÄÚ´æ¿Õ¼ä
* ²ÎÊý£º
* ÊäÈë²ÎÊý iSize : ÄÚ´æ³Øµ¥Ôª´óС
* ·µ»ØÖµ£ºtrue±íʾÉèÖóɹ¦£¬false±íʾÉèÖÃʧ°Ü
* *************************************************************************************/
bool SetMemoryPoolSize(int iSize)
{
try
{
if(m_pszHead == NULL)
{
m_bFree = true;
m_iCapacity = iSize;
m_iFreeSize = iSize;
m_pszHead = new char[iSize];
m_pszFree = m_pszHead;
return true;
}
else
return false;
}
catch(...)
{
return false;
}
}
private:
int m_iFreeSize;
int m_iCapacity;
char *m_pszHead;
char *m_pszFree;
bool m_bFree;
};
#endif
|
// ext/factory_elf/struct_toy.h
//////////////////////////////////////////////////////////////////////////////////////////////////
//
// Declarations of OO-style functions for manipulating Toy structs
//
#ifndef STRUCT_TOY_H
#define STRUCT_TOY_H
#include <ruby.h>
#include "narray.h"
typedef struct _toy_raw {
int toy_id;
int abs_mins;
int size;
} Toy;
Toy *toy__create();
void toy__destroy( Toy *toy );
void toy__read_item( Toy *toy, int *ptr, int id );
#endif
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2012 Litecoin 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 ? 45902 : 55900;
}
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
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
};
/** 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;
};
#endif // __INCLUDED_PROTOCOL_H__
|
//------------------------------------------------------------------------------
// Copyright 2010-2017 by Jyh-Ming Lien and George Mason University
// See the file "LICENSE" for more information
//------------------------------------------------------------------------------
#pragma once
#ifndef _MATHTOOL_UTILITY
#define _MATHTOOL_UTILITY
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <iostream> // define C++ stream I/O routines
#include <iomanip>
using namespace std;
namespace mathtool{
//data type
#define REAL double
/* range of real numbers */
#define SMALLNUMBER 1.0e-10
#define HUGENUMBER 1.0e10
/* Miscellaneous Scalar Math */
#define abs(x) (((x) < 0) ? (-(x)) : (x))
#define sqr(x) ((x) * (x))
inline int round( REAL x, REAL p){
return (long int)(((long int)((x)*pow(10.0,p)+((x)<0?-0.5:0.5)))/pow(10.0,p));
}
inline int round( REAL v ){
int integer=(int)floor((long int)(v));
REAL fraction=v-integer;
if(v>0)
return (fraction>=0.5)?integer+1:integer;
else
return (fraction>=-0.5)?integer:integer+1;
}
#define sign(x) ((x)>=0? 1: -1)
#define applysign(x, y) ((y) >= 0? abs(x): -abs(x))
/* Angle Conversions & Constants */
#ifndef PI
#define PI ((REAL)3.1415926535897)
#endif
#ifndef PI2
#define PI2 ((REAL)6.2831853071794)
#endif
#define RAD2DEG (180/PI)
#define DEG2RAD (PI/180)
#define DegToRad(x) ((x)*DEG2RAD)
#define RadToDeg(x) ((x)*RAD2DEG)
/*
computes sqrt(a^2 + b^2) without destructive underflow or overflow
*/
REAL pythag(REAL a, REAL b);
/*
Utility Error message routines
*/
// print s to stdout with trailing blank and no terminating end of line
void prompt(char *s);
// print s1, s2, s3 to stdout as blank separated fields with terminating eol
void message(char *s1, char *s2 = NULL, char *s3 = NULL);
// print Status: to stdout followed by message(s1, s2, s3)
void status(char *s1, char *s2 = NULL, char *s3 = NULL);
// print Error: followed by s1, s2 and s3 to stderr as blank separated fields
// with terminating eol
void error(char *s1, char *s2 = NULL, char *s3 = NULL);
// print error(s1, s2, s3) and then exit program with code 1
void abort(char *s1, char *s2 = NULL, char *s3 = NULL);
#ifdef _WIN32
////////////////////////////////////////////////////////////////////////////////////////
// Following functions define M_PI and drand48, which are not starndard c library and
// definitions. In addition, rint used to round off float points to int is also here.
/////////////////////////////////////////////////////////////////////////////////////////
#define M_PI 3.1415926 //reference PI above
extern "C" {
//Implementation of these functions are located in util.cpp
REAL drand48();
REAL erand48(register unsigned short *xsubi);
long irand48(register unsigned short m);
long krand48(register unsigned short *xsubi, unsigned short m);
long lrand48();
long mrand48();
static void next();
void srand48(long seedval);
unsigned short * seed48(unsigned short seed16v[3]);
void lcong48(unsigned short param[7]);
long nrand48(register unsigned short *xsubi);
long jrand48(register unsigned short *xsubi);
/**Round to closest integer.
*The rint() function rounds x to an integer value according
*to the prevalent rounding mode. The default rounding mode
*is to round to the nearest integer.
*@return The rint() function returns the integer value as a float-
*ing-point number.
*/
REAL rint(REAL x);
} //end extern "C"
#endif //_WIN32
} //end of namespace
#endif //_MATHTOOL_UTILITY
|
/**
* @file
* @author Dirk Fortmeier
* @date 16.11.2009
*/
#ifndef _GAME_STATE_MAINMENU_H_
#define _GAME_STATE_MAINMENU_H_
#include "YGEGameState.h"
#include "GameManager.h"
#include "YGESpace.h"
#include "YGEKeyDownListener.h"
#include "YGEKeyUpListener.h"
#include "YGEText.h"
#include "GameManager.h"
#include "GameGyrocopter.h"
#include "Camera.h"
#include "Menu.h"
/**
* @brief class managing the main menu
*/
class GameStateMainmenu : public YGEGame::YGEGameState, public YGEInput::YGEKeyDownListener{
private:
GameGyrocopter* gyro;
YGETimeSpace::YGEObserver* observer;
YGETimeSpace::YGEObserver* observerText;
YGETimeSpace::YGESpace* backgroundspace;
YGETimeSpace::YGESpace* textspace;
Menu* mainMenu;
Menu* optionsMenu;
Menu* levelMenu;
Menu* activeMenu;
YGETimeSpace::YGEEntity* optionsmenuEntity;
YGEAudio::YGESoundAsset* menuSound;
public:
GameStateMainmenu();
void update(long delta);
void keyDown(SDLKey key);
virtual void processCommand(const char* command) ;
};
#endif
|
//
// AppDelegate.h
// YueDongQuan
//
// Created by 陈良静 on 2017/3/7.
// Copyright © 2017年 陈良静. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* WARNING: do not edit!
* Generated by util/mkbuildinf.pl
*
* Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#define PLATFORM "platform: darwin64-x86_64-cc"
#define DATE "built on: Tue Dec 15 03:59:11 2020 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a
* workaround for the situation where CFLAGS gets too long for a C90 string
* literal
*/
static const char compiler_flags[] = {
'c','o','m','p','i','l','e','r',':',' ','g','c','c',' ','-','f',
'P','I','C',' ','-','a','r','c','h',' ','x','8','6','_','6','4',
' ','-','W','a',',','-','-','n','o','e','x','e','c','s','t','a',
'c','k',' ','-','O','3',' ','-','W','a','l','l',' ','-','D','L',
'_','E','N','D','I','A','N',' ','-','D','O','P','E','N','S','S',
'L','_','P','I','C',' ','-','D','O','P','E','N','S','S','L','_',
'C','P','U','I','D','_','O','B','J',' ','-','D','O','P','E','N',
'S','S','L','_','I','A','3','2','_','S','S','E','2',' ','-','D',
'O','P','E','N','S','S','L','_','B','N','_','A','S','M','_','M',
'O','N','T',' ','-','D','O','P','E','N','S','S','L','_','B','N',
'_','A','S','M','_','M','O','N','T','5',' ','-','D','O','P','E',
'N','S','S','L','_','B','N','_','A','S','M','_','G','F','2','m',
' ','-','D','S','H','A','1','_','A','S','M',' ','-','D','S','H',
'A','2','5','6','_','A','S','M',' ','-','D','S','H','A','5','1',
'2','_','A','S','M',' ','-','D','K','E','C','C','A','K','1','6',
'0','0','_','A','S','M',' ','-','D','R','C','4','_','A','S','M',
' ','-','D','M','D','5','_','A','S','M',' ','-','D','A','E','S',
'N','I','_','A','S','M',' ','-','D','V','P','A','E','S','_','A',
'S','M',' ','-','D','G','H','A','S','H','_','A','S','M',' ','-',
'D','E','C','P','_','N','I','S','T','Z','2','5','6','_','A','S',
'M',' ','-','D','X','2','5','5','1','9','_','A','S','M',' ','-',
'D','P','O','L','Y','1','3','0','5','_','A','S','M',' ','-','D',
'_','R','E','E','N','T','R','A','N','T',' ','-','D','N','D','E',
'B','U','G','\0'
};
|
//
// AppDelegate.h
// JenkinsTest
//
// Created by Pablo on 17/09/14.
// Copyright (c) 2014 Pablo Rueda. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@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"
#import <DVTKit/DVTPlistPopupCell.h>
@class NSString;
@interface DVTPlistTitledPopupCell : DVTPlistPopupCell
{
NSString *plistTitle;
}
@property(copy) NSString *plistTitle; // @synthesize plistTitle;
- (BOOL)pullsDown;
- (struct CGRect)drawTitle:(id)arg1 withFrame:(struct CGRect)arg2 inView:(id)arg3;
- (id)copyWithZone:(struct _NSZone *)arg1;
@end
|
/* Generated by Interface Builder */
#import <AppKit/NSWindow.h>
namespace Executor {
extern void ROMlib_dummywincall( void );
}
@interface MacWindow : NSWindow
- (BOOL)commandKey:(NSEvent *)theEvent;
@end
|
// Copyright 2014 Vladimir Alyamkin. All Rights Reserved.
#include "SeaCraftUserSettings.generated.h"
UCLASS()
class USeaCraftUserSettings : public UGameUserSettings
{
GENERATED_UCLASS_BODY()
/** Applies all current user settings to the game and saves to permanent storage (e.g. file), optionally checking for command line overrides. */
virtual void ApplySettings(bool bCheckForCommandLineOverrides) override;
int32 GetGraphicsQuality() const
{
return GraphicsQuality;
}
void SetGraphicsQuality(int32 InGraphicsQuality)
{
GraphicsQuality = InGraphicsQuality;
}
/** Gets current fullscreen mode */
EWindowMode::Type GetCurrentFullscreenMode() const;
/** Interface UGameUserSettings */
virtual void SetToDefaults() override;
/** Changes to CUSTOM low quality graphics */
void SetLowQuality();
/** Changes to CUSTOM mid quality graphics */
void SetMidQuality();
/** Changes to CUSTOM high quality graphics */
void SetHighQuality();
private:
/**
* Graphics Quality
* 0 = Low
* 1 = Mid
* 2 = High
* 3 = Ultra
*/
UPROPERTY(config)
int32 GraphicsQuality;
};
|
/*
* Copyright 2012 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Data object to specify the minimum and maximum number of rows and columns for a PDF417 barcode.
*/
#import <UIKit/UIKit.h>
@interface ZXPDF417Dimensions : NSObject
@property (nonatomic, assign, readonly) int minCols;
@property (nonatomic, assign, readonly) int maxCols;
@property (nonatomic, assign, readonly) int minRows;
@property (nonatomic, assign, readonly) int maxRows;
- (id)initWithMinCols:(int)minCols maxCols:(int)maxCols minRows:(int)minRows maxRows:(int)maxRows;
@end
|
/* mz_strm_zlib.h -- Stream for zlib inflate/deflate
Version 2.8.7, May 9, 2019
part of the MiniZip project
Copyright (C) 2010-2019 Nathan Moinvaziri
https://github.com/nmoinvaz/minizip
This program is distributed under the terms of the same license as zlib.
See the accompanying LICENSE file for the full text of the license.
*/
#ifndef MZ_STREAM_ZLIB_H
#define MZ_STREAM_ZLIB_H
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************************************/
int32_t mz_stream_zlib_open(void *stream, const char *filename, int32_t mode);
int32_t mz_stream_zlib_is_open(void *stream);
int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size);
int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size);
int64_t mz_stream_zlib_tell(void *stream);
int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin);
int32_t mz_stream_zlib_close(void *stream);
int32_t mz_stream_zlib_error(void *stream);
int32_t mz_stream_zlib_get_prop_int64(void *stream, int32_t prop, int64_t *value);
int32_t mz_stream_zlib_set_prop_int64(void *stream, int32_t prop, int64_t value);
void* mz_stream_zlib_create(void **stream);
void mz_stream_zlib_delete(void **stream);
void* mz_stream_zlib_get_interface(void);
/***************************************************************************/
#ifdef __cplusplus
}
#endif
#endif
|
//
// The MIT License(MIT)
//
// Copyright(c) 2014 Demonsaw LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#ifndef _EJA_GROUP_CIPHER_
#define _EJA_GROUP_CIPHER_
#include <string>
#include "object/cipher.h"
#include "system/type.h"
namespace eja
{
class group_cipher : public cipher
{
protected:
std::string m_data;
public:
using ptr = std::shared_ptr<group_cipher>;
public:
group_cipher() : cipher() { }
group_cipher(const eja::group_cipher& cipher) : eja::cipher(cipher), m_data(cipher.m_data) { }
group_cipher(const size_t size) : cipher(size) { }
group_cipher(const std::string& id) : cipher(id) { }
group_cipher(const char* id) : cipher(id) { }
virtual ~group_cipher() override { }
// Utility
bool has_data() const { return !m_data.empty(); }
// Mutator
void set_data(const std::string& data) { m_data = data; }
void set_data(const char* data) { m_data = data; }
void set_data() { m_data.clear(); }
// Accessor
const std::string& get_data() const { return m_data; }
// Static
static ptr create() { return std::make_shared<group_cipher>(); }
static ptr create(const eja::group_cipher& group_cipher) { return std::make_shared<eja::group_cipher>(group_cipher); }
static ptr create(const group_cipher::ptr group_cipher) { return std::make_shared<eja::group_cipher>(*group_cipher); }
static ptr create(const std::string& id) { return std::make_shared<group_cipher>(id); }
static ptr create(const char* id) { return std::make_shared<group_cipher>(id); }
};
}
#endif
|
//
// GTMReader-Bridging-Header.h
// GTMReader
//
// Created by Jacob Henning Rothschild on 22/05/2015.
// Copyright (c) 2015 Jacob Henning Rothschild. All rights reserved.
//
#import <GoogleTagManager/TAGManager.h>
#import <GoogleTagManager/TAGContainer.h>
#import <GoogleTagManager/TAGContainerOpener.h> |
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <UIKit/UIImage.h>
@interface UIImage (_UIBackdropViewSettings)
- (id)_applyBackdropViewStyle:(long long)arg1 includeTints:(_Bool)arg2 includeBlur:(_Bool)arg3 graphicsQuality:(long long)arg4 allowImageResizing:(_Bool)arg5;
- (id)_applyBackdropViewStyle:(long long)arg1 includeTints:(_Bool)arg2 includeBlur:(_Bool)arg3 graphicsQuality:(long long)arg4;
- (id)_applyBackdropViewStyle:(long long)arg1 includeTints:(_Bool)arg2 includeBlur:(_Bool)arg3;
- (id)_applyBackdropViewSettings:(id)arg1 includeTints:(_Bool)arg2 includeBlur:(_Bool)arg3 allowImageResizing:(_Bool)arg4;
- (id)_applyBackdropViewSettings:(id)arg1 includeTints:(_Bool)arg2 includeBlur:(_Bool)arg3;
- (id)_applyBackdropViewSettings:(id)arg1;
- (id)_applyBackdropViewSettings:(id)arg1 allowImageResizing:(_Bool)arg2;
@end
|
//
// TWLEncoderTask_private.h
// Broadcast Encoder
//
// Created by Christopher Kalafarski on 3/12/14.
// Copyright (c) 2014 PRX. All rights reserved.
//
#import "TWLEncoderTask.h"
@class TWLEncoder;
@interface TWLEncoderTask ()
@property (nonatomic, strong, readonly) TWLEncoder *encoder;
@property (nonatomic, strong, readonly) NSURL *URL;
@property (readonly, getter = isCanceled) BOOL canceled;
/* Private Initializers */
/* neither url nor encoder can be nil */
- (instancetype)initWithURL:(NSURL *)url encoder:(TWLEncoder *)encoder delegate:(id<TWLEncoderTaskDelegate>)delegate;
/* Delegate Notification */
- (void)didCompleteWithError:(NSError *)error;
@end
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Runtime\Implementation\Internal\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#ifndef __APP_UNO_RUNTIME_IMPLEMENTATION_INTERNAL_ARRAY_ENUMERABLE__UNO_EXCEPTION_H__
#define __APP_UNO_RUNTIME_IMPLEMENTATION_INTERNAL_ARRAY_ENUMERABLE__UNO_EXCEPTION_H__
#include <app/Uno.Collections.IEnumerable__Uno_Exception.h>
#include <app/Uno.Object.h>
#include <Uno.h>
namespace app { namespace Uno { struct Exception; } }
namespace app {
namespace Uno {
namespace Runtime {
namespace Implementation {
namespace Internal {
struct ArrayEnumerable__Uno_Exception;
struct ArrayEnumerable__Uno_Exception__uType : ::uClassType
{
::app::Uno::Collections::IEnumerable__Uno_Exception __interface_0;
};
ArrayEnumerable__Uno_Exception__uType* ArrayEnumerable__Uno_Exception__typeof();
void ArrayEnumerable__Uno_Exception___ObjInit(ArrayEnumerable__Uno_Exception* __this, ::uArray* source);
::uObject* ArrayEnumerable__Uno_Exception__GetEnumerator(ArrayEnumerable__Uno_Exception* __this);
ArrayEnumerable__Uno_Exception* ArrayEnumerable__Uno_Exception__New_1(::uStatic* __this, ::uArray* source);
struct ArrayEnumerable__Uno_Exception : ::uObject
{
::uStrong< ::uArray*> _source;
void _ObjInit(::uArray* source) { ArrayEnumerable__Uno_Exception___ObjInit(this, source); }
::uObject* GetEnumerator() { return ArrayEnumerable__Uno_Exception__GetEnumerator(this); }
};
}}}}}
#endif
|
//
// CULeg.h
// CU Transit
//
// Copyright (c) 2012 Sukolsak Sakshuwong. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
typedef enum {
CULegTypeWalk,
CULegTypeService,
CULegTypeUnknown
} CULegType;
@class CUWalk;
@interface CULeg : NSObject <MKAnnotation> {
CULegType type;
CUWalk *walk;
NSArray *services;
// internal use, for displaying in table
NSString *text;
CGFloat rowHeight;
}
- (id)initWithDictionary:(id)dic;
- (CLLocationCoordinate2D)beginCoordinate;
- (CLLocationCoordinate2D)endCoordinate;
- (CLLocationCoordinate2D)coordinate;
@property (nonatomic) CULegType type;
@property (nonatomic, retain) CUWalk *walk;
@property (nonatomic, retain) NSArray *services;
@property (nonatomic, retain) NSString *text;
@property (nonatomic) CGFloat rowHeight;
@end
|
#ifndef TEXTURE_H
#define TEXTURE_H
#include "CA_Export.h"
#include "IO\IFile.h"
#include <bgfx/bgfx.h>
#include <map>
namespace CasaEngine
{
/**
*
*/
class CA_EXPORT Texture
{
public:
/**
*
*/
static Texture* loadTexture(IFile* pFile, uint32_t _flags = BGFX_TEXTURE_NONE, uint8_t _skip = 0);
/**
*
*/
static Texture* createTexture(const unsigned int width_, const unsigned int height_, const bgfx::TextureFormat::Enum format_,
const bgfx::Memory* pData_, const unsigned long flags_ = BGFX_TEXTURE_NONE, bgfx::TextureInfo* info_ = nullptr);
private:
static std::map<std::string, Texture*> _textureCache;
public:
/**
*
*/
Texture(bgfx::TextureHandle handle_, bgfx::TextureInfo* info_ = nullptr);
/**
*
*/
virtual ~Texture();
/**
*
*/
bgfx::TextureHandle Handle() const;
/**
*
*/
bgfx::TextureInfo* TextureInfo() const;
private:
bgfx::TextureInfo* m_pTextureInfo;
bgfx::TextureHandle m_Handle;
};
}
#endif
|
/*
* file ConsoleInterface.h
*
* author luoxw
* date 2018/01/01
*
*
*/
#pragma once
namespace LostCore
{
class IConsole
{
public:
IConsole();
virtual ~IConsole();
virtual vector<string> GetPageNames() const = 0;
virtual void Refresh() = 0;
virtual void Record() = 0;
virtual void DisplayPage(const string& name) = 0;
public:
static vector<string> GetConsoleNames();
static void DisplayConsole(const string& name);
static void HideAll();
static void RefreshConsole();
static void RecordConsole();
static void AddConsole(IConsole* console);
static void DelConsole(IConsole* console);
static void Clear();
static vector<IConsole*> SConsoles;
static string SInvalid;
};
}
|
// Timer.h
// Three implementations of a Timer class separated by #ifdefs
#pragma once
#define PRINT_TIMING_INFORMATION
#ifdef _WIN32
// Thank you http://www.mindcontrol.org/~hplus/misc/simple-timer.html
# define WINDOWS_LEAN_AND_MEAN
# define NOMINMAX
# include <windows.h>
/// Create a Timer, which will immediately begin counting
/// up from 0.0 seconds.
/// You can call reset() to make it start over.
class Timer {
public:
Timer() {
reset();
}
/// reset() makes the timer start over counting from 0.0 seconds.
void reset() {
unsigned __int64 pf;
QueryPerformanceFrequency( (LARGE_INTEGER *)&pf );
freq_ = 1.0 / (double)pf;
QueryPerformanceCounter( (LARGE_INTEGER *)&baseTime_ );
}
/// seconds() returns the number of seconds (to very high resolution)
/// elapsed since the timer was last created or reset().
double seconds() const {
unsigned __int64 val;
QueryPerformanceCounter( (LARGE_INTEGER *)&val );
return (val - baseTime_) * freq_;
}
private:
double freq_;
unsigned __int64 baseTime_;
};
#endif //_WIN32
#if _LINUX
#include <time.h>
// http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/
timespec diff(const timespec& start, const timespec& end);
class Timer {
public:
Timer() {
reset();
}
/// reset() makes the timer start over counting from 0.0 seconds.
void reset() {
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1_);
}
/// seconds() returns the number of seconds (to very high resolution)
/// elapsed since the timer was last created or reset().
double seconds() const {
timespec time2;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
timespec ts = diff(time1_, time2);
double dt = ts.tv_sec + 1.e-9 * ts.tv_nsec;
return dt;
}
private:
timespec time1_;
};
#endif // _LINUX
#if __APPLE__
#include <mach/mach_time.h>
class Timer {
public:
Timer() {
mach_timebase_info_data_t info;
mach_timebase_info(&info);
conv_factor = (static_cast<double>(info.numer))/
(static_cast<double>(info.denom));
conv_factor = conv_factor*1.0e-9;
reset();
}
/// reset() makes the timer start over counting from 0.0 seconds.
void reset() {
time1_ = mach_absolute_time();
}
/// seconds() returns the number of seconds (to very high resolution)
/// elapsed since the timer was last created or reset().
double seconds() const {
return conv_factor*(mach_absolute_time() - time1_);
}
private:
uint64_t time1_;
double conv_factor;
};
#endif // __APPLE__
|
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_TRACKABLE_OBJECT_H_
#define ATOM_BROWSER_API_TRACKABLE_OBJECT_H_
#include <vector>
#include "atom/browser/api/event_emitter.h"
#include "atom/common/key_weak_map.h"
#include "base/bind.h"
#include "base/memory/weak_ptr.h"
#include "native_mate/object_template_builder.h"
namespace base {
class SupportsUserData;
}
namespace mate {
// Users should use TrackableObject instead.
class TrackableObjectBase {
public:
TrackableObjectBase();
// The ID in weak map.
int32_t weak_map_id() const { return weak_map_id_; }
// Wrap TrackableObject into a class that SupportsUserData.
void AttachAsUserData(base::SupportsUserData* wrapped);
// Get the weak_map_id from SupportsUserData.
static int32_t GetIDFromWrappedClass(base::SupportsUserData* wrapped);
protected:
virtual ~TrackableObjectBase();
// Returns a closure that can destroy the native class.
base::Closure GetDestroyClosure();
// Register a callback that should be destroyed before JavaScript environment
// gets destroyed.
static base::Closure RegisterDestructionCallback(const base::Closure& c);
int32_t weak_map_id_;
private:
void Destroy();
base::Closure cleanup_;
base::WeakPtrFactory<TrackableObjectBase> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(TrackableObjectBase);
};
// All instances of TrackableObject will be kept in a weak map and can be got
// from its ID.
template<typename T>
class TrackableObject : public TrackableObjectBase,
public mate::EventEmitter<T> {
public:
// Mark the JS object as destroyed.
void MarkDestroyed() {
Wrappable<T>::GetWrapper()->SetAlignedPointerInInternalField(0, nullptr);
}
// Finds out the TrackableObject from its ID in weak map.
static T* FromWeakMapID(v8::Isolate* isolate, int32_t id) {
if (!weak_map_)
return nullptr;
v8::MaybeLocal<v8::Object> object = weak_map_->Get(isolate, id);
if (object.IsEmpty())
return nullptr;
T* self = nullptr;
mate::ConvertFromV8(isolate, object.ToLocalChecked(), &self);
return self;
}
// Finds out the TrackableObject from the class it wraps.
static T* FromWrappedClass(v8::Isolate* isolate,
base::SupportsUserData* wrapped) {
int32_t id = GetIDFromWrappedClass(wrapped);
if (!id)
return nullptr;
return FromWeakMapID(isolate, id);
}
// Returns all objects in this class's weak map.
static std::vector<v8::Local<v8::Object>> GetAll(v8::Isolate* isolate) {
if (weak_map_)
return weak_map_->Values(isolate);
else
return std::vector<v8::Local<v8::Object>>();
}
// Removes this instance from the weak map.
void RemoveFromWeakMap() {
if (weak_map_ && weak_map_->Has(weak_map_id()))
weak_map_->Remove(weak_map_id());
}
protected:
TrackableObject() {}
~TrackableObject() override {
RemoveFromWeakMap();
}
void InitWith(v8::Isolate* isolate, v8::Local<v8::Object> wrapper) override {
WrappableBase::InitWith(isolate, wrapper);
if (!weak_map_) {
weak_map_ = new atom::KeyWeakMap<int32_t>;
}
weak_map_id_ = ++next_id_;
weak_map_->Set(isolate, weak_map_id_, wrapper);
}
private:
static int32_t next_id_;
static atom::KeyWeakMap<int32_t>* weak_map_; // leaked on purpose
DISALLOW_COPY_AND_ASSIGN(TrackableObject);
};
template<typename T>
int32_t TrackableObject<T>::next_id_ = 0;
template<typename T>
atom::KeyWeakMap<int32_t>* TrackableObject<T>::weak_map_ = nullptr;
} // namespace mate
#endif // ATOM_BROWSER_API_TRACKABLE_OBJECT_H_
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkWrapPythonConstant.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef VTK_WRAP_PYTHON_CONSTANT_H
#define VTK_WRAP_PYTHON_CONSTANT_H
#include "vtkParse.h"
#include "vtkParseData.h"
#include "vtkParseHierarchy.h"
/* generate code that adds a constant value to a python dict */
void vtkWrapPython_AddConstant(
FILE *fp, const char *indent, const char *dictvar, const char *objvar,
const char *scope, ValueInfo *val);
/* generate code that adds all public constants in a namespace */
void vtkWrapPython_AddPublicConstants(
FILE *fp, const char *indent, const char *dictvar, const char *objvar,
NamespaceInfo *data);
#endif /* VTK_WRAP_PYTHON_CONSTANT_H */
|
//=================================================================================================
/*!
// \file blazemark/flens/Mat6Mat6Mult.h
// \brief Header file for the FLENS 6D matrix/matrix multiplication kernel
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZEMARK_FLENS_MAT6MAT6MULT_H_
#define _BLAZEMARK_FLENS_MAT6MAT6MULT_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blazemark/system/Types.h>
namespace blazemark {
namespace flens {
//=================================================================================================
//
// KERNEL FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\name FLENS kernel functions */
//@{
double mat6mat6mult( size_t N, size_t steps );
//@}
//*************************************************************************************************
} // namespace flens
} // namespace blazemark
#endif
|
/*
Name: saminput
Author: Lars Zerbe <larszerbe@live.de>
Author: Stephan Peter <s.peter@fu-berlin.de>
Maintainer: Lars Zerbe <larszerbe@live.de>
License: GPL v3
Copyright: 2008-2012, FU Berlin
Status: under development
*/
#ifndef PEMER_LITE_H_
#define PEMER_LITE_H_
#include <seqan/basic.h>
#include <seqan/sequence.h>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <seqan/bam_io.h>
#include <seqan/file.h>
#include <seqan/arg_parse.h>
#include <math.h>
#include <vector>
#include <fstream>
#include <string>
struct medianTree // struktur welche den Median Speichert, abhängig von allen in eingegebenen Werten mit konstantem Speicher.
{
private:
int leftSize, rightSize, wert; //Initialisierung: wert speichert den aktuellen Median, leftSize und rightSize die größe der elemente die kleiner oder gößer des Medians sind.
public:
medianTree() : //konstruktor der beim erzeugen 'leftSize, rightSize, wert' mit Anfangswerten definiert.
leftSize(0), rightSize(0),wert(NULL)
{}
void add(int x) // add fügt eine neues Element x ein und überprüft ob es ein Median ist.
{
if(x<=wert){leftSize+=1;} //ist x kleiner/gleich als der aktuelle Median wird leftSize erhöht.
else{rightSize+=1;} //ist x größer als der aktuelle Median wird rightSize erhöht.
// Jetzt wir dgeprüft ob der aktuelle wert immer noch der Median ist oder ob x an seine Stelle kommt.
// Dazu wird geprüft ob die differenz der Anzahl der Elemente die größer oder kleiner sind größer als 1 ist.
if((leftSize-rightSize)>1){wert=x;leftSize-=1;rightSize+=1;} // x ist neuer Median, da die kleineren Elemente in der Anzahl größer sind als die großen Elemente. Es findet eine Verschiebung statt und der alte Median wird ersetzt, sowie die größen von kleiner und größeren Elementen angepasst
if((leftSize-rightSize)<0){wert=x;rightSize-=1;leftSize+=1;} // x ist neuer Median, da die größeren Elemente in der Anzahl größer sind als die kleinen Elemente. Es findet eine Verschiebung statt und der alte Median wird ersetzt, sowie die größen von kleiner und größeren Elementen angepasst
}
int getMedian(){return wert;} // gibt den Median aus.
};
struct candidate
{
enum form{undefine,deletion,insertion}; // form definiert den Type der Kandidaten ob u:undefiniert(0); d:deletion(1); i:insertion(2)
unsigned pos; // speichert die Positon
unsigned ref; // speichert die Referenz
unsigned len; // speichert die Laenge
form type; // speichert den Type
void addvalues(unsigned r,unsigned p,unsigned l,form t)
{
ref=r;
pos=p;
len=l;
type=t;
}
};
struct modifier
{
unsigned x,y,sd,e;
bool p;
seqan::CharString inputFile;
modifier() :
x(1), y(1),e(0),sd(0),p(false)
{}
};
struct statisticals
{
unsigned e_value;
unsigned standardDegression;
statisticals() :
standardDegression(0)
{}
};
typedef std::vector<candidate> candidates;
seqan::ArgumentParser::ParseResult commands(modifier &options, int argc, char const ** argv);
unsigned generateStandardDegression(candidates &input,int e_value);
int saminput(candidates &save, modifier &options, statisticals &stats, std::vector<std::string> &header);
int devide(candidates &input,candidates &result,modifier &options,statisticals &stats);
int output(std::vector<std::vector<unsigned>> &input,candidates &ref, char *out);
int findCluster(candidates &input, std::vector<std::vector<unsigned> > &dest, candidate::form indel);
#endif // PEMER_LITE_HEADER_H_
|
#include "stringc.h"
int str_subkey (const char *string, const char *key, char ***substrings) {
int matches = 0,
arraysize = 16,
x = 0,
y = 0,
lastx = 1,
exit = 0;
void *oldptr; // in case we need to free after a realloc
*substrings = malloc (arraysize);
if (!(*substrings)) {
return -1;
}
do {
x = strcspn ((string + x), key);
y = x - y;
if (((*substrings)[matches] = strndup ((string + x), y))) {
// if we fail, clear the entire array
for (x = 0; x < matches; x++) {
free ((*substrings)[x]);
}
free (*substrings);
return -1;
}
if (lastx != x) {
matches++; // next match
if (matches < arraysize) {
oldptr = *substrings;
arraysize += 16;
*substrings = realloc (*substrings, arraysize);
if (!(*substrings)) {
// if we fail, free the entire thing
*substrings = oldptr;
matches--;
for (x = 0; x < matches; x++) {
free ((*substrings)[x]);
}
free (*substrings);
return -1;
}
}
x += 2; // skip matched char
lastx = y = x; // use to find displacement
} else {
exit = 1;
}
} while (!exit);
return matches;
}
|
#pragma once
#include <d3d12.h>
#include <uc_dev/gx/dx12/cmd/root_signature_meta_data.h>
namespace uc
{
namespace gx
{
namespace dx12
{
struct graphics_pipeline_state
{
ID3D12PipelineState* m_state = nullptr;
ID3D12RootSignature* m_root_signature = nullptr;
root_signature_meta_data* m_root_signature_meta_data = nullptr;
};
struct compute_pipeline_state
{
ID3D12PipelineState* m_state = nullptr;
ID3D12RootSignature* m_root_signature = nullptr;
root_signature_meta_data* m_root_signature_meta_data = nullptr;
};
}
}
}
|
#pragma once
#define EXIT_FAILURE 1
|
// LIALinkedInHttpClient.h
//
// Copyright (c) 2013 Ancientprogramming
//
// 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.
/**
* Check if before AFNetworking 3.0
*/
#if __has_include_next("AFNetworking/AFHTTPRequestOperationManager.h")
#import <AFNetworking/AFHTTPRequestOperationManager.h>
#define AFHTTPManager AFHTTPRequestOperationManager
#elif __has_include_next("AFNetworking/AFHTTPSessionManager.h")
#import <AFNetworking/AFHTTPSessionManager.h>
#define AFHTTPManager AFHTTPSessionManager
#define isSessionManager 1
#endif
@class LIALinkedInApplication;
/**
* A LinkedIn client is created using a `LIALinkedInApplication` and is the network instance that will perform all requests to the LinkedIn API.
**/
@interface LIALinkedInHttpClient : AFHTTPManager
/** ************************************************************************************************ **
* @name Initializers
** ************************************************************************************************ **/
/**
* A LinkedIn client is created using a `LIALinkedInApplication` and is the network instance that will perform all requests to the LinkedIn API.
* @param application A `LIALinkedInApplication` configured instance.
* @discussion This method calls `+clientForApplication:presentingViewController:` with presenting view controller as nil.
**/
+ (LIALinkedInHttpClient *)clientForApplication:(LIALinkedInApplication *)application;
/**
* A LinkedIn client is created using a `LIALinkedInApplication` and is the network instance that will perform all requests to the LinkedIn API.
* @param application A `LIALinkedInApplication` configured instance.
* @param viewController The view controller that the UIWebView will be modally presented from. Passing nil assumes the root view controller.
**/
+ (LIALinkedInHttpClient *)clientForApplication:(LIALinkedInApplication *)application presentingViewController:viewController;
/** ************************************************************************************************ **
* @name Methods
** ************************************************************************************************ **/
/**
* Returns YES if the current cached token is valid and not expired, NO otherwise.
* @return The validity of the cached token.
* @discussion When getting the token via the method `-getAccessToken:success:failure:`, the library is caching the token for further use.
**/
- (BOOL)validToken;
/**
* Returns the previsouldy cached LinkedIn access token.
* @return The access token.
* @discussion When getting the token via the method `-getAccessToken:success:failure:`, the library is caching the token for further use.
**/
- (NSString *)accessToken;
/**
* Retrieves the access token from a valid authhorization code.
* @param authorizationCode The authorization code.
* @param success A success block. The success block contains a dictoinary containing the access token keyed by the string "access_token".
* @param failure A failure block containing the error.
**/
- (void)getAccessToken:(NSString *)authorizationCode success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure;
/**
* Retrieves an authorization code.
* @param success A success block.
* @param cancel A cancel block. This block is called when the user cancels the linkedin authentication flow.
* @param failure A failure block containing the error.
**/
- (void)getAuthorizationCode:(void (^)(NSString *))success cancel:(void (^)(void))cancel failure:(void (^)(NSError *))failure;
- (void)clearToken;
@end
|
//
// UIImageView+DRLocalization.h
// DRLocalization
//
// Created by Dariusz Rybicki on 16.01.2014.
// Copyright (c) 2014 Darrarski. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImageView (DRLocalization)
@end
|
//===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
// This file is distributed under the MIT License (MIT).
// See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//
#pragma once
#include "dawn/Support/NonCopyable.h"
#include <string>
namespace dawn {
namespace iir {
class InstantiationHelper : NonCopyable {
public:
/// @brief Generate a unique name for a local variable
static std::string makeLocalVariablename(const std::string& name, int AccessID);
/// @brief Generate a unique name for a temporary field
static std::string makeTemporaryFieldname(const std::string& name, int AccessID);
/// @brief Extract the name of a local variable
///
/// Reverse the effect of `makeLocalVariablename`.
static std::string extractLocalVariablename(const std::string& name);
/// @brief Extract the name of a local variable
///
/// Reverse the effect of `makeTemporaryFieldname`.
static std::string extractTemporaryFieldname(const std::string& name);
/// @brief Name used for all `StencilCallDeclStmt` in the stencil description AST
/// (`getStencilDescStatements`) to signal code-gen it should insert a call to the gridtools
/// stencil here
static std::string makeStencilCallCodeGenName(int StencilID);
/// @brief Check if the given name of a `StencilCallDeclStmt` was generate by
/// `makeStencilCallCodeGenName`
static bool isStencilCallCodeGenName(const std::string& name);
};
} // namespace iir
} // namespace dawn
|
//
// RKMCSD2.h
// RobotKit
//
// Created by Jon Carroll on 10/28/11.
// Copyright (c) 2011 Orbotix Inc. All rights reserved.
//
#import "RKMacroCommand.h"
/*!
* @brief Sets the system delay 2 variable used by RGB commands
*
* This command sets the system delay 1 variable that is used by RGB
* commands that don't have a specified delay.
* Allowed values:
* delay 0-65,535
*/
@interface RKMCSD2 : RKMacroCommand {
int delay;
}
/*! The delay associated with the command. 0-63,353 allowed */
@property int delay;
/*! Convenience method for creating a command and setting the parameters in one line.
* @param delay The delay the command will be initialized with.
* @return An instance of the command with the given parameters.
*/
+(RKMCSD2*)commandWithDelay:(int)delay;
@end
|
//
// JavaScriptCoreRuntime.h
// JavaScriptCoreRuntime
//
// Created by Chong Francis on 13年1月23日.
// Copyright (c) 2013年 Ignition Soft. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JavaScriptCore/JavaScriptCore.h"
extern NSString *const EvalJSErrorDomain;
typedef id (^EvalJSBlock)(NSUInteger argc, NSArray* argv);
@interface EvalJS : NSObject {
JSGlobalContextRef context;
NSMutableDictionary* callbackBlocks;
}
@property (readonly, nonatomic) NSMutableDictionary* callbackBlocks;
// eval javascript, return the result object when success.
// if there are exception when eval the script, return nil and set error to the error
-(id) eval:(NSString *)script error:(NSError**)error;
// eval javascript, return the result object when success.
// if there are exception when eval the script, return nil.
-(id) eval:(NSString *)script;
// Load script file from resource path.
// @param filename Javascript filename in resources path, without the js extension.
// @return if there are exception when eval the script.
-(id) loadScript:(NSString *)filename;
// Load script file from resource path.
// @param filename Javascript filename in resources path, without the js extension.
// @error pointer to error object
// @return if there are exception when eval the script, return nil and set error to the error.
-(id) loadScript:(NSString *)filename error:(NSError**) error;
// create a javascript function that run the supplied Objective-C Block.
// Return true when function created successfully.
// Return false when exception occurred while creating the function, error object will set to the error.
-(BOOL) createFunction:(NSString*)functionName callback:(EvalJSBlock)callback error:(NSError**) error;
// create a javascript function that run the supplied Objective-C Block.
// Return true when function created successfully.
// Return false when exception occurred while creating the function.
-(BOOL) createFunction:(NSString*)functionName callback:(EvalJSBlock)callback;
@end
|
/*
** Trace management.
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
*/
#ifndef _LJ_TRACE_H
#define _LJ_TRACE_H
#include "lj_obj.h"
#if LJ_HASJIT
#include "lj_jit.h"
#include "lj_dispatch.h"
/* Trace errors. */
typedef enum {
#define TREDEF(name, msg) LJ_TRERR_##name,
#include "lj_traceerr.h"
LJ_TRERR__MAX
} TraceError;
LJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e);
LJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e);
/* Trace management. */
LJ_FUNC void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T);
LJ_FUNC void lj_trace_reenableproto(GCproto *pt);
LJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt);
LJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno);
LJ_FUNC int lj_trace_flushall(lua_State *L);
LJ_FUNC void lj_trace_initstate(global_State *g);
LJ_FUNC void lj_trace_freestate(global_State *g);
/* Event handling. */
LJ_FUNC void lj_trace_ins(jit_State *J, const BCIns *pc);
LJ_FUNCA void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc);
LJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr);
/* Signal asynchronous abort of trace or end of trace. */
#define lj_trace_abort(g) (G2J(g)->state &= ~LJ_TRACE_ACTIVE)
#define lj_trace_end(J) (J->state = LJ_TRACE_END)
#else
#define lj_trace_flushall(L) (UNUSED(L), 0)
#define lj_trace_initstate(g) UNUSED(g)
#define lj_trace_freestate(g) UNUSED(g)
#define lj_trace_abort(g) UNUSED(g)
#define lj_trace_end(J) UNUSED(J)
#endif
#endif
|
/*
* luahelpers.h
*
* Lua helpers declared as macros
*/
#ifndef LUAHELPERS_H
#define LUAHELPERS_H
// a macro for proper Lua CFunction declarations
#ifndef LUA_CFUNC
# ifdef __cdecl
# define LUA_CFUNC(fname) int __cdecl fname(lua_State *L)
# else
# define LUA_CFUNC(fname) int fname(lua_State *L)
# endif
#endif
// raise Lua error, but auto-prefix message with the function name "%s() "
// (see http://www.lua.org/manual/5.1/manual.html#luaL_error)
#define luaL_error_fname(L, ...) \
do { \
lua_pushstring(L, __func__); \
lua_pushfstring(L, "() " __VA_ARGS__); \
lua_concat(L, 2); \
lua_error(L); \
} while (0)
// protect against bad Lua stack index, zero is always invalid
#define LUA_CHECKIDX(L, idx) \
do { \
if (idx == 0) \
luaL_error(L, "%s() Lua state %p, error: " \
"zero is not an acceptable stack index!", __func__, L); \
} while (0)
// relative Lua stack indices sometimes are hard to maintain,
// so convert it to an absolute one (when applicable)
#define LUA_ABSIDX(L, idx) \
do { \
if (idx < 0) { idx += lua_gettop(L); idx++; } \
} while (0)
// combine the two macros
#define LUA_CHKABSIDX(L, idx) \
do { \
if (idx == 0) \
luaL_error(L, "%s() Lua state %p, error: " \
"zero is not an acceptable stack index!", __func__, L); \
if (idx < 0) { idx += lua_gettop(L); idx++; } \
} while (0)
#endif // LUAHELPERS_H
|
/*numPass=0, numTotal=4
Verdict:WRONG_ANSWER, Visibility:1, Input:"2", ExpOutput:"2 -3 2 ", Output:"2 -3 -8 -13 -8 -3 2 "
Verdict:WRONG_ANSWER, Visibility:1, Input:"20", ExpOutput:"20 15 10 5 0 5 10 15 20 ", Output:"20 15 10 5 10 15 20 "
Verdict:WRONG_ANSWER, Visibility:1, Input:"4", ExpOutput:"4 -1 4 ", Output:"4 -1 -6 -11 -6 -1 4 "
Verdict:WRONG_ANSWER, Visibility:0, Input:"16", ExpOutput:"16 11 6 1 -4 1 6 11 16 ", Output:"16 11 6 1 6 11 16 "
*/
#include <stdio.h>
int p;
int func2(int n){
printf("%d ",n);
if(n==p)
{return 0;
}
return func2(n+5);
}
int func(int n){
int x;
x=n;
printf("%d ",x);
if (x>(p-15))
return func(n-5);
if (x<=(p-15))
{
return func2(x+5);}
}
int main(){
int n;
scanf("%d",&n);
p=n;
func(n);
return 0;
} |
#include <stdlib.h>
#include <stdio.h>
#define MAX_BUF 50
/**
* the main function
*
* inputs:
* [0] script name
* [1] number of inputs to generate
* [2] suffix to add to generated files
*
*/
int main(int argc, char **argv) {
int n = 100; // default number of inputs
char files[3][MAX_BUF] = { "in_asc", "in_dsc", "in_rnd" }; // output filenames
switch(argc) {
// if we have 2 inputs: add a suffix to the filenames
case 3:
// if we're given a bigger suffix than allowed: trim it
if(sizeof(argv[2]) > (MAX_BUF -7)) {
snprintf(argv[2], MAX_BUF - 7, "%s", argv[2]);
}
for(int i = 0; i < 3; i++) {
snprintf(files[i], MAX_BUF, "%s_%s", files[i], argv[2]);
}
// fallthrough
// if we have > 1 input: use the given number of inputs
case 2:
n = atoi(argv[1]);
break;
}
// a buffer to hold the command strings
char buf[MAX_BUF];
// generate the files
// ordered ascending
snprintf(buf, MAX_BUF, "./generate %s %d 1 1", files[0], n);
system(buf);
// ordered descending
snprintf(buf, MAX_BUF, "./generate %s %d 1 0", files[1], n);
system(buf);
// random
snprintf(buf, MAX_BUF, "./generate %s %d 0", files[2], n);
system(buf);
// return success
return 0;
}
|
#ifndef TEST_FUNCS_H_
#define TEST_FUNCS_H_
#include <stdarg.h>
#include "../partyql/basicmath/scalar/Integer.h"
#include "../partyql/basicmath/Vektor.h"
#include "../partyql/basicmath/AffineTransformation.h"
#include "../partyql/basicmath/Polyheder.h"
#include "../partyql/basicmath/PolyhedralDomain.h"
#include "../partyql/basicmath/SetRelation.h"
#include "../partyql/basicmath/Lattice.h"
#include "../partyql/basicmath/Matrix.h"
#include "../partyql/basicmath/Module.h"
#include "../partyql/basicmath/Cone.h"
#include "../partyql/core/HadronDescription.h"
#include "../partyql/core/Descriptor.h"
#include "../partyql/core/Hadron.h"
#include "../partyql/core/Domain.h"
#include "../partyql/Computation.h"
#include "../partyql/HierarPart.h"
#include "../partyql/core/SetRelation.h"
#include "../partyql/core/util/Util.h"
using AlgoTrans::C;
using AlgoTrans::G;
using AlgoTrans::CVector;
using AlgoTrans::CInteger;
using AlgoTrans::CMatrix;
using AlgoTrans::CModule;
using AlgoTrans::CCone;
using AlgoTrans::CAffineTransformation;
using AlgoTrans::CModuleRelation;
using AlgoTrans::CLatticeRelation;
using AlgoTrans::CLattice;
using AlgoTrans::CPolyheder;
using AlgoTrans::CPolyhedralDomain;
using AlgoTrans::CFlat;
using AlgoTrans::Flat;
using AlgoTrans::Hadron;
using AlgoTrans::Description;
using AlgoTrans::DeskriptorSet;
using AlgoTrans::Deskriptor;
using AlgoTrans::CDisjunctiveDomain;
using AlgoTrans::SetRelation;
typedef CInteger I;
typedef CVector<I> IVector;
typedef CCone<I> ICone;
typedef CVector<int> IntVector;
typedef CMatrix<I> IMatrix;
typedef CModule<I> IModule;
typedef CFlat<IModule> IFlatModule;
typedef CAffineTransformation<I> IAffineTransformation;
typedef CModuleRelation<I>::T IModuleRelation;
typedef CLatticeRelation<I>::T ILatticeRelation;
typedef CLattice<I> ILattice;
typedef CPolyheder<I> IPolyheder;
typedef CPolyhedralDomain<I> IPolyhedralDomain;
typedef Deskriptor<I> IDeskriptor;
typedef DeskriptorSet<Deskriptor<I> > IDeskriptorSet;
typedef Hadron<DeskriptorSet<Deskriptor<I> > > IHadron;
typedef Flat<IHadron> Polyheder;
typedef SetRelation<Polyheder> ISetRelation;
typedef CDisjunctiveDomain<Polyheder> PolyhedralDomain;
struct IVector_POD { IVector* v; };
struct IPolyheder_POD { IPolyheder* p; };
typedef AlgoTrans::CComputation<I> IComputation;
typedef AlgoTrans::CHierarFinitePart<IComputation, I> IHierarFinitePart;
typedef AlgoTrans::CHierarSetPart<IComputation, I> IHierarSetPart;
typedef AlgoTrans::CHierarScatterPart<IComputation, I> IHierarScatterPart;
typedef AlgoTrans::CHierarPart<IComputation, I> IHierarPart;
// Parms: ints
IVector IV(int argCount, ...);
IVector_POD IV_(int argCount, ...);
IVector_POD IV_(IVector& v);
// Parms: ints
IntVector IntV(int argCount, ...);
// Parms: IVector_POD
IAffineTransformation IAT(int argCount, ...);
IMatrix IMx(int argCount, ...);
IModule IMod_Con(int argCount, ...);
IFlatModule IFMod_Con(int affineness, int argCount, ...);
IModule IMod_Gen(int argCount, ...);
ICone ICone_Con(int argCount, ...);
ICone ICone_Gen(int argCount, ...);
IModule IMod(int argCount, ...); // Default = Generators
//IPolyheder IP(int argCount, ...);
IPolyhedralDomain* pIP_D(int argCount, ...);
PolyhedralDomain* pIPDC(bool bidir, int argCount, ...);
PolyhedralDomain IPDC(bool bidir, int argCount, ...);
Polyheder IPC(bool bidir, int argCount, ...);
Polyheder IP(Description d, int argCount, ...);
IHadron IHC(bool bidir, int argCount, ...);
IHadron IH(Description d, bool bidir, int argCount, ...);
ISetRelation ISR(bool bidir, Description desc, int constDim, int pDim, int qDim, int argCount, ...);
IDeskriptorSet IDS(bool bidir, int argCount, ...);
//PolyhedralDomain* pIPDG(int argCount, ...);
IPolyheder_POD IP_(int argCount, ...);
IPolyhedralDomain IPD(int argCount, ...);
IModuleRelation IMR(int pDim, int qDim, int constDim, int argCount, ...);
IModuleRelation IMR_Con(int pDim, int qDim, int constDim, int argCount, ...);
ILatticeRelation ILR(int pDim, int qDim, int constDim, int argCount, ...);
#endif /*TEST_FUNCS_H_*/
|
//
// ELNViewController.h
// ELNTextFieldFormattingKit
//
// Created by Geor Kasapidi on 02/08/2016.
//
@import UIKit;
@interface ELNViewController : UIViewController
@end
|
// Copyright (c) 2011-2013 The Beardcoin 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_OPTIONSMODEL_H
#define BITCOIN_QT_OPTIONSMODEL_H
#include "amount.h"
#include <QAbstractListModel>
QT_BEGIN_NAMESPACE
class QNetworkProxy;
QT_END_NAMESPACE
/** Interface from Qt to configuration data structure for Beardcoin client.
To Qt, the options are presented as a list with the different options
laid out vertically.
This can be changed to a tree once the settings become sufficiently
complex.
*/
class OptionsModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit OptionsModel(QObject *parent = 0);
enum OptionID {
StartAtStartup, // bool
MinimizeToTray, // bool
MapPortUPnP, // bool
MinimizeOnClose, // bool
ProxyUse, // bool
ProxyIP, // QString
ProxyPort, // int
ProxyUseTor, // bool
ProxyIPTor, // QString
ProxyPortTor, // int
DisplayUnit, // BitcoinUnits::Unit
ThirdPartyTxUrls, // QString
Language, // QString
CoinControlFeatures, // bool
ThreadsScriptVerif, // int
DatabaseCache, // int
SpendZeroConfChange, // bool
Listen, // bool
OptionIDRowCount,
};
void Init();
void Reset();
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
/** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */
void setDisplayUnit(const QVariant &value);
/* Explicit getters */
bool getMinimizeToTray() { return fMinimizeToTray; }
bool getMinimizeOnClose() { return fMinimizeOnClose; }
int getDisplayUnit() { return nDisplayUnit; }
QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; }
bool getProxySettings(QNetworkProxy& proxy) const;
bool getCoinControlFeatures() { return fCoinControlFeatures; }
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
/* Restart flag helper */
void setRestartRequired(bool fRequired);
bool isRestartRequired();
private:
/* Qt-only settings */
bool fMinimizeToTray;
bool fMinimizeOnClose;
QString language;
int nDisplayUnit;
QString strThirdPartyTxUrls;
bool fCoinControlFeatures;
/* settings that were overriden by command-line */
QString strOverriddenByCommandLine;
/// Add option to list of GUI options overridden through command line/config file
void addOverriddenOption(const std::string &option);
Q_SIGNALS:
void displayUnitChanged(int unit);
void coinControlFeaturesChanged(bool);
};
#endif // BITCOIN_QT_OPTIONSMODEL_H
|
// HashMapIntInt.h
#pragma once
const double LOAD_FACTOR_MAX = 0.75;
// linked list Node
struct Node {
Node() {
key = 0;
value = 0;
next = nullptr;
}
Node(int k, int v) {
key = k;
value = v;
next = nullptr;
}
int key;
int value;
Node *next;
};
class HashMap {
public:
HashMap(); // constructor
~HashMap(); // destructor
void put(int k, int v);
bool containsKey(int key);
void remove(int key);
void printTable();
int size();
int capacity();
double loadFactor();
private:
int count;
int tableCapacity;
Node **elements;
int hash(int key);
void rehash();
};
|
//
// TEABarChart.h
// Xhacker
//
// Created by Xhacker on 2013-07-25.
// Copyright (c) 2013 Xhacker. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TEABarChart : UIView
// Array of NSNumber
@property (nonatomic) NSArray *data;
// Max y value for chart (only works when autoMax is NO)
@property (nonatomic) CGFloat max;
// Auto set max value
@property (nonatomic) BOOL autoMax;
@property (nonatomic) UIColor *barColor;
@property (nonatomic) NSArray *barColors;
@property (nonatomic) NSInteger barSpacing;
@property (nonatomic) UIColor *backgroundColor;
// Round bar height to pixel for sharper chart
@property (nonatomic) BOOL roundToPixel;
@end
|
/**
* Copyright (c) 2013 Egor Pushkin. All rights reserved.
*
* 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 SERVERCONTEXT_H__REMOTEPC__INCLUDED_
#define SERVERCONTEXT_H__REMOTEPC__INCLUDED_
#include "Client.h"
#include "IClientHandler.h"
#include "Services/Services.h"
#include "IServerControl.h"
#include "IUIEvents.h"
#include "Shell/IShellControl.h"
namespace RemotePC
{
class ServerContext
: public mc::CommonImpl< mc::IRunnable >
, public mc::CommonImpl< IServerControl >
, public mc::CommonImpl< mc::DServer >
, public mc::CommonImpl< mc::DProtocol >
{
public:
typedef mc::CommonImpl< mc::IRunnable > ClassRoot_;
ServerContext( IUIEventsRef events );
virtual ~ServerContext();
// ICommon section
virtual mc::result PostInit();
// IRunnable section
virtual mc::result Run();
// IServerControl section
virtual mc::result Stop();
virtual mc::result HandleClient(size_t cookie, bool auth);
virtual mc::result HandleClient(mc::IProtocolRef client, bool auth);
virtual bool HasClients();
virtual bool HasClient(size_t cookie);
virtual Client GetClient(size_t cookie);
virtual bool TestClient(const Client& client);
virtual mc::result SpreadMessage(mc::IMessageRef message);
virtual mc::result RequestPassword(size_t cookie, bool requestAuth);
virtual mc::result DisconnectClient(size_t cookie);
virtual void HandleAuthorized(IClientHandlerRef handler);
virtual IServicesManagerPtr ServicesManager();
// DServer section
virtual mc::result ConnectionAccepted(mc::IConnectionRef connection);
// DProtocol section
virtual mc::result MessageArrived(mc::IProtocolRef protocol, mc::IMessageRef message);
virtual mc::result DataErrorOccured(mc::IProtocolRef protocol);
virtual mc::result Disconnected(mc::IProtocolRef protocol);
protected:
void SendVolumeLevel(mc::IProtocolRef client);
mc::IProtocolPtr ClientByCookie(size_t cookie);
void UnregisterClient(mc::IProtocolRef protocol);
mc::result HandleStream(mc::IProtocolRef protocol, mc::IMessageRef message);
mc::result HandleAuthMessage(mc::IProtocolRef protocol, mc::IMessageRef message);
mc::result HandleMouseClickMessage(mc::IMessageRef message);
mc::result HandleMoveToMessage(mc::IProtocolRef protocol, mc::IMessageRef message);
mc::result HandleMoveByMessage(mc::IProtocolRef protocol, mc::IMessageRef message);
mc::result HandleScrollMessage(mc::IMessageRef message);
mc::result HandleScrollMessage2(mc::IMessageRef message);
mc::result HandleKeyboardMessage(mc::IMessageRef message);
mc::result HandleVolumeMessage(mc::IMessageRef message);
mc::result HandleCookieMessage(mc::IMessageRef message);
mc::result HandleShellRequest(mc::IMessageRef message);
mc::result HandlePassword(mc::IProtocolRef protocol, mc::IMessageRef message);
mc::result HandleZoomLevel(mc::IProtocolRef protocol, mc::IMessageRef message);
mc::IMessagePtr PrepareAuthMessage(int clientMajor, int clientMinor);
mc::result RequestPassword(mc::IProtocolRef protocol, bool requestAuth);
mc::result WrongPassword(mc::IProtocolRef protocol);
private:
/** Network service utilized by acceptor. */
mc::IServicePtr service_;
/**
* Each value of this associative container represents client
* record with complete set of required fields.
* See Client for more details.
*/
typedef std::map< mc::IProtocolPtr, Client > Clients_;
/**
* Contains the list of current connections.
*/
Clients_ clients_;
/**
* Rationale of using JobsQueue instead of simple pool of threads:
* This tool combines two conditions which are important for auth tasks:
* 1. Jobs are performed in separate thread.
* 2. Jobs cannot be performed simultaneously. So user will never see
* two or more authentication dialogs at the same time.
*/
mc::IJobsQueuePtr authJobs_;
/**
* List of currently available cookies.
*/
std::set< mc::Guid > listOfCookies_;
/**
* Control interface to tool responsible for the delivery of events
* to application UI.
*/
IUIEventsRef events_;
/**
* Streaming services manager.
*/
IServicesManagerPtr servicesManager_;
};
}
#endif // !SERVERCONTEXT_H__REMOTEPC__INCLUDED_
|
//
// QQMessageFrameModel.h
// QQ
//
// Created by greeting on 15/9/16.
// Copyright (c) 2015年 greeting. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class MessageModel;
@interface MessageFrameModel : NSObject
/**时间的frame*/
@property (nonatomic,assign,readonly) CGRect timeF;
/**正文的frame*/
@property (nonatomic,assign,readonly) CGRect textViewF;
/**图像的frame*/
@property (nonatomic,assign,readonly) CGRect iconF;
/**cell的高度*/
@property (nonatomic,assign,readonly) CGFloat cellH;
/**数据模型*/
@property (nonatomic,strong) MessageModel *message;
@end
|
//
// LCSRotavaultDistributedStateNotification.h
// rotavault
//
// Created by Lorenz Schori on 25.10.10.
// Copyright 2010 znerol.ch. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString *LCSDistributedStateNotification;
extern NSString *LCSDistributedStateSyncRequestNotification;
extern NSString *LCSDistributedStateSyncNotification;
|
//
// CDVSimpleFile.m
// Uniclau
//
// Created by Jordi Bylina.
// Copyright (c) 2014 Uniclau. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
@interface CDVSimpleFile : CDVPlugin {
}
/* Exec API */
- (void)read:(CDVInvokedUrlCommand*)command;
- (void)write:(CDVInvokedUrlCommand*)command;
- (void)remove:(CDVInvokedUrlCommand*)command;
- (void)getUrl:(CDVInvokedUrlCommand*)command;
- (void)download:(CDVInvokedUrlCommand*)command;
- (void)createFolder:(CDVInvokedUrlCommand*)command;
- (void)list:(CDVInvokedUrlCommand*)command;
- (void)copy:(CDVInvokedUrlCommand*)command;
- (void)pluginInitialize;
@end
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QFONTDATABASE_H
#define QFONTDATABASE_H
#include <QtGui/qwindowdefs.h>
#include <QtCore/qstring.h>
#include <QtGui/qfont.h>
QT_BEGIN_NAMESPACE
class QStringList;
template <class T> class QList;
struct QFontDef;
class QFontEngine;
class QFontDatabasePrivate;
class Q_GUI_EXPORT QFontDatabase
{
Q_GADGET
Q_ENUMS(WritingSystem)
public:
// do not re-order or delete entries from this enum without updating the
// QPF2 format and makeqpf!!
enum WritingSystem {
Any,
Latin,
Greek,
Cyrillic,
Armenian,
Hebrew,
Arabic,
Syriac,
Thaana,
Devanagari,
Bengali,
Gurmukhi,
Gujarati,
Oriya,
Tamil,
Telugu,
Kannada,
Malayalam,
Sinhala,
Thai,
Lao,
Tibetan,
Myanmar,
Georgian,
Khmer,
SimplifiedChinese,
TraditionalChinese,
Japanese,
Korean,
Vietnamese,
Symbol,
Other = Symbol,
Ogham,
Runic,
Nko,
WritingSystemsCount
};
static QList<int> standardSizes();
QFontDatabase();
QList<WritingSystem> writingSystems() const;
QList<WritingSystem> writingSystems(const QString &family) const;
QStringList families(WritingSystem writingSystem = Any) const;
QStringList styles(const QString &family) const;
QList<int> pointSizes(const QString &family, const QString &style = QString());
QList<int> smoothSizes(const QString &family, const QString &style);
QString styleString(const QFont &font);
QString styleString(const QFontInfo &fontInfo);
QFont font(const QString &family, const QString &style, int pointSize) const;
bool isBitmapScalable(const QString &family, const QString &style = QString()) const;
bool isSmoothlyScalable(const QString &family, const QString &style = QString()) const;
bool isScalable(const QString &family, const QString &style = QString()) const;
bool isFixedPitch(const QString &family, const QString &style = QString()) const;
bool italic(const QString &family, const QString &style) const;
bool bold(const QString &family, const QString &style) const;
int weight(const QString &family, const QString &style) const;
bool hasFamily(const QString &family) const;
static QString writingSystemName(WritingSystem writingSystem);
static QString writingSystemSample(WritingSystem writingSystem);
static int addApplicationFont(const QString &fileName);
static int addApplicationFontFromData(const QByteArray &fontData);
static QStringList applicationFontFamilies(int id);
static bool removeApplicationFont(int id);
static bool removeAllApplicationFonts();
static bool supportsThreadedFontRendering();
private:
static void createDatabase();
static void parseFontName(const QString &name, QString &foundry, QString &family);
static QString resolveFontFamilyAlias(const QString &family);
static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request, bool multi = false);
static void load(const QFontPrivate *d, int script);
friend struct QFontDef;
friend class QFontPrivate;
friend class QFontDialog;
friend class QFontDialogPrivate;
friend class QFontEngineMultiXLFD;
friend class QFontEngineMultiQWS;
friend class QFontEngineMultiQPA;
QFontDatabasePrivate *d;
};
QT_END_NAMESPACE
#endif // QFONTDATABASE_H
|
#ifndef SINGLECAPTCHAWIDGET_H
#define SINGLECAPTCHAWIDGET_H
#include "engine_global.h"
#include <QWidget>
namespace Ui {
class SingleCaptchaWidget;
}
namespace BrowserAutomationStudioFramework
{
class ENGINESHARED_EXPORT SingleCaptchaWidget : public QWidget
{
Q_OBJECT
QString id;
public:
explicit SingleCaptchaWidget(QWidget *parent = 0);
~SingleCaptchaWidget();
void SetCaptcha(const QString& base64, const QString& id);
private:
Ui::SingleCaptchaWidget *ui;
void changeEvent(QEvent *e);
signals:
void Done(const QString& val, const QString& id, bool res);
private slots:
void on_pushButton_2_clicked();
void on_pushButton_clicked();
void on_lineEdit_returnPressed();
};
}
#endif // SINGLECAPTCHAWIDGET_H
|
#ifndef RDESTL_PAIR_H
#define RDESTL_PAIR_H
// Use std::pair (it's bigger, but the actual code is 'good enough'
// and it comes with more 'modern C++' bells and whistles (most notably, piecewise construct)
//#define RDESTL_USE_STD_PAIR 1
#include "type_traits.h"
#ifdef RDESTL_USE_STD_PAIR
#include <utility>
#endif
namespace rde
{
#ifdef RDESTL_USE_STD_PAIR
template<typename T1, typename T2>
using pair = std::pair<T1, T2>;
#else
//=============================================================================
template<typename T1, typename T2>
struct pair
{
typedef T1 first_type;
typedef T2 second_type;
pair() { /**/ }
pair(const T1& a, const T2& b): first(a), second(b) { /**/ }
explicit pair(const T1& a): first(a) { /**/ }
pair(const pair<T1, T2>& rhs): first(rhs.first), second(rhs.second) { /**/ }
pair(pair<T1, T2>&& rhs): first(std::move(rhs.first)), second(std::move(rhs.second)) { /**/ }
template<class... Args2>
pair(T1&& first_args, Args2&&... second_args)
: first(std::forward<T1>(first_args))
, second(std::forward<Args2>(second_args)...) { /**/ }
pair& operator=(const pair<T1, T2>& rhs)
{
first = rhs.first;
second = rhs.second;
return *this;
}
pair& operator=(pair<T1, T2>&& rhs)
{
first = std::move(rhs.first);
second = std::move(rhs.second);
return *this;
}
T1 first;
T2 second;
};
#endif // #ifdef RDESTL_USE_STD_PAIR
//=============================================================================
// Pair is POD if every element is POD/fundamental
template<typename T1, typename T2>
struct is_pod<pair<T1, T2>>
{
enum {
value = (is_pod<T1>::value || is_fundamental<T1>::value) &&
(is_pod<T2>::value || is_fundamental<T2>::value)
};
};
//-----------------------------------------------------------------------------
template<typename T1, typename T2>
pair<T1, T2> make_pair(const T1& a, const T2& b)
{
return pair<T1, T2>(a, b);
}
} // namespace rde
//-----------------------------------------------------------------------------
#endif // #ifndef RDESTL_PAIR_H
|
#ifndef VIRTUALSOC_H
#define VIRTUALSOC_H
#include <QMainWindow>
#include <QListWidgetItem>
#include "../Client.h"
#include "post.h"
namespace Ui {
class VirtualSoc;
}
class VirtualSoc : public QMainWindow
{
Q_OBJECT
public:
explicit VirtualSoc(QWidget *parent = 0,Client* client = 0,const char* username=0);
~VirtualSoc();
void closeEvent (QCloseEvent *event);
private slots:
void acceptConversation();
void acceptUser();
void addColleague();
void addConvUser();
void addFriend();
void addOther();
void declineConversation();
void declineUser();
void deleteUser();
void refreshMessages();
void userProfile();
void userPosts();
void on_BackButton_clicked();
void on_ConversationList_itemClicked(QListWidgetItem *item);
void on_GroupsCombo_activated(const QString &arg1);
void on_LeaveConvButton_clicked();
void on_NewConvButton_clicked();
void on_PostButton_clicked();
void on_RequestList_customContextMenuRequested(const QPoint &pos);
void on_SaveButton_clicked();
void on_SendButton_clicked();
void on_ServicesTab_tabBarClicked(int index);
void on_UsersList_customContextMenuRequested(const QPoint& pos);
void on_myProfileButton_toggled(bool checked);
private:
Client* m_client;
int m_pipe[2];
Ui::VirtualSoc* m_ui;
std::vector<int> active;
std::vector<int> request;
QTimer* m_timer;
void ProvideContextMenu(const QPoint &);
void terminate();
void printError();
void printError(const char*);
};
#endif // VIRTUALSOC_H
|
//
// XDAppDelegate.h
// Quaternity
//
// Created by 徐 东 on 13-10-11.
// Copyright (c) 2013年 下厨房. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XDAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2015 Scientific Computing and Imaging Institute,
University of Utah.
License for the specific language governing rights and limitations under
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 INTERFACE_APPLICATION_NOTE_H
#define INTERFACE_APPLICATION_NOTE_H
#include <Interface/Application/PositionProvider.h>
#include <boost/shared_ptr.hpp>
#include <boost/tuple/tuple.hpp>
#include <QString>
#include <QFont>
#include <QColor>
#include <QPointF>
class QAction;
class QGraphicsItem;
class QGraphicsTextItem;
class QGraphicsScene;
namespace SCIRun {
namespace Gui {
// TODO: refactor. Combine with ModuleNoteXML, and bring together various Note-related classes to support consistent read/write.
// IDEA: subclass QGraphicsTextItem properly and add a way to associate with a HasNotes object (either module or connection).
// Then serialization will be uniform for all notes.
struct Note
{
QString html_;
QString plainText_;
int fontSize_;
NotePosition position_;
Note() : fontSize_(-1), position_(NotePosition::Default) {}
Note(const QString& html, const QString& plain, int font, NotePosition pos) : html_(html), plainText_(plain), fontSize_(font), position_(pos) {}
};
class NoteDisplayStrategy
{
public:
virtual ~NoteDisplayStrategy() {}
virtual QPointF relativeNotePosition(QGraphicsItem* item, const QGraphicsTextItem* note, NotePosition position) const = 0;
};
typedef boost::shared_ptr<NoteDisplayStrategy> NoteDisplayStrategyPtr;
class ModuleWidgetNoteDisplayStrategy;
class ConnectionNoteDisplayStrategy;
class NoteDisplayHelper
{
public:
virtual ~NoteDisplayHelper();
Note currentNote() const;
protected:
explicit NoteDisplayHelper(NoteDisplayStrategyPtr display);
virtual void setNoteGraphicsContext() = 0;
void updateNoteImpl(const Note& note);
void updateNotePosition();
void setDefaultNotePositionImpl(NotePosition position);
void setDefaultNoteSizeImpl(int size);
void clearNoteCursor();
QGraphicsItem* networkObjectWithNote_;
QGraphicsScene* scene_;
PositionProviderPtr positioner_;
void destroy();
private:
QGraphicsTextItem* note_;
NotePosition notePosition_, defaultNotePosition_;
int defaultNoteFontSize_{ 20 };
NoteDisplayStrategyPtr displayStrategy_;
bool destroyed_;
QPointF relativeNotePosition();
};
}
}
#endif
|
#ifndef WIKIPAGE_H
#define WIKIPAGE_H
#include <string>
#include "HTMLContent.h"
#include "HTMLTag.h"
class WikiPage
{
std::string title_;
std::string text_;
std::vector<std::string> links_;
public:
WikiPage(const HTMLTag& tag);
const std::string& title();
const std::string& text();
const std::vector<std::string>& links();
static bool is_link_ok(const std::string& link);
static std::string transform_link(const std::string& link);
};
#endif
|
// Copyright (C) 2016-2019 Yixuan Qiu <yixuan.qiu@cos.name>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef DENSE_GEN_REAL_SHIFT_SOLVE_H
#define DENSE_GEN_REAL_SHIFT_SOLVE_H
#include <Eigen/Core>
#include <Eigen/LU>
#include <stdexcept>
namespace Spectra {
///
/// \ingroup MatOp
///
/// This class defines the shift-solve operation on a general real matrix \f$A\f$,
/// i.e., calculating \f$y=(A-\sigma I)^{-1}x\f$ for any real \f$\sigma\f$ and
/// vector \f$x\f$. It is mainly used in the GenEigsRealShiftSolver eigen solver.
///
template <typename Scalar>
class DenseGenRealShiftSolve
{
private:
typedef Eigen::Index Index;
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> Matrix;
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> Vector;
typedef Eigen::Map<const Vector> MapConstVec;
typedef Eigen::Map<Vector> MapVec;
typedef const Eigen::Ref<const Matrix> ConstGenericMatrix;
ConstGenericMatrix m_mat;
const Index m_n;
Eigen::PartialPivLU<Matrix> m_solver;
public:
///
/// Constructor to create the matrix operation object.
///
/// \param mat An **Eigen** matrix object, whose type can be
/// `Eigen::Matrix<Scalar, ...>` (e.g. `Eigen::MatrixXd` and
/// `Eigen::MatrixXf`), or its mapped version
/// (e.g. `Eigen::Map<Eigen::MatrixXd>`).
///
DenseGenRealShiftSolve(ConstGenericMatrix& mat) :
m_mat(mat), m_n(mat.rows())
{
if (mat.rows() != mat.cols())
throw std::invalid_argument("DenseGenRealShiftSolve: matrix must be square");
}
///
/// Return the number of rows of the underlying matrix.
///
Index rows() const { return m_n; }
///
/// Return the number of columns of the underlying matrix.
///
Index cols() const { return m_n; }
///
/// Set the real shift \f$\sigma\f$.
///
void set_shift(Scalar sigma)
{
m_solver.compute(m_mat - sigma * Matrix::Identity(m_n, m_n));
}
///
/// Perform the shift-solve operation \f$y=(A-\sigma I)^{-1}x\f$.
///
/// \param x_in Pointer to the \f$x\f$ vector.
/// \param y_out Pointer to the \f$y\f$ vector.
///
// y_out = inv(A - sigma * I) * x_in
void perform_op(const Scalar* x_in, Scalar* y_out) const
{
MapConstVec x(x_in, m_n);
MapVec y(y_out, m_n);
y.noalias() = m_solver.solve(x);
}
};
} // namespace Spectra
#endif // DENSE_GEN_REAL_SHIFT_SOLVE_H
|
// Copyright (c) 2014-2018 NVIDIA Corporation
//
// 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 _VS3D_H_
#define _VS3D_H_
/** D = 3 specialized functions for the D-specific implementation of the void simplex algorithm. */
#include "vsd/vsd.h"
/**
LUP decomposition (LU decomposition with row permutation) function optimized for 2x2 matrices.
Finds the LUP decomposition of the transpose of M.
\param[in,out] M on input, the matrix to decompose. On output, the LU decomposition of M^T.
\param[out] P the row permutation used in the LUP decomposition.
\return the determinant of M.
*/
inline real
LUP_decompose_transpose_2(real M[2][2], uint& P)
{
real detM = 1;
if ((P = (uint)(sq(M[1][0]) > sq(M[0][0]))) != 0)
{
detM = -detM;
swap<2>(M[0], M[1]);
}
detM *= M[0][0];
if (M[0][0] != 0) M[1][1] -= (M[1][0] /= M[0][0])*M[0][1];
detM *= M[1][1];
return detM;
}
/**
Linear equation solver which uses an LUP decomposition, optimized for 2x2 matrices.
Solves the equation M*x = b.
\param[in,out] x a 2-vector. On input, the right-hand side b. On output, the solution x.
\param[in] LU the LU decomposition of M, which can be obtained from LUP_decompose_transpose_2.
\param[in] P the row permutation used in the decomposition, which can be obtained from LUP_decompose_transpose_2.
*/
inline void
LUP_solve_transpose_2(real x[2], const real LU[2][2], uint P)
{
// Perform row permutation to get Pb
swap(x[0], x[P]);
// Forward substitute to get (L^-1)Pb
x[1] -= LU[1][0] * x[0];
// Back substitute to get (U^-1)(L^-1)Pb
x[1] /= LU[1][1];
x[0] = (x[0] - LU[0][1] * x[1]) / LU[0][0];
}
/** Specialization of vsd_solve. See the declaration in vsd.h for the function description. */
template<>
inline real
vsd_solve_feature<2>(real p[], const real q[], const real S[][3], const uint indices[], uint N)
{
real H[2][2];
uint P;
real detH = 1;
switch (N)
{
case 0:
cpy<3>(p, q);
if (dot<3>(p, p) == 0) p[2] = 1;
break;
case 1:
{
const real* S0 = S[indices[0]];
cpy<2>(H[0], S0);
H[1][0] = -H[0][1];
H[1][1] = H[0][0];
p[1] = dot<2>(q, H[1]);
detH = LUP_decompose_transpose_2(H, P);
if (detH == 0) return 0;
p[0] = -q[2] * S0[2];
LUP_solve_transpose_2(p, H, P);
p[2] = q[2];
if (dot<3>(p, p) == 0)
{
p[0] = -S0[2];
LUP_solve_transpose_2(p, H, P);
p[2] = 1;
}
break;
}
case 2:
{
const real* S0 = S[indices[0]];
const real* S1 = S[indices[1]];
cpy<2>(H[0], S0);
cpy<2>(H[1], S1);
detH = LUP_decompose_transpose_2(H, P);
if (detH == 0) return 0;
// We will only solve using q_D == 1 in this case
p[0] = -S0[2];
p[1] = -S1[2];
LUP_solve_transpose_2(p, H, P);
p[2] = 1;
break;
}
}
return detH;
}
/** Specialization of vsd_search_features. See the declaration in vsd.h for the function description. */
template<>
inline bool
vsd_search_features<2>(uint& columns, real p[], real& det_basis, const real S[][3], uint N, const real q[])
{
// Initialize measure for best solution
real p2_min = std::numeric_limits<real>().max();
p[2] = 1;
bool updated = false;
bool solution_found = false;
switch (N)
{
case 3:
updated |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b110, N, S, q);
updated |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b101, N, S, q);
case 2:
updated |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b011, N, S, q);
if (!updated && N > 2) break;
solution_found |= updated;
updated = false;
case 1:
switch (N)
{
case 3: updated |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b100, N, S, q);
case 2: updated |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b010, N, S, q);
case 1: updated |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b001, N, S, q);
}
solution_found |= updated;
if (!updated && N > 1) break;
case 0:
solution_found |= vsd_test_feature<2>(p, p2_min, det_basis, columns, 0b000, N, S, q);
}
return solution_found;
}
#endif // #ifndef _VS3D_H_
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Entities\0.11.3\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#ifndef __APP_FUSE_ENTITIES_MODEL_MESH_COLLISION_DIRECT_H__
#define __APP_FUSE_ENTITIES_MODEL_MESH_COLLISION_DIRECT_H__
#include <app/Fuse.Entities.TriangleMeshIntersecter.h>
#include <Uno.h>
namespace app { namespace Uno { namespace Content { namespace Models { struct VertexAttributeArray; } } } }
namespace app { namespace Uno { namespace Geometry { struct Triangle; } } }
namespace app {
namespace Fuse {
namespace Entities {
struct ModelMeshCollision_Direct;
struct ModelMeshCollision_Direct__uType : ::app::Fuse::Entities::TriangleMeshIntersecter__uType
{
};
ModelMeshCollision_Direct__uType* ModelMeshCollision_Direct__typeof();
void ModelMeshCollision_Direct___ObjInit_1(ModelMeshCollision_Direct* __this, ::app::Uno::Content::Models::VertexAttributeArray* positions, int vertexCount);
::app::Uno::Geometry::Triangle ModelMeshCollision_Direct__GetTriangle(ModelMeshCollision_Direct* __this, int t);
ModelMeshCollision_Direct* ModelMeshCollision_Direct__New_1(::uStatic* __this, ::app::Uno::Content::Models::VertexAttributeArray* positions, int vertexCount);
struct ModelMeshCollision_Direct : ::app::Fuse::Entities::TriangleMeshIntersecter
{
::uStrong< ::app::Uno::Content::Models::VertexAttributeArray*> _positions;
void _ObjInit_1(::app::Uno::Content::Models::VertexAttributeArray* positions, int vertexCount) { ModelMeshCollision_Direct___ObjInit_1(this, positions, vertexCount); }
};
}}}
#endif
|
//
// NSArray+MAESeparatedString.h
// MantleArrayExtension
//
// Created by Hinagiku Soranoba on 2017/03/05.
// Copyright © 2017年 Hinagiku Soranoba. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSArray (MAESeparatedString)
#pragma mark - Public Methods
/**
* It returns string joined by the separator using originalCharacters.
*
* @param separator A separator
* @return A joined string
*/
- (NSString* _Nonnull)mae_componentsJoinedBySeparatedString:(unichar)separator;
@end
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
class InternalString
{
charcount_t m_charLength;
unsigned char m_offset;
const wchar_t* m_content;
public:
InternalString() : m_charLength(0), m_content(NULL), m_offset(0) { };
InternalString(const wchar_t* content, charcount_t charLength, unsigned char offset = 0);
static InternalString* New(ArenaAllocator* alloc, const wchar_t* content, charcount_t length);
static InternalString* New(Recycler* recycler, const wchar_t* content, charcount_t length);
static InternalString* NewNoCopy(ArenaAllocator* alloc, const wchar_t* content, charcount_t length);
inline charcount_t GetLength() const
{
return m_charLength;
}
inline const wchar_t* GetBuffer() const
{
return m_content + m_offset;
}
};
struct InternalStringComparer
{
__inline static bool Equals(InternalString const& str1, InternalString const& str2)
{
return str1.GetLength() == str2.GetLength() &&
JsUtil::CharacterBuffer<WCHAR>::StaticEquals(str1.GetBuffer(), str2.GetBuffer(), str1.GetLength());
}
__inline static hash_t GetHashCode(InternalString const& str)
{
return JsUtil::CharacterBuffer<WCHAR>::StaticGetHashCode(str.GetBuffer(), str.GetLength());
}
};
}
template<>
struct DefaultComparer<Js::InternalString> : public Js::InternalStringComparer {};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.