text
stringlengths
4
6.14k
/* * File: SolutionCopier.h * Author: Sourabh Bhat * * Created on 4 February, 2017, 11:50 AM */ #ifndef SOLUTIONCOPIER_H #define SOLUTIONCOPIER_H #include "data.h" #ifdef __cplusplus extern "C" { #endif void copyBackToLevelN(Cell cells[]); #ifdef __cplusplus } #endif #endif /* SOLUTIONCOPIER_H */
/** * @file logger.h * @brief 日志库 * @author chxuan, 787280310@qq.com * @version 1.0.0 * @date 2017-11-05 */ #pragma once #include <stdio.h> #include <string> #include <sstream> #include <memory> enum class log_level { debug = 0, info, warn, error }; class logger { public: logger(const std::string& file_path, unsigned long line, log_level level); ~logger(); template<typename T> logger& operator << (const T& t) { (*buffer_) << t; return *this; } private: std::string get_level_string(); std::string make_log(); void print_log(const std::string& log); private: std::shared_ptr<std::ostringstream> buffer_; log_level level_; }; #define FILE_LOCATION __FILE__, __LINE__ #define log_error logger(FILE_LOCATION, log_level::error) #define log_warn logger(FILE_LOCATION, log_level::warn) #define log_info logger(FILE_LOCATION, log_level::info) #define log_debug logger(FILE_LOCATION, log_level::debug)
#ifndef LEXER_H #define LEXER_H #include <fstream> #include <vector> #include <string> #include <unordered_map> enum class TokenType{ ResWord, Identifier, IntNumber, RealNumber, Delimiter, AttCommand, RelOp, AddOp, MultOp }; struct Token{ std::string lexeme; TokenType classification; int line; }; static std::unordered_map<std::string, int> resWords = { {"var", 0}, {"do",1}, {"not",2}, {"program",3}, {"begin",4}, {"end",5}, {"else",6}, {"integer",7}, {"real",8}, {"boolean",9}, {"procedure",10}, {"if",11}, {"then",12}, {"while",13}}; class Lexer { public: Lexer(char* filename); ~Lexer(); void run(); std::vector<Token> getSymbolTable(); Token getToken(char c); void lexerError(std::string msg); std::string readIdentifier(std::string currentLexeme); std::string readNumber(std::string currentLexeme); private: std::vector<Token> symbolTable_; Token token_; int line_; char* codePath_; std::ifstream file_; }; static std::string printType(TokenType classification) { switch (classification) { case TokenType::ResWord: return "Palavra Reservada"; case TokenType::Identifier: return "Identificador"; case TokenType::IntNumber: return "Número Inteiro"; case TokenType::RealNumber: return "Número Real"; case TokenType::AddOp: return "Operador de Adição"; case TokenType::AttCommand: return "Comando de Atribuição"; case TokenType::Delimiter: return "Delimitador"; case TokenType::RelOp: return "Operador Relacional"; case TokenType::MultOp: return "Operador de Multiplicação"; default: return " [erro] Tipo não identificado!"; break; } } #endif
//-------------------------------------------------------------------------------------- // File: DirectXTKTest.h // // Helper header for DirectX Tool Kit for DX11 test suite // // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 //------------------------------------------------------------------------------------- #pragma once #if defined(_XBOX_ONE) && defined(_TITLE) #define XBOX #define COREWINDOW #include "DeviceResourcesXDK.h" #elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) #define UWP #define COREWINDOW #define LOSTDEVICE #define WGI #include "DeviceResourcesUWP.h" #else #define PC #define LOSTDEVICE #include "DeviceResourcesPC.h" #if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/) #define WGI #endif #endif
#ifndef _NAKEDPAIR_H_ #define _NAKEDPAIR_H_ #include "SudokuTechnique.h" namespace sudoku { class NakedPair : public Technique { public: NakedPair(); ~NakedPair(); int step(Board& board); }; } #endif
/****************************************************************************** This source code accompanies the Journal of Graphics Tools paper: "Fast Ray-Axis Aligned Bounding Box Overlap Tests With Pluecker Coordinates" by Jeffrey Mahovsky and Brian Wyvill Department of Computer Science, University of Calgary This source code is public domain, but please mention us if you use it. ******************************************************************************/ #ifndef _PLUECKERINT_MUL_CLS_H #define _PLUECKERINT_MUL_CLS_H #include "ray.h" #include "aabox.h" bool plueckerint_mul_cls(ray *r, aabox *b, double *t); #endif
#import <UIKit/UIKit.h> @class PreviewAndSaveViewController; @interface EditSummaryViewController : UIViewController <UITextFieldDelegate> @property (weak, nonatomic) PreviewAndSaveViewController *previewVC; @property (strong, nonatomic) NSString *summaryText; @end
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "mcrouter/lib/fbi/queue.h" namespace facebook { namespace memcache { namespace mcrouter { // Forward declaration. struct awriter_entry_t; struct awriter_callbacks_t { void (*completed)(awriter_entry_t*, int); int (*perform_write)(awriter_entry_t*); }; struct awriter_entry_t { TAILQ_ENTRY(awriter_entry_t) links; void* context; const awriter_callbacks_t* callbacks; }; } // namespace mcrouter } // namespace memcache } // namespace facebook
// // GHUIViewControllerFall.h // GHUIKit // // Created by Gabriel Handford on 2/12/14. // Copyright (c) 2014 Gabriel Handford. All rights reserved. // #import "GHUIViewControllerAnimation.h" @interface GHUIViewControllerFall : GHUIViewControllerAnimation @end
#pragma once #include <core/values/SourceToSinkConnection.h> NS_BEGIN(CORE_VALUES_NAMESPACE) struct AutoSourceToSinkConnection : public SourceToSinkConnection{ std::shared_ptr<::core::events::IEventHandler> listener; bool disconnect()override{ return SourceToSinkConnection::disconnect(); } bool connect(connectable_type from, connectable_type to) override{ if (!SourceToSinkConnection::connect(from, to))return false; auto observable = std::dynamic_pointer_cast<IObservableSource>(from); if (!observable)throw std::exception(); listener = observable->OnValueChanged() += [this](any a){ this->sync(); }; return true; } }; NS_END(CORE_VALUES_NAMESPACE)
// // UIViewController+SJRotationPrivate_FixSafeArea.h // Pods // // Created by 畅三江 on 2019/8/6. // // 适配 iOS 13.0 // #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN typedef NS_OPTIONS(NSUInteger, SJSafeAreaInsetsMask) { SJSafeAreaInsetsMaskNone = 0, SJSafeAreaInsetsMaskTop = 1 << 0, SJSafeAreaInsetsMaskLeft = 1 << 1, SJSafeAreaInsetsMaskBottom = 1 << 2, SJSafeAreaInsetsMaskRight = 1 << 3, SJSafeAreaInsetsMaskHorizontal = SJSafeAreaInsetsMaskLeft | SJSafeAreaInsetsMaskRight, SJSafeAreaInsetsMaskVertical = SJSafeAreaInsetsMaskTop | SJSafeAreaInsetsMaskRight, SJSafeAreaInsetsMaskAll = SJSafeAreaInsetsMaskHorizontal | SJSafeAreaInsetsMaskVertical } NS_AVAILABLE_IOS(13.0); API_AVAILABLE(ios(13.0)) @interface UIViewController (SJRotationPrivate_FixSafeArea) /// 禁止调整哪些方向的安全区 @property (nonatomic) SJSafeAreaInsetsMask disabledAdjustSafeAreaInsetsMask; @end NS_ASSUME_NONNULL_END #endif
// // MKPageFlipTransition.h // Miruken // // Created by Craig Neuwirt on 4/21/14. // Copyright (c) 2014 Craig Neuwirt. All rights reserved. // // Based on work by Colin Eberhardt on 09/09/2013. // Copyright (c) 2013 Colin Eberhardt. All rights reserved. // #import "MKAnimatedTransition.h" @interface MKPageFlipTransition : MKAnimatedTransition @property (assign, nonatomic) CGFloat perspective; @end
#ifndef HISTOGRAM_H #define HISTOGRAM_H #include "utils.h" class histogram { //This class is a histogram and the value in row n and column m is in //dataVector[n+m*rows] public: histogram(int n, int m); ~histogram(); void add(int n, int m); // returns the higerst color value for both row and column cv::Vec2i max(); QString toString(); // returns the row with rhe highest color value int getHighestRow(); // returns the column with rhe highest color value int getHighestColumn(); // returns median of rows int getMedianOfRow(int row); // returns median of columns int getMedianOfColumn(int column); bool numberOfElements(); private: std::vector<int> dataVector; int rows; int columns; int numberOfEls; }; #endif // HISTOGRAM_H
#include "urcrypt.h" #include <ge-additions.h> int urcrypt_ed_point_add(const uint8_t a[32], const uint8_t b[32], uint8_t out[32]) { ge_p3 A, B; ge_cached b_cached; ge_p1p1 sum; ge_p3 result; if ( ge_frombytes_negate_vartime(&A, a) != 0 ) { return -1; } if ( ge_frombytes_negate_vartime(&B, b) != 0 ) { return -1; } // Undo the negation from above. See add_scalar.c in the ed25519 distro. fe_neg(A.X, A.X); fe_neg(A.T, A.T); fe_neg(B.X, B.X); fe_neg(B.T, B.T); ge_p3_to_cached(&b_cached, &B); ge_add(&sum, &A, &b_cached); ge_p1p1_to_p3(&result, &sum); ge_p3_tobytes(out, &result); return 0; } int urcrypt_ed_scalarmult(const uint8_t a[32], const uint8_t b[32], uint8_t out[32]) { ge_p3 B, result; if ( ge_frombytes_negate_vartime(&B, b) != 0 ) { return -1; } // Undo the negation from above. See add_scalar.c in the ed25519 distro. fe_neg(B.X, B.X); fe_neg(B.T, B.T); ge_scalarmult(&result, a, &B); ge_p3_tobytes(out, &result); return 0; } void urcrypt_ed_scalarmult_base(const uint8_t a[32], uint8_t out[32]) { ge_p3 R; ge_scalarmult_base(&R, a); ge_p3_tobytes(out, &R); } int urcrypt_ed_add_scalarmult_scalarmult_base(const uint8_t a[32], const uint8_t a_point[32], const uint8_t b[32], uint8_t out[32]) { ge_p2 r; ge_p3 A; if (ge_frombytes_negate_vartime(&A, a_point) != 0) { return -1; } // Undo the negation from above. See add_scalar.c in the ed25519 distro. fe_neg(A.X, A.X); fe_neg(A.T, A.T); ge_double_scalarmult_vartime(&r, a, &A, b); ge_tobytes(out, &r); return 0; } int urcrypt_ed_add_double_scalarmult(const uint8_t a[32], const uint8_t a_point[32], const uint8_t b[32], const uint8_t b_point[32], uint8_t out[32]) { ge_p3 A, B, a_result, b_result, final_result; ge_cached b_result_cached; ge_p1p1 sum; if ( ge_frombytes_negate_vartime(&A, a_point) != 0 ) { return -1; } if ( ge_frombytes_negate_vartime(&B, b_point) != 0 ) { return -1; } // Undo the negation from above. See add_scalar.c in the ed25519 distro. fe_neg(A.X, A.X); fe_neg(A.T, A.T); fe_neg(B.X, B.X); fe_neg(B.T, B.T); // Perform the multiplications of a*A and b*B ge_scalarmult(&a_result, a, &A); ge_scalarmult(&b_result, b, &B); // Sum those two points ge_p3_to_cached(&b_result_cached, &b_result); ge_add(&sum, &a_result, &b_result_cached); ge_p1p1_to_p3(&final_result, &sum); ge_p3_tobytes(out, &final_result); return 0; }
/* * CaptureState.h * * Copyright (c) 2012, James Kong, http://www.fishkingsin.com * 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 16b.it nor the names of its contributors may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #pragma once #include "ofxState.h" #include "SharedData.h" #include "ofxTimer.h" #include "CountDown.h" #define SINGLE_X 0.401042f #define SINGLE_Y 0.170370f #define SINGLE_W 0.204166f #define SINGLE_H 0.444444f #define DOU1_X 0.246875f #define DOU2_X 0.557291f class CaptureState : public Apex::ofxState<SharedData> { public: void setup(); void update(); void draw(); 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 tweenCompleted(int &id); void stateExit(); void stateEnter(); void keyPressed(int key) ; void keyReleased(int key) ; void Shot(ofEventArgs &arg); void completeShot(ofEventArgs &arg); void saveFace(); string getName(); MyBox2D box2d; bool bBox2D; bool bCapture; bool bSaveFace; bool showMask; CountDown countDown; ofImage lastCapture; ofFbo capturedScreen; float ratio; float screenWidth; float screenHeight; ofImage image,overlayimage;//,mask; int timeCount; ofxTween tween; ofxEasingLinear easing; bool bExit; ofPoint videoOffset; int x,y,w,h,x2; };
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2004 Scientific Computing and Imaging Institute, University of Utah. License for the specific language governing rights and limitations under Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * Barrier: Barrier synchronization primitive * * Written by: * Author: Steve Parker * Department of Computer Science * University of Utah * Date: June 1997 * * Copyright (C) 1997 SCI Group */ #ifndef Core_Thread_RecursiveMutex_h #define Core_Thread_RecursiveMutex_h #include <Core/Thread/Mutex.h> namespace Manta { class RecursiveMutex_private; /************************************** CLASS RecursiveMutex KEYWORDS Thread DESCRIPTION Provides a recursive <b>Mut</b>ual <b>Ex</b>clusion primitive. Atomic <b>lock()</b> and <b>unlock()</b> will lock and unlock the mutex. Nested calls to <b>lock()</b> by the same thread are acceptable, but must be matched with calls to <b>unlock()</b>. This class may be less efficient that the <b>Mutex</b> class, and should not be used unless the recursive lock feature is really required. ****************************************/ class RecursiveMutex { public: ////////// // Create the Mutex. The Mutex is allocated in the unlocked // state. <i>name</i> should be a static string which describe // the primitive for debugging purposes. RecursiveMutex(const char* name); ////////// // Destroy the Mutex. Destroying a Mutex in the locked state // has undefined results. ~RecursiveMutex(); ////////// // Acquire the Mutex. This method will block until the Mutex // is acquired. void lock(); ////////// // Release the Mutex, unblocking any other threads that are // blocked waiting for the Mutex. void unlock(); private: const char* name_; RecursiveMutex_private* priv_; // Cannot copy them RecursiveMutex(const RecursiveMutex&); RecursiveMutex& operator=(const RecursiveMutex&); }; } #endif
/* LodePNG Utils Copyright (c) 2005-2012 Lode Vandevenne 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. */ #include <string> #include <vector> #pragma once namespace lodepng { /* Get the names and sizes of all chunks in the PNG file. Returns 0 if ok, non-0 if error happened. */ unsigned getChunkInfo(std::vector<std::string>& names, std::vector<size_t>& sizes, const std::vector<unsigned char>& buffer); /* Get the filtertypes of each scanline in this PNG file. Returns 0 if ok, non-0 if error happened. */ unsigned getFilterTypes(std::vector<unsigned char>& filterTypes, const std::vector<unsigned char>& buffer); struct ZlibBlockInfo { int btype; //block type (0-2) size_t compressedbits; //size of compressed block in bits size_t uncompressedbytes; //size of uncompressed block in bytes // only filled in for block type 2 size_t treebits; //encoded tree size in bits std::vector<int> clcl; //19 code length code lengths (compressed tree's tree) std::vector<int> treecodes; //N tree codes, with values 0-18. Values 17 or 18 are followed by the repetition value. // only filled in for block type 2 std::vector<int> litlenlengths; //288 code lengths for lit/len symbols std::vector<int> distlengths; //32 code lengths for dist symbols // only filled in for block types 1 or 2 std::vector<int> lz77; //LZ77 codes. 0-255: literals. 256: end symbol. 257-285: length/distance pairs: followed by two numbers: length and distance. size_t numlit; //number of lit codes in this block size_t numlen; //number of len codes in this block }; //Extracts all info needed from a PNG file to reconstruct the zlib compression exactly. void extractZlibInfo(std::vector<ZlibBlockInfo>& zlibinfo, const std::vector<unsigned char>& in); } // namespace lodepng
#ifndef CPPSEARCH_COMMON_H #define CPPSEARCH_COMMON_H #include <string> namespace cppsearch { void log(const std::string& name); void log_error(const std::string& name); } #endif //CPPSEARCH_COMMON_H
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" #import "NSCoding-Protocol.h" #import "NSCopying-Protocol.h" @interface CUIRenditionKey : NSObject <NSCopying, NSCoding> { struct _renditionkeytoken _stackKey[16]; struct _renditionkeytoken *_key; unsigned short _highwaterKeyCount; } + (id)_placeHolderKey; + (void)initialize; - (id)descriptionBasedOnKeyFormat:(const struct _renditionkeyfmt *)arg1; - (id)nameOfAttributeName:(int)arg1; - (id)description; - (long long)themeIdentifier; - (void)setThemeIdentifier:(long long)arg1; - (long long)themeSubtype; - (void)setThemeSubtype:(long long)arg1; - (long long)themeIdiom; - (void)setThemeIdiom:(long long)arg1; - (long long)themeScale; - (void)setThemeScale:(long long)arg1; - (long long)themeLayer; - (void)setThemeLayer:(long long)arg1; - (long long)themePresentationState; - (void)setThemePresentationState:(long long)arg1; - (long long)themeState; - (void)setThemeState:(long long)arg1; - (long long)themeDimension2; - (void)setThemeDimension2:(long long)arg1; - (long long)themeDimension1; - (void)setThemeDimension1:(long long)arg1; - (long long)themeValue; - (void)setThemeValue:(long long)arg1; - (long long)themeDirection; - (void)setThemeDirection:(long long)arg1; - (long long)themeSize; - (void)setThemeSize:(long long)arg1; - (long long)themePart; - (void)setThemePart:(long long)arg1; - (long long)themeElement; - (void)setThemeElement:(long long)arg1; - (id)initWithThemeElement:(long long)arg1 themePart:(long long)arg2 themeSize:(long long)arg3 themeDirection:(long long)arg4 themeValue:(long long)arg5 themeDimension1:(long long)arg6 themeDimension2:(long long)arg7 themeState:(long long)arg8 themePresentationState:(long long)arg9 themeLayer:(long long)arg10 themeScale:(long long)arg11 themeIdentifier:(long long)arg12; - (const struct _renditionkeytoken *)keyList; - (void)removeValueForKeyTokenIdentifier:(long long)arg1; - (void)copyValuesFromKeyList:(const struct _renditionkeytoken *)arg1; - (void)setValuesFromKeyList:(const struct _renditionkeytoken *)arg1; - (void)dealloc; - (id)copyWithZone:(struct _NSZone *)arg1; - (void)encodeWithCoder:(id)arg1; - (id)initWithCoder:(id)arg1; - (id)initWithKeyList:(const struct _renditionkeytoken *)arg1; - (id)init; - (void)_expandKeyIfNecessaryForCount:(long long)arg1; - (unsigned short)_systemTokenCount; @end
#ifndef SEGMENT_H #define SEGMENT_H #include "pca9685.hpp" class Segment { public: Segment(upm::PCA9685& controller, int channel) : controller(controller) , channel(channel) , speed(MAX_SPEED) , angle(90) , requiredAngle(angle) , doingAction(false) , isReversed(false){ } public: upm::PCA9685& controller; int channel; double speed; double angle; double requiredAngle; bool doingAction; bool isReversed; static const int MAX_SPEED = 300; // 300 angle per second static const int MIN_PW = 110; static const int MAX_PW = 580; static const int MAX_ANGLE = 180; void action(double angle, double speed) { reverse(angle); requiredAngle = angle; speed = speed; setPWM(0, getPWMbyAngle(requiredAngle)); } void reverse(double& angle) { if (isReversed) { angle = 180 - angle; } } void setAsReversed() { isReversed = true; } private: void setPWM(int on, int off){ controller.writeByte(upm::PCA9685::REG_LED0_ON_L + 4*channel, on & 0xFF); controller.writeByte(upm::PCA9685::REG_LED0_ON_H + 4*channel, on >> 8); controller.writeByte(upm::PCA9685::REG_LED0_OFF_L + 4*channel, off & 0xFF); controller.writeByte(upm::PCA9685::REG_LED0_OFF_H + 4*channel, off >> 8); } double getPWMbyAngle(double angle) { if (angle < 0) { angle = 0; } else if (angle > MAX_ANGLE) { angle = Segment::MAX_ANGLE; } return ((Segment::MAX_PW - Segment::MIN_PW) * (angle / Segment::MAX_ANGLE)) + Segment::MIN_PW;; } }; #endif // SEGMENT_H
/* * hebimath - arbitrary precision arithmetic library * See LICENSE file for copyright and license details */ #include "../../internal.h" extern HEBI_API void hebi_zset_copy(hebi_zptr restrict, hebi_zsrcptr restrict);
#include <cat/client.h> int main() { //cat cat_init() before the using program calls any other cat functions. cat_init("your.appid", "cat.metaserver.of.your.enviroment"); //Atomic event/error is supported since release-0.7. //Background thread aggregates atomic event/error and wrap them with transactions typed and named _CatMergeTree. cat_log_error("errtype", "errmsg"); //Wrap event/error with transaction in case of low car client version. // //transaction* t; //t = cat_new_trasaction("_CatMergeTree", "_CatMergeTree"); //cat_log_error("errtype", "errmsg"); //t->setStatus(t, "0"); //t->complete(t); cat_close(); }
// // JLYBaseAnimationController.h // ViewControllerTransitions // // Created by Colin Eberhardt on 09/09/2013. // Copyright (c) 2013 Colin Eberhardt. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN /** A base class for animation controllers which provide reversible animations. A reversible animation is often used with navigation controllers where the reverse property is set based on whether this is a push or pop operation, or for modal view controllers where the reverse property is set based o whether this is a show / dismiss. */ @interface JLYReversibleAnimationController : NSObject <UIViewControllerAnimatedTransitioning> /** The direction of the animation. */ @property (nonatomic, assign) BOOL reverse; /** The animation duration. */ @property (nonatomic, assign) NSTimeInterval duration; - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView; @end NS_ASSUME_NONNULL_END
#pragma once #include "window.h" #include "bitmap.h" #include "undo_buffer.h" class MainFrame; class CartFile; class EditorHost : public Window { public: EditorHost(MainFrame& frame); bool Create(LPCSTR lpWindowName, int x, int y, int width, int height, Window *parent); virtual void OnPaint(HDC hdc, const RECT& rcPaint); virtual bool OnEraseBackground(HDC hdc); /* Registers the frame window class */ static bool Register(); private: MainFrame& frame_; /* Class name of the window class */ static const TCHAR *ClassName; }; class Editor : public Panel, public UndoBuffer { public: Editor(MainFrame& frame, CartFile& cart) : frame_(frame), cart_(cart) { child_window_ = true; } virtual ~Editor() { } virtual void OnCreate() = 0; virtual void OnCommand(DWORD id, DWORD code); bool Undo(); bool Redo(); virtual bool Do(Ref<UndoAction> action); virtual bool SaveFile(); protected: MainFrame& frame_; CartFile& cart_; }; class ScrollSurface : public Editor, public BitmapSurface { public: ScrollSurface(MainFrame& frame, CartFile& cart); virtual ~ScrollSurface(); class Redraw : public RedrawRegion { public: Redraw(ScrollSurface& surface); ~Redraw(); virtual void Invalidate(const RECT *zone); private: ScrollSurface& surface_; }; virtual void OnCreate(); virtual void OnSize(WORD width, WORD height); virtual LRESULT OnMessage(UINT msg, WPARAM wParam, LPARAM lParam); virtual void OnPaint(HDC hdc, const RECT& rcPaint); virtual bool OnDestroy(); virtual void OnMouseDown(DWORD key, int x, int y); virtual void OnMouseUp(DWORD key, int x, int y); virtual void OnMouseMove(int x, int y); virtual bool OnQueryCursor(DWORD dwHitTest, const POINT& pt); void GetCursorPos(POINT& pt); void ClientToScroll(RECT& rc); void ScrollToClient(RECT& rc); /** * Sets the dimensions of the surface */ void SetDimensions(int width, int height); const RECT& GetScrollRect() const; virtual void GetRect(RECT& rect) const; void GetView(RECT& rect); int X() const { return x_; } int Y() const { return y_; } bool Resize(int width, int height); void UpdateScroll(int x, int y); void Scroll(int& x, int& y); protected: int x_, y_; int scroll_x_, scroll_y_; int surface_width_, surface_height_; RECT scroll_rect_; RECT viewRc_; }; /** * Provides selection marquee and drag & drop */ class EditTool : public Panel { public: EditTool(ScrollSurface& target); ~EditTool(); /* Start the selection marquee */ void StartSelection(); void StopSelection(); bool IsSelectionActive() const; /* Events for selection marquee */ virtual void OnSelectionMove(const RECT& selection); virtual void OnSelectionRelease(const RECT& selection, RedrawRegion& redraw); /* Enable the drag & drop operation */ void StartDrag(); void StopDrag(); bool IsDragging() const; /* Events for drag & drop */ virtual void OnDragMove(int x, int y); virtual void OnDragRelease(const POINT& pt, int ix, int iy); virtual void OnPaintArea(const RECT& pos, HDC hdc); /* Called when the mouse move */ virtual void OnMouseMove(int x, int y); virtual void OnMouseUp(DWORD key, int x, int y); virtual void OnTimer(DWORD id); private: static const DWORD kTimerId; void Drag(int x, int y); void UpdateSelection(); void DrawFocusRect(const RECT& pos, HDC hdc); void InvalidateFocusRect(RedrawRegion& redraw); ScrollSurface& target_; bool selection_active_; bool drag_active_; POINT dragPt_; int ix_; int iy_; RECT selectionRc_; }; class SelectionMarquee { public: SelectionMarquee(Window& target); /* Enable the marquee to track the mouse */ void Activate(int x, int y); void Desactivate(int x, int y); /* Draw the selection marquee on the device context */ void Draw(HDC hdc, const RECT& pos); /* Called when the mouse move, * the selection rectangle is resized */ void MouseMove(int x, int y); /* Whether or not the selection is shown. */ bool IsActive() const; RECT& GetSelectionZone(); private: /* Selection zone */ RECT zone_; RECT selection_zone_; /* true if selection is active and should be shown. */ bool active_; int grid_; Window& target_; }; class DragDrop { public: explicit DragDrop(Window& host); /* Enable the drag drop, track the mouse */ void Activate(int x, int y); void Desactivate(int x, int y); /* Called when the mouse move, * new position is calculated */ void MouseMove(int& x, int& y); /* Whether or not the drag drop is active. */ bool IsActive() const; private: /* Position of the last move */ POINT last_move_; Window& host_; bool active_; };
/******************************************************************************* * * Copyright (c) 2011, 2012, 2013, 2014, 2015 Olaf Bergmann (TZI) and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v. 1.0 which accompanies this distribution. * * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Olaf Bergmann - initial API and implementation * Hauke Mehrtens - memory optimization, ECC integration * *******************************************************************************/ #ifndef _DTLS_HMAC_H_ #define _DTLS_HMAC_H_ #include <sys/types.h> #include "tinydtls.h" #include "global.h" #ifdef WITH_SHA256 /** Aaron D. Gifford's implementation of SHA256 * see http://www.aarongifford.com/ */ #include "sha2/sha2.h" typedef dtls_sha256_ctx dtls_hash_ctx; typedef dtls_hash_ctx *dtls_hash_t; #define DTLS_HASH_CTX_SIZE sizeof(dtls_sha256_ctx) static inline void dtls_hash_init(dtls_hash_t ctx) { dtls_sha256_init((dtls_sha256_ctx *)ctx); } static inline void dtls_hash_update(dtls_hash_t ctx, const unsigned char *input, size_t len) { dtls_sha256_update((dtls_sha256_ctx *)ctx, input, len); } static inline size_t dtls_hash_finalize(unsigned char *buf, dtls_hash_t ctx) { dtls_sha256_final(buf, (dtls_sha256_ctx *)ctx); return DTLS_SHA256_DIGEST_LENGTH; } #endif /* WITH_SHA256 */ #ifndef WITH_CONTIKI static inline void dtls_hmac_storage_init(void) { } #else void dtls_hmac_storage_init(void); #endif /** * \defgroup HMAC Keyed-Hash Message Authentication Code (HMAC) * NIST Standard FIPS 198 describes the Keyed-Hash Message Authentication * Code (HMAC) which is used as hash function for the DTLS PRF. * @{ */ #define DTLS_HMAC_BLOCKSIZE 64 /**< size of hmac blocks */ #define DTLS_HMAC_DIGEST_SIZE 32 /**< digest size (for SHA-256) */ #define DTLS_HMAC_MAX 64 /**< max number of bytes in digest */ /** * List of known hash functions for use in dtls_hmac_init(). The * identifiers are the same as the HashAlgorithm defined in * <a href="http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1" * >Section 7.4.1.4.1 of RFC 5246</a>. */ typedef enum { HASH_NONE=0, HASH_MD5=1, HASH_SHA1=2, HASH_SHA224=3, HASH_SHA256=4, HASH_SHA384=5, HASH_SHA512=6 } dtls_hashfunc_t; /** * Context for HMAC generation. This object is initialized with * dtls_hmac_init() and must be passed to dtls_hmac_update() and * dtls_hmac_finalize(). Once, finalized, the component \c H is * invalid and must be initialized again with dtls_hmac_init() before * the structure can be used again. */ typedef struct { unsigned char pad[DTLS_HMAC_BLOCKSIZE]; /**< ipad and opad storage */ dtls_hash_ctx data; /**< context for hash function */ } dtls_hmac_context_t; /** * Initializes an existing HMAC context. * * @param ctx The HMAC context to initialize. * @param key The secret key. * @param klen The length of @p key. */ void dtls_hmac_init(dtls_hmac_context_t *ctx, const unsigned char *key, size_t klen); /** * Allocates a new HMAC context \p ctx with the given secret key. * This function returns \c 1 if \c ctx has been set correctly, or \c * 0 or \c -1 otherwise. Note that this function allocates new storage * that must be released by dtls_hmac_free(). * * \param key The secret key. * \param klen The length of \p key. * \return A new dtls_hmac_context_t object or @c NULL on error */ dtls_hmac_context_t *dtls_hmac_new(const unsigned char *key, size_t klen); /** * Releases the storage for @p ctx that has been allocated by * dtls_hmac_new(). * * @param ctx The dtls_hmac_context_t to free. */ void dtls_hmac_free(dtls_hmac_context_t *ctx); /** * Updates the HMAC context with data from \p input. * * \param ctx The HMAC context. * \param input The input data. * \param ilen Size of \p input. */ void dtls_hmac_update(dtls_hmac_context_t *ctx, const unsigned char *input, size_t ilen); /** * Completes the HMAC generation and writes the result to the given * output parameter \c result. The buffer must be large enough to hold * the message digest created by the actual hash function. If in * doubt, use \c DTLS_HMAC_MAX. The function returns the number of * bytes written to \c result. * * \param ctx The HMAC context. * \param result Output parameter where the MAC is written to. * \return Length of the MAC written to \p result. */ int dtls_hmac_finalize(dtls_hmac_context_t *ctx, unsigned char *result); /**@}*/ #endif /* _DTLS_HMAC_H_ */
/*************** * PROGRAM: Modeler * NAME: animbar_class.h * DESCRIPTION: definitions for animation bar subclass * AUTHORS: Andreas Heumann * HISTORY: * DATE NAME COMMENT * 22.11.98 ah initial release ***************/ #ifndef ANIMBAR_CLASS_H #define ANIMBAR_CLASS_H struct AnimBar_Data { Object *b_first, *b_prev, *b_stop, *b_play, *b_next, *b_last; Object *sl_frame; }; SAVEDS ASM ULONG AnimBar_Dispatcher(REG(a0) struct IClass*,REG(a2) Object*,REG(a1) Msg); #endif
// OCExpectations NSObject+OCSpecMatchers.h // // Copyright © 2012, The OCCukes Organisation. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the “Software”), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EITHER // EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO // EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES // OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // //------------------------------------------------------------------------------ #import <Foundation/Foundation.h> @protocol OCSpecMatcher; @class OCSpecBeWithinMatcher; /*! * To obtain a matcher, send one of the following messages to the expected * value. The expected value must always be an object. With LLVM 4.0, you can * conveniently convert literals to Objective-C objects. */ @interface NSObject(OCSpecMatchers) + (id<OCSpecMatcher>)beTrue; + (id<OCSpecMatcher>)beFalse; + (id<OCSpecMatcher>)beNull; - (id<OCSpecMatcher>)be; - (id<OCSpecMatcher>)beA; - (id<OCSpecMatcher>)beAn; - (id<OCSpecMatcher>)beAnInstanceOf; - (id<OCSpecMatcher>)beInstanceOf; - (id<OCSpecMatcher>)beAKindOf; - (id<OCSpecMatcher>)beKindOf; - (OCSpecBeWithinMatcher *)beWithin; - (id<OCSpecMatcher>)equal; - (id<OCSpecMatcher>)eql; - (id<OCSpecMatcher>)include; - (id<OCSpecMatcher>)compareSame; - (id<OCSpecMatcher>)compareAscending; - (id<OCSpecMatcher>)compareDescending; @end /* * Macros use the underscore rather than camel-case delimiter style. This by * design because the matcher method extensions use camel-case. Clashes could * result if both use the same style. The C pre-processor operates on all * tokens, including Objective-C method names. */ //--------------------------------------------------------------------------- be #ifndef be_true #define be_true [NSObject beTrue] #endif #ifndef be_false #define be_false [NSObject beFalse] #endif #ifndef be_null #define be_null [NSObject beNull] #endif #ifndef be #define be(expected) [(expected) be] #endif #ifndef be_a #define be_a(expected) [(expected) beA] #endif #ifndef be_an #define be_an(expected) [(expected) beAn] #endif #ifndef be_an_instance_of #define be_an_instance_of(expected) [(expected) beAnInstanceOf] #endif #ifndef be_instance_of #define be_instance_of(expected) [(expected) beInstanceOf] #endif #ifndef be_a_kind_of #define be_a_kind_of(expected) [(expected) beAKindOf] #endif #ifndef be_kind_of #define be_kind_of(expected) [(expected) beKindOf] #endif #ifndef be_within #define be_within(expected) [(expected) beWithin] #endif //------------------------------------------------------------------------ equal #ifndef equal #define equal(expected) [(expected) equal] #endif #ifndef eql #define eql(expected) [(expected) eql] #endif //---------------------------------------------------------------------- include #ifndef include #define include(expected) [(expected) include] #endif //---------------------------------------------------------------------- compare #ifndef compare_same #define compare_same(expected) [(expected) compareSame] #endif #ifndef compare_ascending #define compare_ascending(expected) [(expected) compareAscending] #endif #ifndef compare_less_than #define compare_less_than(expected) [(expected) compareAscending] #endif #ifndef compare_descending #define compare_descending(expected) [(expected) compareDescending] #endif #ifndef compare_more_than #define compare_more_than(expected) [(expected) compareDescending] #endif
#pragma once //Test header //Good; should not be caught by final/virtual rule. enum class MyEnum { POMEGRANATE }; class FooClass final { virtual void method(void) const = 0; }; class BarClass final : public FooClass { virtual ~BarClass(void) {} //Bad; should be "default"ed //Bad; should have been tagged "virtual" void method(void) const override {} };
// // MKCustomAnnotation.h // ParseExample // // Created by UNA on 08/06/14. // Copyright (c) 2014 GoTouch. All rights reserved. // #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface MKCustomAnnotation : NSObject<MKAnnotation>{ NSString *subtitle; NSString *title; } @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; @property (copy, nonatomic) NSString *title; @property (copy, nonatomic) NSString *subtitle; @property int tag; -(id)initWithTitle:(NSString *)newTitle Subtitle:(NSString*)subtitle Location:(CLLocationCoordinate2D)location; - (MKAnnotationView *)annotationView; - (int)getIndexTour; @end
// // NSString+YNNormalRegex.h // YNCommonProject // // Created by 王阳 on 2016/11/30. // Copyright © 2016年 王阳. All rights reserved. // /** * 正则表达式简单说明 * 语法: . 匹配除换行符以外的任意字符 \w 匹配字母或数字或下划线或汉字 \s 匹配任意的空白符 \d 匹配数字 \b 匹配单词的开始或结束 ^ 匹配字符串的开始 $ 匹配字符串的结束 * 重复零次或更多次 + 重复一次或更多次 ? 重复零次或一次 {n} 重复n次 {n,} 重复n次或更多次 {n,m} 重复n到m次 \W 匹配任意不是字母,数字,下划线,汉字的字符 \S 匹配任意不是空白符的字符 \D 匹配任意非数字的字符 \B 匹配不是单词开头或结束的位置 [^x] 匹配除了x以外的任意字符 [^aeiou]匹配除了aeiou这几个字母以外的任意字符 *? 重复任意次,但尽可能少重复 +? 重复1次或更多次,但尽可能少重复 ?? 重复0次或1次,但尽可能少重复 {n,m}? 重复n到m次,但尽可能少重复 {n,}? 重复n次以上,但尽可能少重复 \a 报警字符(打印它的效果是电脑嘀一声) \b 通常是单词分界位置,但如果在字符类里使用代表退格 \t 制表符,Tab \r 回车 \v 竖向制表符 \f 换页符 \n 换行符 \e Escape \0nn ASCII代码中八进制代码为nn的字符 \xnn ASCII代码中十六进制代码为nn的字符 \unnnn Unicode代码中十六进制代码为nnnn的字符 \cN ASCII控制字符。比如\cC代表Ctrl+C \A 字符串开头(类似^,但不受处理多行选项的影响) \Z 字符串结尾或行尾(不受处理多行选项的影响) \z 字符串结尾(类似$,但不受处理多行选项的影响) \G 当前搜索的开头 \p{name} Unicode中命名为name的字符类,例如\p{IsGreek} (?>exp) 贪婪子表达式 (?<x>-<y>exp) 平衡组 (?im-nsx:exp) 在子表达式exp中改变处理选项 (?im-nsx) 为表达式后面的部分改变处理选项 (?(exp)yes|no) 把exp当作零宽正向先行断言,如果在这个位置能匹配,使用yes作为此组的表达式;否则使用no (?(exp)yes) 同上,只是使用空表达式作为no (?(name)yes|no) 如果命名为name的组捕获到了内容,使用yes作为表达式;否则使用no (?(name)yes) 同上,只是使用空表达式作为no 捕获 (exp) 匹配exp,并捕获文本到自动命名的组里 (?<name>exp) 匹配exp,并捕获文本到名称为name的组里,也可以写成(?'name'exp) (?:exp) 匹配exp,不捕获匹配的文本,也不给此分组分配组号 零宽断言 (?=exp) 匹配exp前面的位置 (?<=exp) 匹配exp后面的位置 (?!exp) 匹配后面跟的不是exp的位置 (?<!exp) 匹配前面不是exp的位置 注释 (?#comment) 这种类型的分组不对正则表达式的处理产生任何影响,用于提供注释让人阅读 * 表达式:\(?0\d{2}[) -]?\d{8} * 这个表达式可以匹配几种格式的电话号码,像(010)88886666,或022-22334455,或02912345678等。 * 我们对它进行一些分析吧: * 首先是一个转义字符\(,它能出现0次或1次(?),然后是一个0,后面跟着2个数字(\d{2}),然后是)或-或空格中的一个,它出现1次或不出现(?), * 最后是8个数字(\d{8}) */ #import <Foundation/Foundation.h> @interface NSString (YNNormalRegex) /** * 手机号码的有效性:分电信、联通、移动和小灵通 */ - (BOOL)yn_isMobileNumberClassification; /** * 手机号有效性 */ - (BOOL)yn_isMobileNumber; /** * 邮箱的有效性 */ - (BOOL)yn_isEmailAddress; /** * 简单的身份证有效性 * */ - (BOOL)yn_simpleVerifyIdentityCardNum; /** * 精确的身份证号码有效性检测 * * @param value 身份证号 */ + (BOOL)yn_accurateVerifyIDCardNumber:(NSString *)value; /** * 车牌号的有效性 */ - (BOOL)yn_isCarNumber; /** * 银行卡的有效性 */ - (BOOL)yn_bankCardluhmCheck; /** * IP地址有效性 */ - (BOOL)yn_isIPAddress; /** * Mac地址有效性 */ - (BOOL)yn_isMacAddress; /** * 网址有效性 */ - (BOOL)yn_isValidUrl; /** * 纯汉字 */ - (BOOL)yn_isValidChinese; /** * 邮政编码 */ - (BOOL)yn_isValidPostalcode; /** * 工商税号 */ - (BOOL)yn_isValidTaxNo; /** @brief 是否符合最小长度、最长长度,是否包含中文,首字母是否可以为数字 @param minLenth 账号最小长度 @param maxLenth 账号最长长度 @param containChinese 是否包含中文 @param firstCannotBeDigtal 首字母不能为数字 @return 正则验证成功返回YES, 否则返回NO */ - (BOOL)yn_isValidWithMinLenth:(NSInteger)minLenth maxLenth:(NSInteger)maxLenth containChinese:(BOOL)containChinese firstCannotBeDigtal:(BOOL)firstCannotBeDigtal; /** @brief 是否符合最小长度、最长长度,是否包含中文,数字,字母,其他字符,首字母是否可以为数字 @param minLenth 账号最小长度 @param maxLenth 账号最长长度 @param containChinese 是否包含中文 @param containDigtal 包含数字 @param containLetter 包含字母 @param containOtherCharacter 其他字符 @param firstCannotBeDigtal 首字母不能为数字 @return 正则验证成功返回YES, 否则返回NO */ - (BOOL)yn_isValidWithMinLenth:(NSInteger)minLenth maxLenth:(NSInteger)maxLenth containChinese:(BOOL)containChinese containDigtal:(BOOL)containDigtal containLetter:(BOOL)containLetter containOtherCharacter:(NSString *)containOtherCharacter firstCannotBeDigtal:(BOOL)firstCannotBeDigtal; @end
// // Article+Methods.h // Greatist Message Publisher // // Created by Ezekiel Abuhoff on 4/14/14. // Copyright (c) 2014 Ezekiel Abuhoff. All rights reserved. // #import "Article.h" @interface Article (Methods) + (instancetype) articleWithTitle: (NSString *)title Created: (NSDate *)created pictureLarge: (NSString *)pictureLarge Nid: (NSString *)nid inContext: (NSManagedObjectContext *)context; @end
/**************************************************************************//** * @file * @brief efm32lg_romtable Register and Bit Field definitions * @author Energy Micro AS * @version 3.20.2 ****************************************************************************** * @section License * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b> ******************************************************************************* * * 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. * 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. * * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no * obligation to support this Software. Silicon Labs is providing the * Software "AS IS", with no express or implied warranties of any kind, * including, but not limited to, any implied warranties of merchantability * or fitness for any particular purpose or warranties against infringement * of any proprietary rights of a third party. * * Silicon Labs will not be liable for any consequential, incidental, or * special damages, or any other relief, or for any claim by any third party, * arising from your use of this Software. * ******************************************************************************/ /**************************************************************************//** * @defgroup EFM32LG_ROMTABLE * @{ * @brief Chip Information, Revision numbers *****************************************************************************/ typedef struct { __I uint32_t PID4; /**< JEP_106_BANK */ __I uint32_t PID5; /**< Unused */ __I uint32_t PID6; /**< Unused */ __I uint32_t PID7; /**< Unused */ __I uint32_t PID0; /**< Chip family LSB, chip major revision */ __I uint32_t PID1; /**< JEP_106_NO, Chip family MSB */ __I uint32_t PID2; /**< Chip minor rev MSB, JEP_106_PRESENT, JEP_106_NO */ __I uint32_t PID3; /**< Chip minor rev LSB */ __I uint32_t CID0; /**< Unused */ } ROMTABLE_TypeDef; /** @} */ /**************************************************************************//** * @defgroup EFM32LG_ROMTABLE_BitFields * @{ *****************************************************************************/ /* Bit fields for EFM32LG_ROMTABLE */ #define _ROMTABLE_PID0_FAMILYLSB_MASK 0x000000C0UL /**< Least Significant Bits [1:0] of CHIP FAMILY, mask */ #define _ROMTABLE_PID0_FAMILYLSB_SHIFT 6 /**< Least Significant Bits [1:0] of CHIP FAMILY, shift */ #define _ROMTABLE_PID0_REVMAJOR_MASK 0x0000003FUL /**< CHIP MAJOR Revison, mask */ #define _ROMTABLE_PID0_REVMAJOR_SHIFT 0 /**< CHIP MAJOR Revison, shift */ #define _ROMTABLE_PID1_FAMILYMSB_MASK 0x0000000FUL /**< Most Significant Bits [5:2] of CHIP FAMILY, mask */ #define _ROMTABLE_PID1_FAMILYMSB_SHIFT 0 /**< Most Significant Bits [5:2] of CHIP FAMILY, shift */ #define _ROMTABLE_PID2_REVMINORMSB_MASK 0x000000F0UL /**< Most Significant Bits [7:4] of CHIP MINOR revision, mask */ #define _ROMTABLE_PID2_REVMINORMSB_SHIFT 4 /**< Most Significant Bits [7:4] of CHIP MINOR revision, mask */ #define _ROMTABLE_PID3_REVMINORLSB_MASK 0x000000F0UL /**< Least Significant Bits [3:0] of CHIP MINOR revision, mask */ #define _ROMTABLE_PID3_REVMINORLSB_SHIFT 4 /**< Least Significant Bits [3:0] of CHIP MINOR revision, shift */ /** @} End of group EFM32LG_ROMTABLE */
// // QBConnection+Auth.h // Quickblox // // Created by Andrey Kozlov on 09/01/2014. // Copyright (c) 2014 QuickBlox. All rights reserved. // #import "QBConnection.h" @interface QBConnection (QBAuth) + (QBConnection *)authSessionConnection; + (QBConnection *)authUserConnection; #pragma mark - Establish connection methods to receive session token + (void)connectWithCompletionBlock:(void (^)(BOOL success))completionBlock; + (void)connectUsingUserLogin:(NSString *)login password:(NSString *)password withCompletionBlock:(void (^)(BOOL success))completionBlock; // TODO: add other wariants of getting session token + (void)disconnectWithCompletionBlock:(void (^)(BOOL success))completionBlock; @end
/** * PLAIN FRAMEWORK ( https://github.com/viticm/plainframework ) * $Id iocp.h * @link https://github.com/viticm/plainframework for the canonical source repository * @copyright Copyright (c) 2014- viticm( viticm.ti@gmail.com ) * @license * @user viticm<viticm.ti@gmail.com> * @date 2014/07/17 17:38 * @uses the connection iocp manager */ #ifndef PF_NET_CONNECTION_MANAGER_IOCP_H_ #define PF_NET_CONNECTION_MANAGER_IOCP_H_ #if __WINDOWS__ && defined(_PF_NET_IOCP) #include "pf/net/connection/manager/config.h" #include "pf/net/connection/manager/base.h" #error iocp connection manager not completed! namespace pf_net { namespace connection { namespace manager { class PF_API Iocp : public Base { public: Iocp(); virtual ~Iocp(); }; }; //namespace manager }; //namespace connection }; //namespace pf_net #endif #endif //PF_NET_CONNECTION_MANAGER_IOCP_H_
/* motor2d Copyright (C) 2015 Florian Kesseler This project is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE.md for details. */ #include <tgmath.h> #include "lerp.h" extern inline float lerp(float a, float b, float t);
#ifndef __IO_H__ #define __IO_H__ #include <string.h> #include <timer.h> #define TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFFULL #define IO_CLASS_GPIO 0x0000 #define IO_CLASS_USER_FIRST 0x8000 #define IO_CLASS_USER_LAST 0xFFFF #define IO_CLASS_REQUEST(Class,Request) ((unsigned int)(((Class) << 16) | (Request))) typedef struct IOP_HANDLE_DATA IOP_HANDLE_DATA, *HANDLE; typedef struct IOP_USER_IO_OPERATION IOP_USER_IO_OPERATION, *IO_OPERATION; typedef struct IOP_CORE_IO_OPERATION IOP_CORE_IO_OPERATION, *CORE_IO_OPERATION; typedef struct IOP_DEVICE IOP_DEVICE, *IO_DEVICE; typedef enum IOSTATUS { IOSTATUS_SUCCESS = 0, IOSTATUS_PENDING = -1, IOSTATUS_OUT_OF_MEMORY = -2, IOSTATUS_TIMEOUT = -3, IOSTATUS_INVALID_NAME = -4, IOSTATUS_DEVICE_NOT_FOUND = -5, IOSTATUS_BUSY = -6, IOSTATUS_INVALID_BUFFER = -7, IOSTATUS_UNSUPPORTED_REQUEST = -8, IOSTATUS_CANCELLED = -9, } IOSTATUS; typedef void (*IO_DRV_COMPLETION_CALLBACK)(IOSTATUS Status, void *Argument); typedef void (*IO_OPERATION_COMPLETION_CALLBACK)(IOSTATUS Status, IO_OPERATION Operation, unsigned int BytesTransferred, void *Argument); #define FAILURE(Status) ((int)(Status) < 0) #define SUCCESS(Status) (!FAILURE(Status))) typedef void (*IO_DRV_ATTACH)(IO_DEVICE Device, const void *PlatformData, IO_DRV_COMPLETION_CALLBACK Callback, void *Argument); typedef void (*IO_DRV_DETACH)(IO_DEVICE Device, IO_DRV_COMPLETION_CALLBACK Callback, void *Argument); typedef void (*IO_DRV_OPEN)(const char *Filename, unsigned int Mode, HANDLE Handle, IO_DRV_COMPLETION_CALLBACK Callback, void *Argument); typedef void (*IO_DRV_DUPLICATE)(HANDLE Handle, HANDLE NewHandle, IO_DRV_COMPLETION_CALLBACK Callback, void *Argument); typedef void (*IO_DRV_CLOSE)(HANDLE Handle, IO_DRV_COMPLETION_CALLBACK Callback, void *Argument); typedef void (*IO_DRV_OPERATION)(CORE_IO_OPERATION Operation, IO_DRV_COMPLETION_CALLBACK Callback, void *Argument); typedef void (*IO_DRV_QUEUE_OPERATION)(CORE_IO_OPERATION Operation); typedef struct IO_DRIVER { size_t DeviceDataSize; size_t HandleDataSize; size_t OperationDataSize; IO_DRV_ATTACH Attach; IO_DRV_DETACH Detach; IO_DRV_OPEN Open; IO_DRV_DUPLICATE Duplicate; IO_DRV_CLOSE Close; IO_DRV_OPERATION Submit; IO_DRV_OPERATION Cancel; } IO_DRIVER; typedef struct IO_DRV_OPERATION_QUEUE { LIST_HEAD Head; IO_DRV_QUEUE_OPERATION Execute; IO_DRV_QUEUE_OPERATION Abort; } IO_DRV_OPERATION_QUEUE; typedef struct IO_DRV_OPERATION_QUEUE_HANDLE_DATA { LIST_HEAD Head; } IO_DRV_OPERATION_QUEUE_HANDLE_DATA; typedef struct IO_BOARD_DEVICE { const IO_DRIVER *Driver; const char *Name; const void *Data; } IO_BOARD_DEVICE; #define BOARD_DEVICE(aDriver,aName,aData) { .Driver = aDriver, .Name = aName, .Data = aData } #define BOARD_END BOARD_DEVICE(NULL, NULL, NULL) typedef struct IO_BOARD { unsigned char Dummy; IO_BOARD_DEVICE Devices[]; } IO_BOARD; LIBC_BEGIN_PROTOTYPES void IoInit(void); #pragma GCC visibility push(default) /* Application API */ IOSTATUS IoOpenFile(const char *Filename, unsigned int Mode, HANDLE *Handle); IOSTATUS IoDuplicateHandle(HANDLE Handle, HANDLE *NewHandle); IOSTATUS IoCloseHandle(HANDLE Handle); IOSTATUS IoSubmit(HANDLE Handle, unsigned int Request, void *Buffer, size_t BufferSize, IO_OPERATION *Operation); IOSTATUS IoCancel(IO_OPERATION Operation); IOSTATUS IoGetResult(IO_OPERATION Operation, unsigned int *BytesTransferred); IOSTATUS IoSynchronize(IO_OPERATION *Operations, size_t Count, TIME Timeout, TIME *TimeElapsed); IOSTATUS IoRelease(IO_OPERATION Operation); IOSTATUS IoAttach(const char *Name, const IO_DRIVER *Driver, const void *PlatformData); IOSTATUS IoDetach(const char *Name); /* Driver API */ void IoDrvOpenFile(const char *Filename, unsigned int Mode, HANDLE *Handle, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvDuplicateHandle(HANDLE Handle, HANDLE *NewHandle, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvCloseHandle(HANDLE Handle, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvSubmit(HANDLE Handle, unsigned int Request, void *Buffer, size_t BufferSize, IO_OPERATION *Operation, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvCancel(IO_OPERATION Operation, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvSubscribe(IO_OPERATION Operation, IO_OPERATION_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvAttach(const char *Name, const IO_DRIVER *Driver, const void *PlatformData, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void IoDrvDetach(const char *Name, IO_DRV_COMPLETION_CALLBACK Callback, void *CallbackArg); void *IoDrvDeviceData(IO_DEVICE Device); IO_DEVICE IoDrvDeviceForHandle(HANDLE Handle); void *IoDrvHandleData(HANDLE Handle); void IoDrvAddTransferred(CORE_IO_OPERATION Operation, unsigned int Bytes); void IoDrvComplete(CORE_IO_OPERATION Operation, IOSTATUS Status); HANDLE IoDrvHandle(CORE_IO_OPERATION Operation); unsigned int IoDrvRequest(CORE_IO_OPERATION Operation); void *IoDrvBuffer(CORE_IO_OPERATION Operation); size_t IoDrvSize(CORE_IO_OPERATION Operation); void *IoDrvData(CORE_IO_OPERATION Operation); /* Utility API */ IOSTATUS IoBringUp(const IO_BOARD *Board); IOSTATUS IoExecute(HANDLE Handle, unsigned int Operation, void *Buffer, size_t BufferSize, unsigned int *BytesTransferred); void IoDrvOperationQueueInitialize(IO_DRV_OPERATION_QUEUE *Queue, IO_DRV_QUEUE_OPERATION Execute, IO_DRV_QUEUE_OPERATION Abort); void IoDrvOperationQueueSubmit(IO_DRV_OPERATION_QUEUE *Queue, CORE_IO_OPERATION Operation); void IoDrvOperationQueueCancel(IO_DRV_OPERATION_QUEUE *Queue, CORE_IO_OPERATION Operation); void IoDrvOperationQueueComplete(IO_DRV_OPERATION_QUEUE *Queue, IOSTATUS Status); CORE_IO_OPERATION IoDrvOperationQueueCurrent(IO_DRV_OPERATION_QUEUE *Queue); void IoHaltWithStatus(IOSTATUS Status); #pragma GCC visibility pop LIBC_END_PROTOTYPES #endif
// // NSObject+YLSwizzle.h // FrameworkDemo // // Created by Bright on 16/4/15. // Copyright © 2016年 yunlong. All rights reserved. // #import <Foundation/Foundation.h> #import <objc/runtime.h> //Method Swizzling 的封装 @interface NSObject (YLSwizzle) + (IMP)swizzleSelector:(SEL)origSelector withIMP:(IMP)newIMP; @end
/* * Copyright (c) 1996 The University of Utah and * the Computer Systems Laboratory at the University of Utah (CSL). * All rights reserved. * * Permission to use, copy, modify and distribute this software is hereby * granted provided that (1) source code retains these copyright, permission, * and disclaimer notices, and (2) redistributions including binaries * reproduce the notices in supporting documentation, and (3) all advertising * materials mentioning features or use of this software display the following * acknowledgement: ``This product includes software developed by the * Computer Systems Laboratory at the University of Utah.'' * * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * CSL requests users of this software to return to csl-dist@cs.utah.edu any * improvements that they make and grant CSL redistribution rights. */ #include <stddef.h> #include "malloc_internal.h" void *_memalign(size_t alignment, size_t size) { unsigned shift; size_t *chunk; /* Find the alignment shift in bits. XXX use proc_ops.h */ for (shift = 0; (1 << shift) < alignment; shift++); /* * Allocate a chunk of LMM memory with the specified alignment shift * and an offset such that the memory block we return will be aligned * after we add our size field to the beginning of it. */ size += sizeof(size_t); if (!(chunk = lmm_alloc_aligned(&malloc_lmm, size, 0, shift, (1 << shift) - sizeof(size_t)))) return NULL; *chunk = size; return chunk+1; }
/* * Configuation settings for MPR2 * * Copyright (C) 2008 * Mark Jonas <mark.jonas@de.bosch.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MPR2_H #define __MPR2_H /* Supported commands */ /* Default environment variables */ #define CONFIG_BOOTFILE "/boot/zImage" #define CONFIG_LOADADDR 0x8E000000 /* CPU and platform */ #define CONFIG_CPU_SH7720 1 #define CONFIG_DISPLAY_BOARDINFO /* U-Boot internals */ #define CONFIG_SYS_BAUDRATE_TABLE { 115200 } /* List of legal baudrate settings for this board */ #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 32 * 1024 * 1024) #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE #define CONFIG_SYS_MONITOR_LEN (128 * 1024) #define CONFIG_SYS_MALLOC_LEN (256 * 1024) /* Memory */ #define CONFIG_SYS_SDRAM_BASE 0x8C000000 #define CONFIG_SYS_SDRAM_SIZE (64 * 1024 * 1024) #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + (60 * 1024 * 1024)) /* Flash */ #define CONFIG_SYS_FLASH_CFI #define CONFIG_FLASH_CFI_DRIVER #define CONFIG_SYS_FLASH_EMPTY_INFO #define CONFIG_SYS_FLASH_BASE 0xA0000000 #define CONFIG_SYS_MAX_FLASH_SECT 256 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE } #define CONFIG_ENV_SECT_SIZE (128 * 1024) #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) #define CONFIG_SYS_FLASH_ERASE_TOUT 120000 #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Clocks */ #define CONFIG_SYS_CLK_FREQ 24000000 #define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ #define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ #define CONFIG_SYS_TMU_CLK_DIV 4 /* 4 (default), 16, 64, 256 or 1024 */ /* UART */ #define CONFIG_CONS_SCIF0 1 #endif /* __MPR2_H */
#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 RAGTextFieldVersionNumber; FOUNDATION_EXPORT const unsigned char RAGTextFieldVersionString[];
#pragma once #include <vector> #include "Point3d.h" #include "TwoManifold.h" #include "LoopSubdivision.h" class MyObject { public: MyObject(std::string filename); virtual ~MyObject(); TwoManifold * getSubdivision(int level); void makeVertexList(int lvl, std::vector<float> &x, std::vector<float> &y, std::vector<float> &z , std::vector<Point3d> &n, bool facenormal); void makeTextureList(int lvl, std::vector<int> &tex_indices, std::vector<HE_Texture> &texture_coords); //void giveTextureFiles(int lvl, std::vector<std::string> &texture_files void assignTexture(std::string filename); void changeTextureCoordinates(int lvl, int face, float t1x, float t1y, float t2x, float t2y, float t3x, float t3y); void changeTextureIndices(int lvl, int face, int texture); std::string getTextureName(int lvl, int face); void writeToFile(int lvl, std::string filename); //Return to private later std::vector<TwoManifold> levels_subdivision; private: int no_subdivisions; int max_subdivisions; bool texture; };
#include<stdio.h> #include<string.h> #include<math.h> int main(int argc, char const *argv[]) { //functionSX(); //functionMonkey(10); // functionJX(3); return 0; } /* 利用递归方法求5! */ 1, 1, 2 ,3 ,5 ... int functionFBLQ(int n){ if (n == 1 || n == 2) { /* code */ return 1; } return functionFBLQ(n) + functionFBLQ(n -1); } int functionJXDG(int n){ if (n == 1) { return 1; } return functionJXDG(n - 1) * n; } /* 题目:求1+2!+3!+...+20!的和 */ int functionJX(int n){ int sum = 0; for (size_t i = 1; i <= n; i++) { /* code */ int sumI = 1; for (size_t j = 1; j <= i; j++){ /* code */ sumI *= j; } sum += sumI; } printf("sumJC = %d\n",sum); return sum; } /* 题目:猴子吃桃问题:猴子第一天摘下若干个桃子,当即吃了一半,还不瘾,又多吃了一个 第二天早上又将剩下的桃子吃掉一半,又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。 到第10天早上想再吃时,见只剩下一个桃子了。求第一天共摘了多少 */ int functionMonkey(int day){ int sum = 0; for (size_t i = 0; i < 10; i++) { /* code */ if (i == 0) { sum = 1; }else{ sum += 1; sum *= 2; } } printf("%d\n",sum); } //水仙花数 functionSX(){ for (size_t i = 100; i < 1000; i++) { /* code */ int a = i/100; //百位 int b = i/10%10; //十位 int c = i%10; //个位 if ( (pow(a,3) + pow(b,3) + pow(c,3)) == i) { /* code */ printf("i = %d\n", i); } } }
#ifndef BITCOINFEEFIELD_H #define BITCOINFEEFIELD_H #include <QWidget> QT_BEGIN_NAMESPACE class QDoubleSpinBox; class QValueComboBox; QT_END_NAMESPACE /** Widget for entering TripleChain fee. */ class BitcoinFeeField: public QWidget { Q_OBJECT Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true) public: explicit BitcoinFeeField(QWidget *parent = 0); qint64 value(bool *valid=0) const; void setValue(qint64 value); /** Mark current value as invalid in UI. */ void setValid(bool valid); /** Perform input validation, mark field as invalid if entered value is not valid. */ bool validate(); /** Change unit used to display amount. */ void setDisplayUnit(int unit); /** Make field empty and ready for new input. */ void clear(); /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), in these cases we have to set it up manually. */ QWidget *setupTabChain(QWidget *prev); signals: void textChanged(); protected: /** Intercept focus-in event and ',' key presses */ bool eventFilter(QObject *object, QEvent *event); private: QDoubleSpinBox *amount; QValueComboBox *unit; int currentUnit; void setText(const QString &text); QString text() const; private slots: void unitChanged(int idx); }; #endif // BITCOINFEEFIELD_H
/* See COPYING file for copyright and license details. */ #ifndef _INPUT_H_ #define _INPUT_H_ #include <string.h> struct input_handle; struct input_ops { unsigned (*get_channels)(struct input_handle *ih); unsigned long (*get_samplerate)(struct input_handle *ih); float *(*get_buffer)(struct input_handle *ih); struct input_handle *(*handle_init)(); void (*handle_destroy)(struct input_handle **ih); int (*open_file)(struct input_handle *ih, char const *filename); int (*set_channel_map)(struct input_handle *ih, int *st); int (*allocate_buffer)(struct input_handle *ih); size_t (*get_total_frames)(struct input_handle *ih); size_t (*read_frames)(struct input_handle *ih); void (*free_buffer)(struct input_handle *ih); void (*close_file)(struct input_handle *ih); int (*init_library)(void); void (*exit_library)(void); }; int input_init(char *exe_name, char const *forced_plugin); int input_deinit(void); struct input_ops *input_get_ops(char const *filename); int input_open_fd(char const *filename); void input_close_fd(int fd); int input_read_fd(int fd, void *buf, unsigned int count); #endif /* _INPUT_H_ */
// // Timer.h // ChilliSource // Created by Scott Downie on 23/09/2010. // // The MIT License (MIT) // // Copyright (c) 2010 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #ifndef _CHILLISOURCE_CORE_TIMER_H_ #define _CHILLISOURCE_CORE_TIMER_H_ #include <ChilliSource/ChilliSource.h> #include <ChilliSource/Core/Event/IDisconnectableEvent.h> #include <ChilliSource/Core/Time/CoreTimer.h> #include <vector> namespace ChilliSource { //--------------------------------------------------- /// Event style class that objects can connect to /// and be notified periodically or after a set /// period of time /// /// @author S Downie //--------------------------------------------------- class Timer final : public IDisconnectableEvent { public: typedef std::function<void()> Delegate; //-------------------------------------------- /// Constructor /// /// @author S Downie //-------------------------------------------- Timer(); //-------------------------------------------- /// Destructor /// /// @author S Downie //-------------------------------------------- ~Timer(); //-------------------------------------------- /// Begin the timer /// /// @author S Downie //-------------------------------------------- void Start(); //-------------------------------------------- /// Reset the elapsed time /// /// @author S Downie //-------------------------------------------- void Reset(); //-------------------------------------------- /// Stop the timer /// /// @author S Downie //-------------------------------------------- void Stop(); //-------------------------------------------- /// @author S Downie /// /// @return Whether timer is active //-------------------------------------------- inline bool IsTimerActive() const { return m_isActive; } //-------------------------------------------- /// @author S Downie /// /// @return Time elapsed since first start /// or last reset //-------------------------------------------- inline f32 GetElapsedTime() const { return m_elapsedTime; } //---------------------------------------------------- /// Opens a scoped connection to the timers periodic update /// event. The listener will be notified after every /// period. /// /// @author S Downie /// /// @param Seconds after which connection is notified /// @param Delegate /// /// @return Scoped connection //---------------------------------------------------- EventConnectionUPtr OpenConnection(f32 in_periodSecs, Delegate in_delegate); //------------------------------------------------------------- /// Close connection to the event. The connection will /// no longer be notified of the event /// /// @author S Downie /// /// @param Connection to close //------------------------------------------------------------- void CloseConnection(EventConnection* in_connection) override; private: //---------------------------------------------------- /// Updates the elapsed time /// /// @author S Downie /// /// @param Time since last update //---------------------------------------------------- void Update(const f32 in_dt); //------------------------------------------------------------------------- /// Remove from the list any connections that have been flagged as closed /// /// @author S Downie //------------------------------------------------------------------------- void RemoveClosedConnections(); //------------------------------------------------------------- /// Closes all the currently open connections /// /// @author S Downie //------------------------------------------------------------- void CloseAllConnections(); private: struct ConnectionDesc { Delegate m_delegate; EventConnection* m_connection = nullptr; f32 m_updatePeriod; f32 m_elapsedSinceLastUpdate = 0.0f; }; typedef std::vector<ConnectionDesc> ConnectionList; ConnectionList m_connections; EventConnectionUPtr m_coreTimerUpdateConnection; f32 m_elapsedTime = 0.0f; bool m_isNotifying = false; bool m_isActive = false;; }; } #endif
#pragma once // FiltersUI #include <Urho3D/Core/Context.h> #include <Urho3D/Core/Object.h> #include <Urho3D/UI/UIElement.h> #include <Urho3D/Scene/Scene.h> #include <Urho3D/Scene/Node.h> #include <Urho3D/Graphics/Light.h> #include <Urho3D/Graphics/Zone.h> #include <Urho3D/UI/FileSelector.h> #include "colorchooser.h" #include "../Filters/filterbase.h" using namespace Urho3D; class EditingCamera; class TerrainContext; class NodeGraphUI; class WaypointGroupUI; class TerrainTexturingUI; class EditMaskUI; class FiltersUI : public Object { URHO3D_OBJECT(FiltersUI, Object); public: FiltersUI(Context *context); void Construct(TerrainContext *tc, WaypointGroupUI *wg); void SetVisible(bool vis); bool IsVisible(){if(element_) return element_->IsVisible(); return false;} template <class T> void AddFilter() { filters_.push_back(SharedPtr<T>(new T(context_, terrainContext_, waypointGroups_))); } protected: TerrainContext *terrainContext_; WaypointGroupUI *waypointGroups_; SharedPtr<UIElement> element_; SharedPtr<UIElement> optionswindow_; std::vector<SharedPtr<FilterBase>> filters_; FilterBase *selectedFilter_; void BuildFilterList(); void HandleExecuteButton(StringHash eventType, VariantMap &eventData); void HandleCloseButton(StringHash eventType, VariantMap &eventData); void HandleItemSelected(StringHash eventType, VariantMap &eventData); };
// Written by Peter Easton // Released under CC BY-NC-SA 3.0 license // Build a reflow oven: http://whizoo.com // // Registers for the ILI9488 controller // Registers #define ILI9488_SOFTRESET 0x01 #define ILI9488_READ_DISPLAY_INFO 0x04 #define ILI9488_SLEEPIN 0x10 #define ILI9488_SLEEPOUT 0x11 #define ILI9488_NORMAL 0x13 #define ILI9488_INVERTOFF 0x20 #define ILI9488_INVERTON 0x21 #define ILI9488_PIXELSOFF 0x22 #define ILI9488_PIXELSON 0x23 #define ILI9488_DISPLAYOFF 0x28 #define ILI9488_DISPLAYON 0x29 #define ILI9488_COLADDRSET 0x2A #define ILI9488_PAGEADDRSET 0x2B #define ILI9488_MEMORYWRITE 0x2C #define ILI9488_MEMORYREAD 0x2E #define ILI9488_MADCTL 0x36 #define ILI9488_PIXELFORMAT 0x3A #define ILI9488_MADCTL_MY 0x80 #define ILI9488_MADCTL_MX 0x40 #define ILI9488_MADCTL_MV 0x20 #define ILI9488_MADCTL_RGB 0x00 #define ILI9488_MADCTL_MH 0x04 #define ILI9488_MADCTL_BGR 0x08 #define ILI9488_MADCTL_ML 0x10
#include "keychain.h" VALUE mKeychain; VALUE eKeychainError; void keychain_raise_error(OSStatus status) { CFStringRef message = SecCopyErrorMessageString(status, NULL); char buf[256]; char *bytes = CFStringGetCString(message, buf, 256, kCFStringEncodingMacRoman); rb_raise(eKeychainError, buf); } static VALUE keychain_add_internet_password(VALUE self, VALUE serverNameStr, VALUE securityDomainStr, VALUE accountNameStr, VALUE pathStr, VALUE passwordStr) { OSStatus error; SecKeychainRef keychain = NULL; char *serverName = StringValueCStr(serverNameStr); char *securityDomain = StringValueCStr(securityDomainStr); char *accountName = StringValueCStr(accountNameStr); char *path = StringValueCStr(pathStr); UInt16 port = 0; SecProtocolType protocol = kSecProtocolTypeAny; SecAuthenticationType authenticationType = kSecProtocolTypeAny; char *password = StringValueCStr(passwordStr); SecKeychainItemRef *itemRef; error = SecKeychainAddInternetPassword( keychain, strlen(serverName), serverName, strlen(securityDomain), securityDomain, strlen(accountName), accountName, strlen(path), path, port, protocol, protocol, strlen(password), password, &itemRef ); if (error) keychain_raise_error(error); VALUE new_keychain_item = rb_obj_alloc(cKeychainItem); KEYCHAIN_ITEM(new_keychain_item)->itemRef = itemRef; return new_keychain_item; } static VALUE keychain_find_internet_password(VALUE self, VALUE serverNameStr, VALUE securityDomainStr, VALUE accountNameStr, VALUE pathStr) { OSStatus error; CFTypeRef keychainOrArray = NULL; char *serverName = StringValueCStr(serverNameStr); char *securityDomain = StringValueCStr(securityDomainStr); char *accountName = StringValueCStr(accountNameStr); char *path = StringValueCStr(pathStr); UInt16 port = 0; SecProtocolType protocol = kSecProtocolTypeAny; SecAuthenticationType authenticationType = kSecProtocolTypeAny; SecKeychainItemRef *itemRef; error = SecKeychainFindInternetPassword( keychainOrArray, strlen(serverName), serverName, strlen(securityDomain), securityDomain, strlen(accountName), accountName, strlen(path), path, port, protocol, authenticationType, 0, NULL, &itemRef ); if (error) keychain_raise_error(error); VALUE new_keychain_item = rb_obj_alloc(cKeychainItem); KEYCHAIN_ITEM(new_keychain_item)->itemRef = itemRef; return new_keychain_item; } static VALUE keychain_add_generic_password(VALUE self, VALUE serverNameStr, VALUE accountNameStr, VALUE passwordStr) { OSStatus error; SecKeychainRef keychain = NULL; char *serverName = StringValueCStr(serverNameStr); char *accountName = StringValueCStr(accountNameStr); char *password = StringValueCStr(passwordStr); SecKeychainItemRef *itemRef; error = SecKeychainAddGenericPassword( keychain, strlen(serverName), serverName, strlen(accountName), accountName, strlen(password), password, &itemRef ); if (error) keychain_raise_error(error); VALUE new_keychain_item = rb_obj_alloc(cKeychainItem); KEYCHAIN_ITEM(new_keychain_item)->itemRef = itemRef; return new_keychain_item; } static VALUE keychain_find_generic_password(VALUE self, VALUE serverNameStr, VALUE accountNameStr) { OSStatus error; CFTypeRef keychainOrArray = NULL; char *serverName = StringValueCStr(serverNameStr); char *accountName = StringValueCStr(accountNameStr); SecKeychainItemRef *itemRef; error = SecKeychainFindGenericPassword( keychainOrArray, strlen(serverName), serverName, strlen(accountName), accountName, 0, NULL, &itemRef ); if (error) keychain_raise_error(error); VALUE new_keychain_item = rb_obj_alloc(cKeychainItem); KEYCHAIN_ITEM(new_keychain_item)->itemRef = itemRef; return new_keychain_item; } static VALUE keychain_find_items_by_class(VALUE self, SecItemClass itemClass) { OSStatus error; CFTypeRef keychainOrArray = NULL; SecKeychainItemRef itemRef; SecKeychainSearchRef searchRef = NULL; error = SecKeychainSearchCreateFromAttributes(keychainOrArray, itemClass, NULL, &searchRef); if (error) keychain_raise_error(error); VALUE items = rb_ary_new(); VALUE keychain_item; while ((error = SecKeychainSearchCopyNext(searchRef, &itemRef)) == noErr) { keychain_item = rb_obj_alloc(cKeychainItem); KEYCHAIN_ITEM(keychain_item)->itemRef = itemRef; rb_ary_push(items, keychain_item); } return items; } static VALUE keychain_internet_password_items(VALUE self) { return keychain_find_items_by_class(self, kSecInternetPasswordItemClass); } static VALUE keychain_generic_password_items(VALUE self) { return keychain_find_items_by_class(self, kSecGenericPasswordItemClass); } static VALUE keychain_items(VALUE self) { VALUE items = rb_ary_new(); rb_funcall(items, rb_intern("concat"), 1, keychain_internet_password_items(self)); rb_funcall(items, rb_intern("concat"), 1, keychain_generic_password_items(self)); return items; } void Init_keychain() { mKeychain = rb_define_module("Keychain"); eKeychainError = rb_define_class_under(mKeychain, "Error", rb_eStandardError); rb_define_module_function(mKeychain, "add_internet_password", keychain_add_internet_password, 5); rb_define_module_function(mKeychain, "find_internet_password", keychain_find_internet_password, 4); rb_define_module_function(mKeychain, "add_generic_password", keychain_add_generic_password, 3); rb_define_module_function(mKeychain, "find_generic_password", keychain_find_generic_password, 2); rb_define_module_function(mKeychain, "internet_password_items", keychain_internet_password_items, 0); rb_define_module_function(mKeychain, "generic_password_items", keychain_generic_password_items, 0); rb_define_module_function(mKeychain, "items", keychain_items, 0); Init_keychain_item(); Init_keychain_constants(); }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. #ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_ #define BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_ #include "content/public/browser/content_browser_client.h" namespace brightray { class BrowserContext; class BrowserMainParts; class NotificationPresenter; class BrowserClient : public content::ContentBrowserClient { public: static BrowserClient* Get(); BrowserClient(); ~BrowserClient(); BrowserContext* browser_context(); BrowserMainParts* browser_main_parts() { return browser_main_parts_; } NotificationPresenter* notification_presenter(); protected: // Subclasses should override this to provide their own BrowserMainParts // implementation. The lifetime of the returned instance is managed by the // caller. virtual BrowserMainParts* OverrideCreateBrowserMainParts( const content::MainFunctionParams&); // Subclasses that override this (e.g., to provide their own protocol // handlers) should call this implementation after doing their own work. virtual net::URLRequestContextGetter* CreateRequestContext( content::BrowserContext* browser_context, content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector protocol_interceptors) override; private: virtual content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams&) override; virtual void ShowDesktopNotification( const content::ShowDesktopNotificationHostMsgParams& params, content::RenderFrameHost* render_frame_host, scoped_ptr<content::DesktopNotificationDelegate> delegate, base::Closure* cancel_callback) override; virtual content::MediaObserver* GetMediaObserver() override; virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_schemes) override; virtual base::FilePath GetDefaultDownloadDirectory() override; BrowserMainParts* browser_main_parts_; scoped_ptr<NotificationPresenter> notification_presenter_; DISALLOW_COPY_AND_ASSIGN(BrowserClient); }; } // namespace brightray #endif
// // MainNavViewController.h // SYDE351-iOS // // Created by Karan Thukral on 2015-07-08. // Copyright (c) 2015 karanthukral. All rights reserved. // #import <UIKit/UIKit.h> @interface MainNavViewController : UITabBarController @end
// Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 WWFcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_NETBASE_H #define BITCOIN_NETBASE_H #include <string> #include <vector> #include "serialize.h" #include "compat.h" extern int nConnectTimeout; #ifdef WIN32 // In MSVC, this is defined as a macro, undefine it to prevent a compile and link error #undef SetPort #endif enum Network { NET_UNROUTABLE, NET_IPV4, NET_IPV6, NET_TOR, NET_I2P, NET_MAX, }; extern int nConnectTimeout; extern bool fNameLookup; /** IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) */ class CNetAddr { protected: unsigned char ip[16]; // in network byte order public: CNetAddr(); CNetAddr(const struct in_addr& ipv4Addr); explicit CNetAddr(const char *pszIp, bool fAllowLookup = false); explicit CNetAddr(const std::string &strIp, bool fAllowLookup = false); void Init(); void SetIP(const CNetAddr& ip); bool SetSpecial(const std::string &strName); // for Tor and I2P addresses bool IsIPv4() const; // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0) bool IsIPv6() const; // IPv6 address (not mapped IPv4, not Tor/I2P) bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12) bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32) bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16) bool IsRFC3964() const; // IPv6 6to4 tunneling (2002::/16) bool IsRFC4193() const; // IPv6 unique local (FC00::/15) bool IsRFC4380() const; // IPv6 Teredo tunneling (2001::/32) bool IsRFC4843() const; // IPv6 ORCHID (2001:10::/28) bool IsRFC4862() const; // IPv6 autoconfig (FE80::/64) bool IsRFC6052() const; // IPv6 well-known prefix (64:FF9B::/96) bool IsRFC6145() const; // IPv6 IPv4-translated address (::FFFF:0:0:0/96) bool IsTor() const; bool IsI2P() const; bool IsLocal() const; bool IsRoutable() const; bool IsValid() const; bool IsMulticast() const; enum Network GetNetwork() const; std::string ToString() const; std::string ToStringIP() const; int GetByte(int n) const; uint64 GetHash() const; bool GetInAddr(struct in_addr* pipv4Addr) const; std::vector<unsigned char> GetGroup() const; int GetReachabilityFrom(const CNetAddr *paddrPartner = NULL) const; void print() const; #ifdef USE_IPV6 CNetAddr(const struct in6_addr& pipv6Addr); bool GetIn6Addr(struct in6_addr* pipv6Addr) const; #endif friend bool operator==(const CNetAddr& a, const CNetAddr& b); friend bool operator!=(const CNetAddr& a, const CNetAddr& b); friend bool operator<(const CNetAddr& a, const CNetAddr& b); IMPLEMENT_SERIALIZE ( READWRITE(FLATDATA(ip)); ) }; /** A combination of a network address (CNetAddr) and a (TCP) port */ class CService : public CNetAddr { protected: unsigned short port; // host order public: CService(); CService(const CNetAddr& ip, unsigned short port); CService(const struct in_addr& ipv4Addr, unsigned short port); CService(const struct sockaddr_in& addr); explicit CService(const char *pszIpPort, int portDefault, bool fAllowLookup = false); explicit CService(const char *pszIpPort, bool fAllowLookup = false); explicit CService(const std::string& strIpPort, int portDefault, bool fAllowLookup = false); explicit CService(const std::string& strIpPort, bool fAllowLookup = false); void Init(); void SetPort(unsigned short portIn); unsigned short GetPort() const; bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const; bool SetSockAddr(const struct sockaddr* paddr); friend bool operator==(const CService& a, const CService& b); friend bool operator!=(const CService& a, const CService& b); friend bool operator<(const CService& a, const CService& b); std::vector<unsigned char> GetKey() const; std::string ToString() const; std::string ToStringPort() const; std::string ToStringIPPort() const; void print() const; #ifdef USE_IPV6 CService(const struct in6_addr& ipv6Addr, unsigned short port); CService(const struct sockaddr_in6& addr); #endif IMPLEMENT_SERIALIZE ( CService* pthis = const_cast<CService*>(this); READWRITE(FLATDATA(ip)); unsigned short portN = htons(port); READWRITE(portN); if (fRead) pthis->port = ntohs(portN); ) }; enum Network ParseNetwork(std::string net); void SplitHostPort(std::string in, int &portOut, std::string &hostOut); bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5); bool GetProxy(enum Network net, CService &addrProxy); bool IsProxy(const CNetAddr &addr); bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); bool GetNameProxy(); bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0); bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true); bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault = 0, bool fAllowLookup = true, unsigned int nMaxSolutions = 0); bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0); bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout = nConnectTimeout); bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault = 0, int nTimeout = nConnectTimeout); #endif
// // FootBleSelectViewController.h // Foot // // Created by 吴迪玮 on 15/7/15. // Copyright (c) 2015年 pandoranews. All rights reserved. // #import <UIKit/UIKit.h> @interface FootBleSelectViewController : UIViewController<UITableViewDataSource,UITableViewDelegate> @property (weak, nonatomic) IBOutlet UITableView *bleDevTableView; @end
/******************************************************************* ** This code is part of Breakout. ** ** Breakout is free software: you can redistribute it and/or modify ** it under the terms of the CC BY 4.0 license as published by ** Creative Commons, either version 4 of the License, or (at your ** option) any later version. ******************************************************************/ #pragma once #include <vector> #include <fstream> #include <sstream> #include <GL/glew.h> #include <glm/glm.hpp> #include "GameObject.h" #include "SpriteRenderer.h" #include "ResourceManager.h" namespace genesis { /// GameLevel holds all Tiles as part of a Breakout level and /// hosts functionality to Load/render levels from the harddisk. class GameLevel { public: // Level state std::vector<GameObject> _bricks; // Constructor GameLevel() { } // Loads level from file void load(const GLchar *file, GLuint levelWidth, GLuint levelHeight); // Render level void draw(SpriteRenderer &renderer); // Check if the level is completed (all non-solid tiles are destroyed) GLboolean isCompleted(); private: // Initialize level from tile data void init(std::vector<std::vector<GLuint>> tileData, GLuint levelWidth, GLuint levelHeight); }; }
// // Soundlinks.h // // Created by LiQingyao on 16/2/24. // Copyright © 2016年 Pheroant. All rights reserved. // #import <Foundation/Foundation.h> @interface SLContent : NSObject @property (nonatomic, retain) NSString *title; @property (nonatomic, retain) NSString *image; @property (nonatomic, retain) NSString *url; @end @class Soundlinks; @protocol SoundlinksDelegate <NSObject> - (void)soundlinks:(Soundlinks *)soundlinks listenContents:(NSArray *)contentArray; @end @interface Soundlinks : NSObject @property (nonatomic, weak) id<SoundlinksDelegate> delegate; + (void)setAppID:(NSString *)appid andEventId:(NSString *)eventid; + (void)setDelegate:(id<SoundlinksDelegate>)delegate; + (void)enable; + (void)disable; @end
//-------------------------------------------------------------------------------- // Copyright (c) 2017-2020, sanko-shoko. All rights reserved. //-------------------------------------------------------------------------------- #ifndef __SP_THREAD_H__ #define __SP_THREAD_H__ //-------------------------------------------------------------------------------- // thread //-------------------------------------------------------------------------------- #include <thread> #include <mutex> #include <functional> namespace sp { class Thread { private: bool m_used; bool m_init; std::mutex m_mtx; public: Thread() { init(); m_used = false; } void init() { m_init = true; } void freeze() { lock(); m_init = false; unlock(); } bool used() { return (m_init == false) | (m_used == true); } void lock() { m_mtx.lock(); } void unlock() { m_mtx.unlock(); } template<class Class, void (Class::*Func)()> bool run(Class *ptr, const bool wait = true) { if (m_init == false) return false; if (wait == false && m_used == true) return false; std::thread th([this, ptr, wait] { lock(); m_used = true; (ptr->*Func)(); m_used = false; unlock(); }); th.detach(); return true; } bool run(std::function<void()> func, const bool wait = true) { if (m_init == false) return false; if (wait == false && m_used == true) return false; std::thread th([this, func, wait] { lock(); m_used = true; func(); m_used = false; unlock(); }); th.detach(); return true; } bool run(void (*func)(), const bool wait = true) { if (m_init == false) return false; if (wait == false && m_used == true) return false; std::thread th([this, func, wait] { lock(); m_used = true; func(); m_used = false; unlock(); }); th.detach(); return true; } }; } #endif
#ifndef TORCHS_PUZZLE_H_ #define TORCHS_PUZZLE_H_ #include <bitset> #include "position_map.h" class Torch { public: Torch(const std::vector<int> &controlled): controlled_(controlled) {} Torch(const std::initializer_list<int> &l): controlled_(l) {} public: std::vector<int> controlled_; // Indices of other torches being controlled. bool on_ = false; public: void swap() { on_ = !on_; } }; class TorchesPosition : public fudge::Position<Torch, int, char> { public: TorchesPosition(const std::vector<Torch> &torches): Position(torches) {} TorchesPosition() {} virtual ~TorchesPosition() = default; public: virtual char hash() const override { char code = 0; for (auto &torch : pos_) { (code <<= 1) |= torch.on_ ? 1 : 0; } return code; } virtual const std::string to_string() const override { std::ostringstream ss; ss << std::bitset<7>(hash()) << '-' << static_cast<int>(hash()); return ss.str(); } }; class TorchesPuzzle : public fudge::PositionMap<Torch, TorchesPosition, int, char> { public: TorchesPuzzle() = default; virtual ~TorchesPuzzle() = default; public: int heuristic(const TorchesPosition &n0, const TorchesPosition &n1) const { int d = 0; for (auto i = 0; i < n0.pos_.size(); ++i) { if (n0.pos_[i].on_ != n1.pos_[i].on_) ++d; } return d; } public: // Override to return edges with destination nodes according to four moves. virtual const std::vector<fudge::Edge<TorchesPosition, int>> edges (const TorchesPosition &n) override { std::vector<fudge::Edge<TorchesPosition, int>> es; for (auto i = 0; i < n.pos_.size(); ++i) { TorchesPosition pos = n; for (auto index : pos.pos_[i].controlled_) { pos.pos_[index].swap(); } pos.pos_[i].swap(); es.push_back(fudge::Edge<TorchesPosition, int>(n, pos, 1)); } return es; } }; #endif /* TORCHS_PUZZLE_H_ */
// The MIT License // // Copyright (c) 2013 Ryan Davies // // 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. /** The major version component. */ #define RIVET_MAJOR_VERSION 0 /** The minor version component. */ #define RIVET_MINOR_VERSION 0 /** The patch version component. */ #define RIVET_PATCH_VERSION 5
#pragma once #include <vector> #include <queue> #include <string> #include <climits> #include <unordered_set> #include <cmath> using namespace std; class Solution { public: int longestConsecutive(vector<int>& nums) { unordered_set<int> s(nums.begin(), nums.end()); int ans = 0; for (int i = 0; i < nums.size(); i++) { if (s.count(nums[i]) == 0) continue; s.erase(nums[i]); int prev = nums[i] - 1, next = nums[i] + 1; while (s.count(prev)) { s.erase(prev); prev--; } while (s.count(next)) { s.erase(next); next++; } ans = max(ans, next - prev - 1); } return ans; } };
// // main.c // SpanningTree // // Created by Sang Gyeong Jo on 2016. 11. 16.. // Copyright © 2016년 Sang Gyeong Jo. All rights reserved. // #include "PrimMST.h" int main(int argc, const char * argv[]) { int start_point = 0; build_path_static(); prim(start_point); return 0; }
#include "Assembly.h" #include "Buffer.h" #include <string.h> char asm_push(t_register reg) { return PUSH | reg; } char asm_pop(t_register reg) { return POP | reg; } char asm_nop() { return NOP; } char asm_ret() { return RET; } char *asm_ret_bytes(int bytes, char buffer[3]) { t_buffer *buf = buffer_initialize(); buffer_insert_byte(buf, RET_BYTES); buffer_insert_word(buf, bytes); strncpy_s(buffer, 3, buffer_get_cstring(buf), 3); buffer_destroy(buf); return buffer; } char *asm_call(void *source, void *destination, char buffer[5]) { size_t distance = (size_t) destination - ((size_t) source + 5); t_buffer *buf = buffer_initialize(); buffer_insert_byte(buf, CALL); buffer_insert_dword(buf, (int)distance); memcpy(buffer, buffer_get_cstring(buf), 5); buffer_destroy(buf); return buffer; } char *asm_jmp(void *source, void *destination, char buffer[5]) { size_t distance = (size_t) destination - ((size_t) source + 5); t_buffer *buf = buffer_initialize(); buffer_insert_byte(buf, LONGJMP); buffer_insert_dword(buf, (int)distance); memcpy(buffer, buffer_get_cstring(buf), 5); buffer_destroy(buf); return buffer; } char asm_pushad() { return PUSHAD; } char asm_popad() { return POPAD; } char asm_pushfd() { return PUSHFD; } char asm_popfd() { return POPFD; } char *asm_pushregisteroffset(t_register reg, char offset, char buffer[3]) { t_buffer *buf = buffer_initialize(); buffer_insert_byte(buf, 0xFF); buffer_insert_byte(buf, 0x70 | reg); buffer_insert_byte(buf, offset); memcpy(buffer, buffer_get_cstring(buf), 3); buffer_destroy(buf); return buffer; } char *asm_leaoffset(t_register dest, t_register src, char offset, char buffer[3]) { t_buffer *buf = buffer_initialize(); buffer_insert_byte(buf, 0x8D); buffer_insert_byte(buf, 0x40 | (dest << 3) | (src)); buffer_insert_byte(buf, offset); memcpy(buffer, buffer_get_cstring(buf), 3); buffer_destroy(buf); return buffer; }
// Copyright (c) 2011-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_TRANSACTIONRECORD_H #define BITCOIN_QT_TRANSACTIONRECORD_H #include "amount.h" #include "uint256.h" #include <QList> #include <QString> class CWallet; class CWalletTx; /** UI model for transaction status. The transaction status is the part of a transaction that will change over time. */ class TransactionStatus { public: TransactionStatus(): countsForBalance(false), sortKey(""), matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1) { } enum Status { Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/ /// Normal (sent/received) transactions OpenUntilDate, /**< Transaction not yet final, waiting for date */ OpenUntilBlock, /**< Transaction not yet final, waiting for block */ Offline, /**< Not sent to any other nodes **/ Unconfirmed, /**< Not yet mined into a block **/ Confirming, /**< Confirmed, but waiting for the recommended number of confirmations **/ Conflicted, /**< Conflicts with other transaction or mempool **/ /// Generated (mined) transactions Immature, /**< Mined but waiting for maturity */ MaturesWarning, /**< Transaction will likely not mature because no nodes have confirmed */ NotAccepted /**< Mined but not accepted */ }; /// Transaction counts towards available balance bool countsForBalance; /// Sorting key based on status std::string sortKey; /** @name Generated (mined) transactions @{*/ int matures_in; /**@}*/ /** @name Reported status @{*/ Status status; qint64 depth; qint64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined before finalization */ /**@}*/ /** Current number of blocks (to know whether cached status is still valid) */ int cur_num_blocks; }; /** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has multiple outputs. */ class TransactionRecord { public: enum Type { Other, Generated, SendToAddress, SendToOther, RecvWithAddress, RecvFromOther, SendToSelf, Shielded }; /** Number of confirmation recommended for accepting a transaction */ static const int RecommendedNumConfirmations = 6; TransactionRecord(): hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0) { } TransactionRecord(uint256 hash, qint64 time): hash(hash), time(time), type(Other), address(""), debit(0), credit(0), idx(0) { } TransactionRecord(uint256 hash, qint64 time, Type type, const std::string &address, const CAmount& debit, const CAmount& credit): hash(hash), time(time), type(type), address(address), debit(debit), credit(credit), idx(0) { } /** Decompose CWallet transaction to model transaction records. */ static bool showTransaction(const CWalletTx &wtx); static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx); static QList<TransactionRecord> decomposeTTransaction(const CWallet *wallet, const CWalletTx &wtx); static QList<TransactionRecord> decomposeZTransaction(const CWallet *wallet, const CWalletTx &wtx); static bool findZTransaction(const CWallet *wallet, const uint256 &hash, CAmount &amout, std::string &address); /** @name Immutable transaction attributes @{*/ uint256 hash; qint64 time; Type type; std::string address; CAmount debit; CAmount credit; /**@}*/ /** Subtransaction index, for sort key */ int idx; /** Status: can change with block chain update */ TransactionStatus status; /** Whether the transaction was sent/received with a watch-only address */ bool involvesWatchAddress; /** Return the unique identifier for this transaction (part) */ QString getTxID() const; /** Return the output index of the subtransaction */ int getOutputIndex() const; /** Update status from core wallet tx. */ void updateStatus(const CWalletTx &wtx); /** Return whether a status update is needed. */ bool statusUpdateNeeded(); }; #endif // BITCOIN_QT_TRANSACTIONRECORD_H
/*! @header GJImage.h @abstract UIImage的Category @discussion UIImage的Category @author guoxiaoliang850417@163.com */ #import <UIKit/UIKit.h> @interface UIImage (ImageWithColor) /** * 用color生成一个size为{1, 1}的image */ + (UIImage *)gjw_imageWithColor:(UIColor *)aColor; /** * 用color生成一个image,size自己指定 */ + (UIImage *)gjw_imageWithColor:(UIColor *)aColor size:(CGSize)aSize; /** * 代码加载启动图:只支持iPhone竖屏和iOS7及其之后的系统 */ + (UIImage *)gjw_loadLaunchImage; @end
// // CityViewController.h // WeatherApp // // Created by Renzo Crisóstomo on 9/25/13. // Copyright (c) 2013 Renzo Crisóstomo. All rights reserved. // #import <UIKit/UIKit.h> @class City; @interface CityViewController : UITableViewController @property (nonatomic, strong) City *city; @property (nonatomic, weak) IBOutlet UILabel *lblTemperature; @property (nonatomic, weak) IBOutlet UILabel *lblPressure; @property (nonatomic, weak) IBOutlet UILabel *lblHumidity; @end
#pragma once #include "directory_entry_limited.h" class DirectoryEntryLimitedBroadcast : public DirectoryEntryLimited { public: DirectoryEntryLimitedBroadcast(SInt32 max_hw_sharers); ~DirectoryEntryLimitedBroadcast(); bool addSharer(core_id_t sharer_id); void removeSharer(core_id_t sharer_id, bool reply_expected); bool getSharersList(vector<core_id_t>& sharers_list); SInt32 getNumSharers(); UInt32 getLatency(); private: bool _global_enabled; UInt32 _num_sharers; };
// // NSData+CommonCrypto.h // TourWay // // Created by luomeng on 16/3/11. // Copyright © 2016年 OneThousandandOneNights. All rights reserved. // #import <Foundation/NSData.h> #import <Foundation/NSError.h> #import <CommonCrypto/CommonCryptor.h> #import <CommonCrypto/CommonHMAC.h> extern NSString * const kCommonCryptoErrorDomain; @interface NSError (CommonCryptoErrorDomain) + (NSError *) errorWithCCCryptorStatus: (CCCryptorStatus) status; @end @interface NSData (CommonDigest) - (NSData *) MD2Sum; - (NSData *) MD4Sum; - (NSData *) MD5Sum; - (NSData *) SHA1Hash; - (NSData *) SHA224Hash; - (NSData *) SHA256Hash; - (NSData *) SHA384Hash; - (NSData *) SHA512Hash; @end @interface NSData (CommonCryptor) - (NSData *) AES256EncryptedDataUsingKey: (id) key error: (NSError **) error; - (NSData *) decryptedAES256DataUsingKey: (id) key error: (NSError **) error; - (NSData *) DESEncryptedDataUsingKey: (id) key error: (NSError **) error; - (NSData *) decryptedDESDataUsingKey: (id) key error: (NSError **) error; - (NSData *) CASTEncryptedDataUsingKey: (id) key error: (NSError **) error; - (NSData *) decryptedCASTDataUsingKey: (id) key error: (NSError **) error; @end @interface NSData (LowLevelCommonCryptor) - (NSData *) dataEncryptedUsingAlgorithm: (CCAlgorithm) algorithm key: (id) key // data or string error: (CCCryptorStatus *) error; - (NSData *) dataEncryptedUsingAlgorithm: (CCAlgorithm) algorithm key: (id) key // data or string options: (CCOptions) options error: (CCCryptorStatus *) error; - (NSData *) dataEncryptedUsingAlgorithm: (CCAlgorithm) algorithm key: (id) key // data or string initializationVector: (id) iv // data or string options: (CCOptions) options error: (CCCryptorStatus *) error; - (NSData *) decryptedDataUsingAlgorithm: (CCAlgorithm) algorithm key: (id) key // data or string error: (CCCryptorStatus *) error; - (NSData *) decryptedDataUsingAlgorithm: (CCAlgorithm) algorithm key: (id) key // data or string options: (CCOptions) options error: (CCCryptorStatus *) error; - (NSData *) decryptedDataUsingAlgorithm: (CCAlgorithm) algorithm key: (id) key // data or string initializationVector: (id) iv // data or string options: (CCOptions) options error: (CCCryptorStatus *) error; @end @interface NSData (CommonHMAC) - (NSData *) HMACWithAlgorithm: (CCHmacAlgorithm) algorithm; - (NSData *) HMACWithAlgorithm: (CCHmacAlgorithm) algorithm key: (id) key; @end
// // NSString+RichText.h // Panda // // Created by 王阳 on 2017/4/30. // Copyright © 2017年 王阳. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (RichText) + (NSMutableAttributedString *)changeHtmlStringToAttributeString:(NSString *)htmlString; @end
#pragma once #include "FileInputStreamInner.h" class FileInputStream { public: FileInputStream(); virtual void method_1(); virtual ~FileInputStream(); virtual void method_3(); virtual void method_4(); virtual void method_5(); virtual void method_6(); virtual void method_7(); virtual void method_8(); virtual void method_9(); virtual void method_10(); virtual void method_11(); virtual void method_12(); virtual void method_13(); virtual void method_14(); virtual void method_15(); virtual void method_16(); virtual void method_17(); FileInputStreamInner* p_inner; //0x0004 void* p_unknown; // 0x0008 };
// // FlavorCategoriesViewController.h // WineTastingJournal // // Created by David Westgate on 9/26/15. // Copyright © 2015 Refabricants. All rights reserved. // #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> @class Item; @interface FlavorCategoriesViewController : UITableViewController @property (nonatomic, strong) Item *item; @end
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_HDDemoSpec_TestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_HDDemoSpec_TestsVersionString[];
/*------------------------------------------------------------------------ * (The MIT License) * * Copyright (c) 2008-2011 Rhomobile, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * http://rhomobile.com *------------------------------------------------------------------------*/ #pragma once #include "logging/RhoLog.h" class Camera { DEFINE_LOGCLASS; public: Camera(void); virtual ~Camera(void); public: HRESULT takePicture(HWND hwndOwner,LPTSTR pszFilename); HRESULT selectPicture(HWND hwndOwner,LPTSTR pszFilename); }; extern "C" void choose_picture(char* callback_url, rho_param *options_hash); extern "C" void take_picture(char* callback_url, rho_param * options_hash); extern "C" VALUE get_camera_info(const char* camera_type);
/* probe.c - code pertaining to probing methods Part of Grbl Copyright (c) 2014-2015 Sungeun K. Jeon Grbl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>. */ #include "grbl.h" // Inverts the probe pin state depending on user settings and probing cycle mode. uint8_t probe_invert_mask; // Probe pin initialization routine. void probe_init() { PROBE_DDR &= ~(PROBE_MASK); // Configure as input pins #ifdef DISABLE_PROBE_PIN_PULL_UP PROBE_PORT &= ~(PROBE_MASK); // Normal low operation. Requires external pull-down. #else PROBE_PORT |= PROBE_MASK; // Enable internal pull-up resistors. Normal high operation. #endif // probe_configure_invert_mask(false); // Initialize invert mask. Not required. Updated when in-use. } // Called by probe_init() and the mc_probe() routines. Sets up the probe pin invert mask to // appropriately set the pin logic according to setting for normal-high/normal-low operation // and the probing cycle modes for toward-workpiece/away-from-workpiece. void probe_configure_invert_mask(uint8_t is_probe_away) { probe_invert_mask = 0; // Initialize as zero. if (bit_isfalse(settings.flags, BITFLAG_INVERT_PROBE_PIN)) { probe_invert_mask ^= PROBE_MASK; } if (is_probe_away) { probe_invert_mask ^= PROBE_MASK; } } // Returns the probe pin state. Triggered = true. Called by gcode parser and probe state monitor. uint8_t probe_get_state() { return ((PROBE_PIN & PROBE_MASK) ^ probe_invert_mask); } // Monitors probe pin state and records the system position when detected. Called by the // stepper ISR per ISR tick. // NOTE: This function must be extremely efficient as to not bog down the stepper ISR. void probe_state_monitor() { if (sys_probe_state == PROBE_ACTIVE) { if (probe_get_state()) { sys_probe_state = PROBE_OFF; memcpy(sys.probe_position, sys.position, sizeof (sys.position)); bit_true(sys_rt_exec_state, EXEC_MOTION_CANCEL); } } }
#include "game/gui/label.h" #include "game/gui/widget.h" #include "utils/compat.h" typedef struct { char *text; text_settings tconf; } label; static void label_render(component *c) { label *local = widget_get_obj(c); text_render(&local->tconf, c->x, c->y, c->w, c->h, local->text); } static void label_free(component *c) { label *local = widget_get_obj(c); free(local->text); free(local); } void label_set_text(component *c, const char* text) { label *local = widget_get_obj(c); if(local->text) { free(local->text); } local->text = strdup(text); } text_settings* label_get_text_settings(component *c) { label *local = widget_get_obj(c); return &local->tconf; } component* label_create(const text_settings *tconf, const char *text) { component *c = widget_create(); component_disable(c, 1); c->supports_disable = 0; c->supports_select = 0; c->supports_focus = 0; label *local = malloc(sizeof(label)); memset(local, 0, sizeof(label)); memcpy(&local->tconf, tconf, sizeof(text_settings)); local->text = strdup(text); widget_set_obj(c, local); widget_set_render_cb(c, label_render); widget_set_free_cb(c, label_free); return c; }
// Copyright (c) 2011-2013 The Bitcoin developers // Copyright (c) 2017-2018 The PIVX developers // Copyright (c) 2019 The Syndicate Ltd developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_PEERTABLEMODEL_H #define BITCOIN_QT_PEERTABLEMODEL_H #include "main.h" #include "net.h" #include <QAbstractTableModel> #include <QStringList> class ClientModel; class PeerTablePriv; QT_BEGIN_NAMESPACE class QTimer; QT_END_NAMESPACE struct CNodeCombinedStats { CNodeStats nodeStats; CNodeStateStats nodeStateStats; bool fNodeStateStatsAvailable; }; class NodeLessThan { public: NodeLessThan(int nColumn, Qt::SortOrder fOrder) : column(nColumn), order(fOrder) {} bool operator()(const CNodeCombinedStats& left, const CNodeCombinedStats& right) const; private: int column; Qt::SortOrder order; }; /** Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call. Used by the rpc console UI. */ class PeerTableModel : public QAbstractTableModel { Q_OBJECT public: explicit PeerTableModel(ClientModel* parent = 0); const CNodeCombinedStats* getNodeStats(int idx); int getRowByNodeId(NodeId nodeid); void startAutoRefresh(); void stopAutoRefresh(); enum ColumnIndex { Address = 0, Subversion = 1, Ping = 2 }; /** @name Methods overridden from QAbstractTableModel @{*/ int rowCount(const QModelIndex& parent) const; int columnCount(const QModelIndex& parent) const; QVariant data(const QModelIndex& index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex& parent) const; Qt::ItemFlags flags(const QModelIndex& index) const; void sort(int column, Qt::SortOrder order); /*@}*/ public slots: void refresh(); private: ClientModel* clientModel; QStringList columns; PeerTablePriv* priv; QTimer* timer; }; #endif // BITCOIN_QT_PEERTABLEMODEL_H
#include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include "cpu.h" #include "error.h" #include "bios.h" bool do_cpu_interrupt(CPU *cpu, RAMUNIT *ram, BYTE id) { // printf("Interrupt 0x%x called.\n", id); emu_error = 0; //Check if BIOS interrupt if(id == 0x10) { return do_bios_interrupt(cpu, ram); } //Store instruction pointer //need to store or1 cpu->bp = cpu->ip; //Move instruction pointer to value stored in IDT cpu->ip = get_dword_at_ram_address(ram, id*4); if(cpu->ip == 0) { //printf("interrupt condition line 20\n"); return false; //No interrupt defined } if(emu_error != 0) { //printf("interrupt condition line 24\n"); return false; //Something's really screwed up (or the programmer of the app running is stupid) } while(get_byte_at_ram_address(ram, cpu->ip) != 0x15) //Check for IRET instruction { if(emu_error != 0) { //printf("interrupt condition line 32\n"); return false; //Something's really screwed up (or the programmer of the app running is stupid) } CPURESULT *result = cpu_exec_instruction(cpu, ram, true); if(result->error != 0) { //Another interrupt if(!do_cpu_interrupt(cpu, ram, result->error)) { //printf("another interrupt called\n"); return false; } } if(cpu->halted && get_byte_at_ram_address(ram, cpu->ip) && emu_error != 0) { //printf("interrupt condition line 41\n"); return false; } if(cpu->halted && result->error == 0) return true; else if(cpu->halted && result->error != 0) { //printf("interrupt condition line 49\n"); return false; } } //IRET instruction reached, we must return from interrupt cpu->ip = cpu->bp; return true; }
#ifndef MEVENT_P_H #define MEVENT_P_H class MEvent::MEventPrivate { public: MEventPrivate(MEvent *m) : m(m) {} MEvent *m; MEvent::Type type; }; #endif // MEVENT_P_H
/* * Copyright (c) 2017 Carter Yagemann * * 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 UNPACK_DUMP_H #define UNPACK_DUMP_H #include <pthread.h> #include <semaphore.h> #include <glib.h> #include <openssl/sha.h> #include <libvmi/libvmi.h> pthread_t dump_worker; char *dump_output_dir; sem_t dump_sem; GQueue *dump_queue; GHashTable *pid_layer; // key: vmi_pid_t, value: uint64_t current layer GSList *seen_hashes; pthread_t shell_worker; extern sem_t shell_sem; GQueue *shell_queue; extern pthread_cond_t shell_cond; extern pthread_mutex_t shell_mtx; #define SEG_COUNT_MAX 100 typedef enum { VadNone, VadDevicePhysicalMemory, VadImageMap, VadAwe, VadWriteWatch, VadLargePages, VadRotatePhysical, VadLargePageSection, } vadtype_t; typedef struct { char *buf; addr_t base_va; size_t size; // size of buffer, size <= va_size size_t va_size; // size of VMA area vadtype_t vadtype; uint8_t isprivate; uint8_t protection; unicode_string_t filename; } vad_seg_t; typedef struct { vmi_pid_t pid; reg_t rip; unsigned char sha256[SHA256_DIGEST_LENGTH]; vad_seg_t **segments; unsigned segment_count; } dump_layer_t; typedef struct { char *cmd; char *out_fn; } shell_cmd_t; /** * Compares two SHA256 hashes. * * @param a The first hash to compare. * @param b The second hash to compare. * * @return 0 if a = b, otherwise not 0. */ gint compare_hashes(gconstpointer a, gconstpointer b); /** * Initializes all the data structures and starts a worker thread. This must be * called before add_to_queue() can be used. * * @param dir The director layers should be dumped into. */ void start_dump_thread(char *dir); void start_shell_thread(); /** * Stops the worker thread and processes any remaining items in the queue. */ void stop_dump_thread(); void stop_shell_thread(); /** * Addes a new layer to the queue to be dumped into the output directory. * * @param buffer A pointer to the buffer to dump. This should be left allocated * and the worker thread will handle freeing it. * @param size The size of the buffer. * @param pid The PID of the process that executed the page. * @param rip The value of the RIP register when this layer was executed. * @param base The base virtual address the buffer was read from. * * Note: The base_addr may not equal rip. For example, if the dump is an entire * VMA but the instruction that triggered the dump was somewhere in the middle. */ void add_to_dump_queue(char *buffer, uint64_t size, vmi_pid_t pid, reg_t rip, reg_t base); /* * Add a new command to queue for shell thread to execute. * * @param cmd_str A string to be executed by the shell. * @param out_fn The filepath to write any captured output. Set to NULL to skip * saving any output. */ void queue_and_wait_for_shell_cmd(char *cmd_str, char *out_fn); void queue_vads_to_dump(dump_layer_t *dump); #endif
/* * Generated by class-dump 3.3.3 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard. */ @protocol NSTextInputClient - (void)insertText:(id)arg1 replacementRange:(struct _NSRange)arg2; - (void)doCommandBySelector:(SEL)arg1; - (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2 replacementRange:(struct _NSRange)arg3; - (void)unmarkText; - (struct _NSRange)selectedRange; - (struct _NSRange)markedRange; - (BOOL)hasMarkedText; - (id)attributedSubstringForProposedRange:(struct _NSRange)arg1 actualRange:(struct _NSRange *)arg2; - (id)validAttributesForMarkedText; - (struct CGRect)firstRectForCharacterRange:(struct _NSRange)arg1 actualRange:(struct _NSRange *)arg2; - (unsigned long long)characterIndexForPoint:(struct CGPoint)arg1; @optional - (id)attributedString; - (double)fractionOfDistanceThroughGlyphForPoint:(struct CGPoint)arg1; - (double)baselineDeltaForCharacterAtIndex:(unsigned long long)arg1; - (long long)windowLevel; - (BOOL)drawsVerticallyForCharacterAtIndex:(unsigned long long)arg1; @end
#ifndef BINARYCLASSIFICATIONDIALOG_H #define BINARYCLASSIFICATIONDIALOG_H #include <QDialog> #include <layermanager.h> #include <QRadioButton> class BinaryClassificationDialog : public QDialog { Q_OBJECT public: BinaryClassificationDialog(QWidget* parent); private: void initDialogLayout(); void findTheToggledButton(); LayerManager* layerManager; std::vector<cv::Vec3b> colorVector; std::vector<QPushButton*> pushButtonVector; signals: void sendColor(cv::Vec3b color); }; #endif // BINARYCLASSIFICATIONDIALOG_H
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_AZFramer_ExampleVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_AZFramer_ExampleVersionString[];
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12). // // Copyright (C) 1997-2019 Steve Nygard. // #import <objc/NSObject.h> #import <IDEKit/IDEFontAndColorItem-Protocol.h> @class NSString; @interface IDEMarkupFontAndColorItem : NSObject <IDEFontAndColorItem> { NSString *_colorPropertyName; NSString *_fontPropertyName; NSString *_displayName; } - (void).cxx_destruct; - (void)setFont:(id)arg1 forTheme:(id)arg2; - (void)setColor:(id)arg1 forTheme:(id)arg2; - (id)fontForTheme:(id)arg1; - (id)colorForTheme:(id)arg1; - (id)displayName; - (id)initWithColorPropertyName:(id)arg1 fontPropertyName:(id)arg2 displayName:(id)arg3; @end
#pragma once #include "ofMain.h" #include "ofxiOS.h" #include "ofxiOSExtras.h" class ofApp : public ofxiOSApp{ public: void setup(); void update(); void draw(); void exit(); void audioOut(float * output, int bufferSize, int nChannels); void touchDown(ofTouchEventArgs & touch); void touchMoved(ofTouchEventArgs & touch); void touchUp(ofTouchEventArgs & touch); void touchDoubleTap(ofTouchEventArgs & touch); void touchCancelled(ofTouchEventArgs & touch); void lostFocus(); void gotFocus(); void gotMemoryWarning(); void deviceOrientationChanged(int newOrientation); float pan; int sampleRate; bool bNoise; float volume; float * lAudio; float * rAudio; //------------------- for the simple sine wave synthesis float targetFrequency; float phase; float phaseAdder; float phaseAdderTarget; int initialBufferSize; };
#ifndef BACKGROUND_GAME_H #define BACKGROUND_GAME_H #include "gl_helper.h" #include <ctime> #include "asset_helper.h" #include "defs.h" #include "messaging.h" #include "observer.h" using namespace std; class background_game : public observer { private: static GLuint _bg1, _bg2; static double _bg_y1, _bg_y2; static clock_t _last_clock; pthread_t thread; static bool _cancel_thread; public: background_game(); ~background_game(); void start(); void stop(); // Static method called launched in a new thread. // Params: // void *: nothing in this case is being passed in. static void *t_update(void *); void draw(); virtual void update(const observable_data &param); }; #endif /* BACKGROUND_GAME_H */
// // NSubTitleNoArrow.h // Connect // // Created by MoHuilin on 16/8/4. // Copyright © 2016年 Connect. All rights reserved. // #import "BaseCell.h" @interface NSubTitleNoArrow : BaseCell @end
// No build information available #define BUILD_DATE "2014-02-13 17:01:17 +0800"
/* * rtGetInf.h * * Code generation for model "ctrl_TA_basic". * * Model version : 1.3 * Simulink Coder version : 8.6 (R2014a) 27-Dec-2013 * C source code generated on : Wed Feb 25 10:49:26 2015 * * Target selection: NIVeriStand_VxWorks.tlc * Note: GRT includes extra infrastructure and instrumentation for prototyping * Embedded hardware selection: 32-bit Generic * Code generation objectives: Unspecified * Validation result: Not run */ #ifndef RTW_HEADER_rtGetInf_h_ #define RTW_HEADER_rtGetInf_h_ #include <stddef.h> #include "rtwtypes.h" #include "rt_nonfinite.h" extern real_T rtGetInf(void); extern real32_T rtGetInfF(void); extern real_T rtGetMinusInf(void); extern real32_T rtGetMinusInfF(void); #endif /* RTW_HEADER_rtGetInf_h_ */
#pragma once #include "Player.h" #include "Game.h" struct TestGame : Game{ Player player; float fps_average; float nFrames; TestGame(); void update(); void render(); void handleKeyStates(const Uint8 *keyStates); };
// // TCSDetailViewController.h // Admin // // Created by Steve Brokaw on 1/17/14. // Copyright (c) 2014 Twocanoes Software, Inc. All rights reserved. // #import <UIKit/UIKit.h> #import "TCSBleuStation.h" @interface TCSDetailViewController : UIViewController <TCSBleuStationDelegate> @property (strong, nonatomic) TCSBleuStation *station; @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @property (weak, nonatomic) IBOutlet UITextField *nameField; @property (weak, nonatomic) IBOutlet UITextField *uuidField; @property (weak, nonatomic) IBOutlet UITextField *majorField; @property (weak, nonatomic) IBOutlet UITextField *minorField; @property (weak, nonatomic) IBOutlet UITextField *powerField; @property (weak, nonatomic) IBOutlet UITextField *calibrationField; @property (weak, nonatomic) IBOutlet UITextField *latitudeField; @property (weak, nonatomic) IBOutlet UITextField *longitudeField; @property (weak, nonatomic) IBOutlet UITextField *firmwareField; @property (weak, nonatomic) IBOutlet UIButton *authenticateButton; @property (weak, nonatomic) IBOutlet UIButton *changePasswordButton; - (IBAction)authenticate:(id)sender; - (IBAction)changePassword:(id)sender; @end
/** * PLAIN FRAMEWORK ( https://github.com/viticm/plainframework ) * $Id config.h * @link https://github.com/viticm/plainframework for the canonical source repository * @copyright Copyright (c) 2014- viticm( viticm.ti@gmail.com ) * @license * @user viticm<viticm.ti@gmail.com> * @date 2014/06/23 11:05 * @uses the net packet config file */ #ifndef PF_NET_PACKET_CONFIG_H_ #define PF_NET_PACKET_CONFIG_H_ #include "pf/net/config.h" #define NET_PACKET_DYNAMIC_ONCESIZE (1024) //动态网络包每次重新增加的内存大小 #define NET_PACKET_DYNAMIC_SIZEMAX (1024 * 100) //动态网络包的最大内存大小 #endif //PF_NET_PACKET_CONFIG_H_
/******************************************************************** created: 2012/07/15 created: 15:7:2012 3:40 filename: C:\Users\Bruno\Documents\Mestrado\2011.2\Dissertacao\AdaptiveShooter\src\AdaptiveShooter\Weapon.h file path: C:\Users\Bruno\Documents\Mestrado\2011.2\Dissertacao\AdaptiveShooter\src\AdaptiveShooter file base: Weapon file ext: h author: Bruno Baère Pederassi Lomba de Araujo purpose: This class represents weapon enhancements gained by the Player *********************************************************************/ #ifndef Weapon_h__ #define Weapon_h__ #include <ClanLib/core.h> #include "Shot.h" // TODO: Modify for receiving which player created the shot class Weapon { public: /** Describes weapon level */ enum WeaponLevel { WL_LEVEL_0 = 0, WL_LEVEL_1, WL_LEVEL_2 }; /** * Constructor * * @param[in] name Weapon's name * @param[in] shotResource Resource string * @param[in] delay Delay between shots in miliseconds * @param[in] damage Base damage caused by each shot * @param[in] level Weapon's level * @param[in] speedX Shot's speed in x axis in pixels per second * @param[in] speedY Shot's speed in y axis in pixels per second */ Weapon( std::string name, std::string shotResource, int delay, int damage = 50, WeaponLevel level = WL_LEVEL_0, float speedX = 0.0f, float speedY = -300.0f ); /** Destructor */ virtual ~Weapon(); /** * Updates weapon's timer */ virtual void update(); /** * Sets if weapon can shoot. Resets current weapon timer. * * @param[in] can true or false */ void setCanShoot( bool can ); /** * Gets weapon's shooting state * * @return bool true if weapon can shoot right now */ bool getCanShoot() const; /** * Sets weapon's delay between shoots timer. If delay is negative, it's set to 0.0f. * * @param[in] delay Delay in miliseconds */ void setDelay( int delay ); /** * Gets weapon's current time delay between shoots * * @return int Weapon delay between shoots in miliseconds */ int getDelay() const; /** * Gets current timer * * @return int Current timer value in miliseconds */ int getTimer() const; /** * Sets weapon's shoot damage. If damage is negative, it's set to 1. * * @param[in] damage Damage amount */ void setDamage( int damage ); /** * Gets weapon's current shoot damage * * @return int Damage amount */ int getDamage() const; /** * Sets weapon's current level * * @param[in] level Weapon's level */ void setWeaponLevel( WeaponLevel level ); /** * Gets weapon's current level * * @return Weapon::WeaponLevel Weapon's current level */ WeaponLevel getWeaponLevel() const; /** * Makes weapon shoot. Returns new Shot objects for adding to current Scene. Delegates deletion to Scene. * Shots created in this method are centered to the Entity. * * @param[in] Entity* Shot owner * @return std::vector<Shot*> How many shots were created. 0 if canShoot returns false */ virtual std::vector<Shot*> shoot( Entity* entity ); /** * Sets the weapon's name * * @param[in] name New name */ void setName(std::string name); /** * Gets the weapon's name * * @return std::string Weapon's name */ std::string getName() const; /** * Sets current shot's speed * * @param[in] x Speed in x axis, in pixels per second * @param[in] y Speed in y axis, in pixels per second */ void setShotSpeed( float x, float y); /** * Sets current shot's speed * * @param[in] speed Speed in pixels per second */ void setShotSpeed( clan::Vec2f& speed ); /** * Gets current shot's speed * * @return CL_Vec2f Current shot's speed */ clan::Vec2f getShotSpeed() const; protected: private: bool _canShoot; // Indicates if weapon is ready to shoot int _damage; // Damage caused by each shot WeaponLevel _level; // Weapon's level int _delay; // Indicates delay between shots in miliseconds int _timer; // Current weapon timer in miliseconds. std::string _name; // Weapon's name std::string _shotResource; // Resource file for creating shots clan::Vec2f _shotSpeed; // Current shot's speed in pixels per second }; #endif // Weapon_h__
// // ExerciseChapterTableViewCell.h // xbsz // // Created by lotus on 2017/4/24. // Copyright © 2017年 lotus. All rights reserved. // #import <UIKit/UIKit.h> @interface ExerciseChapterTableViewCell : UITableViewCell - (void)updateUI:(NSString *)imageName chapterIndex:(NSInteger)chapterIndex num:(NSInteger)num; @end
// // ViewController.h // YQImageToolDemo // // Created by problemchild on 16/8/11. // Copyright © 2016年 ProblenChild. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#include <stdio.h> typedef int boolean; #define TRUE 1 #define FALSE 0 main() { long pid, cid, count; char t[200]; pid = -1; cid = 0; count = 0; while (gets(t)) { cid = atol(strtok(t, ":")); if (cid != pid) { pid = cid; continue; } count++; } printf("%ld\n", count); }
/* * 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-Protocol.h" @protocol PKPassGroupViewDelegate <NSObject> @optional - (long long)groupViewContentModeForFrontmostPassWhenStacked:(id)arg1; - (id)groupViewReusablePassViewQueue:(id)arg1; - (_Bool)groupViewPassesSuppressedContent:(id)arg1; - (_Bool)groupViewPassesGrowCenteredWhenFlipped:(id)arg1; - (_Bool)groupViewPassesGrowWhenFlipped:(id)arg1; - (void)groupView:(id)arg1 flipButtonPressedForPass:(id)arg2; - (_Bool)groupView:(id)arg1 deleteButtonEnabledForPass:(id)arg2; - (void)groupView:(id)arg1 deleteButtonPressedForPass:(id)arg2; - (void)groupViewFrontPassDidFlip:(id)arg1 animated:(_Bool)arg2; - (_Bool)groupViewShouldAllowPassFlip:(id)arg1; - (void)groupViewDidUpdatePageControlVisibility:(id)arg1; - (void)groupView:(id)arg1 panned:(struct CGPoint)arg2 withVelocity:(struct CGPoint)arg3; - (void)groupViewPanDidEnd:(id)arg1; - (void)groupViewPanDidBegin:(id)arg1; - (_Bool)groupViewShouldAllowPanning:(id)arg1; - (void)groupViewTapped:(id)arg1; @end
#ifndef RUBY_JSONNET_RUBY_JSONNET_H_ #define RUBY_JSONNET_RUBY_JSONNET_H_ #include <ruby/ruby.h> #include <ruby/encoding.h> extern const rb_data_type_t jsonnet_vm_type; struct native_callback_ctx { VALUE callback; long arity; VALUE vm; }; struct jsonnet_vm_wrap { struct JsonnetVm *vm; VALUE import_callback; struct { long len; struct native_callback_ctx **contexts; } native_callbacks; }; void rubyjsonnet_init_vm(VALUE mod); void rubyjsonnet_init_callbacks(VALUE cVM); void rubyjsonnet_init_helpers(VALUE mod); struct jsonnet_vm_wrap *rubyjsonnet_obj_to_vm(VALUE vm); VALUE rubyjsonnet_json_to_obj(struct JsonnetVm *vm, const struct JsonnetJsonValue *value); struct JsonnetJsonValue *rubyjsonnet_obj_to_json(struct JsonnetVm *vm, VALUE obj, int *success); rb_encoding *rubyjsonnet_assert_asciicompat(VALUE str); char *rubyjsonnet_str_to_cstr(struct JsonnetVm *vm, VALUE str); VALUE rubyjsonnet_format_exception(VALUE exc); int rubyjsonnet_jump_tag(const char *exc_mesg); #endif /* RUBY_JSONNET_RUBY_JSONNET_H_ */
// // ViewController.h // CCHTTPRequest // // Created by Cathy's JackBook on 2/21/15. // Copyright (c) 2015 Cadet. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
// // NTHTTPFloatingButtonController.h // NetworkTracker // // Created by xzj on 16/8/24. // Copyright © 2016年 xzj. All rights reserved. // #import <UIKit/UIKit.h> @interface NTHTTPFloatingButtonController : UIViewController @property (nonatomic, strong) UIButton *button; @end
/** ################################################################### ** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT. ** Filename : Cpu.h ** Project : rapidradioUSB ** Processor : MC9S08JS16CWJ ** Component : MC9S08JS16_20 ** Version : Component 01.000, Driver 01.38, CPU db: 3.00.015 ** Datasheet : MC9S08JS16RM Rev. 4 4/2009 ** Compiler : CodeWarrior HCS08 C Compiler ** Date/Time : 2015-09-19, 00:58 ** Abstract : ** This component "MC9S08JS16_20" contains initialization ** of the CPU and provides basic methods and events for ** CPU core settings. ** Settings : ** ** Contents : ** EnableInt - void Cpu_EnableInt(void); ** DisableInt - void Cpu_DisableInt(void); ** Delay100US - void Cpu_Delay100US(word us100); ** ** Copyright : 1997 - 2010 Freescale Semiconductor, Inc. All Rights Reserved. ** ** http : www.freescale.com ** mail : support@freescale.com ** ###################################################################*/ #ifndef __Cpu #define __Cpu /* Active configuration define symbol */ #define PEcfg_Debug_S08JS16CWJ 1 /*Include shared modules, which are used for whole project*/ #include "PE_Types.h" #include "PE_Error.h" #include "PE_Const.h" #include "IO_Map.h" /* MODULE Cpu. */ #ifndef __BWUserType_tPowerDownModes #define __BWUserType_tPowerDownModes typedef enum { /* */ PowerDown, PartialPowerDown, StandBy } tPowerDownModes; #endif #define CPU_BUS_CLK_HZ 0x016E3600UL /* Initial value of the bus clock frequency in Hz */ #define CPU_INSTR_CLK_HZ 0x016E3600UL /* Initial value of the instruction clock frequency in Hz */ #define CPU_EXT_CLK_HZ 0x00F42400UL /* Value of the main clock frequency (crystal or external clock) in Hz */ #define CPU_INT_CLK_HZ 0x7A12UL /* Value of the internal oscillator clock frequency in Hz */ #define CPU_TICK_NS 0x3EU /* CPU tick is a unit derived from the frequency of external clock source. If no external clock is enabled or available it is derived from the value of internal clock source. The value of this constant represents period of the clock source in ns. */ #define CPU_CORE_HCS08 /* Specification of the core type of the selected cpu */ #define CPU_DERIVATIVE_MC9S08JS16 /* Name of the selected cpu derivative */ #define CPU_PARTNUM_MC9S08JS16CWJ /* Part number of the selected cpu */ /* Global variables */ extern volatile byte CCR_reg; /* Current CCR register */ __interrupt void Cpu_Interrupt(void); /* ** =================================================================== ** Method : Cpu_Interrupt (component MC9S08JS16_20) ** ** Description : ** The method services unhandled interrupt vectors. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ #define Cpu_DisableInt() __DI() /* Disable interrupts */ /* ** =================================================================== ** Method : Cpu_DisableInt (component MC9S08JS16_20) ** ** Description : ** Disables maskable interrupts ** Parameters : None ** Returns : Nothing ** =================================================================== */ #define Cpu_EnableInt() __EI() /* Enable interrupts */ /* ** =================================================================== ** Method : Cpu_EnableInt (component MC9S08JS16_20) ** ** Description : ** Enables maskable interrupts ** Parameters : None ** Returns : Nothing ** =================================================================== */ void Cpu_Delay100US(word us100); /* ** =================================================================== ** Method : Cpu_Delay100US (component MC9S08JS16_20) ** ** Description : ** This method realizes software delay. The length of delay ** is at least 100 microsecond multiply input parameter ** [us100]. As the delay implementation is not based on real ** clock, the delay time may be increased by interrupt ** service routines processed during the delay. The method ** is independent on selected speed mode. ** Parameters : ** NAME - DESCRIPTION ** us100 - Number of 100 us delay repetitions. ** Returns : Nothing ** =================================================================== */ void PE_low_level_init(void); /* ** =================================================================== ** Method : PE_low_level_init (component MC9S08JS16_20) ** ** Description : ** Initializes components and provides common register ** initialization. The method is called automatically as a part ** of the application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ /* END Cpu. */ #endif /* ifndef __Cpu */ /* ** ################################################################### ** ** This file was created by Processor Expert 3.09 [04.41] ** for the Freescale HCS08 series of microcontrollers. ** ** ################################################################### */
#ifndef NAIVE_DIAGNOSTICS_H_ #define NAIVE_DIAGNOSTICS_H_ #include "misc.h" typedef struct SourceLoc { char *filename; u32 line; u32 column; } SourceLoc; typedef enum ErrorLevel { WARNING, ERROR, } ErrorLevel; void issue_diagnostic(ErrorLevel err_level, SourceLoc *context, char *fmt, ...); void issue_error(SourceLoc *context, char *fmt, ...); void issue_warning(SourceLoc *context, char *fmt, ...); #endif
// // The MIT License (MIT) // // Copyright (c) 2015 JR Apps // // 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. // // // AppDelegate.h // DotNuke // // Created by Joshua Luongo on 5/05/2015. // Copyright (c) 2015 JR Apps. All rights reserved. // #import <Cocoa/Cocoa.h> #import "Nuker.h" @interface AppDelegate : NSObject <NSApplicationDelegate, NukerDelegate> @property (readwrite, retain) IBOutlet NSMenu *menu; @property (readwrite, retain) IBOutlet NSStatusItem *statusItem; - (IBAction)menuAction:(id)sender; @end
/** * @file RoomHousing.h * @brief Õðàíèò îïèñàíèå êëàññà RoomHousing * @author Kirnos Serhii * @version 0 * @date 30.10.17 */ #pragma once #include "Room.h" #include "AppointmentRoom.h" #include <iostream> #include <windows.h> using namespace std; /** * Êëàññ ðàñøèðÿþùèé êîìíàòó ê êîìíàòà â êîðïóñå */ class RoomHousing: public Room { private: char *name; /// Èìÿ êîìíàòû int numberOfSeats; /// Êîëè÷åñòâî êîìíàò AppointmentRoom appointment; /// Ïðåäíàçíà÷åíèå êîìíàòû public: RoomHousing(int H, int W, int L, const char *NAME, int NS, AppointmentRoom A) ; RoomHousing(const RoomHousing& RH) ; ~RoomHousing(); const char* getNmae() const ; int getNumberOfSeats() const ; AppointmentRoom getAppointment() const ; };