text
stringlengths
4
6.14k
// // AXImage.h // FilterImage // // Created by Allen on 15/12/9. // Copyright © 2015年 Allen. All rights reserved. // #import <Foundation/Foundation.h> @interface AXImage : NSObject /**< short file name without extension or @2x @3x. 去掉扩展名和@2x @3x的文件名 */ @property (nonatomic,copy ) NSString *shortName; /**< real file name.真实的文件名 */ @property (nonatomic,copy ) NSString *realName; /**< size of file. 文件大小 */ @property (nonatomic,assign) CGFloat size; /**< path of file.文件路径 */ @property (nonatomic,copy ) NSString *path; @end
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2014 Torus Knot Software Ltd 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 __SCRIPTPARSER_H_ #define __SCRIPTPARSER_H_ #include "OgreScriptLexer.h" #include "OgreScriptCompiler.h" namespace Ogre { /** \addtogroup Core * @{ */ /** \addtogroup General * @{ */ class _OgrePrivate ScriptParser : public ScriptCompilerAlloc { public: static ConcreteNodeListPtr parse(const ScriptTokenListPtr &tokens); static ConcreteNodeListPtr parseChunk(const ScriptTokenListPtr &tokens); private: static ScriptToken *getToken(ScriptTokenList::iterator i, ScriptTokenList::iterator end, int offset); static ScriptTokenList::iterator skipNewlines(ScriptTokenList::iterator i, ScriptTokenList::iterator end); }; /** @} */ /** @} */ } #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 BaseRequest, NSMutableArray, NSString, ShareTag, StatisticInfo; @interface ShareCardItemRequest : WXPBGeneratedMessage { } + (void)initialize; // Remaining properties @property(retain, nonatomic) NSString *appUserName; // @dynamic appUserName; @property(retain, nonatomic) BaseRequest *baseRequest; // @dynamic baseRequest; @property(retain, nonatomic) NSString *consumedboxCardId; // @dynamic consumedboxCardId; @property(nonatomic) unsigned int fromScene; // @dynamic fromScene; @property(nonatomic) unsigned int isShareOwncard; // @dynamic isShareOwncard; @property(retain, nonatomic) NSMutableArray *items; // @dynamic items; @property(retain, nonatomic) ShareTag *shareTag; // @dynamic shareTag; @property(retain, nonatomic) StatisticInfo *statisticInfo; // @dynamic statisticInfo; @end
#ifndef LOCATIONCHANGE_H #define LOCATIONCHANGE_H #include "Reversibles.h" #include "UndoTypes.h" class LocationChange : public ReversibleAction { public: LocationChange(u16 locationIndex, u8 field, u32 data); virtual void Reverse(void *guiMap); virtual int32_t GetType(); private: u16 locationIndex; u8 field; u32 data; }; #endif
/*** * Inferno Engine v4 2015-2017 * Written by Tomasz "Rex Dex" Jonarski * * [#filter: allocator\blocks #] ***/ #pragma once #include "base/system/include/spinLock.h" namespace base { namespace mem { /// specialized allocator of large memory pages /// all pages are allocated from internal page storage and can be recycled very fast /// in essence this is considered a "free" allcator class BASE_MEMORY_API PageAllocator : public base::NoCopy { public: /// NOTE: the page size is a compile-time stuff and we can use it to optimize calculation static const Uint32 PAGE_SIZE_FULL = 65536; static const Uint32 PAGE_SIZE_PADDING = 32; static const Uint32 PAGE_SIZE_USEFUL = PAGE_SIZE_FULL - PAGE_SIZE_PADDING; PageAllocator(const PoolID pool); PageAllocator(PageAllocator&& other); PageAllocator& operator=(PageAllocator&& other); ~PageAllocator(); //! get pool ID this page allocator is for FORCEINLINE const PoolID getPoolID() const { return m_poolID; } //! get number of pages allocated so far FORCEINLINE const Uint32 getNumPages() const { return m_numPages; } //--- //! validate heap void validate() const; //! reset the allocator, release all the pages void reset(); //! allocate single page, returns memory pointer to the page //! NOTE: the usable page size is always PAGE_SIZE void* allocatePage(); //--- // Set number of free pages that we should keep for the given pool // more than that and we start moving them to the overflow pool. // When there are more free pages in the overflow pool that required we will free them to the system. static void SetPageRetentionLimit(const PoolID id, const Uint32 maxFreePagesToKeep); private: struct Page { Page* m_prevPage; // previously allocated page Uint32 m_headerMagic; // data protection Uint8 m_data[PAGE_SIZE_USEFUL]; // page data Uint32 m_footerMagic; // data protection }; static_assert(sizeof(Page) <= PAGE_SIZE_FULL, "Page is to large"); Page* m_pages; // owned pages Uint32 m_numPages; // number of owned pages (can estimate memory usage) PoolID m_poolID; // memory pool ID we are allocating from (for tracking) threads::SpinLock m_lock; // local lock }; } // mem } // base
#import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @class FGUserDefaultsEditViewController; @protocol FGUserDefaultsEditViewControllerDelegate <NSObject> -(void)defaultsEditVC:(FGUserDefaultsEditViewController *)editVC requestedSaveOf:(id)object atKey:(id)key; @optional -(void)defaultsEditVC:(FGUserDefaultsEditViewController *)editVC requestedSaveOf:(id)object atIndex:(NSUInteger)index; - (void)defaultsEditVC:(FGUserDefaultsEditViewController *)editVC requestedSaveOf:(id)object; @end @interface FGUserDefaultsEditViewController : UITableViewController @property (nonatomic, weak) id<FGUserDefaultsEditViewControllerDelegate> delegate; - (instancetype)initWithKey:(id)key value:(id)value; - (instancetype)initWithIndex:(NSUInteger)index value:(id)value; - (instancetype)initToCreateNewKeyValuePair; - (instancetype)initToCreateNewValue; @end
// // TTCoinEntity.h // Tabletops // // Created by Jacob Hauberg Hansen on 14/05/15. // Copyright (c) 2015 Jacob Hauberg Hansen. All rights reserved. // #import "TTEntity.h" #import "TTCoinRepresentation.h" /** Provides a common implementation of a coin entity. */ @interface TTCoinEntity : TTEntity + (instancetype) coinWithFrontside: (id<NSCoding, NSObject, NSCopying>) frontside andBackside: (id<NSCoding, NSObject, NSCopying>) backside; /** Get the representation component. Can not be removed. Note that this component is only created and assigned when first used. */ @property (readonly) TTCoinRepresentation *representation; @end
// Copyright (c) 2011-2015 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once #include "Chaingen.h" /************************************************************************/ /* */ /************************************************************************/ class gen_ring_signature_1 : public test_chain_unit_base { public: gen_ring_signature_1(); bool generate(std::vector<test_event_entry>& events) const; bool check_balances_1(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events); bool check_balances_2(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events); private: CryptoNote::AccountBase m_bob_account; CryptoNote::AccountBase m_alice_account; }; /************************************************************************/ /* */ /************************************************************************/ class gen_ring_signature_2 : public test_chain_unit_base { public: gen_ring_signature_2(); bool generate(std::vector<test_event_entry>& events) const; bool check_balances_1(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events); bool check_balances_2(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events); private: CryptoNote::AccountBase m_bob_account; CryptoNote::AccountBase m_alice_account; }; /************************************************************************/ /* */ /************************************************************************/ class gen_ring_signature_big : public test_chain_unit_base { public: gen_ring_signature_big(); bool generate(std::vector<test_event_entry>& events) const; bool check_balances_1(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events); bool check_balances_2(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events); private: size_t m_test_size; uint64_t m_tx_amount; CryptoNote::AccountBase m_bob_account; CryptoNote::AccountBase m_alice_account; };
#ifndef TE_MODEL_H #define TE_MODEL_H #include <glm/glm.hpp> #include <vector> #include <memory> namespace te { class Mesh; class Shader; class Model { public: Model(const std::vector<std::shared_ptr<const Mesh>>& meshes); Model(std::vector<std::shared_ptr<const Mesh>>&& meshes); void draw(const Shader& shader, const glm::mat4& modelview) const; private: std::vector<std::shared_ptr<const Mesh>> mMeshes; }; } #endif
// Copyright (c) 2015 Kerem KAT // // 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. // // Do not hesisate to contact me about usage of the code or to make comments // about the code. Your feedback will be appreciated. // // http://dissipatedheat.com/ // http://github.com/krk/ /** \file AddressParser.h Defines the AddressParser class. */ #ifndef __ADDRESSPARSER_H__ #define __ADDRESSPARSER_H__ #include "MemoryRange.h" #include <string> #include <sstream> #include <vector> #include "IDebuggerCommandExecutor.h" #include "ILogger.h" #include "AddressCommandOutput.h" /** \class AddressParser Implements a parser for address outputs. */ class AddressCommandParser { private: const std::string _command = "!address"; IDebuggerCommandExecutor* _executor; ILogger* _logger; ::Usage GetUsage(const std::vector<std::string>& items); ::State GetState(const std::vector<std::string>& items); std::vector<const MemoryRange>* Parse(const std::string& lines); public: AddressCommandParser(IDebuggerCommandExecutor* executor, ILogger* logger) : _executor(executor), _logger(logger) { } AddressCommandOutput execute(); }; #endif // #ifndef __ADDRESSPARSER_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/TSCH3DGLVBOLoader.h> // Not exported @interface TSCH3DGLVertexAttributeVBOLoader : TSCH3DGLVBOLoader { int mLocation; struct AttributeSpecs mAttributeSpecs; } + (id)loader; + (int)attributeLocation:(id)arg1 shaderHandle:(id)arg2; - (id).cxx_construct; - (void)setClientState:(const struct DataBufferInfo *)arg1; - (void)loadSingleValueInBuffer:(id)arg1; - (void)loadSingleValue:(const float *)arg1 components:(unsigned long long)arg2; - (_Bool)activateResource:(id)arg1 location:(int)arg2 specs:(const struct AttributeSpecs *)arg3 insideSession:(id)arg4; - (unsigned long long)hash; - (_Bool)isEqual:(id)arg1; - (id)init; @end
#include<stdio.h> #include<conio.h> #include<stdlib.h> //standard library int main() { int x; int id; int money; int number; int g; int showm; printf("!!!!!!!!!!!!!!!!!!!!Welcome to Game!!!!!!!!!!!!!!!!!!!\n\n"); printf("Please enter your age:"); scanf("%d", &x); if( x > 17 ) { printf("Please Show your money:"); scanf("%d", &showm); printf("This is your money:%d\n",showm); while( x > 17 ) { printf("Please enter your id:"); scanf("%d", &id); while( id==100) { printf("Please enter your money:\n At least 1000ks:"); scanf("%d", &money); while( money > 999 ) { printf("Please enter your lucky number:"); scanf("%d", &number); if( number == 123 ) { printf("Winner\n"); showm=showm+money*2; printf("This is your remain money:%d\n",showm); printf("If you wanna play or quit,please enter 1 or 2\n"); scanf("%d", &g); if( g == 1) { printf("You can play next time\n"); }else { printf("Good Bye"); exit(0); } }else { printf("Sorry try again\n"); showm=showm-money; printf("This is your remain money:%d\n",showm); if( number != 123 ) { printf("If you want to play enter 1 or quit to 2:\n"); scanf("%d", &g); if( g == 1) { printf("You can play next time\n"); }else { printf("Sorory for quit"); exit(0); } } if( showm < 999 ) { printf("It is not enough money:%d\n",showm); printf("Thank for playing"); exit(0); } } } } } }else { printf("Now you will not play"); } getch (); return 0; }
/* This file is part of the Palabos library. * * Copyright (C) 2011-2015 FlowKit Sarl * Route d'Oron 2 * 1010 Lausanne, Switzerland * E-mail contact: contact@flowkit.com * * The most recent release of Palabos can be downloaded at * <http://www.palabos.org/> * * The library Palabos is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * The library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifdef PLB_MPI_PARALLEL #ifndef NON_LOCAL_TRANSFER_2D_3D_H #define NON_LOCAL_TRANSFER_2D_3D_H #include "core/globalDefs.h" #include "multiBlock/nonLocalTransfer2D.h" #include "multiBlock/nonLocalTransfer3D.h" #include "parallelism/parallelBlockCommunicator3D.h" #include "parallelism/sendRecvPool.h" namespace plb { /// Determine pairs of domains associated to a data transfer between domains on two blocks. /** It is assumed that the two domains have the same extent. **/ std::vector<Overlap3D> copyDomainDataTransfer ( SparseBlockStructure2D const& block1, Box2D block1Domain, SparseBlockStructure3D const& block2, Box3D block2Domain ); std::vector<Overlap3D> copyDomainDataTransfer ( SparseBlockStructure3D const& block1, Box3D block1Domain, SparseBlockStructure2D const& block2, Box2D block2Domain ); struct CommunicationStructure2D_3D { CommunicationStructure2D_3D ( std::vector<Overlap3D> const& overlaps, MultiBlockManagement2D const& originManagement, MultiBlockManagement3D const& destinationManagement, plint sizeOfCell ); CommunicationPackage3D sendPackage; CommunicationPackage3D recvPackage; CommunicationPackage3D sendRecvPackage; SendPoolCommunicator sendComm; RecvPoolCommunicator recvComm; }; struct CommunicationStructure3D_2D { CommunicationStructure3D_2D ( std::vector<Overlap3D> const& overlaps, MultiBlockManagement3D const& originManagement, MultiBlockManagement2D const& destinationManagement, plint sizeOfCell ); CommunicationPackage3D sendPackage; CommunicationPackage3D recvPackage; CommunicationPackage3D sendRecvPackage; SendPoolCommunicator sendComm; RecvPoolCommunicator recvComm; }; /// Inter-domain copy between two generic fields. /** The two blocks are not required to have same parallelization. If the two * domains have different extent, the smaller domain is taken to be the valid one * (this argument is reiterated independently in each space direction). * The two blocks must be of same kind. This condition is enforced by an assertion. **/ void copy_generic ( MultiBlock2D const& from, Box2D const& fromDomain, MultiBlock3D& to, Box3D const& toDomain, modif::ModifT typeOfModif ); void copy_generic ( MultiBlock3D const& from, Box3D const& fromDomain, MultiBlock2D& to, Box2D const& toDomain, modif::ModifT typeOfModif ); /// Inter-domain copy between two scalar-fields. /** The two blocks are not required to have same parallelization. If the two * domains have different extent, the smaller domain is taken to be the valid one * (this argument is reiterated independently in each space direction). **/ template<typename T> void copy ( MultiScalarField2D<T> const& from, Box2D const& fromDomain, MultiScalarField3D<T>& to, Box3D const& toDomain ) { copy_generic(from, fromDomain, to, toDomain, modif::staticVariables); } template<typename T> void copy ( MultiScalarField3D<T> const& from, Box3D const& fromDomain, MultiScalarField2D<T>& to, Box2D const& toDomain ) { copy_generic(from, fromDomain, to, toDomain, modif::staticVariables); } /// Inter-domain copy between two ntensor-fields. /** The two blocks are not required to have same parallelization. If the two * domains have different extent, the smaller domain is taken to be the valid one * (this argument is reiterated independently in each space direction). **/ template<typename T> void copy ( MultiNTensorField2D<T> const& from, Box2D const& fromDomain, MultiNTensorField3D<T>& to, Box3D const& toDomain ) { copy_generic(from, fromDomain, to, toDomain, modif::staticVariables); } template<typename T> void copy ( MultiNTensorField3D<T> const& from, Box3D const& fromDomain, MultiNTensorField2D<T>& to, Box2D const& toDomain ) { copy_generic(from, fromDomain, to, toDomain, modif::staticVariables); } /// Inter-domain copy between two tensor-fields. /** The two blocks are not required to have same parallelization. If the two * domains have different extent, the smaller domain is taken to be the valid one * (this argument is reiterated independently in each space direction). **/ template<typename T, int nDim> void copy ( MultiTensorField2D<T,nDim> const& from, Box2D const& fromDomain, MultiTensorField3D<T,nDim>& to, Box3D const& toDomain ) { copy_generic(from, fromDomain, to, toDomain, modif::staticVariables); } template<typename T, int nDim> void copy ( MultiTensorField3D<T,nDim> const& from, Box3D const& fromDomain, MultiTensorField2D<T,nDim>& to, Box2D const& toDomain ) { copy_generic(from, fromDomain, to, toDomain, modif::staticVariables); } } // namespace plb #endif // NON_LOCAL_TRANSFER_2D_3D_H #endif // PLB_MPI_PARALLEL
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef BT_COLLISION__DISPATCHER_H #define BT_COLLISION__DISPATCHER_H #include "btDispatcher.h" #include "btPersistentManifold.h" #include "btManifoldResult.h" #include "btBroadphaseProxy.h" #include "btAlignedObjectArray.h" class btIDebugDraw; class btOverlappingPairCache; class btPoolAllocator; class btCollisionConfiguration; #include "btCollisionCreateFunc.h" #define USE_DISPATCH_REGISTRY_ARRAY 1 class btCollisionDispatcher; ///user can override this nearcallback for collision filtering and more finegrained control over collision detection typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo); ///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs. ///Time of Impact, Closest Points and Penetration Depth. class btCollisionDispatcher : public btDispatcher { protected: int m_dispatcherFlags; btAlignedObjectArray<btPersistentManifold*> m_manifoldsPtr; btManifoldResult m_defaultManifoldResult; btNearCallback m_nearCallback; btPoolAllocator* m_collisionAlgorithmPoolAllocator; btPoolAllocator* m_persistentManifoldPoolAllocator; btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; btCollisionConfiguration* m_collisionConfiguration; public: enum DispatcherFlags { CD_STATIC_STATIC_REPORTED = 1, CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2, CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION = 4 }; int getDispatcherFlags() const { return m_dispatcherFlags; } void setDispatcherFlags(int flags) { m_dispatcherFlags = flags; } ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions void registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc); int getNumManifolds() const { return int( m_manifoldsPtr.size()); } btPersistentManifold** getInternalManifoldPointer() { return &m_manifoldsPtr[0]; } btPersistentManifold* getManifoldByIndexInternal(int index) { return m_manifoldsPtr[index]; } const btPersistentManifold* getManifoldByIndexInternal(int index) const { return m_manifoldsPtr[index]; } btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration); virtual ~btCollisionDispatcher(); virtual btPersistentManifold* getNewManifold(void* b0,void* b1); virtual void releaseManifold(btPersistentManifold* manifold); virtual void clearManifold(btPersistentManifold* manifold); btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold = 0); virtual bool needsCollision(btCollisionObject* body0,btCollisionObject* body1); virtual bool needsResponse(btCollisionObject* body0,btCollisionObject* body1); virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ; void setNearCallback(btNearCallback nearCallback) { m_nearCallback = nearCallback; } btNearCallback getNearCallback() const { return m_nearCallback; } //by default, Bullet will use this near callback static void defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo); virtual void* allocateCollisionAlgorithm(int size); virtual void freeCollisionAlgorithm(void* ptr); btCollisionConfiguration* getCollisionConfiguration() { return m_collisionConfiguration; } const btCollisionConfiguration* getCollisionConfiguration() const { return m_collisionConfiguration; } void setCollisionConfiguration(btCollisionConfiguration* config) { m_collisionConfiguration = config; } virtual btPoolAllocator* getInternalManifoldPool() { return m_persistentManifoldPoolAllocator; } virtual const btPoolAllocator* getInternalManifoldPool() const { return m_persistentManifoldPoolAllocator; } }; #endif //BT_COLLISION__DISPATCHER_H
// // game.h // Game of Life // // Created by Sergey Bogolepov on 10/22/14. // Copyright (c) 2014 Sergey Bogolepov. All rights reserved. // #ifndef __Game_of_Life__game__ #define __Game_of_Life__game__ #include <cstdlib> #include <boost/program_options.hpp> namespace po = boost::program_options; #include "game_view.h" #include "game_controller.h" #include "field_model.h" #include "file_parser.h" // Main class, entry point of the Game. class Game { public: // Running game. // argc and argv are usual console parameters. void run(int argc, char** argv); private: FieldModel model; GameView view; GameController controller; std::string output_filename = ""; std::string input_filename = ""; int iterations = -1; int _parse_arguments(int argc, char** argv); }; #endif /* defined(__Game_of_Life__game__) */
label(interp_psl_popthis); DEBUG_CMD("popthis"); context = context->parent; STEP;
// // WidgetManager.h // Amnesty Hypercube // // Created by Danny Espinoza on 3/13/07. // Copyright 2007 Mesa Dynamics, LLC. All rights reserved. // #import <Cocoa/Cocoa.h> #import "WidgetController.h" #import "BrowserController.h" #import "GalleryController.h" @interface WidgetManager : NSObject { NSString* cubeDomain; NSSound* switchSound; NSSound* clickSound; NSSound* welcomeSound; NSMutableDictionary* providers; NSMutableDictionary* coders; NSMutableDictionary* tags; BOOL usingDefaultLibrary; int updateDay; // day of last update int updateHash; // widgets served since last update BOOL isUpdating; BOOL syndicate; int preset; NSMutableArray* providersFeatured; NSMutableArray* providersHidden; NSMutableArray* providersSpoofed; NSMutableDictionary* widgets; // code library NSMutableDictionary* menus; // menu items (desktop only) NSMutableDictionary* instances; // widget controllers NSMutableArray* desktop; NSMutableArray* hypercube; NSMutableArray* hidden; NSMutableDictionary* images; // generic image library (e.g. providers) BOOL isInHypercube; BOOL isInGallery; NSMenu* widgetMenu; NSString* createTitle; BOOL createTitleCustom; NSString* createThumbnail; BOOL createThumbnailCustom; int galleryMode; NSTextField* cubeTitle; NSWindow* cube; NSWindow* gallery; NSMutableArray* cubeWindows; NSMutableArray* galleryWindows; int imageSessionCount; NSTimer* imageSessionTimer; NSMutableDictionary* imageSessions; NSMutableDictionary* sessionData; NSMutableDictionary* sessionID; // client integration char* widgetData; NSString* widgetName; } + (NSDictionary*)widgetWithCode:(id)code title:(id)title image:(id)image; + (int)markerFromCode:(NSString*)code; + (NSString*)domainFromCode:(NSString*)code; + (NSString*)identifierFromCode:(NSString*)code; - (id)initWithMenu:(NSMenu*)menu inCube:(NSString*)domain; - (WidgetController*)createWidgetController; - (BrowserController*)createBrowserController; - (BOOL)testWidgetWithCode:(NSString*)code; - (BOOL)installWidgetWithCode:(NSString*)code create:(BOOL)create force:(BOOL)force; - (BOOL)verifyCode:(NSString*)code; - (BOOL)matchCode:(NSString*)code fromDomain:(NSString*)domain andPrefix:(NSString*)prefix withTitle:(NSString*)title; - (WidgetController*)createWidget:(NSString*)code identifier:(NSString*)identifier domain:(NSString*)domain; - (BOOL)addWidget:(NSString*)code title:(NSString*)title image:(NSImage*)image identifier:(NSString*)identifier; - (void)addMenuItem:(NSString*)identifier title:(NSString*)title image:(NSImage*)image; - (void)menuItemAction:(id)sender; - (void)writeToPath:(NSString*)path; - (void)readFromPath:(NSString*)path andCreate:(BOOL)create; - (void)readFromNet; - (void)writeDomain:(NSString*)domain; - (void)readDomain:(NSString*)domain; - (void)hideWidgets; - (void)showWidgets:(BOOL)all; - (BOOL)isInHypercube; - (BOOL)isInGallery; - (void)setPreset:(id)sender; // called by WidgetController - (void)loadWidget:(NSString*)identifier; - (void)closeWidget:(NSString*)identifier; - (void)removeWidget:(NSString*)identifier; - (void)forgetWidget:(NSString*)identifier inDomain:(NSString*)domain; - (NSString*)infoForWidget:(NSString*)identifier key:(NSString*)key; - (void)setInfoForWidget:(NSString*)identifier key:(NSString*)key object:(id)object; - (void)addToDashboard:(NSString*)code identifier:(NSString*)identifier dashboard:(NSString*)dashboardID width:(int)width height:(int)height; - (void)addToDesktop:(NSString*)identifier; - (void)addToHypercube:(NSString*)identifier; - (void)removeFromDesktop:(NSString*)identifier; - (void)removeFromHypercube:(NSString*)identifier; - (void)openCube; - (void)closeCube; - (NSArray*)filteredProviders; - (void)setupGallery:(int)mode; - (void)openGallery:(id)sender; - (void)setupGalleryLibrary; - (void)galleryLibraryAction:(id)sender; - (void)setupGalleryCubes; - (void)galleryCubeAction:(id)sender; - (void)setupGalleryProviders; - (void)galleryProviderAction:(id)sender; - (void)resetProviders; - (void)closeGallery; // //- (NSImage*)getDesktopImage; - (void)loadLibrary; - (void)updateLibrary:(id)sender; - (void)parseLibrary:(NSString*)xml; - (void)parseWidgets:(NSString*)xml; - (void)buildDefaultLibrary; - (int)getWidgetVersion; - (void)pollImageSessions:(id)sender; @end
// // KFChatViewModel.h // Pods // // Created by admin on 16/10/20. // // #import <Foundation/Foundation.h> #if __has_include("KFDispatcher.h") #import "KFDispatcher.h" #else #import <KF5SDKCore/KFDispatcher.h> #endif @class KFChatViewModel; @class KFMessageModel; @class KFAgent; typedef NS_ENUM(NSInteger,KFChatRatingScore) { KFChatRatingScoreNone = -1, // 未评价 KFChatRatingScoreBad = 0, // 不满意 KFChatRatingScoreSoso = 2, // 不太满意 KFChatRatingScoreOk = 3, // 一般 KFChatRatingScoreGood = 4, // 基本满意 KFChatRatingScoreGreat = 1 // 满意 }; @protocol KFChatViewModelDelegate <NSObject> /**连接服务器失败*/ - (void)chat:(nonnull KFChatViewModel *)chat connectError:(nullable NSError *)error; /**排队人数变化*/ - (void)chat:(nonnull KFChatViewModel *)chat queueIndexChange:(NSInteger)queueIndex; /**排队失败*/ - (void)chat:(nonnull KFChatViewModel *)chat queueError:(nullable NSError *)error; /** 状态改变*/ - (void)chat:(nonnull KFChatViewModel *)chat statusChange:(KFChatStatus)status; /** 客服发起满意度评价请求*/ - (void)chatWithAgentRating:(nonnull KFChatViewModel *)chat; /**对话被客服关闭*/ - (void)chatWithEndChat:(nonnull KFChatViewModel *)chat; /**刷新数据*/ - (void)chat:(nonnull KFChatViewModel *)chat addMessageModels:(nullable NSArray <KFMessageModel *>*)messageModels; /**更新数据*/ - (void)chat:(nonnull KFChatViewModel *)chat reloadMessageModels:(nullable NSArray <KFMessageModel *>*)messageModels; /**获取要选择的客服组模型*/ - (void)chat:(nonnull KFChatViewModel *)chat selectQuestionWithOptions:(nonnull NSArray <NSDictionary*>*)options selectBlock:(void (^_Nullable)(NSNumber* _Nullable questionKey, BOOL cancel))selectBlock; @end @interface KFChatViewModel : NSObject @property (nullable, nonatomic, weak) id<KFChatViewModelDelegate> delegate; /** IM自定义字段 */ @property (nullable, nonatomic, strong) NSArray <NSDictionary *>*metadata; /** 聊天状态 */ @property (nonatomic, assign, readonly) KFChatStatus chatStatus; /** 当前的客服 */ @property (nullable, nonatomic, weak, readonly) KFAgent *currentAgent; /** 当未开启机器人时,设置是否发送一条消息后,再分配客服(用于过滤无效的空对话),默认NO */ @property (nonatomic, assign) BOOL assignAgentWhenSendedMessage; /** 问题分配的id,用于在关闭问题分配后,不走问题分配选择逻辑,直接通过questionId自动分配 */ @property (nonatomic, assign) NSInteger questionId; /** 是否能发送消息 */ - (BOOL)canSendMessageWithCompletion:(nullable void (^)(void))completion; /** 连接服务器 */ - (void)configChatWithCompletion:(nullable void (^)(NSError *_Nullable))completion; /** 断开连接 */ - (void)disconnect; /** 发送满意度评价 @param rating 满意度分数 */ - (void)sendRating:(NSInteger)rating completion:(nullable void (^)(NSError * _Nullable error))completion; /** 发送消息 @param messageType 消息格式,文本,图片,语音,视频 @param data NSString,UIImage,NSURL,NSURL */ - (void)sendMessageWithMessageType:(KFMessageType)messageType data:(nonnull id)data; /** 获取问题的答案 @param Id id @param title 问题的标题 @param isCategory 如果是YES,id为问题分类的id;如果是NO,id为问题的id */ - (void)getAnswerWithId:(NSInteger)Id title:(nonnull NSString *)title isCategory:(BOOL)isCategory; /** 重发消息 */ - (void)resendMessageModel:(nullable KFMessageModel *)messageModel; /** 加入排队 */ - (void)queueUpWithCompletion:(nullable void (^)(NSError *_Nullable))completion; /** 取消排队 */ - (void)cancleWithCompletion:(nullable void (^)( NSError * _Nullable ))completion; /** 从数据库中获取新数据 */ - (nonnull NSArray<KFMessageModel *> *)queryMessageModelsWithLimit:(NSInteger)limit; /** 获取要显示的满意度 */ - (nonnull NSArray <NSNumber *> *)rateLevelArray; /** 满意度字符串 */ + (nullable NSString *)stringForRatingScore:(KFChatRatingScore)ratingScore; /** 获取聊天消息未读数 */ + (void)getUnReadMessageCountWithCompletion:(nullable void (^)(NSInteger unReadMessageCount, NSError * _Nullable error))completion; @end
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #include <stdio.h> #include <tchar.h> #include <iostream> // TODO: reference additional headers your program requires here
// // XScrollItemsByCategory.h // XScrollExample // // Created by Agus Soedibjo on 07/10/2014. // Copyright (c) 2014 Agus Soedibjo. 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. #import <Foundation/Foundation.h> @interface XScrollItemsByCategory : NSObject @property (strong, nonatomic) NSString *category; @property (strong, nonatomic) NSArray *xScrollItems; @end
#import <Foundation/Foundation.h> #import "OAIObject.h" /** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * The version of the OpenAPI document: 1.1.2-pre.0 * Contact: blah@cliffano.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ #import "OAIQueueBlockedItem.h" @protocol OAIQueueBlockedItem; @class OAIQueueBlockedItem; @protocol OAIQueue @end @interface OAIQueue : OAIObject @property(nonatomic) NSString* _class; @property(nonatomic) NSArray<OAIQueueBlockedItem>* items; @end
// PARAM: --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set ana.activated[+] "'region'" --set exp.region-offsets true extern int __VERIFIER_nondet_int(); extern void abort(void); void assume_abort_if_not(int cond) { if(!cond) {abort();} } #include<pthread.h> #include<stdlib.h> #include<stdio.h> struct s { int datum; struct s *next; }; struct s *new(int x) { struct s *p = malloc(sizeof(struct s)); p->datum = x; p->next = NULL; return p; } void list_add(struct s *node, struct s *list) { struct s *temp = list->next; list->next = node; node->next = temp; } pthread_mutex_t mutex[10]; struct s *slot[10]; void *t_fun(void *arg) { int i = __VERIFIER_nondet_int(); assume_abort_if_not(0 <= i && i < 9); pthread_mutex_lock(&mutex[i+1]); list_add(new(3), slot[i]); pthread_mutex_unlock(&mutex[i+1]); return NULL; } int main () { for (int i = 0; i < 10; i++) pthread_mutex_init(&mutex[i], NULL); int j = __VERIFIER_nondet_int(); assume_abort_if_not(0 <= j && j < 10); struct s *p; pthread_t t1; slot[j] = new(1); list_add(new(2), slot[j]); pthread_create(&t1, NULL, t_fun, NULL); pthread_mutex_lock(&mutex[j]); p = slot[j]->next; // RACE! printf("%d\n", p->datum); pthread_mutex_unlock(&mutex[j]); return 0; }
/////////////////////////////////////////////////////////////////////////////// // // // (C) Copyright 2005 by Autodesk, Inc. All rights reserved. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // /////////////////////////////////////////////////////////////////////////////// #ifndef ATILDEFS_H #include "AtilDefs.h" #endif #ifndef FORMATCODECPROPERTYINTERFACE_H #include "FormatCodecPropertyInterface.h" #endif #ifndef FORMATCODECBOOLEANPROPERTY_H #define FORMATCODECBOOLEANPROPERTY_H namespace Atil { class FormatCodecBooleanProperty : public FormatCodecPropertyInterface { public: FormatCodecBooleanProperty (bool mbDefault); virtual ~FormatCodecBooleanProperty (); virtual FormatCodecPropertyInterface* clone () const; bool getDefaultValue (bool& bDefault) const; void setValue (bool bState); void getValue (bool& bState) const; protected: bool mbDefault; bool mbValue; }; } // end of namespace Atil #endif
#include <stdlib.h> int* Mergesort(int n,int (*CFun)(int,int)); void Mergesortd(int p,int q,int (*CFun)(int,int),int *order,int *t); void Merge(int p,int m,int q,int (*CFun)(int,int),int *order,int *t); int CFun(int x,int y); /******* ******* ******* *p=Mergesort(n,x); x[1-n] don't forget to free *p use int CFun(int x,int y); ******* ******* *******/ int* Mergesort(int n,int (*CFun)(int,int)) { int a; int *order=(int*)malloc((n+1)*sizeof(int)); int *t=(int*)malloc(n*sizeof(int)); for(a=1;a<=n;a++) order[a]=a; Mergesortd(1,n,CFun,order,t); free(t); return order; } void Mergesortd(int p,int q,int (*CFun)(int,int),int *order,int *t) { int m; m=(p+q)/2; if(p<m)Mergesortd(p,m,CFun,order,t); if(m+1<q)Mergesortd(m+1,q,CFun,order,t); Merge(p,m,q,CFun,order,t); } void Merge(int p,int m,int q,int (*CFun)(int,int),int *order,int *t) { int k,i=p,j=m+1; for(k=0;k<q-p+1;k++) if(j>q || i<=m && CFun(order[i],order[j])<=0) t[k]=order[i++]; else t[k]=order[j++]; for(k=0;k<q-p+1;k++) order[p+k]=t[k]; } int CFun(int x,int y) { if(x>y) return 1;/*right is front*/ else if(x==y) return 0;/*left is front*/ else return -1;/*left is front*/ }
#ifndef Magnum_Text_Text_h #define Magnum_Text_Text_h /* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš <mosra@centrum.cz> 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. */ /** @file * @brief Forward declarations for @ref Magnum::Text namespace */ #include "Magnum/Types.h" #include "Magnum/configure.h" namespace Magnum { namespace Text { #ifndef DOXYGEN_GENERATING_OUTPUT class AbstractFont; class AbstractFontConverter; class AbstractLayouter; class DistanceFieldGlyphCache; class GlyphCache; enum class Alignment: UnsignedByte; class AbstractRenderer; template<UnsignedInt> class Renderer; typedef Renderer<2> Renderer2D; typedef Renderer<3> Renderer3D; #endif }} #endif
// // FoodPlace.h // feverestival2015 // // Created by Ricardo Nunes de Miranda on 29/01/15. // Copyright (c) 2015 Ricardo Nunes de Miranda. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @interface FoodPlace : NSManagedObject @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSString * address; @property (nonatomic, retain) NSString * phone; @property (nonatomic, retain) NSString * site; @end
// // SoftlightCommand.h // hc // // Created by Rob Warner on 3/3/15. // Copyright (c) 2015 Rob Warner. All rights reserved. // #import <Foundation/Foundation.h> #import "Command.h" @interface SoftlightCommand : NSObject <Command> @end
//////////////////////////////////////////////////////////////////////////// /// /// WraithOne tech Engine /// /// https://github.com/WraithOne/WOtech /// by https://twitter.com/WraithOne /// /// File: DeferredRenderer.h /// /// Description: /// /// Created: 07.05.2014 /// Edited: 18.02.2018 /// //////////////////////////////////////////////////////////////////////////// #ifndef WO_DEFERREDRENDERER_H #define WO_DEFERREDRENDERER_H ////////////// // INCLUDES // ////////////// #include <pch.h> #include <IRenderer.h> #include <3DComponents.h> #include <DeviceDX11.h> #include <RenderCommand.h> namespace WOtech { ref class DeferredRenderer sealed : IRenderer { public: DeferredRenderer(_In_ DeviceDX11^ device); virtual void Begin(); virtual void Submit(_In_ Mesh^ mesh, _In_ Camera^ camera); virtual void Submit(); virtual void End(); virtual void Present(); virtual DeviceDX11^ getDeviceDX11(); virtual void Init(_In_ Windows::UI::Color clearColor); private: DeviceDX11^ m_device; Platform::Boolean m_beginRender; // Render command queue CommandQueue m_CommandQueue; // ClearColor Windows::UI::Color m_clearColor; }; } #endif
#ifndef __TYPES_H #define __TYPES_H #include <stdlib.h> #include <stdbool.h> #include <stdint.h> enum t_type { Int, Float, Char, String, Bool, List, Exception, Function, FunctionReference, Symbol}; struct atom; struct function; typedef struct { struct atom* head; struct atom* tail; } list_t; typedef union { int i; char c; char* s; double f; bool b; list_t* l; struct function* function; } generic_value_t; typedef struct { generic_value_t value; enum t_type type; } generic_t; typedef struct { generic_t* value; int line_num; int id; } object_t; struct function { // store if the function is C code or zapper code bool native; // if it's C code, the function pointer is stored here object_t* (*pointer)(list_t* args); // if it's zapper code, the body and arguments are stored here list_t* body; list_t* args; // both C and zapper code use these char* name; int params; char* namespace; }; struct atom { object_t* value; struct atom* next; }; struct function* newFunction(object_t* (*pointer)(), char* name, int params); struct function* newZFunction(char* name, list_t* args, list_t* body, int params); #endif
#ifndef OBJECTITEM_H #define OBJECTITEM_H #include "common.h" namespace DB { class ObjectItem : public QStandardItem, public EventListener<ObjectImageChange>, public EventBroadcaster<ObjectItemChange> { static QStringList s_filenames; QString m_filename; public: QList<ObjectView*> views; QList<ObjectImage*> images; ObjectItem(const QString & name); ObjectItem(const QJsonObject & obj); QJsonObject toJsonObject(); virtual ~ObjectItem(); int addImage(ObjectImage * image); QString imagePath(int index); bool rename(QString newName); bool clean(bool force = false); bool isUsed(); bool _canRename(QString newName); void _rename(QString newName); void _renameFiles(QString newFilename); QString _getNewFilename(QString newName); void update(); void event(ObjectImageChange & event); }; } #endif // OBJECTITEM_H
#pragma once #include "receiver.h" #include "controller.h" #include "packets.h" #include <functional> // #include "progressinfo.h" namespace TMY { class Receiver { friend class Controller; private: int fd; std::string session; public: int waitDirInfo(DirInfo&); int sendPull(const PullReq&); int waitPush(PushReq&); ~Receiver(); }; typedef std::shared_ptr<Receiver> Receiver_ptr; }
/* * Copyright (C) 2011 Andes Technology Corporation * Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com> * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com> * * SPDX-License-Identifier: GPL-2.0+ */ #include <asm/mach-types.h> #include <common.h> #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH) #include <netdev.h> #endif #include <linux/io.h> #include <faraday/ftsmc020.h> DECLARE_GLOBAL_DATA_PTR; /* * Miscellaneous platform dependent initializations */ int board_init(void) { /* * refer to BOOT_PARAMETER_PA_BASE within * "linux/arch/nds32/include/asm/misc_spec.h" */ printf("Board: %s\n" , CONFIG_SYS_BOARD); gd->bd->bi_arch_number = MACH_TYPE_ADPAE3XX; gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400; return 0; } int dram_init(void) { unsigned long sdram_base = PHYS_SDRAM_0; unsigned long expected_size = PHYS_SDRAM_0_SIZE + PHYS_SDRAM_1_SIZE; unsigned long actual_size; actual_size = get_ram_size((void *)sdram_base, expected_size); gd->ram_size = actual_size; if (expected_size != actual_size) { printf("Warning: Only %lu of %lu MiB SDRAM is working\n", actual_size >> 20, expected_size >> 20); } return 0; } int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_0; gd->bd->bi_dram[0].size = PHYS_SDRAM_0_SIZE; gd->bd->bi_dram[1].start = PHYS_SDRAM_1; gd->bd->bi_dram[1].size = PHYS_SDRAM_1_SIZE; return 0; } #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH) int board_eth_init(bd_t *bd) { return ftmac100_initialize(bd); } #endif ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info) { if (banknum == 0) { /* non-CFI boot flash */ info->portwidth = FLASH_CFI_8BIT; info->chipwidth = FLASH_CFI_BY8; info->interface = FLASH_CFI_X8; return 1; } else { return 0; } }
/** * Pointer arithmetic * C supplies 3 ops: * 1. Adding an int to a pointer * 2. Subtracting an int from a pointer * 3. Substracting one pointer from another (of the same type) -> tells how many integers there are inbetween */
/* * The MIT License (MIT) * * Copyright (c) 2014 Duane Wessels and The Measurement Factory, Inc. * * 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. */ typedef struct _hashitem { const void *key; void *data; struct _hashitem *next; } hashitem; typedef unsigned int hashfunc(const void *key); typedef int hashkeycmp(const void *a, const void *b); typedef void hashfree(void *); typedef struct { unsigned int modulus; hashitem **items; hashfunc *hasher; hashkeycmp *keycmp; hashfree *datafree; struct { hashitem *next; unsigned int slot; } iter; unsigned int cnt; } hashtbl; hashtbl *hash_create(int N, hashfunc *, hashkeycmp *, hashfree *); int hash_add(const void *key, void *data, hashtbl *); void hash_remove(const void *key, hashtbl * tbl); void *hash_find(const void *key, hashtbl *); void hash_iter_init(hashtbl *); void *hash_iterate(hashtbl *); unsigned int hash_count(hashtbl *); void hash_free(hashtbl *); void hash_destroy(hashtbl *); void hash_analyze(hashtbl *); extern unsigned int SuperFastHash (const char * data, int len);
// // UIViewController+ActivityIndicator.h // TDevUtils // // Created by Thomas Dias on 10/26/15. // Copyright © 2015 Thomas Delgado. All rights reserved. // #import <UIKit/UIKit.h> @interface UIViewController (ActivityIndicator) /** Category that allows add convinient UIActivityIndicator on navigation bar */ -(void) startActivity; -(void) stopActivity; -(void) removeActivity; @end
// Fried.h : PROJECT_NAME ÀÀ¿ë ÇÁ·Î±×·¥¿¡ ´ëÇÑ ÁÖ Çì´õ ÆÄÀÏÀÔ´Ï´Ù. // #pragma once #ifndef __AFXWIN_H__ #error "PCH¿¡ ´ëÇØ ÀÌ ÆÄÀÏÀ» Æ÷ÇÔÇϱâ Àü¿¡ 'stdafx.h'¸¦ Æ÷ÇÔÇÕ´Ï´Ù." #endif #include "resource.h" // ÁÖ ±âÈ£ÀÔ´Ï´Ù. // CFriedApp: // ÀÌ Å¬·¡½ºÀÇ ±¸Çö¿¡ ´ëÇØ¼­´Â Fried.MFC.cppÀ» ÂüÁ¶ÇϽʽÿÀ. // class CFriedApp : public CWinApp { public: CFriedApp(); // ÀçÁ¤ÀÇÀÔ´Ï´Ù. public: virtual BOOL InitInstance(); // ±¸ÇöÀÔ´Ï´Ù. DECLARE_MESSAGE_MAP() }; extern CFriedApp theApp;
#pragma once #include <glbinding/glbinding_api.h> #include <glbinding/gl/nogl.h> #include <glbinding/gl/extension.h> #include <glbinding/gl/types.h> #include <glbinding/gl/boolean.h> #include <glbinding/gl/bitfield40ext.h> #include <glbinding/gl/enum40ext.h> #include <glbinding/gl/functions40ext.h>
#ifndef __ML_ATOMIC_GUARD_H #define __ML_ATOMIC_GUARD_H class MLAtomicGuard { public: MLAtomicGuard(bool val) :_lock(QReadWriteLock::Recursive),_guard(val) {} ~MLAtomicGuard() {} MLAtomicGuard& operator=(bool v) { QWriteLocker locker(&_lock); _guard = v; return *this; } bool operator==(bool v) const { QReadLocker locker(&_lock); return (_guard == v); } bool operator!=(bool v) const { QReadLocker locker(&_lock); return (_guard != v); } private: bool _guard; mutable QReadWriteLock _lock; }; #endif
// // Created by dpostigo on 9/20/12. // // To change the template use AppCode | Preferences | File Templates. // #import <Foundation/Foundation.h> #import "BasicDelegater.h" @interface BasicModel : BasicDelegater { NSDictionary *payload; } @property(nonatomic, strong) NSDictionary *payload; - (void) saveWithKeys: (NSArray *) keys; - (void) dearchivePayload; - (NSDictionary *) dearchivedPayload; + (BasicModel *) sharedBasicModel; - (NSString *) pathForSearchPath: (NSSearchPathDirectory) searchPath; - (NSString *) cacheDirectoryPath; - (NSString *) userDocumentsPath; - (void) modelDidDearchive; @end
/* * Copyright (c) 2013 Joe Kopena <tjkopena@gmail.com> * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <setjmp.h> #include <stdarg.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include "cmocka.h" #include "tj_searchpathlist.h" static const int MAX_PATH_LEN = 256; static void setup(void **state) { tj_searchpathlist *s = tj_searchpathlist_create(); assert_non_null(s); *state = (void*)s; } static void teardown(void **state) { tj_searchpathlist *s = *state; if (s != NULL) { tj_searchpathlist_finalize(s); } } static void test_empty(void **state) { tj_searchpathlist *s = *state; char result[MAX_PATH_LEN]; memset(result, 0, MAX_PATH_LEN); assert_false(tj_searchpathlist_locate(s, "EMPTY", result, MAX_PATH_LEN)); assert_string_equal(result, ""); } static void test_relative1(void **state) { tj_searchpathlist *s = *state; char result[MAX_PATH_LEN]; memset(result, 0, MAX_PATH_LEN); assert_true(tj_searchpathlist_add(s, ".")); assert_true(tj_searchpathlist_locate(s, "README.md", result, MAX_PATH_LEN)); assert_string_equal(result, "./README.md"); } static void test_relative2(void **state) { tj_searchpathlist *s = *state; char result[MAX_PATH_LEN]; memset(result, 0, MAX_PATH_LEN); assert_true(tj_searchpathlist_add(s, ".")); assert_true(tj_searchpathlist_add(s, "src")); assert_true(tj_searchpathlist_locate(s, "README.md", result, MAX_PATH_LEN)); assert_string_equal(result, "./README.md"); } static void test_relative3(void **state) { tj_searchpathlist *s = *state; char result[MAX_PATH_LEN]; memset(result, 0, MAX_PATH_LEN); assert_true(tj_searchpathlist_add(s, "src")); assert_true(tj_searchpathlist_add(s, ".")); assert_true(tj_searchpathlist_locate(s, "README.md", result, MAX_PATH_LEN)); assert_string_equal(result, "./README.md"); } static void test_relative4(void **state) { tj_searchpathlist *s = *state; char result[MAX_PATH_LEN]; memset(result, 0, MAX_PATH_LEN); assert_true(tj_searchpathlist_add(s, ".")); assert_true(tj_searchpathlist_add(s, "src")); assert_true(tj_searchpathlist_locate(s, "tj_searchpathlist.c", result, MAX_PATH_LEN)); assert_string_equal(result, "src/tj_searchpathlist.c"); } static void test_relative5(void **state) { tj_searchpathlist *s = *state; char result[MAX_PATH_LEN]; memset(result, 0, MAX_PATH_LEN); assert_true(tj_searchpathlist_add(s, "src")); assert_true(tj_searchpathlist_add(s, ".")); assert_true(tj_searchpathlist_locate(s, "tj_searchpathlist.c", result, MAX_PATH_LEN)); assert_string_equal(result, "src/tj_searchpathlist.c"); } int main(int argc, char *argv[]) { const UnitTest tests[] = { unit_test_setup_teardown(test_empty, setup, teardown), unit_test_setup_teardown(test_relative1, setup, teardown), unit_test_setup_teardown(test_relative2, setup, teardown), unit_test_setup_teardown(test_relative3, setup, teardown), unit_test_setup_teardown(test_relative4, setup, teardown), unit_test_setup_teardown(test_relative5, setup, teardown), }; return run_tests(tests); }
/**************************************************************************** * net/net_sockets.c * * Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #ifdef CONFIG_NET #include <debug.h> #include <nuttx/net/iob.h> #include <nuttx/net/net.h> #include "socket/socket.h" #include "devif/devif.h" #include "netdev/netdev.h" #include "arp/arp.h" #include "neighbor/neighbor.h" #include "tcp/tcp.h" #include "udp/udp.h" #include "pkt/pkt.h" #include "igmp/igmp.h" #include "route/route.h" #include "utils/utils.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** * Public Types ****************************************************************************/ /**************************************************************************** * Private Variables ****************************************************************************/ /**************************************************************************** * Private Variables ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: net_initialize * * Description: * This is called from the OS initialization logic at power-up reset in * order to configure the networking subsystem. * * Input Parameters: * None * * Returned Value: * None * ****************************************************************************/ void net_initialize(void) { /* Initialize the locking facility */ net_lockinitialize(); /* Clear the ARP table */ arp_reset(); #ifdef CONFIG_NET_IPv6 /* Initialize the Neighbor Table */ neighbor_initialize(); #endif #ifdef CONFIG_NET_IOB /* Initialize I/O buffering */ iob_initialize(); #endif /* Initialize the device interface layer */ devif_initialize(); #ifdef CONFIG_NET_PKT /* Initialize packet socket support */ pkt_initialize(); #endif #ifdef CONFIG_NET_TCP /* Initialize the listening port structures */ tcp_listen_initialize(); /* Initialize the TCP/IP connection structures */ tcp_initialize(); /* Initialize the TCP/IP write buffering */ #ifdef CONFIG_NET_TCP_WRITE_BUFFERS tcp_wrbuffer_initialize(); #endif #endif /* CONFIG_NET_TCP */ #ifdef CONFIG_NET_UDP /* Initialize the UDP connection structures */ udp_initialize(); #endif #ifdef CONFIG_NET_IGMP /* Initialize IGMP support */ igmp_initialize(); #endif #ifdef CONFIG_NET_ROUTE /* Initialize the routing table */ net_initroute(); #endif #if CONFIG_NSOCKET_DESCRIPTORS > 0 /* Initialize the socket layer */ netdev_seminit(); #endif /* Initialize the periodic ARP timer */ arp_timer_initialize(); } #endif /* CONFIG_NET */
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @interface VCODEC2ImageCom : NSObject { } + (id)constructImg:(void *)arg1 width:(int)arg2 height:(int)arg3; + (unsigned long long)decodeVCODEC2ImageFile:(id)arg1 toUIImage:(id *)arg2 toJPGQuality:(int *)arg3; + (id)decodeVCODEC2ImageFile:(id)arg1; + (unsigned long long)decodeVCODEC2ImageFile:(id)arg1 toUIImage:(id *)arg2; + (unsigned long long)encodeJPG:(id)arg1 toVCODEC2Data:(id *)arg2 qp:(int *)arg3; @end
// // PLRError.h // PaylerSDK // // Created by Максим Павлов on 13.01.15. // Copyright (c) 2015 Polonium Arts. All rights reserved. // NS_ASSUME_NONNULL_BEGIN /** * Актуальные коды ошибок можно посмотреть здесь: http://payler.com/docs/acquiring.html#acquiring_docs */ extern NSString *const PaylerErrorDomain; extern NSInteger const PaylerErrorInvalidServerResponse; NS_ASSUME_NONNULL_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 "NSLayoutManager.h" #import "DVTFoldingManagerDelegate-Protocol.h" @class DVTFoldingManager, DVTTextFoldInlineTokenAttachmentCell, NSCell; @interface DVTFoldingLayoutManager : NSLayoutManager <DVTFoldingManagerDelegate> { DVTFoldingManager *_foldingManager; NSCell *_blockFoldCell; DVTTextFoldInlineTokenAttachmentCell *_inlineFoldCell; } + (id)layoutLogAspect; @property(copy) DVTTextFoldInlineTokenAttachmentCell *inlineFoldCell; // @synthesize inlineFoldCell=_inlineFoldCell; @property(copy) NSCell *blockFoldCell; // @synthesize blockFoldCell=_blockFoldCell; @property(readonly) DVTFoldingManager *foldingManager; // @synthesize foldingManager=_foldingManager; - (void).cxx_destruct; - (unsigned long long)characterIndexForPoint:(struct CGPoint)arg1 inTextContainer:(id)arg2 fractionOfDistanceBetweenInsertionPoints:(double *)arg3; - (id)foldCellAtCharacterIndex:(unsigned long long)arg1; - (struct CGSize)attachmentSizeForGlyphAtIndex:(unsigned long long)arg1; - (void)drawGlyphsForGlyphRange:(struct _NSRange)arg1 atPoint:(struct CGPoint)arg2; - (void)foldingManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; - (void)foldingManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; - (void)_invalidateGlyphsInCharacterRange:(struct _NSRange)arg1; - (struct _NSRange)_paragraphExtendedCharacterRange:(struct _NSRange)arg1; - (void)textStorage:(id)arg1 edited:(unsigned long long)arg2 range:(struct _NSRange)arg3 changeInLength:(long long)arg4 invalidatedRange:(struct _NSRange)arg5; - (void)_invalidateGlyphsForExtendedCharacterRange:(struct _NSRange)arg1 changeInLength:(long long)arg2 includeBlocks:(BOOL)arg3; - (struct _NSRange)_extendedCharRangeForInvalidation:(struct _NSRange)arg1 editedCharRange:(struct _NSRange)arg2; - (void)generateInlineFoldsForCharacterRange:(struct _NSRange)arg1; - (struct _NSRange)paragraphRangeForLineRange:(struct _NSRange)arg1; - (struct CGSize)layoutSizeForFoldAtCharacterIndex:(unsigned long long)arg1; - (BOOL)foldsAreValid:(id)arg1; - (void)setTextStorage:(id)arg1; - (void)enableTextFolding:(BOOL)arg1; - (id)textStorage; @end
/* Copyright (c) 2014 Martin Peres Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <sys/socket.h> #include <stdio.h> #include <sys/un.h> #include <unistd.h> #include "unix_socket.h" int unix_socket_server_create(const char *path) { struct sockaddr_un addr; int fd; if ( (fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket error"); return -1; } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, path, sizeof(addr.sun_path)-1); unlink(path); if (bind(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) { perror("bind error"); return -1; } if (listen(fd, 5) == -1) { perror("listen error"); return -1; } return fd; } int unix_socket_server_accept(int fd) { int client_fd; if ( (client_fd = accept(fd, NULL, NULL)) == -1) { perror("accept error"); return -1; } return client_fd; } int unix_socket_client_connect(const char *path) { struct sockaddr_un addr; int fd; if ( (fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket error"); return -1; } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, path, sizeof(addr.sun_path)-1); if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) { perror("connect error"); return -1; } return fd; }
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: (null) */ #import "SurvivalBaseDao.h" __attribute__((visibility("hidden"))) @interface DAO_db_survival_Units : SurvivalBaseDao { } - (void)Encryption; - (void)ExecuteQueryNoResult:(id)result; - (int)countWithQuery:(id)query; - (BOOL)deleteAt:(int)at; - (void)eraseTable; - (void)insertRow:(id)row; - (id)select; - (id)selectAt:(int)at; - (id)selectWithQuery:(id)query; - (id)setTable:(id)table; - (id)setTable:(id)table Query:(id)query; - (BOOL)updateAt:(id)at; @end
#include <stddef.h> #include <string.h> #include "opencl.h" #include "quadrature.h" // quadrature rules #include "quad/point.h" #include "quad/sub2.h" #include "quad/sub4.h" #include "quad/gm75.h" #include "quad/g3k7.h" #include "quad/g5k11.h" #include "quad/g7k15.h" // macro to quickly add a rule #define ADD_RULE(x, n, s) \ { n, s, QUAD_##x##_N, QUAD_##x##_PTS, QUAD_##x##_WHT, QUAD_##x##_ERR } // list of known rules const quad_rule_data QUAD_RULES[] = { ADD_RULE(POINT, "point", "single point sampling without error estimate"), ADD_RULE(SUB2, "sub2", "2x2 subsampling without error estimate" ), ADD_RULE(SUB4, "sub4", "4x4 subsampling without error estimate" ), ADD_RULE(GM75, "gm75", "Genz-Malik (7, 5) fully symmetric rule" ), ADD_RULE(G3K7, "g3k7", "Gauß-Kronrod (7, 3) Cartesian rule" ), ADD_RULE(G5K11, "g5k11", "Gauß-Kronrod (11, 5) Cartesian rule" ), ADD_RULE(G7K15, "g7k15", "Gauß-Kronrod (15, 7) Cartesian rule" ), {0} }; void quad_rule(int r, cl_float2 xx[], cl_float2 ww[], double sx, double sy) { const quad_rule_data* rd = QUAD_RULES + r; for(size_t i = 0; i < rd->size; ++i) { xx[i].s[0] = sx*rd->absc[i][0]; xx[i].s[1] = sy*rd->absc[i][1]; ww[i].s[0] = rd->weig[i]; ww[i].s[1] = rd->errw[i]; } }
// // AliPayManager.h // TomatoDemo // // Created by 冯洪建 on 15/8/18. // Copyright (c) 2015年 hongjian feng. All rights reserved. // #import <Foundation/Foundation.h> #import "PartnerConfig.h" #import "DataSigner.h" #import "TomatoSingleton.h" #import "ProductModel.h" @interface AliPayManager : NSObject TomatoSingletonH(AliPayManager) @property (strong, nonatomic) ProductModel *product; - (void)pay:(ProductModel *)product; @end
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/tball/tmp/j2objc/testing/mockito/build_result/java/org/mockito/internal/configuration/injection/filter/FinalMockCandidateFilter.java // #ifndef _OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter_H_ #define _OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter_H_ #include "J2ObjC_header.h" #include "org/mockito/internal/configuration/injection/filter/MockCandidateFilter.h" @class JavaLangReflectField; @protocol JavaUtilCollection; @protocol OrgMockitoInternalConfigurationInjectionFilterOngoingInjecter; @interface OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter : NSObject < OrgMockitoInternalConfigurationInjectionFilterMockCandidateFilter > #pragma mark Public - (instancetype)init; - (id<OrgMockitoInternalConfigurationInjectionFilterOngoingInjecter>)filterCandidateWithJavaUtilCollection:(id<JavaUtilCollection>)mocks withJavaLangReflectField:(JavaLangReflectField *)field withId:(id)fieldInstance; @end J2OBJC_EMPTY_STATIC_INIT(OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter) FOUNDATION_EXPORT void OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter_init(OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter *self); FOUNDATION_EXPORT OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter *new_OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter_init() NS_RETURNS_RETAINED; J2OBJC_TYPE_LITERAL_HEADER(OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter) #endif // _OrgMockitoInternalConfigurationInjectionFilterFinalMockCandidateFilter_H_
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // Adelanto #define COCOAPODS_POD_AVAILABLE_Adelanto #define COCOAPODS_VERSION_MAJOR_Adelanto 0 #define COCOAPODS_VERSION_MINOR_Adelanto 1 #define COCOAPODS_VERSION_PATCH_Adelanto 1 // Expecta #define COCOAPODS_POD_AVAILABLE_Expecta #define COCOAPODS_VERSION_MAJOR_Expecta 0 #define COCOAPODS_VERSION_MINOR_Expecta 3 #define COCOAPODS_VERSION_PATCH_Expecta 1 // Expecta+Snapshots #define COCOAPODS_POD_AVAILABLE_Expecta_Snapshots #define COCOAPODS_VERSION_MAJOR_Expecta_Snapshots 1 #define COCOAPODS_VERSION_MINOR_Expecta_Snapshots 2 #define COCOAPODS_VERSION_PATCH_Expecta_Snapshots 1 // FBSnapshotTestCase #define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase #define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase 1 #define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase 2 #define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase 0 // Specta #define COCOAPODS_POD_AVAILABLE_Specta #define COCOAPODS_VERSION_MAJOR_Specta 0 #define COCOAPODS_VERSION_MINOR_Specta 2 #define COCOAPODS_VERSION_PATCH_Specta 1
#ifndef _LIBMESSAGING_MSGDEF_H_ #define _LIBMESSAGING_MSGDEF_H_ #include <stddef.h> struct Message { unsigned int src_type; unsigned int src_sender; unsigned int dst_type; unsigned int dst_sender; unsigned int msg; char* param; size_t len; }; #endif
#ifndef MAWAR_XMPPDOMAIN_H #define MAWAR_XMPPDOMAIN_H #include <string> #include <stanza.h> class XMPPServer; /** * Базовый класс представляющий домен (виртуальный хост, s2s, XEP-0114 и т.п.) */ class XMPPDomain { protected: /** * Ссылка на сервер */ XMPPServer *server; /** * Имя домена */ std::string name; public: /** * Конструктор * @param srv ссылка на сервер * @param aName имя хоста */ XMPPDomain(XMPPServer *srv, const std::string &aName); /** * Деструктор */ virtual ~XMPPDomain(); /** * Вернуть имя хоста */ const std::string &hostname() const { return name; } XMPPServer* getServer() const { return server; } /** * Роутер станз (need thread-safe) * * Данная функция отвечает только за маршрутизацию станз в данном домене * * @note Данный метод вызывается из глобального маршрутизатора станз XMPPServer::routeStanza() * вызывать его напрямую из других мест не рекомендуется - используйте XMPPServer::routeStanza() * * @param stanza станза * @return TRUE - станза была отправлена, FALSE - станзу отправить не удалось */ virtual bool routeStanza(Stanza stanza) = 0; }; #endif // MAWAR_XMPPDOMAIN_H
// // AppDelegate.h // AtlasMap // // Created by Atlas on 15/12/25. // Copyright © 2015年 Atlas. All rights reserved. // #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; - (void)saveContext; - (NSURL *)applicationDocumentsDirectory; @end
/** * @file render_hobd_gps_baseline_ned1.c * @brief TODO. * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include "gl_headers.h" #include "math_util.h" #include "time_domain.h" #include "render.h" #include "config.h" #include "signal_table_def.h" // ***************************************************** // static global types/macros // ***************************************************** // ***************************************************** // static global data // ***************************************************** // ***************************************************** // static declarations // ***************************************************** // ***************************************************** // static definitions // ***************************************************** // ***************************************************** // public definitions // ***************************************************** // void render_hobd_gps_baseline_ned1( const config_s * const config, const hobd_gps_baseline_ned1_s * const data, const GLdouble base_x, const GLdouble base_y ) { char string[512]; GLdouble delta_y = 5.0; const GLdouble bound_x = 355.0; const GLdouble text_yoff = 15.0; const GLdouble text_xoff = 5.0; render_line( base_x, base_y, base_x + bound_x, base_y ); snprintf( string, sizeof(string), "time_of_week : %lu", (unsigned long) data->time_of_week ); render_text_2d( base_x + text_xoff, base_y + text_yoff, string, NULL ); render_line( base_x, base_y + text_yoff + delta_y, base_x + bound_x, base_y + text_yoff + delta_y ); delta_y += 15.0; snprintf( string, sizeof(string), "num_sats : %lu", (unsigned long) data->num_sats ); render_text_2d( base_x + text_xoff, base_y + text_yoff + delta_y, string, NULL ); delta_y += 5.0; render_line( base_x, base_y + text_yoff + delta_y, base_x + bound_x, base_y + text_yoff + delta_y ); delta_y += 15.0; snprintf( string, sizeof(string), "fix_mode : %lu", (unsigned long) data->fix_mode ); render_text_2d( base_x + text_xoff, base_y + text_yoff + delta_y, string, NULL ); delta_y += 5.0; render_line( base_x, base_y + text_yoff + delta_y, base_x + bound_x, base_y + text_yoff + delta_y ); delta_y += 15.0; snprintf( string, sizeof(string), "flags : 0x%02lX", (unsigned long) data->flags ); render_text_2d( base_x + text_xoff, base_y + text_yoff + delta_y, string, NULL ); delta_y += 5.0; render_line( base_x, base_y + text_yoff + delta_y, base_x + bound_x, base_y + text_yoff + delta_y ); }
#include "pub/type.h" #include "pub/err.h" #include "pub/com.h" #include "mem.h" #include "string.h" #include "sys.h" ivm_char_t * ivm_sys_getBasePath(const ivm_char_t *file) { ivm_size_t len = IVM_STRLEN(file); const ivm_char_t *i, *end; ivm_char_t *ret; for (i = file + len - 1, end = file - 1; i != end; i--) { if (*i == '/' || *i == '\\') { len = IVM_PTR_DIFF(i, file, ivm_char_t); if (!len) return IVM_STRDUP(IVM_FILE_SEPARATOR_S); ret = STD_ALLOC(sizeof(*ret) * (len + 1)); IVM_MEMCHECK(ret); STD_MEMCPY(ret, file, len); ret[len] = '\0'; return ret; } } return IVM_STRDUP("."); }
/* * Swamp - cooperative multitasking operating system * Copyright (c) 2016 rksdna * * 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 CORE_H #define CORE_H #include <types.h> #define PSR_ISR ((u32_t)(0x000001FF)) #define PSR_T ((u32_t)(0x01000000)) #define PSR_IT ((u32_t)(0x06000000)) #define PSR_Q ((u32_t)(0x08000000)) #define PSR_V ((u32_t)(0x10000000)) #define PSR_C ((u32_t)(0x20000000)) #define PSR_Z ((u32_t)(0x40000000)) #define PSR_N ((u32_t)(0x80000000)) #define PRIMASK_PRIMASK ((u32_t)(0x00000001)) #define FAULTMASK_FAULTMASK ((u32_t)(0x00000001)) #define BASEPR_BASEPRI ((u32_t)(0x000000FF)) #define CONTROL_TPL ((u32_t)(0x00000001)) #define CONTROL_ASPSEL ((u32_t)(0x00000002)) #define LR_HANDLER ((u32_t)0xFFFFFFF1) #define LR_THREAD_MSP ((u32_t)0xFFFFFFF9) #define LR_THREAD_PSP ((u32_t)0xFFFFFFFD) #endif
#ifndef _VPS_H_ #define _VPS_H_ #include <hw_config.h> #include <Point.h> Point get_vps_target() { copy_objects(); Point ret; ret.x = game.coords[1].x * UNITS_VPS_TO_MM; ret.y = game.coords[1].y * UNITS_VPS_TO_MM; return ret; } Point get_vps_current() { copy_objects(); Point ret; ret.x = game.coords[0].x * UNITS_VPS_TO_MM; ret.y = game.coords[0].y * UNITS_VPS_TO_MM; return ret; } /* float get_vps_theta() { copy_objects(); return game.coords[0].theta * UNITS_VPS_TO_DEG; }*/ /* void vps_dump() { Point target = get_vps_target(); Point current = get_vps_current(); printf("Target: (%.2f, %.2f)\n", target.x, target.y); printf("Current: (%.2f, %.2f)\n", current.x, current.y); printf("Theta: %.2f\n", get_vps_theta()); }*/ #endif
#import <Foundation/Foundation.h> @interface Artist : NSObject @property (nonatomic, copy, readonly) NSString *artistId; @property (nonatomic, copy, readonly) NSString *name; - (instancetype)initWithId:(NSString *)artistId name:(NSString *)name; @end
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_MNCellTextFieldVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_MNCellTextFieldVersionString[];
/************************************************************************************************** Filename: accelerometer.h Revised: $Date: 2011-11-11 15:13:08 -0800 (Fri, 11 Nov 2011) $ Revision: $Revision: 28319 $ Description: This file contains Accelerometer Profile header file. Copyright 2009 Texas Instruments Incorporated. All rights reserved. IMPORTANT: Your use of this Software is limited to those specific rights granted under the terms of a software license agreement between the user who downloaded the software, his/her employer (which must be your employer) and Texas Instruments Incorporated (the "License"). You may not use this Software unless you agree to abide by the terms of the License. The License limits your use, and you acknowledge, that the Software may not be modified, copied or distributed unless embedded on a Texas Instruments microcontroller or used solely and exclusively in conjunction with a Texas Instruments radio frequency transceiver, which is integrated into your product. Other than for the foregoing purpose, you may not use, reproduce, copy, prepare derivative works of, modify, distribute, perform, display or sell this Software and/or its documentation for any purpose. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. Should you have any questions regarding your right to use this Software, contact Texas Instruments Incorporated at www.TI.com. **************************************************************************************************/ #ifndef ACCELEROMETER_H #define ACCELEROMETER_H #ifdef __cplusplus extern "C" { #endif /********************************************************************* * INCLUDES */ /********************************************************************* * CONSTANTS */ // Profile Parameters #define ACCEL_ENABLER 0 // RW uint8 - Profile Attribute value #define ACCEL_X_ATTR 1 // RW int16 - Profile Attribute value #define ACCEL_Y_ATTR 2 // RW int16 - Profile Attribute value #define ACCEL_Z_ATTR 3 // RW int16 - Profile Attribute value #define ACCEL_RANGE 4 // RW uint16 - Profile Attribute value // Profile UUIDs #define ACCEL_ENABLER_UUID 0xFFA1 #define ACCEL_RANGE_UUID 0xFFA2 #define ACCEL_X_UUID 0xFFA3 #define ACCEL_Y_UUID 0xFFA4 #define ACCEL_Z_UUID 0xFFA5 // Accelerometer Service UUID #define ACCEL_SERVICE_UUID 0xFFA0 // Profile Range Values #define ACCEL_RANGE_2G 20 #define ACCEL_RANGE_8G 80 // Accelerometer Profile Services bit fields #define ACCEL_SERVICE 0x00000001 /********************************************************************* * TYPEDEFS */ /********************************************************************* * MACROS */ /********************************************************************* * Profile Callbacks */ // Callback when the device has been started. Callback event to // the ask for a battery check. typedef NULL_OK void (*accelEnabler_t)( void ); typedef struct { accelEnabler_t pfnAccelEnabler; // Called when Enabler attribute changes } accelCBs_t; /********************************************************************* * API FUNCTIONS */ /* * Accel_AddService- Initializes the Accelerometer service by registering * GATT attributes with the GATT server. Only call this function once. * * @param services - services to add. This is a bit map and can * contain more than one service. */ extern bStatus_t Accel_AddService( uint32 services ); /* * Accel_RegisterAppCBs - Registers the application callback function. * Only call this function once. * * appCallbacks - pointer to application callbacks. */ extern bStatus_t Accel_RegisterAppCBs( accelCBs_t *appCallbacks ); /* * Accel_SetParameter - Set an Accelerometer Profile parameter. * * param - Profile parameter ID * len - length of data to right * value - pointer to data to write. This is dependent on * the parameter ID and WILL be cast to the appropriate * data type (example: data type of uint16 will be cast to * uint16 pointer). */ extern bStatus_t Accel_SetParameter( uint8 param, uint8 len, void *value ); /* * Accel_GetParameter - Get an Accelerometer Profile parameter. * * param - Profile parameter ID * value - pointer to data to write. This is dependent on * the parameter ID and WILL be cast to the appropriate * data type (example: data type of uint16 will be cast to * uint16 pointer). */ extern bStatus_t Accel_GetParameter( uint8 param, void *value ); /********************************************************************* *********************************************************************/ #ifdef __cplusplus } #endif #endif /* ACCELEROMETER_H */
// // ViewController.h // MethodSwizzling // // Created by George Wu on 3/17/15. // Copyright © 2015 George Wu. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
// // CLTextView.h // CLBottomCommentView // // Created by YuanRong on 16/1/19. // Copyright © 2016年 FelixMLians. All rights reserved. // #import <UIKit/UIKit.h> #import "CLBottomCommentViewDelegate.h" @interface CLTextView : UIView @property (weak, nonatomic) IBOutlet UIView *contentView; @property (weak, nonatomic) IBOutlet UIView *containerView; @property (weak, nonatomic) IBOutlet UIButton *sendButton; @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (weak, nonatomic) IBOutlet UITextView *commentTextView; @property (weak, nonatomic) id<CLBottomCommentViewDelegate> delegate; @end
// // MeetViewController.h // MXMeetSample // // Created by KenYu on 7/8/14. // Copyright (c) 2014 Moxtra. All rights reserved. // @interface MeetViewController : UIViewController @end
// ====================================================================== /*! * \file NFmiDataModifierAvg.h * \brief Interface of class NFmiDataModifierAvg */ // ====================================================================== #pragma once #include "NFmiDataModifier.h" class NFmiDataModifierAvg : public NFmiDataModifier { public: virtual ~NFmiDataModifierAvg(); NFmiDataModifierAvg(); NFmiDataModifierAvg(const NFmiDataModifierAvg& theOther); NFmiDataModifier* Clone() const; float Avg(); virtual void Calculate(float theValue); virtual void Calculate(NFmiQueryInfo* theQI); void Clear(); using NFmiDataModifier::CalculationResult; virtual float CalculationResult(); long Counter(); protected: long itsCounter; float itsAverage; }; // class NFmiDataModifierAvg // ======================================================================
/****************************************************************************** Copyright (c) 1992, 1995, 1996 Xerox Corporation. All rights reserved. Portions of this code were written by Stephen White, aka ghond. Use and copying of this software and preparation of derivative works based upon this software are permitted. Any distribution of this software or derivative works must comply with all applicable United States export control laws. This software is made available AS IS, and Xerox Corporation makes no warranty about the software, its performance or its conformity to any specification. Any person obtaining a copy of this software is requested to send their name and post office or electronic mail address to: Pavel Curtis Xerox PARC 3333 Coyote Hill Rd. Palo Alto, CA 94304 Pavel@Xerox.Com *****************************************************************************/ #include "config.h" /* The server no longer uses variable-length argument lists of large (size > 8 * bytes) structures, so this code is no longer needed and BUGGY_STDARG is * never defined in config.h. I've left the code here for possible future use. */ #if BUGGY_STDARG /* * This implementation of the stdarg.h stuff is very simplistic; it ignores all * promotion and alignment issues. This is good enough for LambdaMOO's uses on * most machines. Regardless, this implementation should not be used unless * the one on your machine won't work. */ #ifndef STDARG_H #define STDARG_H 1 #ifndef _VA_LIST_ #define _VA_LIST_ 1 typedef void *va_list; #endif #define va_start(ptr, arg) \ (ptr = (void *) ((unsigned) &arg + sizeof(arg))) #define va_arg(ptr, type) \ ((type *) (ptr = (void *) ((unsigned) ptr + sizeof(type))))[-1] #define va_end(ptr) #endif /* STDARG_H */ #else #include <stdarg.h> #endif /* BUGGY_STDARG */ /* * $Log: my-stdarg.h,v $ * Revision 1.3 1998/12/14 13:18:16 nop * Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims * * Revision 1.2 1997/03/03 04:18:55 nop * GNU Indent normalization * * Revision 1.1.1.1 1997/03/03 03:45:05 nop * LambdaMOO 1.8.0p5 * * Revision 2.1 1996/02/08 06:02:14 pavel * Updated copyright notice for 1996. Release 1.8.0beta1. * * Revision 2.0 1995/11/30 04:58:36 pavel * New baseline version, corresponding to release 1.8.0alpha1. * * Revision 1.4 1992/10/23 23:03:47 pavel * Added copyright notice. * * Revision 1.3 1992/10/21 03:02:35 pavel * Converted to use new automatic configuration system. * * Revision 1.2 1992/09/22 22:47:15 pavel * Added missing #include of "config.h". * * Revision 1.1 1992/07/20 23:23:12 pavel * Initial RCS-controlled version. */
// // UIColor+CCKit.h // demo // // Created by KudoCC on 16/5/12. // Copyright © 2016年 KudoCC. All rights reserved. // #import <UIKit/UIKit.h> @interface UIColor (CCKit) // from 0 ~ 255, alpha default is 255 + (UIColor *)cc_colorWithRed:(int)red green:(int)green blue:(int)blue; + (UIColor *)cc_colorWithRed:(int)red green:(int)green blue:(int)blue alpha:(int)alpha; + (UIColor *)cc_opaqueColorWithHexString:(NSString *)stringToConvert; + (UIColor *)cc_colorWithHexString:(NSString *)stringToConvert alpha:(CGFloat)alpha; @end
// // CDDNetWorking.h // BaseProject // // Created by 曹冬冬 on 16/7/8. // Copyright © 2016年 曹冬冬. All rights reserved. // #import <AFNetworking/AFNetworking.h> #import "APIConstant.h" #define CDDNetWorkingManager [CDDNetWorking shareManager] typedef NS_ENUM(NSUInteger, NetworkStates) { NetworkStatesNone, // 没有网络 NetworkStates2G, // 2G NetworkStates3G, // 3G NetworkStates4G, // 4G NetworkStatesWIFI // WIFI }; typedef NS_ENUM(NSUInteger, HTTPClientRequestCachePolicy){ HTTPClientReturnCacheDataThenLoad = 0, // 有缓存就先返回缓存,同步请求数据 HTTPClientReloadIgnoringLocalCacheData, // 忽略缓存,重新请求 HTTPClientReturnCacheDataElseLoad, // 有缓存就用缓存,没有缓存就重新请求(用于数据不变时) HTTPClientReturnCacheDataDontLoad, // 有缓存就用缓存,没有缓存就不发请求,当做请求出错处理(用于离线模式) }; typedef NS_ENUM(NSInteger, RequestMethodType){ RequestMethodTypePost = 0, // POST请求 RequestMethodTypeGet, // GET请求 RequestMethodTypePut, // PUT请求 RequestMethodTypePatch, // PUT请求 RequestMethodTypeDelete // Delete请求 }; /** * HTTP访问回调 * * @param urlString 状态码 0 访问失败 200 正常 500 空 其他异常 * @param result 返回数据 nil 为空 * @param error 错误描述 */ typedef void(^ResultBlock)(NSString *stateCode, NSDictionary *result, NSError *error); @interface CDDNetWorking : AFHTTPSessionManager /** * 单例 * * @return 请求 */ + (instancetype)shareManager; /** * POST请求 * * @param url API地址 * @param params 参数 * @param success 成功回调 * @param failure 失败回调 */ - (void)POST:(NSString *)url params:(NSDictionary *)params result:(ResultBlock)requestBlock; /** * 是否连接网络 * */ - (BOOL)isReachable; /** * 获取网络状态 * * @return 网络状态 */ + (NetworkStates)getNetworkStates; @end
#include<stdio.h> #define MAX 20 int any(char s1[],char s2[]); main() { char a[MAX],b[MAX]; scanf("%s %s",a,b); printf("the position is %d",any(a,b)); } int any(char s1[],char s2[]) { int i,j; for(i=0;s1[i]!='\0';i++) for(j=0;s2[j]!=0;j++) { if(s1[i]==s2[j]) return i; /*应该返回的是i,而不是j*/ else return -1; } }
/* * gkanalysis.h * * Created on: 2017/09/15 * Author: tmakimoto */ #ifndef GKANALYSIS_H_ #define GKANALYSIS_H_ #include "gkgeometry.h" namespace gk { #if __cplusplus >= 201103L template<typename _Geometry1, typename _Geometry2> struct distance_definition_type { typedef geometry_traits<_Geometry1> traits1; typedef geometry_traits<_Geometry2> traits2; // Checking each dimension. typedef check_same_dimension<traits1::Dimension, traits2::Dimension>::value_type check_dimension; typedef typename check_same_type<typename traits1::value_type, typename traits2::value_type>::value_type value_type; }; template<typename _Geometry1, typename _Geometry2> using distance_type=distance_definition_type<_Geometry1,_Geometry2>::value_type; #elif #endif namespace inner { template<typename _Point1, typename _Point2> distance_type<_Point1, _Point2> distance(const _Point1& a, const _Point2& b, point_tag, point_tag, dimension_tag<GK::GK_2D>) { return std::sqrt(a[GK::X] * b[GK::X] + a[GK::Y] * b[GK::Y]); } template<typename _Point1, typename _Point2> distance_type<_Point1, _Point2> distance(const _Point1& a, const _Point2& b, point_tag, point_tag, dimension_tag<GK::GK_3D>) { return std::sqrt( a[GK::X] * b[GK::X] + a[GK::Y] * b[GK::Y] + a[GK::Z] * b[GK::Z]); } } // namespace inner template<typename _Geometry1, typename _Geometry2> distance_type<_Geometry1, _Geometry2> distance(const _Geometry1& a, const _Geometry2& b) { } } // namespace gk #endif /* GKANALYSIS_H_ */
/* ----------------------------------------------------------------- * * * gdt.c: global variable holder for the global descriptor * table on x86 based systems. * * Copyright (C) 2017 Sandro Francesco Montemezzani * Author: Sandro Montemezzani <sandro@montemezzani.net> * * This file is part of the SFM-OS kernel, and is licensed * under the MIT License. * * ----------------------------------------------------------------- */ #include <arch/x86/gdt.h> struct global_descriptor_table kernel_gdtr; struct global_descriptor_table_entry kernel_gdt[ GDT_NUM_ENTRIES ];
/****************************************************************************** ******************************************************************************* Space Impakto DS Relminator http://rel.betterwebber.com Worm class ******************************************************************************* ******************************************************************************/ #include <nds.h> #include <vector> #include <gl2d.h> #include "Vector2df32.h" #include "Turret.h" #include "Spline.h" #include "cearn_atan.h" #include "EntityContainer.h" #include "PowerUp.h" #ifndef WORM_H #define WORM_H //------------------------------------------------------------------------------ // Worm Enemy //------------------------------------------------------------------------------ class Worm { public: friend class WormContainer; Worm(); ~Worm(); void Update( PlayerShip &Vic ); private: void Destroy(); void Kill(); s32 x; s32 y; s32 Sx; s32 Dx; s32 Angle; int Frame; int Counter; bool Active; int Hp; int DeathScore; EN_DRAW_MODE DrawMode; int Width; int Height; AABB Aabb; Vector2df32 TurretPos; Vector2df32 TurretTar; std::vector<Turret>::iterator TurretPtr[2]; }; //------------------------------------------------------------------------------ // Worm Container //------------------------------------------------------------------------------ class WormContainer : public EntityContainer { public: WormContainer(); ~WormContainer(); void Init(int Palette, glImage* const Sprites ); virtual void UpdateEntities( PlayerShip &Vic ); virtual void DrawEntities(); virtual void DrawAABB( int color ); virtual void KillAllEntities(); virtual EntityContainer::CollisionPacket Collide( PlayerShip &Vic, bool BombIsActive, bool &IsDestroyed, int &BulletSpawnMode ); virtual EntityContainer::CollisionPacket BombEntities( PlayerShip &Vic, int BombDamageValue ) { EntityContainer::CollisionPacket Ret; Ret.Collision = 0; std::vector<Worm>::iterator iter; for( iter = Worms.begin(); iter != Worms.end(); ++iter ) { if( (iter->Active) && ( iter->x < (256 << 12) ) ) { iter->Hp -= BombDamageValue; if( iter->Hp < 0 ) { iter->Destroy(); Vic.AddToScore( iter->DeathScore ); } } } return Ret; } virtual void SetDrawMode( EN_DRAW_MODE mode ) { std::vector<Worm>::iterator iter; for( iter = Worms.begin(); iter != Worms.end(); ++iter ) { if( iter->Active ) iter->DrawMode = mode; } } void Spawn( int _y, s32 angle, TurretArray &Turrets ); virtual int NumEntities() { return numEntities; } private: int numEntities; glImage *Images; int ColorTable; std::vector<Worm> Worms; }; #endif // WORM
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__char_file_w32_spawnlp_67b.c Label Definition File: CWE78_OS_Command_Injection.strings.label.xml Template File: sources-sink-67b.tmpl.c */ /* * @description * CWE: 78 OS Command Injection * BadSource: file Read input from a file * GoodSource: Fixed string * Sinks: w32_spawnlp * BadSink : execute command with spawnlp * Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files * * */ #include "std_testcase.h" #include <wchar.h> #ifdef _WIN32 #define COMMAND_INT_PATH "%WINDIR%\\system32\\cmd.exe" #define COMMAND_INT "cmd.exe" #define COMMAND_ARG1 "/c" #define COMMAND_ARG2 "dir" #define COMMAND_ARG3 data #else /* NOT _WIN32 */ #include <unistd.h> #define COMMAND_INT_PATH "/bin/sh" #define COMMAND_INT "sh" #define COMMAND_ARG1 "ls" #define COMMAND_ARG2 "-la" #define COMMAND_ARG3 data #endif #ifdef _WIN32 #define FILENAME "C:\\temp\\file.txt" #else #define FILENAME "/tmp/file.txt" #endif #include <process.h> typedef struct _CWE78_OS_Command_Injection__char_file_w32_spawnlp_67_structType { char * structFirst; } CWE78_OS_Command_Injection__char_file_w32_spawnlp_67_structType; #ifndef OMITBAD void CWE78_OS_Command_Injection__char_file_w32_spawnlp_67b_badSink(CWE78_OS_Command_Injection__char_file_w32_spawnlp_67_structType myStruct) { char * data = myStruct.structFirst; /* spawnlp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ _spawnlp(_P_WAIT, COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE78_OS_Command_Injection__char_file_w32_spawnlp_67b_goodG2BSink(CWE78_OS_Command_Injection__char_file_w32_spawnlp_67_structType myStruct) { char * data = myStruct.structFirst; /* spawnlp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ _spawnlp(_P_WAIT, COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL); } #endif /* OMITGOOD */
// // MXChatPrefix.h // MXChatDemo // // Created by longminxiang on 15/7/4. // Copyright (c) 2015年 eric. All rights reserved. // #import <UIKit/UIKit.h> #ifndef __WEAKS #define __WEAKS(__w) __weak __typeof(self) __w = self #endif void mxc_setImageBundlePath(NSString *path); UIImage* mxc_imageInChatBundle(NSString *name); UIViewController* mxc_rootViewController(); UIWindow *mxc_keyWindow(); BOOL mxc_stringIsNil(NSString *string); void mxc_showLoadingProgressWithMessage(NSString *message, float delay); void mxc_showLoadingProgress(); void mxc_hideLoadingProgress();
// // AGXAztecDetector.h // AGXGcode // // Created by Char Aznable on 2016/8/9. // Copyright © 2016 github.com/CharLemAznable. All rights reserved. // // // Modify from: // TheLevelUp/ZXingObjC // // // Copyright 2014 ZXing authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #ifndef AGXGcode_AGXAztecDetector_h #define AGXGcode_AGXAztecDetector_h #import "AGXAztecDetectorResult.h" @interface AGXAztecDetector : NSObject @property (nonatomic, readonly) AGXBitMatrix *bits; + (AGX_INSTANCETYPE)detectorWithBits:(AGXBitMatrix *)bits; - (AGXAztecDetectorResult *)detectWithMirror:(BOOL)isMirror error:(NSError **)error; @end #endif /* AGXGcode_AGXAztecDetector_h */
/********************************************************************** * Copyright (c) 2013, 2014 Pieter Wuille * * Distributed under the MIT software license, see the accompanying * * file COPYING or http://www.opensource.org/licenses/mit-license.php.* **********************************************************************/ #ifndef _SECP256K1_ECDSA_ #define _SECP256K1_ECDSA_ #include <stddef.h> #include "scalar.h" #include "group.h" #include "ecmult.h" static int secp256k1_ecdsa_sig_parse(secp256k1_scalar *r, secp256k1_scalar *s, const unsigned char *sig, size_t size); static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar *r, const secp256k1_scalar *s); static int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar *r, const secp256k1_scalar *s, const secp256k1_ge *pubkey, const secp256k1_scalar *message); static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar *r, secp256k1_scalar *s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid); #endif
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: (null) */ #import "AWSModel.h" @class NSString, NSNumber, NSDate; @interface AWSEC2InstanceNetworkInterfaceAttachment : AWSModel { NSDate* _attachTime; NSString* _attachmentId; NSNumber* _deleteOnTermination; NSNumber* _deviceIndex; int _status; } @property(retain, nonatomic) NSDate* attachTime; @property(retain, nonatomic) NSString* attachmentId; @property(retain, nonatomic) NSNumber* deleteOnTermination; @property(retain, nonatomic) NSNumber* deviceIndex; @property(assign, nonatomic) int status; + (id)JSONKeyPathsByPropertyKey; + (id)attachTimeJSONTransformer; + (id)statusJSONTransformer; - (void).cxx_destruct; @end
// // Keychain.h // Coaches Loupe // // Created by David Keegan on 2/12/11. // #import "AGKeychain.h" @interface Keychain : NSObject {} + (NSString *)passwordForUser:(NSString *)username forItem:(NSString *)item ofKind:(NSString *)kind; + (void)setPassword:(NSString *)password forUser:(NSString *)username forItem:(NSString *)item ofKind:(NSString *)kind; + (NSString *)dribbblePasswordForUser:(NSString *)username; + (void)setDribbblePassword:(NSString *)password forUser:(NSString *)username; + (NSString *)cloudPasswordForUser:(NSString *)username; + (void)setCloudPassword:(NSString *)password forUser:(NSString *)username; @end
//header file for pulse, part of cava. void* input_pulse(void* data); void getPulseDefaultSink();
/* * Copyright © 2018 - Vitaliy Perevertun * * This file is part of scmedit * * This file is licensed under the MIT license. * See the file LICENSE. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cli/cli_s.h" static int cli_rename(cli_t *cli, int argc, char* argv[]) { char name[255] = {}; uint16_t num; if (argc > 3) { fprintf(stderr, "rename command require two arguments!\n"); return -1; } if (argc < 2) { if (cli_read(cli, "enter channel number", "%d", &num) != 1) return -1; } else num = strtol(argv[1], NULL, 10); if (num < 1 || num > 1000) { fprintf(stderr, "channel number must be from 1 to 1000\n"); return -1; } if (argc < 3) { if (cli_read(cli, "enter channel name", "%s", &name) != 1) return -1; } else strcpy(name, argv[2]); if (!name || !name[0]) { fprintf(stderr, "channel name must be not empty\n"); return -1; } channel_t* ch; ch = map_get(cli->map, num); if (ch) { char *oldname; size_t len; oldname = ch->name; len = strlen(name); ch->name = malloc(len + 1); if (!ch->name) { ch->name = oldname; fprintf(stderr, "out of memory\n"); return -1; } memcpy(ch->name, name, len); ch->name[len] = '\0'; printf("channel '%s' renamed to '%s' in [%d] position\n", oldname, ch->name, num); free(oldname); } return 0; } const cli_cmd clicmd_rename = { .name = "rename", .cmd = cli_rename, .help = "Rename the channel" };
/****************************************************************/ /* NAME: Damian Manda */ /* ORGN: MIT Cambridge MA */ /* FILE: SonarFilter_Info.h */ /* DATE: Dec 29th 1963 */ /****************************************************************/ #ifndef SonarFilter_INFO_HEADER #define SonarFilter_INFO_HEADER void showSynopsis(); void showHelpAndExit(); void showExampleConfigAndExit(); void showInterfaceAndExit(); void showReleaseInfoAndExit(); #endif
// // JYJRecommendCategory.h // JYJ不得姐 // // Created by JYJ on 16/4/2. // Copyright © 2016年 baobeikeji. All rights reserved. // #import <Foundation/Foundation.h> @interface JYJRecommendCategory : NSObject /** id */ @property (nonatomic, assign) NSInteger ID; /** 总数 */ @property (nonatomic, assign) NSInteger count; /** 名字 */ @property (nonatomic, copy) NSString *name; /** 这个类别对应的用户数据 */ @property (nonatomic, strong) NSMutableArray *users; /** 总数 */ @property (nonatomic, assign) NSInteger total; /** 当前页码 */ @property (nonatomic, assign) NSInteger currentPage; @end
// // FoundationAdditions.h // NBClient // // Copyright (MIT) 2014-present NationBuilder // #import <Foundation/Foundation.h> @interface NSIndexSet (NBAdditions) + (nonnull NSIndexSet *)nb_indexSetOfSuccessfulHTTPStatusCodes; + (nonnull NSIndexSet *)nb_indexSetOfSuccessfulEmptyResponseHTTPStatusCodes; @end @interface NSDictionary (NBAdditions) - (BOOL)nb_containsDictionary:(nonnull NSDictionary *)dictionary; - (BOOL)nb_hasKeys:(nonnull NSArray *)keys; - (BOOL)nb_isEquivalentToDictionary:(nonnull NSDictionary *)dictionary; - (nonnull NSString *)nb_queryString; // Deprecated, will be removed in the next major release. - (nonnull NSString *)nb_queryStringWithEncoding:(NSStringEncoding)stringEncoding skipPercentEncodingPairKeys:(nullable NSSet *)skipPairKeys charactersToLeaveUnescaped:(nullable NSString *)charactersToLeaveUnescaped; - (nonnull NSString *)nb_queryStringWithSkippedPairKeys:(nullable NSSet *)skippedPairKeys; @end @interface NSObject (NBAdditions) - (nullable id)nb_nilIfNull; @end @interface NSString (NBAdditions) - (nonnull NSDictionary *)nb_queryStringParameters; // Deprecated, will be removed in the next major release. - (nonnull NSDictionary *)nb_queryStringParametersWithEncoding:(NSStringEncoding)stringEncoding; // Deprecated, will be removed in the next major release. - (nonnull NSString *)nb_percentEscapedQueryStringWithEncoding:(NSStringEncoding)stringEncoding charactersToLeaveUnescaped:(nullable NSString *)charactersToLeaveUnescaped; // Deprecated, will be removed in the next major release. - (nonnull NSString *)nb_percentUnescapedQueryStringWithEncoding:(NSStringEncoding)stringEncoding charactersToLeaveEscaped:(nullable NSString *)charactersToLeaveEscaped; - (nonnull NSString *)nb_localizedString; - (BOOL)nb_isNumeric; @end @interface NSURLRequest (NBAdditions) - (nonnull NSString *)nb_debugDescription; @end @interface NSError (NBAdditions) + (nonnull NSError *)nb_genericError; @end
#pragma once #include "util/stl_ext.h" #include "skse/skse.h" #include "reflection/tes_binding.h" #include "collections/collections.h" #include "collections/context.h" namespace reflection { namespace binding { using namespace collections; template<class T = object_base> struct ObjectConverter { typedef HandleT tes_type; static HandleT convert2Tes(object_base* obj) { return (HandleT)(obj ? obj->uid() : Handle::Null); } static object_stack_ref_template<T> convert2J(HandleT hdl, tes_context& ctx) { auto ref = ctx.getObjectRefOfType<T>((Handle)hdl); if (!ref && hdl != util::to_integral(Handle::Null)) { JC_log("Warning: access to non-existing object with id 0x%X", hdl); } return ref; } }; template<> struct GetConv < object_stack_ref > : ObjectConverter<>{}; template<> struct GetConv < object_base* > : ObjectConverter<>{}; template<> struct GetConv < array* > : ObjectConverter< array >{}; template<> struct GetConv < map* > : ObjectConverter< map >{}; template<> struct GetConv < form_map* > : ObjectConverter< form_map >{}; template<> struct GetConv < integer_map* > : ObjectConverter < integer_map >{}; ////////////////////////////////////////////////////////////////////////// template<> struct GetConv < Handle > : StaticCastValueConverter<Handle, HandleT> {}; ////////////////////////////////////////////////////////////////////////// template<> struct GetConv < FormId > { typedef TESForm* tes_type; static TESForm* convert2Tes(FormId id) { return LookupFormByID((uint32_t)id); } template<class Any> static FormId convert2J(const TESForm* form, const Any&) { return form ? (FormId)form->formID : FormId::Zero; } }; ///////////////// template<> struct GetConv < forms::form_ref > { typedef TESForm* tes_type; static TESForm* convert2Tes(const forms::form_ref& id) { return skse::lookup_form(id.get()); } static forms::form_ref convert2J(const TESForm* form, tes_context& ctx) { return make_weak_form_id(form, ctx); } }; template<> struct GetConv < forms::form_ref_lightweight > { typedef TESForm* tes_type; static TESForm* convert2Tes(const forms::form_ref_lightweight& id) { return skse::lookup_form(id.get()); } static forms::form_ref_lightweight convert2J(const TESForm* form ,tes_context& ctx) { return make_lightweight_form_ref(form, ctx); } }; } }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE127_Buffer_Underread__malloc_wchar_t_cpy_52a.c Label Definition File: CWE127_Buffer_Underread__malloc.label.xml Template File: sources-sink-52a.tmpl.c */ /* * @description * CWE: 127 Buffer Under-read * BadSource: Set data pointer to before the allocated memory buffer * GoodSource: Set data pointer to the allocated memory buffer * Sink: cpy * BadSink : Copy data to string using wcscpy * Flow Variant: 52 Data flow: data passed as an argument from one function to another to another in three different source files * * */ #include "std_testcase.h" #include <wchar.h> #ifndef OMITBAD /* bad function declaration */ void CWE127_Buffer_Underread__malloc_wchar_t_cpy_52b_badSink(wchar_t * data); void CWE127_Buffer_Underread__malloc_wchar_t_cpy_52_bad() { wchar_t * data; data = NULL; { wchar_t * dataBuffer = (wchar_t *)malloc(100*sizeof(wchar_t)); wmemset(dataBuffer, L'A', 100-1); dataBuffer[100-1] = L'\0'; /* FLAW: Set data pointer to before the allocated memory buffer */ data = dataBuffer - 8; } CWE127_Buffer_Underread__malloc_wchar_t_cpy_52b_badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* good function declaration */ void CWE127_Buffer_Underread__malloc_wchar_t_cpy_52b_goodG2BSink(wchar_t * data); /* goodG2B uses the GoodSource with the BadSink */ static void goodG2B() { wchar_t * data; data = NULL; { wchar_t * dataBuffer = (wchar_t *)malloc(100*sizeof(wchar_t)); wmemset(dataBuffer, L'A', 100-1); dataBuffer[100-1] = L'\0'; /* FIX: Set data pointer to the allocated memory buffer */ data = dataBuffer; } CWE127_Buffer_Underread__malloc_wchar_t_cpy_52b_goodG2BSink(data); } void CWE127_Buffer_Underread__malloc_wchar_t_cpy_52_good() { goodG2B(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE127_Buffer_Underread__malloc_wchar_t_cpy_52_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE127_Buffer_Underread__malloc_wchar_t_cpy_52_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
#pragma once #include "Core/Texture/TAbstractPixelTex2D.h" #include "Frame/TFrame.h" #include "Common/assertion.h" #include <type_traits> #include <utility> namespace ph { template<typename T, std::size_t N> class TPixelTex2D : public TAbstractPixelTex2D<T, N> { public: inline TPixelTex2D() : TPixelTex2D(TFrame<T, N>(1, 1)) {} explicit inline TPixelTex2D(const TFrame<T, N>& frame) : TAbstractPixelTex2D<T, N>(frame.widthPx(), frame.heightPx()), m_frame(frame) { PH_ASSERT(!m_frame.isEmpty()); } explicit inline TPixelTex2D(TFrame<T, N>&& frame) : TAbstractPixelTex2D<T, N>(frame.widthPx(), frame.heightPx()), m_frame(std::move(frame)) { PH_ASSERT(!m_frame.isEmpty()); } void sample( const SampleLocation& sampleLocation, TTexPixel<T, N>* out_value) const override = 0; inline void getPixel( const uint32 x, const uint32 y, TTexPixel<T, N>* const out_pixel) const { static_assert(std::is_same_v<TTexPixel<T, N>, typename TFrame<T, N>::Pixel>, "require same pixel type"); PH_ASSERT(out_pixel != nullptr); m_frame.getPixel(x, y, out_pixel); } inline void setPixels(const TFrame<T, N>& frame) { m_frame = frame; setWidthPx(frame->widthPx()); setHeightPx(frame->heightPx()); PH_ASSERT(!m_frame.isEmpty()); } private: TFrame<T, N> m_frame; }; }// end namespace ph
// // Timer.hpp // FmodTest_macosx // // Created by Cody Claborn on 1/22/16. // Copyright © 2016 oxygine. All rights reserved. // #pragma once #include <functional> #include "oxygine-framework.h" using namespace oxygine; using namespace std; class Timer { public: Timer(); ~Timer(); Timer start(double time, int loops = 1, function<void(Timer&)> callback=NULL); void update(const UpdateState &us); void stop(); void pause(); void resume(); private: int _loopsLeft; double _duration; double _elapsed; function<void(Timer&)> _callback; bool _running; double _pauseTime = 0; };
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "SBAlertWindowViewController.h" @interface SBMainScreenAlertWindowViewController : SBAlertWindowViewController { } - (void)_getRotationContentSettings:(CDStruct_e950349b *)arg1; - (void)didRotateFromInterfaceOrientation:(long long)arg1; - (void)willAnimateRotationToInterfaceOrientation:(long long)arg1 duration:(double)arg2; - (_Bool)shouldAutorotateToInterfaceOrientation:(long long)arg1; - (void)noteAlertWindow:(id)arg1 didDisplayAlert:(id)arg2; - (_Bool)alertWindow:(id)arg1 canAnimateInAlert:(id)arg2; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "SChartLegendSymbol.h" @class SChartBarSeriesStyle; @interface SChartLegendSymbolBarSeries : SChartLegendSymbol { SChartBarSeriesStyle *style; } @property(readonly, nonatomic) SChartBarSeriesStyle *style; // @synthesize style; - (void)drawRect:(struct CGRect)arg1; - (void)dealloc; - (id)initWithSeries:(id)arg1; @end
/** library covlib This library exercises less-used parts of the interpreter to help increase coverage. */ #include "lily.h" /** Begin autogen section. **/ const char *lily_covlib_info_table[] = { "\02FlatEnum\0ScopedEnum\0" ,"E\0FlatEnum\0" ,"V\0FlatOne\0" ,"V\0FlatTwo\0" ,"V\0FlatThree\0" ,"E\03ScopedEnum\0" ,"V\0ScopedOne\0" ,"V\0ScopedTwo\0" ,"V\0ScopedThree\0" ,"Z" }; lily_call_entry_func lily_covlib_call_table[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; /** End autogen section. **/ /** enum FlatEnum { FlatOne, FlatTwo, FlatThree } Flat enum test. */ /** scoped enum ScopedEnum { ScopedOne, ScopedTwo, ScopedThree } Scoped enum test. */
/* COPYRIGHT 2011 ESRI TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL Unpublished material - all rights reserved under the Copyright Laws of the United States and applicable international laws, treaties, and conventions. For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, 92373 USA email: contracts@esri.com */ @protocol AGSCoding; @class AGSGeometry; @class AGSMosaicRule; @class AGSImageServiceIdentifyParameters; /** @brief Input parameters for the Image Service Identify Task. Input parameters for an @c AGSImageServiceIdentifyTask. @define{AGSImageServiceIdentifyParameters.h, ArcGIS} @agssince{1.8, 10.2} */ @interface AGSImageServiceIdentifyParameters : NSObject <AGSCoding> /** The geometry according to which features should be identified. @c AGSPoint is most commonly used for identifying features at a location, but @c AGSPolygon may also be used for searching within an area. @agssince{1.8, 10.2} */ @property (nonatomic, strong) AGSGeometry *geometry; /** Specifies the mosaic rule defining the image sorting order. When mosaic rule is not specified, mosaic rule will default to AGSMosaicMethodCenter. @agssince{1.8, 10.2} */ @property (nonatomic, strong) AGSMosaicRule *mosaicRule; /** The pixel level being identified (or the resolution being looked at). If pixel size is not specified, then @p pixelSizeX will default to the x-value of the base resolution of the dataset. The raster at the specified pixel size in the mosaic dataset will be used for identify. @agssince{1.8, 10.2} */ @property (nonatomic, assign) double pixelSizeX; /** The pixel level being identified (or the resolution being looked at). If pixel size is not specified, then @p pixelSizeY will default to the y-value of the base resolution of the dataset. The raster at the specified pixel size in the mosaic dataset will be used for identify. @agssince{1.8, 10.2} */ @property (nonatomic, assign) double pixelSizeY; /** Initialize an autoreleased <code>AGSImageServiceIdentifyParameters</code> object. @agssince{1.8, 10.2} */ +(id)imageServiceIdentifyParameters; @end
/** * Pre-include header file. * * All c11httpd library header files should include this file first. * * Copyright (c) 2015 Alex Jin (toalexjin@hotmail.com) */ #pragma once #include <cassert> #include <cstdint> namespace c11httpd { using std::int8_t; using std::int16_t; using std::int32_t; using std::int64_t; using std::uint8_t; using std::uint16_t; using std::uint32_t; using std::uint64_t; using std::size_t; using std::ptrdiff_t; using std::intptr_t; using std::uintptr_t; } // namespace c11httpd.
// // IsingGrid.h // jdemon // // Created by Mark Larus on 3/11/13. // Copyright (c) 2013 Kenyon College. All rights reserved. // #ifndef __jdemon__IsingGrid__ #define __jdemon__IsingGrid__ #include <iterator> #include <stdexcept> #include <string> #include <vector> #include <boost/scoped_array.hpp> #include <boost/array.hpp> #include <boost/iterator/filter_iterator.hpp> #include <boost/iterator/counting_iterator.hpp> #include "CATools.h" namespace Ising { class Cell; class Grid; namespace detail { // This class is used by the boost::filter_iterator to ensure even // contents. typedef bool Kind; const extern Kind even; const extern Kind odd; template <class T> class CheckerboardPtrOffset { T * const base; const int dimension; const Kind kind; public: CheckerboardPtrOffset(T * const b, Kind k, int dim) : base(b),dimension(dim), kind(k) {} bool operator()(T *n) const; }; typedef CheckerboardPtrOffset<Cell> CheckerboardCellOffset; } class Cell : public CATools::Cell<Cell, unsigned char> { public: typedef boost::array<Cell *, 4> Neighbors; protected: friend class Grid; Neighbors neighbors; friend class CATools::Cell<Cell, unsigned char>; char _setValue(const char &c); public: void toggle() { setValue(value ^ 1); } Neighbors getNeighbors() { return neighbors; } bool isNeighbor(Cell *neighbor){ return std::count(neighbors.begin(),neighbors.end(),neighbor);} long getEnergy(); }; class Grid : public CATools::Grid<Cell> { public: typedef boost::counting_iterator<Cell *> iterator; class subset : public std::vector<Cell *> { // This class is a lazy container for iterating over the // even or odd cells in the grid. It can be accessed with // Ising:Grid::subset::iterator it = grid.evens.begin(); detail::Kind kind; public: detail::Kind getKind() const { return kind; } subset(const Grid &grid, detail::Kind k); }; const subset evens; const subset odds; Grid(int dimension); }; class InvalidCellValue : public std::runtime_error { public: InvalidCellValue() : std::runtime_error(std::string("Tried to set cell to invalid value.")) {} }; } template <class Container> std::pair<typename Container::iterator, typename Container::iterator> foreach_container(Container &c); #endif /* defined(__jdemon__IsingGrid__) */
// // ViewController.h // ChainableKit // // Created by apple on 15/5/12. // Copyright (c) 2015年 DeltaX. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#pragma once #include "File.h" #ifndef YSRESULT_IS_DEFINED #define YSERR 0 #define YSOK 1 #endif #ifndef YSBOOL_IS_DEFINED #define YSBOOL_IS_DEFINED #define YSFALSE 0 #define YSTRUE 1 #endif class YsPngHuffmanTree { public: YsPngHuffmanTree(); ~YsPngHuffmanTree(); YsPngHuffmanTree *zero,*one; unsigned int dat; unsigned int weight,depth; static int leakTracker; static void DeleteHuffmanTree(YsPngHuffmanTree *node); }; class YsPngUncompressor { public: class YsGenericPngDecoder *output; inline unsigned int GetNextBit(const unsigned char* dat,unsigned &bytePtr,unsigned &bitPtr) { unsigned a; a=dat[bytePtr]&bitPtr; bitPtr<<=1; if(bitPtr>=256) { bitPtr=1; bytePtr++; } return (a!=0 ? 1 : 0); } inline unsigned int GetNextMultiBit(const unsigned char* dat,unsigned &bytePtr,unsigned &bitPtr,unsigned n) { unsigned value,mask,i; value=0; mask=1; for(i=0; i<n; i++) { if(GetNextBit(dat,bytePtr,bitPtr)) { value|=mask; } mask<<=1; } return value; } void MakeFixedHuffmanCode(unsigned hLength[288],unsigned hCode[288]); static void MakeDynamicHuffmanCode(unsigned hLength[288],unsigned hCode[288],unsigned nLng,unsigned* lng); int DecodeDynamicHuffmanCode (unsigned int &hLit,unsigned int &hDist,unsigned int &hCLen, unsigned int *&hLengthLiteral,unsigned int *&hCodeLiteral, unsigned int *&hLengthDist,unsigned int *&hCodeDist, unsigned int hLengthBuf[322],unsigned int hCodeBuf[322], const unsigned char* dat,unsigned int &bytePtr,unsigned int &bitPtr); YsPngHuffmanTree *MakeHuffmanTree(unsigned n,unsigned* hLength,unsigned* hCode); void DeleteHuffmanTree(YsPngHuffmanTree *node); unsigned GetCopyLength(unsigned value,unsigned char* dat,unsigned &bytePtr,unsigned &bitPtr); unsigned GetBackwardDistance(unsigned distCode,unsigned char* dat,unsigned &bytePtr,unsigned &bitPtr); int Uncompress(unsigned length,unsigned char* dat); }; //////////////////////////////////////////////////////////// class YsPngHeader { public: unsigned int width,height; unsigned int bitDepth,colorType; unsigned int compressionMethod,filterMethod,interlaceMethod; void Decode(unsigned char* dat); }; class YsPngPalette { public: unsigned int nEntry; unsigned char *entry; YsPngPalette(); ~YsPngPalette(); int Decode(unsigned length,unsigned char* dat); }; class YsPngTransparency { public: unsigned int col[3]; // For color type 3, up to three transparent colors is supported. int Decode(unsigned length,unsigned char* dat,unsigned int colorType); }; class YsGenericPngDecoder { public: enum { gamma_default=100000 }; YsPngHeader hdr; YsPngPalette plt; YsPngTransparency trns; unsigned int gamma; YsGenericPngDecoder(); virtual ~YsGenericPngDecoder() {} void Initialize(void); int CheckSignature(SPlay::File *fp); int ReadChunk(unsigned &length,unsigned char *&buf,unsigned &chunkType,unsigned &crc,SPlay::File *fp); int Decode(const char* fn); virtual int PrepareOutput(void); virtual int Output(unsigned char dat); virtual int EndOutput(void); }; //////////////////////////////////////////////////////////// class YsRawPngDecoder : public YsGenericPngDecoder { public: YsRawPngDecoder(); virtual ~YsRawPngDecoder(); int wid,hei; unsigned char *rgba; // Raw data of R,G,B,A unsigned char *indexed; // Raw indexed color data int autoDeleteRgbaBuffer; int filter,x,y,firstByte; int inLineCount; int inPixelCount; unsigned int r,g,b,msb; // msb for reading 16 bit depth unsigned int index; unsigned int interlacePass; // For filtering unsigned char *twoLineBuf8,*curLine8,*prvLine8; void ShiftTwoLineBuf(void); virtual int PrepareOutput(void); virtual int Output(unsigned char dat); virtual int EndOutput(void); void Flip(void); // For drawing in OpenGL };
#ifndef _MAIN_HEADER_ #define _MAIN_HEADER_ #pragma comment(linker, "/NODEFAULTLIB:libcmt") #define _RETAIL #define WINDOWS_LEAN_AND_MEAN #define GAME_DLL #define ENGINE_LIB "engine.dll" #include "MODULE_LuaOO.h" #include "eiface.h" #include "interface.h" #include "tier1.h" #include <string> #include "GarrysMod/Lua/Interface.h" #include <stdio.h> #include "Lua.h" extern GarrysMod::Lua::ILuaBase* g_Lua; extern IVEngineServer *g_IVEngineServer; using namespace GarrysMod::Lua; int GetClusterCount( lua_State* state ); int GetClusterForOrigin( lua_State* state ); int GetAllClusterBounds( lua_State* state ); int GetPVSForCluster( lua_State* state ); class PVS : public LuaObjectBaseTemplate<PVS, 301> { LUA_OBJECT public: PVS(lua_State* state); virtual ~PVS(void); int CheckCluster(); int GetList(); int CheckOrigin(); int CheckBox(); private: byte* pvs; }; #endif
#pragma once namespace nethax { namespace random { extern unsigned int current_seed; void srand_original(unsigned int seed); void __cdecl srand_hook(unsigned int seed); void init(); void deinit(); } }
// // DLSBufferedStream.h // Dials-Shared // // Created by Akiva Leffert on 12/6/14. // Copyright (c) 2014 Akiva Leffert. All rights reserved. // #import <Foundation/Foundation.h> typedef int32_t DLSStreamSize;
// // FirefeedSearch.h // iFirefeed // // Created by Greg Soltis on 4/23/13. // Copyright (c) 2013 Firebase. All rights reserved. // #import <Foundation/Foundation.h> #import <Firebase/Firebase.h> @protocol FirefeedSearchDelegate; @interface FirefeedSearch : NSObject - (id) initWithRef:(Firebase *)ref; - (BOOL) searchTextDidUpdate:(NSString *)text; @property (strong, nonatomic) UITableView* resultsTable; @property (weak, nonatomic) id<FirefeedSearchDelegate> delegate; @end @protocol FirefeedSearchDelegate <NSObject> - (void) userIdWasSelected:(NSString *)userId; @end
// // ImageCell.h // CollectionViewLayouts // // Created by Zhaoyu Li on 23/5/15. // Copyright (c) 2015 Ramon Bartl. All rights reserved. // #import <UIKit/UIKit.h> @interface ImageCell : UICollectionViewCell @property (nonatomic, strong) UIImage *img; @property (nonatomic, getter=isActive) BOOL active; @end
#ifndef AC_BRMESH_H #define AC_BRMESH_H 1 // // Copyright 2014 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // // DESCRIPTION: // // The AcBrMesh class is the interface base class for meshes. All // the functionality supported by this class is implemented by // the class AcBrImpMesh. // // This class defines the functions that are common to all dimensions // of meshes, and cannot be instantiated as it has no meaning on // its own. // // A mesh is a network of nodal approximations to curves, surfaces and // volumes in a brep object (or subobject), and thus has associated // geometry. The geometry, however, is stored at the individual // elements and nodes, as are the mappings back to the original brep // topology. Each supported dimension of meshing has its own associated // class. General faceting is exposed through the AcBrMesh2d subclass. #include "adesk.h" #include "rxobject.h" #include "rxboiler.h" #include "brment.h" // forward class declarations class AcBrMeshEntity; class AcBrMesh : public AcBrMeshEntity { public: ACRX_DECLARE_MEMBERS(AcBrMesh); virtual ~AcBrMesh(); protected: AcBrMesh(); AcBrMesh(const AcBrMesh&); AcBrMesh& operator = (const AcBrMesh&); }; #endif