text
stringlengths
4
6.14k
/* * Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ARM_COMPUTE_EXPERIMENTAL_TYPES_H #define ARM_COMPUTE_EXPERIMENTAL_TYPES_H #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/TensorShape.h" #include <vector> namespace arm_compute { // Forward declaration class ITensor; /** Memory type */ enum TensorType : int32_t { ACL_UNKNOWN = -1, ACL_SRC_DST = 0, // Src ACL_SRC = 0, ACL_SRC_0 = 0, ACL_SRC_1 = 1, ACL_SRC_2 = 2, ACL_SRC_3 = 3, ACL_SRC_4 = 4, ACL_SRC_5 = 5, ACL_SRC_6 = 6, // Dst ACL_DST = 30, ACL_DST_0 = 30, ACL_DST_1 = 31, ACL_DST_2 = 32, // Aux ACL_INT = 50, ACL_INT_0 = 50, ACL_INT_1 = 51, ACL_INT_2 = 52, ACL_INT_3 = 53, ACL_INT_4 = 54, ACL_SRC_VEC = 256, ACL_DST_VEC = 512, ACL_INT_VEC = 1024, // Aliasing Types // Conv etc ACL_BIAS = ACL_SRC_2, // Gemm ACL_VEC_ROW_SUM = ACL_SRC_3, ACL_VEC_COL_SUM = ACL_SRC_4, ACL_SHIFTS = ACL_SRC_5, ACL_MULTIPLIERS = ACL_SRC_6, // (EXPERIMENTAL_POST_OPS) Post ops arguments begin after everything else EXPERIMENTAL_ACL_POST_OP_ARG = 2048, EXPERIMENTAL_ACL_POST_OP_ARG_FIRST = EXPERIMENTAL_ACL_POST_OP_ARG, EXPERIMENTAL_ACL_POST_OP_ARG_LAST = EXPERIMENTAL_ACL_POST_OP_ARG_FIRST + 1024, // Max number of post op arguments }; namespace experimental { enum class MemoryLifetime { Temporary = 0, Persistent = 1, Prepare = 2, }; struct MemoryInfo { MemoryInfo() = default; MemoryInfo(int slot, size_t size, size_t alignment = 0) noexcept : slot(slot), size(size), alignment(alignment) { } MemoryInfo(int slot, MemoryLifetime lifetime, size_t size, size_t alignment = 0) noexcept : slot(slot), lifetime(lifetime), size(size), alignment(alignment) { } bool merge(int slot, size_t new_size, size_t new_alignment = 0) noexcept { if(slot != this->slot) { return false; } size = std::max(size, new_size); alignment = std::max(alignment, new_alignment); return true; } int slot{ ACL_UNKNOWN }; MemoryLifetime lifetime{ MemoryLifetime::Temporary }; size_t size{ 0 }; size_t alignment{ 64 }; }; using MemoryRequirements = std::vector<MemoryInfo>; } // namespace experimental } // namespace arm_compute #endif /* ARM_COMPUTE_EXPERIMENTAL_TYPES_H */
#include <stdio.h> #include <stdlib.h> int test_trueThreeFourths(int x) { long long int x3 = (long long int) x * 3LL; return (int) (x3/4LL); } int trueThreeFourths(int x) { int xs1 = x >> 1; int xs2 = x >> 2; /* Compute value from low-order 2 bits */ int bias = (x >> 31) & 0x3; int xl2 = x & 0x3; int xl1 = (x & 0x1) << 1; int incr = (xl2 + xl1 + bias) >> 2; return xs1 + xs2 + incr; } int main(int argc, char *argv[]) { int i; for (i = 1; i < argc; i++) { int x = atoi(argv[i]); int v1 = trueThreeFourths(x); int v2 = test_trueThreeFourths(x); printf("x = %d (0x%x)\n", x, x); printf("\tref: %d (0x%x)\n", v2, v2); printf("\tGot: %d (0x%x)\n", v1, v1); } return 0; }
/* * TODO * Implement loading what modules should be used from a file. * * Implement map from module ID to initiation function. * Initiation function should have a standardised "declaration" * * Module will be responsible for passing update command down to every active module * It means that ModuleManager will have to track which modules are active. */ #ifndef MASKED_MODULEMANAGER_H #define MASKED_MODULEMANAGER_H // Standard #include <vector> #include <string> #include <map> #include <stdexcept> namespace Masked { class Module; class ModuleManager { public: // ============================================================================================================= // Constructors/Destructors // ============================================================================================================= // ============================================================================================================= // Functions // ============================================================================================================= // Use this function to register a module. Registered modules are used and updated in execution time. static void Register(Module *); // Use this function to get registered modules. static std::vector<Module *> &Modules(); // Use this function to update registered modules. static void UpdateModules(); private: // ============================================================================================================= // Variables // ============================================================================================================= }; } #endif //MASKED_MODULEMANAGER_H
/* The MIT License (MIT) Copyright (c) 2015 Apostol Dadachev 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 SAVVY_TEMPLATE_CONVERTER_HLSL_TO_GLSL_H #define SAVVY_TEMPLATE_CONVERTER_HLSL_TO_GLSL_H #include "SavvyTemplateConverter.h" namespace Savvy { namespace Internal { class TemplateConverterHLSLToGLSL : public TemplateConverter { public: TemplateConverterHLSLToGLSL(); ~TemplateConverterHLSLToGLSL(); virtual ResultCode ConvertTemplatedVariable(Database::Variable& a_Var, Database::Variable& a_RetVar); virtual ResultCode ConvertTemplatedInstruction(Database::WordMultiMap::iterator& it1, std::string& currentLine, Key& a_FuncName, uint32 a_Shader, Key& a_InputStructName = Key(), Key& a_OutputStructName = Key()); virtual ResultCode GetTemplateArguments(Database::WordMultiMap::iterator& it1, StringList& a_OutputList, std::string& currentLine); protected: typedef std::vector<std::function<ResultCode(Database::Variable&, Database::Variable&, bool&)>> TemplateConvertList; TemplateConvertList m_TemplateConvertList; ResultCode ConvertTextureTemplates(Database::Variable& a_Var, Database::Variable& a_RetVar, bool& a_Handled); }; } } #endif // !SAVVY_TEMPLATE_CONVERTER_HLSL_TO_GLSL_H
/* * Copyright (c) 2014 Jason Kölker * */ #include "atheme.h" #include "uplink.h" DECLARE_MODULE_V1 ( "totes/ns_forceuser", false, _modinit, _moddeinit, "$Revision: 1 $", "Jason Kölker <jason@koelker.net>" ); static void hook_user_identify(user_t *u); void _modinit(module_t *m) { hook_add_event("user_identify"); hook_add_user_identify(hook_user_identify); } void _moddeinit(module_unload_intent_t intent) { hook_del_user_identify(hook_user_identify); } static void hook_user_identify(user_t *u) { int ret; char *ident; char buf[100]; myuser_t *mu = u->myuser; if (mu == NULL) { snprintf(buf, 100, "%s_insecure", entity(mu)->name); ident = buf; } else { ident = entity(mu)->name; } ret = sts("CHGIDENT %s %s", u->uid, ident); if (ret == 1) { slog(LG_INFO, "Could not set ident (%s) for user (%s): ret (%d)", ident, u->uid, ret); } } /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs * vim:ts=4 * vim:sw=4 * vim:noexpandtab */
// // QPTBaseModel.h // QiPinTong // // Created by 企聘通 on 2017/4/20. // Copyright © 2017年 ShiJiJiaLian. All rights reserved. // #import <Foundation/Foundation.h> @interface QPTBaseModel : NSObject //#pragma mark - 缓存 /** * 归档 - 存入模型 */ //- (void)archive; /** * 解档 - 取出模型 */ //- (id)unarchiver; /** * 移除缓存中的模型 */ //- (void)remove; /** * 字典数组转模型数组 */ + (NSMutableArray *)modelArrayWithDictArray:(NSArray *)response; /** * 字典转模型 */ + (instancetype)modelWithDictionary:(NSDictionary *)dictionary; /** * 模型包含模型数组 */ + (void)setUpModelClassInArrayWithContainDict:(NSDictionary *)dict; /** * 字典数组转模型数组 * @param dict 模型包含模型数组 格式为 key-字段名字 value-[被包含的类名] */ + (NSMutableArray *)modelArrayWithDictArray:(NSArray *)response containDict:(NSDictionary *)dict; @end
#ifndef PP_GETADDRINFO_H #define PP_GETADDRINFO_H #define ANY (0) struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; size_t ai_addrlen; struct sockaddr* ai_addr; char* ai_canonname; /* canonical name */ struct addrinfo* ai_next; /* this struct can form a linked list */ }; #endif // PP_GETADDRINFO_H
#ifndef __GAME_SCENE_H__ #define __GAME_SCENE_H__ #include "cocos2d.h" #include "GameLayer.h" USING_NS_CC; class GameScene : public Layer { public: static Scene* createScene(); bool init(); CREATE_FUNC(GameScene); void startPlay(); void gameOver(); void update(float dt); void updateScore(); int readRecord(); void writeRecord(int record); bool onTouchBegan(Touch* touch, Event* event); private: enum class State { Tutorial, Playing, Falling, Gameover }; bool cheating; State state; Label* scoreLabel; Node* tutorialNode; GameLayer* layer; Bird* bird; }; #endif // __GAME_SCENE_H__
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <DVTKit/DVTDraggedImageStateTransitionView.h> @class NSAffineTransform; @interface DVTDraggedObjectsTransitionView : DVTDraggedImageStateTransitionView { NSAffineTransform *_transformFromToState; NSAffineTransform *_transformFromFromState; } - (void).cxx_destruct; - (void)drawRect:(struct CGRect)arg1; - (void)setProgress:(float)arg1; - (id)toState; - (id)fromState; - (id)description; - (id)initWithFromState:(id)arg1 andToState:(id)arg2; @end
#ifndef _IVM_APP_IAS_PARSER_H_ #define _IVM_APP_IAS_PARSER_H_ #include "pub/com.h" #include "pub/type.h" #include "pub/vm.h" #include "std/list.h" #include "gen.h" IVM_COM_HEADER ias_gen_env_t * ias_parser_parseSource(const ivm_char_t *src); IVM_COM_END #endif
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef mistcoin_WALLETDB_H #define mistcoin_WALLETDB_H #include "db.h" #include "base58.h" class CKeyPool; class CAccount; class CAccountingEntry; /** Error statuses for the wallet database */ enum DBErrors { DB_LOAD_OK, DB_CORRUPT, DB_NONCRITICAL_ERROR, DB_TOO_NEW, DB_LOAD_FAIL, DB_NEED_REWRITE }; class CKeyMetadata { public: static const int CURRENT_VERSION=1; int nVersion; int64_t nCreateTime; // 0 means unknown CKeyMetadata() { SetNull(); } CKeyMetadata(int64_t nCreateTime_) { nVersion = CKeyMetadata::CURRENT_VERSION; nCreateTime = nCreateTime_; } IMPLEMENT_SERIALIZE ( READWRITE(this->nVersion); nVersion = this->nVersion; READWRITE(nCreateTime); ) void SetNull() { nVersion = CKeyMetadata::CURRENT_VERSION; nCreateTime = 0; } }; /** Access to the wallet database (wallet.dat) */ class CWalletDB : public CDB { public: CWalletDB(std::string strFilename, const char* pszMode="r+") : CDB(strFilename.c_str(), pszMode) { } private: CWalletDB(const CWalletDB&); void operator=(const CWalletDB&); public: bool WriteName(const std::string& strAddress, const std::string& strName); bool EraseName(const std::string& strAddress); bool WriteTx(uint256 hash, const CWalletTx& wtx) { nWalletDBUpdated++; return Write(std::make_pair(std::string("tx"), hash), wtx); } bool EraseTx(uint256 hash) { nWalletDBUpdated++; return Erase(std::make_pair(std::string("tx"), hash)); } bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta) { nWalletDBUpdated++; if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; return Write(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey, false); } bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta) { nWalletDBUpdated++; bool fEraseUnencryptedKey = true; if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; if (!Write(std::make_pair(std::string("ckey"), vchPubKey.Raw()), vchCryptedSecret, false)) return false; if (fEraseUnencryptedKey) { Erase(std::make_pair(std::string("key"), vchPubKey.Raw())); Erase(std::make_pair(std::string("wkey"), vchPubKey.Raw())); } return true; } bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey) { nWalletDBUpdated++; return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); } bool WriteCScript(const uint160& hash, const CScript& redeemScript) { nWalletDBUpdated++; return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false); } bool WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++; return Write(std::string("bestblock"), locator); } bool ReadBestBlock(CBlockLocator& locator) { return Read(std::string("bestblock"), locator); } bool WriteOrderPosNext(int64_t nOrderPosNext) { nWalletDBUpdated++; return Write(std::string("orderposnext"), nOrderPosNext); } bool WriteDefaultKey(const CPubKey& vchPubKey) { nWalletDBUpdated++; return Write(std::string("defaultkey"), vchPubKey.Raw()); } bool ReadPool(int64_t nPool, CKeyPool& keypool) { return Read(std::make_pair(std::string("pool"), nPool), keypool); } bool WritePool(int64_t nPool, const CKeyPool& keypool) { nWalletDBUpdated++; return Write(std::make_pair(std::string("pool"), nPool), keypool); } bool ErasePool(int64_t nPool) { nWalletDBUpdated++; return Erase(std::make_pair(std::string("pool"), nPool)); } // Settings are no longer stored in wallet.dat; these are // used only for backwards compatibility: template<typename T> bool ReadSetting(const std::string& strKey, T& value) { return Read(std::make_pair(std::string("setting"), strKey), value); } template<typename T> bool WriteSetting(const std::string& strKey, const T& value) { nWalletDBUpdated++; return Write(std::make_pair(std::string("setting"), strKey), value); } bool EraseSetting(const std::string& strKey) { nWalletDBUpdated++; return Erase(std::make_pair(std::string("setting"), strKey)); } bool WriteMinVersion(int nVersion) { return Write(std::string("minversion"), nVersion); } bool ReadAccount(const std::string& strAccount, CAccount& account); bool WriteAccount(const std::string& strAccount, const CAccount& account); private: bool WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry); public: bool WriteAccountingEntry(const CAccountingEntry& acentry); int64_t GetAccountCreditDebit(const std::string& strAccount); void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries); DBErrors ReorderTransactions(CWallet*); DBErrors LoadWallet(CWallet* pwallet); static bool Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys); static bool Recover(CDBEnv& dbenv, std::string filename); }; #endif // mistcoin_WALLETDB_H
/*********************************************************************************************************************************** HTTP Session ***********************************************************************************************************************************/ #include "build.auto.h" #include "common/debug.h" #include "common/io/http/session.h" #include "common/io/io.h" #include "common/log.h" /*********************************************************************************************************************************** Object type ***********************************************************************************************************************************/ struct HttpSession { HttpClient *httpClient; // HTTP client IoSession *ioSession; // IO session }; /**********************************************************************************************************************************/ HttpSession * httpSessionNew(HttpClient *httpClient, IoSession *ioSession) { FUNCTION_LOG_BEGIN(logLevelDebug) FUNCTION_LOG_PARAM(HTTP_CLIENT, httpClient); FUNCTION_LOG_PARAM(IO_SESSION, ioSession); FUNCTION_LOG_END(); ASSERT(httpClient != NULL); ASSERT(ioSession != NULL); HttpSession *this = NULL; OBJ_NEW_BEGIN(HttpSession) { this = OBJ_NEW_ALLOC(); *this = (HttpSession) { .httpClient = httpClient, .ioSession = ioSessionMove(ioSession, memContextCurrent()), }; } OBJ_NEW_END(); FUNCTION_LOG_RETURN(HTTP_SESSION, this); } /**********************************************************************************************************************************/ void httpSessionDone(HttpSession *this) { FUNCTION_LOG_BEGIN(logLevelDebug) FUNCTION_LOG_PARAM(HTTP_SESSION, this); FUNCTION_LOG_END(); ASSERT(this != NULL); httpClientReuse(this->httpClient, this); FUNCTION_LOG_RETURN_VOID(); } /**********************************************************************************************************************************/ IoRead * httpSessionIoRead(HttpSession *this) { FUNCTION_TEST_BEGIN(); FUNCTION_TEST_PARAM(HTTP_SESSION, this); FUNCTION_TEST_END(); ASSERT(this != NULL); FUNCTION_TEST_RETURN(ioSessionIoRead(this->ioSession)); } /**********************************************************************************************************************************/ IoWrite * httpSessionIoWrite(HttpSession *this) { FUNCTION_TEST_BEGIN(); FUNCTION_TEST_PARAM(HTTP_SESSION, this); FUNCTION_TEST_END(); ASSERT(this != NULL); FUNCTION_TEST_RETURN(ioSessionIoWrite(this->ioSession)); }
// // Licensed under the terms in LICENSE.txt // // Copyright 2014 Tom Dalling. All rights reserved. // @import Cocoa; @interface NSMenu(TDCocoaExtensions) +(NSMenu*) td_menuWithItems:(NSArray*)items; -(NSMenuItem*) td_itemWithRepresentedObject:(id)representedObject; @end @interface NSPopUpButton(TDCocoaExtensions) -(void) td_selectItemWithRepresentedObject:(id)representedObject; @end @interface NSColor(TDCocoaExtensions) +(instancetype) td_fromHex:(NSString*)hex; @end @interface NSView(TDCocoaExtensions) -(void) td_fadeToAlpha:(CGFloat)alpha onFinish:(void(^)(void))onFinish; -(void) td_fillWithView:(NSView*)view; -(void) td_fillWithViewController:(NSViewController*)viewController; @end @interface NSSavePanel(TDCocoaExtensions) -(void) td_saveCurrentState; //useless in the OS X sandbox -(void) td_loadLastState; //useless in the OS X sandbox @end
#include "image.h" #include "histogram.h" struct cell { unsigned char B; cell next; }; struct histo_iter { int R,G; cell current; }; int main(int argc, char **argv) { image img=FAIRE_image(); int i=0; /* Param a afficher */ int R=0,G=0,B=0; int lum=0; int occ=0; histo histogram=create_histo(); histo_iter iter; /* Chargement de l'image */ image_charger(img,argv[1]); /* Positionnement du pointeur courant au debut de l'image */ image_debut(img); init_histo(histogram,img); /* Creation de l'iterateur */ iter = create_histo_iter(histogram); /* Parcours de l'histogramme */ do { R=iter->R; G=iter->G; B=iter->current->B; lum=(R+G+B)/3; occ=give_freq_histo(histogram,R,G,B); printf("(R = %d, G = %d, B = %d, LUM = %d, OCC = %d)\n",R,G,B,lum,occ); i++; } while(next_histo_iter(iter,histogram)); printf("\033[32mNombre de couleurs : %d\033[0m\n", i); return 0; }
// Copyright 2015 XLGAMES Inc. // // Distributed under the MIT License (See // accompanying file "LICENSE" or the website // http://www.opensource.org/licenses/mit-license.php) #pragma once #include "../EntityInterface/EntityInterface.h" #include "DelayedDeleteQueue.h" #include "CLIXAutoPtr.h" using namespace System::Collections::Generic; namespace EntityInterface { class Switch; } namespace GUILayer { public ref class EntityLayer { public: //// //// //// G O B I N T E R F A C E //// //// //// using DocumentTypeId = EntityInterface::DocumentTypeId; using ObjectTypeId = EntityInterface::ObjectTypeId; using DocumentId = EntityInterface::DocumentId; using ObjectId = EntityInterface::ObjectId; using ObjectTypeId = EntityInterface::ObjectTypeId; using PropertyId = EntityInterface::PropertyId; using ChildListId = EntityInterface::ChildListId; DocumentId CreateDocument(DocumentTypeId docType); bool DeleteDocument(DocumentId doc, DocumentTypeId docType); value struct PropertyInitializer { PropertyId _prop; const void* _src; unsigned _elementType; unsigned _arrayCount; bool _isString; PropertyInitializer(PropertyId prop, const void* src, unsigned elementType, unsigned arrayCount, bool isString) : _prop(prop), _src(src), _elementType(elementType), _arrayCount(arrayCount), _isString(isString) {} }; ObjectId AssignObjectId(DocumentId doc, ObjectTypeId type); bool CreateObject(DocumentId doc, ObjectId obj, ObjectTypeId objType, IEnumerable<PropertyInitializer>^ initializers); bool DeleteObject(DocumentId doc, ObjectId obj, ObjectTypeId objType); bool SetProperty(DocumentId doc, ObjectId obj, ObjectTypeId objType, IEnumerable<PropertyInitializer>^ initializers); bool GetProperty(DocumentId doc, ObjectId obj, ObjectTypeId objType, PropertyId prop, void* dest, unsigned* destSize); bool SetObjectParent(DocumentId doc, ObjectId childId, ObjectTypeId childTypeId, ObjectId parentId, ObjectTypeId parentTypeId, int insertionPosition); ObjectTypeId GetTypeId(System::String^ name); DocumentTypeId GetDocumentTypeId(System::String^ name); PropertyId GetPropertyId(ObjectTypeId type, System::String^ name); ChildListId GetChildListId(ObjectTypeId type, System::String^ name); EntityInterface::Switch& GetSwitch(); EntityLayer(std::shared_ptr<EntityInterface::Switch> swtch); ~EntityLayer(); protected: clix::shared_ptr<EntityInterface::Switch> _switch; }; }
/* * fibers.h * * Created on: Jan 24, 2013 * @author Ralph Schurade */ #ifndef FIBERS_H_ #define FIBERS_H_ #include <QVector> class DatasetFibers; class DatasetScalar; class Dataset3D; class Fibers { public: Fibers( DatasetFibers* ds ); virtual ~Fibers(); DatasetFibers* thinOut(); DatasetScalar* tractDensity(); Dataset3D* tractColor(); private: DatasetFibers* m_dataset; float getFiberDist( QVector< float >& lhs, QVector< float >& rhs ); float getDist( float x1, float y1, float z1, float x2, float y2, float z2 ); QVector<float> mergeFibs( QVector< float >& lhs, QVector< float >& rhs ); int m_nx; int m_ny; int m_nz; float m_dx; float m_dy; float m_dz; int m_blockSize; int getID( float x, float y, float z ) { int id = (int) ( x / m_dx ) + (int) ( y / m_dy ) * m_nx + (int) ( z / m_dz ) * m_ny * m_nx; id = std::max( (int) 0, std::min( m_blockSize - 1, id ) ); return id; } void getXYZ( int id, int &x, int &y, int &z ) { x = id % m_nx; int tempY = id % ( m_nx * m_ny ); y = tempY / m_nx; z = id / ( m_nx * m_ny ); } }; #endif /* FIBERS_H_ */
#import <UIKit/UIKit.h> @class BTUI; /** Represents a Venmo button */ @interface BTUIVenmoButton : UIControl @property (nonatomic, strong) BTUI *theme; @end
#ifndef XSUSBHUBINFO_H #define XSUSBHUBINFO_H #ifdef _WIN32 typedef int XsHubIdentifier; #else typedef const char* XsHubIdentifier; #endif struct XsUsbHubInfo; #ifndef __cplusplus #define XSUSBHUBINFO_INITIALIZER { 0 } typedef struct XsUsbHubInfo XsUsbHubInfo; #else extern "C" { #endif XDA_DLL_API void XsUsbHubInfo_assign(XsUsbHubInfo* thisPtr, XsHubIdentifier hub); XDA_DLL_API void XsUsbHubInfo_construct(XsUsbHubInfo* thisPtr, XsHubIdentifier hub); XDA_DLL_API void XsUsbHubInfo_destruct(XsUsbHubInfo* thisPtr); XDA_DLL_API void XsUsbHubInfo_copy(XsUsbHubInfo* copy, XsUsbHubInfo const* src); XDA_DLL_API void XsUsbHubInfo_swap(XsUsbHubInfo* thisPtr, XsUsbHubInfo* thatPtr); XDA_DLL_API int XsUsbHubInfo_parentPathMatches(const XsUsbHubInfo* thisPtr, const XsUsbHubInfo* other); #ifdef __cplusplus } // extern "C" #endif /*! \struct XsUsbHubInfo \brief A structure that wraps USB hub information */ struct XsUsbHubInfo { #ifdef __cplusplus /*! \brief Default constructor \param hubid an optional hub identifier to initialize with \sa XsUsbHubInfo_construct */ explicit XsUsbHubInfo(XsHubIdentifier hubid = 0) : m_hub(0) { if (hubid) XsUsbHubInfo_construct(this, hubid); } /*! \brief Destructor \sa XsUsbHubInfo_destruct */ ~XsUsbHubInfo() { XsUsbHubInfo_destruct(this); //lint !e1551 } /*! \brief Copy constructor \param other the object to copy \sa XsUsbHubInfo_copy \sa XsUsbHubInfo_construct */ XsUsbHubInfo(const XsUsbHubInfo &other) : m_hub(0) { if (other.m_hub) XsUsbHubInfo_construct(this, other.m_hub); } /*! \brief Assigns \a other to this XsUsbHubInfo \param other the object to copy \returns a const reference to this info object \sa XsUsbHubInfo_copy */ const XsUsbHubInfo& operator=(const XsUsbHubInfo &other) { if (this != &other) XsUsbHubInfo_copy(this, &other); return *this; } /*! \brief \copybrief XsUsbHubInfo_parentPathMatches * \param other the object to compare to * \returns true if the two objects share the same immediate parent hub, false otherwise * \sa XsUsbHubInfo_parentPathMatches */ bool parentPathMatches(const XsUsbHubInfo &other) const { return 0 != XsUsbHubInfo_parentPathMatches(this, &other); } /*! \brief Returns true if a valid hub is set */ bool isValid() const { return m_hub != 0; } /*! \brief Return the hub identifier */ inline XsHubIdentifier hub() const { return m_hub; } private: #endif XsHubIdentifier m_hub; }; typedef struct XsUsbHubInfo XsUsbHubInfo; #endif // file guard
/***************************************************************************************** * * * OpenSpace * * * * Copyright (c) 2014-2022 * * * * 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 __OPENSPACE_MODULE_VOLUME___RAWVOLUMEREADER___H__ #define __OPENSPACE_MODULE_VOLUME___RAWVOLUMEREADER___H__ #include <ghoul/glm.h> #include <filesystem> #include <string> namespace openspace::volume { template <typename T> class RawVolume; template <typename Type> class RawVolumeReader { public: using VoxelType = Type; RawVolumeReader(const std::filesystem::path& path, const glm::uvec3& dimensions); glm::uvec3 dimensions() const; std::filesystem::path path() const; void setPath(std::filesystem::path path); void setDimensions(const glm::uvec3& dimensions); //VoxelType get(const glm::ivec3& coordinates) const; // TODO: Implement this //VoxelType get(const size_t index) const; // TODO: Implement this std::unique_ptr<RawVolume<VoxelType>> read(bool invertZ = false); private: size_t coordsToIndex(const glm::uvec3& cartesian) const; glm::uvec3 indexToCoords(size_t linear) const; glm::uvec3 _dimensions; std::filesystem::path _path; }; } // namespace openspace::volume #include "rawvolumereader.inl" #endif // __OPENSPACE_MODULE_VOLUME___RAWVOLUMEREADER___H__
/* * Copyright © 2012-2013 Graham Sellers * * This code is part of the OpenGL SuperBible, 6th Edition. * * 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 (including the next * paragraph) 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 __OBJECT_H__ #define __OBJECT_H__ #include "sb6mfile.h" #include <GL/glew.h> #ifndef SB6M_FILETYPES_ONLY namespace sb7 { class object { public: object(); ~object(); inline void render(unsigned int instance_count = 1, unsigned int base_instance = 0) { render_sub_object(0, instance_count, base_instance); } void render_sub_object(unsigned int object_index, unsigned int instance_count = 1, unsigned int base_instance = 0); void get_sub_object_info(unsigned int index, GLuint &first, GLuint &count) { if (index >= num_sub_objects) { first = 0; count = 0; } else { first = sub_object[index].first; count = sub_object[index].count; } } unsigned int get_sub_object_count() const { return num_sub_objects; } GLuint get_vao() const { return vao; } void load(const char * filename); void free(); private: GLuint data_buffer; GLuint vao; GLuint index_type; GLuint index_offset; enum { MAX_SUB_OBJECTS = 256 }; unsigned int num_sub_objects; SB6M_SUB_OBJECT_DECL sub_object[MAX_SUB_OBJECTS]; }; } #endif /* SB6M_FILETYPES_ONLY */ #endif /* __OBJECT_H__ */
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/GQHState.h> @class GQHXML; // Not exported @interface GQHLassoState : GQHState { GQHXML *mNavigation; int mSheetCount; int mTableCount; struct __CFString *mCssUri; struct __CFString *mCurrentSheetFilename; struct __CFString *mCurrentSheetUri; struct CGPoint mMaxCanvasPoint; unsigned int mCurrentDrawableZOrder; unsigned int mZOrderedDrawableCount; struct __CFDictionary *mDrawableUidToCssZOrderClassMap; struct __CFArray *mSheetCssUriList; struct __CFString *mSheetCssFilename; struct __CFString *mSheetOneCss; struct __CFString *mSheetOneLastCSS; char *mFirstWorkspaceName; _Bool mIsProgressiveMode; GQHXML *mIndex; struct __CFArray *mSheetFilenameList; struct __CFArray *mSheetUriList; struct __CFArray *mSheetCssLastUriList; struct __CFString *mSheetCssLastFilename; } - (id).cxx_construct; - (struct __CFString *)writeTabsJS; - (_Bool)inProgressiveMode; - (void)writeNavigationPage:(id)arg1; - (_Bool)writeIndexPageWithIFrame:(id)arg1; - (void)writeIndexPageWithDocumentSize:(struct CGSize)arg1; - (unsigned int)currentDrawableZOrder; - (struct __CFString *)cssZOrderClassForDrawableUid:(const char *)arg1; - (_Bool)drawablesNeedCssZOrdering; - (void)addedDrawableWithBounds:(struct CGRect)arg1; - (struct CGPoint)maxCanvasPoint; - (_Bool)finishMainHtml; - (void)addCachedStyle:(struct __CFString *)arg1; - (struct __CFString *)makeInlineStyle:(struct __CFString *)arg1; - (void)addStyle:(struct __CFString *)arg1 className:(struct __CFString *)arg2 srcStyle:(id)arg3; - (int)endSheet; - (void)cacheAnchorForIndexPage:(char *)arg1; - (void)writeAnchorInNavigationPage:(char *)arg1; - (void)beginNewSheet:(const char *)arg1 processorState:(id)arg2; - (void)dealloc; - (id)initWithState:(id)arg1; @end
///////////////////////////////////////////////////////////////////////////// // Copyright (c) 2009-2014 Alan Wright. All rights reserved. // Distributable under the terms of either the Apache License (Version 2.0) // or the GNU Lesser General Public License. ///////////////////////////////////////////////////////////////////////////// #ifndef FIELDMASKINGSPANQUERY_H #define FIELDMASKINGSPANQUERY_H #include "SpanQuery.h" namespace Lucene { /// Wrapper to allow {@link SpanQuery} objects participate in composite single-field SpanQueries by /// 'lying' about their search field. That is, the masked SpanQuery will function as normal, but /// {@link SpanQuery#getField()} simply hands back the value supplied in this class's constructor. /// /// This can be used to support Queries like {@link SpanNearQuery} or {@link SpanOrQuery} across /// different fields, which is not ordinarily permitted. /// /// This can be useful for denormalized relational data: for example, when indexing a document with /// conceptually many 'children': /// /// <pre> /// teacherid: 1 /// studentfirstname: james /// studentsurname: jones /// /// teacherid: 2 /// studenfirstname: james /// studentsurname: smith /// studentfirstname: sally /// studentsurname: jones /// </pre> /// /// A SpanNearQuery with a slop of 0 can be applied across two {@link SpanTermQuery} objects as follows: /// /// <pre> /// SpanQueryPtr q1 = newLucene<SpanTermQuery>(newLucene<Term>(L"studentfirstname", L"james")); /// SpanQueryPtr q2 = newLucene<SpanTermQuery>(newLucene<Term>(L"studentsurname", L"jones")); /// SpanQueryPtr q2m = newLucene<FieldMaskingSpanQuery>(q2, L"studentfirstname"); /// /// Collection<SpanQueryPtr> span = newCollection<SpanQueryPtr>(q1, q1); /// /// QueryPtr q = newLucene<SpanNearQuery>(span, -1, false); /// </pre> /// to search for 'studentfirstname:james studentsurname:jones' and find teacherid 1 without matching /// teacherid 2 (which has a 'james' in position 0 and 'jones' in position 1). /// /// Note: as {@link #getField()} returns the masked field, scoring will be done using the norms of the /// field name supplied. This may lead to unexpected scoring behaviour. class LPPAPI FieldMaskingSpanQuery : public SpanQuery { public: FieldMaskingSpanQuery(const SpanQueryPtr& maskedQuery, const String& maskedField); virtual ~FieldMaskingSpanQuery(); LUCENE_CLASS(FieldMaskingSpanQuery); protected: SpanQueryPtr maskedQuery; String field; public: using SpanQuery::toString; virtual String getField(); SpanQueryPtr getMaskedQuery(); virtual SpansPtr getSpans(const IndexReaderPtr& reader); virtual void extractTerms(SetTerm terms); virtual WeightPtr createWeight(const SearcherPtr& searcher); virtual SimilarityPtr getSimilarity(const SearcherPtr& searcher); virtual QueryPtr rewrite(const IndexReaderPtr& reader); virtual String toString(const String& field); virtual bool equals(const LuceneObjectPtr& other); virtual int32_t hashCode(); /// Returns a clone of this query. virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr()); }; } #endif
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "MMObject.h" #import "PBMessageObserverDelegate.h" @interface JumpToBizWebviewLogicHelper : MMObject <PBMessageObserverDelegate> { id <JumpToBizWebviewLogicHelperDelegate> _delegate; } @property(nonatomic) __weak id <JumpToBizWebviewLogicHelperDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)MessageReturn:(id)arg1 Event:(unsigned int)arg2; - (void)handleJumpToBizWebviewResponse:(id)arg1; - (void)jumpToBizWebview:(id)arg1; - (void)dealloc; @end
#import <Foundation/Foundation.h> #import "JOYButton.h" #import "JOYAxis.h" #import "JOYAxes2D.h" #import "JOYAxes3D.h" #import "JOYHat.h" static NSString const *JOYAxes2DEmulateButtonsKey = @"JOYAxes2DEmulateButtons"; static NSString const *JOYHatsEmulateButtonsKey = @"JOYHatsEmulateButtons"; @class JOYController; @protocol JOYListener <NSObject> @optional -(void) controllerConnected:(JOYController *)controller; -(void) controllerDisconnected:(JOYController *)controller; -(void) controller:(JOYController *)controller buttonChangedState:(JOYButton *)button; -(void) controller:(JOYController *)controller movedAxis:(JOYAxis *)axis; -(void) controller:(JOYController *)controller movedAxes2D:(JOYAxes2D *)axes; -(void) controller:(JOYController *)controller movedAxes3D:(JOYAxes3D *)axes; -(void) controller:(JOYController *)controller movedHat:(JOYHat *)hat; @end @interface JOYController : NSObject + (void)startOnRunLoop:(NSRunLoop *)runloop withOptions: (NSDictionary *)options; + (NSArray<JOYController *> *) allControllers; + (void) registerListener:(id<JOYListener>)listener; + (void) unregisterListener:(id<JOYListener>)listener; - (NSString *)deviceName; - (NSString *)uniqueID; - (NSArray<JOYButton *> *) buttons; - (NSArray<JOYAxis *> *) axes; - (NSArray<JOYAxes2D *> *) axes2D; - (NSArray<JOYAxes3D *> *) axes3D; - (NSArray<JOYHat *> *) hats; - (void)setRumbleAmplitude:(double)amp; - (void)setPlayerLEDs:(uint8_t)mask; - (uint8_t)LEDMaskForPlayer:(unsigned)player; @property (readonly, getter=isConnected) bool connected; @end
#include <stdio.h> #include <math.h> #include <time.h> #include <string.h> #define ARRAY_SZ(_ax) (sizeof(_ax)/sizeof(_ax[0])) // NOTE! the array that `output` points to must be >= a_len+b_len-1 void convolution(const double* input_a, const int a_len, const double* input_b, const int b_len, double* output) { // Initialize the array #if !defined(USE_HAX) for(int i=0; i<a_len; i++) { for(int j=0; j<b_len; j++) { output[i+j] = 0.0; } } #else // Memset is kind of cheating, its probably all SSE'd up and such memset(output, 0x00, (a_len+b_len-1)*sizeof(double)); #endif // Do the math for(int i=0; i<a_len; i++) { for(int j=0; j<b_len; j++) { output[i+j] += (input_a[i] * input_b[j]); } } return; } int main() { double input_a[5000] = {0.0}; double input_b[5000] = {0.0}; double output[ARRAY_SZ(input_a)+ARRAY_SZ(input_b)-1]; clock_t start; clock_t diff; for(int i=0; i<5000; i++) { input_a[i] = sin((double)i / 8.0); input_b[i] = cos((double)i / 8.0); } printf("Start\n"); start = clock(); convolution(input_a, ARRAY_SZ(input_a), input_b, ARRAY_SZ(input_b), output); diff = clock() - start; printf("Done.\n"); int msec = diff * 1000 / CLOCKS_PER_SEC; printf("Time taken %d seconds %d milliseconds\n", msec/1000, msec%1000); }
#pragma once #include "SceneGraphNode.h" class CGeometricPrimitive : public CSceneGraphNodeDrawable { private: bool needToUpdateVBO; bool isUsedExternalGeomData; float* geomData; const float* constGeomData; int geomDataLength; private: void clearGeomData(); public: const bool isNeedToUpdateVBO()const; void isNeedToUpdateVBO(const bool need); virtual void update(const float dt); void updateManuallyVBO(); void setGeomDataPointer(const float* data, const int dataLength); void setGeomData(float* data, const int dataLength); CGeometricPrimitive(); virtual ~CGeometricPrimitive(); };
/**************************************************************************** Copyright (c) 2013-2015 Scutgame.com http://www.scutgame.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 FILEHELPER_H #define FILEHELPER_H #include <string> #include <vector> extern "C" { #include "lua.h" #include "lauxlib.h" #include "lauxlib.h" } std::string getPath(const char* szPath, bool bOnly2X = false); namespace ScutDataLogic { class CLuaString; class CFileHelper { public: static std::string getPath(const char* szPath, bool bOnly2X = false); //ÉèÖÃapp ÔÚANDROID SD¿¨ÉϵÄĿ¼ static void setAndroidSDCardDirPath(const char *szPath); static const char* getAndroidSDCardDirPath(); static void setAndroidResourcePath(const char* pszPath);//apk path static const char* getAndroidResourcePath(){return s_strAndroidPackagePath.c_str();} static void setAndroidRelativeDir(const char* pszPath); static const char* getAndroidRelativeDir(){return s_strRelativePath.c_str();} #ifdef SCUT_ANDROID static unsigned char* getFileDataFromZip(const char* pszZipFilePath, const char* pszFileName, unsigned long * pSize); #endif static unsigned char* getFileData(const char* pszFileName, const char* pszMode, unsigned long *pSize); static void freeFileData(unsigned char* pFileDataPtr); static bool executeScriptFile(const char * pszFile); //Ìí¼Ó²»Í¬·Ö±æÂʶÁÈ¡²»Í¬Ä¿Â¼ÏµÄ×ÊÔ´ //iphone --->resource //ANDROID --->480*320 resource ·ñÔò¶¼¶Áresource480_800 static std::string getResourceDir(const char* pszFileName); #ifdef SCUT_WIN32 static void setResourceFolderName(const char* pszResourceFolderName) { s_strConfigResource = pszResourceFolderName;} #endif static void setWinSize(int nWidth, int nHeight); static int getFileState(const char* pszFileName); static bool createDirs(const char* szDir); static bool isDirExists(const char* dir); static bool createDir(const char* dir); static bool isFileExists(const char* szFilePath); static std::string getWritablePath(const char* szFileName); static CLuaString encryptPwd(const char* pPwd, const char*key); static bool unZip(const char* szZipFile, const char* pszOutPutDir); static bool unZipToMemory(const char* szZipFile, unsigned char **out, unsigned int *outLengh); static int unZipMemory(unsigned char* in, unsigned int inLengh, unsigned char **out, unsigned int *outLength); static bool zipMemory(unsigned char* in, unsigned int inLengh, unsigned char **out, unsigned int *outLength); static bool unZipByFolder(const char* szZipFile, const char* szAssetsName, const char* szFolderName, const char* pszOutPutDir, const char* excludeExt = NULL); static void parseSubFoldersListFromZip(std::vector<std::string>& retVector, const char* szZipFile, const char* szAssetsName, const char* szRootFolderName); private: static int s_width; static int s_height; #ifdef SCUT_WIN32 static std::string s_strConfigResource; #endif static std::string s_strResource; static std::string s_strResource480_800; static std::string s_strResource1280_800; static std::string s_strAndroidSDPath; static std::string s_strAndroidPackagePath; static std::string s_strRelativePath; static std::string s_strIPhoneBundleID; }; #if defined(SCUT_IPHONE) || defined(SCUT_MAC) extern "C" { const std::string& getDocumentPath(); std::string getDocumentFilePathByFileName(const char* szFilePath); //»ñÈ¡App Ŀ¼ÏµÄ×ÊÔ´ const char* appFullPathFromRelativePath(const char* pszRelativePath); std::string getBundleID(); } #endif } #endif//FILEHELPER_H
#pragma once #include <torch/nn/module.h> #include <torch/types.h> #include <torch/utils.h> #include <ATen/core/TensorOptions.h> #include <c10/util/Exception.h> #include <memory> #include <utility> namespace torch { namespace nn { /// The `clone()` method in the base `Module` class does not have knowledge of /// the concrete runtime type of its subclasses. Therefore, `clone()` must /// either be called from within the subclass, or from a base class that has /// knowledge of the concrete type. `Cloneable` uses the CRTP to gain /// knowledge of the subclass' static type and provide an implementation of the /// `clone()` method. We do not want to use this pattern in the base class, /// because then storing a module would always require templatizing it. template <typename Derived> class Cloneable : public virtual Module { public: using Module::Module; /// `reset()` must perform initialization of all members with reference /// semantics, most importantly parameters, buffers and submodules. virtual void reset() = 0; /// Performs a recursive "deep copy" of the `Module`, such that all parameters /// and submodules in the cloned module are different from those in the /// original module. std::shared_ptr<Module> clone( optional<Device> device = nullopt) const override { NoGradGuard no_grad; const auto& self = static_cast<const Derived&>(*this); auto copy = std::make_shared<Derived>(self); copy->parameters_.clear(); copy->buffers_.clear(); copy->children_.clear(); copy->reset(); AT_CHECK( copy->parameters_.size() == parameters_.size(), "The cloned module does not have the same number of " "parameters as the original module after calling reset(). " "Are you sure you called register_parameter() inside reset() " "and not the constructor?"); for (const auto& parameter : parameters_) { auto data = autograd::Variable(*parameter).data().clone(); copy->parameters_[parameter.key()].set_data( device ? data.to(*device) : data); } AT_CHECK( copy->buffers_.size() == buffers_.size(), "The cloned module does not have the same number of " "buffers as the original module after calling reset(). " "Are you sure you called register_buffer() inside reset() " "and not the constructor?"); for (const auto& buffer : buffers_) { auto data = autograd::Variable(*buffer).data().clone(); copy->buffers_[buffer.key()].set_data(device ? data.to(*device) : data); } AT_CHECK( copy->children_.size() == children_.size(), "The cloned module does not have the same number of " "child modules as the original module after calling reset(). " "Are you sure you called register_module() inside reset() " "and not the constructor?"); for (const auto& child : children_) { copy->children_[child.key()]->clone_(*child.value(), device); } return copy; } private: void clone_(Module& other, optional<Device> device) final { // Here we are *pretty* certain that `other's` type is `Derived` (because it // was registered under the same name as `this`), but you never know what // crazy things `reset()` does, so `dynamic_cast` just to be safe. auto clone = std::dynamic_pointer_cast<Derived>(other.clone(device)); AT_CHECK( clone != nullptr, "Attempted to clone submodule, but it is of a " "different type than the submodule it was to be cloned into"); static_cast<Derived&>(*this) = std::move(*clone); } }; } // namespace nn } // namespace torch
/* *Abstract:Init the device of System * */ /* Includes */ #include <stm32f10x_rcc.h> #include <stm32f10x_gpio.h> #include <stm32f10x_usart.h> #include <misc.h> /* Declare all init func */ void Rcc_Config(void); void Gpio_Config(void); void Usart_Config(void); void Nvic_Config(void); /* Realization init interface func */ void Sys_Init(void) { SystemInit(); Rcc_Config(); Gpio_Config(); Usart_Config(); Nvic_Config(); } /* Realization Init function */ void Rcc_Config(void) { RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE); } static void Gpio_ModeSet(GPIO_TypeDef* GPIOx, uint16_t Gpio_Pin, GPIOSpeed_TypeDef Gpio_Speed, GPIOMode_TypeDef Gpio_Mode) { GPIO_InitTypeDef Gpio_InitStruct; Gpio_InitStruct.GPIO_Pin = Gpio_Pin; Gpio_InitStruct.GPIO_Speed = Gpio_Speed; Gpio_InitStruct.GPIO_Mode = Gpio_Mode; GPIO_Init(GPIOx,&Gpio_InitStruct); } void Gpio_Config(void) { /* Set Led Control I/O */ GPIO_DeInit(GPIOB); Gpio_ModeSet(GPIOB, GPIO_Pin_5, GPIO_Speed_50MHz, GPIO_Mode_Out_PP); /* Set Usart comunicate I/O */ GPIO_DeInit(GPIOA); Gpio_ModeSet(GPIOA, GPIO_Pin_2, GPIO_Speed_50MHz, GPIO_Mode_AF_PP); Gpio_ModeSet(GPIOA, GPIO_Pin_3, GPIO_Speed_50MHz, GPIO_Mode_IN_FLOATING); } void Nvic_Config(void) { NVIC_InitTypeDef NVIC_InitStruct; NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0); NVIC_InitStruct.NVIC_IRQChannel=USART2_IRQChannel; NVIC_InitStruct.NVIC_IRQChannelPreemptionPriority=0; NVIC_InitStruct.NVIC_IRQChannelSubPriority=0; NVIC_InitStruct.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStruct); } void Usart_Config(void) { USART_InitTypeDef Usart_InitStruct; USART_DeInit(USART2); Usart_InitStruct.USART_BaudRate=115200; Usart_InitStruct.USART_WordLength=USART_WordLength_8b; Usart_InitStruct.USART_StopBits=USART_StopBits_1; Usart_InitStruct.USART_Parity=USART_Parity_No; Usart_InitStruct.USART_Mode=USART_Mode_Rx|USART_Mode_Tx; Usart_InitStruct.USART_HardwareFlowControl=USART_HardwareFlowControl_None; USART_Init(USART2,&Usart_InitStruct); USART_ITConfig(USART2, USART_IT_RXNE,ENABLE); USART_Cmd(USART2,ENABLE); }
//metadoc Debugger copyright Steve Dekorte 2002 //metadoc Debugger license BSD revised #ifndef IoDebugger_DEFINED #define IoDebugger_DEFINED 1 #include "IoObject.h" #ifdef __cplusplus extern "C" { #endif IoObject *IoDebugger_proto(void *state); #ifdef __cplusplus } #endif #endif
#pragma once #include "PlayerStrategy.h" class State; class HeroStrategy : public PlayerStrategy { public: double GetShowdownValue(State* statePtr) const; };
#include "stdio.h" #include "stdlib.h" #include "stddef.h" #include "tree.h" node* n_empty(){ node* n = (node*) malloc(sizeof(node)); if (n == NULL){ printf("ERROR: No available memory for new list"); exit(-1); } return n; } tree* t_empty(){ tree* t = (tree*) malloc(sizeof(tree)); if (t == NULL){ printf("ERROR: No available memory for new tree"); exit(-1); } t->root = n_empty(); return t; } node* new_node(int element){ node* child = n_empty(); child->element = element; child->lc = NULL; child->rc = NULL; return child; } tree* t_prune(node* root){ if (root->rc == NULL && root->lc == NULL) //if it has no children, then it's a leave free(root); return NULL; //check every possible branch of the tree if (root->lc != NULL) return t_prune(root->lc); if (root->rc != NULL) return t_prune(root->rc); } int main(){ tree* t = t_empty(); node* r = t->root; r->lc = new_node(1); r->rc = new_node(2); t = t_prune(t->root); }
#define GLI_INCLUDE_ATI_TEXTURE_ENV_COMBINE3 enum Main { GL_MODULATE_ADD_ATI = 0x8744, GL_MODULATE_SIGNED_ADD_ATI = 0x8745, GL_MODULATE_SUBTRACT_ATI = 0x8746, };
// // RPBorderlessSegmentedControl.h // RPBorderlessSegmentedControlDemo // // Created by Brandon Evans on 2/10/2014. // Copyright (c) 2014 Robots and Pencils. All rights reserved. // @import Cocoa; @interface RPBorderlessSegmentedControl : NSSegmentedControl @end
/**************************************************************************//** * @file ustimer.h * @brief Microsecond delay function API definition. * @version 4.3.0 ****************************************************************************** * @section License * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b> ******************************************************************************* * * This file is licensed under the Silabs License Agreement. See the file * "Silabs_License_Agreement.txt" for details. Before using this software for * any purpose, you must agree to the terms of that agreement. * ******************************************************************************/ #ifndef __SILICON_LABS_USTIMER_H #define __SILICON_LABS_USTIMER_H #include <stdint.h> #include "ecode.h" #include "ustimer_config.h" #ifdef __cplusplus extern "C" { #endif /***************************************************************************//** * @addtogroup emdrv * @{ ******************************************************************************/ /***************************************************************************//** * @addtogroup USTIMER * @brief USTIMER Microsecond delay timer module * @{ ******************************************************************************/ #define ECODE_EMDRV_USTIMER_OK ( ECODE_OK ) ///< Success return value. Ecode_t USTIMER_Init( void ); Ecode_t USTIMER_DeInit( void ); Ecode_t USTIMER_Delay( uint32_t usec ); Ecode_t USTIMER_DelayIntSafe( uint32_t usec ); #ifdef __cplusplus } #endif /** @} (end group Ustimer) */ /** @} (end group Drivers) */ #endif
#pragma once #include <gamelib/Circle.h> namespace Physics { struct DynamicCircle { Circle128C cirlce; __m128 prevPosition; }; }
#pragma once #include <Framework/Any.h> /// declaration of the template that has to be specialized for each visitable/visitor pair template <typename VISITABLE, typename VISITOR> struct visit; template <typename T> struct has_visit_return_type { typedef char yes[1]; typedef char no[2]; template <typename C> static yes& test(typename C::visit_return_type*); template <typename> static no& test(...); static constexpr bool value = sizeof(test<T>(0)) == sizeof(yes); }; template <typename VISITOR, typename...VISITORS> struct IVisitable : IVisitable<VISITORS...> { template <typename VISITOR_T> std::enable_if_t<has_visit_return_type<VISITOR_T>::value,typename VISITOR_T::visit_return_type> accept(VISITOR_T& visitor) { return accept_untyped(visitor).template as<typename VISITOR_T::visit_return_type>(); } template <typename VISITOR_T> std::enable_if_t<!has_visit_return_type<VISITOR_T>::value,void> accept(VISITOR_T& visitor) { accept_untyped(visitor); } private: using IVisitable<VISITORS...>::accept; friend struct IVisitable; virtual Any accept_untyped(VISITOR&) = 0; }; template <typename VISITOR> struct IVisitable<VISITOR> { template <typename VISITOR_T> std::enable_if_t<has_visit_return_type<VISITOR_T>::value,typename VISITOR_T::visit_return_type> accept(VISITOR_T& visitor) { return accept_untyped(visitor).template as<typename VISITOR_T::visit_return_type>(); } template <typename VISITOR_T> std::enable_if_t<!has_visit_return_type<VISITOR_T>::value,void> accept(VISITOR_T& visitor) { accept_untyped(visitor); } private: friend struct IVisitable; virtual Any accept_untyped(VISITOR&) = 0; };
// // VKRSAppDelegate.h // AppSoundEngineDemo // // Created by Vilem Kurz on 3.11.2011. // Copyright (c) 2011 Cocoa Miners. All rights reserved. // #import <UIKit/UIKit.h> @class VKRSMainViewController; @interface VKRSAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) VKRSMainViewController *mainViewController; @end
#ifndef SHA512_H #define SHA512_H #include <string.h> #include "macro_defines.h" #include "net.h" void sha512(const char *input, size_t ilen, char* output, int is384); /*@ requires [?f]crypto_chars(?kind, input, ilen, ?cs_pay) &*& chars(output, ?olen, _) &*& is384 == 0 && olen == 64 || is384 == 1 && olen == 48; @*/ /*@ ensures [f]crypto_chars(kind, input, ilen, cs_pay) &*& cryptogram(output, olen, _, cg_hash(cs_pay)); @*/ void sha512_hmac(const char *key, size_t keylen, const char *input, size_t ilen, char *output, int is384); /*@ requires [?f1]cryptogram(key, keylen, ?cs_key, ?cg_key) &*& cg_key == cg_symmetric_key(?p, ?c) &*& [?f2]crypto_chars(?kind, input, ilen, ?cs_pay) &*& ilen >= MINIMAL_STRING_SIZE &*& chars(output, ?length, _) &*& is384 == 0 && length == 64 || is384 == 1 && length == 48; @*/ /*@ ensures [f1]cryptogram(key, keylen, cs_key, cg_key) &*& [f2]crypto_chars(kind, input, ilen, cs_pay) &*& cryptogram(output, length, _, cg_hmac(p, c, cs_pay)); @*/ #endif
// // DramaDetailViewController.h // d-addicts // // Created by Eigil Hansen on 11/04/13. // Copyright (c) 2013 Eigil Hansen. All rights reserved. // #import <UIKit/UIKit.h> @class Episode; @interface DramaDetailViewController : UIViewController @property (strong, nonatomic) NSArray *torrents; @property (nonatomic) NSInteger currentRow; @end
// // LLPushTableViewController.h // LLLottery // // Created by 李学林 on 16/2/1. // Copyright © 2016年 Upriver. All rights reserved. // #import <UIKit/UIKit.h> //@interface LLPushTableViewController : UITableViewController @interface LLPushTableViewController : LLBaseTableViewController @end
// // HBSNotesViewController.h // FetchedTableView // // Created by Anokhov Pavel on 29.02.16. // Copyright © 2016 IndependentLabs. All rights reserved. // #import "HBSRootFetchedTableViewController.h" @class HBSNotebook; @interface HBSNotesViewController : HBSRootFetchedTableViewController @property (nonatomic, strong, nonnull) HBSNotebook *notebook; - (IBAction)addButtonTouched:(nonnull id)sender; @end
// // ViewController.h // UAEOffroaders // // Created by Imthiaz Rafiq on 4/21/16. // Copyright © 2016 Imthiaz Rafiq. All rights reserved. // #import <UIKit/UIKit.h> @import CoreLocation; @import Mapbox; @import CoreLocation; @interface ViewController : UIViewController <CLLocationManagerDelegate,MGLMapViewDelegate> @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 "NSString.h" @interface NSString (WebNSURLExtras) - (id)_webkit_queryKeysAndValues; - (id)_webkit_unescapedQueryValue; - (id)_webkit_URLFragment; - (_Bool)_webkit_looksLikeAbsoluteURL; - (struct _NSRange)_webkit_rangeOfURLScheme; - (id)_web_encodeHostName; - (id)_web_decodeHostName; - (id)_web_encodeHostNameWithRange:(struct _NSRange)arg1; - (id)_web_decodeHostNameWithRange:(struct _NSRange)arg1; - (_Bool)_web_hostNameNeedsEncodingWithRange:(struct _NSRange)arg1; - (_Bool)_web_hostNameNeedsDecodingWithRange:(struct _NSRange)arg1; - (_Bool)_webkit_isFTPDirectoryURL; - (id)_webkit_scriptIfJavaScriptURL; - (id)_webkit_stringByReplacingValidPercentEscapes; - (_Bool)_webkit_isFileURL; - (_Bool)_webkit_isJavaScriptURL; - (_Bool)_web_isUserVisibleURL; @end
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double SwiftSparklineVersionNumber; FOUNDATION_EXPORT const unsigned char SwiftSparklineVersionString[];
#pragma once #include <IO/FileSystem.h> #include "NpkTOC.h" // Original Nebula 2 NPK virtual file system. namespace IO { class CFileSystemNPK: public IFileSystem { protected: struct CNPKFile { CNpkTOCEntry* pTOCEntry; UPTR Offset; }; struct CNPKDir { CNpkTOCEntry* pTOCEntry; CNpkTOCEntry::CIterator It; CString Filter; CNPKDir(CNpkTOCEntry* pEntry): pTOCEntry(pEntry), It(pTOCEntry->GetEntryIterator()) {} bool IsValid() const { return pTOCEntry && It != pTOCEntry->End(); } operator bool() const { return IsValid(); } }; CNpkTOC TOC; PStream NPKStream; //!!!can use MMF and create views when big files are read! public: CFileSystemNPK(IStream* pSource); virtual ~CFileSystemNPK(); virtual bool Init() override; virtual bool IsCaseSensitive() const override { FAIL; } virtual bool IsReadOnly() const { OK; } virtual bool ProvidesFileCursor() const { OK; } virtual bool FileExists(const char* pPath); virtual bool IsFileReadOnly(const char* pPath); virtual bool SetFileReadOnly(const char* pPath, bool ReadOnly) { OK; /*Already read-only*/ } virtual bool DeleteFile(const char* pPath); virtual bool CopyFile(const char* pSrcPath, const char* pDestPath); virtual bool DirectoryExists(const char* pPath); virtual bool CreateDirectory(const char* pPath); virtual bool DeleteDirectory(const char* pPath); virtual void* OpenDirectory(const char* pPath, const char* pFilter, CString& OutName, EFSEntryType& OutType); virtual void CloseDirectory(void* hDir); virtual bool NextDirectoryEntry(void* hDir, CString& OutName, EFSEntryType& OutType); virtual void* OpenFile(const char* pPath, EStreamAccessMode Mode, EStreamAccessPattern Pattern = SAP_DEFAULT); virtual void CloseFile(void* hFile); virtual UPTR Read(void* hFile, void* pData, UPTR Size); virtual UPTR Write(void* hFile, const void* pData, UPTR Size); virtual U64 GetFileSize(void* hFile) const; virtual U64 GetFileWriteTime(void* hFile) const { return 0; } virtual bool Seek(void* hFile, I64 Offset, ESeekOrigin Origin); virtual U64 Tell(void* hFile) const; virtual bool Truncate(void* hFile) override; virtual void Flush(void* hFile); virtual bool IsEOF(void* hFile) const; }; }
#ifndef SOCKET_H #define SOCKET_H #include "types.h" #define SOCK_STREAM 1 /* stream socket */ #define SOCK_DGRAM 2 /* datagram socket */ #define SOCK_RAW 3 /* raw-protocol interface */ #define SOCK_RDM 4 /* reliably-delivered message */ #define SOCK_SEQPACKET 5 /* sequenced packet stream */ /* * Option flags per-socket. */ #define SO_DEBUG 0x0001 /* turn on debugging info recording */ #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ #define SO_REUSEADDR 0x0004 /* allow local address reuse */ #define SO_KEEPALIVE 0x0008 /* keep connections alive */ #define SO_DONTROUTE 0x0010 /* just use interface addresses */ #define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ #if __BSD_VISIBLE #define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ #endif #define SO_LINGER 0x0080 /* linger on close if data present */ #define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ #if __BSD_VISIBLE #define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ #define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ #define SO_NOSIGPIPE 0x0800 /* no SIGPIPE from EPIPE */ #define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ #define SO_BINTIME 0x2000 /* timestamp received dgram traffic */ #endif #define SO_NO_OFFLOAD 0x4000 /* socket cannot be offloaded */ #define SO_NO_DDP 0x8000 /* disable direct data placement */ /* * Additional options, not kept in so_options. */ #define SO_SNDBUF 0x1001 /* send buffer size */ #define SO_RCVBUF 0x1002 /* receive buffer size */ #define SO_SNDLOWAT 0x1003 /* send low-water mark */ #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ #define SO_SNDTIMEO 0x1005 /* send timeout */ #define SO_RCVTIMEO 0x1006 /* receive timeout */ #define SO_ERROR 0x1007 /* get error status and clear */ #define SO_TYPE 0x1008 /* get socket type */ #define SO_LABEL 0x1009 /* socket's MAC label */ #define SO_PEERLABEL 0x1010 /* socket's peer's MAC label */ #define SO_LISTENQLIMIT 0x1011 /* socket's backlog limit */ #define SO_LISTENQLEN 0x1012 /* socket's complete queue length */ #define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ #define SO_SETFIB 0x1014 /* use this FIB to route */ #define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ #define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ #define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ /* * Address families. */ #define AF_UNSPEC 0 /* unspecified */ #define AF_LOCAL AF_UNIX /* local to host (pipes, portals) */ #define AF_UNIX 1 /* standardized name for AF_LOCAL */ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #define AF_IMPLINK 3 /* arpanet imp addresses */ #define AF_PUP 4 /* pup protocols: e.g. BSP */ #define AF_CHAOS 5 /* mit CHAOS protocols */ #define AF_NETBIOS 6 /* SMB protocols */ #define AF_ISO 7 /* ISO protocols */ #define AF_OSI AF_ISO #define AF_ECMA 8 /* European computer manufacturers */ #define AF_DATAKIT 9 /* datakit protocols */ #define AF_CCITT 10 /* CCITT protocols, X.25 etc */ #define AF_SNA 11 /* IBM SNA */ #define AF_DECnet 12 /* DECnet */ #define AF_DLI 13 /* DEC Direct data link interface */ #define AF_LAT 14 /* LAT */ #define AF_HYLINK 15 /* NSC Hyperchannel */ #define AF_APPLETALK 16 /* Apple Talk */ #define AF_ROUTE 17 /* Internal Routing Protocol */ #define AF_LINK 18 /* Link layer interface */ #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ #define AF_COIP 20 /* connection-oriented IP, aka ST II */ #define AF_CNT 21 /* Computer Network Technology */ #define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ #define AF_IPX 23 /* Novell Internet Protocol */ #define AF_SIP 24 /* Simple Internet Protocol */ #define pseudo_AF_PIP 25 /* Help Identify PIP packets */ #define AF_ISDN 26 /* Integrated Services Digital Network*/ #define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ #define pseudo_AF_KEY 27 /* Internal key-management function */ #define AF_INET6 28 /* IPv6 */ #define AF_NATM 29 /* native ATM access */ #define AF_ATM 30 /* ATM */ #define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers * in interface output routine */ #define AF_NETGRAPH 32 /* Netgraph sockets */ #define AF_SLOW 33 /* 802.3ad slow protocol */ #define AF_SCLUSTER 34 /* Sitara cluster protocol */ #define AF_ARP 35 #define AF_BLUETOOTH 36 /* Bluetooth sockets */ #define AF_IEEE80211 37 /* IEEE 802.11 protocol */ #define AF_INET_SDP 40 /* OFED Socket Direct Protocol ipv4 */ #define AF_INET6_SDP 42 /* OFED Socket Direct Protocol ipv6 */ #define AF_MAX 42 struct sockaddr { u_char sa_len; u_char sa_family; char sa_data[14]; }; struct osockaddr { u_short sa_family; char sa_data[14]; }; #endif // SOCKET_H
#ifndef __BSP_ILI9341_LCD_H #define __BSP_ILI9341_LCD_H #include "stm32f10x.h" /*************************************************************************************** 2^26 =0X0400 0000 = 64MB,ÿ¸ö BANK ÓÐ4*64MB = 256MB 64MB:FSMC_Bank1_NORSRAM1:0X6000 0000 ~ 0X63FF FFFF 64MB:FSMC_Bank1_NORSRAM2:0X6400 0000 ~ 0X67FF FFFF 64MB:FSMC_Bank1_NORSRAM3:0X6800 0000 ~ 0X6BFF FFFF 64MB:FSMC_Bank1_NORSRAM4:0X6C00 0000 ~ 0X6FFF FFFF Ñ¡ÔñBANK1-BORSRAM4 Á¬½Ó TFT£¬µØÖ··¶Î§Îª0X6C00 0000 ~ 0X6FFF FFFF FSMC_A23 ½ÓLCDµÄDC(¼Ä´æÆ÷/Êý¾ÝÑ¡Ôñ)½Å ¼Ä´æÆ÷»ùµØÖ· = 0X6C00 0000 RAM»ùµØÖ· = 0X6D00 0000 = 0X6C00 0000+2^23*2 = 0X6C00 0000 + 0X100 0000 = 0X6D00 0000 µ±Ñ¡Ôñ²»Í¬µÄµØÖ·Ïßʱ£¬µØÖ·ÒªÖØÐ¼ÆËã ****************************************************************************************/ #define Bank1_LCD_C ((u32)0x60000000) //Disp Reg ADDR #define Bank1_LCD_D ((u32)0x60020000) //Disp Data ADDR // A16 PD11 /*Ñ¡¶¨LCDÖ¸¶¨¼Ä´æÆ÷*/ #define LCD_WR_REG(index) ((*(__IO u16 *) (Bank1_LCD_C)) = ((u16)index)) /*ÍùLCD GRAMдÈëÊý¾Ý*/ #define LCD_WR_Data(val) ((*(__IO u16 *) (Bank1_LCD_D)) = ((u16)(val))) #define LCD_ILI9341_CMD(index) LCD_WR_REG(index) #define LCD_ILI9341_Parameter(val) LCD_WR_Data(val) #define COLUMN 240 #define PAGE 320 // SRT ÊÇstringµÄËõд #define STR_WIDTH 6 /* ×Ö·û¿í¶È */ #define STR_HEIGHT 16 /* ×Ö·û¸ß¶È */ // CH ÊÇchineseµÄËõд #define CH_WIDTH 16 /* ºº×Ö¿í¶È */ #define CH_HEIGHT 16 /* ºº×Ö¸ß¶È */ #ifdef WORD_MODE #define BACKGROUND D_YELLOW #else #define BACKGROUND WHITE #endif #define D_YELLOW 0xF761 //²¥·ÅÆ÷±³¾°ÑÕÉ« #define WHITE 0xFFFF /* °×É« */ #define BLACK 0x0000 /* ºÚÉ« */ #define GREY 0xF7DE /* »ÒÉ« */ #define BLUE 0x001F /* À¶É« */ #define BLUE2 0x051F /* dzÀ¶É« */ #define RED 0xF800 /* ºìÉ« */ #define MAGENTA 0xF81F /* ºì×ÏÉ«£¬ÑóºìÉ« */ #define GREEN 0x07E0 /* ÂÌÉ« */ #define CYAN 0x7FFF /* À¶ÂÌÉ«£¬ÇàÉ« */ #define YELLOW 0xFFE0 /* »ÆÉ« */ #define BRED 0XF81F #define GRED 0XFFE0 #define GBLUE 0X07FF void LCD_Init(void); void Lcd_GramScan( uint16_t option ); void LCD_Clear(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color); void LCD_SetCursor(uint16_t x, uint16_t y); void LCD_OpenWindow(uint16_t x, uint16_t y, uint16_t width, uint16_t height); void LCD_SetPoint(uint16_t x , uint16_t y , uint16_t color); uint16_t LCD_GetPoint(uint16_t x , uint16_t y); void LCD_DispChar(uint16_t x, uint16_t y, uint8_t ascii, uint16_t color); void LCD_DispStr(uint16_t x, uint16_t y, uint8_t *pstr, uint16_t color); void LCD_DisNum(uint16_t x, uint16_t y, uint32_t num, uint16_t color); void LCD_DispCH(uint16_t x, uint16_t y, const uint8_t *str, uint16_t color); void LCD_DispStrCH(uint16_t x, uint16_t y, const uint8_t *pstr, uint16_t color); void LCD_DispEnCh(uint16_t x, uint16_t y, const uint8_t *pstr, uint16_t color); #endif /* __BSP_ILI9341_LCD_H */
// // PXSmallView.h // PXMultiForwarder // // Created by Spencer Phippen on 2015/09/09. // Copyright (c) 2015年 Spencer Phippen. All rights reserved. // #import <UIKit/UIKit.h> @interface PXSmallView : UIView @property UIButton* button; - (void) makeRandomColor; @end
#ifndef V1OOPC_VICTIM_H #define V1OOPC_VICTIM_H #include "rectangle.hpp" #include "iostream" class victim : public rectangle { private: vector start; vector end; public: bool touched; victim(window &w, const vector &start, const vector &end); void update() override; void interact(drawable &other) override; }; #endif //V1OOPC_VICTIM_H
// // UITextField+MoneyInput.h // ejlShop // // Created by xyy on 2017/5/11. // Copyright © 2017年 e键联. All rights reserved. // #import <UIKit/UIKit.h> @interface UITextField (MoneyInput) //是否只能属于金额默认为NO @property (nonatomic, assign) IBInspectable BOOL isMoney; @end
// ----------------------------------------------------------------------- // // // FILENAME: SSLogDestinationFile.h // AUTHOR: Steve Schaneville // CREATED: 15 Feb 2003, 18:25 // // PURPOSE: // // Copyright (c) 2003 // // ----------------------------------------------------------------------- // #ifndef __SSLogDestinationFile_h__ #define __SSLogDestinationFile_h__ // ------------------[ Pre-Include Defines ]------------------ // // ------------------[ Include Files ]------------------ // #include "SSLogDestination.h" // ------------------[ Macros/Defines ]------------------ // // ------------------[ Constants/Enumerations ]------------------ // // ------------------[ Forward Declarations ]------------------ // // ------------------[ Global Variables ]------------------ // // ------------------[ Global Functions ]------------------ // // ------------------[ Classes ]------------------ // // ----------------------------------------------------------------------- // // Class: SSLogDestinationFile // Author: Steve Schaneville // Notes: // ----------------------------------------------------------------------- // class SSLogDestinationFile : public SSLogDestination { public: // construction, destruction SSLogDestinationFile (); virtual ~SSLogDestinationFile (); // assignment, copy SSLogDestinationFile (SSLogDestinationFile& rhs); SSLogDestinationFile& operator = (SSLogDestinationFile& rhs); protected: // initialization virtual VOID InitObject (); public: // accessor functions LPTSTR Filename (); VOID Filename (LPCTSTR szFilename); // utilities VOID LimitFileSize (const DWORD dwMaxFileSize); // overrides virtual BOOL OnWriteMessage (LOGMESSAGE* pMsg); virtual BOOL OnEraseLog (LOGMESSAGE* pMsg); virtual BOOL OnLimitOutputSize (LOGMESSAGE* pMsg); virtual BOOL OnSetDestinationName (LOGMESSAGE* pMsg); virtual BOOL OnShutDownServer (LOGMESSAGE* pMsg); virtual BOOL OnFinishUpdate (); protected: // accessor functions const HANDLE FileHandle () const; VOID FileHandle (const HANDLE hFile); const DWORD MaxFileSizeKb () const; VOID MaxFileSizeKb (DWORD dwMaxFileSizeKb); // utilities VOID WriteToFile (LOGMESSAGE* pMsg); private: HANDLE m_hFile; DWORD m_dwMaxFileSizeKb; // don't let files grow beyond this level (in Kilobytes) TCHAR m_szFilename[MAX_PATH]; // the filename to write to }; // ----------------------------------------------------------------------- // // SSLogDestinationFile Inline Functions // ----------------------------------------------------------------------- // // return the handle to the log file inline const HANDLE SSLogDestinationFile::FileHandle() const { return m_hFile; } // set the handle to the log file inline VOID SSLogDestinationFile::FileHandle(const HANDLE hFile) { if( hFile == NULL && FileHandle() != NULL ) CloseHandle(FileHandle()); m_hFile = hFile; } inline const DWORD SSLogDestinationFile::MaxFileSizeKb() const { return m_dwMaxFileSizeKb; } inline VOID SSLogDestinationFile::MaxFileSizeKb(const DWORD dwMaxFileSizeKb) { m_dwMaxFileSizeKb = dwMaxFileSizeKb; } // return the log window's name inline LPTSTR SSLogDestinationFile::Filename() { return m_szFilename; } #endif // __SSLogDestinationFile_h__
// // XQByrUserTable.h // ASByrApp // // Created by lixiangqian on 17/2/25. // Copyright © 2017年 andy. All rights reserved. // #import <Foundation/Foundation.h> #import "XQTableBaseExecutor.h" @interface XQByrUserTable : XQTableBaseExecutor extern NSString *XQByrDatabaseName; @end
#pragma once #include <GLFW/glfw3.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <ship.h> enum enemy_pattern { enemy_static, enemy_ver, enemy_hor, enemy_circ, enemy_sines, enemy_intense }; enum enemy_type { enemy_collider, enemy_shooter, enemy_fshooter, enemy_laser, }; typedef struct enemy_bullet { float x, y, vx, vy; bool active; } enemy_bullet_t; typedef struct enemy { // x, y, size, time, width, phase float x, y, s, t, w, p; float rx, ry; int pattern; int enemy; bool alive; enemy_bullet_t bullets[SHIP_BULLETS]; float timer; } enemy_t; #define MAX_ENEMIES 64 enum { powerup_health, powerup_mode, powerup_superhealth }; typedef struct powerup { float x, y, vx, vy; int type; float t; bool active; } powerup_t; typedef struct explosion { float x, y, s, t; bool active; } explosion_t; #define WORLD_STARS 128 typedef struct star { float x, y, l; float r, g, b; } star_t; #define MAX_POWERUPS 32 typedef struct world { int score; int level; enemy_t enemies[MAX_ENEMIES]; explosion_t explosions[MAX_ENEMIES/4]; star_t stars[WORLD_STARS]; powerup_t powerups[MAX_POWERUPS]; float hurtTimer; int restartTimer; float restartSTimer; int health; } world_t; enemy_t enemy_init(float x, float y, float s, float p, int pattern, int enemy); void enemy_path(enemy_t* enemy); int enemy_update(enemy_t* enemy, float dt, ship_t* player, world_t* world); void enemy_draw(enemy_t* enemy); world_t* world_init(); void world_update(world_t* world, float dt, ship_t* player); void world_spawn(world_t* world); void world_add_enemy(world_t* world, float x, float y, float s, float p, int pattern, int enemy); void world_add_powerup(world_t* world, float x, float y, float vx, float vy, int type); void powerup_update(powerup_t* power, float dt, ship_t* player, world_t* world); void world_draw(world_t* world); void powerup_draw(powerup_t* power);
/* * zsummerX License * ----------- * * zsummerX is licensed under the terms of the MIT license reproduced below. * This means that zsummerX is free software and can be used for both academic * and commercial purposes at absolutely no cost. * * * =============================================================================== * * Copyright (C) 2013 YaweiZhang <yawei_zhang@foxmail.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. * * =============================================================================== * * (end of COPYRIGHT) */ #pragma once #ifndef _ZSUMMERX_COMMON_IMPL_H_ #define _ZSUMMERX_COMMON_IMPL_H_ #include "../common/common.h" namespace zsummer { namespace network { const int InvalideFD = -1; struct tagReqHandle { OVERLAPPED _overlapped; unsigned char _type; enum HANDLE_TYPE { HANDLE_ACCEPT, HANDLE_RECV, HANDLE_SEND, HANDLE_CONNECT, HANDLE_RECVFROM, HANDLE_SENDTO, }; }; template <class T> T & operator <<(T &t, const tagReqHandle & h) { t << (unsigned int)h._type; return t; } //! 完成键 enum POST_COM_KEY { PCK_USER_DATA, }; #define HandlerFromOverlaped(ptr) ((tagReqHandle*)((char*)ptr - (char*)&((tagReqHandle*)NULL)->_overlapped)) } } #endif
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "WXPBGeneratedMessage.h" @class NSString; @interface GameCenterSearchWebResultItem : WXPBGeneratedMessage { } + (void)initialize; // Remaining properties @property(retain, nonatomic) NSString *appId; // @dynamic appId; @property(retain, nonatomic) NSString *appName; // @dynamic appName; @property(nonatomic) unsigned int articleId; // @dynamic articleId; @property(nonatomic) unsigned int articleType; // @dynamic articleType; @property(nonatomic) unsigned int createTime; // @dynamic createTime; @property(retain, nonatomic) NSString *desc; // @dynamic desc; @property(retain, nonatomic) NSString *targetUrl; // @dynamic targetUrl; @property(retain, nonatomic) NSString *thumbUrl; // @dynamic thumbUrl; @property(retain, nonatomic) NSString *title; // @dynamic title; @end
#pragma once #include "track_description.h" namespace AIMPPlayer { class IPlaylistQueueManager { public: virtual void reloadQueuedEntries() = 0; // throws std::runtime_error /*! Track should be already queued. */ virtual void moveQueueEntry(TrackDescription track_desc, int new_queue_index) = 0; // throws std::runtime_error virtual void moveQueueEntry(int old_queue_index, int new_queue_index) = 0; // throws std::runtime_error protected: ~IPlaylistQueueManager() {}; }; }
/* ----------------------------------------------------------------------------------------------- Copyright (C) 2013 Henry van Merode. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------------------------- */ #ifndef __PU_ONRANDOM_OBSERVER_FACTORY_H__ #define __PU_ONRANDOM_OBSERVER_FACTORY_H__ #include "ParticleUniversePrerequisites.h" #include "ParticleUniverseObserverFactory.h" #include "ParticleUniverseOnRandomObserverTokens.h" #include "ParticleUniverseOnRandomObserver.h" namespace ParticleUniverse { /** Factory class responsible for creating the OnRandomObserver. */ class _ParticleUniverseExport OnRandomObserverFactory : public ParticleObserverFactory { public: OnRandomObserverFactory(void) {}; virtual ~OnRandomObserverFactory(void) {}; /** See ParticleObserverFactory */ virtual String getObserverType(void) const { return "OnRandom"; } /** See ParticleObserverFactory */ virtual ParticleObserver* createObserver(void) { return _createObserver<OnRandomObserver>(); } /** See ScriptReader */ virtual bool translateChildProperty(ScriptCompiler* compiler, const AbstractNodePtr &node) { return mOnRandomObserverTranslator.translateChildProperty(compiler, node); }; /** See ScriptReader */ virtual bool translateChildObject(ScriptCompiler* compiler, const AbstractNodePtr &node) { return mOnRandomObserverTranslator.translateChildObject(compiler, node); }; /* */ virtual void write(ParticleScriptSerializer* serializer, const IElement* element) { // Delegate mOnRandomObserverWriter.write(serializer, element); } protected: OnRandomObserverWriter mOnRandomObserverWriter; OnRandomObserverTranslator mOnRandomObserverTranslator; }; } #endif
/** * @file AOIntegrator.h * @author Sebastian Maisch <sebastian.maisch@googlemail.com> * @date 2021.21.05 * * @brief Class for the ambient occlusion integrator. */ #pragma once #include "gfx/RTIntegrator.h" namespace vkfw_app::gfx::rt { class AOIntegrator : public RTIntegrator { public: AOIntegrator(vkfw_core::gfx::LogicalDevice* device); ~AOIntegrator() override; void TraceRays(vkfw_core::gfx::CommandBuffer& cmdBuffer, std::size_t cmdBufferIndex, const glm::u32vec4& rtGroups) override; private: std::vector<vkfw_core::gfx::RayTracingPipeline::RTShaderInfo> GetShaders() const override; }; }
// // SPMovieClip.h // Sparrow // // Created by Daniel Sperl on 01.05.10. // Copyright 2011-2014 Gamua. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the Simplified BSD License. // #import <Foundation/Foundation.h> #import <Sparrow/SPAnimatable.h> #import <Sparrow/SPImage.h> @class SPSoundChannel; /** ------------------------------------------------------------------------------------------------ An SPMovieClip is a simple way to display an animation depicted by a list of textures. You can add the frames one by one or pass them all at once (in an array) at initialization time. The movie clip will have the width and height of the first frame. At initialization, you can specify the desired framerate. You can, however, manually give each frame a custom duration. You can also play a sound whenever a certain frame appears. The methods `play` and `pause` control playback of the movie. You will receive an event of type `SPEventTypeCompleted` when the movie finished playback. When the movie is looping, the event is dispatched once per loop. As any animated object, a movie clip has to be added to a juggler (or have its `advanceTime:` method called regularly) to run. ------------------------------------------------------------------------------------------------- */ @interface SPMovieClip : SPImage <SPAnimatable> /// -------------------- /// @name Initialization /// -------------------- /// Initializes a movie with the first frame and the default number of frames per second. _Designated initializer_. - (instancetype)initWithFrame:(SPTexture *)texture fps:(float)fps; /// Initializes a movie with an array of textures and the default number of frames per second. - (instancetype)initWithFrames:(NSArray *)textures fps:(float)fps; /// Factory method. + (instancetype)movieWithFrame:(SPTexture *)texture fps:(float)fps; /// Factory method. + (instancetype)movieWithFrames:(NSArray *)textures fps:(float)fps; /// -------------------------------- /// @name Frame Manipulation Methods /// -------------------------------- /// Adds a frame with a certain texture, using the default duration. - (void)addFrameWithTexture:(SPTexture *)texture; /// Adds a frame with a certain texture and duration. - (void)addFrameWithTexture:(SPTexture *)texture duration:(double)duration; /// Adds a frame with a certain texture, duration and sound. - (void)addFrameWithTexture:(SPTexture *)texture duration:(double)duration sound:(SPSoundChannel *)sound; /// Inserts a frame at the specified index. The successors will move down. - (void)addFrameWithTexture:(SPTexture *)texture atIndex:(int)frameID; /// Adds a frame with a certain texture and duration. - (void)addFrameWithTexture:(SPTexture *)texture duration:(double)duration atIndex:(int)frameID; /// Adds a frame with a certain texture, duration and sound. - (void)addFrameWithTexture:(SPTexture *)texture duration:(double)duration sound:(SPSoundChannel *)sound atIndex:(int)frameID; /// Removes the frame at the specified index. The successors will move up. - (void)removeFrameAtIndex:(int)frameID; /// Sets the texture of a certain frame. - (void)setTexture:(SPTexture *)texture atIndex:(int)frameID; /// Sets the sound that will be played back when a certain frame is active. - (void)setSound:(SPSoundChannel *)sound atIndex:(int)frameID; /// Sets the duration of a certain frame in seconds. - (void)setDuration:(double)duration atIndex:(int)frameID; /// Returns the texture of a frame at a certain index. - (SPTexture *)textureAtIndex:(int)frameID; /// Returns the sound of a frame at a certain index. - (SPSoundChannel *)soundAtIndex:(int)frameID; /// Returns the duration (in seconds) of a frame at a certain index. - (double)durationAtIndex:(int)frameID; /// ---------------------- /// @name Playback Methods /// ---------------------- /// Start playback. Beware that the clip has to be added to a juggler, too! - (void)play; /// Pause playback. - (void)pause; /// Stop playback. Resets currentFrame to beginning. - (void)stop; /// ---------------- /// @name Properties /// ---------------- /// The number of frames of the clip. @property (nonatomic, readonly) int numFrames; /// The total duration of the clip in seconds. @property (nonatomic, readonly) double totalTime; /// The time that has passed since the clip was started (each loop starts at zero). @property (nonatomic, readonly) double currentTime; /// Indicates if the movie is currently playing. Returns `NO` when the end has been reached. @property (nonatomic, readonly) BOOL isPlaying; /// Indicates if a (non-looping) movie has come to its end. @property (nonatomic, readonly) BOOL isComplete; /// Indicates if the movie is looping. @property (nonatomic, assign) BOOL loop; /// The ID of the frame that is currently displayed. @property (nonatomic, assign) int currentFrame; /// The default frames per second. Used when you add a frame without specifying a duration. @property (nonatomic, assign) float fps; @end
// // ThreadViewController.h // Network // // Created by 朱双泉 on 2018/9/26. // Copyright © 2018 Castie!. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface ThreadViewController : UITableViewController @end NS_ASSUME_NONNULL_END
#pragma once #include "Archs/MIPS/MipsOpcodes.h" #include "Commands/CAssemblerCommand.h" #include "Core/Expression.h" #include "Core/Types.h" enum class MipsRegisterType { Normal, Float, FpuControl, Cop0, Ps2Cop2, PsxCop2Data, PsxCop2Control, VfpuVector, VfpuMatrix, RspCop0, RspVector, RspVectorControl, RspVectorElement, RspScalarElement, RspOffsetElement }; enum class MipsImmediateType { None, Immediate5, Immediate10, Immediate16, Immediate20, Immediate25, Immediate26, Immediate20_0, ImmediateHalfFloat, Immediate7, CacheOp, Ext, Ins, Cop2BranchType }; struct MipsRegisterValue { MipsRegisterType type; Identifier name{}; int num; }; struct MipsRegisterData { MipsRegisterValue grs; // general source reg MipsRegisterValue grt; // general target reg MipsRegisterValue grd; // general dest reg MipsRegisterValue frs; // float source reg MipsRegisterValue frt; // float target reg MipsRegisterValue frd; // float dest reg MipsRegisterValue ps2vrs; // ps2 vector source reg MipsRegisterValue ps2vrt; // ps2 vector target reg MipsRegisterValue ps2vrd; // ps2 vector dest reg MipsRegisterValue rspvrs; // rsp vector source reg MipsRegisterValue rspvrt; // rsp vector target reg MipsRegisterValue rspvrd; // rsp vector dest reg MipsRegisterValue rspve; // rsp vector element reg MipsRegisterValue rspvde; // rsp vector dest element reg MipsRegisterValue rspvealt; // rsp vector element reg (alt. placement) MipsRegisterValue vrs; // vfpu source reg MipsRegisterValue vrt; // vfpu target reg MipsRegisterValue vrd; // vfpu dest reg void reset() { grs.num = grt.num = grd.num = -1; frs.num = frt.num = frd.num = -1; vrs.num = vrt.num = vrd.num = -1; ps2vrs.num = ps2vrt.num = ps2vrd.num = -1; rspvrs.num = rspvrt.num = rspvrd.num = -1; rspve.num = rspvde.num = rspvealt.num = -1; } }; struct MipsImmediateData { struct { MipsImmediateType type; Expression expression; int value; int originalValue; } primary; struct { MipsImmediateType type; Expression expression; int value; int originalValue; } secondary; void reset() { primary.type = MipsImmediateType::None; if (primary.expression.isLoaded()) primary.expression = Expression(); secondary.type = MipsImmediateType::None; if (secondary.expression.isLoaded()) secondary.expression = Expression(); } }; struct MipsOpcodeData { tMipsOpcode opcode; int vfpuSize; int vectorCondition; void reset() { vfpuSize = vectorCondition = -1; } }; class CMipsInstruction: public CAssemblerCommand { public: CMipsInstruction(MipsOpcodeData& opcode, MipsImmediateData& immediate, MipsRegisterData& registers); ~CMipsInstruction(); bool Validate(const ValidateState &state) override; void Encode() const override; void writeTempData(TempData& tempData) const override; private: void encodeNormal() const; void encodeVfpu() const; int floatToHalfFloat(int i); bool IgnoreLoadDelay; int64_t RamPos; bool addNop; // opcode variables MipsOpcodeData opcodeData; MipsImmediateData immediateData; MipsRegisterData registerData; };
/********************************************************************** * $Id$ main.c *//** * @file main.c * @brief Write a program to create virtual keyboard on GLCD * and display input taken from it. * @version 1.0 * @date 09. Dec. 2013 * @author Dwijay.Edutech Learning Solutions *********************************************************************** * Software that is described herein is for illustrative purposes only * which provides customers with programming information regarding the * products. This software is supplied "AS IS" without any warranties. * NXP Semiconductors assumes no responsibility or liability for the * use of the software, conveys no license or title under any patent, * copyright, or mask work right to the product. NXP Semiconductors * reserves the right to make changes in the software without * notification. NXP Semiconductors also make no representation or * warranty that such application will be suitable for the specified * use without further testing or modification. **********************************************************************/ #include "lpc_system_init.h" /* Example group ----------------------------------------------------------- */ /** @defgroup TGLCD * @ingroup TGLCD_Examples * @{ */ /*-------------------------MAIN Page------------------------------*/ /** @mainpage TGLCD Test Example * @par Description: * - Store input from virtual keypad and display it to UART0. * * @par Activity - more information: * - Connect TGLCD to EPB1768 and as you type on touch keypad it will * be displayed on GLCD and as you press return key it will display * typed buffer on UART0 Terminal. */ /*-------------------------MAIN FUNCTION------------------------------*/ /*********************************************************************//** * @brief Main TGLCD testing example sub-routine **********************************************************************/ /* With ARM and GHS toolsets, the entry point is main() - this will allow the linker to generate wrapper code to setup stacks, allocate heap area, and initialize and copy code and data segments. For GNU toolsets, the entry point is through __start() in the crt0_gnu.asm file, and that startup code will setup stacks and data */ int main(void) { schar key; uint16_t i=0,j=0; Bool CAPSLOCK=0; System_Init(); // Initialize System GLCD_Clear(White); while(1) { key = GLCD_Getche(); // Get character from touch keypad printf(LPC_UART0,"%c",key); if(i+5 >= 320) // Performs character wrapping { i = 0; // Set x at far left position j += 8; // Set y at next position down } if(key == CAPS) // If CAPS key is pressed toggle CAPS mode { CAPSLOCK = !CAPSLOCK; } if(CAPSLOCK && (key!=CAPS)) // if caps lock is enabled { gprintf(i,j,1,Black,"%c",to_upper(key)); i=i+6; } else if(!CAPSLOCK && (key!=CAPS)) // if caps lock is disabled { gprintf(i,j,1,Black,"%c",key); i=i+6; } } return 1; } #ifdef DEBUG /******************************************************************************* * @brief Reports the name of the source file and the source line number * where the CHECK_PARAM error has occurred. * @param[in] file Pointer to the source file name * @param[in] line assert_param error line source number * @return None *******************************************************************************/ void check_failed(uint8_t *file, uint32_t line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* Infinite loop */ while(1); } #endif /* * @} */
#ifndef INCLUDED_flash_net_URLLoader #define INCLUDED_flash_net_URLLoader #ifndef HXCPP_H #include <hxcpp.h> #endif #include <flash/events/EventDispatcher.h> HX_DECLARE_CLASS0(List) HX_DECLARE_CLASS2(flash,events,EventDispatcher) HX_DECLARE_CLASS2(flash,events,IEventDispatcher) HX_DECLARE_CLASS2(flash,net,URLLoader) HX_DECLARE_CLASS2(flash,net,URLLoaderDataFormat) HX_DECLARE_CLASS2(flash,net,URLRequest) HX_DECLARE_CLASS2(flash,utils,ByteArray) HX_DECLARE_CLASS2(flash,utils,IDataInput) HX_DECLARE_CLASS2(flash,utils,IDataOutput) HX_DECLARE_CLASS2(haxe,io,Bytes) HX_DECLARE_CLASS2(openfl,utils,IMemoryRange) namespace flash{ namespace net{ class HXCPP_CLASS_ATTRIBUTES URLLoader_obj : public ::flash::events::EventDispatcher_obj{ public: typedef ::flash::events::EventDispatcher_obj super; typedef URLLoader_obj OBJ_; URLLoader_obj(); Void __construct(::flash::net::URLRequest request); public: static hx::ObjectPtr< URLLoader_obj > __new(::flash::net::URLRequest request); static Dynamic __CreateEmpty(); static Dynamic __Create(hx::DynamicArray inArgs); ~URLLoader_obj(); HX_DO_RTTI; static void __boot(); static void __register(); void __Mark(HX_MARK_PARAMS); void __Visit(HX_VISIT_PARAMS); ::String __ToString() const { return HX_CSTRING("URLLoader"); } virtual Void __dataComplete( ); Dynamic __dataComplete_dyn(); virtual Void update( ); Dynamic update_dyn(); virtual Void dispatchHTTPStatus( int code); Dynamic dispatchHTTPStatus_dyn(); virtual Void onError( ::String msg); Dynamic onError_dyn(); virtual Void load( ::flash::net::URLRequest request); Dynamic load_dyn(); virtual Array< ::String > getCookies( ); Dynamic getCookies_dyn(); virtual Void close( ); Dynamic close_dyn(); Dynamic __onComplete; Dynamic &__onComplete_dyn() { return __onComplete;} Dynamic __handle; int state; ::flash::net::URLLoaderDataFormat dataFormat; Dynamic data; int bytesTotal; int bytesLoaded; static ::List activeLoaders; static int urlInvalid; static int urlInit; static int urlLoading; static int urlComplete; static int urlError; static bool hasActive( ); static Dynamic hasActive_dyn(); static Void initialize( ::String caCertFilePath); static Dynamic initialize_dyn(); static bool __loadPending( ); static Dynamic __loadPending_dyn(); static Void __pollData( ); static Dynamic __pollData_dyn(); static Dynamic lime_curl_create; static Dynamic &lime_curl_create_dyn() { return lime_curl_create;} static Dynamic lime_curl_process_loaders; static Dynamic &lime_curl_process_loaders_dyn() { return lime_curl_process_loaders;} static Dynamic lime_curl_update_loader; static Dynamic &lime_curl_update_loader_dyn() { return lime_curl_update_loader;} static Dynamic lime_curl_get_code; static Dynamic &lime_curl_get_code_dyn() { return lime_curl_get_code;} static Dynamic lime_curl_get_error_message; static Dynamic &lime_curl_get_error_message_dyn() { return lime_curl_get_error_message;} static Dynamic lime_curl_get_data; static Dynamic &lime_curl_get_data_dyn() { return lime_curl_get_data;} static Dynamic lime_curl_get_cookies; static Dynamic &lime_curl_get_cookies_dyn() { return lime_curl_get_cookies;} static Dynamic lime_curl_initialize; static Dynamic &lime_curl_initialize_dyn() { return lime_curl_initialize;} }; } // end namespace flash } // end namespace net #endif /* INCLUDED_flash_net_URLLoader */
#ifndef STEngineHeader #define STEngineHeader #include <windows.h> #include <GL/gl.h> #include <stdio.h> #include "CPF.StandardTetris.STGame.h" #include "CPF.StandardTetris.STFileList.h" #include "CPF.StandardTetris.STVideoProcessing.h" #include "CPF.StandardTetris.STConsole.h" namespace CPF { namespace StandardTetris { class STEngine { // WINDOW-RELATED private: static char mApplicationWindowClassNameANSI[ 256 ]; private: static char mApplicationWindowTitleANSI[ 256 ]; private: static char mApplicationFriendlyNameANSI[ 256 ]; private: static wchar_t mApplicationWindowClassNameWCHAR[ 256 ]; private: static wchar_t mApplicationWindowTitleWCHAR[ 256 ]; private: static wchar_t mApplicationFriendlyNameWCHAR[ 256 ]; private: static char mApplicationPathAndNameANSI[ _MAX_PATH ]; private: static wchar_t mApplicationPathAndNameWCHAR[ _MAX_PATH ]; private: static char mApplicationPathOnlyANSI[ _MAX_PATH ]; private: static wchar_t mApplicationPathOnlyWCHAR[ _MAX_PATH ]; private: static int mClient_Width; private: static int mClient_Height; private: static HWND m_HWND; private: static HINSTANCE m_HINSTANCE; private: static HDC m_HDC; private: static HGLRC m_HGLRC; private: static STGame mSTGame; private: static STVideoProcessing mSTVideoProcessing; private: static STFileList mSTFileList; private: static STConsole mSTConsole; public: STEngine(); public: ~STEngine(); public: static int GeneralInitialization(); public: static char * GetApplicationWindowClassNameANSI() { return( (char *)(mApplicationWindowClassNameANSI) ); } public: static char * GetApplicationWindowTitleANSI() { return( (char *)(mApplicationWindowTitleANSI) ); } public: static char * GetApplicationFriendlyNameANSI() { return( (char *)(mApplicationFriendlyNameANSI) ); } public: static wchar_t * GetApplicationWindowClassNameWCHAR() { return( (wchar_t *)(mApplicationWindowClassNameWCHAR) ); } public: static wchar_t * GetApplicationWindowTitleWCHAR() { return( (wchar_t *)(mApplicationWindowTitleWCHAR) ); } public: static wchar_t * GetApplicationFriendlyNameWCHAR() { return( (wchar_t *)(mApplicationFriendlyNameWCHAR) ); } public: static char * GetApplicationPathAndNameANSI() { return( (char *)(mApplicationPathAndNameANSI) ); } public: static wchar_t * GetApplicationPathAndNameWCHAR() { return( (wchar_t *)(mApplicationPathAndNameWCHAR) ); } public: static char * GetApplicationPathOnlyANSI() { return( (char *)(mApplicationPathOnlyANSI) ); } public: static wchar_t * GetApplicationPathOnlyWCHAR() { return( (wchar_t *)(mApplicationPathOnlyWCHAR) ); } public: static int SetUpGraphics(); public: static void PerformGameIterations ( float f32_DeltaTimeSeconds ); public: static STGame & GetGame() { return( mSTGame ); } public: static STVideoProcessing & GetVideoProcessing() { return( mSTVideoProcessing ); } public: static STConsole & GetConsole ( ) { return ( mSTConsole ); } public: static STFileList & GetFileList() { return( mSTFileList ); } public: static int GetClientWidth() { return( mClient_Width ); } public: static int GetClientHeight() { return( mClient_Height ); } public: static void SetClientWidth( int clientWidth ) { mClient_Width = clientWidth; } public: static void SetClientHeight( int clientHeight ) { mClient_Height = clientHeight; } public: static int GetClientDefaultX(); public: static int GetClientDefaultY(); public: static int GetClientDefaultWidth(); public: static int GetClientDefaultHeight(); public: static HINSTANCE GetHINSTANCE() { return( m_HINSTANCE ); } public: static void SetHWND ( HWND HWND_Parameter ) { m_HWND = HWND_Parameter; } public: static void SetHDC ( HDC HDC_Parameter ) { m_HDC = HDC_Parameter; } public: static HDC GetHDC() { return(m_HDC); } public: static HWND GetHWND() { return( m_HWND ); } public: static void SetHINSTANCE ( HINSTANCE HINSTANCE_Parameter ) { m_HINSTANCE = HINSTANCE_Parameter; } }; } } #endif
// // KSRouterItem.h // Copyright (c) 2015 Krin-San. All rights reserved. // #import <Foundation/Foundation.h> @interface KSRouterItem : NSObject /// Main key to handle routing @property (nonatomic, strong, readonly, nonnull) NSString *key; /// Different string aliases that could point on this route @property (nonatomic, strong, readonly, nullable) NSArray *aliases; /** Identifier to instantiate target view controller @note You must check `Use Storyboard ID` below `Restoration ID` field for proper `nextRoute` feature working */ @property (nonatomic, strong, readonly, nonnull) NSString *storyboardID; /// Main keys of all target controller dependencies. All of them will lie before target controller in navigation stack @property (nonatomic, strong, readonly, nullable) NSArray *dependencies; /// KVO-attributes with required values to be set @property (nonatomic, strong, readonly, nullable) NSDictionary *attributes; + (instancetype _Nonnull)itemWithStoryboardID:(NSString * _Nonnull)storyboardID; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID aliases:(NSArray * _Nullable)aliases; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID dependencies:(NSArray * _Nullable)dependencies; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID aliases:(NSArray * _Nullable)aliases dependencies:(NSArray * _Nullable)dependencies; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID attributes:(NSDictionary * _Nullable)attributes; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID aliases:(NSArray * _Nullable)aliases attributes:(NSDictionary * _Nullable)attributes; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID dependencies:(NSArray * _Nullable)dependencies attributes:(NSDictionary * _Nullable)attributes; + (instancetype _Nonnull)itemWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID aliases:(NSArray * _Nullable)aliases dependencies:(NSArray * _Nullable)dependencies attributes:(NSDictionary * _Nullable)attributes; - (instancetype _Nonnull)initWithKey:(NSString * _Nullable)key storyboardID:(NSString * _Nonnull)storyboardID aliases:(NSArray * _Nullable)aliases dependencies:(NSArray * _Nullable)dependencies attributes:(NSDictionary * _Nullable)attributes; @end
/************************************************************************* * File Name: usart_cfg.h * Author: Michael Dobinson * Date Created: 2015-10-23 * * Sub-files: * usart_cfg.c * usart_callback.c * usart_ctrl.c * * Brief: * Provides configuration settings for USART * * [Compiled and tested with Atmel Studio 7] * *************************************************************************/ #ifndef USART_CFG_H_ #define USART_CFG_H_ /*======================================================================*/ /* GLOBAL DEPENDENCIES */ /*======================================================================*/ #include "compiler.h" #include "user_board.h" #include "FreeRTOS.h" #include "queue.h" #include "semphr.h" #include "usart.h" #include "usart_interrupt.h" #include "dma.h" /*======================================================================*/ /* GLOBAL CONSTANT DEFINITIONS */ /*======================================================================*/ #define BAUDRATE_BLUETOOTH 9600 #define BAUDRATE_FTDI 9600 #define MAX_CALLBACK_BUFFER_LEN 5 #define FTDI_MAX_RX_LEN 32 /*======================================================================*/ /* GLOBAL VARIABLE DECLARATIONS */ /*======================================================================*/ struct usart_module usart_instanceBluetooth; struct usart_module usart_instanceFTDI; uint8_t rx_bufferFTDI[MAX_CALLBACK_BUFFER_LEN]; uint8_t rx_bufferBluetooth[MAX_CALLBACK_BUFFER_LEN]; SemaphoreHandle_t txSemaphoreFTDI, rxSemaphoreFTDI; SemaphoreHandle_t txSemaphoreBluetooth, rxSemaphoreBluetooth; QueueHandle_t xFTDITxQueue, xFTDIRxQueue; QueueHandle_t xBTTxQueue, xBTRxQueue; QueueHandle_t xParserQueue; /*======================================================================*/ /* EXTERNAL FUNCTION PROTOTYPES */ /*======================================================================*/ void usart_rxCallbackFTDI( struct usart_module *const usart_module ); void usart_txCallbackFTDI( struct usart_module *const usart_module ); void usart_rxCallbackBluetooth( struct usart_module *const usart_module ); void usart_txCallbackBluetooth( struct usart_module *const usart_module ); void TASK_FTDI ( void *pvParameters ); void TASK_Bluetooth ( void *pvParameters ); /*======================================================================*/ /* FUNCTION PROTOTYPES */ /*======================================================================*/ void USART_init( void ); #endif /* USART_CFG_H_ */
#ifndef PONTO_H_ #define PONTO_H_ #include "geometria/ObjetoGeometrico.h" /** * Ponto. */ class Ponto : public ObjetoGeometrico { public: /** * Construtor. */ Ponto(); /** * Construtor. * @param ponto objeto a ser copiado. */ Ponto(const Ponto& ponto); /** * Construtor. * @param nome nome do objeto. * @param x coordenada x do ponto. * @param y coordenada y do ponto. * @param z coordenada z do ponto. * @param cor cor do ponto. */ Ponto(const String& nome, const double x, const double y, const double z, const QColor& cor = QColor(0, 0, 0)); /** * Destrutor. */ virtual ~Ponto(); /** * Operador de atribuição. * @param ponto objeto a ser copiado. * @return ponto copiado. */ Ponto& operator=(const Ponto& ponto); /** * Operador de comparação de igualdade. * @param rhs ponto a ser comparado. * @return true caso os pontos sejam iguais. */ bool operator==(const Ponto& rhs) const; /** * Clonar o objeto. * @return cópia do objeto geométrico. */ ObjetoGeometrico* clonar() const; /** * Obter os pontos do objeto. * @return lista com a cópia dos pontos. */ QList<Ponto> getPontos() const; /** * Obter os pontos do objeto. * @return lista de pontos. */ QList<Ponto*> getPontosObjeto(); /** * Converter o objeto em string. * @return string representando o objeto. */ const String toString() const; /** * Obter a coordenada X. * @return coordenada x do ponto. */ const double getX() const; /** * Obter a coordenada Y. * @return coordenada y do ponto. */ const double getY() const; /** * Obter a coordenada Z. * @return coordenada z do ponto. */ const double getZ() const; /** * Definir a coordenada X. * @param x coordenada x do ponto. */ void setX(const double x); /** * Definir a coordenada Y. * @param y coordenada y do ponto. */ void setY(const double y); /** * Definir a coordenada Z. * @param z coordenada z do ponto. */ void setZ(const double z); protected: double coord_x; double coord_y; double coord_z; }; #endif
#pragma once #include <Win33/Application.h> #include <Win33/Window.h> #include <Win33/Dialog.h> #include <Win33/Button.h> #include <Win33/PopupBox.h> class Dialog : public Win33::Dialog<std::wstring> { public: Dialog( Win33::Window* parent ) : Win33::Dialog<std::wstring>( parent, Win33::Window::DefaultPosition, { 320, 240 } ) { setTitle( L"Dialog" ); mResult = L"Hello, world!"; } Dialog ( const Dialog& other ) = delete; Dialog ( Dialog&& other ) = delete; Dialog& operator= ( const Dialog& other ) = delete; Dialog& operator= ( Dialog&& other ) = delete; ~Dialog ( ) = default; }; class DialogWindow : public Win33::Window { public: DialogWindow( ) : Win33::Window ( Win33::Window::DefaultPosition, { 640, 480 } ), mShowDialog ( this, { 515, 407 }, { 100, 25 }, L"Show Dialog" ) { setTitle( L"DialogWindow" ); mShowDialog.setAnchor( Win33::Anchor::RightBottom ); mShowDialog.onClick += [&]( ) { const auto result = Dialog( this ).show( ); Win33::PopupBox::information( result, L"Dialog Result" ); }; } DialogWindow ( const DialogWindow& other ) = delete; DialogWindow ( DialogWindow&& other ) = delete; DialogWindow& operator= ( const DialogWindow& other ) = delete; DialogWindow& operator= ( DialogWindow&& other ) = delete; ~DialogWindow ( ) = default; private: Win33::Button mShowDialog; }; class DialogApplication : public Win33::Application { public: DialogApplication( ) : Win33::Application ( ), mDialogWindow ( ) { mDialogWindow.show( ); } DialogApplication ( const DialogApplication& other ) = delete; DialogApplication ( DialogApplication&& other ) = delete; DialogApplication& operator= ( const DialogApplication& other ) = delete; DialogApplication& operator= ( DialogApplication&& other ) = delete; ~DialogApplication ( ) = default; private: DialogWindow mDialogWindow; };
// // TKScrollPageViewController.h // XiaoNongDingClient // // Created by YueWen on 2017/9/4. // Copyright © 2017年 ryden. All rights reserved. // #import <UIKit/UIKit.h> #import "LLSegmentBar.h" NS_ASSUME_NONNULL_BEGIN /// UIPageViewControllerTransitionStyleScroll 模式下的UIPageViewController @interface TKScrollPageViewController : UIPageViewController /// 当前的控制器 @property (nonatomic, weak, nullable) UIViewController *currentViewController; /// 当前控制器的索引 @property (nonatomic, assign, readonly) NSInteger currentIndex; /// 涵盖的viewControllers @property (nonatomic, copy)NSArray <__kindof UIViewController *> *contentViewControllers; @end @class TKScrollHorizontalPageViewController; @protocol TKScrollHorizontalPageDelegate <NSObject> @optional /** TKScrollHorizontalPageViewController 将要变为第几个控制器 @param viewController TKScrollHorizontalPageViewController @param index 当前控制器的index */ - (void)tk_scrollHorizontalPageViewController:(TKScrollHorizontalPageViewController *)viewController willToIndex:(NSInteger)index; @end @interface TKScrollHorizontalPageViewController : TKScrollPageViewController <LLSegmentBarDelegate> /// 代理 @property (nonatomic, weak, nullable) id<TKScrollHorizontalPageDelegate> tk_delegate; /// 控制器 @property (nonatomic, strong) LLSegmentBar * segmentBar; /// 导航栏的pop手势 @property (nonatomic, weak)UIPanGestureRecognizer *popPanGestureRecognizer; @end @interface TKScrollVerticalPageViewController : TKScrollPageViewController @end @interface UIPageViewController (TKScrollView) /// 滚动视图 @property (nonatomic, weak, nullable, readonly) UIScrollView *tk_scrollView; /// 滚动视图的滑动手势 @property (nonatomic, strong, nullable, readonly) UIPanGestureRecognizer *tk_scrollPanGestureRecongnizer; /// 滚动视图的所有手势 @property (nonatomic, copy, nullable, readonly) NSArray <UIGestureRecognizer *> *tk_gestureRecongnizers; @end @interface TKScrollPageViewController (UIPageViewControllerDataSource) <UIPageViewControllerDataSource> @end @interface TKScrollPageViewController (UIPageViewControllerDelegate) <UIPageViewControllerDelegate> @end NS_ASSUME_NONNULL_END
#import <Foundation/Foundation.h> #import "EICairoImage.h" // TODO: This should be a category on EICairoImage #ifndef CAIRO_HAS_PNG_FUNCTIONS #error Cairo does not have required PNG support #endif @interface EICairoPNGImage : EICairoImage - (id)initWithPath:(NSString *)image_path; @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 <OfficeImport/CMDiagramShapeHierarchyMapper.h> @interface CMDiagramShapeHierarchyMapper (Private) - (struct ODIHRangeVector *)mapRangesForNode:(id)arg1; - (void)setAbsolutePositionOfNode:(id)arg1 parentRow:(int)arg2 parentXOffset:(float)arg3 index:(int)arg4; - (void)copyInfoForNode:(id)arg1 depth:(int)arg2; - (struct CGRect)mapLogicalBoundsWithXRanges:(const struct ODIHRangeVector *)arg1; - (struct CGRect)boundsForNode:(id)arg1; - (id)infoForNode:(id)arg1; - (void)setUpLayers; @end
/* * Network_manager.h * * Created on: 23 lut 2015 * Author: ky3orr */ #ifndef NETWORK_MANAGER_H_ #define NETWORK_MANAGER_H_ #define NET_SYNC_CODE_1 0x5C // OSN id code #define NET_SYNC_CODE_2 0x3A // OSN id code #endif /* NETWORK_MANAGER_H_ */
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" // Not exported @interface TSCEArgumentToken : NSObject { } + (_Bool)isStringValidArgumentToken:(id)arg1; @end
// // TTMutableProxy.h // ZhaoCaiHuiBaoRt // // Created by apple on 2017/8/3. // Copyright © 2017年 ttayaa. All rights reserved. // #import <Foundation/Foundation.h> @interface TTMutableProxy : NSObject /** The array of registered delegates. */ @property (readonly, nonatomic) NSPointerArray* delegates; /** Set whether to throw unrecognized selector exceptions when calling delegate methods on an empty AIMultiDelegate. When `slientWhenEmpty` is NO, the default, if a delegate selector is called and there are no registered delegates an unregonized selector execption will be thrown. Which, unless you have a try/catch block, will crash the app. Setting `silentWhenEmpt` to YES will silence the execptions by ignoring selector invocations when there are no registered delegates. */ @property (nonatomic, assign) BOOL silentWhenEmpty; - (id)initWithDelegates:(NSArray*)delegates; - (void)addDelegate:(id)delegate; - (void)addDelegate:(id)delegate beforeDelegate:(id)otherDelegate; - (void)addDelegate:(id)delegate afterDelegate:(id)otherDelegate; - (void)removeDelegate:(id)delegate; - (void)removeAllDelegates; @end
#import "CPTDefinitions.h" #import "CPTPlot.h" /// @file @class CPTColor; @class CPTFill; @class CPTMutableNumericData; @class CPTNumericData; @class CPTPieChart; @class CPTTextLayer; @class CPTLineStyle; /// @ingroup plotBindingsPieChart /// @{ extern NSString *const CPTPieChartBindingPieSliceWidthValues; extern NSString *const CPTPieChartBindingPieSliceFills; extern NSString *const CPTPieChartBindingPieSliceRadialOffsets; /// @} /** * @brief Enumeration of pie chart data source field types. **/ typedef enum _CPTPieChartField { CPTPieChartFieldSliceWidth, ///< Pie slice width. CPTPieChartFieldSliceWidthNormalized, ///< Pie slice width normalized [0, 1]. CPTPieChartFieldSliceWidthSum ///< Cumulative sum of pie slice widths. } CPTPieChartField; /** * @brief Enumeration of pie slice drawing directions. **/ typedef enum _CPTPieDirection { CPTPieDirectionClockwise, ///< Pie slices are drawn in a clockwise direction. CPTPieDirectionCounterClockwise ///< Pie slices are drawn in a counter-clockwise direction. } CPTPieDirection; #pragma mark - /** * @brief A pie chart data source. **/ @protocol CPTPieChartDataSource<CPTPlotDataSource> @optional /// @name Slice Style /// @{ /** @brief @optional Gets a range of slice fills for the given pie chart. * @param pieChart The pie chart. * @param indexRange The range of the data indexes of interest. * @return The pie slice fill for the slice with the given index. **/ -(NSArray *)sliceFillsForPieChart:(CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a fill for the given pie chart slice. * This method will not be called if * @link CPTPieChartDataSource::sliceFillsForPieChart:recordIndexRange: -sliceFillsForPieChart:recordIndexRange: @endlink * is also implemented in the datasource. * @param pieChart The pie chart. * @param idx The data index of interest. * @return The pie slice fill for the slice with the given index. **/ -(CPTFill *)sliceFillForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /// @} /// @name Slice Layout /// @{ /** @brief @optional Gets a range of slice offsets for the given pie chart. * @param pieChart The pie chart. * @param indexRange The range of the data indexes of interest. * @return An array of radial offsets. **/ -(NSArray *)radialOffsetsForPieChart:(CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; /** @brief @optional Offsets the slice radially from the center point. Can be used to @quote{explode} the chart. * This method will not be called if * @link CPTPieChartDataSource::radialOffsetsForPieChart:recordIndexRange: -radialOffsetsForPieChart:recordIndexRange: @endlink * is also implemented in the datasource. * @param pieChart The pie chart. * @param idx The data index of interest. * @return The radial offset in view coordinates. Zero is no offset. **/ -(CGFloat)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /// @} /// @name Legends /// @{ /** @brief @optional Gets the legend title for the given pie chart slice. * @param pieChart The pie chart. * @param idx The data index of interest. * @return The title text for the legend entry for the point with the given index. **/ -(NSString *)legendTitleForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /// @} @end #pragma mark - /** * @brief Pie chart delegate. **/ @protocol CPTPieChartDelegate<CPTPlotDelegate> @optional /// @name Slice Selection /// @{ /** @brief @optional Informs the delegate that a pie slice was * @if MacOnly clicked. @endif * @if iOSOnly touched. @endif * @param plot The pie chart. * @param idx The index of the * @if MacOnly clicked pie slice. @endif * @if iOSOnly touched pie slice. @endif **/ -(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a pie slice was * @if MacOnly clicked. @endif * @if iOSOnly touched. @endif * @param plot The pie chart. * @param idx The index of the * @if MacOnly clicked pie slice. @endif * @if iOSOnly touched pie slice. @endif * @param event The event that triggered the selection. **/ -(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; /// @} @end #pragma mark - @interface CPTPieChart : CPTPlot { @private CGFloat pieRadius; CGFloat pieInnerRadius; CGFloat startAngle; CGFloat endAngle; CPTPieDirection sliceDirection; CGPoint centerAnchor; CPTLineStyle *borderLineStyle; CPTFill *overlayFill; BOOL labelRotationRelativeToRadius; } /// @name Appearance /// @{ @property (nonatomic, readwrite) CGFloat pieRadius; @property (nonatomic, readwrite) CGFloat pieInnerRadius; @property (nonatomic, readwrite) CGFloat startAngle; @property (nonatomic, readwrite) CGFloat endAngle; @property (nonatomic, readwrite) CPTPieDirection sliceDirection; @property (nonatomic, readwrite) CGPoint centerAnchor; /// @} /// @name Drawing /// @{ @property (nonatomic, readwrite, copy) CPTLineStyle *borderLineStyle; @property (nonatomic, readwrite, copy) CPTFill *overlayFill; /// @} /// @name Data Labels /// @{ @property (nonatomic, readwrite, assign) BOOL labelRotationRelativeToRadius; /// @} /// @name Information /// @{ -(NSUInteger)pieSliceIndexAtAngle:(CGFloat)angle; -(CGFloat)medianAngleForPieSliceIndex:(NSUInteger)index; /// @} /// @name Factory Methods /// @{ +(CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex; /// @} @end
//===--------------------------------------------------------------------------------*- C++ -*-===// // _ // | | // __| | __ ___ ___ ___ // / _` |/ _` \ \ /\ / / '_ | // | (_| | (_| |\ V V /| | | | // \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain // // // This file is distributed under the MIT License (MIT). // See LICENSE.txt for details. // //===------------------------------------------------------------------------------------------===// #ifndef DAWN_CODEGEN_GRIDTOOLS_ASTSTENCILDESC_H #define DAWN_CODEGEN_GRIDTOOLS_ASTSTENCILDESC_H #include "dawn/CodeGen/ASTCodeGenCXX.h" #include "dawn/Support/StringUtil.h" #include <stack> #include <unordered_map> #include <vector> namespace dawn { class StencilInstantiation; namespace codegen { namespace gt { /// @brief ASTVisitor to generate C++ gridtools code for the stencil and stencil function bodies /// @ingroup gt class ASTStencilDesc : public ASTCodeGenCXX { protected: const StencilInstantiation* instantiation_; /// StencilID to the name of the generated stencils for this ID const std::unordered_map<int, std::vector<std::string>>& StencilIDToStencilNameMap_; public: using Base = ASTCodeGenCXX; ASTStencilDesc( const StencilInstantiation* instantiation, const std::unordered_map<int, std::vector<std::string>>& StencilIDToStencilNameMap); virtual ~ASTStencilDesc(); /// @name Statement implementation /// @{ virtual void visit(const std::shared_ptr<BlockStmt>& stmt) override; virtual void visit(const std::shared_ptr<ExprStmt>& stmt) override; virtual void visit(const std::shared_ptr<ReturnStmt>& stmt) override; virtual void visit(const std::shared_ptr<VarDeclStmt>& stmt) override; virtual void visit(const std::shared_ptr<VerticalRegionDeclStmt>& stmt) override; virtual void visit(const std::shared_ptr<StencilCallDeclStmt>& stmt) override; virtual void visit(const std::shared_ptr<BoundaryConditionDeclStmt>& stmt) override; virtual void visit(const std::shared_ptr<IfStmt>& stmt) override; /// @} /// @name Expression implementation /// @{ virtual void visit(const std::shared_ptr<UnaryOperator>& expr) override; virtual void visit(const std::shared_ptr<BinaryOperator>& expr) override; virtual void visit(const std::shared_ptr<AssignmentExpr>& expr) override; virtual void visit(const std::shared_ptr<TernaryOperator>& expr) override; virtual void visit(const std::shared_ptr<FunCallExpr>& expr) override; virtual void visit(const std::shared_ptr<StencilFunCallExpr>& expr) override; virtual void visit(const std::shared_ptr<StencilFunArgExpr>& expr) override; virtual void visit(const std::shared_ptr<VarAccessExpr>& expr) override; virtual void visit(const std::shared_ptr<LiteralAccessExpr>& expr) override; virtual void visit(const std::shared_ptr<FieldAccessExpr>& expr) override; /// @} std::string getName(const std::shared_ptr<Stmt>& stmt) const override; std::string getName(const std::shared_ptr<Expr>& expr) const override; }; } // namespace gt } // namespace codegen } // namespace dawn #endif
/* * * Copyright 2014 Flavio Negrão Torres * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <Foundation/Foundation.h> #import <Parse/Parse.h> /* Parse config */ extern NSString* const APParseApplicationID; extern NSString* const APParseClientKey; extern NSString* const APUnitTestingParseUserName; extern NSString* const APUnitTestingParseUserName2; // Used to test changing logged user extern NSString* const APUnitTestingParsePassword;
/* Copyright (c) 2010, Jonathan Wayne Parrott Please see the license.txt file included with this source distribution for more information. */ #ifndef __PHBATCHGEOMETRYCOMP_H__ #define __PHBATCHGEOMETRYCOMP_H__ #include "BatchGeometry.h" namespace phoenix { //! Batch Geometry Composite Class. /* Implements the composite pattern for batch geometry. Differences are noted. */ class BatchGeometryComposite : public BatchGeometry { public: /*! Default constructor */ BatchGeometryComposite( BatchRenderer& _r ) : BatchGeometry(_r), geoms() { } /*! Does nothing. \sa drop() */ virtual ~BatchGeometryComposite() { geoms.clear(); } //! Add a child geom inline void add( BatchGeometryPtr g ){ geoms.push_back(g); } //! Remove a child geom inline void remove( BatchGeometryPtr g ){ geoms.erase( std::remove(geoms.begin(),geoms.end(),g), geoms.end() ); } //! Removea all children inline void clear() { geoms.clear(); } //! Get children inline std::vector< BatchGeometryPtr >& getChildren() { return geoms; } //! Drop /*! Also drops all children. */ inline virtual void drop() { BatchGeometry::drop(); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->drop(); } } inline virtual void drop(bool skip_children = false){ BatchGeometry::drop(); } //! Set OpenGL Primitive type. /* Affects all children. */ inline virtual void setPrimitiveType( const unsigned int& _v ) { BatchGeometry::setPrimitiveType(_v); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setPrimitiveType(_v); } } //! Set Texture. /*! Affects all children */ inline virtual void setTexture( TexturePtr _t ) { BatchGeometry::setTexture(_t); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setTexture(_t); } } //! Set Group Id. /* Affects all children */ inline virtual void setGroup( const signed int& _v ) { BatchGeometry::setGroup(_v); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setGroup(_v); } } //! Set Depth /*! Affects all children */ inline virtual void setDepth( float _v ) { BatchGeometry::setDepth(_v); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setDepth(_v); } } //! Enable or Disable. /*! Affects all children */ inline virtual void setEnabled( bool _e ) { BatchGeometry::setEnabled(_e); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setEnabled(_e); } } //! Immediate rendering. /*! Affects all children */ inline virtual void setImmediate( bool _i ) { BatchGeometry::setImmediate(_i); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setImmediate(_i); } } //! Update /*! Affects all children */ virtual void update() { BatchGeometry::update(); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->update(); } } //! Batch /*! Does nothing except the immediate check. (does not batch children, that is automatic) */ virtual unsigned int batch( std::vector<Vertex>& list, bool persist = false ) { if( immediate && !persist ) { drop(true); //children should all be immediate, so they should be collected automatically, no need for us to preemptively drop them, will cause them not to be drawn. } return 0; } //! Translate /*! Affects all children */ inline virtual void translate( const Vector2d& _t ) { BatchGeometry::translate(_t); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->translate(_t); } } //! Scale /*! Affects all children */ inline virtual void scale( const Vector2d& _s ) { BatchGeometry::scale(_s); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->scale(_s); } } //! Rotate /*! Affects all children */ inline virtual void rotate( const RotationMatrix& _m ) { BatchGeometry::rotate(_m); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->rotate(_m); } } //! Sets the color on all vertices. Affects all children inline virtual void colorize( const Color& _c ) { BatchGeometry::colorize(_c); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->colorize(_c); } } //! Enables/disables clipping. Affects all children. inline virtual void setClipping( bool _c ) { BatchGeometry::setClipping(false); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setClipping(_c); } } //! Sets the clipping rectangle. Affects all children. inline virtual void setClippingRectangle( const Rectangle& _r ) { BatchGeometry::setClippingRectangle(_r); BOOST_FOREACH( BatchGeometryPtr& g, geoms ){ g->setClippingRectangle(_r); } } protected: //! Geoms std::vector< BatchGeometryPtr > geoms; }; typedef boost::intrusive_ptr<BatchGeometryComposite> BatchGeometryCompositePtr; } //namespace phoniex #endif // __PHBATCHGEOMETRY_H__
#ifndef PHOTONCONTAINER_H #define PHOTONCONTAINER_H #include "Container.h" #include "Photon.h" declareContainer(Photon, photon) #endif // PHOTONCONTAINER_H
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" #import "OADClient-Protocol.h" #import "OADTextClient-Protocol.h" @class OADDrawable, WDAAnchor, WDATextBox; // Not exported @interface WDAContent : NSObject <OADClient, OADTextClient> { WDAAnchor *mAnchor; WDATextBox *mTextBox; OADDrawable *mDrawable; int mTextType; } @property(readonly, nonatomic) WDAAnchor *anchor; // @synthesize anchor=mAnchor; - (_Bool)hasText; - (_Bool)floating; - (void)setTextType:(int)arg1; - (int)textType; - (_Bool)isTopLevelObject; - (_Bool)isLine; - (_Bool)isShape; - (void)setDrawable:(id)arg1; - (id)drawable; - (void)setTextBox:(id)arg1 document:(id)arg2; - (id)textBox; - (void)setBounds:(struct CGRect)arg1; - (struct CGRect)bounds; - (_Bool)hasBounds; - (id)createTextBoxWithDocument:(id)arg1 textType:(int)arg2; - (void)clearAnchor; - (id)createAnchor; - (void)dealloc; - (id)init; @end
// // This file is part of nunn Library // Copyright (c) Antonino Calderone (antonino.calderone@gmail.com) // All rights reserved. // Licensed under the MIT License. // See COPYING file in the project root for full license information. // /* -------------------------------------------------------------------------- */ #ifndef __NU_E_GREEDY_POLICY_H__ #define __NU_E_GREEDY_POLICY_H__ /* -------------------------------------------------------------------------- */ #include "nu_random_gen.h" #include <cmath> #include <cassert> /* -------------------------------------------------------------------------- */ namespace nu { /* -------------------------------------------------------------------------- */ template<class Action, class Agent, class RndGen = RandomGenerator<>> class EGreedyPolicy { public: void setEpsilon(const double & e) noexcept { _epsilon = e; } double getEpsilon() const noexcept { return _epsilon; } template<class QMap> Action selectAction( const Agent& agent, QMap & qMap, bool dontExplore = false) const { auto validActions = agent.getValidActions(); assert(!validActions.empty()); Action action = validActions[0]; double reward = 0; if (dontExplore || _rndGen() > getEpsilon()) { // get current agent state const auto & agentState = agent.getCurrentState(); reward = qMap[agentState][action]; for (const auto & anAction : validActions) { const auto & val = qMap[agentState][anAction]; if (val > reward) { reward = val; action = anAction; } } } if (reward == .0) { action = validActions[size_t(_rndGen() * double(validActions.size()))]; } return action; } template<class QMap> Action getLearnedAction(const Agent& agent, QMap & qMap) const { return selectAction(agent, qMap, true); } private: double _epsilon = .1; mutable RndGen _rndGen; }; /* -------------------------------------------------------------------------- */ } /* -------------------------------------------------------------------------- */ #endif // __NU_E_GREEDY_POLICY_H__
/*========================================================================= Program: Visualization Toolkit Module: vtkPistonSort.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkPistonSort - NVidia thrust filter example. // .SECTION Description // An example filter that operates on the GPU and produces a result that // can be processed by another piston filter in the pipeline. // The implementation simply calls thrust::sort on the scalar array which // keeps the same data type while producing a result which is verifiably // correct. #ifndef vtkPistonSort_h #define vtkPistonSort_h #include "vtkPistonAlgorithm.h" class VTKACCELERATORSPISTON_EXPORT vtkPistonSort : public vtkPistonAlgorithm { public: vtkTypeMacro(vtkPistonSort,vtkPistonAlgorithm); static vtkPistonSort *New(); void PrintSelf(ostream& os, vtkIndent indent); protected: vtkPistonSort() {} ~vtkPistonSort() {} // Description: // Method that does the actual calculation. virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector); private: vtkPistonSort(const vtkPistonSort&); // Not implemented. void operator=(const vtkPistonSort&); // Not implemented. }; #endif
#define TINYCBOR_VERSION_MAJOR 0 #define TINYCBOR_VERSION_MINOR 5 #define TINYCBOR_VERSION_PATCH 4
// // XBAchivementDetailsParser.h // Xbox Live Friends // // Created by Wil Gieseler on 8/7/06. // Copyright 2006 __MyCompanyName__. All rights reserved. // #import <Cocoa/Cocoa.h> @interface XBAchievementDetailsParser : NSObject { } + (NSArray *)fetchWithGameID:(NSString *)gameID tag:(NSString *)tag; + (NSArray *)fetchWithURL:(NSURL *)URL; + (NSArray *)fetchForSelfWithGameID:(NSString *)gameID; @end
#ifndef _BLP_H_ #define _BLP_H_ #include <stdint.h> #include <stdio.h> #include <string> #ifdef __cplusplus extern "C" { #endif #ifdef _WIN32 # ifdef blp_EXPORTS # define MODULE_API __declspec(dllexport) # else # define MODULE_API # endif #else # define MODULE_API #endif struct tBGRAPixel { uint8_t b; uint8_t g; uint8_t r; uint8_t a; }; // Opaque type representing a BLP file typedef void* tBLPInfos; enum tBLPEncoding { BLP_ENCODING_UNCOMPRESSED = 1, BLP_ENCODING_DXT = 2, BLP_ENCODING_UNCOMPRESSED_RAW_BGRA = 3 }; enum tBLPAlphaDepth { BLP_ALPHA_DEPTH_0 = 0, BLP_ALPHA_DEPTH_1 = 1, BLP_ALPHA_DEPTH_4 = 4, BLP_ALPHA_DEPTH_8 = 8, }; enum tBLPAlphaEncoding { BLP_ALPHA_ENCODING_DXT1 = 0, BLP_ALPHA_ENCODING_DXT3 = 1, BLP_ALPHA_ENCODING_DXT5 = 7, }; enum tBLPFormat { BLP_FORMAT_JPEG = 0, BLP_FORMAT_PALETTED_NO_ALPHA = (BLP_ENCODING_UNCOMPRESSED << 16) | (BLP_ALPHA_DEPTH_0 << 8), BLP_FORMAT_PALETTED_ALPHA_1 = (BLP_ENCODING_UNCOMPRESSED << 16) | (BLP_ALPHA_DEPTH_1 << 8), BLP_FORMAT_PALETTED_ALPHA_4 = (BLP_ENCODING_UNCOMPRESSED << 16) | (BLP_ALPHA_DEPTH_4 << 8), BLP_FORMAT_PALETTED_ALPHA_8 = (BLP_ENCODING_UNCOMPRESSED << 16) | (BLP_ALPHA_DEPTH_8 << 8), BLP_FORMAT_RAW_BGRA = (BLP_ENCODING_UNCOMPRESSED_RAW_BGRA << 16), BLP_FORMAT_DXT1_NO_ALPHA = (BLP_ENCODING_DXT << 16) | (BLP_ALPHA_DEPTH_0 << 8) | BLP_ALPHA_ENCODING_DXT1, BLP_FORMAT_DXT1_ALPHA_1 = (BLP_ENCODING_DXT << 16) | (BLP_ALPHA_DEPTH_1 << 8) | BLP_ALPHA_ENCODING_DXT1, BLP_FORMAT_DXT3_ALPHA_4 = (BLP_ENCODING_DXT << 16) | (BLP_ALPHA_DEPTH_4 << 8) | BLP_ALPHA_ENCODING_DXT3, BLP_FORMAT_DXT3_ALPHA_8 = (BLP_ENCODING_DXT << 16) | (BLP_ALPHA_DEPTH_8 << 8) | BLP_ALPHA_ENCODING_DXT3, BLP_FORMAT_DXT5_ALPHA_8 = (BLP_ENCODING_DXT << 16) | (BLP_ALPHA_DEPTH_8 << 8) | BLP_ALPHA_ENCODING_DXT5, }; MODULE_API tBLPInfos blp_processFile(FILE* pFile); MODULE_API void blp_release(tBLPInfos blpInfos); MODULE_API uint8_t blp_version(tBLPInfos blpInfos); MODULE_API tBLPFormat blp_format(tBLPInfos blpInfos); MODULE_API unsigned int blp_width(tBLPInfos blpInfos, unsigned int mipLevel = 0); MODULE_API unsigned int blp_height(tBLPInfos blpInfos, unsigned int mipLevel = 0); MODULE_API unsigned int blp_nbMipLevels(tBLPInfos blpInfos); MODULE_API tBGRAPixel* blp_convert(FILE* pFile, tBLPInfos blpInfos, unsigned int mipLevel = 0); #ifdef __cplusplus } #endif std::string blp_asString(tBLPFormat format); #endif
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Animations\0.11.3\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_FUSE_ANIMATIONS_AVERAGE_MASTER_PROPERTY__FUSE_ELEMENTS_STRETCH_MODE_H__ #define __APP_FUSE_ANIMATIONS_AVERAGE_MASTER_PROPERTY__FUSE_ELEMENTS_STRETCH_MODE_H__ #include <app/Fuse.Animations.IMixerMaster.h> #include <app/Fuse.Animations.MasterProperty__Fuse_Elements_StretchMode.h> #include <app/Fuse.Animations.MasterPropertyGet.h> #include <Uno.h> namespace app { namespace Fuse { namespace Animations { struct MixerBase; } } } namespace app { namespace Fuse { namespace Internal { struct Blender__Fuse_Elements_StretchMode; } } } namespace app { namespace Uno { namespace UX { struct Property__Fuse_Elements_StretchMode; } } } namespace app { namespace Fuse { namespace Animations { struct AverageMasterProperty__Fuse_Elements_StretchMode; struct AverageMasterProperty__Fuse_Elements_StretchMode__uType : ::app::Fuse::Animations::MasterProperty__Fuse_Elements_StretchMode__uType { }; AverageMasterProperty__Fuse_Elements_StretchMode__uType* AverageMasterProperty__Fuse_Elements_StretchMode__typeof(); void AverageMasterProperty__Fuse_Elements_StretchMode___ObjInit_2(AverageMasterProperty__Fuse_Elements_StretchMode* __this, ::app::Uno::UX::Property__Fuse_Elements_StretchMode* property, ::app::Fuse::Animations::MixerBase* mixerBase); AverageMasterProperty__Fuse_Elements_StretchMode* AverageMasterProperty__Fuse_Elements_StretchMode__New_1(::uStatic* __this, ::app::Uno::UX::Property__Fuse_Elements_StretchMode* property, ::app::Fuse::Animations::MixerBase* mixerBase); void AverageMasterProperty__Fuse_Elements_StretchMode__OnActive(AverageMasterProperty__Fuse_Elements_StretchMode* __this); void AverageMasterProperty__Fuse_Elements_StretchMode__OnComplete(AverageMasterProperty__Fuse_Elements_StretchMode* __this); struct AverageMasterProperty__Fuse_Elements_StretchMode : ::app::Fuse::Animations::MasterProperty__Fuse_Elements_StretchMode { ::uStrong< ::app::Fuse::Internal::Blender__Fuse_Elements_StretchMode*> blender; void _ObjInit_2(::app::Uno::UX::Property__Fuse_Elements_StretchMode* property, ::app::Fuse::Animations::MixerBase* mixerBase) { AverageMasterProperty__Fuse_Elements_StretchMode___ObjInit_2(this, property, mixerBase); } }; }}} #endif
/* * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * * 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 MICROPY_INCLUDED_EXTMOD_VFS_FAT_H #define MICROPY_INCLUDED_EXTMOD_VFS_FAT_H #include "py/lexer.h" #include "py/obj.h" #include "lib/oofatfs/ff.h" #include "extmod/vfs.h" // these are the values for fs_user_mount_t.flags #define FSUSER_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func #define FSUSER_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount #define FSUSER_HAVE_IOCTL (0x0004) // new protocol with ioctl typedef struct _fs_user_mount_t { mp_obj_base_t base; uint16_t flags; mp_obj_t readblocks[4]; mp_obj_t writeblocks[4]; // new protocol uses just ioctl, old uses sync (optional) and count union { mp_obj_t ioctl[4]; struct { mp_obj_t sync[2]; mp_obj_t count[2]; } old; } u; FATFS fatfs; } fs_user_mount_t; extern const byte fresult_to_errno_table[20]; extern const mp_obj_type_t mp_fat_vfs_type; mp_import_stat_t fat_vfs_import_stat(struct _fs_user_mount_t *vfs, const char *path); mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode); MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); mp_obj_t fat_vfs_ilistdir2(struct _fs_user_mount_t *vfs, const char *path, bool is_str_type); #endif // MICROPY_INCLUDED_EXTMOD_VFS_FAT_H
// The MIT License (MIT) // // Copyright (c) 2015 Sergey Makeev, Vadim Slyusarev // // 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 #ifndef __MT_FIBER__ #define __MT_FIBER__ //#define MT_USE_BOOST_CONTEXT (1) #if MT_USE_BOOST_CONTEXT #include <fcontext.h> //TODO #else #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #endif #include <ucontext.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <sys/mman.h> #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif #ifndef MAP_STACK #define MAP_STACK (0) #endif #include <MTAppInterop.h> #include "MTAtomic.h" #endif namespace MT { // // // class Fiber { void* funcData; TThreadEntryPoint func; Memory::StackDesc stackDesc; ucontext_t fiberContext; bool isInitialized; static void FiberFuncInternal(void* pFiber) { MT_ASSERT(pFiber != nullptr, "Invalid fiber"); Fiber* self = (Fiber*)pFiber; MT_ASSERT(self->isInitialized == true, "Using non initialized fiber"); MT_ASSERT(self->func != nullptr, "Invalid fiber func"); self->func(self->funcData); } void CleanUp() { if (isInitialized) { // if func != null than we have stack memory ownership if (func != nullptr) { Memory::FreeStack(stackDesc); } isInitialized = false; } } public: MT_NOCOPYABLE(Fiber); Fiber() : funcData(nullptr) , func(nullptr) , isInitialized(false) { memset(&fiberContext, 0, sizeof(ucontext_t)); } ~Fiber() { CleanUp(); } void CreateFromCurrentThreadAndRun(TThreadEntryPoint entryPoint, void *userData) { MT_ASSERT(!isInitialized, "Already initialized"); func = nullptr; funcData = nullptr; // get execution context int res = getcontext(&fiberContext); MT_USED_IN_ASSERT(res); MT_ASSERT(res == 0, "getcontext - failed"); isInitialized = true; entryPoint(userData); CleanUp(); } void Create(size_t stackSize, TThreadEntryPoint entryPoint, void *userData) { MT_ASSERT(!isInitialized, "Already initialized"); MT_ASSERT(stackSize >= PTHREAD_STACK_MIN, "Stack to small"); func = entryPoint; funcData = userData; int res = getcontext(&fiberContext); MT_USED_IN_ASSERT(res); MT_ASSERT(res == 0, "getcontext - failed"); stackDesc = Memory::AllocStack(stackSize); fiberContext.uc_link = nullptr; fiberContext.uc_stack.ss_sp = stackDesc.stackBottom; fiberContext.uc_stack.ss_size = stackDesc.GetStackSize(); fiberContext.uc_stack.ss_flags = 0; makecontext(&fiberContext, (void(*)())&FiberFuncInternal, 1, (void *)this); isInitialized = true; } #ifdef MT_INSTRUMENTED_BUILD void SetName(const char* fiberName) { MT_UNUSED(fiberName); } #endif static void SwitchTo(Fiber & from, Fiber & to) { HardwareFullMemoryBarrier(); MT_ASSERT(from.isInitialized, "Invalid from fiber"); MT_ASSERT(to.isInitialized, "Invalid to fiber"); int res = swapcontext(&from.fiberContext, &to.fiberContext); MT_USED_IN_ASSERT(res); MT_ASSERT(res == 0, "setcontext - failed"); } }; } #endif
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class com_waicool20_skrypton_jni_objects_SKryptonMouseEvent_Companion */ #ifndef _Included_com_waicool20_skrypton_jni_objects_SKryptonMouseEvent_Companion #define _Included_com_waicool20_skrypton_jni_objects_SKryptonMouseEvent_Companion #ifdef __cplusplus extern "C" { #endif /* * Class: com_waicool20_skrypton_jni_objects_SKryptonMouseEvent_Companion * Method: initialize_N * Signature: (IIIJJJ)J */ JNIEXPORT jlong JNICALL Java_com_waicool20_skrypton_jni_objects_SKryptonMouseEvent_00024Companion_initialize_1N (JNIEnv *, jobject, jint, jint, jint, jlong, jlong, jlong); #ifdef __cplusplus } #endif #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double Pods_LXModuleDemoVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_LXModuleDemoVersionString[];
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////////// #ifndef Pegasus_CIMDateTimeRep_h #define Pegasus_CIMDateTimeRep_h PEGASUS_NAMESPACE_BEGIN /** This struct defines the internal representation of the CIMDateTime class. The CIMDateTimeRep is a private memeber of CIMDateTime class. */ struct CIMDateTimeRep { // Number of microseconds elapsed since January 1, 1 BCE. Uint64 usec; // UTC offset Uint32 utcOffset; // ':' for intervals. '-' or '+' for time stamps. Uint16 sign; // Number of wild characters ('*') used to initialize this object. Uint16 numWildcards; }; PEGASUS_NAMESPACE_END #endif /* Pegasus_CIMDateTimeRep_h */
#ifndef VECTORS_H #define VECTORS_H #include <stdlib.h> #include "common.h" typedef struct vector_m { real *storage; size_t dimension; } *vector; vector new_vector(size_t n); void delete_vector(vector vec); #define vidx(vec, idx) vec->storage[idx] #endif
#pragma once #include "State.h" #include "World.h" #include "Container.h" #include "OptionContainer.h" class StateStack; class OptionState : public State{ public: OptionState(StateStack &stack, Context context); void draw(); bool update(sf::Time deltaTime); bool handleEvent(const sf::Event &event); void applyOptions(); void onResolutionChange(); private: GUI::Container mGUIContainer; GUI::OptionContainer::Ptr mOptionContainer; };
#pragma once #include <vector> #include <memory> #include <functional> #include <set> #include <list> #include <assert.h> #include <Engine/GlobalEnv.h> extern fastbird::GlobalEnv* gFBEnv; namespace fastbird { void Log(const char* szFmt, ...); void Error(const char* szFmt, ...); typedef std::vector<char> BYTE_BUFFER; // name : like Engine.dll or UI.dll etc.. // this function will append postfix. so the final name will be // Engine_Debug.dll or UI_Debug.dll in Debug build. // Engine_Release.dll or Engine_Release.dll in Release build. HMODULE LoadFBLibrary(const char* name); void FreeFBLibrary(HMODULE module); } #define ARRAYCOUNT(A) (sizeof(A) / sizeof(A[0])) #define FB_FOREACH(it, container) auto it = (container).begin();\ auto it ## End = (container).end(); \ for (; it != it ## End; ++it) #define if_assert_pass(V) assert((V)); \ if ((V)) //assert((V)); #define if_assert_fail(V) \ if (!(V)) #define ValueNotExistInVector(arr, v) (std::find(arr.begin(), arr.end(), v) == arr.end()) #define DeleteValuesInVector(arr, v) \ unsigned arr ## SizeBefore = arr.size(); \ arr.erase(std::remove(arr.begin(), arr.end(), v), arr.end()); \ unsigned arr ## SizeAfter = arr.size(); #define DeleteValuesInList(arr, v) \ unsigned arr ## SizeBefore = arr.size(); \ for (auto it = arr.begin(); it != arr.end();)\ {\ if ((*it) == v)\ {\ it = mChildren.erase(it);\ }\ else\ {\ ++it;\ }\ }\ unsigned arr ## SizeAfter = arr.size(); #if defined(_DEBUG) #define CHECK(exp) if(!(exp)) { DebugBreak(); } else {} #define VERIFY(exp) if(!(exp)) { DebugBreak(); } else {} #else #define CHECK(exp) #define VERIFY(exp) (exp) #endif template <class T> void ClearWithSwap(T& m) { T empty; std::swap(m, empty); } template <typename T> bool operator == (const std::weak_ptr<T>& a, const std::weak_ptr<T>& b) { return a.lock() == b.lock(); } template <typename T> bool operator != (const std::weak_ptr<T>& a, const std::weak_ptr<T>& b) { return !(a.lock() == b.lock()); } template <typename T> bool operator == (const std::weak_ptr<T>& a, const std::shared_ptr<T>& b) { return a.lock() == b; } template <typename T> bool operator != (const std::weak_ptr<T>& a, const std::shared_ptr<T>& b) { return !(a.lock() == b); } // not change often. #include <CommonLib/System.h> #include <CommonLib/Math/fbMath.h> #include <CommonLib/tinyxml2.h>
// // PAYErrorCodes.h // PAYFormBuilder // // Created by Simon Seyer on 10.07.14. // Copyright (c) 2014 Paij. All rights reserved. // #import <Foundation/Foundation.h> /** * Different error codes that are used to mark validation errors */ typedef enum { /** * Used to mark generic validation errors */ PAYFormDefaultErrorCode, /** * Used to mark errors indicating a missing value in a field that is marked as required */ PAYFormMissingErrorCode, /** * Used to mark errors indicating a too long value in a field that has maximum text length */ PAYFormTextFieldAboveMaxLengthErrorCode, /** * Used to mark errors indicating a too short value in a field that has minimum text length */ PAYFormTextFieldBelowMinLengthErrorCode, /** * Used to mark errors indicating a non-interger value in a field that has a integer validation block */ PAYFormIntegerValidationErrorCode } PAYFormErrorCodes; /** * Used to store the control that is not valid in the user info of the error */ extern NSString * const PAYFormErrorControlKey; /** * Error domain of the PAYFormBuilder */ extern NSString * const PAYFormErrorDomain;
#include <stdio.h> #include <errno.h> void errno_msg(char *filename) { fprintf(stderr, "Error opening file: %s\n", filename); switch (errno) { case EACCES: fprintf(stderr, "Permission denied\n"); break; case ENOENT: fprintf(stderr, "No such file\n"); break; case ENOTDIR: fprintf(stderr, "Not a directory\n"); break; default: fprintf(stderr, "Something went wrong and I don't know what\n"); } }
// // GhostEventFrameOSX.h // GhostEventFrameOSX // // Created by Eneko Alonso on 2/5/16. // Copyright © 2016 Eneko Alonso. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for GhostEventFrameOSX. FOUNDATION_EXPORT double GhostEventFrameOSXVersionNumber; //! Project version string for GhostEventFrameOSX. FOUNDATION_EXPORT const unsigned char GhostEventFrameOSXVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <GhostEventFrameOSX/PublicHeader.h>
// // NewThemeTableViewCell.h // LEEThemeDemo // // Created by 李响 on 2017/6/1. // Copyright © 2017年 lee. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, NewThemeState) { NewThemeStateDownload, NewThemeStateStart, NewThemeStateRemove }; @interface NewThemeTableViewCell : UITableViewCell @property (nonatomic , strong ) NSDictionary *info; @property (nonatomic , copy ) void (^clickBlock)(NewThemeTableViewCell * ,NewThemeState); // 检查主题状态 - (void)checkThemeState; @end
#pragma once #if PHYSX_ENABLED #include "glm\glm.hpp" #include "glm\gtx\quaternion.hpp" #include "Physics/GenericRigidBody.h" #include "Physics/PhysicsTypes.h" #include "physx\PxPhysicsAPI.h" #include "Core/Transform.h" class PhysxRigidbody : public GenericRigidBody { public: ~PhysxRigidbody(); PhysxRigidbody(EBodyType::Type type, Transform InitalPosition); CORE_API glm::vec3 GetPosition(); CORE_API glm::quat GetRotation(); void SetPositionAndRotation(glm::vec3 pos, glm::quat rot); CORE_API void AddTorque(glm::vec3); CORE_API void AddForce(glm::vec3, EForceMode::Type Mode = EForceMode::AsForce); CORE_API glm::vec3 GetLinearVelocity(); CORE_API void SetLinearVelocity(glm::vec3 velocity); void AttachCollider(Collider* col); void SetPhysicalMaterial(PhysicalMaterial* newmat); void UpdateFlagStates() override; void InitBody(); private: physx::PxRigidDynamic* Dynamicactor = nullptr; physx::PxRigidStatic* StaticActor = nullptr; physx::PxRigidActor* CommonActorPtr = nullptr; glm::vec3 PXvec3ToGLM(physx::PxVec3 val) { return glm::vec3(val.x, val.y, val.z); } glm::quat PXquatToGLM(physx::PxQuat val) { return glm::quat(val.x, val.y, val.z, val.w); } physx::PxVec3 GLMtoPXvec3(glm::vec3 val) { return physx::PxVec3(val.x, val.y, val.z); } physx::PxQuat GLMtoPXQuat(glm::quat val) { return physx::PxQuat(val.x, val.y, val.z, val.w); } std::vector<physx::PxShape*> Shapes; Transform transform; PhysicalMaterial* PhysicsMat = nullptr; physx::PxMaterial* PMaterial = nullptr; }; #endif