text
stringlengths
4
6.14k
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "CDStructures.h" @interface _IDEKitPrivateClassForFindingBundle : NSObject { } @end
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double Pods_WZYUnlimitedScrollViewDemoVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_WZYUnlimitedScrollViewDemoVersionString[];
#ifndef SYMTAB_H #define SYMTAB_H #include "symbol.h" void symtab_init(); void push_scope(); void pop_scope(); symbol *bind_symbol(char *name); symbol *lookup_symbol(char *name); void print_symtab(); #endif
/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- Copyright (c) 2006-2021, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the assimp team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of the assimp team. 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. --------------------------------------------------------------------------- */ /** @file Bitmap.h * @brief Defines bitmap format helper for textures * * Used for file formats which embed their textures into the model file. */ #pragma once #ifndef AI_BITMAP_H_INC #define AI_BITMAP_H_INC #ifdef __GNUC__ # pragma GCC system_header #endif #include "defs.h" #include <stdint.h> #include <cstddef> struct aiTexture; namespace Assimp { class IOStream; class ASSIMP_API Bitmap { protected: struct Header { uint16_t type; uint32_t size; uint16_t reserved1; uint16_t reserved2; uint32_t offset; // We define the struct size because sizeof(Header) might return a wrong result because of structure padding. // Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). static const std::size_t header_size = sizeof(uint16_t) + // type sizeof(uint32_t) + // size sizeof(uint16_t) + // reserved1 sizeof(uint16_t) + // reserved2 sizeof(uint32_t); // offset }; struct DIB { uint32_t size; int32_t width; int32_t height; uint16_t planes; uint16_t bits_per_pixel; uint32_t compression; uint32_t image_size; int32_t x_resolution; int32_t y_resolution; uint32_t nb_colors; uint32_t nb_important_colors; // We define the struct size because sizeof(DIB) might return a wrong result because of structure padding. // Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). static const std::size_t dib_size = sizeof(uint32_t) + // size sizeof(int32_t) + // width sizeof(int32_t) + // height sizeof(uint16_t) + // planes sizeof(uint16_t) + // bits_per_pixel sizeof(uint32_t) + // compression sizeof(uint32_t) + // image_size sizeof(int32_t) + // x_resolution sizeof(int32_t) + // y_resolution sizeof(uint32_t) + // nb_colors sizeof(uint32_t); // nb_important_colors }; static const std::size_t mBytesPerPixel = 4; public: static void Save(aiTexture* texture, IOStream* file); protected: static void WriteHeader(Header& header, IOStream* file); static void WriteDIB(DIB& dib, IOStream* file); static void WriteData(aiTexture* texture, IOStream* file); }; } #endif // AI_BITMAP_H_INC
// // DORDoneHUD.h // DORDoneHUD // // Created by Pawel Bednorz on 23/09/15. // Copyright © 2015 Droids on Roids. All rights reserved. // #import <UIKit/UIKit.h> @interface DORDoneHUD : NSObject + (void)show:(UIView *)view message:(NSString *)messageText completion:(void (^)(void))completionBlock; + (void)show:(UIView *)view message:(NSString *)messageText; + (void)show:(UIView *)view; @end
// Copyright (c) 2013-2014 PropCoin Developers #ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 5 #define CLIENT_VERSION_REVISION 1 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2014 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
/* * Signals.h * * Created on: 07.06.2017 * Author: abt674 * * */ #ifndef SIGNALS_H_ #define SIGNALS_H_ //Lightbarriers and Sensor #define INLET_IN_VAL 0b0000000000000001 #define INLET_OUT_VAL 0b0000000000000011 #define HEIGHTMEASUREMENT_IN_VAL 0b0000000000000010 #define HEIGHTMEASUREMENT_OUT_VAL 0b0000000000000110 //#define SENSOR_HEIGHT 0b0000000000000100 #define SWITCH_IN_VAL 0b0000000000001000 #define SWITCH_OUT_VAL 0b0000000000011000 #define METAL_DETECT_VAL 0b0000000000010000 #define SWITCH_OPEN_VAL 0b0000000000100000 #define SWITCH_CLOSED_VAL 0b0000000001100000 #define SLIDE_IN_VAL 0b0000000001000000 #define SLIDE_OUT_VAL 0b0000000011000000 #define OUTLET_IN_VAL 0b0000000010000000 #define OUTLET_OUT_VAL 0b0000000110000000 //Buttons #define BUTTON_START_VAL 0b0001000000000000 #define BUTTON_STOP_VAL 0b0010000000000000 #define BUTTON_RESET_VAL 0b0100000000000000 #define BUTTON_ESTOP_IN_VAL 0b1000000000000000 #define BUTTON_ESTOP_OUT_VAL 0b1100000000000000 namespace interrupts { enum interruptSignals : int32_t { INLET_IN = INLET_IN_VAL, INLET_OUT = INLET_OUT_VAL, HEIGHTMEASUREMENT_IN = HEIGHTMEASUREMENT_IN_VAL, HEIGHTMEASUREMENT_OUT = HEIGHTMEASUREMENT_OUT_VAL, SWITCH_IN = SWITCH_IN_VAL, SWITCH_OUT = SWITCH_OUT_VAL, METAL_DETECT = METAL_DETECT_VAL, SWITCH_OPEN = SWITCH_OPEN_VAL, SWITCH_CLOSED = SWITCH_CLOSED_VAL, SLIDE_IN = SLIDE_IN_VAL, SLIDE_OUT = SLIDE_OUT_VAL, OUTLET_IN = OUTLET_IN_VAL, OUTLET_OUT = OUTLET_OUT_VAL, BUTTON_START = BUTTON_START_VAL, BUTTON_STOP = BUTTON_STOP_VAL, BUTTON_RESET = BUTTON_RESET_VAL, BUTTON_ESTOP_IN = BUTTON_ESTOP_IN_VAL, BUTTON_ESTOP_OUT = BUTTON_ESTOP_OUT_VAL }; } #endif /* SIGNALS_H_ */
/* * Configuration.h * * Created on: Nov 25, 2015 * Author: yash */ #ifndef CONFIGURATION_H_ #define CONFIGURATION_H_ #include <string> #include <vector> #include <map> #include <mutex> namespace daf { class Config { private: std::string FileLocation; std::mutex Lock; std::map<std::string, std::string> Storage; public: Config(); Config(const char* loc); Config(std::string loc); virtual ~Config(); std::string& operator[](std::string key); const std::map<std::string, std::string> getMap(); bool remove(std::string key); bool refresh(); bool flush(); std::string getFilename(); void setFilename(std::string nloc); }; // typedef void* DPFDAT; // // class Configuration; // class ConfigItem; // // enum ConfigType // { // Namespace, // Number, // String, // Binary // }; // // enum NumberType // { // Integer, // Floating // }; // // class ConfigItem // { // public: // ConfigType type; // DPFDAT data; // }; // // class Configuration // { // private: // std::map<std::string, ConfigItem> ConfigItems; // std::string location; // public: // Configuration(); // Configuration(const char* location); // Configuration(std::string location); // Configuration(Configuration& configuration); // Configuration& operator=(Configuration&& configuration); // virtual ~Configuration(); // // bool read(); // }; } #endif /* CONFIGURATION_H_ */
#include <string> #include <vector> using std::string; using std::vector; // StrUtil class class StrUtils { public: /**Function used to trim empty character * from begin and end of the string * @param string& string to trim * @return string& trimed tring, same object of parameter */ static string trim(string&); /**Find if the given string is peresented * in the given array * @param const int char* array length * @param const char*[] char* array, used to store string ary * @return -1 if not found, otherwise return index */ static int indexOf(vector<string>&, string&); static int indexOf(const int, const char*[], const char*); static bool is_number(const std::string& s); private: static bool isEmpChar(const char); //static const char m_empChar[]; //static const int m_empLen; }; //class strutil
#include <stdio.h> #include <stdlib.h> static inline void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } static int firstMissingPositive(int* nums, int numsSize) { if (numsSize == 0) { return 1; } int i = 0; while (i < numsSize) { /* nums[i] should be i+1 and nums[nums[i] - 1] should be nums[i] */ if (nums[i] != i + 1 && nums[i] > 0 && nums[i] <= numsSize && nums[nums[i] - 1] != nums[i]) { /* let nums[nums[i] - 1] = nums[i] */ swap(nums + i, nums + nums[i] - 1); } else { i++; } } for (i = 0; i < numsSize; i++) { if (nums[i] != i + 1) { break; } } return i + 1; } int main(int argc, char **argv) { int i, count = argc - 1; int *nums = malloc(count * sizeof(int)); for (i = 0; i < count; i++) { nums[i] = atoi(argv[i + 1]); } printf("%d\n", firstMissingPositive(nums, count)); return 0; }
/* -*- C++ -*- */ // $Id: ntsvc.h 80826 2008-03-04 14:51:23Z wotte $ // ============================================================================ // // = LIBRARY // examples/NT_Service // // = FILENAME // ntsvc.h // // = DESCRIPTION // This is the definition of the sample NT Service class. This example // only runs on Win32 platforms. // // = AUTHOR // Gonzalo Diethelm and Steve Huston // // ============================================================================ #ifndef NTSVC_H_ #define NTSVC_H_ #include "ace/config-lite.h" #if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_SERVICES) #include "ace/Event_Handler.h" #include "ace/NT_Service.h" #include "ace/Singleton.h" #include "ace/Mutex.h" class Service : public ACE_NT_Service { public: Service (void); ~Service (void); virtual void handle_control (DWORD control_code); // We override <handle_control> because it handles stop requests // privately. virtual int handle_exception (ACE_HANDLE h); // We override <handle_exception> so a 'stop' control code can pop // the reactor off of its wait. virtual int svc (void); // This is a virtual method inherited from ACE_NT_Service. virtual int handle_timeout (const ACE_Time_Value& tv, const void *arg = 0); // Where the real work is done: private: typedef ACE_NT_Service inherited; private: int stop_; }; // Define a singleton class as a way to insure that there's only one // Service instance in the program, and to protect against access from // multiple threads. The first reference to it at runtime creates it, // and the ACE_Object_Manager deletes it at run-down. typedef ACE_Singleton<Service, ACE_Mutex> SERVICE; #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_SERVICES */ #endif /* #ifndef NTSVC_H_ */
#ifndef SE_SCANNNER_H #define SE_SCANNNER_H #include <stdio.h> #include <stdlib.h> #include <string> #include "read.h" #include "fusion.h" #include "match.h" #include <cstdlib> #include <condition_variable> #include <mutex> #include <thread> #include "fusionmapper.h" using namespace std; struct ReadPack { Read** data; int count; }; typedef struct ReadPack ReadPack; struct ReadRepository { ReadPack** packBuffer; size_t readPos; size_t writePos; size_t readCounter; std::mutex mtx; std::mutex readCounterMtx; std::condition_variable repoNotFull; std::condition_variable repoNotEmpty; }; typedef struct ReadRepository ReadRepository; class SingleEndScanner{ public: SingleEndScanner(string fusionFile, string refFile, string read1File, string html, string json, int threadnum); ~SingleEndScanner(); bool scan(); void textReport(); void htmlReport(); void jsonReport(); private: bool scanSingleEnd(ReadPack* pack); void initPackRepository(); void destroyPackRepository(); void producePack(ReadPack* pack); void consumePack(); void producerTask(); void consumerTask(); void pushMatch(Match* m); private: string mFusionFile; string mRefFile; string mRead1File; string mRead2File; string mHtmlFile; string mJsonFile; ReadRepository mRepo; bool mProduceFinished; std::mutex mFusionMtx; int mThreadNum; FusionMapper* mFusionMapper; }; #endif
#ifndef _SYSAPPDB_SYSAPPDBHELPER_H_ #define _SYSAPPDB_SYSAPPDBHELPER_H_ #include <vector> #include <map> #include <string> #include "sqlite3.h" std::vector<std::string> read_text_file(std::string path); std::vector<std::string> split_str(std::string src, char c); std::string join_str(std::vector<std::string> strings, std::string connector); template<typename K, typename V> std::vector<K> map_get_keys(std::map<K, V> map); template<typename K, typename V> std::vector<V> map_get_values(std::map<K, V> map); int db_insert(sqlite3* con, std::string table, std::map<std::string, std::string> values); template<typename C> std::vector<C> db_select(sqlite3* con, std::string table, std::string coloumn, std::string where_stmt); #endif
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "WFBTLEServiceProcessor.h" @class NSData, WFNordicDFUControlPointCh, WFNordicDFUPacketCh; @interface WFBTLENordicDFUService : WFBTLEServiceProcessor { id <WFNordicDFUDelegate> delegate; WFNordicDFUControlPointCh *dfuControlPointCh; WFNordicDFUPacketCh *dfuPacketCh; BOOL bDFUInProgress; BOOL bStartTransferOnACK; BOOL bFinishOnACK; BOOL bWaitingForReceiveImageACK; unsigned long ulImageSize; unsigned long ulBytesSent; NSData *firmwareData; double startTime; unsigned short usCRC; unsigned short usProductId; unsigned int packetIntervalTime; unsigned char ucMaxRetries; unsigned char ucRetryCount; BOOL bTransferThreadRunning; BOOL bBlockTransferThread; BOOL bTransferCheckPassed; BOOL bAbortImageTransfer; } @property(retain, nonatomic) id <WFNordicDFUDelegate> delegate; // @synthesize delegate; - (void)setMaxRetries:(unsigned char)arg1; - (void)setPacketIntervalTime:(unsigned int)arg1; - (BOOL)sendHardReset; - (BOOL)sendExitDFU; - (BOOL)sendFirmware:(id)arg1; - (void)sendFirmwareImage_TM; - (void)sendFirmwareImage; - (void)sendDFUInitParams; - (BOOL)sendStartDFU; - (void)restartTransfer; - (void)delegateFinish:(unsigned char)arg1; - (void)delegateUpdateBytesSent:(unsigned long)arg1; - (void)delegateValidateFirmwareResponse:(unsigned char)arg1; - (void)delegateReceiveFirmwareImageResponse:(unsigned char)arg1; - (void)delegateInitDFUParamsResponse:(unsigned char)arg1; - (void)delegateStartDFUResponse:(unsigned char)arg1 imageSize:(unsigned long)arg2; - (void)reset; - (id)getData; - (BOOL)startUpdatingForService:(id)arg1 onPeripheral:(id)arg2; - (void)peripheral:(id)arg1 didWriteValueForCharacteristic:(id)arg2 error:(id)arg3; - (void)peripheral:(id)arg1 didUpdateValueForCharacteristic:(id)arg2 error:(id)arg3; - (void)peripheral:(id)arg1 didUpdateNotificationStateForCharacteristic:(id)arg2 error:(id)arg3; - (void)dealloc; - (id)init; @end
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <pthread.h> #include <errno.h> #include "semaphore.h" typedef struct lock { Semaphore *sem; } Lock; Lock *make_lock () { Lock *lock = (Lock *) malloc (sizeof(Lock)); lock->sem = make_semaphore(1); return lock; } void lock_acquire (Lock *lock) { semaphore_wait(lock->sem); } void lock_release (Lock *lock) { semaphore_signal(lock->sem); }
// // EBBannerView+Categories.h // demo // // Created by [email protected] on 2017/10/20. // Copyright © 2017年 [email protected]. All rights reserved. // #import "EBBannerView.h" #define WEAK_SELF(weakSelf) __weak __typeof(&*self)weakSelf = self; #define ScreenWidth [UIScreen mainScreen].bounds.size.width #define ScreenHeight [UIScreen mainScreen].bounds.size.height @interface EBBannerView (EBCategory) +(UIImage*)defaultIcon; +(NSString*)defaultTitle; +(NSString*)defaultDate; +(NSTimeInterval)defaultAnimationTime; +(NSTimeInterval)defaultStayTime; +(UInt32)defaultSoundID; @end @interface NSTimer (EBCategory) + (NSTimer *)eb_scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(void (^)(NSTimer *timer))block repeats:(BOOL)repeats; @end @interface UIImage (EBBannerViewCategory) +(UIColor *)colorAtPoint:(CGPoint)point; @end
/***************************************************************************** * x264: h264 encoder ***************************************************************************** * Copyright (C) 2005 Tuukka Toivonen <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. *****************************************************************************/ #ifndef X264_VISUALIZE_H #define X264_VISUALIZE_H #include "common.h" void x264_visualize_init( x264_t *h ); void x264_visualize_mb( x264_t *h ); void x264_visualize_show( x264_t *h ); void x264_visualize_close( x264_t *h ); #endif
// // UIView+BluredSnapshot.h // CustomTransitionAndBlur // // Created by Gao Song on 11/1/15. // Copyright © 2015 Gao Song. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (BluredSnapshot) -(UIImage *)blurredSnapshot; @end
// // BallVC.h // KenshinPro // // Created by apple on 2019/1/31. // Copyright © 2019 Kenshin. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface BallVC : UIViewController @end NS_ASSUME_NONNULL_END
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double NSObject_SerializeVersionNumber; FOUNDATION_EXPORT const unsigned char NSObject_SerializeVersionString[];
// // Created by root on 07.05.17. // #ifndef BASICMODEL_BASEMANAGER_H #define BASICMODEL_BASEMANAGER_H #include <mysql++.h> #include <vector> #include "dbConfig.h" namespace model { namespace manager { template<class ModelName> class baseManager { public: baseManager() { try { _con.connect(db_name, db_ip, db_user, db_password); } catch (...) { return; } } baseManager(const std::string &table) : _tableName(table) { try { _con.connect(db_name, db_ip, db_user, db_password); } catch (...) { return; } } baseManager(const baseManager &rhs) : _con(rhs._con), _query(rhs._query), _tableName(rhs._tableName) {} virtual ~baseManager() { _con.disconnect(); } virtual void update(ModelName &model) = 0; virtual void get(const std::string &filter) = 0; virtual void get() = 0; virtual void all() = 0; virtual void filter(const std::string &filter) = 0; virtual void execute() = 0; virtual void execute(ModelName &result) = 0; virtual void execute(std::vector<ModelName> &result) = 0; protected: mysqlpp::Connection _con; std::string _query; std::string _tableName; }; } } #endif //BASICMODEL_BASEMANAGER_H
/******************************************************************************* * Filename: irc_comm.h * * These are functions and definitions that can be used for both the client * and the server programs. * * Written by: James Ross ******************************************************************************/ #ifndef _IRC_COMM_H_ #define _IRC_COMM_H_ #include "utility_sys.h" /* useful macros, definitions and libraries */ #define NO_FLAGS 0 /* used for functions where no flag argument is used. */ /* Server connectivity information */ #define _COM_SERV_ADDR "10.200.248.135" #define _COM_SERV_LEN sizeof(_COM_SERV_ADDR) #define _COM_SERV_PORT 50059 /* port listening on server */ #define _COM_NET_DOMAIN AF_INET /* network domain we are using. IPV4 */ #define _COM_SOCK_TYPE SOCK_STREAM /* tcp socket */ #define _COM_IP_PROTOCOL 0 /* Default for type in socket() */ #define _COM_IO_BUFF 512 /* max bytes that can be sent/recieved */ #define _NAME_SIZE_MAX 11 /* includes '\0' */ #define MSG_TYPE_SIZE 1 /****************************************************************************** * Command Code Definition ******************************************************************************/ #define RC_FA 0x1 #define RC_FL 0x2 #define RC_JOIN 0x7 #define RC_EXIT 0x8 #define RC_LOGOUT 0xA #define RC_RL 0xC #define RC_FR 0x10 #define RC_LOGON 0x11 #define RC_LEAVE 0x15 #define RC_MSG 0x16 #define RC_RUL 0x17 /* list users in a room */ #define RESERVED_Z 0x0 /* was useful to reserve for error checking */ #define RESERVE_CR 0x13 /* reserved since we use \r in messages */ /* server to client reply success/failure */ #define _REPLY_SUCCESS 1 #define _REPLY_FAILURE 0 /* length of the reply to logon. */ #define _LOGON_REPLY_SIZE 3 typedef struct server_info { in_addr_t addr; /* network binary of server address */ char *dot_addr; /* dotted representation of IP address */ in_port_t port; /* port used at IP address, network ordered */ int domain; /* AF_INET or AF_INET6 */ int sock_type; /* type of socket, socket() definition. */ int pcol; /* Protocol argument used in socket() */ int sockfd; /* socket file descriptior */ struct sockaddr_in *socket_info; /* socket API struct, IPV4 */ } struct_serv_info; typedef struct parsed_cli_message { char *cli_name; int type; char *msg; } struct_cli_message; typedef struct parsed_serv_message { uint8_t type; char *msg; } struct_serv_message; struct_serv_info* _com_init_serv_info(void); void _com_free_serv_info(struct_serv_info *dest); void _com_free_cli_message(struct_cli_message *rem); void _com_free_serv_message(struct_serv_message *rem); /******************************************************************************* * TODO: Maybe make these functions since they are long, though my current * protocol with them just calls a seperate stack frame and just calls the * inline, which the compiler should notice and just make that 1 stack frame * this code... * * An analyze binary size, which i think is okay since it is only called in a * single line function that returns this. Other issues though? Memory * imprint in a different way? ******************************************************************************/ static inline ssize_t socket_transmit(int sockfd, uint8_t *tx, size_t len, int flags) { ssize_t sent; /* number of bytes written to socket */ size_t remaining = len; /* number of bytes left to write */ sent = send(sockfd, tx, remaining, flags); if (_usrUnlikely(sent == FAILURE)) { err_msg("socket_transmit: send() failed"); return FAILURE; } /* in case there was something not written, try again */ remaining -= sent; tx += sent; return (len - remaining); } /* end socket_transmit */ static inline ssize_t socket_receive(int sockfd, uint8_t *rx, size_t len, int flags) { ssize_t received = 1; /* bytes read from a socket, non-EOF init */ size_t remaining = len; /* bytes still in buffer */ received = recv(sockfd, rx, remaining, flags); if (received == FAILURE) { err_msg("socket_recieve: recv() failed"); return FAILURE; } remaining -= received; rx += received; return (len - remaining); } /* end socket_recieve */ #endif
//*************************************************************************** // Copyright (C) 2009 Realmac Software Ltd // // These coded instructions, statements, and computer programs contain // unpublished proprietary information of Realmac Software Ltd // and are protected by copyright law. They may not be disclosed // to third parties or copied or duplicated in any form, in whole or // in part, without the prior written consent of Realmac Software Ltd. // Created by Keith Duncan on 26/03/2009 //*************************************************************************** #import <Cocoa/Cocoa.h> // Model #import "RMUploadKit/AFPropertyListProtocol.h" #import "RMUploadKit/RMUploadPlugin.h" #import "RMUploadKit/RMUploadPreset.h" #import "RMUploadKit/RMUploadCredentials.h" // Controller #import "RMUploadKit/RMUploadPresetConfigurationViewController.h" #import "RMUploadKit/RMUploadMetadataConfigurationViewController.h" // Upload #import "RMUploadKit/RMUploadTask.h" #import "RMUploadKit/RMUploadURLConnection.h" #import "RMUploadKit/NSURLRequest+RMUploadAdditions.h" #import "RMUploadKit/RMUploadMultipartFormDocument.h" // Other #import "RMUploadKit/RMUploadConstants.h" #import "RMUploadKit/RMUploadErrors.h"
/* Copyright (c) 2012 Jess VanDerwalker <[email protected]> * All rights reserved. * * data.h * * 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 _DATA_H_ #define _DATA_H_ #include <xcb/xcb.h> #include <xcb/damage.h> #define XTOQ_DAMAGE 0 #define XTOQ_EXPOSE 1 #define XTOQ_CREATE 2 #define XTOQ_DESTROY 3 typedef struct xtoq_context_t { xcb_connection_t *conn; xcb_drawable_t window; xcb_window_t parent; xcb_damage_damage_t damage; int x; int y; int width; int height; int damaged_x; int damaged_y; int damaged_width; int damaged_height; char *name; /* The name of the window */ int wm_delete_set; /* Flag for WM_DELETE_WINDOW, 1 if set */ void *local_data; // Area for data client cares about } xtoq_context_t; typedef struct xtoq_event_t { xtoq_context_t *context; int event_type; } xtoq_event_t; typedef struct image_data_t { uint8_t *data; int length; } image_data_t; typedef struct xtoq_image_t { xcb_image_t *image; int x; int y; int width; int height; } xtoq_image_t; typedef void (*xtoq_event_cb_t) (xtoq_event_t const *event); extern int _damage_event; #endif
/************************************************************************ The MIT License(MIT) Copyright(c) 2014 Lingjijian [B-y] [email protected] 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 __TUI_UTIL_H__ #define __TUI_UTIL_H__ #include "cocos2d.h" #include "TuiMacros.h" NS_TUI_BEGIN using namespace std; /** * @brief the tool * */ class TuiUtil{ public: /** * @brief use name to create the animation * * @param name * @param delay * @param iLoops Whether loop * @return Animation */ static Animation* createAnimWithName(const char* name,float delay,unsigned int iLoops); /** * @brief use name and Play frames to create the animation * * @param name * @param iNum frame number * @param delay * @param iLoops Whether loop * @return Animation */ static Animation* createAnimWithNameAndNum(const char* name,int iNum, float delay,unsigned int iLoops); /* * @brief replace all string in actual ,such as => replace_all(string("12212"),"12","21") => 22211 * * @param str text * @param old_value * @param new_value * @return string */ static string replace_all_actual(string str, const string& old_value, const string& new_value); /* * @brief replace all string ,such as => replace_all(string("12212"),"12","21") => 21221 * * @param str text * @param old_value * @param new_value * @return string */ static string replace_all(string str, const string& old_value, const string& new_value); /* * @brief split string ,such as => split(string("ff_a"),"_") => ["ff","a"] * * @param str text * @param delim * @return string */ static vector< string > split(const string& s,const string& delim); static vector< string > separateUtf8(const std::string& inStr); static bool isChinese(const std::string& s); protected: private: }; NS_TUI_END #endif
#ifndef _PSW_H_INCLUDED_ #define _PSW_H_INCLUDED_ /* * (補足) プロセッサステータスレジスタ(PSW): * -------+----------+---------------------------------------- * b16 | I | 割り込み許可ビット(0:禁止/1:許可) * b17 | U | スタックポインタ指定ビット(0:ISP/1:USP) * b20 | PM | プロセッサモード設定ビット(0:S/1:U) * b27-24 | IPL[3:0] | プロセッサ割り込み優先レベル(0(最低)-15(最高) * -------+----------+---------------------------------------- */ #define PSW_I_DISABLE 0x00000000 #define PSW_I_ENABLE 0x00010000 #define PSW_U_ISP 0x00000000 #define PSW_U_USP 0x00020000 #define PSW_PM_SUPER 0x00000000 #define PSW_PM_USER 0x00100000 #define PSW_IPL_MIN 0x00000000 #define PSW_IPL_MAX 0x0f000000 #endif /* _PSW_H_INCLUDED_ */
#ifndef VIEWER_H #define VIEWER_H #include "common.h" #include "drawable.h" #include "controller.h" class Viewer { public: bool glfw_is_up; GLFWwindow* window; GLuint VertexArrayID; int width; int height; Controller controls; std::vector<Drawable *> drawables; Viewer(); void add( Drawable *d) { drawables.push_back( d); } void fatal( std::string msg) { fprintf( stderr, "%s\n", msg.c_str()); getchar(); throw Exc(msg); } // Various inits void init(); int init_window(); int init_glew(); int init_vao(); void run(); virtual ~Viewer(); }; #endif
#pragma once #include "Component.h" #include "Transform.h" #include "CubeMesh.h" using namespace Beans; class PlayerController : public Component, public Utilities::AutoLister<PlayerController> { public: PlayerController(GameObject* owner); REFLECT_CLASS; static void UpdatePlayerControllers(double dt); void Update(double dt); double speed; private: Transform* transform_; CubeMesh* sprite_; };
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QHTTPMULTIPART_H #define QHTTPMULTIPART_H #include <QtCore/QSharedDataPointer> #include <QtCore/QByteArray> #include <QtCore/QIODevice> #include <QtNetwork/QNetworkRequest> QT_BEGIN_NAMESPACE class QHttpPartPrivate; class QHttpMultiPart; class Q_NETWORK_EXPORT QHttpPart { public: QHttpPart(); QHttpPart(const QHttpPart &other); ~QHttpPart(); #ifdef Q_COMPILER_RVALUE_REFS QHttpPart &operator=(QHttpPart &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif QHttpPart &operator=(const QHttpPart &other); void swap(QHttpPart &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QHttpPart &other) const; inline bool operator!=(const QHttpPart &other) const { return !operator==(other); } void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value); void setRawHeader(const QByteArray &headerName, const QByteArray &headerValue); void setBody(const QByteArray &body); void setBodyDevice(QIODevice *device); private: QSharedDataPointer<QHttpPartPrivate> d; friend class QHttpMultiPartIODevice; }; Q_DECLARE_SHARED(QHttpPart) class QHttpMultiPartPrivate; class Q_NETWORK_EXPORT QHttpMultiPart : public QObject { Q_OBJECT public: enum ContentType { MixedType, RelatedType, FormDataType, AlternativeType }; explicit QHttpMultiPart(QObject *parent = Q_NULLPTR); explicit QHttpMultiPart(ContentType contentType, QObject *parent = Q_NULLPTR); ~QHttpMultiPart(); void append(const QHttpPart &httpPart); void setContentType(ContentType contentType); QByteArray boundary() const; void setBoundary(const QByteArray &boundary); private: Q_DECLARE_PRIVATE(QHttpMultiPart) Q_DISABLE_COPY(QHttpMultiPart) friend class QNetworkAccessManager; friend class QNetworkAccessManagerPrivate; }; QT_END_NAMESPACE #endif // QHTTPMULTIPART_H
// // This is the main include file for the gcode library // It parses and executes G-code functions // // gcode.h // #ifndef GCODE_H #define GCODE_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <stdarg.h> #ifndef NRF51 // G-code debug print unsigned int debug(const char *format, ...); #else #include "uart.h" #endif // Single G-code parameter typedef struct { char type; float value; } gcode_parameter_t; // Parse G-code command int gcode_parse(const char *s); // Extract G-code parameter (similar to strtok) int gcode_get_parameter(char **s, gcode_parameter_t *gp); #endif
#pragma once char separator; #ifdef _WIN32 #define DIR_SEPARATOR '\\' #else #define DIR_SEPARATOR '/' #endif #include <string> #include <algorithm> using namespace std; class PathUtil{ public: /*A small function to extract FileName from File Path C:/File.exe -> File.exe */ string static extractFileName(string FilePath){ int separatorlast = FilePath.find_last_of(DIR_SEPARATOR); return FilePath.substr(separatorlast + 1, FilePath.length() - separatorlast); } string static extractFileExt(string FilePath){ int separatorlast = FilePath.find_last_of('.'); string FileExt = FilePath.substr(separatorlast + 1, FilePath.length() - separatorlast); std::transform(FileExt.begin(), FileExt.end(), FileExt.begin(), ::tolower); return FileExt; } string static extractFileNamewithoutExt(string FilePath){ string FileName = extractFileName(FilePath); int separatorlast = FilePath.find_last_of(DIR_SEPARATOR); int dotlast = FilePath.find_last_of('.'); return FilePath.substr(separatorlast + 1, dotlast); } string static extractDirPath(string FilePath){ string FileName = extractFileName(FilePath); int separatorlast = FilePath.find_last_of(DIR_SEPARATOR); int dotlast = FilePath.find_first_of('.'); return FilePath.substr(separatorlast + 1, dotlast - separatorlast -1); } };
// // AppDelegate.h // testspinner // // Created by Christian Menschel on 29/09/15. // Copyright © 2015 TAPWORK. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // DNTag.h // DNTagView // // Created by dawnnnnn on 16/9/1. // Copyright © 2016年 dawnnnnn. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface DNTag : NSObject @property (nonatomic, copy) NSString *text; @property (nonatomic, copy) NSAttributedString *attributedText; @property (nonatomic, strong) UIColor *textColor; @property (nonatomic, strong) UIColor *bgColor; @property (nonatomic, strong) UIColor *highlightedBgColor; @property (nonatomic, strong) UIColor *borderColor; @property (nonatomic, strong) UIImage *bgImg; @property (nonatomic, strong) UIFont *font; @property (nonatomic, assign) CGFloat cornerRadius; @property (nonatomic, assign) CGFloat borderWidth; ///like padding in css @property (nonatomic, assign) UIEdgeInsets padding; ///if no font is specified, system font with fontSize is used @property (nonatomic, assign) CGFloat fontSize; ///default:YES @property (nonatomic, assign) BOOL enable; - (nonnull instancetype)initWithText: (nonnull NSString *)text; + (nonnull instancetype)tagWithText: (nonnull NSString *)text; @end NS_ASSUME_NONNULL_END
#pragma once #include "FtInclude.h" #include <string> namespace ft { class Library { public: Library(); ~Library(); FT_Library library = nullptr; Library(const Library&) = delete; Library(Library&&) = delete; Library& operator = (const Library&) = delete; Library& operator=(Library&&) = delete; std::string getVersionString() const; private: static int initialized; }; }
// // RegionContainerViewController.h // MH4U Dex // // Created by Joseph Goldberg on 3/6/15. // Copyright (c) 2015 Joseph Goldberg. All rights reserved. // #import <UIKit/UIKit.h> @class Region; @interface RegionContainerViewController : UIViewController @property (nonatomic, strong) Region *region; @end
// // RepeatExpression.h // iLogo // // Created by Yuhua Mai on 10/27/13. // Copyright (c) 2013 Yuhua Mai. All rights reserved. // #import "ScopedExpression.h" //#import "Expression.h" @interface RepeatExpression : ScopedExpression { Expression *variableExpression; NSMutableArray *commandExpression; } - (void)convert:(NSMutableArray*)commandList; - (NSMutableArray*)evaluate:(TurtleCommand*)lastTurtleCommand; @end
// // HomeDateContainerView.h // XQDemo // // Created by XiangqiTu on 15-4-13. // // #import <UIKit/UIKit.h> @interface HomeDateContainerView : UIView - (void)caculateDateWithTimestamp:(NSString *)timestamp; @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 <HomeSharing/HSRequest.h> @interface HSItemDataRequest : HSRequest { } + (id)requestWithDatabaseID:(unsigned int)arg1 itemID:(unsigned long long)arg2 format:(id)arg3; - (id)initWithDatabaseID:(unsigned int)arg1 itemID:(unsigned long long)arg2 format:(id)arg3; @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 <Foundation/NSPredicateOperator.h> @interface NSCompoundPredicateOperator : NSPredicateOperator { } + (id)notPredicateOperator; + (id)orPredicateOperator; + (id)andPredicateOperator; - (_Bool)evaluatePredicates:(id)arg1 withObject:(id)arg2 substitutionVariables:(id)arg3; - (_Bool)evaluatePredicates:(id)arg1 withObject:(id)arg2; - (id)symbol; - (id)predicateFormat; - (id)copyWithZone:(struct _NSZone *)arg1; @end
// // Copyright (c) 2017-2020 the rbfx project. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #pragma once #include <EASTL/utility.h> #include "Tabs/Tab.h" namespace Urho3D { class Asset; class FileChange; struct ResourceContextMenuArgs { ea::string resourceName_; }; URHO3D_EVENT(E_RESOURCEBROWSERDELETE, ResourceBrowserDelete) { URHO3D_PARAM(P_NAME, Name); // String } /// Resource browser tab. class ResourceTab : public Tab { URHO3D_OBJECT(ResourceTab, Tab) public: /// Construct. explicit ResourceTab(Context* context); /// Render content of tab window. Returns false if tab was closed. bool RenderWindowContent() override; /// Clear any user selection tracked by this tab. void ClearSelection() override; /// Serialize current user selection into a buffer and return it. bool SerializeSelection(Archive& archive) override; /// Signal set when user right-clicks a resource or folder. Signal<void(const ResourceContextMenuArgs&)> resourceContextMenu_; protected: /// void OnLocateResource(StringHash, VariantMap& args); /// Constructs a name for newly created resource based on specified template name. ea::string GetNewResourcePath(const ea::string& name); /// Select current item in attribute inspector. void SelectCurrentItemInspector(); /// void OnEndFrame(StringHash, VariantMap&); /// void OnResourceUpdated(const FileChange& change); /// void ScanAssets(); /// void OpenResource(const ea::string& resourceName); /// void RenderContextMenu(); /// void RenderDirectoryTree(const eastl::string& path = ""); /// void ScanDirTree(StringVector& result, const eastl::string& path); /// void RenderDeletionDialog(); /// void StartRename(); /// bool RenderRenameWidget(const ea::string& icon = ""); /// Current open resource path. ea::string currentDir_; /// Current selected resource file name. ea::string selectedItem_; /// Assets visible in resource browser. ea::vector<WeakPtr<Asset>> assets_; /// Cache of directory names at current selected resource path. StringVector currentDirs_; /// Cache of file names at current selected resource path. StringVector currentFiles_; /// Flag which requests rescan of current selected resource path. bool rescan_ = true; /// Flag requesting to scroll to selection on next frame. bool scrollToCurrent_ = false; /// State cache. ValueCache cache_{context_}; /// Frame at which rename started. Non-zero means rename is in-progress. unsigned isRenamingFrame_ = 0; /// Current value of text widget during rename. ea::string renameBuffer_; }; }
/* 1023 组个最小数 (20 分) */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { // 处理输入 int n = 10; int quantities[n]; for (int i = 0; i < n; i++) { if (scanf("%d", &quantities[i]) != 1) return EXIT_FAILURE; } // 组装数字 int nums[50] = {0}; int count = 0; // 找到开头的数字 for (int i = 1; i < n; i++) { if (quantities[i] > 0) { nums[count] = i; count++; quantities[i]--; break; } } // 组装剩余的数字 for (int i = 0; i < n; i++) { while (quantities[i] > 0) { nums[count] = i; count++; quantities[i]--; } } // 处理输出 for (int i = 0; i < count; i++) { printf("%d", nums[i]); } return EXIT_SUCCESS; }
// // DYMEPubChapterFile.h // DYMEpubToPlistConverter // // Created by Dong Yiming on 15/11/13. // Copyright © 2015年 Dong Yiming. All rights reserved. // #import <Foundation/Foundation.h> @interface DYMEPubChapterFile : NSObject @property (nonatomic, copy) NSString *chapterID; @property (nonatomic, copy) NSString *href; @property (nonatomic, copy) NSString *mediaType; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *content; @end
/* * Simple Vulkan application * * Copyright (c) 2016 by Mathias Johansson * * This code is licensed under the MIT license * https://opensource.org/licenses/MIT */ #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include "util/vulkan.h" #include "util/window.h" int main() { // Create an instance of vulkan createInstance("Vulkan"); setupDebugging(); getDevice(); openWindow(); createCommandPool(); createCommandBuffer(); prepRender(); beginCommands(); VkClearColorValue clearColor = { .uint32 = {1, 0, 0, 1} }; VkImageMemoryBarrier preImageBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, queueFam, queueFam, swapImages[nextImage], swapViewInfos[nextImage].subresourceRange }; vkCmdPipelineBarrier( comBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, 1, &preImageBarrier ); vkCmdClearColorImage( comBuffer, swapImages[nextImage], VK_IMAGE_LAYOUT_GENERAL, &clearColor, 1, &swapViewInfos[nextImage].subresourceRange ); VkImageMemoryBarrier postImageBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, swapImages[nextImage], swapViewInfos[nextImage].subresourceRange }; vkCmdPipelineBarrier( comBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, NULL, 1, &postImageBarrier ); endCommands(); submitCommandBuffer(); tickWindow(); sleep(3); // DESTROY destroyInstance(); quitWindow(); return 0; }
#ifndef DIMACSGENERATOR_H #define DIMACSGENERATOR_H 1 #include <vector> #include <fstream> #include "cnfclause.h" #include "cnfformula.h" #include "satgenerator.h" /** A very very basic DIMACS parser. Only parses for cnf formulas. */ class DimacsGenerator : public SatGenerator{ private: std::string filename; public: /** constructor - reads the formula from the file and creates it @param file the file to read @param k arity of a clause */ DimacsGenerator(std::string filename, unsigned int k); /** @return sat formula from the file */ void generate_sat(CNFFormula & f); }; #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #endif #import "DataStatistic.h" #import "TalkingData.h" #import "TalkingDataSMS.h" FOUNDATION_EXPORT double DataStatisticVersionNumber; FOUNDATION_EXPORT const unsigned char DataStatisticVersionString[];
#ifndef MESSAGEFILE_H #define MESSAGEFILE_H #include "xmlserializable.h" #include <QList> #include <QByteArray> #include <QImage> #include "messagekey.h" #include "messagetypemix.h" namespace Velasquez { class DrawingElement; } namespace MoodBox { #define MESSAGE_FILE_EXTENSION ".mbm" #define MESSAGE_TIMESTAMP "dd.MM.yyyy hh-mm-ss-zzz" #define MESSAGE_FILE_XML_TAGNAME "Message" #define MESSAGE_FILE_ID_ATTRIBUTE "Id" #define MESSAGE_TYPE_XML_ATTRIBUTE "Type" #define MESSAGE_SENTDATE_XML_ATTRIBUTE "SentDate" #define MESSAGE_RECIPIENT_XML_ATTRIBUTE "Recipient" #define MESSAGE_AUTHOR_XML_ATTRIBUTE "Author" #define MESSAGE_AUTHORLOGIN_XML_ATTRIBUTE "AuthorLogin" #define MESSAGE_SENT_XML_ATTRIBUTE "Sent" #define MESSAGE_ISPUBLIC_XML_ATTRIBUTE "IsPublic" #define MESSAGE_ONBEHALF_XML_TAGNAME "OnBehalf" #define MESSAGE_TYPE_PRIVATE_VALUE "Private" #define MESSAGE_TYPE_FRIENDS_VALUE "Friends" #define MESSAGE_TYPE_CHANNEL_VALUE "Channel" #define MESSAGE_YES_VALUE "Yes" #define MESSAGE_NO_VALUE "No" #define METAINFO_IMAGEFORMAT_TITLE "Image" #define METAINFO_IMAGEFORMAT_TAGNAME "Type" #define METAINFO_IMAGEFORMAT_VALUEPREFIX "image/" // Drawing Message file base info class MessageFileBase : public MessageTypeMix, protected XmlSerializable { public: MessageFileBase(); MessageFileBase(MessageType::MessageTypeEnum type, qint32 authorId); MessageFileBase(qint32 recipientId, qint32 authorId); inline void setId(qint32 id) { key.setId(id); }; inline qint32 getId() const { return key.getId(); }; inline void setSentDate(const QDateTime &date) { key.setDate(date); }; inline QDateTime getSentDate() const { return key.getDate(); }; inline void setAuthor(qint32 authorId) { this->authorId = authorId; }; inline qint32 getAuthor() const { return authorId; }; inline void setAuthorLogin(const QString &authorLogin) { this->authorLogin = authorLogin; }; inline QString getAuthorLogin() const { return authorLogin; }; inline void setSent(bool sent) { this->sent = sent; }; inline bool getSent() const { return sent; }; inline void setPublic(bool isPublic) { this->isPublic = isPublic; }; inline bool getPublic() const { return isPublic; }; inline void setFileName(const QString &fileName) { this->fileName = fileName; }; inline QString getFileName() const { return this->fileName; }; inline MessageKey getMessageKey() const { return key; }; SerializationResult save(); SerializationResult load(); static QString messageTypeToString(MessageType::MessageTypeEnum type); static MessageType::MessageTypeEnum messageTypeFromString(const QString &string, bool *ok = NULL); static QString messageBoolToString(bool value); static bool messageBoolFromString(const QString &string); protected: virtual SerializationResult saveToXml(QXmlStreamWriter* writer) const; virtual SerializationResult loadFromXml(QXmlStreamReader* reader); virtual SerializationResult saveContentToXml(QXmlStreamWriter* writer) const; virtual SerializationResult loadContentFromXml(QXmlStreamReader* reader); private: MessageKey key; qint32 authorId; QString authorLogin; bool sent; bool isPublic; QString fileName; }; // Drawing Message file with elements buffer class MessageFile : public MessageFileBase { public: MessageFile(); MessageFile(MessageType::MessageTypeEnum type, qint32 authorId); MessageFile(qint32 recipientId, qint32 authorId); // Information inline void setInfo(const QString &info) { this->info = info; }; QString getInfo() const { return info; }; // Image format info QString getImageFormatFromInfo() const; // Preview works void setPreview(const QImage &preview); void setPreview(const QByteArray &previewBytes); inline QImage getPreview() const { return preview; }; inline QByteArray getPreviewBytes() const { return previewBytes; }; protected: virtual SerializationResult saveContentToXml(QXmlStreamWriter* writer) const; virtual SerializationResult loadContentFromXml(QXmlStreamReader* reader); private: QString info; QImage preview; QByteArray previewBytes; void updateBytesFromPreview(); void updatePreviewFromBytes(); }; } #endif // MESSAGEFILE_H
/*************************************************************************/ /* surface_tool.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* 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 SURFACE_TOOL_H #define SURFACE_TOOL_H #include "scene/resources/mesh.h" #include "thirdparty/misc/mikktspace.h" class SurfaceTool : public Reference { GDCLASS(SurfaceTool, Reference); public: struct Vertex { Vector3 vertex; Color color; Vector3 normal; // normal, binormal, tangent Vector3 binormal; Vector3 tangent; Vector2 uv; Vector2 uv2; Vector<int> bones; Vector<float> weights; bool operator==(const Vertex &p_vertex) const; Vertex() {} }; private: struct VertexHasher { static _FORCE_INLINE_ uint32_t hash(const Vertex &p_vtx); }; bool begun; bool first; Mesh::PrimitiveType primitive; int format; Ref<Material> material; //arrays List<Vertex> vertex_array; List<int> index_array; Map<int, bool> smooth_groups; //memory Color last_color; Vector3 last_normal; Vector2 last_uv; Vector2 last_uv2; Vector<int> last_bones; Vector<float> last_weights; Plane last_tangent; void _create_list_from_arrays(Array arr, List<Vertex> *r_vertex, List<int> *r_index, int &lformat); void _create_list(const Ref<Mesh> &p_existing, int p_surface, List<Vertex> *r_vertex, List<int> *r_index, int &lformat); //mikktspace callbacks static int mikktGetNumFaces(const SMikkTSpaceContext *pContext); static int mikktGetNumVerticesOfFace(const SMikkTSpaceContext *pContext, const int iFace); static void mikktGetPosition(const SMikkTSpaceContext *pContext, float fvPosOut[], const int iFace, const int iVert); static void mikktGetNormal(const SMikkTSpaceContext *pContext, float fvNormOut[], const int iFace, const int iVert); static void mikktGetTexCoord(const SMikkTSpaceContext *pContext, float fvTexcOut[], const int iFace, const int iVert); static void mikktSetTSpaceBasic(const SMikkTSpaceContext *pContext, const float fvTangent[], const float fSign, const int iFace, const int iVert); protected: static void _bind_methods(); public: void begin(Mesh::PrimitiveType p_primitive); void add_vertex(const Vector3 &p_vertex); void add_color(Color p_color); void add_normal(const Vector3 &p_normal); void add_tangent(const Plane &p_tangent); void add_uv(const Vector2 &p_uv); void add_uv2(const Vector2 &p_uv); void add_bones(const Vector<int> &p_indices); void add_weights(const Vector<float> &p_weights); void add_smooth_group(bool p_smooth); void add_triangle_fan(const Vector<Vector3> &p_vertexes, const Vector<Vector2> &p_uvs = Vector<Vector2>(), const Vector<Color> &p_colors = Vector<Color>(), const Vector<Vector2> &p_uv2s = Vector<Vector2>(), const Vector<Vector3> &p_normals = Vector<Vector3>(), const Vector<Plane> &p_tangents = Vector<Plane>()); void add_index(int p_index); void index(); void deindex(); void generate_normals(); void generate_tangents(); void add_to_format(int p_flags) { format |= p_flags; } void set_material(const Ref<Material> &p_material); void clear(); List<Vertex> &get_vertex_array() { return vertex_array; } void create_from_triangle_arrays(const Array &p_arrays); Array commit_to_arrays(); void create_from(const Ref<Mesh> &p_existing, int p_surface); void append_from(const Ref<Mesh> &p_existing, int p_surface, const Transform &p_xform); Ref<ArrayMesh> commit(const Ref<ArrayMesh> &p_existing = Ref<ArrayMesh>()); SurfaceTool(); }; #endif
#pragma once class Menu : public QWidget { private: QGridLayout layout; QPushButton play_single; QPushButton play_2v2; QPushButton play_multi; public: Menu(Window *window, Game *game); };
// node-vcdiff // https://github.com/baranov1ch/node-vcdiff // // Copyright 2014 Alexey Baranov <[email protected]> // Released under the MIT license #ifndef VCDIFF_H_ #define VCDIFF_H_ #include <memory> #include <string> #include <node.h> #include <node_object_wrap.h> #include <uv.h> #include <v8.h> namespace open_vcdiff { class OutputStringInterface; } class VcdCtx : public node::ObjectWrap { public: enum class Mode { ENCODE, DECODE, }; enum class Error { OK, INIT_ERROR, ENCODE_ERROR, DECODE_ERROR, }; class Coder { public: virtual Error Start(open_vcdiff::OutputStringInterface* out) = 0; virtual Error Process(const char* data, size_t len, open_vcdiff::OutputStringInterface* out) = 0; virtual Error Finish(open_vcdiff::OutputStringInterface* out) = 0; virtual ~Coder() {} }; VcdCtx(std::unique_ptr<Coder> coder); virtual ~VcdCtx(); static void Init(v8::Handle<v8::Object> exports); static v8::Persistent<v8::Function> constructor; static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static void WriteAsync(const v8::FunctionCallbackInfo<v8::Value>& args); static void WriteSync(const v8::FunctionCallbackInfo<v8::Value>& args); static void Close(const v8::FunctionCallbackInfo<v8::Value>& args); private: enum class State { IDLE, PROCESSING, FINALIZING, DONE, }; struct WorkData { VcdCtx* ctx; v8::Isolate* isolate; const char* data; size_t len; bool is_last; }; static void WriteInternal( const v8::FunctionCallbackInfo<v8::Value>& args, bool async); v8::Local<v8::Object> Write( v8::Local<v8::Object> buffer, bool is_last, bool async); v8::Local<v8::Array> FinishWrite(v8::Isolate* isolate); void Process(const char* data, size_t len, bool is_last); bool CheckError(v8::Isolate* isolate); void SendError(v8::Isolate* isolate); void Close(); void Reset(); bool HasError() const; v8::Local<v8::Object> GetOutputBuffer(v8::Isolate* isolate); static const char* GetErrorString(Error err); static void ProcessShim(uv_work_t* work_req); static void AfterShim(uv_work_t* work_req, int status); std::unique_ptr<Coder> coder_; v8::Persistent<v8::Object> in_buffer_; // hold reference when async uv_work_t work_req_; bool write_in_progress_ = false; bool pending_close_ = false; State state_ = State::IDLE; Error err_ = Error::OK; std::string output_buffer_; VcdCtx(const VcdCtx& other) = delete; VcdCtx& operator=(const VcdCtx& other) = delete; }; #endif // VCDIFF_H_
/******************************************************************************** ** Form generated from reading UI file 'modifystationdlg.ui' ** ** Created by: Qt User Interface Compiler version 5.7.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_MODIFYSTATIONDLG_H #define UI_MODIFYSTATIONDLG_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QDialog> #include <QtWidgets/QGridLayout> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QPushButton> #include <QtWidgets/QSpacerItem> #include <QtWidgets/QVBoxLayout> QT_BEGIN_NAMESPACE class Ui_ModifyStationDlg { public: QGridLayout *gridLayout_2; QGroupBox *groupBox; QGridLayout *gridLayout; QVBoxLayout *verticalLayout; QHBoxLayout *horizontalLayout; QLabel *label; QLineEdit *lineEdit; QHBoxLayout *horizontalLayout_2; QSpacerItem *horizontalSpacer; QPushButton *pushButton; void setupUi(QDialog *ModifyStationDlg) { if (ModifyStationDlg->objectName().isEmpty()) ModifyStationDlg->setObjectName(QStringLiteral("ModifyStationDlg")); ModifyStationDlg->resize(311, 111); gridLayout_2 = new QGridLayout(ModifyStationDlg); gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); groupBox = new QGroupBox(ModifyStationDlg); groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); gridLayout->setObjectName(QStringLiteral("gridLayout")); verticalLayout = new QVBoxLayout(); verticalLayout->setObjectName(QStringLiteral("verticalLayout")); horizontalLayout = new QHBoxLayout(); horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); label = new QLabel(groupBox); label->setObjectName(QStringLiteral("label")); label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); horizontalLayout->addWidget(label); lineEdit = new QLineEdit(groupBox); lineEdit->setObjectName(QStringLiteral("lineEdit")); horizontalLayout->addWidget(lineEdit); verticalLayout->addLayout(horizontalLayout); horizontalLayout_2 = new QHBoxLayout(); horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout_2->addItem(horizontalSpacer); pushButton = new QPushButton(groupBox); pushButton->setObjectName(QStringLiteral("pushButton")); horizontalLayout_2->addWidget(pushButton); verticalLayout->addLayout(horizontalLayout_2); gridLayout->addLayout(verticalLayout, 0, 0, 1, 1); gridLayout_2->addWidget(groupBox, 0, 0, 1, 1); retranslateUi(ModifyStationDlg); QMetaObject::connectSlotsByName(ModifyStationDlg); } // setupUi void retranslateUi(QDialog *ModifyStationDlg) { ModifyStationDlg->setWindowTitle(QApplication::translate("ModifyStationDlg", "ModifyStation", 0)); groupBox->setTitle(QApplication::translate("ModifyStationDlg", "GroupBox", 0)); label->setText(QApplication::translate("ModifyStationDlg", "\350\257\267\350\276\223\345\205\245\344\277\256\346\224\271\345\200\274\357\274\232", 0)); pushButton->setText(QApplication::translate("ModifyStationDlg", "\346\217\220\344\272\244", 0)); } // retranslateUi }; namespace Ui { class ModifyStationDlg: public Ui_ModifyStationDlg {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MODIFYSTATIONDLG_H
/* Copyright (C) 2001-2015 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ #ifndef BACKEND_GEO_H #define BACKEND_GEO_H #include "potracelib.h" int page_geojson(FILE *fout, potrace_path_t *plist, int as_polygons); #endif /* BACKEND_GEO_H */
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" // Not exported @interface GQDWPColumn : NSObject { long long mIndex; float mWidth; float mSpacing; _Bool mHasSpacing; } + (const struct StateSpec *)stateForReading; - (float)spacing; - (_Bool)hasSpacing; - (float)width; - (long long)index; - (int)readAttributesFromReader:(struct _xmlTextReader *)arg1; @end
// // AppDelegate.h // discovery // // Created by Karthik Rao on 1/20/17. // Copyright © 2017 Karthik Rao. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* File: Reachability.h Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. Version: 2.1 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2010 Apple Inc. All Rights Reserved. */ #import <Foundation/Foundation.h> #import <SystemConfiguration/SystemConfiguration.h> typedef enum { NotReachable = 0, ReachableViaWiFi, ReachableViaWWAN } NetworkStatus; #define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" @interface Reachability: NSObject { BOOL localWiFiRef; SCNetworkReachabilityRef reachabilityRef; } //reachabilityWithHostName- Use to check the reachability of a particular host name. + (Reachability*) reachabilityWithHostName: (NSString*) hostName; //reachabilityWithAddress- Use to check the reachability of a particular IP address. + (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; //reachabilityForInternetConnection- checks whether the default route is available. // Should be used by applications that do not connect to a particular host + (Reachability*) reachabilityForInternetConnection; //reachabilityForLocalWiFi- checks whether a local wifi connection is available. + (Reachability*) reachabilityForLocalWiFi; //Start listening for reachability notifications on the current run loop - (BOOL) startNotifier; - (void) stopNotifier; - (NetworkStatus) currentReachabilityStatus; //WWAN may be available, but not active until a connection has been established. //WiFi may require a connection for VPN on Demand. - (BOOL) connectionRequired; @end
#ifndef LIBFEEDKIT_CONSTANTS_H #define LIBFEEDKIT_CONSTANTS_H #include <String.h> #include <vector> namespace FeedKit { class Channel; class Content; class Enclosure; class Feed; class Item; extern const char *ServerSignature; typedef std::vector<BString> uuid_list_t; typedef std::vector<Content *> content_list_t; typedef std::vector<Channel *> channel_list_t; typedef std::vector<Enclosure *> enclosure_list_t; typedef std::vector<Feed *> feed_list_t; typedef std::vector<Item *> item_list_t; namespace FromServer { enum msg_what { SettingsUpdated = 'rfsu', // Settings have been updated }; }; namespace ErrorCode { enum code { UnableToParseFeed = 'ecpf', // Unable to parse the Feed InvalidItem = 'ecii', // Invalid Item InvalidEnclosure = 'ecie', // Invalid Enclosure InvalidEnclosurePath = 'ecip', // Invalid Enclosure path UnableToStartDownload = 'ecsd', // Unable to start downloading the Enclosure }; }; // The Settings namespace details things relating to settings and settings templates namespace Settings { enum display_type { Unset = ' ', // Unset - don't use, used internally Hidden = 'hide', // A setting not controlled by the user RadioButton = 'rabu', // Radio buttons CheckBox = 'chkb', // Check boxes MenuSingle = 'mens', // Single-select menu MenuMulti = 'menm', // Multiple-select menu TextSingle = 'txts', // Single line text control TextMulti = 'txtm', // Multi line text control TextPassword = 'txtp', // Single line, hidden input, text control FilePickerSingle = 'fpks', // File Picker - single file FilePickerMulti = 'fpkm', // File Picker - multiple file DirectoryPickerSingle = 'dpks', // Directory Picker - single DirectoryPickerMultiple = 'dpkm', // Directory picker - multiple }; // These are some common types of applications. The Type param of FeedListener is free // form but you should use one of these constants, if possible, to ensure consistency namespace AppTypes { extern const char *SettingClient; // Something which allows user interaction extern const char *SettingServer; // The server extern const char *SettingUtil; // Interacts with the FeedKit but not the // user extern const char *SettingParser; // An addon for parsing data into FeedKit // objects extern const char *SettingFeed; // Settings specific to a feed }; namespace Icon { enum Location { Contents = 'cnts', // Icon comes from the contents of the file TrackerIcon = 'trki', // Use the Tracker icon }; }; }; }; #endif
#include <stdio.h> struct Employee { unsigned int id; char name[256]; char gender; float salary; }; void addEmployee(FILE *f) { struct Employee emp; printf("Adding a new employee, please type his id \n"); int id; scanf("%d", &id); if (id > 0) { while (1) { //search if id already in use struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) { //end of file emp.id = id; break; } if (id == tmp.id) { printf("Id already in use, id must be unique \n"); return; } else { emp.id = id; } } } else { printf("Id must be greater than 0 \n"); return; } printf("Please type his name \n"); scanf("%s", &emp.name); printf("Please type his gender (m or f) \n"); scanf(" %c", &emp.gender); if ((emp.gender != 'm') && (emp.gender != 'f')) { printf("Gender should be 'm' or 'f'"); return; } printf("Please type his salary \n"); scanf("%f", &emp.salary); fwrite(&emp, sizeof(struct Employee), 1, f); } void removeEmployee(FILE *f) { printf("Removing employee, please type his id \n"); int id; scanf("%d)", &id); while (1) { struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) { printf("Employee not found"); return; } if (id == tmp.id) { fseek(f, -sizeof(struct Employee), SEEK_CUR); tmp.id = 0; fwrite(&tmp, sizeof(struct Employee), 1, f); printf("Sucess \n"); return; } } } void calculateAvarageSalaryByGender(FILE *f) { printf("Calculating the avarage salary by gender \n"); int maleNumber = 0; int femaleNumber = 0; float sumMale = 0; float sumFemale = 0; while (1) { struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) break; if (tmp.id == 0) continue; if (tmp.gender == 'm') { maleNumber++; sumMale += tmp.salary; } else { femaleNumber++; sumFemale += tmp.salary; } } printf("Avarage male salary: %f \n", sumMale/maleNumber); printf("Avarage female salary: %f \n", sumFemale/femaleNumber); } void exportTextFile(FILE *f) { char path[256]; printf("Please type the name of the file to store the data \n"); scanf("%s)", &path); FILE *final; if ((final = fopen(path, "w")) == NULL) { printf("Error opening/creating the file"); } else { while (1) { struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) break; if (tmp.id != 0) { fprintf(final, "ID: %d \n", tmp.id); fprintf(final, "Name: %s \n", tmp.name); fprintf(final, "Gender: %c \n", tmp.gender); fprintf(final, "Salary: %f \n", tmp.salary); } } } fclose(final); } void compactData(FILE *f, char fileName[]) { FILE *copy; if ((copy = fopen("copy", "wb")) == NULL) { printf("Error creating the copy file"); } else { while (1) { struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) break; if (tmp.id != 0) { fwrite(&tmp, sizeof(struct Employee), 1, copy); } } fclose(copy); remove(fileName); rename("copy", fileName); } printf("Database compacted"); } int main(int argc, char *argv[]) { if (argc == 3) { int option = atoi(argv[2]); FILE *f; f = fopen(argv[1], "ab+"); fclose(f); switch(option) { case 1: if ((f = fopen(argv[1], "ab+")) == NULL) { printf("Error opening/creating the file"); } else { addEmployee(f); fclose(f); } break; case 2: if ((f = fopen(argv[1], "rb+")) == NULL) { printf("Error opening/creating the file"); } else { removeEmployee(f); fclose(f); } break; case 3: if ((f = fopen(argv[1], "rb")) == NULL) { printf("Error opening/creating the file"); } else { calculateAvarageSalaryByGender(f); fclose(f); } break; case 4: if ((f = fopen(argv[1], "rb")) == NULL) { printf("Error opening/creating the file"); } else { exportTextFile(f); fclose(f); } break; case 5: if ((f = fopen(argv[1], "rb")) == NULL) { printf("Error opening/creating the file"); } else { compactData(f, argv[1]); fclose(f); } break; } } else { printf("Need to provide two arguments, the first one is the binary file and second is the option. \n"); printf("1 - Add employee \n"); printf("2 - Remove employee \n"); printf("3 - Calculate avarage salary by gender \n"); printf("4 - Export data to a text file \n"); printf("5 - Compact data \n"); } return 0; }
// // YYBaseLib.h // YYBaseLib // // Created by 银羽网络 on 16/7/19. // Copyright © 2016年 银羽网络. All rights reserved. // #import <UIKit/UIKit.h> #import "AppConfig.h" #import "BaseViewController.h" #import "CommonTool.h" #import "DataVerify.h" #import "FSMediaPicker.h" #import "MBProgressHUD+MBProgressHUD_Category.h" #import "EnumModel.h" #import "UsersModel.h" #import "NSDataAdditions.h" #import "NSDate_Extensions.h" #import "NSDictionary_Extensions.h" #import "NSObject_Extensions.h" #import "NSString_Extensions.h" #import "UIImageExtentions.h" #import "UILabel_Extensions.h" #import "PopupBaseView.h" #import "SDCycleScrollView.h" #import "UIButton+FillColor.h" #import "UIColor_Extensions.h" #import "UIImage+UIImage.h" #import "UIImage+UIImageScale.h" #import "UITableView+FDTemplateLayoutCell.h" #import "UITextView+Placeholder.h" #import "UIView+extensions.h" #import "UIView+Masonry.h" #import "AuthService.h" #import "AppManager.h" #import "ApiService.h" #import "GTMBase64.h" #import "GTMDefines.h" #import "ConsultGradeModel.h" #import "CategoryModel.h" #import "CityModel.h" #import "MenuModel.h" //! Project version number for YYBaseLib. FOUNDATION_EXPORT double YYBaseLibVersionNumber; //! Project version string for YYBaseLib. FOUNDATION_EXPORT const unsigned char YYBaseLibVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <YYBaseLib/PublicHeader.h>
#pragma once /** * Copyright (c) blueback * Released under the MIT License * https://github.com/bluebackblue/brownie/blob/master/LICENSE.txt * http://bbbproject.sakura.ne.jp/wordpress/mitlicense * @brief OpenGL。 */ /** include */ #pragma warning(push) #pragma warning(disable:4464) #include "../types/types.h" #pragma warning(pop) /** include */ #pragma warning(push) #pragma warning(disable:4464) #include "../actionbatching/actionbatching.h" #pragma warning(pop) /** include */ #include "./opengl_impl.h" #include "./opengl_impl_include.h" /** NBsys::NOpengl */ #if(BSYS_OPENGL_ENABLE) #pragma warning(push) #pragma warning(disable:4710) namespace NBsys{namespace NOpengl { /** バーテックスバッファ作成。 */ class Opengl_Impl_ActionBatching_Shader_Load : public NBsys::NActionBatching::ActionBatching_ActionItem_Base { private: /** opengl_impl */ Opengl_Impl& opengl_impl; /** shaderlayout */ sharedptr<Opengl_ShaderLayout> shaderlayout; /** asyncresult */ AsyncResult<bool> asyncresult; public: /** constructor */ Opengl_Impl_ActionBatching_Shader_Load(Opengl_Impl& a_opengl_impl,const sharedptr<Opengl_ShaderLayout>& a_shaderlayout,AsyncResult<bool>& a_asyncresult) : opengl_impl(a_opengl_impl), shaderlayout(a_shaderlayout), asyncresult(a_asyncresult) { } /** destructor */ virtual ~Opengl_Impl_ActionBatching_Shader_Load() { } private: /** copy constructor禁止。 */ Opengl_Impl_ActionBatching_Shader_Load(const Opengl_Impl_ActionBatching_Shader_Load& a_this) = delete; /** コピー禁止。 */ void operator =(const Opengl_Impl_ActionBatching_Shader_Load& a_this) = delete; public: /** アクション開始。 */ virtual void Start() { } /** アクション中。 */ virtual s32 Do(f32& a_delta,bool a_endrequest) { if(a_endrequest == true){ //中断。 } if(this->shaderlayout->IsBusy() == true){ //継続。 a_delta -= 1.0f; return 0; } //Render_LoadShader this->opengl_impl.Render_LoadShader(this->shaderlayout); //asyncresult this->asyncresult.Set(true); //成功。 return 1; } }; }} #pragma warning(pop) #endif
// Copyright (c) 2020 The Firo Core Developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef FIRO_ELYSIUM_SIGMAWALLETV0_H #define FIRO_ELYSIUM_SIGMAWALLETV0_H #include "sigmawallet.h" namespace elysium { class SigmaWalletV0 : public SigmaWallet { public: SigmaWalletV0(); protected: uint32_t BIP44ChangeIndex() const; SigmaPrivateKey GeneratePrivateKey(uint512 const &seed); class Database : public SigmaWallet::Database { public: Database(); public: bool WriteMint(SigmaMintId const &id, SigmaMint const &mint, CWalletDB *db = nullptr); bool ReadMint(SigmaMintId const &id, SigmaMint &mint, CWalletDB *db = nullptr) const; bool EraseMint(SigmaMintId const &id, CWalletDB *db = nullptr); bool HasMint(SigmaMintId const &id, CWalletDB *db = nullptr) const; bool WriteMintId(uint160 const &hash, SigmaMintId const &mintId, CWalletDB *db = nullptr); bool ReadMintId(uint160 const &hash, SigmaMintId &mintId, CWalletDB *db = nullptr) const; bool EraseMintId(uint160 const &hash, CWalletDB *db = nullptr); bool HasMintId(uint160 const &hash, CWalletDB *db = nullptr) const; bool WriteMintPool(std::vector<MintPoolEntry> const &mints, CWalletDB *db = nullptr); bool ReadMintPool(std::vector<MintPoolEntry> &mints, CWalletDB *db = nullptr); void ListMints(std::function<void(SigmaMintId&, SigmaMint&)> const&, CWalletDB *db = nullptr); }; public: using SigmaWallet::GeneratePrivateKey; }; } #endif // FIRO_ELYSIUM_SIGMAWALLETV0_H
#if !defined(AFX_DIALOG3_H__8EF7DE42_F33E_4217_87B0_FE9ACBCE3E84__INCLUDED_) #define AFX_DIALOG3_H__8EF7DE42_F33E_4217_87B0_FE9ACBCE3E84__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Dialog3.h : header file // ///////////////////////////////////////////////////////////////////////////// // CDialog3 dialog class CDialog3 : public CDialog { // Construction public: CDialog3(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDialog3) enum { IDD = IDD_DIALOG3 }; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDialog3) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CDialog3) virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DIALOG3_H__8EF7DE42_F33E_4217_87B0_FE9ACBCE3E84__INCLUDED_)
/* * Copyright 2013 MongoDB, Inc. * * 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 BSON_COMPAT_H #define BSON_COMPAT_H #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) # error "Only <bson.h> can be included directly." #endif #if defined(__MINGW32__) # if defined(__USE_MINGW_ANSI_STDIO) # if __USE_MINGW_ANSI_STDIO < 1 # error "__USE_MINGW_ANSI_STDIO > 0 is required for correct PRI* macros" # endif # else # define __USE_MINGW_ANSI_STDIO 1 # endif #endif #include "bson-config.h" #include "bson-macros.h" #ifdef BSON_OS_WIN32 # if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0600) # undef _WIN32_WINNT # endif # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0600 # endif # ifndef NOMINMAX # define NOMINMAX # endif # include <winsock2.h> # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # include <windows.h> # undef WIN32_LEAN_AND_MEAN # else # include <windows.h> # endif #include <direct.h> #include <io.h> #endif #ifdef BSON_OS_UNIX # include <unistd.h> # include <sys/time.h> #endif #include "bson-macros.h" #include <errno.h> #include <ctype.h> #include <limits.h> #include <fcntl.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> BSON_BEGIN_DECLS #ifdef _MSC_VER # include "bson-stdint-win32.h" # ifndef __cplusplus /* benign redefinition of type */ # pragma warning (disable :4142) # ifndef _SSIZE_T_DEFINED # define _SSIZE_T_DEFINED typedef SSIZE_T ssize_t; # endif typedef SIZE_T size_t; # pragma warning (default :4142) # else /* * MSVC++ does not include ssize_t, just size_t. * So we need to synthesize that as well. */ # pragma warning (disable :4142) # ifndef _SSIZE_T_DEFINED # define _SSIZE_T_DEFINED typedef SSIZE_T ssize_t; # endif # pragma warning (default :4142) # endif # define PRIi32 "d" # define PRId32 "d" # define PRIu32 "u" # define PRIi64 "I64i" # define PRId64 "I64i" # define PRIu64 "I64u" #else # include "bson-stdint.h" # include <inttypes.h> #endif #if defined(__MINGW32__) && ! defined(INIT_ONCE_STATIC_INIT) # define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT typedef RTL_RUN_ONCE INIT_ONCE; #endif #ifdef BSON_HAVE_STDBOOL_H # include <stdbool.h> #elif !defined(__bool_true_false_are_defined) # ifndef __cplusplus typedef signed char bool; # define false 0 # define true 1 # endif # define __bool_true_false_are_defined 1 #endif #if defined(__GNUC__) # if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) # define bson_sync_synchronize() __sync_synchronize() # elif defined(__i386__ ) || defined( __i486__ ) || defined( __i586__ ) || \ defined( __i686__ ) || defined( __x86_64__ ) # define bson_sync_synchronize() asm volatile("mfence":::"memory") # else # define bson_sync_synchronize() asm volatile("sync":::"memory") # endif #elif defined(_MSC_VER) # define bson_sync_synchronize() MemoryBarrier() #endif #if !defined(va_copy) && defined(__va_copy) # define va_copy(dst,src) __va_copy(dst, src) #endif #if !defined(va_copy) # define va_copy(dst,src) ((dst) = (src)) #endif BSON_END_DECLS #endif /* BSON_COMPAT_H */
/* * Business.h * UsersService * * Copyright 2011 QuickBlox team. All rights reserved. * */ #import "QBUsersModels.h"
// // GFTestAppDelegate.h // TestChaosApp // // Created by Michael Charkin on 2/26/14. // Copyright (c) 2014 GitFlub. All rights reserved. // #import <UIKit/UIKit.h> @interface GFTestAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // rbLinkedList.h // rbLinkedList // // Created by Ryan Bemowski on 4/6/15. // #pragma once #include <string> struct Node { int key; Node *next; }; class rbLinkedList { public: /** Constructor for the rbLinkedList class. */ rbLinkedList(); /** Deconstructor for the rbLinkedList class. */ ~rbLinkedList(); /** Determine if the collection is empty or not. * @return: A bool that will be true if the collection is empty and false * otherwise. */ bool IsEmpty(); /** Determine the number of nodes within the linked list. * @return: An integer that represents the number of nodes between the head * and tail nodes. */ int Size(); void AddKey(int key); void RemoveKey(int key); std::string ToString(); private: Node *h_; Node *z_; };
// // KAAppDelegate.h // UIViewController-KeyboardAdditions // // Created by CocoaPods on 02/03/2015. // Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. // #import <UIKit/UIKit.h> @interface KAAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* HardwareSerial.h - Hardware serial library for Wiring Copyright (c) 2006 Nicholas Zambetti. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef HardwareSerial_h #define HardwareSerial_h #include <inttypes.h> #include "Print.h" struct ring_buffer; #if defined(__AVR_ATmega103__) class HardwareSerial : public Print { private: ring_buffer *_rx_buffer; volatile uint8_t *_ubrr; volatile uint8_t *_ucr; volatile uint8_t *_usr; volatile uint8_t *_udr; uint8_t _rxen; uint8_t _txen; uint8_t _rxcie; uint8_t _udre; public: HardwareSerial(ring_buffer *rx_buffer, volatile uint8_t *ubrr, volatile uint8_t *ucr, volatile uint8_t *usr, volatile uint8_t *udr, uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre); void begin(long); void end(); uint8_t available(void); int read(void); void flush(void); virtual void write(uint8_t); using Print::write; // pull in write(str) and write(buf, size) from Print }; #else class HardwareSerial : public Print { private: ring_buffer *_rx_buffer; volatile uint8_t *_ubrrh; volatile uint8_t *_ubrrl; volatile uint8_t *_ucsra; volatile uint8_t *_ucsrb; volatile uint8_t *_udr; uint8_t _rxen; uint8_t _txen; uint8_t _rxcie; uint8_t _udre; uint8_t _u2x; public: HardwareSerial(ring_buffer *rx_buffer, volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, volatile uint8_t *ucsra, volatile uint8_t *ucsrb, volatile uint8_t *udr, uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x); void begin(long); void end(); uint8_t available(void); int read(void); void flush(void); virtual void write(uint8_t); using Print::write; // pull in write(str) and write(buf, size) from Print }; #endif extern HardwareSerial Serial; #if defined(__AVR_ATmega1280__) extern HardwareSerial Serial1; extern HardwareSerial Serial2; extern HardwareSerial Serial3; #endif #endif
/* Copyright (c) 2014-2020, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #include "core/or/or.h" #ifndef TOR_LOG_TEST_HELPERS_H #define TOR_LOG_TEST_HELPERS_H /** An element of mock_saved_logs(); records the log element that we * received. */ typedef struct mock_saved_log_entry_t { int severity; const char *funcname; const char *suffix; const char *format; char *generated_msg; } mock_saved_log_entry_t; void mock_clean_saved_logs(void); const smartlist_t *mock_saved_logs(void); void setup_capture_of_logs(int new_level); void setup_full_capture_of_logs(int new_level); void teardown_capture_of_logs(void); int mock_saved_log_has_message(const char *msg); int mock_saved_log_has_message_containing(const char *msg); int mock_saved_log_has_message_not_containing(const char *msg); int mock_saved_log_has_severity(int severity); int mock_saved_log_has_entry(void); int mock_saved_log_n_entries(void); void mock_dump_saved_logs(void); #define assert_log_predicate(predicate, failure_msg) \ do { \ if (!(predicate)) { \ TT_FAIL(failure_msg); \ mock_dump_saved_logs(); \ TT_EXIT_TEST_FUNCTION; \ } \ } while (0) #define expect_log_msg(str) \ assert_log_predicate(mock_saved_log_has_message(str), \ ("expected log to contain \"%s\"", str)); #define expect_log_msg_containing(str) \ assert_log_predicate(mock_saved_log_has_message_containing(str), \ ("expected log to contain \"%s\"", str)); #define expect_log_msg_not_containing(str) \ assert_log_predicate(mock_saved_log_has_message_not_containing(str), \ ("expected log to not contain \"%s\"", str)); #define expect_log_msg_containing_either(str1, str2) \ assert_log_predicate(mock_saved_log_has_message_containing(str1) || \ mock_saved_log_has_message_containing(str2), \ ("expected log to contain \"%s\" or \"%s\"", str1, str2)); #define expect_log_msg_containing_either3(str1, str2, str3) \ assert_log_predicate(mock_saved_log_has_message_containing(str1) || \ mock_saved_log_has_message_containing(str2) || \ mock_saved_log_has_message_containing(str3), \ ("expected log to contain \"%s\" or \"%s\" or \"%s\"", \ str1, str2, str3)) #define expect_log_msg_containing_either4(str1, str2, str3, str4) \ assert_log_predicate(mock_saved_log_has_message_containing(str1) || \ mock_saved_log_has_message_containing(str2) || \ mock_saved_log_has_message_containing(str3) || \ mock_saved_log_has_message_containing(str4), \ ("expected log to contain \"%s\" or \"%s\" or \"%s\" or \"%s\"", \ str1, str2, str3, str4)) #define expect_single_log_msg(str) \ do { \ \ assert_log_predicate(mock_saved_log_has_message_containing(str) && \ mock_saved_log_n_entries() == 1, \ ("expected log to contain exactly 1 message \"%s\"", \ str)); \ } while (0); #define expect_single_log_msg_containing(str) \ do { \ assert_log_predicate(mock_saved_log_has_message_containing(str)&& \ mock_saved_log_n_entries() == 1 , \ ("expected log to contain 1 message, containing \"%s\"",\ str)); \ } while (0); #define expect_no_log_msg(str) \ assert_log_predicate(!mock_saved_log_has_message(str), \ ("expected log to not contain \"%s\"",str)); #define expect_no_log_msg_containing(str) \ assert_log_predicate(!mock_saved_log_has_message_containing(str), \ ("expected log to not contain \"%s\"", str)); #define expect_log_severity(severity) \ assert_log_predicate(mock_saved_log_has_severity(severity), \ ("expected log to contain severity " # severity)); #define expect_no_log_severity(severity) \ assert_log_predicate(!mock_saved_log_has_severity(severity), \ ("expected log to not contain severity " # severity)); #define expect_log_entry() \ assert_log_predicate(mock_saved_log_has_entry(), \ ("expected log to contain entries")); #define expect_no_log_entry() \ assert_log_predicate(!mock_saved_log_has_entry(), \ ("expected log to not contain entries")); #endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
// // AppDelegate.h // EXTabBarController // // Created by apple on 15/5/23. // Copyright (c) 2015年 DeltaX. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#include<stdio.h> int main(void) { double a,b; printf("Enter a\&b:\n"); while(scanf("%lf%lf",&a,&b)==2) { printf("%.3g - %.3g / %.3g * %.3g = %.3g .\n",a,b,a,b,(double)(a-b)/(a*b)); printf("\n"); printf("Enter a\&b:\n"); } printf("done!"); return 0; }
#ifndef _ZLX_PLATFORM_H #define _ZLX_PLATFORM_H #include "arch.h" #if defined(ZLX_FREESTANDING) && ZLX_FREESTANDING #else # undef ZLX_FREESTANDING # define ZLX_FREESTANDING 0 # if defined(_WIN32) # define ZLX_MSWIN 1 # elif defined(_AIX) # define ZLX_AIX 1 # elif defined(__unix__) || defined(__unix) # define ZLX_UNIX 1 # include <unistd.h> # if defined(POSIX_VERSION) # define ZLX_POSIX POSIX_VERSION # endif # if defined(__DragonFly__) # define ZLX_BSD 1 # define ZLX_DRAGONFLY_BSD 1 # elif defined(__FreeBSD__) # define ZLX_BSD 1 # define ZLX_FREEBSD 1 # elif defined(__NetBSD__) # define ZLX_BSD 1 # define ZLX_NETBSD 1 # elif defined(__OpenBSD__) # define ZLX_BSD 1 # define ZLX_OPENBSD 1 # endif # endif /* OS defines */ #endif /* ZLX_FREESTANDING */ /* assume System V ABI if we're not under a Microsoft environment */ #if !defined(ZLX_ABI_SYSV) && !defined(ZLX_ABI_MS) # if defined(_WIN32) # define ZLX_ABI_MS 1 # else # define ZLX_ABI_SYSV 1 # endif #endif #if ZLX_IA32 && ZLX_ABI_MS # define ZLX_FAST_CALL __fastcall #elif ZLX_IA32 && ZLX_ABI_SYSV && (ZLX_GCC || ZLX_CLANG) # define ZLX_FAST_CALL __attribute__((regparm((3)))) #else # define ZLX_FAST_CALL #endif #endif /* _ZLX_PLATFORM_H */
//////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2019 Marco Antognini ([email protected]), // Laurent Gomila ([email protected]) // // 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. // //////////////////////////////////////////////////////////// #import <Cocoa/Cocoa.h> #import <SFML/Graphics.hpp> /* * NB: We need pointers for C++ objects fields in Obj-C interface ! * The recommended way is to use PIMPL idiom. * * It's elegant. Moreover, we do no constrain * other file including this one to be Obj-C++. */ struct SFMLmainWindow; @interface CocoaAppDelegate : NSObject <NSApplicationDelegate> { @private NSWindow* m_window; NSView* m_sfmlView; NSTextField* m_textField; SFMLmainWindow* m_mainWindow; NSTimer* m_renderTimer; BOOL m_visible; BOOL m_initialized; } @property (retain) IBOutlet NSWindow* window; @property (assign) IBOutlet NSView* sfmlView; @property (assign) IBOutlet NSTextField* textField; -(IBAction)colorChanged:(NSPopUpButton*)sender; -(IBAction)rotationChanged:(NSSlider*)sender; -(IBAction)visibleChanged:(NSButton*)sender; -(IBAction)textChanged:(NSTextField*)sender; -(IBAction)updateText:(NSButton*)sender; @end /* * This interface is used to prevent the system alert produced when the SFML view * has the focus and the user press a key. */ @interface SilentWindow : NSWindow -(void)keyDown:(NSEvent*)theEvent; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "CDStructures.h" @interface IDEEditorDocumentValidatedUserInterfaceItem : NSObject <NSValidatedUserInterfaceItem> { SEL _action; long long _tag; } @property long long tag; // @synthesize tag=_tag; @property SEL action; // @synthesize action=_action; @end
//Generated by the Argon Build System /*********************************************************************** Copyright (c) 2006-2011, Skype Limited. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific 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. ***********************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "opus/silk/float/main_FLP.h" /* Autocorrelations for a warped frequency axis */ void silk_warped_autocorrelation_FLP( silk_float *corr, /* O Result [order + 1] */ const silk_float *input, /* I Input data to correlate */ const silk_float warping, /* I Warping coefficient */ const opus_int length, /* I Length of input */ const opus_int order /* I Correlation order (even) */ ) { opus_int n, i; double tmp1, tmp2; double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; /* Order must be even */ silk_assert( ( order & 1 ) == 0 ); /* Loop over samples */ for( n = 0; n < length; n++ ) { tmp1 = input[ n ]; /* Loop over allpass sections */ for( i = 0; i < order; i += 2 ) { /* Output of allpass section */ tmp2 = state[ i ] + warping * ( state[ i + 1 ] - tmp1 ); state[ i ] = tmp1; C[ i ] += state[ 0 ] * tmp1; /* Output of allpass section */ tmp1 = state[ i + 1 ] + warping * ( state[ i + 2 ] - tmp2 ); state[ i + 1 ] = tmp2; C[ i + 1 ] += state[ 0 ] * tmp2; } state[ order ] = tmp1; C[ order ] += state[ 0 ] * tmp1; } /* Copy correlations in silk_float output format */ for( i = 0; i < order + 1; i++ ) { corr[ i ] = ( silk_float )C[ i ]; } }
// // RSAEncryptor.h // iOSProject // // Created by Alpha on 2017/6/12. // Copyright © 2017年 STT. All rights reserved. // #import <Foundation/Foundation.h> @interface RSAEncryptor : NSObject /** * 加密方法 * * @param str 需要加密的字符串 * @param path '.der'格式的公钥文件路径 */ + (NSString *)encryptString:(NSString *)str publicKeyWithContentsOfFile:(NSString *)path; /** * 解密方法 * * @param str 需要解密的字符串 * @param path '.p12'格式的私钥文件路径 * @param password 私钥文件密码 */ + (NSString *)decryptString:(NSString *)str privateKeyWithContentsOfFile:(NSString *)path password:(NSString *)password; /** * 加密方法 * * @param str 需要加密的字符串 * @param pubKey 公钥字符串 */ + (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey; /** * 解密方法 * * @param str 需要解密的字符串 * @param privKey 私钥字符串 */ + (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey; @end
/////////////////////////////////////////////////////////////////////////////// // // (C) Autodesk, Inc. 2007-2011. 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 FORMATCODECINCLUSIVEPROPERTYSETINTERFACE_H #define FORMATCODECINCLUSIVEPROPERTYSETINTERFACE_H #if __GNUC__ >= 4 #pragma GCC visibility push(default) #endif namespace Atil { /// <summary> /// This class groups properties into a set of properties much /// like a "structure" in "c". /// </summary> /// class FormatCodecInclusivePropertySetInterface : public FormatCodecPropertyInterface { public: /// <summary> /// The virtual destructor. /// </summary> /// virtual ~FormatCodecInclusivePropertySetInterface (); /// <summary> /// This returns the number of properties in the set. /// </summary> /// /// <returns> /// The number of properties in the set. /// </returns> /// virtual int getNumProperties () const; /// <summary> /// This returns a selected property from the properties in the set. /// </summary> /// /// <param name="nIndex"> /// The index of the property to that is returned. /// </param> /// /// <returns> /// A pointer to the property at the index. This pointer should not be freed by the caller. /// </returns> /// virtual FormatCodecPropertyInterface* getProperty (int nIndex) const; protected: /// <summary> /// (Protected) Copy constructor. /// </summary> /// /// <param name="iter"> /// The instance to be copied. /// </param> /// FormatCodecInclusivePropertySetInterface (const FormatCodecInclusivePropertySetInterface& iter); /// <summary> /// (Protected) The simple constructor. /// </summary> /// FormatCodecInclusivePropertySetInterface (); /// <summary> /// (Protected) The pre-allocating constructor. /// </summary> /// /// <param name="nNumToAlloc"> /// The number of properties that will be in the set. /// </param> /// FormatCodecInclusivePropertySetInterface (int nNumToAlloc); /// <summary> /// (Protected) This sets the property at index in the set. /// </summary> /// /// <param name="nIndex"> /// The index of the property that is to be set. /// </param> /// /// <param name="pProperty"> /// A pointer to the property that should be placed at the index. The /// property will be <c>clone()</c> copied. The pointer is not held by the set. /// </param> /// void setProperty (int nIndex, FormatCodecPropertyInterface* pProperty); /// <summary> /// (Protected) This adds the property to the set. /// </summary> /// /// <param name="pProperty"> /// A pointer to the property that should be placed at the index. The /// property will be <c>clone()</c> copied. The pointer is not held by the set. /// </param> /// void appendProperty (FormatCodecPropertyInterface* pProperty); /// <summary> /// (Protected) The array of property pointers held by the set. /// </summary> /// FormatCodecPropertyInterface** mppProperties; /// <summary> /// (Protected) The number of properties that have been set into the set. /// </summary> int mnNumProperties; /// <summary> /// (Protected) The length of the property array. /// </summary> int mnArraySize; private: FormatCodecInclusivePropertySetInterface& operator= (const FormatCodecInclusivePropertySetInterface& from); }; } // end of namespace Atil #if __GNUC__ >= 4 #pragma GCC visibility pop #endif #endif
#ifndef BITMAP_H #define BITMAP_H #include <allegro5/allegro.h> #include <memory> #include "renderlist.h" // This class does double duty as a renderable, and a wrapper for allegro bitmap. class Bitmap; using BitmapPtr = std::shared_ptr<Bitmap>; class Bitmap : public Renderable { ALLEGRO_BITMAP* bitmap; float x, y; float scale; public: Bitmap() : bitmap(nullptr), x(0), y(0), scale(1.0f) {} Bitmap( ALLEGRO_BITMAP* _bitmap, int _x = 0 , int _y = 0 ) : bitmap(_bitmap), x(_x), y(_y), scale(1.0f) {} ~Bitmap(); void render(); void create( int w, int h, int flags = 0 ); bool loadFromFile( const std::string& filename, int flags = 0 ); bool saveToFile( const std::string& filename ); BitmapPtr getSubBitmap( int _x, int _y, int _w, int _h ); void setBitmap( ALLEGRO_BITMAP* nb ); void setBitmap( BitmapPtr& nb ); void blit( const BitmapPtr& other, float x, float y, float scale ); float getX() { return x; } float getY() { return y; } float getScale() { return scale; } void setX( int _x ) { x = _x; } void setY( int _y ) { y = _y; } int getWidth() { return al_get_bitmap_width( bitmap ); } int getHeight() { return al_get_bitmap_height( bitmap ); } void setScale( float _scale ) { scale = _scale; } }; #endif // BITMAP_H
// // Reliant.h // Reliant // // Created by Michael Seghers on 18/09/14. // // #ifndef Reliant_Header____FILEEXTENSION___ #define Reliant_Header____FILEEXTENSION___ #import "OCSObjectContext.h" #import "OCSConfiguratorFromClass.h" #import "NSObject+OCSReliantContextBinding.h" #import "NSObject+OCSReliantInjection.h" #endif
/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2016 zilongshanren http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #import <AppKit/AppKit.h> #include "ui/UIEditBox/Mac/CCUITextInput.h" @interface CCUIPasswordTextField : NSTextField<CCUITextInput> { NSMutableDictionary* _placeholderAttributes; } @end
#ifndef _VSARDUINO_H_ #define _VSARDUINO_H_ //Board = Arduino Nano w/ ATmega328 #define __AVR_ATmega328p__ #define __AVR_ATmega328P__ #define ARDUINO 105 #define ARDUINO_MAIN #define __AVR__ #define __avr__ #define F_CPU 16000000L #define __cplusplus #define __inline__ #define __asm__(x) #define __extension__ #define __ATTR_PURE__ #define __ATTR_CONST__ #define __inline__ #define __asm__ #define __volatile__ #define __builtin_va_list #define __builtin_va_start #define __builtin_va_end #define __DOXYGEN__ #define __attribute__(x) #define NOINLINE __attribute__((noinline)) #define prog_void #define PGM_VOID_P int typedef unsigned char byte; extern "C" void __cxa_pure_virtual() {;} int serial_putc(char c, FILE *); void printf_begin(void); static void dhcp_status_cb(int s, const uint16_t *dnsaddr); static void resolv_found_cb(char *name, uint16_t *addr); void ___dhcp_status(int s, const uint16_t *); // // void webclient_datahandler(char *data, u16_t len); void webclient_connected(void); void webclient_timedout(void); void webclient_aborted(void); void webclient_closed(void); #include "D:\arduino\arduino-1.0.5\hardware\arduino\cores\arduino\arduino.h" #include "D:\arduino\arduino-1.0.5\hardware\arduino\variants\eightanaloginputs\pins_arduino.h" #include "D:\Projects\arduino-sensor-network\nrf24l01\RF24SensorTestServerMQTT2\RF24SensorTestServerMQTT2.ino" #endif
#pragma once #include "messages.h" #include "primitives/string_utils.h" // Given pairs of pulse lens from 2 base stations, this class determines the phase for current cycle // Phases are: // 0) Base 1 (B), horizontal sweep // 1) Base 1 (B), vertical sweep // 2) Base 2 (C), horizontal sweep // 3) Base 2 (C), vertical sweep // // TODO: We might want to introduce a more thorough check for a fix, using the average_error_ value. class CyclePhaseClassifier { public: CyclePhaseClassifier(); // Process the pulse lengths for current cycle (given by incrementing cycle_idx). void process_pulse_lengths(uint32_t cycle_idx, const TimeDelta (&pulse_lens)[num_base_stations]); // Get current cycle phase. -1 if phase is not known (no fix achieved). int get_phase(uint32_t cycle_idx); // Reference to a pair of DataFrameBit-s typedef DataFrameBit (&DataFrameBitPair)[num_base_stations]; // Get updated data bits from the pulse lens for current cycle. // Both bits are always returned, but caller needs to make sure they were updated this cycle by // checking DataFrameBit.cycle_idx == cycle_idx. DataFrameBitPair get_data_bits(uint32_t cycle_idx, const TimeDelta (&pulse_lens)[num_base_stations]); // Reset the state of this classifier - needs to be called if the cycle fix was lost. void reset(); // Print debug information. virtual bool debug_cmd(HashedWord *input_words); virtual void debug_print(PrintStream &stream); private: float expected_pulse_len(bool skip, bool data, bool axis); uint32_t prev_full_cycle_idx_; uint32_t phase_history_; int fix_level_; uint32_t phase_shift_; float pulse_base_len_; DataFrameBit bits_[num_base_stations]; float average_error_; bool debug_print_state_; };
#ifndef ECLAIR_DIRECTORY_H # define ECLAIR_DIRECTORY_H # include "eclair.h" # include <sys/types.h> # include <dirent.h> namespace Eclair { struct DirectoryFile { std::string name; bool is_directory; bool is_regular_file; }; class Directory { private: std::string _dirname; DIR *_dir = nullptr; std::string _error_str; DirectoryFile _file; explicit Directory(); public: explicit Directory(const std::string& dir); virtual ~Directory() noexcept; bool open() noexcept; DirectoryFile *next() noexcept; inline std::string error() const noexcept { return (this->_error_str); } inline std::string path() const noexcept { return (this->_dirname); } static inline std::string current() noexcept { char str[1025]; return (getcwd(str, 1024)); } }; } #endif
// // Person.h // SJDBMapProject // // Created by BlueDancer on 2017/6/4. // Copyright © 2017年 SanJiang. All rights reserved. // #import <Foundation/Foundation.h> #import "SJDBMapUseProtocol.h" @class Book; @class PersonTag; @class Goods; @class TestTest; @interface Person : NSObject<SJDBMapUseProtocol> @property (nonatomic, strong) Book *aBook; @property (nonatomic, assign) NSInteger personID; @property (nonatomic, strong) NSString *name; @property (nonatomic, strong) NSArray<PersonTag *> *tags; @property (nonatomic, strong) NSString *test; @property (nonatomic, strong) NSString *teet; @property (nonatomic, strong) NSString *ttttt; @property (nonatomic, strong) NSArray<Goods *> *goods; @property (nonatomic, assign) NSInteger age; @property (nonatomic, assign) NSInteger group; @property (nonatomic, assign) NSInteger index; @property (nonatomic, assign) NSInteger ID; @property (nonatomic, assign) NSInteger unique; @property (nonatomic, strong) NSURL *tessss; @property (nonatomic, strong) NSString *teesssf; @property (nonatomic, strong) TestTest *testTest; @end
// // SwiftMan.h // SwiftMan // // Created by yangjun on 16/4/29. // Copyright © 2016年 yangjun. All rights reserved. // #import "TargetConditionals.h" #if TARGET_OS_IPHONE #import <UIKit/UIKit.h> #elif TARGET_OS_MAC #import <Cocoa/Cocoa.h> #elif TARGET_OS_WATCH #import <WatchKit/WatchKit.h> #endif //! Project version number for SwiftMan. FOUNDATION_EXPORT double SwiftManVersionNumber; //! Project version string for SwiftMan. FOUNDATION_EXPORT const unsigned char SwiftManVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SwiftMan/PublicHeader.h>
#pragma once #include "ofMain.h" #include "ofxOsc.h" #include "VHPtriggerArea.h" #include "ofxXmlSettings.h" class ofApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); void gotMessage(ofMessage msg); // variables // Cam ofVideoGrabber vidGrabber; ofTexture videoTexture; ofTexture contrastTexture; ofTexture backgroundTexture; unsigned char * background; unsigned char * pixels; unsigned char * buffer; unsigned char * timeBuffer; int camWidth; int camHeight; int totalPixels; float contrast_e[2]; float contrast_f[2]; float percent; float colorFactor[3]; // triggerArea VHPtriggerArea area; // OSC ofxOscReceiver receiver; // info ofTrueTypeFont font; // settings ofxXmlSettings XML; };
// // main.c // demo14 // // Created by weichen on 15/1/9. // Copyright (c) 2015年 weichen. All rights reserved. // #include <stdio.h> int main() { // 求输入的数的平均数,并输出大于平均数的数字 int x = 0; //输入的数 double num = 0; //总和(这个定义为double, 因为计算结果可能出现浮点数) int count = 0; //个数 double per; //平均数(结果也定义double) printf("请输入一些数:"); scanf("%d", &x); //不等于0时执行累计;输入等于0的值,来终止循环,并执行后面的代码 while(x != 0) { num += x; count++; scanf("%d", &x); } if(count > 0) { per = num / count; printf("%f \n", per); } return 0; }
// // RBViewController.h // Pods // // Created by Param Aggarwal on 01/02/15. // // #import <UIKit/UIKit.h> #import "RBViewControllerModel.h" @interface RBViewController : UIViewController + (instancetype)create:(RBViewControllerModel *)model; - (void)update:(RBViewControllerModel *)model; - (void)updateChildren:(RBViewControllerModel *)model; @end
// // This source file is part of appleseed. // Visit http://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited // Copyright (c) 2014-2015 Francois Beaune, The appleseedhq Organization // // 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 APPLESEED_FOUNDATION_UTILITY_TEST_LOGGERTESTLISTENER_H #define APPLESEED_FOUNDATION_UTILITY_TEST_LOGGERTESTLISTENER_H // appleseed.main headers. #include "main/dllsymbol.h" // Forward declarations. namespace foundation { class ITestListener; } namespace foundation { class Logger; } namespace foundation { // // A test listener that forwards messages to a logger. // // Factory function. APPLESEED_DLLSYMBOL ITestListener* create_logger_test_listener( Logger& logger, const bool verbose = false); } // namespace foundation #endif // !APPLESEED_FOUNDATION_UTILITY_TEST_LOGGERTESTLISTENER_H
/* from optimizations/bfs/topology-atomic.cu */ #define BFS_VARIANT "topology-atomic" #define WORKPERTHREAD 1 #define VERTICALWORKPERTHREAD 12 // max value, see relax. #define BLKSIZE 1024 #define BANKSIZE BLKSIZE __global__ void initialize(foru *dist, unsigned int *nv) { unsigned int ii = blockIdx.x * blockDim.x + threadIdx.x; //printf("ii=%d, nv=%d.\n", ii, *nv); if (ii < *nv) { dist[ii] = MYINFINITY; } } __global__ void dprocess(float *matrix, foru *dist, unsigned int *prev, bool *relaxed) { __shared__ volatile unsigned int dNVERTICES; unsigned int ii = blockIdx.x * blockDim.x + threadIdx.x; unsigned int v; unsigned int jj; if (ii < dNVERTICES) { unsigned int u = dNVERTICES; foru mm = MYINFINITY; //minimum <<< NVERTICES / BLKSIZE, BLKSIZE>>> (dist, relaxed, &u); for (jj = 0; jj < dNVERTICES; ++jj) { if (relaxed[jj] == false && dist[jj] < mm) { mm = dist[jj]; u = jj; } } if (u != dNVERTICES && dist[u] != MYINFINITY) { relaxed[u] = true; for (v = 0; v < dNVERTICES; ++v) { if (matrix[u*dNVERTICES + v] > 0) { foru alt = dist[u] + matrix[u*dNVERTICES + v]; if (alt < dist[v]) { dist[v] = alt; prev[v] = u; } } } } } } __global__ void drelax(foru *dist, unsigned int *edgessrcdst, foru *edgessrcwt, unsigned int *psrc, unsigned int *noutgoing, unsigned int *nedges, unsigned int *nv, bool *changed, unsigned int *srcsrc, unsigned unroll) { unsigned int workperthread = WORKPERTHREAD; unsigned nn = workperthread * (blockIdx.x * blockDim.x + threadIdx.x); unsigned int ii; __shared__ int changedv[VERTICALWORKPERTHREAD * BLKSIZE]; int iichangedv = threadIdx.x; int anotheriichangedv = iichangedv; unsigned int nprocessed = 0; // collect the work to be performed. for (unsigned node = 0; node < workperthread; ++node, ++nn) { changedv[iichangedv] = nn; iichangedv += BANKSIZE; } // go over the worklist and keep updating it in a BFS manner. while (anotheriichangedv < iichangedv) { nn = changedv[anotheriichangedv]; anotheriichangedv += BANKSIZE; if (nn < *nv) { unsigned src = nn; // source node. //if (src < *nv && psrc[srcsrc[src]]) { unsigned int start = psrc[srcsrc[src]]; unsigned int end = start + noutgoing[src]; // go over all the target nodes for the source node. for (ii = start; ii < end; ++ii) { unsigned int u = src; unsigned int v = edgessrcdst[ii]; // target node. float wt = 1; //if (wt > 0 && v < *nv) { foru alt = dist[u] + wt; if (alt < dist[v]) { //dist[v] = alt; atomicMin((unsigned *)&dist[v], (unsigned )alt); if (++nprocessed < unroll) { // add work to the worklist. changedv[iichangedv] = v; iichangedv += BANKSIZE; } } //} } //} } } if (nprocessed) { *changed = true; } } void bfs(Graph &graph, foru *dist) { cudaFuncSetCacheConfig(drelax, cudaFuncCachePreferShared); foru zero = 0; //unsigned int intzero = 0, intone = 1; unsigned int NBLOCKS, FACTOR = 128; unsigned int *nedges, hnedges; unsigned int *nv; bool *changed, hchanged; int iteration = 0; double starttime, endtime; double runtime; cudaEvent_t start, stop; float time; cudaDeviceProp deviceProp; unsigned int NVERTICES; cudaGetDeviceProperties(&deviceProp, 0); NBLOCKS = deviceProp.multiProcessorCount; NVERTICES = graph.nnodes; hnedges = graph.nedges; FACTOR = (NVERTICES + BLKSIZE * NBLOCKS - 1) / (BLKSIZE * NBLOCKS); if (cudaMalloc((void **)&nv, sizeof(unsigned int)) != cudaSuccess) CudaTest("allocating nv failed"); cudaMemcpy(nv, &NVERTICES, sizeof(NVERTICES), cudaMemcpyHostToDevice); if (cudaMalloc((void **)&nedges, sizeof(unsigned int)) != cudaSuccess) CudaTest("allocating nedges failed"); cudaMemcpy(nedges, &hnedges, sizeof(unsigned int), cudaMemcpyHostToDevice); if (cudaMalloc((void **)&changed, sizeof(bool)) != cudaSuccess) CudaTest("allocating changed failed"); for (unsigned unroll=VERTICALWORKPERTHREAD; unroll <= VERTICALWORKPERTHREAD; ++unroll) { //printf("initializing (nblocks=%d, blocksize=%d).\n", NBLOCKS*FACTOR, BLKSIZE); //initialize <<<NBLOCKS*FACTOR, BLKSIZE>>> (dist, nv); //__set_CUDAConfig(NBLOCKS*FACTOR, BLKSIZE); printf("initialize kernel \n"); __set_CUDAConfig(1, 256); initialize(dist, nv); CudaTest("initializing failed"); cudaMemcpy(&dist[0], &zero, sizeof(zero), cudaMemcpyHostToDevice); //printf("solving.\n"); starttime = rtclock(); cudaEventCreate(&start); cudaEventCreate(&stop); //cudaEventRecord(start, 0); //do { ++iteration; //printf("iteration %d.\n", iteration); hchanged = false; cudaMemcpy(changed, &hchanged, sizeof(bool), cudaMemcpyHostToDevice); unsigned nblocks = NBLOCKS*FACTOR; //sree: why are nedges and nv pointers? //drelax <<<nblocks/WORKPERTHREAD, BLKSIZE>>> (dist, graph.edgessrcdst, graph.edgessrcwt, graph.psrc, graph.noutgoing, nedges, nv, changed, graph.srcsrc, unroll); printf("drelax kernel \n"); __set_CUDAConfig(1, 256); drelax(dist, graph.edgessrcdst, graph.edgessrcwt, graph.psrc, graph.noutgoing, nedges, nv, changed, graph.srcsrc, unroll); CudaTest("solving failed"); cudaMemcpy(&hchanged, changed, sizeof(bool), cudaMemcpyDeviceToHost); //} while (hchanged); //cudaEventRecord(stop, 0); cudaEventSynchronize(stop); cudaEventElapsedTime(&time, start, stop); endtime = rtclock(); runtime = 1000*(endtime - starttime); //printf("%d ms.\n", runtime); printf("\n"); printf("\truntime [%s] = %.3lf ms.\n", BFS_VARIANT, 1000 * (endtime - starttime)); printf("%d\t%f\n", unroll, runtime); } printf("iterations = %d.\n", iteration); }
#include <stdio.h> #include <stdint.h> #include <ibcrypt/chacha.h> #include <ibcrypt/rand.h> #include <ibcrypt/sha256.h> #include <ibcrypt/zfree.h> #include <libibur/util.h> #include <libibur/endian.h> #include "datafile.h" #include "../util/log.h" int write_datafile(char *path, void *arg, void *data, struct format_desc *f) { int ret = -1; uint8_t *payload = NULL; uint64_t payload_len = 0; uint64_t payload_num = 0; uint8_t *prefix = NULL; uint64_t pref_len = 0; uint8_t symm_key[0x20]; uint8_t hmac_key[0x20]; uint8_t enc_key[0x20]; FILE *ff = fopen(path, "wb"); if(ff == NULL) { ERR("failed to open file for writing: %s", path); goto err; } pref_len = 0x50 + f->pref_len; prefix = malloc(pref_len); if(prefix == NULL) { ERR("failed to allocate memory"); goto err; } void *cur = data; while(cur) { payload_len += f->datalen(cur); payload_num++; cur = *((void **) ((char*)cur + f->next_off)); } encbe64(payload_num, &prefix[0]); encbe64(payload_len, &prefix[8]); if(cs_rand(&prefix[0x10], 0x20) != 0) { ERR("failed to generate random numbers"); goto err; } if(f->p_fill(arg, &prefix[0x30]) != 0) { goto err; } if(f->s_key(arg, &prefix[0x30], symm_key) != 0) { goto err; } if(f->h_key(arg, &prefix[0x30], hmac_key) != 0) { goto err; } hmac_sha256(hmac_key, 0x20, prefix, pref_len - 0x20, &prefix[pref_len - 0x20]); SHA256_CTX kctx; sha256_init(&kctx); sha256_update(&kctx, symm_key, 0x20); sha256_update(&kctx, &prefix[0x10], 0x20); sha256_final(&kctx, enc_key); payload = malloc(payload_len); if(payload == NULL) { ERR("failed to allocate memory"); goto err; } cur = data; uint8_t *ptr = payload; while(cur) { ptr = f->datawrite(cur, ptr); if(ptr == NULL) { goto err; } cur = *((void **) ((char*)cur + f->next_off)); } if(ptr - payload != payload_len) { ERR("written length does not match expected"); goto err; } chacha_enc(enc_key, 0x20, 0, payload, payload, payload_len); HMAC_SHA256_CTX hctx; hmac_sha256_init(&hctx, hmac_key, 0x20); hmac_sha256_update(&hctx, prefix, pref_len); hmac_sha256_update(&hctx, payload, payload_len); uint8_t mac[0x20]; hmac_sha256_final(&hctx, mac); if(fwrite(prefix, 1, pref_len, ff) != pref_len) { goto writerr; } if(payload_len > 0) { if(fwrite(payload, 1, payload_len, ff) != payload_len) { goto writerr; } } if(fwrite(mac, 1, 0x20, ff) != 0x20) { goto writerr; } ret = 0; err: if(ff) fclose(ff); if(payload) zfree(payload, payload_len); memsets(enc_key, 0, sizeof(enc_key)); memsets(symm_key, 0, sizeof(symm_key)); memsets(hmac_key, 0, sizeof(hmac_key)); return ret; writerr: ERR("failed to write to file: %s", path); goto err; } int read_datafile(char *path, void *arg, void **data, struct format_desc *f) { int ret = -1; uint8_t *payload = NULL; uint64_t payload_len = 0; uint64_t payload_num = 0; uint8_t *prefix = NULL; uint64_t pref_len = 0; uint8_t symm_key[0x20]; uint8_t hmac_key[0x20]; uint8_t enc_key[0x20]; uint8_t mac1[0x20]; uint8_t mac2c[0x20]; uint8_t mac2f[0x20]; FILE *ff = fopen(path, "rb"); if(ff == NULL) { ERR("failed to open file for reading: %s", path); goto err; } pref_len = 0x50 + f->pref_len; prefix = malloc(pref_len); if(prefix == NULL) { ERR("failed to allocate memory"); goto err; } if(fread(prefix, 1, pref_len, ff) != pref_len) { goto readerr; } payload_num = decbe64(&prefix[0]); payload_len = decbe64(&prefix[8]); if(f->s_key(arg, &prefix[0x30], symm_key) != 0) { goto err; } if(f->h_key(arg, &prefix[0x30], hmac_key) != 0) { goto err; } hmac_sha256(hmac_key, 0x20, prefix, pref_len - 0x20, mac1); if(memcmp_ct(mac1, &prefix[pref_len-0x20], 0x20) != 0) { ERR("invalid file"); goto err; } SHA256_CTX kctx; sha256_init(&kctx); sha256_update(&kctx, symm_key, 0x20); sha256_update(&kctx, &prefix[0x10], 0x20); sha256_final(&kctx, enc_key); payload = malloc(payload_len); if(payload == NULL) { ERR("failed to allocate memory"); goto err; } if(fread(payload, 1, payload_len, ff) != payload_len) { goto readerr; } if(fread(mac2f, 1, 0x20, ff) != 0x20) { goto readerr; } HMAC_SHA256_CTX hctx; hmac_sha256_init(&hctx, hmac_key, 0x20); hmac_sha256_update(&hctx, prefix, pref_len); hmac_sha256_update(&hctx, payload, payload_len); hmac_sha256_final(&hctx, mac2c); if(memcmp_ct(mac2c, mac2f, 0x20) != 0) { ERR("invalid file"); goto err; } chacha_dec(enc_key, 0x20, 0, payload, payload, payload_len); void **cur = data; uint8_t *ptr = payload; uint64_t i; for(i = 0; (ptr - payload) < payload_len && i < payload_num; i++) { ptr = f->dataread(cur, arg, ptr); if(ptr == NULL) { goto err; } cur = (void **) ((char*)(*cur) + f->next_off); } *cur = NULL; if(i != payload_num) { ERR("read num does not match expected"); goto err; } if(ptr - payload != payload_len) { ERR("read length does not match expected"); goto err; } ret = 0; err: if(ff) fclose(ff); if(payload) zfree(payload, payload_len); memsets(enc_key, 0, sizeof(enc_key)); memsets(symm_key, 0, sizeof(symm_key)); memsets(hmac_key, 0, sizeof(hmac_key)); return ret; readerr: ERR("failed to read from file: %s", path); goto err; }
/** @file std_streambuf.h @brief suppresses warnings in streambuf. @author HRYKY @version $Id: std_streambuf.h 337 2014-03-23 14:12:33Z [email protected] $ */ #ifndef STD_STREAMBUF_H_20140323003904693 #define STD_STREAMBUF_H_20140323003904693 #include "hryky/pragma.h" #pragma hryky_pragma_push_warning # include <streambuf> #pragma hryky_pragma_pop_warning //------------------------------------------------------------------------------ // defines macros //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // declares types //------------------------------------------------------------------------------ namespace hryky { } // namespace hryky //------------------------------------------------------------------------------ // declares classes //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // declares global functions //------------------------------------------------------------------------------ namespace hryky { } // namespace hryky //------------------------------------------------------------------------------ // defines global functions //------------------------------------------------------------------------------ #endif // STD_STREAMBUF_H_20140323003904693 // end of file
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: android/libcore/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Enumerated.java // #ifndef _OrgApacheHarmonySecurityAsn1ASN1Enumerated_H_ #define _OrgApacheHarmonySecurityAsn1ASN1Enumerated_H_ #include "J2ObjC_header.h" #include "org/apache/harmony/security/asn1/ASN1Primitive.h" @class OrgApacheHarmonySecurityAsn1BerInputStream; @class OrgApacheHarmonySecurityAsn1BerOutputStream; /*! @author Stepan M. Mishura @version $Revision$ */ /*! @brief This class represents ASN.1 Enumerated type. */ @interface OrgApacheHarmonySecurityAsn1ASN1Enumerated : OrgApacheHarmonySecurityAsn1ASN1Primitive #pragma mark Public /*! @brief Constructs ASN.1 Enumerated type The constructor is provided for inheritance purposes when there is a need to create a custom ASN.1 Enumerated type. To get a default implementation it is recommended to use getInstance() method. */ - (instancetype)init; - (id)decodeWithOrgApacheHarmonySecurityAsn1BerInputStream:(OrgApacheHarmonySecurityAsn1BerInputStream *)inArg; - (void)encodeContentWithOrgApacheHarmonySecurityAsn1BerOutputStream:(OrgApacheHarmonySecurityAsn1BerOutputStream *)outArg; /*! @brief Extracts array of bytes from BER input stream. @return array of bytes */ - (id)getDecodedObjectWithOrgApacheHarmonySecurityAsn1BerInputStream:(OrgApacheHarmonySecurityAsn1BerInputStream *)inArg; /*! @brief Returns ASN.1 Enumerated type default implementation The default implementation works with encoding that is represented as byte array. @return ASN.1 Enumerated type default implementation */ + (OrgApacheHarmonySecurityAsn1ASN1Enumerated *)getInstance; - (void)setEncodingContentWithOrgApacheHarmonySecurityAsn1BerOutputStream:(OrgApacheHarmonySecurityAsn1BerOutputStream *)outArg; @end J2OBJC_STATIC_INIT(OrgApacheHarmonySecurityAsn1ASN1Enumerated) FOUNDATION_EXPORT void OrgApacheHarmonySecurityAsn1ASN1Enumerated_init(OrgApacheHarmonySecurityAsn1ASN1Enumerated *self); FOUNDATION_EXPORT OrgApacheHarmonySecurityAsn1ASN1Enumerated *new_OrgApacheHarmonySecurityAsn1ASN1Enumerated_init() NS_RETURNS_RETAINED; FOUNDATION_EXPORT OrgApacheHarmonySecurityAsn1ASN1Enumerated *OrgApacheHarmonySecurityAsn1ASN1Enumerated_getInstance(); J2OBJC_TYPE_LITERAL_HEADER(OrgApacheHarmonySecurityAsn1ASN1Enumerated) #endif // _OrgApacheHarmonySecurityAsn1ASN1Enumerated_H_
#include <assert.h> #include <SDL2/SDL.h> #include <SDL2/SDL_ttf.h> #include <video/gl.h> #include <xxhash.h> #include <memtrack.h> #include "base/stack.h" #include "core/common.h" #include "base/math_ext.h" #include "core/asset.h" #include "core/configs.h" #include "core/frame.h" #include "core/logerr.h" #include <core/application.h> #include "core/video.h" #include "video/resources_detail.h" #include <core/audio.h> static int running = 1; static STACK *states_stack; static APP_STATE *allstates; static size_t states_num; NEON_API void application_next_state(unsigned int state) { if (state > states_num) { LOG_ERROR("State(%d) out of range", state); exit(EXIT_FAILURE); } push_stack(states_stack, &allstates[state]); ((APP_STATE*)top_stack(states_stack))->on_init(); frame_flush(); } NEON_API void application_back_state(void) { ((APP_STATE*)pop_stack(states_stack))->on_cleanup(); frame_flush(); } static void application_cleanup(void) { configs_cleanup(); asset_close(); audio_cleanup(); video_cleanup(); while (!is_stack_empty(states_stack)) application_back_state(); delete_stack(states_stack); } #ifdef OPENAL_BACKEND #define SDL_INIT_FLAGS (SDL_INIT_VIDEO | SDL_INIT_TIMER) #else #define SDL_INIT_FLAGS (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) #endif NEON_API int application_exec(const char *title, APP_STATE *states, size_t states_n) { allstates = states; states_num = states_n; if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { LOG_ERROR("%s\n", SDL_GetError()); return EXIT_FAILURE; } atexit(SDL_Quit); if (TTF_Init() < 0) { LOG_ERROR("%s\n", TTF_GetError()); return EXIT_FAILURE; } atexit(TTF_Quit); if ((states_stack = new_stack(sizeof(APP_STATE), states_n + 1)) == NULL) { LOG_ERROR("%s\n", "Can\'t create game states stack"); return EXIT_FAILURE; } LOG("%s launched...\n", title); LOG("Platform: %s\n", SDL_GetPlatform()); video_init(title); audio_init(); atexit(application_cleanup); application_next_state(0); if (is_stack_empty(states_stack)) { LOG_CRITICAL("%s\n", "No game states"); exit(EXIT_FAILURE); } SDL_Event event; Uint64 current = 0; Uint64 last = 0; float accumulator = 0.0f; while(running) { frame_begin(); while(SDL_PollEvent(&event)) { ((APP_STATE*)top_stack(states_stack))->on_event(&event); } asset_process(); resources_process(); last = current; current = SDL_GetPerformanceCounter(); Uint64 freq = SDL_GetPerformanceFrequency(); float delta = (double)(current - last) / (double)freq; accumulator += CLAMP(delta, 0.f, 0.2f); while(accumulator >= TIMESTEP) { accumulator -= TIMESTEP; ((APP_STATE*)top_stack(states_stack))->on_update(TIMESTEP); } ((APP_STATE*)top_stack(states_stack))->on_present(screen.width, screen.height, accumulator / TIMESTEP); video_swap_buffers(); frame_end(); SDL_Delay(1); } return EXIT_SUCCESS; } NEON_API void application_quit(void) { running = 0; }
#pragma once #include <QtCore/QPointer> #include <QtWidgets/QTabWidget> #include "backend/backend_requests_interface.h" class BreakpointModel; class PDIBackendRequests; class DisassemblyView; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class CodeViews : public QTabWidget { public: CodeViews(BreakpointModel* breakpoints, QWidget* parent = 0); virtual ~CodeViews(); void set_breakpoint_model(BreakpointModel* breakpoints); void reload_current_file(); void toggle_breakpoint(); void set_backend_interface(PDIBackendRequests* iface); Q_SLOT void open_file(const QString& filename, bool setActive); Q_SLOT void program_counter_changed(const PDIBackendRequests::ProgramCounterChange& pc); Q_SLOT void session_ended(); private: Q_SLOT void closeTab(int index); enum Mode { SourceView, Disassembly, }; void read_settings(); void write_settings(); Mode m_mode = SourceView; int m_oldIndex = 0; // DisassemblyView* m_disassemblyView = nullptr; BreakpointModel* m_breakpoints = nullptr; QPointer<PDIBackendRequests> m_interface; QVector<QString> m_files; bool m_was_in_source_view = true; }; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// inline void CodeViews::set_breakpoint_model(BreakpointModel* breakpoints) { m_breakpoints = breakpoints; }
// // BPPopToast.h // BPKITsDemo // // Created by mikeooye on 15-3-28. // Copyright (c) 2015年 ihojin. All rights reserved. // #import <UIKit/UIKit.h> @interface BPPopToast : UIView @property (copy, nonatomic) NSString *text; - (void)popToastAtRect:(CGRect)rect inView:(UIView *)view; @end @interface NSString (BPPopToast) - (void)popToastAtRect:(CGRect)rect inView:(UIView *)view; @end
// // SNPGetStreamOperation.h // Snapper // // Created by Paul Schifferer on 12/23/12. // Copyright (c) 2012 Pilgrimage Software. All rights reserved. // #import "SNPBaseAppTokenOperation.h" @interface SNPGetStreamOperation : SNPBaseAppTokenOperation // -- Properties -- @property (nonatomic, assign) NSInteger streamId; // -- Initializers -- - (nonnull instancetype)initWithStreamId:(NSUInteger)streamId appToken:(nonnull NSString*)appToken finishBlock:(nonnull void (^)(SNPResponse* _Nonnull response))finishBlock; @end
/* * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ #define MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ #include <list> #include <memory> #include BOSS_WEBRTC_U_api__rtp_headers_h //original-code:"api/rtp_headers.h" // NOLINT(build/include) #include BOSS_WEBRTC_U_common_types_h //original-code:"common_types.h" // NOLINT(build/include) #include BOSS_WEBRTC_U_rtc_base__constructormagic_h //original-code:"rtc_base/constructormagic.h" #include BOSS_WEBRTC_U_typedefs_h //original-code:"typedefs.h" // NOLINT(build/include) namespace webrtc { class RtpHeaderParser; namespace test { // Class for handling RTP packets in test applications. class Packet { public: // Creates a packet, with the packet payload (including header bytes) in // |packet_memory|. The length of |packet_memory| is |allocated_bytes|. // The new object assumes ownership of |packet_memory| and will delete it // when the Packet object is deleted. The |time_ms| is an extra time // associated with this packet, typically used to denote arrival time. // The first bytes in |packet_memory| will be parsed using |parser|. Packet(uint8_t* packet_memory, size_t allocated_bytes, double time_ms, const RtpHeaderParser& parser); // Same as above, but with the extra argument |virtual_packet_length_bytes|. // This is typically used when reading RTP dump files that only contain the // RTP headers, and no payload (a.k.a RTP dummy files or RTP light). The // |virtual_packet_length_bytes| tells what size the packet had on wire, // including the now discarded payload, whereas |allocated_bytes| is the // length of the remaining payload (typically only the RTP header). Packet(uint8_t* packet_memory, size_t allocated_bytes, size_t virtual_packet_length_bytes, double time_ms, const RtpHeaderParser& parser); // The following two constructors are the same as above, but without a // parser. Note that when the object is constructed using any of these // methods, the header will be parsed using a default RtpHeaderParser object. // In particular, RTP header extensions won't be parsed. Packet(uint8_t* packet_memory, size_t allocated_bytes, double time_ms); Packet(uint8_t* packet_memory, size_t allocated_bytes, size_t virtual_packet_length_bytes, double time_ms); virtual ~Packet(); // Parses the first bytes of the RTP payload, interpreting them as RED headers // according to RFC 2198. The headers will be inserted into |headers|. The // caller of the method assumes ownership of the objects in the list, and // must delete them properly. bool ExtractRedHeaders(std::list<RTPHeader*>* headers) const; // Deletes all RTPHeader objects in |headers|, but does not delete |headers| // itself. static void DeleteRedHeaders(std::list<RTPHeader*>* headers); const uint8_t* payload() const { return payload_; } size_t packet_length_bytes() const { return packet_length_bytes_; } size_t payload_length_bytes() const { return payload_length_bytes_; } size_t virtual_packet_length_bytes() const { return virtual_packet_length_bytes_; } size_t virtual_payload_length_bytes() const { return virtual_payload_length_bytes_; } const RTPHeader& header() const { return header_; } void set_time_ms(double time) { time_ms_ = time; } double time_ms() const { return time_ms_; } bool valid_header() const { return valid_header_; } private: bool ParseHeader(const RtpHeaderParser& parser); void CopyToHeader(RTPHeader* destination) const; RTPHeader header_; std::unique_ptr<uint8_t[]> payload_memory_; const uint8_t* payload_; // First byte after header. const size_t packet_length_bytes_; // Total length of packet. size_t payload_length_bytes_; // Length of the payload, after RTP header. // Zero for dummy RTP packets. // Virtual lengths are used when parsing RTP header files (dummy RTP files). const size_t virtual_packet_length_bytes_; size_t virtual_payload_length_bytes_; double time_ms_; // Used to denote a packet's arrival time. bool valid_header_; // Set by the RtpHeaderParser. RTC_DISALLOW_COPY_AND_ASSIGN(Packet); }; } // namespace test } // namespace webrtc #endif // MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_
/* * optimization needed. */ struct ListNode { int val; struct ListNode *next; }; #ifndef NULL #define NULL ((struct ListNode *)0) #endif struct ListNode *detectCycle(struct ListNode *head) { if (!head || !head->next) return(NULL); if (head->next == head) return(head); struct ListNode *p1, *p2; int has_cycle; p1 = head; p2 = head; while (1) { if (!p2) { has_cycle = 0; break; } p1 = p1->next; p2 = p2->next; if (p2) { p2 = p2->next; } else { has_cycle = 0; break; } if (p1 == p2) { has_cycle = 1; break; } } if (!has_cycle) return(NULL); while (1) { if (head == p1) { break; } p2 = p1->next; while (p2 != p1) { if (head == p2) break; else p2 = p2->next; } if (head == p2) break; else head = head->next; } return(head); } int main(void) { return(0); }
#import "MOBProjection.h" @interface MOBProjectionEPSG6331 : MOBProjection @end
/* * $QNXLicenseC: * Copyright 2009, QNX Software Systems. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not reproduce, modify or distribute this software 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 OF ANY KIND, either express or implied. * * This file may contain contributions from others, either as * contributors under the License or as licensors under other terms. * Please review this entire file for other proprietary rights or license * notices, as well as the QNX Development Suite License Guide at * http://licensing.qnx.com/license-guide/ for other information. * $ */ #ifndef __BEAGLEBONE_H_INCLUDED #define __BEAGLEBONE_H_INCLUDED #define RGMII 1 #define GMII 2 #define RMII 3 #define AM335X_I2C0_CPLD 0x35 #define AM335X_I2C0_BBID 0x50 #define AM335X_I2C0_CAPE0 0x54 #define AM335X_I2C0_MAXCAPES 4 #define AM335X_BDID_HEADER_LEN 4 #define AM335X_BDID_BDNAME_LEN 8 #define AM335X_BDID_VERSION_LEN 4 #define AM335X_BDID_SERIAL_LEN 12 #define AM335X_BDID_CONFIG_LEN 32 #define AM335X_BDID_MAC_LEN 6 #define AM335X_BDID_BDNAME_OFFSET (AM335X_BDID_HEADER_LEN) #define AM335X_BDID_VERSION_OFFSET (AM335X_BDID_BDNAME_OFFSET +AM335X_BDID_BDNAME_LEN) #define AM335X_BDID_SERIAL_OFFSET (AM335X_BDID_VERSION_OFFSET +AM335X_BDID_VERSION_LEN) #define AM335X_BDID_CONFIG_OFFSET (AM335X_BDID_SERIAL_OFFSET +AM335X_BDID_SERIAL_LEN) #define AM335X_BDID_MAC1_OFFSET (AM335X_BDID_CONFIG_OFFSET +AM335X_BDID_CONFIG_LEN) #define AM335X_BDID_MAC2_OFFSET (AM335X_BDID_MAC1_OFFSET +AM335X_BDID_MAC_LEN) #define AM335X_MACS 3 #define BOARDID_I2C_DEVICE "/dev/i2c0" typedef struct board_identity { unsigned int header; char bdname [AM335X_BDID_BDNAME_LEN+1]; char version[AM335X_BDID_VERSION_LEN+1]; char serial [AM335X_BDID_SERIAL_LEN+1]; char config [AM335X_BDID_CONFIG_LEN+1]; uint8_t macaddr[AM335X_MACS][AM335X_BDID_MAC_LEN]; } BDIDENT; enum enum_basebd_type { bb_not_detected = 0, bb_BeagleBone = 1, /* BeagleBone Base Board */ bb_unknown = 99, }; enum enum_cape_type { ct_not_detected = 0, ct_unknown = 99, }; typedef struct beaglebone_id { /* Base board */ enum enum_basebd_type basebd_type; /* Daughter board, they're called cape. */ enum enum_cape_type cape_type[4]; } BEAGLEBONE_ID; #endif
// // NSDate+WT.h // lchSDK // // Created by lch on 16/1/12. // Copyright © 2015年 lch. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDate (WT) - (BOOL)isThisYear; /** 判断某个时间是否为今年 */ - (BOOL)isYesterday; /** 判断某个时间是否为昨天 */ - (BOOL)isToday; /** 判断某个时间是否为今天 */ /** 字符串时间戳。 */ @property (nonatomic, copy, readonly) NSString *timeStamp; /** * 长型时间戳 */ //@property (nonatomic, assign, readonly) long timeStamp; /** * 时间成分 */ @property (nonatomic, strong, readonly) NSDateComponents *components; /** * 两个时间比较 * * @param unit 成分单元 * @param fromDate 起点时间 * @param toDate 终点时间 * * @return 时间成分对象 */ + (NSDateComponents *)dateComponents:(NSCalendarUnit)unit fromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; /** *@Description:根据年份、月份、日期、小时数、分钟数、秒数返回NSDate *@Params: * year:年份 * month:月份 * day:日期 * hour:小时数 * minute:分钟数 * second:秒数 *@Return: */ + (NSDate *)dateWithYear:(NSUInteger)year Month:(NSUInteger)month Day:(NSUInteger)day Hour:(NSUInteger)hour Minute:(NSUInteger)minute Second:(NSUInteger)second; /** *@Description:实现dateFormatter单例方法 *@Params:nil *Return:相应格式的NSDataFormatter对象 */ + (NSDateFormatter *)defaultDateFormatterWithFormatYYYYMMddHHmmss; + (NSDateFormatter *)defaultDateFormatterWithFormatYYYYMMdd; + (NSDateFormatter *)defaultDateFormatterWithFormatMMddHHmm; + (NSDateFormatter *)defaultDateFormatterWithFormatYYYYMMddHHmmInChinese; + (NSDateFormatter *)defaultDateFormatterWithFormatMMddHHmmInChinese; /** *@Description:获取当天的包括“年”,“月”,“日”,“周”,“时”,“分”,“秒”的NSDateComponents *@Params:nil *@Return:当天的包括“年”,“月”,“日”,“周”,“时”,“分”,“秒”的NSDateComponents */ - (NSDateComponents *)componentsOfDay; /** *@Description:获得NSDate对应的年份 *@Params:nil *@Return:NSDate对应的年份 **/ - (NSUInteger)year; /** *@Description:获得NSDate对应的月份 *@Params:nil *@Return:NSDate对应的月份 */ - (NSUInteger)month; /** *@Description:获得NSDate对应的日期 *@Params:nil *@Return:NSDate对应的日期 */ - (NSUInteger)day; /** *@Description:获得NSDate对应的小时数 *@Params:nil *@Return:NSDate对应的小时数 */ - (NSUInteger)hour; /** *@Description:获得NSDate对应的分钟数 *@Params:nil *@Return:NSDate对应的分钟数 */ - (NSUInteger)minute; /** *@Description:获得NSDate对应的秒数 *@Params:nil *@Return:NSDate对应的秒数 */ - (NSUInteger)second; /** *@Description:获得NSDate对应的星期 *@Params:nil *@Return:NSDate对应的星期 */ - (NSUInteger)weekday; /** *@Description:获取当天是当年的第几周 *@Params:nil *@Return:当天是当年的第几周 */ - (NSUInteger)weekOfDayInYear; /** *@Description:获得一般当天的工作开始时间 *@Params:nil *@Return:一般当天的工作开始时间 */ - (NSDate *)workBeginTime; /** *@Description:获得一般当天的工作结束时间 *@Params:nil *@Return:一般当天的工作结束时间 */ - (NSDate *)workEndTime; /** *@Description:获取一小时后的时间 *@Params:nil *@Return:一小时后的时间 **/ - (NSDate *)oneHourLater; /** *@Description:获得某一天的这个时刻 *@Params:nil *@Return:某一天的这个时刻 */ - (NSDate *)sameTimeOfDate; /** *@Description:判断与某一天是否为同一天 *@Params: * otherDate:某一天 *@Return:YES-同一天;NO-不同一天 */ - (BOOL)sameDayWithDate:(NSDate *)otherDate; /** *@Description:判断与某一天是否为同一周 *@Params: * otherDate:某一天 *@Return:YES-同一周;NO-不同一周 */ - (BOOL)sameWeekWithDate:(NSDate *)otherDate; /** *@Description:判断与某一天是否为同一月 *@Params: * otherDate:某一天 *@Return:YES-同一月;NO-不同一月 */ - (BOOL)sameMonthWithDate:(NSDate *)otherDate; - (NSString *)whatTimeAgo; /** 多久以前呢 ? 1分钟内 X分钟前 X天前 */ - (NSString *)whatTimeBefore; /** 前段某时间日期的描述 上午?? 星期二 下午?? */ - (NSString *)whatDayTheWeek; /** 今天星期几来着?*/ /** YYYY-MM-dd HH:mm:ss */ - (NSString *)WT_YYYYMMddHHmmss; /** YYYY.MM.dd */ - (NSString *)WT_YYYYMMdd; /** YYYY-MM-dd */ - (NSString *)WT_YYYYMMdd__; /** HH:mm */ - (NSString *)WT_HHmm; - (NSString *)MMddHHmm; - (NSString *)YYYYMMddHHmmInChinese; - (NSString *)MMddHHmmInChinese; @end