text stringlengths 4 6.14k |
|---|
//
// AEFUser.h
// OctoCrash
//
// Created by Alex Fish on 09/01/2014.
// Copyright (c) 2014 alexefish. All rights reserved.
//
#import <Mantle/Mantle.h>
/**
Represents a Github user holding any user specific
details.
*/
@interface AEFUser : MTLModel
/**
The users Github login
*/
@property (nonatomic, copy, readonly) NSString *login;
/**
The users Github token, this token may be out of date if
the user has revoked access
*/
@property (nonatomic, copy, readonly) NSString *token;
/**
Init a new user object with a username and password
@param username The user's login
@param password The user's token
@returns A new user object
*/
- (id)initWithLogin:(NSString *)login
token:(NSString *)token;
@end
|
#include <stdio.h>
void foo()
{
int x;
printf("hello");
printf("%d", x);
}
int main()
{
int i, j;
int a[100][100];
for (i = 0; i < 100; ++i)
{
for (j = 0; j < 100; ++j)
{
printf("%d ", a[j][i]);
}
}
}
|
#ifndef __Room__
#define __Room__
#include <string>
#include <vector>
#include <iostream>
#include "Entity.h"
class Exit;
class Room : public Entity {
public:
Room(const char* name, const char* description, const char* long_description);
~Room();
void SetExit(Exit* exit);
Exit* GetExit(const string& direction) const;
void PrintExits() const;
void Look(int long_descriptions = 0, bool full_description = false);
vector<Exit*> exits;
private:
bool _visited;
};
#endif //__Room__ |
/*******************************************************************************
System Definitions
File Name:
system_definitions.h
Summary:
MPLAB Harmony project system definitions.
Description:
This file contains the system-wide prototypes and definitions for an MPLAB
Harmony project.
*******************************************************************************/
//DOM-IGNORE-BEGIN
/*******************************************************************************
Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller that is integrated into your product or third party product
(pursuant to the sublicense terms in the accompanying license agreement).
You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.
SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
*******************************************************************************/
//DOM-IGNORE-END
#ifndef _SYS_DEFINITIONS_H
#define _SYS_DEFINITIONS_H
// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "system/common/sys_common.h"
#include "system/common/sys_module.h"
#include "system/clk/sys_clk.h"
#include "system/clk/sys_clk_static.h"
#include "system/devcon/sys_devcon.h"
#include "system/int/sys_int.h"
#include "system/dma/sys_dma.h"
#include "system/fs/sys_fs.h"
#include "system/fs/sys_fs_media_manager.h"
#include "system/random/sys_random.h"
#include "system/fs/mpfs/mpfs.h"
#include "system/tmr/sys_tmr.h"
#include "system/reset/sys_reset.h"
#include "driver/tmr/drv_tmr.h"
#include "driver/nvm/drv_nvm.h"
#include "system/ports/sys_ports.h"
#include "driver/spi/drv_spi.h"
#include "tcpip/tcpip.h"
#include "driver/ethmac/drv_ethmac.h"
#include "driver/wifi/mrf24w/drv_wifi.h"
#include "TCPIPStack.h"
/* this needs to be included before anything I've got defined: */
//#ifndef packed
// #define packed (__attribute__((packed)))
//#endif
#include "LEDScroller.h"
// DOM-IGNORE-BEGIN
#ifdef __cplusplus // Provide C++ Compatibility
extern "C" {
#endif
// DOM-IGNORE-END
// *****************************************************************************
// *****************************************************************************
// Section: Type Definitions
// *****************************************************************************
// *****************************************************************************
// *****************************************************************************
/* System Objects
Summary:
Structure holding the system's object handles
Description:
This structure contains the object handles for all objects in the
MPLAB Harmony project's system configuration.
Remarks:
These handles are returned from the "Initialize" functions for each module
and must be passed into the "Tasks" function for each module.
*/
typedef struct
{
SYS_MODULE_OBJ sysDevcon;
SYS_MODULE_OBJ sysTmr;
SYS_MODULE_OBJ sysDma;
SYS_MODULE_OBJ drvTmr0;
SYS_MODULE_OBJ drvTmr1;
SYS_MODULE_OBJ drvNvm;
/*** SPI Object for Index 0 ***/
SYS_MODULE_OBJ spiObjectIdx0;
/*** SPI Object for Index 1 ***/
SYS_MODULE_OBJ spiObjectIdx1;
SYS_MODULE_OBJ tcpip;
} SYSTEM_OBJECTS;
// *****************************************************************************
// *****************************************************************************
// Section: extern declarations
// *****************************************************************************
// *****************************************************************************
extern SYSTEM_OBJECTS sysObj;
//DOM-IGNORE-BEGIN
#ifdef __cplusplus
}
#endif
//DOM-IGNORE-END
#endif /* _SYS_DEFINITIONS_H */
/*******************************************************************************
End of File
*/
|
//
// TCSTomcatManagerResponseDelegate.h
// TomcatSlapper
//
// Created by John Clayton on 1/18/05.
// Copyright 2005 Fivesquare Software, LLC. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class TCSComponent;
@protocol TCSComponentProtocol;
@protocol TCSTomcatManagerResponseDelegateProtocol
- (void) handleResponse;
@end
@interface TCSTomcatManagerResponseDelegate
: NSObject <TCSTomcatManagerResponseDelegateProtocol> {
TCSComponent *component;
NSMutableData *responseData;
NSString *rString;
NSArray *rLines;
NSMutableDictionary *messages;
}
- (id) initWithComponent:(id<TCSComponentProtocol>)tk;
+ (id) withComponent:(id<TCSComponentProtocol>)tk;
- (TCSComponent *)component;
- (void)setComponent:(TCSComponent *)newComponent;
- (NSMutableData *)responseData;
- (void)setResponseData:(NSMutableData *)newResponseData;
- (NSString *)rString;
- (void)setRString:(NSString *)newRString;
- (NSArray *)rLines;
- (void)setRLines:(NSArray *)newRLines;
- (NSMutableDictionary *)messages;
- (void)setMessages:(NSMutableDictionary *)newMessages;
@end
|
#ifndef COLORGENERATOR_H
#define COLORGENERATOR_H
#include "color.h"
class ColorGenerator {
public:
virtual ~ColorGenerator() {};
virtual Color generate() = 0;
};
#endif // COLORGENERATOR_H
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CHAINPARAMS_H
#define BITCOIN_CHAINPARAMS_H
#include "amount.h"
#include "chainparamsbase.h"
#include "consensus/params.h"
#include "primitives/block.h"
#include "protocol.h"
#include <memory>
#include <vector>
struct CDNSSeedData {
std::string name, host;
bool supportsServiceBitsFiltering;
CDNSSeedData(const std::string &strName, const std::string &strHost, bool supportsServiceBitsFilteringIn = false) : name(strName), host(strHost), supportsServiceBitsFiltering(supportsServiceBitsFilteringIn) {}
};
struct SeedSpec6 {
uint8_t addr[16];
uint16_t port;
};
typedef std::map<int, uint256> MapCheckpoints;
struct CCheckpointData {
MapCheckpoints mapCheckpoints;
};
struct ChainTxData {
int64_t nTime;
int64_t nTxCount;
double dTxRate;
};
/**
* CChainParams defines various tweakable parameters of a given instance of the
* Bitcoin system. There are three: the main network on which people trade goods
* and services, the public test network which gets reset from time to time and
* a regression test mode which is intended for private networks only. It has
* minimal difficulty to ensure that blocks can be found instantly.
*/
class CChainParams
{
public:
enum Base58Type {
PUBKEY_ADDRESS,
SCRIPT_ADDRESS,
BLINDED_ADDRESS,
SECRET_KEY,
EXT_PUBLIC_KEY,
EXT_SECRET_KEY,
PARENT_PUBKEY_ADDRESS,
PARENT_SCRIPT_ADDRESS,
MAX_BASE58_TYPES
};
/**
* Maps strNetworkID [see BIP70] to chainID (hashGenesisBlock and genesis checkpoint)
*/
static const std::vector<std::string> supportedChains;
const Consensus::Params& GetConsensus() const { return consensus; }
const CMessageHeader::MessageStartChars& MessageStart() const { return pchMessageStart; }
int GetDefaultPort() const { return nDefaultPort; }
const CBlock& GenesisBlock() const { return genesis; }
const uint256 ParentGenesisBlockHash() const { return parentGenesisBlockHash; }
/** Make miner wait to have peers to avoid wasting work */
bool MiningRequiresPeers() const { return fMiningRequiresPeers; }
/** Default value for -checkmempool and -checkblockindex argument */
bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }
/** Policy: Filter transactions that do not match well-defined patterns */
bool RequireStandard() const { return fRequireStandard; }
uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }
/** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
/** Return the BIP70 network string (main, test or regtest) */
std::string NetworkIDString() const { return strNetworkID; }
const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; }
const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
const CCheckpointData& Checkpoints() const { return checkpointData; }
const ChainTxData& TxData() const { return chainTxData; }
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
/** All coinbase outputs (after genesis) must be to this destination */
bool anyonecanspend_aremine;
protected:
CChainParams() = delete;
CChainParams(const std::string& chain) : strNetworkID(chain) {}
Consensus::Params consensus;
CMessageHeader::MessageStartChars pchMessageStart;
int nDefaultPort;
uint64_t nPruneAfterHeight;
std::vector<CDNSSeedData> vSeeds;
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
std::string strNetworkID;
CBlock genesis;
uint256 parentGenesisBlockHash;
CAmount initialFreeCoins;
CAmount initial_reissuance_tokens;
std::vector<SeedSpec6> vFixedSeeds;
bool fMiningRequiresPeers;
bool fDefaultConsistencyChecks;
bool fRequireStandard;
bool fMineBlocksOnDemand;
CCheckpointData checkpointData;
ChainTxData chainTxData;
};
/**
* Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
* @returns a CChainParams* of the chosen chain.
* @throws a std::runtime_error if the chain is not supported.
*/
std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain);
/**
* Return the currently selected parameters. This won't change after app
* startup, except for unit tests.
*/
const CChainParams &Params();
/**
* Sets the params returned by Params() to those for the given BIP70 chain name.
* @throws std::runtime_error when the chain is not supported.
*/
void SelectParams(const std::string& chain);
/**
* Allows modifying the BIP9 regtest parameters.
*/
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
#endif // BITCOIN_CHAINPARAMS_H
|
#ifndef AP_INCLUDED
#define AP_INCLUDED
#include <stdarg.h>
#include "fmt.h"
#define T AP_T
typedef struct T *T;
extern T AP_new (long int n);
extern T AP_fromstr(const char *str, int base,
char **end);
extern long int AP_toint(T x);
extern char *AP_tostr(char *str, int size,
int base, T x);
extern void AP_fmt(int code, va_list_box *box,
int put(int c, void *cl), void *cl,
unsigned char flags[], int width, int precision);
extern void AP_free(T *z);
extern T AP_neg(T x);
extern T AP_add(T x, T y);
extern T AP_sub(T x, T y);
extern T AP_mul(T x, T y);
extern T AP_div(T x, T y);
extern T AP_mod(T x, T y);
extern T AP_pow(T x, T y, T p);
extern T AP_addi(T x, long int y);
extern T AP_subi(T x, long int y);
extern T AP_muli(T x, long int y);
extern T AP_divi(T x, long int y);
extern long AP_modi(T x, long int y);
extern T AP_lshift(T x, int s);
extern T AP_rshift(T x, int s);
extern int AP_cmp (T x, T y);
extern int AP_cmpi(T x, long int y);
#undef T
#endif
|
/*
* base64.c: accord to rfc4648 implements base64
*
* Authors:
* mardyu<michealyxd@hotmail.com>
*
* Copyright 2016 mardyu<michealyxd@hotmail.com>
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include "base64.h"
#include <string.h>
static char const * const base_str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
static char const * const base_str_url = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";
static char const pad = '=';
#define BASE64_UNIT_LEN 4
#define BASE64_UNIT_LEN_MASK (BASE64_UNIT_LEN - 1)
#define BASE64_CEIL(num) ((num + BASE64_UNIT_LEN_MASK) & ~BASE64_UNIT_LEN_MASK)
static int _base64_encode(const char *in, const int len_in, char *out, const int len_out, const char *base_ab);
static int _base64_decode(const char *in, const int len_in, char *out, const int len_out, const char *base_ab);
int base64_encode(const char *in, const int len_in, char *out, const int len_out)
{
return _base64_encode(in, len_in, out, len_out, base_str);
}
int base64_url_encode(const char *in, const int len_in, char *out, const int len_out)
{
return _base64_encode(in, len_in, out, len_out, base_str_url);
}
int base64_encode_length(const int len)
{
return BASE64_CEIL((len * 8) / 6);
}
static int _base64_encode(const char *in, const int len_in
, char *out, const int len_out
, const char *base_ab)
{
if (base64_encode_length(len_in) > len_out)
return -1;
const unsigned char *i = in;
unsigned char *o = out;
int len_i = len_in;
unsigned int base = 0;
int len = 0;
while (len_i >= 3) {
base = 0;
base |= (*i++) << 16;
base |= (*i++) << 8;
base |= *i++;
o[len++] = base_ab[(base >> 18) & 0x3f];
o[len++] = base_ab[(base >> 12) & 0x3f];
o[len++] = base_ab[(base >> 6) & 0x3f];
o[len++] = base_ab[base & 0x3f];
len_i -= 3;
}
if (len_i == 0)
return len;
base = 0;
for (int j = 0; j < len_i; j++) {
base <<= 8;
base |= *i++;
}
for (int j = len_i; j < 3; j++) {
base <<= 8;
base |= 0;
}
for (int j = 0; j < 4; j++) {
o[len + 3 - j] = base_ab[base & 0x3f];
base >>= 6;
}
int len_pad = 4 - len_i - 1;
for (int j = 0; j < len_pad; j++) {
o[len + len_i + j + 1] = pad;
}
return len + 4;
}
int base64_decode(const char *in, const int len_in, char *out, const int len_out)
{
return _base64_decode(in, len_in, out, len_out, base_str);
}
int base64_url_decode(const char *in, const int len_in, char *out, const int len_out)
{
return _base64_decode(in, len_in, out, len_out, base_str_url);
}
int base64_decode_length(const int len)
{
return (len * 6 + 7) / 8;
}
static int _base64_decode(const char *in, const int len_in
, char *out, const int len_out
, const char *base_ab)
{
if (base64_decode_length(len_in) > len_out)
return -1;
const unsigned char *i = in;
unsigned char *o = out;
int len_i = len_in;
unsigned int base = 0;
int len = 0;
char *loc = NULL;
while (len_i > 4) {
base = 0;
for (int j = 0; j < 4; j++) {
loc = strchr(base_ab, *i++);
if (loc == NULL || loc - base_ab == 64)
return -2;
base <<= 6;
base |= (loc - base_ab);
}
o[len++] = (unsigned char)((base >> 16) & 0xff);
o[len++] = (unsigned char)((base >> 8) & 0xff);
o[len++] = (unsigned char)(base & 0xff);
len_i -= 4;
}
if (0 == len_i)
return len;
for (int j = 0; j < len_i; j++) {
loc = strchr(base_ab, *i++);
if (loc == NULL)
return -2;
if (loc - base_ab == 64) {
len_i = j;
break;
}
base <<= 6;
base |= (loc - base_ab);
}
if (0 == len_i)
return len;
for (int j = len_i; j < 4; j++) {
base <<= 6;
base |= 0;
}
int correction = 0;
switch (len_i)
{
case 4:
case 3:
o[len + 2] = (unsigned char)(base & 0xff);
case 2:
o[len + 1] = (unsigned char)((base >> 8) & 0xff);
correction = -1;
case 1:
o[len] = (unsigned char)((base >> 16) & 0xff);
break;
}
return len + len_i + correction;
}
|
#ifndef COLOR_H
#define COLOR_H
#ifdef OAK_COLORIZE
#define ERROR_MSG_COLOR "\x1B[1m\x1B[31m"
#define ERROR_HIGHLIGHT_COLOR "\x1B[1m\x1B[33m"
#define ERROR_NOTE_COLOR "\x1B[1m\x1B[34m"
#define ERROR_LOCATION_COLOR "\x1B[1m\x1B[37m"
#define RESET_COLOR "\x1B[0m"
#else
#define ERROR_MSG_COLOR ""
#define ERROR_HIGHLIGHT_COLOR ""
#define ERROR_NOTE_COLOR ""
#define ERROR_LOCATION_COLOR ""
#define RESET_COLOR ""
#endif
#endif
|
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HK_SERIALIZE_CONTENT_PREDICATE_H
#define HK_SERIALIZE_CONTENT_PREDICATE_H
/// This class represents a predicate that will be applied to data being serialized.
/// This is used in order to be able to peek at the content of a file without having
/// deserialize its content.
/// A predicate is a function matching the prototype: "bool pred(hkVariant obj)" and
/// which returns true if the predicate is valid for obj, false otherwise.
/// The predicate functions are registered through static constructors and the lists
/// are merged on DLL init through mergePredicateList().
class hkContentPredicate
{
public:
HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_SERIALIZE, hkContentPredicate);
// This enum must be complete (no holes). Don't change the values since
// this would break all existing assets.
enum PredicateIdEnum
{
NO_PREDICATE = 0,
// Some placeholder entries that can be used by code external to Havok
USER_PREDICATE_1 = 1,
USER_PREDICATE_2 = 2,
USER_PREDICATE_3 = 3,
USER_PREDICATE_4 = 4,
USER_PREDICATE_5 = 5,
USER_PREDICATE_6 = 6,
USER_PREDICATE_7 = 7,
USER_PREDICATE_8 = 8,
USER_PREDICATE_9 = 9,
USER_PREDICATE_10 = 10,
USER_PREDICATE_11 = 11,
USER_PREDICATE_12 = 12,
USER_PREDICATE_13 = 13,
USER_PREDICATE_14 = 14,
USER_PREDICATE_15 = 15,
USER_PREDICATE_16 = 16,
USER_PREDICATE_17 = 17,
USER_PREDICATE_18 = 18,
USER_PREDICATE_19 = 19,
// Havok internal predicates
HAS_ROOT_LEVEL_CONTAINER = 20,
// If you add a predicate ID here, please do it first on the Head to avoid having two different branches
// using the same ID for different predicates.
MAX_PREDICATE_ID
};
// At most 2^16 predicates.
HK_COMPILE_TIME_ASSERT(MAX_PREDICATE_ID <= 0xFFFF);
typedef hkEnum<PredicateIdEnum, hkUint16> PredicateId;
typedef bool (*PredicateFunctionType)(hkVariant obj);
/// Creating a hkContentPredicate registers it in the static linked list. This should only be called through
/// the HK_REGISTER_FILE_PREDICATE macro. The predicateName is purely cosmetic and is used to generate
/// human-readable comments in XML files.
hkContentPredicate(PredicateId id, const char* predicateName, PredicateFunctionType func);
/// Returns the head of the static linked list of predicates
static hkContentPredicate* getListHead() { return m_head; }
/// Performs a linear search through the static linked list for a specific predicate.
static hkContentPredicate* findPredicate(PredicateId id);
static hkContentPredicate* findPredicate(hkUint16 id) { return findPredicate(PredicateId(static_cast<PredicateIdEnum>(id))); }
/// Merges the elements from otherListHead into this static list.
static void mergePredicateList(hkContentPredicate* otherListHead);
/// Applies the predicate function to v and returns the result.
bool applyPredicate(hkVariant v) const { return m_predicate(v); }
/// Get the next predicate in the list.
hkContentPredicate* getNext() const { return m_next; }
/// Get the ID of this predicate.
PredicateId getId() const { return m_id; }
/// Get the name of this predicate.
const char* getName() const { return m_predicateName; }
private:
PredicateId m_id;
const char* m_predicateName;
PredicateFunctionType m_predicate;
hkContentPredicate* m_next;
static hkContentPredicate* m_head;
};
/// Macro used to register a predicate. It should be placed in a .cpp file.
/// The first argument is an ID from the PredicateIdEnum enum and the second is the name of a C++ function to be used as predicate.
#define HK_REGISTER_FILE_PREDICATE(ID, PREDICATE_FUNCTION) \
static const hkContentPredicate register_ ## PREDICATE_FUNCTION(hkContentPredicate::ID, #PREDICATE_FUNCTION, &PREDICATE_FUNCTION)
#endif
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
|
/*
* Generated by class-dump 3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard.
*/
#import "NSObject.h"
@interface MFMessageCounts : NSObject
{
unsigned long long _totalCount;
unsigned long long _unreadCount;
unsigned long long _unseenCount;
unsigned long long _deletedCount;
unsigned long long _unreadAdjustedForDuplicates;
}
@property(readonly, nonatomic) unsigned long long unreadAdjustedForDuplicates; // @synthesize unreadAdjustedForDuplicates=_unreadAdjustedForDuplicates;
@property(readonly, nonatomic) unsigned long long deletedCount; // @synthesize deletedCount=_deletedCount;
@property(readonly, nonatomic) unsigned long long unseenCount; // @synthesize unseenCount=_unseenCount;
@property(readonly, nonatomic) unsigned long long unreadCount; // @synthesize unreadCount=_unreadCount;
@property(readonly, nonatomic) unsigned long long totalCount; // @synthesize totalCount=_totalCount;
- (id)description;
- (id)initWithTotal:(unsigned long long)arg1 unread:(unsigned long long)arg2 unseen:(unsigned long long)arg3 deleted:(unsigned long long)arg4 unreadAdjustedForDuplicates:(unsigned long long)arg5;
@end
|
//
// PersonalViewController.h
// week_2_chat
//
// Created by Viet on 9/11/17.
// Copyright © 2017 Viet. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PersonalViewController : UIViewController<UITableViewDelegate, UITableViewDataSource>
@end
|
#ifndef MPOOL_H
#define MPOOL_H
#include <stddef.h>
typedef struct
{
void *head;
#ifdef SAFE // TODO
size_t size;
size_t chunk_size;
void *mem;
#endif
}
mpool_t;
void *mp_alloc(mpool_t *pool);
void mp_free(mpool_t *pool, void *ptr);
void mp_init(mpool_t *pool, size_t size, size_t chunk_size, void *mem);
#endif // MPOOL_H
|
/**
Protocol to define the methods that will be invoke by TransparentView.
**/
@protocol RoundedController
// Correspondence Info Methods
- (BOOL)shouldDisplayPlusMinusButtons;
- (NSString *)statusLine1;
- (NSString *)statusLine2;
- (NSString *)plusButtonStr;
- (NSString *)minusButtonStr;
- (NSString *)timeStr;
- (NSString *)leftButtonStr;
- (NSString *)rightButtonStr;
// Correspondence Action Methods
- (void)statusLineClicked;
- (void)plusButtonClicked;
- (void)minusButtonClicked;
- (void)leftButtonClicked;
- (void)rightButtonClicked;
- (BOOL)canSystemSleep;
- (NSCalendarDate *)systemWillSleep;
- (void)systemDidWake;
@end |
#ifndef VALKYRIE_TEST_VK_ENTITY_H_INCLUDED
#define VALKYRIE_TEST_VK_ENTITY_H_INCLUDED
#include "gtest/gtest.h"
#include "entity.h"
namespace
{
TEST (Entity, testId)
{
valkyrie::Entity entity(5);
ASSERT_EQ(entity.get_id(), 5) << "error in getting the 'id' of an entity !";
}
TEST (Entity, testName)
{
valkyrie::Entity entity1(5);
ASSERT_EQ(entity1.get_name(), "") << "error in getting the 'name' of an entity !";
valkyrie::Entity entity2(10, "truss");
ASSERT_EQ(entity2.get_name(), "truss") << "error in getting the 'name' of an entity !";
}
} //~ ns:
#endif // VALKYRIE_TEST_VK_ENTITY_H_INCLUDED
|
//
// TopDVDTableViewController.h
// RottenTomatoesClient
//
// Created by Kevin Ku on 6/8/14.
// Copyright (c) 2014 Kevin Ku. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MMProgressHUD/MMProgressHUD.h>
#import "RottenTomatoesInterface.h"
@interface TopDVDTableViewController : UITableViewController
@property (nonatomic, retain) NSArray *topDVDList;
@property (nonatomic) RottenTomatoesInterface *rti;
@end
|
#pragma once
#include "mc-cmd.h"
class mcCmdGet : public mcCommand {
public:
string command(void) { return "get"; }
void help(void);
mcLanguageState parse(mcScanner& scanner, mcIPerformer* performer);
};
|
//
// KKDropDownSubCell.h
// 小团购
//
// Created by Imanol on 9/29/15.
// Copyright (c) 2015 Imanol. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface KKDropDownSubCell : UITableViewCell
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
|
//
// JLNavgationController.h
// 仿汽车之家
//
// Created by long108 on 15/5/16.
// Copyright (c) 2015年 long108. All rights reserved.
//
#import <UIKit/UIKit.h>
@class JLNavgationBar;
@interface JLNavgationController : UINavigationController
@property(nonatomic,strong)JLNavgationBar *navBar;
@property(nonatomic,strong)NSArray *dataArray;
@end
|
#pragma once
#include <cmath>
struct pixel
{
unsigned char r,g,b;
pixel():r(0),g(0),b(0){};
pixel(char r, char g, char b):r(r),g(g),b(b){};
void operator += (const pixel& a){ r += a.r; g += a.g; b += a.b;}
void operator *= (const double& a){
r = static_cast<unsigned char>(r * a);
g = static_cast<unsigned char>(g * a);
b = static_cast<unsigned char>(b * a);
}
};
struct apixel {
unsigned char r,g,b,a;
apixel():a(0),r(0),g(0),b(0){};
apixel(char a, char r, char g, char b):a(a),r(r),g(g),b(b){};
operator pixel() { return pixel(r,g,b);};
};
struct fpixel {
double r,g,b;
fpixel():r(0),g(0),b(0){};
fpixel(double r, double g, double b):r(r),g(g),b(b){};
fpixel(pixel p) : r(p.r/255.0f), g(p.g/255.0f), b(p.b/255.0f) {}
fpixel(apixel p) : r(p.r/255.0f), g(p.g/255.0f), b(p.b/255.0f) {}
void operator += (const fpixel& v){ r += v.r; g += v.g; b += v.b;}
void operator += (const double& v){ r += v; g += v; b += v;}
void operator *= (const double& a){ r *= a; g *= a; b *=a;}
void operator *= (const fpixel& p){ r *= p.r; g *= p.g; b *=p.b;}
void operator /= (const double& a){ r /= a; g /= a; b /=a;}
void Set (const double& x){r=x;g=x;b=x;}
void Set (const double& xr, const double& xg, const double& xb){r=xr;g=xg;b=xb;}
void Pow(double p) {r = pow(r, p); g = pow(g, p); b = pow(b, p);};
};
inline fpixel operator * (const double& a, const fpixel& f){ return fpixel(f.r * a, f.g * a, f.b * a);}
inline fpixel operator * (const fpixel& f, const double& a){ return fpixel(f.r * a, f.g * a, f.b * a);}
inline fpixel operator + (const fpixel& a, const fpixel& b){ return fpixel(a.r + b.r, a.g + b.g, a.b + b.b);}
struct double2 {
double x,y;
double2():x(0),y(0){};
double2(double x, double y):x(x),y(y){};
void Set(const double& x_, const double& y_) { x = x_; y = y_; }
};
struct double3
{
/// Default constructor does nothing (for performance).
double3() {}
/// Construct using coordinates.
double3(double x, double y, double z) : x(x), y(y), z(z) {}
/// Set this vector to some specified coordinates.
void Set(const double& x_, const double& y_, const double& z_) { x = x_; y = y_; z = z_;}
/// Negate this vector.
double3 operator -() const { double3 v; v.Set(-x, -y, -z); return v; }
/// Add a vector to this vector.
void operator += (const double3& v){ x += v.x; y += v.y; z += v.z;}
/// Subtract a vector from this vector.
void operator -= (const double3& v){ x -= v.x; y -= v.y; z -= v.z;}
/// Multiply this vector by a scalar.
void operator *= (const double& a){ x *= a; y *= a; z *=a;}
/// Get the length of this vector (the norm).
double Length() const{ return sqrt(x * x + y * y + z * z);}
/// Get the length squared.
double Length2() const{ return x * x + y * y + z * z;}
/// Convert this vector into a unit vector. Returns the length.
void Normalize()
{
double length = Length();
double invLength = 1.0f / length;
x *= invLength;
y *= invLength;
z *= invLength;
}
void rotatex(const double& a)
{
double tmp = cos(a) * y - sin(a) * z;
z = sin(a) * y + cos(a) * z;
y = tmp;
}
void rotatey(const double& a)
{
double tmp = cos(a) * x + sin(a) * z;
z = - sin(a) * x + cos(a) * z;
x = tmp;
}
double x, y, z;
};
inline double3 operator + (const double3& a, const double3& b){ return double3(a.x + b.x, a.y + b.y, a.z + b.z);};
inline double3 operator - (const double3& a, const double3& b){ return double3(a.x - b.x, a.y - b.y, a.z - b.z);};
inline double3 operator * (const double a, const double3& b){ return double3(a * b.x, a * b.y, a * b.z);};
inline double3 operator * (const double3& b, double a){ return double3(a * b.x, a * b.y, a * b.z);};
inline double3 operator / (const double3& a, double b){ return double3(a.x / b, a.y / b, a.z / b);};
inline double dot (const double3& a, const double3& b){ return a.x * b.x + a.y * b.y + a.z * b.z;};
template<typename T>
inline T clamp(const T&, double a, double b);
template<>
inline double clamp(const double& v, double a, double b)
{
double x = v;
if (v < a) {x = a;}
if (v > b) {x = b;}
return x;
}
template<>
inline double3 clamp(const double3& v, double a, double b)
{
double3 x = v;
x.x = clamp(x.x, a, b);
x.y = clamp(x.y, a, b);
x.z = clamp(x.z, a, b);
return x;
}
template<>
inline double2 clamp(const double2& v, double a, double b)
{
double2 x = v;
x.x = clamp(x.x, a, b);
x.y = clamp(x.y, a, b);
return x;
}
inline int Round(double number)
{
return static_cast<int>(number < 0.0 ? ceil(number - 0.5) : floor(number + 0.5));
}
inline unsigned long long xorshf96(void) { //period 2^96-1
static unsigned long long x=123456789, y=362436069, z=521288629;
unsigned long long t;
x ^= x << 16;
x ^= x >> 5;
x ^= x << 1;
t = x;
x = y;
y = z;
z = t ^ x ^ y;
return z;
}
inline float erfinv(float x)
{
float w, p;
w = - logf((1.0f-x)*(1.0f+x));
if ( w < 5.000000f ) {
w = w - 2.500000f;
p = 2.81022636e-08f;
p = 3.43273939e-07f + p*w;
p = -3.5233877e-06f + p*w;
p = -4.39150654e-06f + p*w;
p = 0.00021858087f + p*w;
p = -0.00125372503f + p*w;
p = -0.00417768164f + p*w;
p = 0.246640727f + p*w;
p = 1.50140941f + p*w;
}
else {
w = sqrtf(w) - 3.000000f;
p = -0.000200214257f;
p = 0.000100950558f + p*w;
p = 0.00134934322f + p*w;
p = -0.00367342844f + p*w;
p = 0.00573950773f + p*w;
p = -0.0076224613f + p*w;
p = 0.00943887047f + p*w;
p = 1.00167406f + p*w;
p = 2.83297682f + p*w;
}
return p*x;
}
inline float fastNormal(float a = 0.0f, float b = 1.0f)
{
unsigned long long r = xorshf96() ;
int x = r & (256 * 256 - 1);
float v = ((float)x) / (256 * 256);
v = a + v * (b - a);
float nn = erfinv(v);
reinterpret_cast<int&>(nn) = (reinterpret_cast<int&>(nn) & 0x7FFFFFFF) | ((r & (256 * 256)) << 15);
return nn;
}
|
#ifndef __CLTOP_H
#define __CLTOP_H
#include "libcl.h"
#include "clpopen.h"
#endif
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "DVTFilePath.h"
@interface DVTFilePath (DVTFileIconAdditions)
- (id)dvt_fileIconUndecorated;
- (id)dvt_fileIcon;
@end
|
#ifndef SerialSenderReceiver_H
#define SerialSenderReceiver_H
// #include <aJSON.h> // https://github.com/interactive-matter/aJson
class SerialCommnder
{
public:
SerialCommnder();
bool receive_exec_command();
void send_command_complete(int function_code, int status_code);
void send_sensor_readings(int front_value, int front_left_value, int front_right_value, int left_value, int right_value, int side_ultra_value);
void send_ready_signal();
int get_command();
private:
int command;
bool is_started;
bool exec_command(int function_code, double parameter);
void routine_clean(int function_code);
};
#endif
|
#pragma once
#include <FangameEvents.h>
namespace Fangame {
//////////////////////////////////////////////////////////////////////////
// Action that fires another given action after a certain period of time has passed.
template <class... ActionArgs>
class CDelayedTimerAction : public IAction<void( const CUpdateEvent& )> {
public:
CDelayedTimerAction( double delay, CActionOwner<void( ActionArgs... )> action, ActionArgs... args );
virtual void Invoke( const CUpdateEvent& ) const override final;
private:
DWORD startTime;
DWORD delayMs;
// Delayed action.
CActionOwner<void( ActionArgs... )> action;
CTuple<ActionArgs...> args;
};
//////////////////////////////////////////////////////////////////////////
template <class... ActionArgs>
CDelayedTimerAction<ActionArgs...>::CDelayedTimerAction( double _delay, CActionOwner<void( ActionArgs... )> _action, ActionArgs... _args ) :
delayMs( Round( _delay * 1000 ) ),
action( move( _action ) ),
args( forward<ActionArgs>( _args )... ),
startTime( ::GetTickCount() )
{
}
template <class... ActionArgs>
void CDelayedTimerAction<ActionArgs...>::Invoke( const CUpdateEvent& e ) const
{
const auto timeDelta = ::GetTickCount() - startTime;
if( timeDelta > delayMs ) {
auto timer = e.GetVisualizer().DetachTimerEvent( this );
TupleInvoke( action, args );
}
}
//////////////////////////////////////////////////////////////////////////
} // namespace Fangame.
|
//
// LTBadgeView.h
// YJNew
//
// Created by yelon on 16/3/16.
// Copyright © 2016年 yelon. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LTBadgeView : UIView
@property(nonatomic,strong,readonly) UILabel *badgeLabel;
@property(nonatomic,assign) NSString *badge;
@property(nonatomic,assign) UIColor *badgeTextColor;
@property(nonatomic,assign) UIColor *badgeColor;
@end
|
/* @(#)e_log.c 1.3 95/01/18 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/* __ieee754_log(x)
* Return the logrithm of x
*
* Method :
* 1. Argument Reduction: find k and f such that
* x = 2^k * (1+f),
* where sqrt(2)/2 < 1+f < sqrt(2) .
*
* 2. Approximation of log(1+f).
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
* = 2s + s*R
* We use a special Reme algorithm on [0,0.1716] to generate
* a polynomial of degree 14 to approximate R The maximum error
* of this polynomial approximation is bounded by 2**-58.45. In
* other words,
* 2 4 6 8 10 12 14
* R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
* (the values of Lg1 to Lg7 are listed in the program)
* and
* | 2 14 | -58.45
* | Lg1*s +...+Lg7*s - R(z) | <= 2
* | |
* Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
* In order to guarantee error in log below 1ulp, we compute log
* by
* log(1+f) = f - s*(f - R) (if f is not too large)
* log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
*
* 3. Finally, log(x) = k*ln2 + log(1+f).
* = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
* Here ln2 is split into two floating point number:
* ln2_hi + ln2_lo,
* where n*ln2_hi is always exact for |n| < 2000.
*
* Special cases:
* log(x) is NaN with signal if x < 0 (including -INF) ;
* log(+INF) is +INF; log(0) is -INF with signal;
* log(NaN) is that NaN with no signal.
*
* Accuracy:
* according to an error analysis, the error is always less than
* 1 ulp (unit in the last place).
*
* Constants:
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
#include "fdlibm.h"
#ifdef __STDC__
static const double
#else
static double
#endif
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
static double zero = 0.0;
#ifdef __STDC__
double __ieee754_log(double x)
#else
double __ieee754_log(x)
double x;
#endif
{
double hfsq,f,s,z,R,w,t1,t2,dk;
int k,hx,i,j;
unsigned lx;
hx = __HI(x); /* high word of x */
lx = __LO(x); /* low word of x */
k=0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx&0x7fffffff)|lx)==0)
return -two54/zero; /* log(+-0)=-inf */
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
k -= 54; x *= two54; /* subnormal number, scale up x */
hx = __HI(x); /* high word of x */
}
if (hx >= 0x7ff00000) return x+x;
k += (hx>>20)-1023;
hx &= 0x000fffff;
i = (hx+0x95f64)&0x100000;
__HI(x) = hx|(i^0x3ff00000); /* normalize x or x/2 */
k += (i>>20);
f = x-1.0;
if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */
if(f==zero){ if(k==0) return zero; else {dk=(double)k;
return dk*ln2_hi+dk*ln2_lo;}}
R = f*f*(0.5-0.33333333333333333*f);
if(k==0) return f-R; else {dk=(double)k;
return dk*ln2_hi-((R-dk*ln2_lo)-f);}
}
s = f/(2.0+f);
dk = (double)k;
z = s*s;
i = hx-0x6147a;
w = z*z;
j = 0x6b851-hx;
t1= w*(Lg2+w*(Lg4+w*Lg6));
t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
i |= j;
R = t2+t1;
if(i>0) {
hfsq=0.5*f*f;
if(k==0) return f-(hfsq-s*(hfsq+R)); else
return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
} else {
if(k==0) return f-s*(f-R); else
return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
}
}
|
//===- ProfileInfoLoader.h - Load & convert profile information -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// The ProfileInfoLoader class is used to load and represent profiling
// information read in from the dump file. If conversions between formats are
// needed, it can also do this.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ANALYSIS_PROFILEINFOLOADER_H
#define LLVM_ANALYSIS_PROFILEINFOLOADER_H
#include <vector>
#include <string>
#include <utility>
namespace llvm {
class Module;
class Function;
class BasicBlock;
class ProfileInfoLoader {
const std::string &Filename;
Module &M;
std::vector<std::string> CommandLines;
std::vector<unsigned> FunctionCounts;
std::vector<unsigned> BlockCounts;
std::vector<unsigned> EdgeCounts;
std::vector<unsigned> OptimalEdgeCounts;
std::vector<unsigned> BBTrace;
bool Warned;
public:
// ProfileInfoLoader ctor - Read the specified profiling data file, exiting
// the program if the file is invalid or broken.
ProfileInfoLoader(const char *ToolName, const std::string &Filename,
Module &M);
static const unsigned Uncounted;
unsigned getNumExecutions() const { return CommandLines.size(); }
const std::string &getExecution(unsigned i) const { return CommandLines[i]; }
const std::string &getFileName() const { return Filename; }
// getRawFunctionCounts - This method is used by consumers of function
// counting information.
//
const std::vector<unsigned> &getRawFunctionCounts() const {
return FunctionCounts;
}
// getRawBlockCounts - This method is used by consumers of block counting
// information.
//
const std::vector<unsigned> &getRawBlockCounts() const {
return BlockCounts;
}
// getEdgeCounts - This method is used by consumers of edge counting
// information.
//
const std::vector<unsigned> &getRawEdgeCounts() const {
return EdgeCounts;
}
// getEdgeOptimalCounts - This method is used by consumers of optimal edge
// counting information.
//
const std::vector<unsigned> &getRawOptimalEdgeCounts() const {
return OptimalEdgeCounts;
}
};
} // End llvm namespace
#endif
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
@class AudioPlayerUserData;
@protocol SilkAudioPlayerDelegate
@optional
- (_Bool)onSilkEndDontNotifyOtherApp;
- (void)onSilkEarTip;
- (void)onSilkEndPlaying:(AudioPlayerUserData *)arg1 isForceStop:(_Bool)arg2;
- (void)onSilkBeginPlaying:(AudioPlayerUserData *)arg1 ErrNo:(int)arg2;
- (void)onSilkLevelMeter:(AudioPlayerUserData *)arg1 Peak:(float)arg2;
@end
|
/*
* This file is part of the UnTech Editor Suite.
* Copyright (c) 2016 - 2021, Marcus Rowe <undisbeliever@gmail.com>.
* Distributed under The MIT License: https://opensource.org/licenses/MIT
*/
#pragma once
#include "snescolor.h"
#include "models/common/rgba.h"
namespace UnTech::Snes {
inline SnesColor toSnesColor(const rgba& color)
{
// Ignoring rounding so converting SNES->RGB->SNES is lossless
unsigned b = (color.blue >> 3) & 31;
unsigned g = (color.green >> 3) & 31;
unsigned r = (color.red >> 3) & 31;
return SnesColor((b << 10) | (g << 5) | r);
}
inline rgba toRgb(const SnesColor& c)
{
// ::KUDOS ccovell http://forums.nesdev.com/viewtopic.php?p=146491#p146491::
unsigned b = c.blue();
unsigned g = c.green();
unsigned r = c.red();
return rgba((r << 3) | (r >> 2),
(g << 3) | (g >> 2),
(b << 3) | (b >> 2));
}
}
|
//
// UIFont+AppFonts.h
// Philips Questionaire
//
// Created by HAI on 5/8/15.
// Copyright (c) 2015 HAI. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIFont (AppFonts)
+ (CGFloat)appFontSize;
+ (UIFont *)appFont;
+ (UIFont *)appFontOfSize:(float)fontSize;
+ (UIFont *)boldAppFont;
+ (UIFont *)boldAppFontOfSize:(float)fontSize;
+ (UIFont *)italicAppFont;
+ (UIFont *)italicAppFontOfSize:(float)fontSize;
+ (UIFont *)boldItalicAppFont;
+ (UIFont *)italicBoldAppFont;
+ (UIFont *)italicBoldAppFontOfSize:(float)fontSize;
+ (UIFont *)boldItalicAppFontOfSize:(float)fontSize;
@end
|
/*
* @file ibv_controller_worker_messages_ada.h
* @date 11 Feb 2018
* @author Chester Gillon
* @brief Wrapper for ibv_controller_worker_messages.h to allow generation of Ada specs by by the GNAT g++ -dump-ada-spec option.
* @details This:
* a) Includes the other files required by ibv_controller_worker_messages.h
* b) Wraps the definitions in an extern "C" block since g++ is used to create the Ada specs
* to preserve the procedure argument names, while maintaining the C linkage rather than C++ mangled names.
*/
#ifndef IBV_CONTROLLER_WORKER_MESSAGES_ADA_H_
#define IBV_CONTROLLER_WORKER_MESSAGES_ADA_H_
extern "C" {
#include <stdint.h>
#include <limits.h>
#include "ibv_controller_worker_messages.h"
}
#endif /* IBV_CONTROLLER_WORKER_MESSAGES_ADA_H_ */
|
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// fxc /nologo RepeatingGrid.hlsl /Tps_4_0 /Zi /Zpc /Qstrip_reflect
// /Qstrip_debug /EPS_MainXZ /FhRepeatingGrid_PS_MainXZ.h
// /VnRepeatingGrid_PS_MainXZ
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_POSITION 0 xyzw 0 POS float
// NORMAL 0 xyz 1 NONE float x z
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_4_0
dcl_constantbuffer cb0[1], immediateIndexed
dcl_input_ps linear v1.xz
dcl_output o0.xyzw
dcl_temps 2
add r0.xy, v1.xzxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r0.xy, r0.xyxx
add r0.xy, r0.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
deriv_rtx r0.zw, v1.xxxz
deriv_rty r1.xy, v1.xzxx
add r0.zw, |r0.zzzw|, |r1.xxxy|
div r0.xy, |r0.xyxx|, r0.zwzz
min r0.x, r0.y, r0.x
min r0.x, r0.x, l(1.000000)
mad r0.x, -r0.x, cb0[0].y, l(1.000000)
mul o0.xyz, r0.xxxx, cb0[0].xxxx
mov o0.w, l(1.000000)
ret
// Approximately 0 instruction slots used
#endif
const BYTE RepeatingGrid_PS_MainXZ[] =
{
68, 88, 66, 67, 143, 107,
168, 96, 177, 196, 140, 127,
35, 97, 45, 119, 232, 231,
158, 136, 1, 0, 0, 0,
96, 2, 0, 0, 3, 0,
0, 0, 44, 0, 0, 0,
128, 0, 0, 0, 180, 0,
0, 0, 73, 83, 71, 78,
76, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
68, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 5, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0,
78, 79, 82, 77, 65, 76,
0, 171, 79, 83, 71, 78,
44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171,
83, 72, 68, 82, 164, 1,
0, 0, 64, 0, 0, 0,
105, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 98, 16, 0, 3,
82, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 104, 0, 0, 2,
2, 0, 0, 0, 0, 0,
0, 10, 50, 0, 16, 0,
0, 0, 0, 0, 134, 16,
16, 0, 1, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 191, 0, 0, 0, 191,
0, 0, 0, 0, 0, 0,
0, 0, 26, 0, 0, 5,
50, 0, 16, 0, 0, 0,
0, 0, 70, 0, 16, 0,
0, 0, 0, 0, 0, 0,
0, 10, 50, 0, 16, 0,
0, 0, 0, 0, 70, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 191, 0, 0, 0, 191,
0, 0, 0, 0, 0, 0,
0, 0, 11, 0, 0, 5,
194, 0, 16, 0, 0, 0,
0, 0, 6, 24, 16, 0,
1, 0, 0, 0, 12, 0,
0, 5, 50, 0, 16, 0,
1, 0, 0, 0, 134, 16,
16, 0, 1, 0, 0, 0,
0, 0, 0, 9, 194, 0,
16, 0, 0, 0, 0, 0,
166, 14, 16, 128, 129, 0,
0, 0, 0, 0, 0, 0,
6, 4, 16, 128, 129, 0,
0, 0, 1, 0, 0, 0,
14, 0, 0, 8, 50, 0,
16, 0, 0, 0, 0, 0,
70, 0, 16, 128, 129, 0,
0, 0, 0, 0, 0, 0,
230, 10, 16, 0, 0, 0,
0, 0, 51, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 26, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
51, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 50, 0,
0, 11, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 128, 65, 0, 0, 0,
0, 0, 0, 0, 26, 128,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
56, 0, 0, 8, 114, 32,
16, 0, 0, 0, 0, 0,
6, 0, 16, 0, 0, 0,
0, 0, 6, 128, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 54, 0, 0, 5,
130, 32, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 62, 0,
0, 1
};
|
#ifndef __wav_h__
#define __wav_h__
#include <stdio.h>
#include <io.h>
typedef unsigned char uint8_t;
//typedef unsigned int uint16_t;
typedef unsigned long uint32_t;
#define WAV_BUFFER_SIZE 512
#define WAV_DATA_OFFSET 44
typedef struct{
unsigned short format;
unsigned short channels;
unsigned long sampleRate;
unsigned long byteRate;
unsigned short blockAlign;
unsigned short bitsPerSample;
}audio_format_t;
typedef struct{
uint16_t length;
uint16_t offset;
uint8_t data [WAV_BUFFER_SIZE];
}audio_buffer_t;
typedef struct{
FILE *fp;
uint16_t frequency;
audio_buffer_t audioBuffer[2];
audio_buffer_t* audioBufferUse;
audio_buffer_t* audioBufferLoad;
}wav_t;
wav_t* openWAV(char *path);
void closeWAV(wav_t* wav);
uint8_t getSample(wav_t *wav);
void switchWAVBuffer(wav_t *wav);
uint8_t readWAVBuffer(wav_t *wav);
#endif
|
//
// TUMusicHelper.h
// TUSmartSpeaker
//
// Created by chengxianghe on 16/5/1.
// Copyright © 2016年 ITwU. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface TUMusicHelper : NSObject
+ (NSString *)stringWithCount:(NSInteger)count;
+ (NSString *)stringWithDuration:(NSInteger)stringWithDuration;
@end
@interface NSString (Blank)
- (NSString *)insertBlank;
- (NSString *)insertBlankWithNumber:(NSInteger)count;
- (NSString *)appendBlankWithNumber:(NSInteger)count;
@end
|
//
// CZViewTests.h
// CZKit
//
// Created by Carter Allen on 1/2/11.
// Copyright 2011 Opt-6 Products, LLC. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
#import <CZKit/CZKit.h>
@interface CZViewTests : SenTestCase {}
@property (nonatomic, retain) CZView *view;
@end |
//
// TYBaseViewController.h
// TYSnapshotScroll
//
// Created by Tony on 2016/7/11.
// Copyright © 2016年 TonyReet. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TYBaseViewController : UIViewController
@property (nonatomic,copy) NSArray *dataSourceArr;
@end
|
#include <string.h>
#include "edna.h"
int
cmd_delete (State *st, Buffer *buf, Arg *arg, char *error)
{
Line *targ;
targ = *arg->sel->v;
if (rmline(buf, targ)) {
strcpy (error, "empty selection");
return -1;
}
return 0;
}
|
#ifndef __RIGID_ALIGNMENT_ITK_WRAPPER_H__
#define __RIGID_ALIGNMENT_ITK_WRAPPER_H__
#include <armadillo>
#include <vnl/vnl_vector.h>
#include "mesh/Mesh.h"
#include "optimization/rigidalignment/Transformation.h"
#include "optimization/rigidalignment/TransformationEnum.h"
namespace rigidAlignment{
/* class containing static methods from converting between ITK data structures
* and energy data structures
*/
class ITKWrapper{
public:
/*--------------------------------------------------------------------------*/
/* converts from a vnl_vector to transformation */
static void vnl_vector_to_transformation(
const vnl_vector<double>& x,
Transformation& transformation,
const Mesh& mesh
) {
// first read translation
const double& tx = x[TX];
const double& ty = x[TY];
const double& tz = x[TZ];
// read scaling
const double& sx = x[SX];
const double& sy = x[SY];
const double& sz = x[SZ];
// read rotation angles
const double& alpha = x[ALPHA];
const double& beta = x[BETA];
const double& gamma = x[GAMMA];
Translation translation(tx, ty, tz);
Scaling scaling(sx, sy, sz);
transformation = Transformation(
translation,
scaling,
alpha,
beta,
gamma
);
transformation.set_origin(mesh.get_center());
}
/*--------------------------------------------------------------------------*/
};
}
#endif
|
//===-- SBReproducer.h ------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_API_SBREPRODUCER_H
#define LLDB_API_SBREPRODUCER_H
#include "lldb/API/SBDefines.h"
namespace lldb {
/// The SBReproducer class is special because it bootstraps the capture and
/// replay of SB API calls. As a result we cannot rely on any other SB objects
/// in the interface or implementation of this class.
class LLDB_API SBReproducer {
public:
static const char *Capture();
static const char *Capture(const char *path);
static const char *Replay(const char *path);
static const char *Replay(const char *path, bool skip_version_check);
static const char *GetPath();
static bool Generate();
};
} // namespace lldb
#endif
|
//
// Created by Dmitry Korotchenkov on 23/03/15.
// Copyright (c) 2015 BlueBird LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface AlertHelper : NSObject
+ (void)showAlertWithTitle:(NSString *)title message:(NSString *)message;
+ (void)showAlertWithMessage:(NSString *)message;
+ (void)showDefaultError;
@end |
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tcomp_dicts.c
* @brief SigComp Dictionaries
*
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
*
*/
#include "tcomp_dicts.h"
#include "tcomp_buffer.h"
#include "tcomp_rfc3485_dictionary_sip.h"
#include "tcomp_rfc5112_dictionary_presence.h"
#include "tsk_debug.h"
/**Presence-Specific Static Dictionary for Signaling Compression as per RFC 5112.
*/
tcomp_dictionary_t* tcomp_dicts_create_presence_dict()
{
static const char *pres_dict_data = RFC5112_DICTIONARY_PRESENCE_VALUE;
static tcomp_dictionary_t * pres_dict = tsk_null;
if(!pres_dict){
pres_dict = tcomp_state_create(
RFC5112_DICTIONARY_PRESENCE_VALUE_LENGTH,
RFC5112_DICTIONARY_PRESENCE_STATE_ADDRESS,
RFC5112_DICTIONARY_PRESENCE_STATE_INSTRUCTION,
RFC5112_DICTIONARY_PRESENCE_MINIMUM_ACCESS_LENGTH,
65535);
if(pres_dict){
tcomp_buffer_referenceBuff(pres_dict->value, (uint8_t*)pres_dict_data, RFC5112_DICTIONARY_PRESENCE_VALUE_LENGTH);
tcomp_state_makeValid(pres_dict);
TSK_DEBUG_INFO("SigComp - Presence dict State id=");
tcomp_buffer_print(pres_dict->identifier);
}
else{
TSK_DEBUG_ERROR("Failed to create Presence dictionary.");
}
}
return tsk_object_ref(pres_dict);
}
/**The Session Initiation Protocol (SIP) and Session Description Protocol (SDP) Static Dictionary for Signaling Compression as per RFC 3485.
*/
tcomp_dictionary_t* tcomp_dicts_create_sip_dict()
{
static const char *sip_dict_data = RFC3485_DICTIONARY_SIP_VALUE;
static tcomp_dictionary_t *sip_dict = tsk_null;
if(!sip_dict){
sip_dict = tcomp_state_create(
RFC3485_DICTIONARY_SIP_VALUE_LENGTH,
RFC3485_DICTIONARY_SIP_STATE_ADDRESS,
RFC3485_DICTIONARY_SIP_STATE_INSTRUCTION,
RFC3485_DICTIONARY_SIP_MINIMUM_ACCESS_LENGTH,
65535);
if(sip_dict){
tcomp_buffer_referenceBuff(sip_dict->value, (uint8_t*)sip_dict_data, RFC3485_DICTIONARY_SIP_VALUE_LENGTH);
tcomp_state_makeValid(sip_dict);
TSK_DEBUG_INFO("SigComp - SIP dict State id=");
tcomp_buffer_print(sip_dict->identifier);
}
else{
TSK_DEBUG_ERROR("Failed to create SIP/SDP dictionary.");
}
}
return tsk_object_ref(sip_dict);
}
|
//
// NSDateFormatter+Utilities.h
// DRYV
//
// Created by Jeffrey Camealy on 5/13/13.
// Copyright (c) 2013 Ora Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDateFormatter (Utilities)
/**
* Returns a date based on a common format.
*
* formatter.dateFormat = @"M/d/yyyy h:mm a"
* ex: @"8/23/1985 3:45 PM"
*
*/
+ (NSDate *)dateWithCommonFormatString:(NSString *)dateString;
@end
|
//
// BC3DIndex.h
// DictionaryExplorer
//
// Created by Bartosz Ciechanowski on 07.04.2014.
// Copyright (c) 2014 Bartosz Ciechanowski. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BC3DIndex : NSObject <NSCopying>
@property (nonatomic, readonly) NSUInteger i, j, k; // you actually can do that
- (instancetype)initWithI:(NSUInteger)i j:(NSUInteger)j k:(NSUInteger)k;
@end
|
/*
* The MIT License
*
* Copyright © 2016 2sui.
*
* 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 QP_POOL_CORE_H
#define QP_POOL_CORE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../qp_pool.h"
#include "qp_memory_core.h"
struct qp_pool_elm_s {
struct qp_list_s next;
struct qp_pool_s* root;
};
struct qp_pool_s {
struct qp_list_s free;
qp_uchar_t* room; /* data room */
void* info_node; /* stored info related to this pool */
size_t nsize; /* max element number */
size_t esize; /* element size */
size_t nfree;
bool is_inited;
bool is_alloced;
};
struct qp_manager_elm_s {
struct qp_queue_s queue; // pools_queue
struct qp_list_s link; // available_pools
struct qp_pool_s pool; // single memory pool
struct qp_manager_s* manager; // manager
};
struct qp_manager_s {
struct qp_queue_s pools_queue; /* queue of pools */
struct qp_list_s available_pools; /* pools that still available */
size_t pool_count; /* pool count in queue */
size_t nfree; /* totol free element in manager */
size_t esize; /* size per element in pool */
size_t ecount; /* element number in pool */
bool is_inited;
bool is_alloced;
};
static inline bool
qp_pool_is_inited(qp_pool_t pool)
{
return pool ? pool->is_inited : false;
}
static inline bool
qp_pool_is_alloced(qp_pool_t pool)
{
return pool ? pool->is_alloced : false;
}
static inline bool
qp_manager_is_inited(qp_manager_t manager)
{
return manager ? manager->is_inited : false;
}
static inline bool
qp_manager_is_alloced(qp_manager_t manager)
{
return manager ? manager->is_alloced : false;
}
#ifdef __cplusplus
}
#endif
#endif /* QP_POOL_CORE_H */
|
/*
* test.h
*
* Created on: Apr 1, 2015
* Author: megaboz
*/
#ifndef TEST_H_
#define TEST_H_
#endif /* TEST_H_ */
|
//
// AMScrollingNavbarTableViewController.h
// AMScrollingNavbarViewController
//
// Created by Andrea on 04/12/13.
// Copyright (c) 2013 Andrea Mazzini. All rights reserved.
//
@interface AMScrollingNavbarTableViewController : UITableViewController
/**-----------------------------------------------------------------------------
* @name AMScrollingNavbarTableViewController
* -----------------------------------------------------------------------------
*/
/** Scrolling init method
*
* Enables the scrolling on a generic UIView.
*
* @param scrollableView The UIView where the scrolling is performed.
*/
- (void)followScrollView:(UIView*)scrollableView;
/** Navbar slide down
*
* Manually show the navbar
*/
- (void)showNavbar;
/** Navbar refresh
*
* Use this method when you manually change the navbar items to re-enable the fadeout
*/
- (void)refreshNavbar;
@end
|
//
// BinarySearchTree.h
// Algorithms2
//
// Created by Gil Beyruth on 4/25/17.
// Copyright © 2017 Gil Beyruth. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Node.h"
@interface BinarySearchTree : NSObject
@property(nonatomic, strong) Node * root;
@property(nonatomic, strong) Node * curr;
@end
|
void delaym(int );
//millisec delay
void delayms(int );
//Fn for datawrite into display
void spi_write(u08 );
//Fn to print a string in location (x,y)
void LCDSTR(char *,u08 ,u08 ,u08 );
//Fn to indicate ON/OFF , YES/NO , En/Dis
//fl --> invert color
void LCDNF(u08 ,u08 ,u08 ,u08 );
//Fn to print the integers directly
//st--> invert color
void LCDDEC(u08 ,u08 );
//Fn to print a u08
void LCDDIR(u08 );
//Set the position of cursor
void LCDGOTOXY(u08 ,u08 );
//NO NEED
void LCDEN(char *,u08 ,u08 );
//Fn to display highlighted menu
void LCDMEN(char *,u08 ,u08 );
//Initialize LCD
void LCDINI();
//To print borders alone
void LCDBRD();
|
//
// SuPhotoBrowser.h
// LazyWeather
//
// Created by KevinSu on 15/12/6.
// Copyright © 2015年 SuXiaoMing. All rights reserved.
//
#import "SuPhotoBaseController.h"
#import "SuPhotoBrowser.h"
@interface SuPhotoAblumList : SuPhotoBaseController
@property (nonatomic, strong) NSArray * assetCollections; //相册列表
@end
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtSerialBus module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later 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 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QCANBUSDEVICE_H
#define QCANBUSDEVICE_H
#include <QtCore/qobject.h>
#include <QtSerialBus/qcanbusframe.h>
QT_BEGIN_NAMESPACE
class QCanBusDevicePrivate;
class Q_SERIALBUS_EXPORT QCanBusDevice : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QCanBusDevice)
Q_DISABLE_COPY(QCanBusDevice)
public:
enum CanBusError {
NoError,
ReadError,
WriteError,
ConnectionError,
ConfigurationError,
UnknownError
};
Q_ENUM(CanBusError)
enum CanBusDeviceState {
UnconnectedState,
ConnectingState,
ConnectedState,
ClosingState
};
Q_ENUM(CanBusDeviceState)
enum ConfigurationKey {
RawFilterKey = 0,
ErrorFilterKey,
LoopbackKey,
ReceiveOwnKey,
BitRateKey,
CanFdKey,
UserKey = 30
};
Q_ENUM(ConfigurationKey)
struct Filter
{
enum FormatFilter {
MatchBaseFormat = 0x0001,
MatchExtendedFormat = 0x0002,
MatchBaseAndExtendedFormat = 0x0003,
};
Q_DECLARE_FLAGS(FormatFilters, FormatFilter)
quint32 frameId = 0;
quint32 frameIdMask = 0;
QCanBusFrame::FrameType type = QCanBusFrame::InvalidFrame;
FormatFilter format = MatchBaseAndExtendedFormat;
};
explicit QCanBusDevice(QObject *parent = nullptr);
virtual void setConfigurationParameter(int key, const QVariant &value);
QVariant configurationParameter(int key) const;
QVector<int> configurationKeys() const;
virtual bool writeFrame(const QCanBusFrame &frame) = 0;
QCanBusFrame readFrame();
qint64 framesAvailable() const;
qint64 framesToWrite() const;
virtual bool waitForFramesWritten(int msecs);
virtual bool waitForFramesReceived(int msecs);
// TODO rename these once QIODevice dependency has been removed
bool connectDevice();
void disconnectDevice();
CanBusDeviceState state() const;
CanBusError error() const;
QString errorString() const;
virtual QString interpretErrorFrame(const QCanBusFrame &errorFrame) = 0;
Q_SIGNALS:
void errorOccurred(QCanBusDevice::CanBusError);
void framesReceived();
void framesWritten(qint64 framesCount);
void stateChanged(QCanBusDevice::CanBusDeviceState state);
protected:
void setState(QCanBusDevice::CanBusDeviceState newState);
void setError(const QString &errorText, QCanBusDevice::CanBusError);
void enqueueReceivedFrames(const QVector<QCanBusFrame> &newFrames);
void enqueueOutgoingFrame(const QCanBusFrame &newFrame);
QCanBusFrame dequeueOutgoingFrame();
bool hasOutgoingFrames() const;
// TODO Remove once official plugin system is gone
// Can be folded into one call to connectDevice() & disconnectDevice()
virtual bool open() = 0;
virtual void close() = 0;
};
Q_DECLARE_TYPEINFO(QCanBusDevice::CanBusError, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QCanBusDevice::CanBusDeviceState, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QCanBusDevice::ConfigurationKey, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QCanBusDevice::Filter, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QCanBusDevice::Filter::FormatFilter, Q_PRIMITIVE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(QCanBusDevice::Filter::FormatFilters)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QCanBusDevice::Filter::FormatFilter)
Q_DECLARE_METATYPE(QList<QCanBusDevice::Filter>)
#endif // QCANBUSDEVICE_H
|
//
// BXTWMockListItem.h
// VizzleTest
//
// Created by moxin on 15/7/21.
// Copyright (c) 2015年 VizLab. All rights reserved.
//
#import "BXTWMockItem.h"
@interface BXTWMockListItem : BXTWMockItem
@property(nonatomic,strong)NSString *headPic;
@property(nonatomic,strong)NSString *userNick;
@property(nonatomic,strong)NSString *servicePicUrl;
@end
|
/************************************************************************/
/* */
/* FillPat.c -- Pattern Table for Area Fill */
/* */
/************************************************************************/
/* Author: Gene Apperson */
/* Copyright 2011, Digilent Inc. */
/************************************************************************/
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) 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; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/************************************************************************/
/* Module Description: */
/* */
/* This module contains the data definitions for an set of8x8 pixel */
/* patterns used for area fill. */
/* */
/* This pattern table is defined for a display where each byte */
/* represents 8 vertical pixels and consecutive bytes give adjacent */
/* sets of 8 vertical pixels progressing to the right across the */
/* display. This is rotated 90 degrees from the conventional video */
/* display orientation. */
/* */
/************************************************************************/
/* Revision History: */
/* */
/* 06/08/2011(GeneA): created */
/* */
/************************************************************************/
/* ------------------------------------------------------------ */
/* Include File Definitions */
/* ------------------------------------------------------------ */
#ifdef __XC32
#include <xc.h> /* Defines special function registers, CP0 regs */
#endif
#include <stdint.h>
#include "OLED.h"
//#include <p32xxxx.h>
//#include <plib.h>
/* ------------------------------------------------------------ */
/* Global Variables */
/* ------------------------------------------------------------ */
const BYTE rgbFillPat[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 0x01
0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, // 0x02
0x11, 0x44, 0x00, 0x11, 0x44, 0x00, 0x11, 0x44, // 0x03
0x92, 0x45, 0x24, 0x92, 0x45, 0x24, 0x92, 0x45, // 0x04
0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, // 0x05
0x22, 0x11, 0x22, 0x00, 0x22, 0x11, 0x22, 0x00, // 0x06
0x11, 0x22, 0x11, 0x00, 0x11, 0x22, 0x11, 0x00 // 0x07
};
/* ------------------------------------------------------------ */
/************************************************************************/
|
//
// WeatherDriver+Helper.h
// AmazingWeather
//
// Created by Darednaxella on 3/4/14.
//
//
#import "WeatherDriver.h"
@interface WeatherDriver (Helper)
-(id)fetchDictKey:(NSString*)key fromDictionary:(NSDictionary*)sourceDict;
-(void) getJSONFromServer:(NSString *)urlString;
-(double) convertDegrees:(double)temperature
fromUnit:(NSString *)unitFrom
toUnit:(NSString *)unitTo;
-(NSString *) getWindDirectionDisplay: (double)degrees;
@end
|
#ifndef TITLEWIN_H
#define TITLEWIN_H
#include <pebble.h>
#include "select_win.h"
#include "module/shared_val.h"
Window *title_window;
TextLayer *title;
TextLayer *company;
void title_continue_callback(ClickRecognizerRef recognizer, void *context);
void title_click_config_provider(void *context);
void register_click_providers();
void create_title(Layer* window_layer, GRect bounds);
void create_company(Layer* window_layer, GRect bounds);
void title_win_create();
void title_win_destroy();
void push_title_win(bool animated);
void remove_title_win(bool animated);
#endif // TITLEWIN_H
|
/* File: lcds.h
* Synchronous lcd hd44780 interface.
*/
/* Copyright (c) 2012-2013 Domen Ipavec (domen.ipavec@z-v.si)
*
* 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 LCDS_H
#define LCDS_H
#include <stdint.h>
#include "io.h"
namespace avr_cpp_lib {
class LCDS {
public:
LCDS(OutputPin rs, OutputPin e, OutputPin d4, OutputPin d5, OutputPin d6, OutputPin d7);
void write(const char * s);
void writeFlash(const char * s);
void write(uint32_t i, uint8_t l, uint8_t m = 10);
void gotoXY(uint8_t x, uint8_t y);
void command(uint8_t c);
void character(uint8_t c);
static const uint8_t CLEAR = (1<<0);
static const uint8_t HOME = (1<<1);
static const uint8_t CURSOR_ON = 0b00001110;
static const uint8_t CURSOR_ON_BLINK = 0b00001111;
static const uint8_t CURSOR_BLINK = 0b00001101;
static const uint8_t CURSOR_OFF = 0b00001100;
static const uint8_t CURSOR_LEFT = 0b00010000;
static const uint8_t CURSOR_RIGHT = 0b00010100;
static const uint8_t DISPLAY_ON = 0b00001100;
static const uint8_t DISPLAY_OFF = 0b00001000;
static const uint8_t DISPLAY_RIGHT = 0b00011100;
static const uint8_t DISPLAY_LEFT = 0b00011000;
private:
void enableToggle();
void send(uint8_t c);
OutputPin rs;
OutputPin e;
OutputPin d4;
OutputPin d5;
OutputPin d6;
OutputPin d7;
};
}
#endif
|
/**
* NCtoolKit © 2007-2017 Luís F.Loureiro, under zlib software license.
* https://github.com/nczeroshift/nctoolkit
*/
#ifndef NCK_AUDIO_STREAM_H_
#define NCK_AUDIO_STREAM_H_
#include "nckAudioDevice.h"
#ifdef NCK_OGG
#include <vorbis/codec.h>
_AUDIO_BEGIN
class OggStream:public virtual Stream, public virtual SeekStream{
public:
OggStream(Core::DataReader * srcReader);
virtual ~OggStream();
void Init();
int GetSampleRate();
int GetChannelsCount();
Format GetFormat();
int64_t GetDuration();
int64_t GetTime();
void SetTime(int64_t position);
int64_t Seek(int64_t position);
int Read(int dataSize, uint8_t * dataBuffer);
static OggStream * Load(const std::string & filename);
static OggStream * Load(Core::DataReader * reader);
private:
void updateGranulate(int dataSize);
int64_t lastGranulate;
int64_t currentTime;
int64_t fLength;
Core::DataReader * reader;
ogg_sync_state oy;
ogg_stream_state os;
ogg_page og;
ogg_packet op;
vorbis_info vi;
vorbis_comment vc;
vorbis_dsp_state vd;
vorbis_block vb;
};
_AUDIO_END
#endif // #ifdef NCK_OGG
#endif // #ifndef NCK_AUDIO_STREAM_H_
|
//
// Created by Scott Downie on 17/09/2014.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Tag Games Limited
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#ifndef _CHILLISOURCE_INPUT_BASE_INPUTFILTER_H_
#define _CHILLISOURCE_INPUT_BASE_INPUTFILTER_H_
namespace ChilliSource
{
//------------------------------------------------------------------
/// Simple class that holds whether something has been filtered
/// and allows the filter flag to be set
///
/// @author S Downie
//------------------------------------------------------------------
class InputFilter final
{
public:
//--------------------------------------------------------------
/// @author S Downie
///
/// @return Filtered or not
//--------------------------------------------------------------
bool IsFiltered() const;
//--------------------------------------------------------------
/// Flag as filtered
///
/// @author S Downie
//--------------------------------------------------------------
void SetFiltered();
private:
bool m_isFiltered = false;
};
}
#endif
|
#include <stdio.h>
#include <string.h>
#include "resolution.h"
static void writeFn(WrenVM* vm, const char* text)
{
printf("%s", text);
}
static void reportError(WrenVM* vm, WrenErrorType type,
const char* module, int line, const char* message)
{
if (type == WREN_ERROR_RUNTIME) printf("%s\n", message);
}
static void loadModuleComplete(WrenVM* vm, const char* module, WrenLoadModuleResult result)
{
free((void*)result.source);
}
static WrenLoadModuleResult loadModule(WrenVM* vm, const char* module)
{
printf("loading %s\n", module);
const char* source;
if (strcmp(module, "main/baz/bang") == 0)
{
source = "import \"foo|bar\"";
}
else
{
source = "System.print(\"ok\")";
}
char* string = (char*)malloc(strlen(source) + 1);
strcpy(string, source);
WrenLoadModuleResult result = {0};
result.onComplete = loadModuleComplete;
result.source = string;
return result;
}
static void runTestVM(WrenVM* vm, WrenConfiguration* configuration,
const char* source)
{
configuration->writeFn = writeFn;
configuration->errorFn = reportError;
configuration->loadModuleFn = loadModule;
WrenVM* otherVM = wrenNewVM(configuration);
// We should be able to execute code.
WrenInterpretResult result = wrenInterpret(otherVM, "main", source);
if (result != WREN_RESULT_SUCCESS)
{
wrenSetSlotString(vm, 0, "error");
}
else
{
wrenSetSlotString(vm, 0, "success");
}
wrenFreeVM(otherVM);
}
static void noResolver(WrenVM* vm)
{
WrenConfiguration configuration;
wrenInitConfiguration(&configuration);
// Should default to no resolution function.
if (configuration.resolveModuleFn != NULL)
{
wrenSetSlotString(vm, 0, "Did not have null resolve function.");
return;
}
runTestVM(vm, &configuration, "import \"foo/bar\"");
}
static const char* resolveToNull(WrenVM* vm, const char* importer,
const char* name)
{
return NULL;
}
static void returnsNull(WrenVM* vm)
{
WrenConfiguration configuration;
wrenInitConfiguration(&configuration);
configuration.resolveModuleFn = resolveToNull;
runTestVM(vm, &configuration, "import \"foo/bar\"");
}
static const char* resolveChange(WrenVM* vm, const char* importer,
const char* name)
{
// Concatenate importer and name.
size_t length = strlen(importer) + 1 + strlen(name) + 1;
char* result = (char*)malloc(length);
strcpy(result, importer);
strcat(result, "/");
strcat(result, name);
// Replace "|" with "/".
for (size_t i = 0; i < length; i++)
{
if (result[i] == '|') result[i] = '/';
}
return result;
}
static void changesString(WrenVM* vm)
{
WrenConfiguration configuration;
wrenInitConfiguration(&configuration);
configuration.resolveModuleFn = resolveChange;
runTestVM(vm, &configuration, "import \"foo|bar\"");
}
static void shared(WrenVM* vm)
{
WrenConfiguration configuration;
wrenInitConfiguration(&configuration);
configuration.resolveModuleFn = resolveChange;
runTestVM(vm, &configuration, "import \"foo|bar\"\nimport \"foo/bar\"");
}
static void importer(WrenVM* vm)
{
WrenConfiguration configuration;
wrenInitConfiguration(&configuration);
configuration.resolveModuleFn = resolveChange;
runTestVM(vm, &configuration, "import \"baz|bang\"");
}
WrenForeignMethodFn resolutionBindMethod(const char* signature)
{
if (strcmp(signature, "static Resolution.noResolver()") == 0) return noResolver;
if (strcmp(signature, "static Resolution.returnsNull()") == 0) return returnsNull;
if (strcmp(signature, "static Resolution.changesString()") == 0) return changesString;
if (strcmp(signature, "static Resolution.shared()") == 0) return shared;
if (strcmp(signature, "static Resolution.importer()") == 0) return importer;
return NULL;
}
void resolutionBindClass(const char* className, WrenForeignClassMethods* methods)
{
// methods->allocate = foreignClassAllocate;
}
|
#pragma once
#include <map>
#include <stack>
#include <string>
template <typename TYPE,typename KEY = std::wstring>
class CRegistryStack{
//TYPEÀàµÄʵÀýµÄÓÃKEYË÷ÒýµÄÊ÷µÄÕ»
public:
void Push();
void Pop();
void Insert(KEY key, TYPE val);
TYPE Find(KEY key, TYPE notFound = NULL);
CRegistryStack();
private:
typedef std::map<KEY,TYPE> MAP;
typedef std::stack<MAP> STACK;
STACK m_stack;
};
|
//
// ViewController.h
// DownloadImageViewExample
//
// Created by Marcos Lacerda on 30/05/15.
// Copyright (c) 2015 Marcos Lacerda. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MLDownloadImageView.h"
@interface ViewController : UIViewController<UITextFieldDelegate> {
IBOutlet MLDownloadImageView *imageView;
IBOutlet UITextField *urlField;
IBOutlet UISwitch *roundedCorners;
}
@end
|
//
// MessagePush.h
// HomeMate
//
// Created by liuzhicai on 15/8/25.
// Copyright © 2017年 Air. All rights reserved.
//
#import "HMBaseModel+Extension.h"
@class HMDevice;
typedef NS_ENUM(NSInteger,HMMessagePushType) {
HMMessagePushTimingTaskTotalSwitch = 0,//定时任务的推送设置 [总开关]
HMMessagePushTimimgTaskSwitch = 1,//定时任务的推送设置 [分开关]
HMMessagePushEnergySavingRemindingTotalSwitch = 11,//节能提醒设置 [总开关]
HMMessagePushEnergySavingRemindingSwitch = 12,//节能提醒设置 [分开关]
};
@interface HMMessagePush : HMBaseModel
@property (nonatomic, strong)NSString *pushId;
@property (nonatomic, strong)NSString *userId;
/**
* 0:对所有设备的定时任务的推送设置
1:对单个设备的定时任务的推送设置。如果存在type为0的设置,则以0的设置为准
*/
@property (nonatomic, assign)int type;
@property (nonatomic, strong)NSString *taskId;
/**
* 0:需要推送
1:不需要推送
*/
@property (nonatomic, assign)int isPush;
@property (nonatomic, strong) NSString *startTime;
@property (nonatomic, strong) NSString *endTime;
@property (nonatomic, assign) int week;
// 漏电自检
@property (nonatomic, assign) int day;
@property (nonatomic, assign)int authorizedId;
/**
* 是否有打开提醒功能的COCO
*/
+ (BOOL)isHasOnCoco;
/**
* 是否有打开提醒功能的传感器
*/
+ (BOOL)isHasOnSensor;
+ (instancetype)objectWithTaskId:(NSString *)TaskId;
/**
* 所有传感器是否需要推送
*/
+ (BOOL)allSensorsMessageIsNeedPush;
/**
* 单个传感器是否需要推送
* @return YES:推送状态为开, NO:关
*/
+ (BOOL)singleSensorsIsNeedPushWithDeviceId:(NSString *)deviceId;
/**
* 单个COCO是否需要推送
*/
+ (BOOL)singleCocoIsNeedPushWithDeviceId:(NSString *)deviceId;
/**
* 所有coco是否需要提醒
*/
+ (BOOL)allCocosMessageIsNeedPush;
/**
* 更新表
*
* @param isPush 是否需要推送
* @param type 推送类型
* @param taskId 设备Id
*/
+ (void)updateTableSetIsPush:(int)isPush type:(int)type taskId:(NSString *)taskId;
// 当传感器总开关设置时,分开关的开关要更新
+ (void)updateSensorsPushDataIsPush:(int)isPush;
// 当COCO总开关设置时,分开关的开关要更新
+ (void)updateCocosPushDataIsPush:(int)isPush;
// 当一个分开关打开时,总开关必须打开 type : 0 coco总开关 type : 2 传感器总开关
+ (void)OpenAllSwitchWithType:(int)type;
+ (instancetype)objectWithTaskId:(NSString *)TaskId
WithAuthorID:(int )authorId;
// 此方法内部只结合familyId 来查,没有加userId
+ (instancetype)objectWithTaskId:(NSString *)TaskId
WithAuthorID:(int )authorId
type:(int)type;
+ (HMMessagePush *)selectModelWithTaskId:(NSString *)taskId AndType:(int)type;
+ (HMMessagePush *)selectModelWithFamilyId:(NSString *)familyId andType:(int)type;
/**
* 删除wifi插座是否推送的设置
*/
+ (BOOL)deleteWifiSockectPushSettingWithDeviceId:(NSString *)deviceId;
+ (instancetype)sensorObjectWithTaskId:(NSString *)taskId;
//查询t1门锁门磁开关消息
+ (HMMessagePush *)t1LockSensorMessagePush:(HMDevice *)device;
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "IDESourceControlOperation.h"
@class NSOperationQueue;
@interface SVNUpgradeOperation : IDESourceControlOperation
{
NSOperationQueue *_operationQueue;
}
@property(retain) NSOperationQueue *operationQueue; // @synthesize operationQueue=_operationQueue;
- (void).cxx_destruct;
- (void)main;
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSOperation.h"
@class DVTFindDescriptor, IDEBatchFindCandidateFile, NSArray, NSError;
@interface IDEBatchFindable : NSOperation
{
NSArray *_findResults;
DVTFindDescriptor *_findDescriptor;
IDEBatchFindCandidateFile *_file;
NSError *_error;
id _completionObject;
}
+ (BOOL)findableCanHandleFile:(id)arg1 forFindDescriptor:(id)arg2;
+ (id)findableForFindDescriptor:(id)arg1 onFile:(id)arg2;
@property(retain) id completionObject; // @synthesize completionObject=_completionObject;
@property(copy) NSError *error; // @synthesize error=_error;
@property(readonly) IDEBatchFindCandidateFile *file; // @synthesize file=_file;
@property(readonly) DVTFindDescriptor *findDescriptor; // @synthesize findDescriptor=_findDescriptor;
@property(readonly) NSArray *findResults; // @synthesize findResults=_findResults;
- (void).cxx_destruct;
- (void)setDVTFindResults:(id)arg1;
@property(readonly) BOOL shouldFallbackToDocumentFindable;
@property(readonly) BOOL requiresMainThreadAccess;
- (id)initWithFindDescriptor:(id)arg1 onFile:(id)arg2;
@end
|
#include <kipr/botball.h>
// 4 from the 'T'
int main()
{
printf("Open Claws\n");
enable_servos();
set_servo_position(1,1169);
msleep(800);
set_servo_position(2,1654);
msleep(800);
motor(0,0);
motor(3,0);
msleep(800);
printf("Go Forward\n");
motor(0,50);
motor(3,54);
msleep(2800);
motor(0,0);
motor(3,0);
msleep(800);
printf("Close Claws\n");
set_servo_position(2,817);
msleep(500);
set_servo_position(1,857);
msleep(500);
printf("Go Backwards\n");
motor(0,-50);
motor(3,-50);
msleep(2300);
printf("Hello World\n");
motor(0,0);
motor(3,0);
msleep(800);
printf("Hello World\n");
set_servo_position(1,1137);
msleep(500);
set_servo_position(2,1267);
msleep(500);
printf("Hello World\n");
motor(0,-51);
motor(3,-50);
msleep(900);
printf("Hello World\n");
motor(0,50);
motor(3,00);
msleep(800);
printf("Hello World\n");
motor(0,50);
motor(3,50);
msleep(2700);
printf("Hello World\n");
motor(3,50);
motor(0,00);
msleep(810);
printf("Hello World\n");
motor(0,50);
motor(3,55);
msleep(4800);
printf("Go Backwards\n");
motor(0,-50);
motor(3,-50);
msleep(2000);
printf("Hello World\n");
motor(3,50);
motor(0,0);
msleep(1000);
printf("Go forward\n");
motor(0,50);
motor(3,50);
msleep(1800);
printf("Close Claws\n");
set_servo_position(2,817);
msleep(500);
printf("Go Backwards\n");
motor(0,-50);
motor(3,-50);
msleep(1400);
return 0;
}
|
/*
* SKAction+SKMech - SKMech's additions to
* SpriteKit's SKAction.
*/
#import <SpriteKit/SpriteKit.h>
#import "SKEasing.h"
#import "SKPath.h"
@interface SKAction (SKMech)
+(SKAction *) customActionWithStart: (void (^)(SKNode *node)) start
progress: (void (^)(SKNode *node, CGFloat elapsedTime, CGFloat progress)) progress
end: (void (^)(SKNode *node)) end duration: (NSTimeInterval) duration;
+(SKAction *) moveTo: (CGPoint) point duration: (NSTimeInterval) duration easing: (SKEasing *) easing;
+(SKAction *) followPath: (CGPathRef) path duration: (NSTimeInterval) duration easing: (SKEasing *) easing;
@end
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_UTIL_FEES_H
#define SYSCOIN_UTIL_FEES_H
#include <string>
enum class FeeEstimateMode;
enum class FeeReason;
bool FeeModeFromString(const std::string& mode_string, FeeEstimateMode& fee_estimate_mode);
std::string StringForFeeReason(FeeReason reason);
std::string FeeModes(const std::string& delimiter);
const std::string InvalidEstimateModeErrorMessage();
#endif // SYSCOIN_UTIL_FEES_H
|
#pragma once
#include <cctype>
#include <functional>
#include <iterator>
#include <limits>
#include <string_view>
#include <type_traits>
#include "lw/err/macros.h"
namespace lw {
class CaseInsensitiveHash {
public:
using is_transparent = void;
std::size_t operator()(std::string_view str) const {
const std::size_t prime = 251; // Prime around the size of character set.
const std::size_t modulus = std::numeric_limits<std::size_t>::max();
std::size_t multiplier = 1;
std::size_t hash = 0;
for (auto c : str) {
auto upper = std::toupper(c);
hash = (hash + ((upper + 1) * multiplier)) % modulus;
multiplier = (multiplier * prime) % modulus;
}
return hash;
}
};
// -------------------------------------------------------------------------- //
class CaseInsensitiveEqual {
public:
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const {
if (std::size(lhs) != std::size(rhs)) return false;
const std::size_t length = std::size(lhs);
for (std::size_t i = 0; i < length; ++i) {
if (std::toupper(lhs[i]) != std::toupper(rhs[i])) return false;
}
return true;
}
};
// -------------------------------------------------------------------------- //
class CaseInsensitiveCompare {
public:
using is_transparent = void;
int operator()(std::string_view lhs, std::string_view rhs) const {
if (lhs.empty() && rhs.empty()) return 0;
std::size_t i;
for (i = 0; i < lhs.size() && i < rhs.size(); ++i) {
const auto l_up = std::toupper(lhs[i]);
const auto r_up = std::toupper(rhs[i]);
if (l_up != r_up) return l_up - r_up;
}
return lhs.size() - rhs.size();
}
};
// -------------------------------------------------------------------------- //
class CaseInsensitiveLess {
public:
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const {
return CaseInsensitiveCompare()(lhs, rhs) < 0;
}
};
}
|
/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "array.h"
struct foo {
unsigned int a, b, c;
};
static void test_array_foreach(void)
{
ARRAY_DEFINE(foos, struct foo);
const struct foo *foo;
struct foo nfoo;
unsigned int i;
test_begin("array foreach");
t_array_init(&foos, 32);
for (i = 0; i < 10; i++) {
nfoo.a = nfoo.b = nfoo.c = i;
array_append(&foos, &nfoo, 1);
}
array_foreach(&foos, foo) {
i = array_foreach_idx(&foos, foo);
test_assert(foo->a == i);
test_assert(foo->b == i);
test_assert(foo->c == i);
}
test_end();
}
static void test_array_reverse(void)
{
ARRAY_DEFINE(intarr, int);
int input[] = { -1234567890, -272585721, 2724859223U, 824725652 };
const int *output;
unsigned int i, j;
test_begin("array reverse");
t_array_init(&intarr, 5);
for (i = 0; i < N_ELEMENTS(input); i++) {
array_clear(&intarr);
array_append(&intarr, input, i);
array_reverse(&intarr);
output = i == 0 ? NULL : array_idx(&intarr, 0);
for (j = 0; j < i; j++)
test_assert(input[i-j-1] == output[j]);
}
test_end();
}
void test_array(void)
{
test_array_foreach();
test_array_reverse();
}
|
//
// Created by jonas on 10.12.15.
//
#ifndef TEST_MESH_H
#define TEST_MESH_H
#include <string>
#include <GL/gl.h>
#include <vector>
#include <list>
using namespace std;
template <typename T>
struct Vertex
{
T x;
T y;
T z;
};
using namespace std;
class Mesh
{
public:
Mesh();
virtual ~Mesh();
const string& get_name() const;
const int& get_vertices() const;
const int& get_faces() const;
const int& get_edges() const;
void draw();
bool load( const char* name );
protected:
string m_name;
int m_vertices;
int m_faces;
int m_edges;
vector< Vertex<GLfloat> > m_verts;
vector< Vertex<GLint> > m_indicies;
vector< Vertex<GLfloat> > m_normals;
GLfloat m_ambient[3];
GLfloat m_diffuse[3];
GLfloat m_specular[3];
GLfloat m_shining;
};
#endif //TEST_MESH_H
|
//例:数组的元素通过传值作为函数的参数
#include "stdio.h"
#include "stdlib.h"
int main()
{
int max(int x, int y);
void printd(int data[], int n);
int a[10], m, n, i;
for(i=0;i<10;i++)
a[i]=rand() % 100;
for(i=1, m=a[0],n=0;i<10;i++){
if(max(m, a[i])>m){
m = max(m, a[i]);
n=i;
}
}
printd(a, 10);
printf("max = %d, number=%d\n", m, n+1);
return 0;
}
int max(int x, int y){
return (x>y)?x:y;
}
void printd(int data[], int n){
for(int i=0;i<n;i++){
printf("%6d", data[i]);
}
putchar('\n');
} |
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2015 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Paul Panotzki - Bunyip Information Systems |
| Jim Winstead <jimw@php.net> |
| Sascha Schumann <sascha@schumann.cx> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#include "php_globals.h"
#include <stdlib.h>
#include <stddef.h>
#include "php_network.h"
#include "file.h"
/* {{{ php_fsockopen() */
static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *host;
int host_len;
long port = -1;
zval *zerrno = NULL, *zerrstr = NULL;
double timeout = FG(default_socket_timeout);
unsigned long conv;
struct timeval tv;
char *hashkey = NULL;
php_stream *stream = NULL;
int err;
char *hostname = NULL;
long hostname_len;
char *errstr = NULL;
RETVAL_FALSE;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lzzd", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) {
RETURN_FALSE;
}
if (persistent) {
spprintf(&hashkey, 0, "pfsockopen__%s:%ld", host, port);
}
if (port > 0) {
hostname_len = spprintf(&hostname, 0, "%s:%ld", host, port);
} else {
hostname_len = host_len;
hostname = host;
}
/* prepare the timeout value for use */
conv = (unsigned long) (timeout * 1000000.0);
tv.tv_sec = conv / 1000000;
tv.tv_usec = conv % 1000000;
if (zerrno) {
zval_dtor(zerrno);
ZVAL_LONG(zerrno, 0);
}
if (zerrstr) {
zval_dtor(zerrstr);
ZVAL_STRING(zerrstr, "", 1);
}
stream = php_stream_xport_create(hostname, hostname_len, REPORT_ERRORS,
STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, hashkey, &tv, NULL, &errstr, &err);
if (port > 0) {
efree(hostname);
}
if (stream == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:%ld (%s)", host, port, errstr == NULL ? "Unknown error" : errstr);
}
if (hashkey) {
efree(hashkey);
}
if (stream == NULL) {
if (zerrno) {
zval_dtor(zerrno);
ZVAL_LONG(zerrno, err);
}
if (zerrstr && errstr) {
/* no need to dup; we need to efree buf anyway */
zval_dtor(zerrstr);
ZVAL_STRING(zerrstr, errstr, 0);
}
else if (!zerrstr && errstr) {
efree(errstr);
}
RETURN_FALSE;
}
if (errstr) {
efree(errstr);
}
php_stream_to_zval(stream, return_value);
}
/* }}} */
/* {{{ proto resource fsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])
Open Internet or Unix domain socket connection */
PHP_FUNCTION(fsockopen)
{
php_fsockopen_stream(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto resource pfsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])
Open persistent Internet or Unix domain socket connection */
PHP_FUNCTION(pfsockopen)
{
php_fsockopen_stream(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
|
#pragma once
#include <Parser/ParserVal.h>
#include <Parser/Parser.tab.hpp>
#ifndef __FLEX_LEXER_H
#define yyFlexLexer SQLFlexLexer
#include "FlexLexer.h"
#undef yyFlexLexer
#endif
namespace tinydbpp {
class Lexer :public SQLFlexLexer {
public:
typedef tinydbpp::Parser::token::yytokentype Token;
public:
Lexer(std::istream &in, std::ostream &out) :SQLFlexLexer(in, out) {
}
int yylex();
int lex(ParserVal *v) {
int ret = yylex();
*v = yylval;
return ret;
}
private:
ParserVal yylval;
};
}
|
int main(void) {
float a = {"error", 1, 2.0, '3', "aaa"};
return a;
}
|
/**
File: dbgaux.h
Project: DCPU-16 Toolchain
Component: LibDCPU-vm-dbg
Authors: James Rhodes
José Manuel Díez
Description: Declares auxilary functions for the debugger.
**/
#include <stdint.h>
#include <bstrlib.h>
///
/// The last return code from a debugging command (to indicate
/// success or failure).
///
extern int ddbg_return_code;
void ddbg_init();
void ddbg_help(bstring section);
void ddbg_set(bstring object, bstring value);
void ddbg_load(bstring path);
void ddbg_load_symbols(bstring path);
void ddbg_inspect_symbols();
void ddbg_create_vm();
void ddbg_flash_vm();
void ddbg_run_vm();
void ddbg_continue_vm();
void ddbg_attach(bstring hw);
void ddbg_add_breakpoint(bstring file, int index);
void ddbg_delete_breakpoint(bstring file, int index);
void ddbg_add_breakpoint_identifier(bstring ident);
void ddbg_delete_breakpoint_identifier(bstring ident);
void ddbg_step_into();
void ddbg_step_over();
void ddbg_backtrace();
void ddbg_breakpoints_list();
void ddbg_dump_state();
void ddbg_dump_ram(int start, int difference);
void ddbg_disassemble_default();
void ddbg_disassemble(int start, int difference);
int32_t ddbg_file_to_address(bstring file, int index);
|
/*
* cc3000_platform.c
*
* Created on: 05.09.2013
* Author: Johannes
*
* Platform dependent functions
*
*/
#include "cc3000_platform.h"
// guess what.. i am too fast.. so i need a delay
// if this is defined, then we add a little delay
// before CS_ASSERT and after CS_DEASSERT and before cc3000_read_irq_pin
//#define CS_IS_TOO_FAST
// handle debug output
void debug_str(const char *string){
printf("%s\r",string);
}
void debug_int(unsigned int wert){
printf("%i",wert);
}
void debug_int_hex(unsigned char wert){
printf("0x%02X ",wert);
}
void debug_putc(unsigned char wert){
printf("%c",wert);
}
void debug_nl(void){
printf("\n\r");
}
void debug_int_hex_16bit(uint16 wert){
printf("0x%04X\n\r",wert);
}
//*****************************************************************************
//
//! delay_us
//!
//! @param usec delay time in microseconds
//!
//! @brief delay in microseconds
//
//*****************************************************************************
#define BOARD_MCK_MHZ 48
void delay_us( uint32 usec){
uint32 loop;
loop = (BOARD_MCK_MHZ * usec)/6;
while(loop--){
__asm__("NOP");
}
}
//*****************************************************************************
//
//! cc3000_hw_setup
//!
//! @brief hardware setup for startup
//
//*****************************************************************************
void cc3000_hw_setup(void){
// Configure port initial values and directions (EN = 0, WL_EN = 0, CS = 1)
// Init SPI
// Init IRQ
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_hw_setup\n");
#endif
}
//*****************************************************************************
//
//! cc3000_set_pin_WL_EN
//!
//! @brief sets the enable pin
//
//*****************************************************************************
void cc3000_set_pin_WL_EN(void){
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_set_pin_WL_EN\n");
#endif
}
//*****************************************************************************
//
//! cc3000_clear_pin_WL_EN
//!
//! @brief sets the enable pin
//
//*****************************************************************************
void cc3000_clear_pin_WL_EN(void){
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_clear_pin_WL_EN\n");
#endif
}
//*****************************************************************************
//
//! cc3000_read_irq_pin
//!
//! @brief reads the state of the IRQ pin
//!
//! @return if pin is high 1 is returned else 0 is returned
//
//*****************************************************************************
uint8 cc3000_read_irq_pin(void) {
#ifdef CS_IS_TOO_FAST
delay_us(100);
#endif
return 0;
}
//*****************************************************************************
//
//! cc3000_interrupt_enable
//!
//! @brief enables IRQ
//
//*****************************************************************************
void cc3000_interrupt_enable(void){
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_interrupt_ENable\n");
#endif
if(!cc3000_read_irq_pin()){
cc3000_isr_flag = 1;
}
}
//*****************************************************************************
//
//! cc3000_interrupt_disable
//!
//! @brief disables IRQ
//
//*****************************************************************************
void cc3000_interrupt_disable(void){
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_interrupt_DISable\n");
#endif
}
//*****************************************************************************
//
//! cc3000_assert_cs
//!
//! @brief asserts CS
//
//*****************************************************************************
void cc3000_assert_cs(void){
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_Assert_cs\n");
#endif
// Set pin low
#ifdef CS_IS_TOO_FAST
delay_us(50);
#endif
}
//*****************************************************************************
//
//! cc3000_deassert_cs
//!
//! @brief deasserts CS
//
//*****************************************************************************
void cc3000_deassert_cs(void){
#if (CC3000_TRACE_LEVEL & CC3000_TRACE_LEVEL_DEBUG)
debug_str("cc3000_DEAssert_cs\n");
#endif
#ifdef CS_IS_TOO_FAST
delay_us(50);
#endif
// Set pin high
}
//*****************************************************************************
//
//! cc3000_spi_send
//!
//! @param data data to send
//!
//! @brief sends 1 byte to the CC3000
//
//*****************************************************************************
void cc3000_spi_send(uint8 data){
}
//*****************************************************************************
//
//! cc3000_spi_recv
//!
//! @return returns 1 byte
//!
//! @brief receives 1 byte from CC3000
//
//*****************************************************************************
uint8 cc3000_spi_recv(void){
return 0;
}
|
/*
* Data.h
* Kylie Dale and Michael Guida
*/
int armSRBackTol = 18;
int armSRShoulderTol = 4;
int armSRUnderTol = 30;
int armSR45BackTol = 27;
int armSR45ShoulderTol = 5;
int armSR45UnderTol = 13;
int armSR90BackTol = 12;
int armSR90ShoulderTol = 9;
int armSR90UnderTol = 15;
int armSR135BackTol = 14;
int armSR135ShoulderTol = 5;
int armSR135UnderTol = 13;
int armSR180BackTol = 24;
int armSR180ShoulderTol = 4;
int armSR180UnderTol = 8;
int armFR45BackTol = 7;
int armFR45ShoulderTol = 4;
int armFR45UnderTol = 26;
int armFR90BackTol = 24;
int armFR90ShoulderTol = 10;
int armFR90UnderTol = 12;
int armFR135BackTol = 7;
int armFR135ShoulderTol = 8;
int armFR135UnderTol = 14;
int armFR180BackTol = 10;
int armFR180ShoulderTol = 4;
int armFR180UnderTol = 17;
int armSLBackTol = 18;
int armSLShoulderTol = 21;
int armSLUnderTol = 31;
int armSL45BackTol = 27;
int armSL45ShoulderTol = 3;
int armSL45UnderTol = 13;
int armSL90BackTol = 12;
int armSL90ShoulderTol = 7;
int armSL90UnderTol = 7;
int armSL135BackTol = 14;
int armSL135ShoulderTol = 29;
int armSL135UnderTol = 13;
int armSL180BackTol = 24;
int armSL180ShoulderTol = 31;
int armSL180UnderTol = 8;
int armFL45BackTol = 7;
int armFL45ShoulderTol = 14;
int armFL45UnderTol = 28;
int armFL90BackTol = 24;
int armFL90ShoulderTol = 7;
int armFL90UnderTol = 7;
int armFL135BackTol = 7;
int armFL135ShoulderTol = 14;
int armFL135UnderTol = 14;
int armFL180BackTol = 10;
int armFL180ShoulderTol = 15;
int armFL180UnderTol = 17;
int backStraightBackTol = 18;
int backBentFBackTol = 168;
int backBentBBackTol = 18;
int armSRBackVal = 865;
int armSRShoulderVal = 704;
int armSRUnderVal = 764;
int armSR45BackVal = 852;
int armSR45ShoulderVal = 865;
int armSR45UnderVal = 789;
int armSR90BackVal = 872;
int armSR90ShoulderVal = 865;
int armSR90UnderVal = 780;
int armSR135BackVal = 880;
int armSR135ShoulderVal = 830;
int armSR135UnderVal = 761;
int armSR180BackVal = 881;
int armSR180ShoulderVal = 825;
int armSR180UnderVal = 749;
int armFR45BackVal = 873;
int armFR45ShoulderVal = 837;
int armFR45UnderVal = 778;
int armFR90BackVal = 891;
int armFR90ShoulderVal = 862;
int armFR90UnderVal = 795;
int armFR135BackVal = 882;
int armFR135ShoulderVal = 846;
int armFR135UnderVal = 760;
int armFR180BackVal = 879;
int armFR180ShoulderVal = 826;
int armFR180UnderVal = 754;
int armSLBackVal = 865;
int armSLShoulderVal = 841;
int armSLUnderVal = 841;
int armSL45BackVal = 852;
int armSL45ShoulderVal = 862;
int armSL45UnderVal = 863;
int armSL90BackVal = 872;
int armSL90ShoulderVal = 852;
int armSL90UnderVal = 852;
int armSL135BackVal = 880;
int armSL135ShoulderVal = 833;
int armSL135UnderVal = 833;
int armSL180BackVal = 881;
int armSL180ShoulderVal = 827;
int armSL180UnderVal = 827;
int armFL45BackVal = 873;
int armFL45ShoulderVal = 850;
int armFL45UnderVal = 850;
int armFL90BackVal = 891;
int armFL90ShoulderVal = 865;
int armFL90UnderVal = 865;
int armFL135BackVal = 882;
int armFL135ShoulderVal = 839;
int armFL135UnderVal = 839;
int armFL180BackVal = 879;
int armFL180ShoulderVal = 836;
int armFL180UnderVal = 837;
int backStraightBackVal = 872;
int backBentFBackVal = 754;
int backBentBBackVal = 862;
|
//
// PCCategoryCell.h
// PCCategoryView
//
// Created by 远超李 on 15/2/13.
// Copyright (c) 2015年 远超李. All rights reserved.
//
#import <UIKit/UIKit.h>
@class PCCategoryCell;
typedef void(^DidSelect)(PCCategoryCell *cell);
@interface PCCategoryCell : UIView
@property (nonatomic, copy) DidSelect didSelect;
@property (nonatomic, assign) NSUInteger index;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, assign) UIEdgeInsets titleEdgeInsets;
@end
|
#pragma once
namespace KinectVisionLib{
namespace Core{
class Utils{
public:
static uint8 ConvertToByte(uint32 value)
{
return value > 256 ? 256 : value;
}
};
}
} |
//
// CalendarPages.h
// Workdays
//
// Created by Andrey Fedorov on 17.02.14.
// Copyright (c) 2014 Andrey Fedorov. All rights reserved.
//
@interface CalendarPages : NSObject <UIPageViewControllerDataSource, UIPageViewControllerDelegate>
@property (nonatomic, assign) NSInteger month;
- (UIViewController *)initialViewController;
@end
|
#pragma once
#ifndef SCONSOLE_MESSAGE_H_
#define SCONSOLE_MESSAGE_H_
#include "Message.h"
struct MsgConModS : public MessageBase
{
std::string data = "";
};
struct MsgConModI : public MessageBase
{
int data = -1;
};
MessageBase* genMCMS(std::string from, int type,
std::string data, std::string note = "");
MessageBase* genMCMI(std::string from, int type,
int data, std::string note = "");
#endif // SCONOSLE_MESSAGE_H_ |
/*
Copyright(c) 2015 Neodymium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#pragma once
#include "sha.h"
#include "cryptography_hashes.h"
extern char* LUT;
extern char* AESKey;
extern char** ngKeys;
extern char** ngTables;
void encrypt_aes(byte *buffer, int length, const byte *key);
void decrypt_aes(byte *buffer, int length, const byte *key);
unsigned int hash_ng(const char *text, int length);
void encrypt_ng(unsigned char *buffer, int length, char *key);
void decrypt_ng(unsigned char *buffer, int length, char *key);
bool find_hash(const byte* buffer, int bufferLength, const char *hash, unsigned int *hashPosition, int blockLength);
bool find_hashes(const byte* buffer, int bufferLength, const char *hash, const int xwidth, const int numOfHashes, unsigned int *hashPositions, int blockLength); |
/*
* common.h
*
* Copyright (c) 2014 Ben Hamlin <protob3n@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* ┏━┓┏━┓╻┏┳┓
* ┃┓┃┗━┓┃┃┃┃
* ┗┻┛┗━┛╹╹ ╹
*
*/
#ifndef QSIM_COMMON_H
#define QSIM_COMMON_H
#include <assert.h>
#include <complex.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
/* Non-standard definitions from glibc math.h */
# define M_E 2.7182818284590452354 /* e */
# define M_LOG2E 1.4426950408889634074 /* log_2 e */
# define M_LOG10E 0.43429448190325182765 /* log_10 e */
# define M_LN2 0.69314718055994530942 /* log_e 2 */
# define M_LN10 2.30258509299404568402 /* log_e 10 */
# define M_PI 3.14159265358979323846 /* pi */
# define M_PI_2 1.57079632679489661923 /* pi/2 */
# define M_PI_4 0.78539816339744830962 /* pi/4 */
# define M_1_PI 0.31830988618379067154 /* 1/pi */
# define M_2_PI 0.63661977236758134308 /* 2/pi */
# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
#define DBL_PRECISION (6)
#define DBL_TOLERANCE (1e-6)
#define DEQ(x, y) (((x) > (y)) ? ((x) - (y) < DBL_TOLERANCE) \
: ((y) - (x) < DBL_TOLERANCE))
#define CEQ(x, y) (DEQ(creal(x), creal(y)) && DEQ(cimag(x), cimag(y)))
void die(int err, const char *fmt, ...);
void *malloc_or_die(size_t s);
unsigned strtou_or_die(char *start, char **endp, int base);
FILE *fopen_or_die(const char *fname, const char *mode);
char *complex_to_str(char *buf, size_t s, complex c);
char *ket_to_str(char *buf, size_t s, uint32_t basis, unsigned width);
#endif /* QSIM_COMMON_H */
|
//
// FlickrSearchResultsModel.h
//
// Created by Keith Lazuka on 7/23/09.
//
//
#import "Three20/Three20.h"
#import "SearchResultsModel.h"
@class URLModelResponse;
/*
* FlickrSearchResultsModel
* -----------------------
*
* See the description of YahooSearchResultsModel.
*
*/
@interface FlickrSearchResultsModel : TTURLRequestModel <SearchResultsModel>
{
URLModelResponse *responseProcessor;
NSString *searchTerms;
NSUInteger page;
}
// The designated initializer is defined in the SearchResultsModel protocol.
@end
|
#pragma once
#include <inttypes.h>
#include <wchar.h>
#define TSM_UCS4_MAX (0x7fffffffUL)
#define TSM_UCS4_INVALID (TSM_UCS4_MAX + 1)
#define TSM_UCS4_REPLACEMENT (0xfffdUL)
#define TSM_UCS4_MAXLEN 10
/* symbols */
typedef uint32_t tsm_symbol_t;
enum tsm_utf8_mach_state {
TSM_UTF8_START,
TSM_UTF8_ACCEPT,
TSM_UTF8_REJECT,
TSM_UTF8_EXPECT1,
TSM_UTF8_EXPECT2,
TSM_UTF8_EXPECT3,
};
struct UTF8Machine {
int state;
uint32_t ch;
UTF8Machine();
uint32_t get();
void reset();
int feed(char ci);
};
int mk_wcwidth(wchar_t ucs);
int mk_wcswidth(const wchar_t *pwcs, size_t n);
int mk_wcwidth_cjk(wchar_t ucs);
int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n);
unsigned int tsm_ucs4_get_width(uint32_t ucs4);
size_t tsm_ucs4_to_utf8(uint32_t ucs4, char *out);
char *tsm_ucs4_to_utf8_alloc(const uint32_t *ucs4, size_t len, size_t *len_out);
/* available character sets */
typedef tsm_symbol_t tsm_vte_charset[96];
extern tsm_vte_charset tsm_vte_unicode_lower;
extern tsm_vte_charset tsm_vte_unicode_upper;
extern tsm_vte_charset tsm_vte_dec_supplemental_graphics;
extern tsm_vte_charset tsm_vte_dec_special_graphics; |
#ifndef VTRC_LISTENER_TCP_H
#define VTRC_LISTENER_TCP_H
#include <string>
#include "vtrc/server/listener.h"
namespace vtrc { namespace server {
class application;
namespace listeners { namespace tcp {
/// tcp_nodelay sets TCP_NODELAY socket option for every connection
listener_sptr create( application &app,
const std::string &address,
unsigned short service,
bool tcp_nodelay = false );
listener_sptr create( application &app,
const rpc::session_options &opts,
const std::string &address,
unsigned short service,
bool tcp_nodelay = false );
}}
}}
#endif // VTRCENDPOINTTCP_H
|
//
// HJSplashAdvertisment.h
// HJSplashAdvertismentView
//
// Created by HeJeffery on 2017/3/10.
// Copyright © 2017年 HeJeffery. All rights reserved.
//
#import "HJSplashAdvertismentView.h"
#import "HJSplashAdvertismentModel.h"
|
QString HQt_LatexRedText (QString String); |
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */
#include "pubnub_internal.h"
#include "lib/sockets/pbpal_ntf_callback_poller_select.h"
#include "core/pubnub_assert.h"
#include "core/pubnub_log.h"
#include <stdlib.h>
struct pbpal_poll_data* pbpal_ntf_callback_poller_init(void)
{
struct pbpal_poll_data* rslt;
rslt = (struct pbpal_poll_data*)malloc(sizeof *rslt);
if (NULL == rslt) {
return NULL;
}
FD_ZERO(&rslt->readfds);
FD_ZERO(&rslt->writefds);
FD_ZERO(&rslt->exceptfds);
rslt->size = rslt->nfds = 0;
return rslt;
}
static bool we_ve_got_ya(struct pbpal_poll_data const* data, pubnub_t const* pb)
{
size_t i;
for (i = 0; i < data->size; ++i) {
if (data->apb[i] == pb) {
return true;
}
}
return false;
}
void pbpal_ntf_callback_save_socket(struct pbpal_poll_data* data, pubnub_t* pb)
{
pbpal_native_socket_t sockt = pubnub_get_native_socket(pb);
PUBNUB_ASSERT_OPT(data != NULL);
if (INVALID_SOCKET == sockt) {
return;
}
PUBNUB_ASSERT(!FD_ISSET(sockt, &data->exceptfds));
PUBNUB_ASSERT(!FD_ISSET(sockt, &data->writefds));
PUBNUB_ASSERT(!FD_ISSET(sockt, &data->readfds));
PUBNUB_ASSERT_EX(!we_ve_got_ya(data, pb));
if ((int)sockt > data->nfds) {
data->nfds = sockt;
}
FD_SET(sockt, &data->exceptfds);
FD_SET(sockt, &data->writefds);
data->apb[data->size] = pb;
data->asocket[data->size] = sockt;
++data->size;
}
void pbpal_ntf_callback_remove_socket(struct pbpal_poll_data* data, pubnub_t* pb)
{
size_t i;
int new_nfds = 0;
pbpal_native_socket_t sockt = pubnub_get_native_socket(pb);
PUBNUB_ASSERT_OPT(data != NULL);
if (INVALID_SOCKET == sockt) {
return;
}
PUBNUB_ASSERT(FD_ISSET(sockt, &data->exceptfds));
PUBNUB_ASSERT_EX(we_ve_got_ya(data, pb));
for (i = 0; i < data->size; ++i) {
pbpal_native_socket_t i_sckt = data->asocket[i];
PUBNUB_ASSERT(pubnub_get_native_socket(data->apb[i]) == data->asocket[i]);
if ((int)i_sckt > new_nfds) {
new_nfds = i_sckt;
}
if (data->apb[i] == pb) {
size_t to_move = data->size - i - 1;
if (to_move > 0) {
memmove(data->apb + i, data->apb + i + 1, sizeof data->apb[0] * to_move);
memmove(data->asocket + i,
data->asocket + i + 1,
sizeof data->asocket[0] * to_move);
}
--data->size;
break;
}
}
FD_CLR(sockt, &data->exceptfds);
FD_CLR(sockt, &data->writefds);
FD_CLR(sockt, &data->readfds);
for (; i < data->size; ++i) {
pbpal_native_socket_t i_sckt = data->asocket[i];
PUBNUB_ASSERT(pubnub_get_native_socket(data->apb[i]) == data->asocket[i]);
if ((int)i_sckt > new_nfds) {
new_nfds = i_sckt;
}
}
data->nfds = new_nfds;
}
void pbpal_ntf_callback_update_socket(struct pbpal_poll_data* data, pubnub_t* pb)
{
size_t i;
PUBNUB_ASSERT_OPT(data != NULL);
for (i = 0; i < data->size; ++i) {
if (data->apb[i] == pb) {
pbpal_native_socket_t sckt = data->asocket[i];
FD_CLR(sckt, &data->readfds);
FD_CLR(sckt, &data->readfds);
FD_CLR(sckt, &data->readfds);
sckt = pubnub_get_native_socket(data->apb[i]);
FD_CLR(sckt, &data->readfds);
FD_SET(sckt, &data->writefds);
FD_SET(sckt, &data->exceptfds);
data->asocket[i] = sckt;
break;
}
}
}
int pbpal_ntf_watch_out_events(struct pbpal_poll_data* data, pubnub_t* pbp)
{
pbpal_native_socket_t scket = pubnub_get_native_socket(pbp);
PUBNUB_ASSERT_OPT(data != NULL);
if (!we_ve_got_ya(data, pbp)) {
return -1;
}
FD_CLR(scket, &data->readfds);
FD_SET(scket, &data->writefds);
return 0;
}
int pbpal_ntf_watch_in_events(struct pbpal_poll_data* data, pubnub_t* pbp)
{
pbpal_native_socket_t scket = pubnub_get_native_socket(pbp);
PUBNUB_ASSERT_OPT(data != NULL);
if (!we_ve_got_ya(data, pbp)) {
return -1;
}
FD_SET(scket, &data->readfds);
FD_CLR(scket, &data->writefds);
return 0;
}
int pbpal_ntf_poll_away(struct pbpal_poll_data* data, int ms)
{
int i;
int rslt;
fd_set readfds;
fd_set writefds;
fd_set exceptfds;
struct timeval timeout;
if (0 == data->size) {
return 0;
}
timeout.tv_sec = ms / 1000;
timeout.tv_usec = (ms % 1000) * 1000;
memcpy(&readfds, &data->readfds, sizeof readfds);
memcpy(&writefds, &data->writefds, sizeof writefds);
memcpy(&exceptfds, &data->exceptfds, sizeof exceptfds);
rslt = select(data->nfds + 1, &readfds, &writefds, &exceptfds, &timeout);
if (SOCKET_ERROR == rslt) {
int last_err =
#if defined(_WIN32)
WSAGetLastError()
#else
errno
#endif
;
/* error? what to do about it? */
PUBNUB_LOG_WARNING(
"poll size = %u, error = %d\n", (unsigned)data->size, last_err);
return -1;
}
for (i = 0; (i < (int)data->size) && (rslt > 0); ++i) {
bool should_process = false;
if (FD_ISSET(data->asocket[i], &readfds)) {
should_process = true;
--rslt;
}
if (FD_ISSET(data->asocket[i], &writefds)) {
should_process = true;
--rslt;
PUBNUB_ASSERT_OPT(rslt >= 0);
}
if (FD_ISSET(data->asocket[i], &exceptfds)) {
should_process = true;
--rslt;
PUBNUB_ASSERT_OPT(rslt >= 0);
}
if (should_process) {
pbntf_requeue_for_processing(data->apb[i]);
}
}
PUBNUB_ASSERT_OPT(0 == rslt);
return rslt;
}
void pbpal_ntf_callback_poller_deinit(struct pbpal_poll_data** data)
{
PUBNUB_ASSERT_OPT(data != NULL);
PUBNUB_ASSERT_OPT(*data != NULL);
free(*data);
*data = NULL;
}
|
//
// GGLumberLog.h
// __无邪_
//
// Created by __无邪_ on 15/4/27.
// Copyright (c) 2015年 __无邪_. All rights reserved.
//
// CocoaLumberjac & XcodeColors(插件)
// https://github.com/robbiehanson/XcodeColors https://github.com/CocoaLumberjack/CocoaLumberjack
// 在 EditScheme Environment Variables 中添加 key: XcodeColors values:YES 可显示颜色
// info.plist 中 Application supports iTunes file sharing 设置为 YES
#import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
static const int ddLogLevel = DDLogLevelVerbose;// 定义日志级别
/**
* @brief 在iTunes共享文档Logs目录下产出日志文件
* @param
*/
/**
* DDLogError(@"错误信息"); // 红色
* DDLogWarn(@"警告"); // 橙色
* DDLogInfo(@"提示信息"); // 默认是黑色
* DDLogVerbose(@"详细信息"); // 默认是黑色
*/
/**
* 如果要修改Log输出的颜色可以使用如下代码:
* [[DDTTYLogger sharedInstance] setForegroundColor:[UIColor blueColor] backgroundColor:nil forFlag:LOG_FLAG_INFO];
*/
@interface GGLumberLog : NSObject
+ (instancetype)sharedInstance;
- (void)recordLog;
- (void)redirectLogfile2ShareOfiTunes;
@end
|
2800 #include "types.h"
2801 #include "defs.h"
2802 #include "param.h"
2803 #include "mmu.h"
2804 #include "proc.h"
2805
2806 int
2807 sys_fork(void)
2808 {
2809 int pid;
2810 struct proc *np;
2811
2812 if((np = copyproc(cp)) == 0)
2813 return -1;
2814 pid = np->pid;
2815 np->state = RUNNABLE;
2816 return pid;
2817 }
2818
2819 int
2820 sys_exit(void)
2821 {
2822 exit();
2823 return 0; // not reached
2824 }
2825
2826 int
2827 sys_wait(void)
2828 {
2829 return wait();
2830 }
2831
2832 int
2833 sys_kill(void)
2834 {
2835 int pid;
2836
2837 if(argint(0, &pid) < 0)
2838 return -1;
2839 return kill(pid);
2840 }
2841
2842 int
2843 sys_getpid(void)
2844 {
2845 return cp->pid;
2846 }
2847
2848
2849
2850 int
2851 sys_sbrk(void)
2852 {
2853 int addr;
2854 int n;
2855
2856 if(argint(0, &n) < 0)
2857 return -1;
2858 if((addr = growproc(n)) < 0)
2859 return -1;
2860 return addr;
2861 }
2862
2863 int
2864 sys_sleep(void)
2865 {
2866 int n, ticks0;
2867
2868 if(argint(0, &n) < 0)
2869 return -1;
2870 acquire(&tickslock);
2871 ticks0 = ticks;
2872 while(ticks - ticks0 < n){
2873 if(cp->killed){
2874 release(&tickslock);
2875 return -1;
2876 }
2877 sleep(&ticks, &tickslock);
2878 }
2879 release(&tickslock);
2880 return 0;
2881 }
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
|
//////////////////////////////////////////////////////////////////////////////
//
// Copyright 2018 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.
//
//////////////////////////////////////////////////////////////////////////////
//
// CREATED BY: Pei Zhan March 2009
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include "AcDbAssocSurfaceActionBody.h"
#pragma pack (push, 8)
/// <summary>
/// Action that sets the contents of AcDbSurface entity create by surface offset operation.
/// The action can be fully associative or semi-associative. If fully associative, the resulting
/// surface will always automatically regenerate when any input data is changed. If semi-associative,
/// when the geometry of input surfaces is changed, this action will be erased and
/// the resulting surface will not regenerate and become a generic surface.
/// </summary>
///
class ACDB_PORT AcDbAssocOffsetSurfaceActionBody : public AcDbAssocSurfaceActionBody
{
public:
ACRX_DECLARE_MEMBERS(AcDbAssocOffsetSurfaceActionBody);
/// <summary> Default constructor. </summary>
/// <param name="createImpObject"> See AcDbAssocCreateImpObject explanation. </param>
///
explicit AcDbAssocOffsetSurfaceActionBody(AcDbAssocCreateImpObject createImpObject = kAcDbAssocCreateImpObject);
/// <summary>
/// Set offset distance
/// </summary>
/// the same parameter can be set through class AcDbAssocAction by calling method
/// setValueParam with name "kOffsetDistanceParamName".
/// <param name="distance"> New value of the extension distance, must be non-zero. </param>
/// <param name="expression"> Expression of the parameter, if the value is controlled by other parameters</param>
/// <param name="evaluatorId"> The id of the expression evaluator that is used to parse the expression, if an expression is used. </param>
/// <returns> Acad::ErrorStatus. </returns>
///
Acad::ErrorStatus setDistance(double distance, const AcString& expression = AcString(),
const AcString& evaluatorId = AcString());
/// <summary><para>
/// Get offset distance and its possible expression
/// </para><para>
/// the same parameter can be accessed through class AcDbAssocAction by calling method
/// getValueParam with name "kOffsetDistanceParamName".
/// </para></summary>
/// <param name="expression"> Expression of the parameter, empty string if no expression is being used. </param>
/// <param name="evaluatorId"> The id of the expression evaluator that is used to parse the expression, empty string if no expression is being used </param>
/// <returns> Offset distance. </returns>
///
double distance(AcString& expression = dummyString(), AcString& evaluatorId = dummyString()) const;
/// <summary>
/// Create an instance of AcDbAssocOffsetSurfaceActionBody
/// </summary>
/// <param name="resultingSurfaceId"> Resulting offset surface id. </param>
/// <param name="inputSurfaceId1"> Id of input surface that used to create the new offset surface. </param>
/// <param name="distance"> Offset distance that used to create the new offset surface. </param>
/// <param name="createdActionId"> Id of created action. </param>
/// <param name="bEnabled"> Specify if the action is fully associative. if True, the resulting surface will
/// always automatically regenerate itself when input data is changed. If false, it will be
/// semi-associative, which means when the geometry input surface is changed, this
/// action will be erased and the resulting surface will not regenerate and become a generic surface. </param>
/// <returns> Acad::ErrorStatus. </returns>
///
static Acad::ErrorStatus createInstance( const AcDbObjectId& resultingSurfaceId,
const AcDbObjectId& inputSurfaceId,
double distance,
bool bEnabled,
AcDbObjectId& createdActionId);
}; // class AcDbAssocOffsetSurfaceActionBody
#pragma pack (pop)
|
#include <stdio.h>
int main()
{
int i;
for(i=1; i<=10; i++) {
printf("%d ", i);
}
return 0;
}
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class GameCenterGameBriefInfo, GameCenterMyGameView, GiftCenterData, NSString, RankSummaryData, RecentPlayCommModule, RecentPlayRecommendTopic;
@protocol GameCenterMyGameViewDelegate <NSObject>
- (void)onMyGameBannerClick:(NSString *)arg1 AppID:(NSString *)arg2;
- (void)onMyGameCommonModuleClick:(RecentPlayCommModule *)arg1 AppID:(NSString *)arg2;
- (void)onMyGameRankClick:(RankSummaryData *)arg1 AppID:(NSString *)arg2;
- (void)onMyGameGameCircleClick:(RecentPlayRecommendTopic *)arg1 AppID:(NSString *)arg2;
- (void)onMyGameGiftCenterClick:(GiftCenterData *)arg1 AppID:(NSString *)arg2;
- (void)onMyGame:(GameCenterMyGameView *)arg1 downloadGameClick:(GameCenterGameBriefInfo *)arg2;
- (void)onMyGame:(GameCenterMyGameView *)arg1 gameRowClick:(GameCenterGameBriefInfo *)arg2 Index:(long long)arg3;
@end
|
//
// SAViewController.h
// ServiceApi
//
// Created by Sergey Starukhin on 02/12/2017.
// Copyright (c) 2017 Sergey Starukhin. All rights reserved.
//
@import UIKit;
@interface SAViewController : UIViewController
@end
|
//
// SceneBase.h
// show
//
// Created by Chris Mullany on 02/09/2015.
//
//
#pragma once
#include "ofMain.h"
#include "AppModel.h"
#include "LedDisplay.h"
#include "Mic.h"
#include "GuiableBase.h"
#include "VisionManager.h"
#include "OscClient.h"
#include "Sequencable.h"
#include "DisplayManager.h"
// Each Scene shoud inherit from SceneBase
// provides pointers to common objects
//
class SceneBase : public GuiableBase, public Sequencable {
public:
SceneBase();
virtual void setup();
virtual void update();
virtual void draw();
virtual void drawSlaveProjection(){}
virtual void drawMasterProjection(){}
virtual void drawMasterScreen();
virtual void play();
virtual void play(int i);
virtual void stop();
// common pointers
// passed into each scene by SceneManager
DisplayManager * displays;
OscClient * osc;
VisionManager* vision;
LedDisplay* led;
Countdown* countdown;
Mic* mic;
ofTrueTypeFont* font;
AppModel* appModel;
// scenes can have child scenes (subscenes)
// a subscene is more like a state, but each has a unique int id
// ids are counted globally across all scenes
int subsceneStart;
int subsceneEnd;
int subsceneI;
ofEvent<int> nextSubsceneEvent;
bool isDebugMode;
string name;
string modeLabel;
AppModel::Mode mode;
protected:
void nextSubscene(int i = 0);
void playSubscene(int i);
bool isMaster();
bool isSlave();
bool isWindow();
void drawVision();
// Master / Slave display drawing methods
bool beginMasterScreenDraw();
bool endMasterScreenDraw();
bool beginMasterProjectionDraw();
bool endMasterProjectionDraw();
bool beginSlaveScreenDraw();
bool endSlaveScreenDraw();
bool beginSlaveProjectionDraw();
bool endSlaveProjectionDraw();
// App mode change listner
// only used for dev/debugging when switching modes at runtime
void onModeChange(AppModel::Mode& mode);
virtual void onCountdownComplete(int& i);
// common scene params
ofParameter<int> countdownDuration;
private:
}; |
//
// P2ViewController.h
//
// Created by Pedro Plowman on 2013-06-24.
//
// The MIT License (MIT)
//
// Copyright (c) 2013 Pedro Plowman
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <UIKit/UIKit.h>
#import "P2EmailVerifier.h"
@interface P2ViewController : UIViewController <P2EmailVerifierDelegate>
- (IBAction)tappedValidatePatternButton:(id)sender;
- (IBAction)tappedVerifyAddressButton:(id)sender;
@end
|
#ifndef __c15_HIL_model_error_h__
#define __c15_HIL_model_error_h__
/* Include files */
#include "sfc_sf.h"
#include "sfc_mex.h"
#include "rtwtypes.h"
/* Type Definitions */
#ifndef typedef_SFc15_HIL_model_errorInstanceStruct
#define typedef_SFc15_HIL_model_errorInstanceStruct
typedef struct {
SimStruct *S;
ChartInfoStruct chartInfo;
uint32_T chartNumber;
uint32_T instanceNumber;
int32_T c15_sfEvent;
boolean_T c15_isStable;
boolean_T c15_doneDoubleBufferReInit;
uint8_T c15_is_active_c15_HIL_model_error;
} SFc15_HIL_model_errorInstanceStruct;
#endif /*typedef_SFc15_HIL_model_errorInstanceStruct*/
/* Named Constants */
/* Variable Declarations */
/* Variable Definitions */
/* Function Declarations */
extern const mxArray *sf_c15_HIL_model_error_get_eml_resolved_functions_info
(void);
/* Function Definitions */
extern void sf_c15_HIL_model_error_get_check_sum(mxArray *plhs[]);
extern void c15_HIL_model_error_method_dispatcher(SimStruct *S, int_T method,
void *data);
#endif
|
#include "stm32f10x.h"
#include "HAL.H"
/***********************************************************************************
º¯ÊýÃû£ºvoid PWM_Set(const u16 pwm1, const u16 pwm2, const u16 pwm3, const u16 pwm4)
˵Ã÷£ºPWMÉèÖÃ
Èë¿Ú£ºÎÞ
³ö¿Ú£ºÎÞ
±¸×¢£º¸ù¾ÝPWMµÄÊýÖµ¸øÓëÏàÓ¦PWMÐźŵƵÄ״̬:
µ±PWMΪ0ʱ£¬µÆÃð
²»Îª0ʱ£¬µÆÁÁ
************************************************************************************/
void PWM_Set(const u16 pwm1, const u16 pwm2, const u16 pwm3, const u16 pwm4)
{
if (pwm1 == 0) //ûÓÐPWM£¬´ËʱµÆÃð
LED1 = 1;
else
LED1 = 0;
if (pwm2 == 0) //ûÓÐPWM£¬´ËʱµÆÃð
LED2 = 1;
else
LED2 = 0;
if (pwm3 == 0) //ûÓÐPWM£¬´ËʱµÆÃð
LED3 = 1;
else
LED3 = 0;
if (pwm4 == 0) //ûÓÐPWM£¬´ËʱµÆÃð
LED4 = 1;
else
LED4 = 0;
TIM_SetCompare1(TIM3, pwm1);
TIM_SetCompare2(TIM3, pwm2);
TIM_SetCompare3(TIM3, pwm3);
TIM_SetCompare4(TIM3, pwm4);
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__char_connect_socket_system_68b.c
Label Definition File: CWE78_OS_Command_Injection.one_string.label.xml
Template File: sources-sink-68b.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: connect_socket Read data using a connect socket (client side)
* GoodSource: Fixed string
* Sink: system
* BadSink : Execute command in data using system()
* Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define FULL_COMMAND "%WINDIR%\\system32\\cmd.exe /c dir "
#else
#include <unistd.h>
#define FULL_COMMAND "/bin/sh ls -la "
#endif
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else /* NOT _WIN32 */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define IP_ADDRESS "127.0.0.1"
#ifdef _WIN32
#define SYSTEM system
#else /* NOT _WIN32 */
#define SYSTEM system
#endif
extern char * CWE78_OS_Command_Injection__char_connect_socket_system_68_badData;
extern char * CWE78_OS_Command_Injection__char_connect_socket_system_68_goodG2BData;
/* all the sinks are the same, we just want to know where the hit originated if a tool flags one */
#ifndef OMITBAD
void CWE78_OS_Command_Injection__char_connect_socket_system_68b_badSink()
{
char * data = CWE78_OS_Command_Injection__char_connect_socket_system_68_badData;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE78_OS_Command_Injection__char_connect_socket_system_68b_goodG2BSink()
{
char * data = CWE78_OS_Command_Injection__char_connect_socket_system_68_goodG2BData;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
}
#endif /* OMITGOOD */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.