text
stringlengths
4
6.14k
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_DROP_WHILE_H_ #define TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_DROP_WHILE_H_ #include "list_index.h" #include "list/operation/drop.h" #include "utility/predicate.h" namespace tav { template < template<typename> class Predicate, typename List > using DropWhile = Drop< typename utility::predicate_assurance< IsSize, Length<List> >::template assure< ListIndex< utility::predicate_negator<Predicate>::template function, List > >, List >; } #endif // TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_DROP_WHILE_H_
#pragma once #include "ofMain.h" #include "ofxiPhone.h" #include "ofxiPhoneExtras.h" class testApp : public ofxiPhoneApp { public: void setup(); void update(); void draw(); void touchDown(ofTouchEventArgs &touch); void touchMoved(ofTouchEventArgs &touch); void touchUp(ofTouchEventArgs &touch); void touchDoubleTap(ofTouchEventArgs &touch); void exit(); void lostFocus(); void gotFocus(); void gotMemoryWarning(); void deviceOrientationChanged(int newOrientation); ofxiPhoneCoreLocation * coreLocation; bool hasCompass; bool hasGPS; };
/*! \file variantinterface.h Defines a variant interface to be used with context */ #pragma once #include <maybe.h> #include "getaddressoftype.h" #include "trygetpointertoqobjectdescendant.h" #include <QVariant> #include <QMetaType> #include <QObject> namespace dukpp03 { namespace qt { class VariantInterface { public: typedef QVariant Variant; /*! Makes variant from value \param[in] val value \return new variant */ template< typename _UnderlyingValue > static Variant* makeFrom(_UnderlyingValue val) { return new QVariant(QVariant::fromValue(val)); } /*! Fetches underlying value from variant type \param[in] v a variant, containing data \return an underlying value */ template< typename _UnderlyingValue > static dukpp03::Maybe<_UnderlyingValue> get(Variant* v) { if (v->canConvert<_UnderlyingValue>()) { return dukpp03::Maybe<_UnderlyingValue>(v->value<_UnderlyingValue>()); } else { if (v->canConvert<QObject*>()) { return dukpp03::qt::TryToGetPointerToQObjectDescendant<_UnderlyingValue>::perform(v->value<QObject*>()); } } return dukpp03::Maybe<_UnderlyingValue>(); } /*! Fetches underlying value address from variant type \param[in] v a variant, containing data \return an underlying value */ template< typename _UnderlyingValue > static dukpp03::Maybe<_UnderlyingValue> getAddress(Variant* v) { return dukpp03::qt::GetAddressOfType<_UnderlyingValue>::getAddress(v); } /*! A typename interface for variant */ template< typename _UnderlyingValue > class TypeName { public: /*! Returns name of type \return name of type */ static std::string type() { #if ( QT_VERSION >= 0x060000 ) return QMetaType(qMetaTypeId<_UnderlyingValue>()).name(); #else return QMetaType::typeName(qMetaTypeId<_UnderlyingValue>()); #endif } }; }; } }
/* * 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" @class NSString; @interface MSSubscribedStream : NSObject <NSCoding> { NSString *_streamID; NSString *_ctag; } + (id)subscribedStreamWithStreamID:(id)arg1; @property(retain, nonatomic) NSString *ctag; // @synthesize ctag=_ctag; @property(retain, nonatomic) NSString *streamID; // @synthesize streamID=_streamID; - (void).cxx_destruct; - (id)initWithCoder:(id)arg1; - (void)encodeWithCoder:(id)arg1; - (id)description; - (id)initWithStreamID:(id)arg1; @end
#include"../Core/cSanObject.h" #include"SanGraphics.h" using namespace std; #pragma once namespace San { namespace Graphics { #ifndef __CSANCAMERADEF_H__ #define __CSANCAMERADEF_H__ struct stSANCAMERADESC { public: SPOINT3 CameraCoord; SPOINT3 CameraLookAtPoint; SVECTOR3 CameraOrien; sfloat ViewFOV; sfloat ViewNear; sfloat ViewFar; uint32 ViewWidth; uint32 ViewHeight; bool bCameraMovable; bool bIsOrthoCamera; public: stSANCAMERADESC(); stSANCAMERADESC(SPOINT3 CameraCoord,SPOINT3 CameraLookAtPoint,SVECTOR3 CameraOrien,sfloat ViewFOV,sfloat ViewNear=1.0,sfloat ViewFar=1000.0,uint32 ViewWidth=1024,uint32 ViewHeight=768,bool bIsOrthoCamera=false); ~stSANCAMERADESC(){}; }; typedef stSANCAMERADESC SANCAMERADESC; typedef stSANCAMERADESC* lpSANCAMERADESC; #endif } }
// #include <stdio.h> #include <math.h> double distance(int x1, int y1, int x2, int y2); int main () { printf("distance between two points for points" " x%d,y%d x%d,y%d: %f\n", 1, 1,//x1,y1 4, 4,//x2,y2 distance(1, 1, 4, 4) ); printf("distance between two points for points" " x%d,y%d x%d,y%d: %f\n", 1, -4,//x1,y1 -4, 2,//x2,y2 distance(1, -4, -4, 2) ); printf("distance between two points for points" " x%d,y%d x%d,y%d: %f\n", 2, -5,//x1,y1 -3, -7,//x2,y2 distance(2, -5, -3, -7) ); } double distance (int x1, int y1, int x2, int y2) { return sqrt(((x2 - x1)*(x2 - x1))+((y2 - y1)*(y2 - y1))); }
#pragma once namespace tfm{ template <typename type_t> struct transq; template <typename type_t> struct transf{ tmat3<type_t> m; tvec3<type_t> v; transf() { } transf(const tmat3<type_t> &m, const tvec3<type_t> &v) : m(m), v(v) { } transf<type_t> operator * (const transf<type_t> &t) const; tvec3<type_t> operator * (const tvec3<type_t> &v) const; }; template <typename type_t> std::ostream& operator << (std::ostream &stream, const transf<type_t> &t); template <typename type_t> std::istream& operator >> (std::istream &stream, transf<type_t> &t); template <typename type_t> transf<type_t> scale (type_t x, type_t y, type_t z); template <typename type_t> transf<type_t> scale (const tvec3<type_t> &v); template <typename type_t> transf<type_t> rotate (type_t x, type_t y, type_t z); template <typename type_t> transf<type_t> rotate (type_t theta, const tvec3<type_t> &direction); template <typename type_t> transf<type_t> rotate (const tvec3<type_t> &v); template <typename type_t> transf<type_t> translate (type_t x, type_t y, type_t z); template <typename type_t> transf<type_t> translate (const tvec3<type_t> &v); template <typename type_t> transf<type_t> transf_cast (const transq<type_t> &t); template <typename type_t> struct transq{ tquat<type_t> q; tvec3<type_t> v; transq() { } transq(const tquat<type_t> &q, const tvec3<type_t> &v) : q(q), v(v) { } transq<type_t> operator * (const transq<type_t> &t) const; tvec3<type_t> operator * (const tvec3<type_t> &v) const; }; template <typename type_t> std::ostream& operator << (std::ostream &stream, const transq<type_t> &t); template <typename type_t> std::istream& operator >> (std::istream &stream, transq<type_t> &t); template <typename type_t> transq<type_t> q_rotate (type_t x, type_t y, type_t z); template <typename type_t> transq<type_t> q_rotate (type_t theta, const tvec3<type_t> &direction); template <typename type_t> transq<type_t> q_rotate (const tvec3<type_t> &v); template <typename type_t> transq<type_t> q_translate (type_t x, type_t y, type_t z); template <typename type_t> transq<type_t> q_translate (const tvec3<type_t> &v); template <typename type_t> transq<type_t> transq_cast (const transf<type_t> &t); } #include "transf.inl"
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is guacd. * * The Initial Developer of the Original Code is * Michael Jumper. * Portions created by the Initial Developer are Copyright (C) 2010 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include <guacamole/client.h> #ifndef _GUACD_CLIENT_H #define _GUACD_CLIENT_H /** * The time to allow between sync responses in milliseconds. If a sync * instruction is sent to the client and no response is received within this * timeframe, server messages will not be handled until a sync instruction is * received from the client. */ #define GUACD_SYNC_THRESHOLD 500 /** * The time to allow between server sync messages in milliseconds. A sync * message from the server will be sent every GUACD_SYNC_FREQUENCY milliseconds. * As this will induce a response from a client that is not malfunctioning, * this is used to detect when a client has died. This must be set to a * reasonable value to avoid clients being disconnected unnecessarily due * to timeout. */ #define GUACD_SYNC_FREQUENCY 5000 /** * The amount of time to wait after handling server messages. If a client * plugin has a message handler, and sends instructions when server messages * are being handled, there will be a pause of this many milliseconds before * the next call to the message handler. */ #define GUACD_MESSAGE_HANDLE_FREQUENCY 50 /** * The number of milliseconds to wait for messages in any phase before * timing out and closing the connection with an error. */ #define GUACD_TIMEOUT 15000 /** * The number of microseconds to wait for messages in any phase before * timing out and closing the conncetion with an error. This is always * equal to GUACD_TIMEOUT * 1000. */ #define GUACD_USEC_TIMEOUT (GUACD_TIMEOUT*1000) int guacd_client_start(guac_client* client); #endif
// // NewsTableViewController.h // netNews // // Created by yangyinglei on 2017/3/10. // Copyright © 2017年 yangyinglei. All rights reserved. // #import <UIKit/UIKit.h> @interface NewsTableViewController : UITableViewController @property (nonatomic, copy)NSString *urlStr; @end
// // TodoListItem.h // Todo // // Created by Adam Tait on 1/28/14. // Copyright (c) 2014 Adam Tait. All rights reserved. // #import <Foundation/Foundation.h> #import <Parse/Parse.h> @interface TodoListItem : PFObject <PFSubclassing> // public instance methods + (NSString *)parseClassName; @property (retain) NSString *item; @property (retain) NSString *index; @end
#pragma once #include "FrameTimerBase.h" #include <chrono> class FrameTimerChronoSystem : public FrameTimerBase { public: FrameTimerChronoSystem() { renderStartTime = std::chrono::system_clock::now(); } std::string getNameStr() const override { return "chrono::system_clock"; } double getResolutionNS() const override { std::chrono::duration<double, std::nano> ns = std::chrono::system_clock::duration(1); return ns.count(); } void renderStart() override { auto now = std::chrono::system_clock::now(); frameMS = 0.000001 * (double)std::chrono::duration_cast<std::chrono::nanoseconds>(now - renderStartTime).count(); renderStartTime = now; } void renderEnd() override { renderMS = 0.000001 * (double)std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now() - renderStartTime).count(); updateAvgs(); } private: typedef std::chrono::system_clock::time_point TimePointT; TimePointT renderStartTime; };
#include <pebble.h> static Window *s_main_window; static TextLayer *s_time_layer; static void handle_second_tick(struct tm* tick_time, TimeUnits units_changed) { // Needs to be static because it's used by the system later. static char s_time_text[] = "00:00:00"; strftime(s_time_text, sizeof(s_time_text), "%T", tick_time); text_layer_set_text(s_time_layer, s_time_text); } static void main_window_load(Window *window) { Layer *window_layer = window_get_root_layer(window); GRect bounds = layer_get_bounds(window_layer); const int text_height = 28; s_time_layer = text_layer_create( GRect(bounds.origin.x, (bounds.size.h - text_height) / 2, bounds.size.w, text_height)); text_layer_set_text_color(s_time_layer, GColorWhite); text_layer_set_background_color(s_time_layer, GColorClear); text_layer_set_font(s_time_layer, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD)); text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter); layer_add_child(window_layer, text_layer_get_layer(s_time_layer)); // Ensure time display is not blank on launch time_t now = time(NULL); struct tm *current_time = localtime(&now); handle_second_tick(current_time, SECOND_UNIT); } static void main_window_unload(Window *window) { text_layer_destroy(s_time_layer); } static void init() { s_main_window = window_create(); window_set_background_color(s_main_window, GColorBlack); window_set_window_handlers(s_main_window, (WindowHandlers) { .load = main_window_load, .unload = main_window_unload, }); window_stack_push(s_main_window, true); tick_timer_service_subscribe(SECOND_UNIT, handle_second_tick); } static void deinit() { window_destroy(s_main_window); } int main(void) { init(); app_event_loop(); deinit(); }
// // ScrapingMetadata.h // pixiViewer // // Created by Naomoto nya on 11/12/21. // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. // #import <Foundation/Foundation.h> @interface ScrapingTag : NSObject @property(readwrite, nonatomic, retain) NSString *ID; @property(readwrite, nonatomic, retain) NSString *name; @property(readwrite, nonatomic, retain) NSDictionary *attributes; @property(readwrite, nonatomic, assign) ScrapingTag *parent; @property(readwrite, nonatomic, retain) NSMutableArray *children; @property(readwrite, nonatomic, assign) int depth; @property(readwrite, nonatomic, retain) NSDictionary *needsScrapAttributes; @property(readwrite, nonatomic, retain) NSArray *needsScrapBodys; @property(readwrite, nonatomic, assign) BOOL needsReadBody; - (id) initWithDictionary:(NSDictionary *)dic; - (BOOL) matchStart:(NSString *)name attributes:(NSDictionary *)attr; - (BOOL) matchEnd:(NSString *)name; - (NSDictionary *) scrapedAttributes:(NSDictionary *)attr; - (NSArray *) scrapedBodys:(NSString *)body; - (void) addChild:(ScrapingTag *)c; @end @interface ScrapingResult : NSObject @property(readwrite, nonatomic, retain) NSMutableString *stringBuffer; @property(readwrite, nonatomic, retain) NSDictionary *scrapedAttributes; @property(readwrite, nonatomic, retain) NSArray *scrapedBodys; @property(readwrite, nonatomic, retain) NSString *ID; @property(readwrite, nonatomic, assign) ScrapingResult *parent; @property(readwrite, nonatomic, retain) NSMutableArray *children; - (void) addChild:(ScrapingResult *)c; - (ScrapingResult *) childForPath:(NSString *)path; - (NSString *) description; @end @interface ScrapingEvaluator : NSObject @property(readwrite, nonatomic, retain) NSArray *path; @property(readwrite, nonatomic, retain) NSString *attrName; @property(readwrite, nonatomic, retain) NSArray *children; @property(readwrite, nonatomic, retain) NSArray *replacing; @property(readwrite, nonatomic, assign) int regexIndex; @property(readwrite, nonatomic, assign) int bodyIndex; @property(readwrite, nonatomic, assign) int resultIndex; @property(readwrite, nonatomic, assign) BOOL isList; @property(readwrite, nonatomic, assign) BOOL strict; @property(readwrite, nonatomic, assign) ScrapingResult *resultRoot; - (id) initWithDictionary:(NSDictionary *)dic; - (id) eval; @end
#pragma once #define MAX_FORMAT 10 #define MAX_EXTENSION 10 #define MAX_FORMAT_LONG 255 #define FOREACH_FORMATINFO(x) for(int index = 0; index < (sizeof(cFormatInfo)/sizeof(cFormatInfo[0])); index++) { x } typedef struct { ChemFormat format; TCHAR extension[MAX_EXTENSION]; TCHAR formatTag[MAX_FORMAT]; TCHAR formatTagLong[MAX_FORMAT_LONG]; } FORMATINFO, *LPFORMATINFO; // FORMAT - EXTENSION - SHORT NAME - LONG NAME const FORMATINFO cFormatInfo[] = { { fmtMOLV2, _T(".mol"), _T("MOL V2000"), _T("MDL MOL V2000") }, { fmtMOLV3, _T(".mol"), _T("MOL V3000"), _T("MDL MOL V3000") }, { fmtRXNV2, _T(".rxn"), _T("RXN V2000"), _T("MDL RXN V2000") }, { fmtRXNV2, _T(".rxn"), _T("RXN V3000"), _T("MDL RXN V3000") }, { fmtCDXML, _T(".cdxml"), _T("CDXML"), _T("ChemDraw XML") }, { fmtSMILES, _T(".smi"), _T("SMILES"), _T("SMILES") }, { fmtSMILES, _T(".smiles"), _T("SMILES"), _T("SMILES") }, { fmtSMARTS, _T(".sma"), _T("SMARTS"), _T("SMARTS") }, { fmtSMARTS, _T(".smarts"), _T("SMARTS"), _T("SMARTS") }, { fmtSDFV2, _T(".sdf"), _T("SDF"), _T("Structure Data File") }, { fmtSDFV3, _T(".sdf"), _T("SDF V3000"), _T("Structure Data File (V3000)") }, { fmtRDFV2, _T(".rdf"), _T("RDF"), _T("Reaction Data File") }, { fmtRDFV3, _T(".rdf"), _T("RDF V3000"), _T("Reaction Data File (V3000)") }, { fmtEMF, _T(".emf"), _T("EMF"), _T("Enhanced Meta File") }, { fmtCML, _T(".cml"), _T("CML"), _T("Chemical Markup Language") }, { fmtPNG, _T(".png"), _T("PNG"), _T("Portable Network Graphics") }, { fmtPDF, _T(".pdf"), _T("PDF"), _T("Portable Document Format") }, { fmtSVG, _T(".svg"), _T("SVG"), _T("Scalable Vector Graphics") }, { fmtINCHI, _T(".inchi"), _T("INCHI"), _T("InChi") }, { fmtINCHIKEY, _T(".inchik"), _T("INCHIKEY"), _T("InChi Key") }, { fmtMDLCT, _T(".ct"), _T("MDLCT"), _T("MDL Connection Table") } }; /** Contains helper functions common between the main dll and provider. */ class CommonUtils { public: static ChemFormat GetFormatFromFileName(TCHAR* fileName) { LPWSTR ext = ::PathFindExtension(fileName); FOREACH_FORMATINFO(if(TEQUAL(ext, cFormatInfo[index].extension)) return cFormatInfo[index].format;) return fmtUnknown; } static bool GetFormatString(ChemFormat fmt, TCHAR* outBuffer, int bufferLength) { FOREACH_FORMATINFO(if(fmt == cFormatInfo[index].format) return (_tcscpy_s(outBuffer, bufferLength, cFormatInfo[index].formatTag) == 0);) return false; } static bool GetFormatExtension(ChemFormat fmt, TCHAR* outBuffer, int bufferLength) { FOREACH_FORMATINFO(if(fmt == cFormatInfo[index].format) return (_tcscpy_s(outBuffer, bufferLength, cFormatInfo[index].extension) == 0);) return false; } static bool IsMultiMolFormat(ChemFormat format) { return ((format == fmtSDFV2) || (format == fmtSDFV3) || (format == fmtRDFV2) || (format == fmtRDFV3) || (format == fmtCML) || (format == fmtSMILES)); } static bool IsReadableFormat(ChemFormat format) { return ((format == fmtMOLV2) || (format == fmtMOLV3) || (format == fmtRXNV2) || (format == fmtRXNV3) || (format == fmtSDFV2)|| (format == fmtSDFV3) || (format == fmtRDFV2) || (format == fmtRDFV3) || (format == fmtCML) || (format == fmtSMILES) || (format == fmtSMARTS)); } static bool IsMOLV2000Format(ChemFormat format) { return ((format == fmtMOLV2) || (format == fmtRXNV2) || (format == fmtSDFV2) || (format == fmtRDFV2)); } static bool IsMOLV3000Format(ChemFormat format) { return ((format == fmtMOLV3) || (format == fmtRXNV3) || (format == fmtSDFV3) || (format == fmtRDFV3)); } //------------------------------------------------------------------------- // Identifies the connection table version in a MOL or RXN file // Returns: 1=V2000, 2=V3000 //------------------------------------------------------------------------- static int IdentifyCTVersion(PCHAR data, size_t dataLength, int lineNum) { int line = 0; for(int index = 0; index < dataLength; index++) { if(data[index] == '\n') { line++; // when we are at the end of desired line, check if the last few // chars corresponds to some version number if(line == lineNum) { // if the LF char is preceded by a CR then we have to shift our compare index int shiftIndex = (data[index - 1] == '\r') ? 6 : 5; // compare the last 5/6 characters to get the version number // For V3000 format, the text 'V3000' will always be there. This is not true // for V2000 which could be missing in a RXN file if (_strnicmp(&(data[index - shiftIndex]), "V3000", 5) == 0) return 2; else return 1; // default to V2000 } } } return 1; // v2000 } };
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "policy.h" #include "xrandr.h" #include "client.h" #include <extnsionst.h> #include <dixstruct.h> #include <randrstr.h> #include <X11/extensions/randr.h> #include <X11/extensions/randrproto.h> static const char *RequestName(unsigned short); Bool XrandrInit(void) { return TRUE; } void XrandrExit(void) { } int XrandrAuthorizeRequest(ClientPtr client, ExtensionEntry *ext) { unsigned short opcode = StandardMinorOpcode(client); ClientPolicyPtr policy = ClientGetPolicyRec(client); switch (opcode) { case X_RRChangeOutputProperty: { REQUEST(xRRChangeOutputPropertyReq); PolicyDebug("client %p (pid %u exe '%s') requested RandR " "ChangeOutputProperty '%s'", client, policy->pid, policy->exe, NameForAtom(stuff->property)); } break; default: PolicyDebug("client %p (pid %u exe '%s') requested RandR %s", client, policy->pid, policy->exe, RequestName(opcode)); break; } return Success; } static const char * RequestName(unsigned short opcode) { switch (opcode) { case X_RRQueryVersion: return "QueryVersion"; case X_RRSetScreenConfig: return "SetScreenConfig"; case X_RRSelectInput: return "SelectInput"; case X_RRGetScreenInfo: return "GetScreenInfo"; case X_RRGetScreenSizeRange: return "GetScreenSizeRange"; case X_RRSetScreenSize: return "SetScreenSize"; case X_RRGetScreenResources: return "GetScreenResources"; case X_RRGetOutputInfo: return "GetOutputInfo"; case X_RRListOutputProperties: return "ListOutputProperties"; case X_RRQueryOutputProperty: return "QueryOutputProperty"; case X_RRConfigureOutputProperty: return "ConfigureOutputProperty"; case X_RRChangeOutputProperty: return "ChangeOutputProperty"; case X_RRDeleteOutputProperty: return "DeleteOutputProperty"; case X_RRGetOutputProperty: return "GetOutputProperty"; case X_RRCreateMode: return "CreateMode"; case X_RRDestroyMode: return "DestroyMode"; case X_RRAddOutputMode: return "AddOutputMode"; case X_RRDeleteOutputMode: return "DeleteOutputMode"; case X_RRGetCrtcInfo: return "GetCrtcInfo"; case X_RRSetCrtcConfig: return "SetCrtcConfig"; case X_RRGetCrtcGammaSize: return "GetCrtcGammaSize"; case X_RRGetCrtcGamma: return "GetCrtcGamma"; case X_RRSetCrtcGamma: return "SetCrtcGamma"; case X_RRGetScreenResourcesCurrent: return "GetScreenResourcesCurrent"; case X_RRSetCrtcTransform: return "SetCrtcTransform"; case X_RRGetCrtcTransform: return "GetCrtcTransform"; case X_RRGetPanning: return "GetPanning"; case X_RRSetPanning: return "SetPanning"; case X_RRSetOutputPrimary: return "SetOutputPrimary"; case X_RRGetOutputPrimary: return "GetOutputPrimary"; default: return "<unknown>"; } } /* * Local Variables: * c-basic-offset: 4 * indent-tabs-mode: nil * End: * */
// // AppDelegate.h // skewImageUseUISlider // // Created by admin on 7/14/15. // Copyright (c) 2015 iOS31. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#import <Foundation/Foundation.h> @interface MWZUniverse : NSObject @property(nonatomic, strong) NSString* identifier; @property(nonatomic, strong) NSString* name; @property(nonatomic, strong) NSString* alias; - (instancetype)initFromDictionary:(NSDictionary*)dic; @end
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12). // // Copyright (C) 1997-2019 Steve Nygard. // #import <DVTFoundation/DVTOperation.h> @interface DVTTextCompletionGeneratorOperation : DVTOperation { } @end
// // BallButton.h // Balls // // Created by Jacek Grygiel on 6/13/13. // Copyright (c) 2013 Jacek Grygiel. All rights reserved. // #import <UIKit/UIKit.h> @class BallButton; @protocol BallButtonDelegate <NSObject> - (void) ballButton:(BallButton*) ballButton isActive:(BOOL) active; @end @interface BallButton : UIButton @property(nonatomic, weak) id<BallButtonDelegate> delegate; @property(nonatomic, unsafe_unretained) int x; @property(nonatomic, unsafe_unretained) int y; @property(nonatomic, unsafe_unretained) BOOL isActive; @property(nonatomic, unsafe_unretained) BallType ballType; - (id) initWithBallType:(BallType) ballType; @end
/* * Copyright(c) Sophist Solutions, Inc. 1990-2022. All rights reserved */ #ifndef _Stroika_Foundation_DataExchange_Variant_Reader_h_ #define _Stroika_Foundation_DataExchange_Variant_Reader_h_ 1 #include "../../StroikaPreComp.h" #include <istream> #include "../../Memory/SharedByValue.h" #include "../../Streams/InputStream.h" #include "../VariantValue.h" /** * \file * * \version <a href="Code-Status.md#Beta">Beta</a> * * \em Design Note: * One question was whether or not to natively include support for istream sources or not. * Its easy todo if not supported, by just using BinaryInputStreamFromIStreamAdapter. However, * I decided it would be best to directly support it so typical users (who may not want to * lookup those mapper classes) will just get the right results automagically. * * Also note - since there are no virtual functions involved in the call, the linker/optimizer * can eliminate the code if this feature isn't used. * * This comports with a similar choice made in the String and Container classes (direct builtin * first-class support for native STL objects where appropriate). */ namespace Stroika::Foundation::Memory { class BLOB; } namespace Stroika::Foundation::DataExchange::Variant { /** * \brief abstract class specifying interface for readers that map a source like XML or JSON to a VariantValue objects */ class Reader { protected: class _IRep; protected: Reader () = delete; // @todo may want to allow? protected: explicit Reader (const shared_ptr<_IRep>& rep); public: /** */ nonvirtual String GetDefaultFileSuffix () const; public: /** */ nonvirtual VariantValue Read (const Traversal::Iterable<Characters::Character>& in); nonvirtual VariantValue Read (const Memory::BLOB& in); nonvirtual VariantValue Read (const Streams::InputStream<std::byte>::Ptr& in); nonvirtual VariantValue Read (const Streams::InputStream<Characters::Character>::Ptr& in); nonvirtual VariantValue Read (istream& in); nonvirtual VariantValue Read (wistream& in); protected: nonvirtual _IRep& _GetRep (); nonvirtual const _IRep& _GetRep () const; protected: using _SharedPtrIRep = shared_ptr<_IRep>; private: struct _Rep_Cloner { _SharedPtrIRep operator() (const _IRep& t) const; }; using SharedRepByValuePtr_ = Memory::SharedByValue<_IRep, Memory::SharedByValue_Traits<_IRep, _SharedPtrIRep, _Rep_Cloner>>; private: SharedRepByValuePtr_ fRep_; }; class Reader::_IRep { public: virtual ~_IRep () = default; virtual _SharedPtrIRep Clone () const = 0; virtual String GetDefaultFileSuffix () const = 0; virtual VariantValue Read (const Streams::InputStream<std::byte>::Ptr& in) = 0; virtual VariantValue Read (const Streams::InputStream<Characters::Character>::Ptr& in) = 0; }; } /* ******************************************************************************** ***************************** Implementation Details *************************** ******************************************************************************** */ #include "Reader.inl" #endif /*_Stroika_Foundation_DataExchange_Variant_Reader_h_*/
// // AppDelegate.h // LPRefreshControl // // Created by litt1e-p on 16/1/9. // Copyright © 2016年 litt1e-p. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#ifndef _CAPSTONE_WRAPPER_H #define _CAPSTONE_WRAPPER_H #include "capstone/capstone.h" #include <string> #include <functional> #define MAX_DISASM_BUFFER 16 class Capstone { public: static void GlobalInitialize(); static void GlobalFinalize(); Capstone(); Capstone(const Capstone & capstone); //copy constructor ~Capstone(); bool Disassemble(size_t addr, const unsigned char data[MAX_DISASM_BUFFER]); bool Disassemble(size_t addr, const unsigned char* data, int size); bool DisassembleSafe(size_t addr, const unsigned char* data, int size); const cs_insn* GetInstr() const; bool Success() const; const char* RegName(x86_reg reg) const; bool InGroup(cs_group_type group) const; std::string OperandText(int opindex) const; int Size() const; size_t Address() const; const cs_x86 & x86() const; bool IsFilling() const; bool IsLoop() const; bool IsUnusual() const; x86_insn GetId() const; std::string InstructionText(bool replaceRipRelative = true) const; int OpCount() const; const cs_x86_op & operator[](int index) const; bool IsNop() const; bool IsInt3() const; std::string Mnemonic() const; std::string MnemonicId() const; const char* MemSizeName(int size) const; size_t BranchDestination() const; size_t ResolveOpValue(int opindex, const std::function<size_t(x86_reg)> & resolveReg) const; bool IsBranchGoingToExecute(size_t cflags, size_t ccx) const; static bool IsBranchGoingToExecute(x86_insn id, size_t cflags, size_t ccx); bool IsConditionalGoingToExecute(size_t cflags, size_t ccx) const; static bool IsConditionalGoingToExecute(x86_insn id, size_t cflags, size_t ccx); enum RegInfoAccess { None = 0, Read = 1 << 0, Write = 1 << 1, Implicit = 1 << 2, Explicit = 1 << 3 }; enum Flag { FLAG_INVALID, FLAG_AF, FLAG_CF, FLAG_SF, FLAG_ZF, FLAG_PF, FLAG_OF, FLAG_TF, FLAG_IF, FLAG_DF, FLAG_NT, FLAG_RF, FLAG_ENDING }; enum FlagInfoAccess { Modify = 1 << 0, Prior = 1 << 1, Reset = 1 << 2, Set = 1 << 3, Test = 1 << 4, Undefined = 1 << 5 }; void RegInfo(uint8_t info[X86_REG_ENDING]) const; void FlagInfo(uint8_t info[FLAG_ENDING]) const; const char* FlagName(Flag flag) const; private: static csh mHandle; static bool mInitialized; cs_insn* mInstr; bool mSuccess; }; #endif //_CAPSTONE_WRAPPER_H
#ifndef ADDSCIENTISTDIALOG_H #define ADDSCIENTISTDIALOG_H #include "mainwindow.h" #include "listworker.h" #include <QDialog> namespace Ui { class addScientistDialog; } class addScientistDialog : public QDialog { Q_OBJECT public: explicit addScientistDialog(QWidget *parent = 0); ~addScientistDialog(); private slots: void on_button_add_scientist_clicked(); // A function that dictates what happens when the user presses a specific button. void on_button_add_picture_clicked(); // A function that dictates what happens when the user presses a specific button. private: Ui::addScientistDialog *ui; ListWorker list; QString fileName = "0"; }; #endif // ADDSCIENTISTDIALOG_H
#include <stdio.h> #include <ctype.h> //forward declarations int can_print_it(char ch); void print_letters(char arg[]); void print_arguments(int argc, char* argv[]) { int i = 0; for(i = 0; i < argc; i++) { print_letters(argv[i]); } } void print_letters(char arg[]) { int i = 0; for(i = 0; arg[i] != '\0'; i++) { char ch = arg[i]; if(can_print_it(ch)) { printf("'%c' == %d ", ch, ch); } } printf("\n"); } int can_print_it(char ch) { return isalpha(ch) || isblank(ch); } int main(int argc, char* argv[]) { print_arguments(argc, argv); return 0; }
/* * keys.h * * Created: 7/14/2018 6:06:20 AM * Author: pvallone */ #ifndef KEYS_H_ #define KEYS_H_ extern uint8_t key00[16]; extern uint8_t key01[16]; extern uint8_t key02[16]; extern uint8_t key03[16]; extern uint8_t key04[16]; extern uint8_t key05[16]; extern uint8_t key06[16]; extern uint8_t key07[16]; extern uint8_t key08[16]; extern uint8_t key09[16]; extern uint8_t key10[16]; extern uint8_t key11[16]; extern uint8_t key12[16]; extern uint8_t key13[16]; extern uint8_t key14[16]; extern uint8_t key15[16]; extern uint8_t keyconfiguration[16][4]; extern uint8_t user_zone_configuration[16][4]; extern uint8_t counter_configuration[16][2]; #endif /* KEYS_H_ */
// Copyright (c) 2015 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef SHELL_COMMON_KEYBOARD_UTIL_H_ #define SHELL_COMMON_KEYBOARD_UTIL_H_ #include <string> #include "base/strings/string16.h" #include "ui/events/keycodes/keyboard_codes.h" namespace electron { // Return key code of the char, and also determine whether the SHIFT key is // pressed. ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted); // Return key code of the |str|, and also determine whether the SHIFT key is // pressed. ui::KeyboardCode KeyboardCodeFromStr(const std::string& str, bool* shifted); } // namespace electron #endif // SHELL_COMMON_KEYBOARD_UTIL_H_
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @protocol V8HorizontalPickerElementState <NSObject> - (void)setSelectedElement:(BOOL)arg1; @end
// // AppDelegate.h // MultipleLineChart // // Created by azu on 2014/03/25. // Copyright (c) 2014年 azu. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // InstallViewController.h // nitoTV4 // // Created by Kevin Bradley on 3/15/16. // Copyright © 2016 nito. All rights reserved. // #import <UIKit/UIKit.h> @interface AboutViewController : UIViewController { } @property (nonatomic, strong) UITextView *textView; @end
// // Created by Stephan Bösebeck on 22.09.13. // Copyright (c) 2013 Stephan Bösebeck. All rights reserved. // // To change the template use AppCode | Preferences | File Templates. // #import <Foundation/Foundation.h> @interface MPN : NSObject + (int64_t)add_1:(int64_t *)dest x:(int64_t *)x size:(int)size y:(int64_t)y; + (int64_t)add_n:(int64_t *)dest x:(int64_t *)x y:(int64_t *)y len:(int)len; + (int64_t)sub_n:(int64_t *)dest x:(int64_t *)X y:(int64_t *)Y size:(int64_t)size; + (int64_t)mul_1:(int64_t *)dest x:(int64_t *)x len:(int64_t)len y:(int64_t)y; + (void)mul:(int64_t *)dest x:(int64_t *)x xlen:(int64_t)xlen y:(int64_t *)y ylen:(int64_t)ylen; + (int64_t)udiv_qrnnd:(int64_t)N D:(int32_t)D; + (int64_t)divmod_1:(int64_t *)quotient divident:(int64_t *)dividend len:(int64_t)len divisor:(int64_t)divisor; + (int32_t)submul_1:(int64_t *)dest offset:(int64_t)offset x:(int64_t *)x len:(int64_t)len y:(int64_t)y; + (void)divide:(int64_t *)zds nx:(int)nx y:(int64_t *)y ny:(int)ny; + (int)chars_per_word:(int64_t)radix; + (int)count_leading_zeros:(int64_t)i; + (int64_t)set_str:(int64_t *)dest str:(int64_t *)str strLen:(int)str_len base:(int64_t)base; + (int)cmp:(int64_t *)x y:(int64_t *)y size:(int64_t)size; + (int)cmp:(int64_t *)x xlen:(int64_t)xlen y:(int64_t *)y ylen:(int64_t)ylen; + (int64_t)rshift:(int64_t *)dest x:(int64_t *)x x_start:(int)x_start len:(int)len count:(int)count; + (void)rshift0:(int64_t *)dest x:(int64_t *)x x_start:(int)x_start len:(int)len count:(int)count; + (int64_t)rshift_long:(int64_t *)x len:(int)len count:(int)count; + (int64_t)lshift:(int64_t *)dest d_offset:(int64_t)d_offset x:(int64_t *)x len:(int64_t)len count:(int64_t)count; + (int)findLowestBit:(int64_t)word; + (int)findLowestBitInArr:(int64_t *)words; + (int64_t)gcd:(int64_t *)x y:(int64_t *)y len:(int)len; + (int)intLength:(int64_t)i; + (int)intLength:(int64_t *)words len:(int64_t)len; @end
// // DFMUserInfoEntity.h // ProjectFinal // // Created by xvxvxxx on 12/29/14. // Copyright (c) 2014 谢伟军. All rights reserved. // #import <Foundation/Foundation.h> @interface DFMUserInfoEntity : NSObject <NSCoding> @property (nonatomic, copy) NSString *isNotLogin; @property (nonatomic, copy) NSString *cookies; @property (nonatomic, copy) NSString *userID; @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *banned; @property (nonatomic, copy) NSString *liked; @property (nonatomic, copy) NSString *played; - (instancetype)initWithDictionary:(NSDictionary *)dictionary; - (void)archiverUserInfo; @end
#ifndef GAME_H #define GAME_H #include "GlobalIncludes.h" #include "StateMachine.h" #include "WindowManager.h" #include "InputManager.h" namespace iceberg { enum ICEBERGAPI Backend { OPENGL }; class ICEBERGAPI GameState; class ICEBERGAPI Game { public: Game(Backend backend); ~Game(); void run(); float delta_time() const; void change_state(GameState* state) const; WindowManager* window_manager() const; static void handle_error(const std::string &errorMessage); private: std::shared_ptr<WindowManager> windowManager_; std::shared_ptr<StateMachine> stateMachine_; std::chrono::time_point<std::chrono::high_resolution_clock> previousTime_, currentTime_; float deltaTime_; bool running_; void update(); void draw() const; }; class ICEBERGAPI GameState : public ProgramState { public: virtual ~GameState() {}; void ChangeState(GameState* state) const { game_->change_state(state); } protected: GameState(Game* game) : game_(game) {}; Game* game_; }; } #endif
#include "matrix.h" #include "mytime.h" #define SIGN(X) ((X>=0.0 ? 1.0 : -1.0)) static void givens(double * a, double * b, double * d, double sinphi, double cosphi, unsigned int n, unsigned int i, unsigned int j){ unsigned int l; double temp, g, h; /* rt * a * r: */ g = d[i]; h = d[j]; temp = 2.0*cosphi*sinphi*a[mpos(i,j)]; d[i] = cosphi*cosphi*g + sinphi*sinphi*h + temp; d[j] = cosphi*cosphi*h + sinphi*sinphi*g - temp; a[mpos(i,j)] = 0.0; for (l=0; l<i; l++){ g = a[mpos(l,i)]; h = a[mpos(l,j)]; a[mpos(l,i)] = (g*cosphi) + (h*sinphi); a[mpos(l,j)] = -(g*sinphi) + (h*cosphi); } for (l=i+1; l<j; l++){ h = a[mpos(l,j)]; g = a[mpos(i,l)]; a[mpos(l,j)] = -(g*sinphi) + (h*cosphi); a[mpos(i,l)] = (g*cosphi) + (sinphi*h); } for (l=j+1; l<n; l++){ g = a[mpos(i,l)]; h = a[mpos(j,l)]; a[mpos(i,l)] = (cosphi*g) + (sinphi*h); a[mpos(j,l)] = -(sinphi*g) + (cosphi*h); } /* rt * (b): */ for (l=0; l<n; l++){ g = b[i*n+l]; h = b[j*n+l]; b[i*n+l] = (cosphi*g) + (sinphi*h); b[j*n+l] = -(sinphi*g) + (cosphi*h); } } void jacobi(double * a, double * b, double * d, unsigned int n, double eps, unsigned int rot, FILE * f){ unsigned int i, j, k, r, R; double c, sinphi, cosphi, tgphi, compij, compii, compjj, time_sec; R = (n*n-n)/2; for(i=0; i<n; i++){ d[i]=a[mpos(i,i)]; } time_sec = myutime(); k = 0; do{ r = 0; for (i=0; i<n; i++){ compii = fabs(d[i]) * eps; for (j=i+1; j<n; j++){ compjj = fabs(d[j]) * eps; compij = fabs(a[mpos(i,j)]); if ( compij<=compii || compij<=compjj ){ r++; continue; } c = (d[i]-d[j])*0.5/a[mpos(i,j)]; tgphi = SIGN(c)/(fabs(c)+sqrt(1.0+c*c)); cosphi = 1.0/(sqrt(1.0+tgphi*tgphi)); sinphi = tgphi * cosphi; givens(a, b, d, sinphi, cosphi, n, i, j); } } k++; #if 0 fprintf(stderr, "%u\telements < epsilon:\t%u/%u\n", k, r, R); #endif } while ( k<rot && r<R ); time_sec = myutime()-time_sec; if (f){ fprintf(f, "\n====== diagonalization ======\n"); fprintf(f, "time : %.2f s\n", time_sec); fprintf(f, "iterations : %u/%u\n", k-1, rot); fprintf(f, "a_ij < epsilon: %u/%u\n\n", r, R); fflush(f); } return; }
/* * Copyright (C) 2018, STMicroelectronics - All Rights Reserved * * SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause */ #include <common.h> #include <dm.h> #include <syscon.h> #include <asm/arch/stm32.h> static const struct udevice_id stm32mp_syscon_ids[] = { { .compatible = "st,stm32-stgen", .data = STM32MP_SYSCON_STGEN }, { } }; U_BOOT_DRIVER(syscon_stm32mp) = { .name = "stmp32mp_syscon", .id = UCLASS_SYSCON, .of_match = stm32mp_syscon_ids, .bind = dm_scan_fdt_dev, };
// // UIColor+Tempo.h // tempo // // Created by bosleo8 on 12/10/13. // Copyright (c) 2013 Blue Maestro Limited. All rights reserved. // @interface UIColor (Tempo) +(UIColor *)blueMaestroBlue; +(UIColor *)graphTemperature; +(UIColor *)graphPressure; +(UIColor *)graphDewPoint; +(UIColor *)botomBarSeparatorGrey; +(UIColor *)buttonDarkGrey; +(UIColor *)buttonSeparator; +(UIColor *)commandBorder; @end
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_wctomb.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: kdavis <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/25 16:41:24 by kdavis #+# #+# */ /* Updated: 2017/01/03 15:56:59 by kdavis ### ########.fr */ /* */ /* ************************************************************************** */ #include <wchar.h> /* ** ft_wctomb translates a wide character it into a multibyte character which ** is stored in s. s must have enough space to store the multibyte character. ** It translates by taking the wide char and parsing out the data into ** individual bytes in an array with the appropriate tags placed on them. */ int ft_wctomb(char *s, wchar_t wc) { int bytes; if (!s) return (0); bytes = 0; if (wc > 0x10FFFF || (wc >= 0xD800 && wc <= 0xDFFF)) return (-1); if (wc > 0xFFFF) *(s + bytes++) = 0xF0 | ((wc & 0x1C0000) >> 18); if (wc > 0x7FF) *(s + bytes++) = (wc <= 0xFFFF ? 0xE0 : 0x80) | ((wc & 0x3F000) >> 12); if (wc > 0x7F) *(s + bytes++) = (wc <= 0x7FF ? 0xC0 : 0x80) | ((wc & 0xFC0) >> 6); if (wc >= 0x00) *(s + bytes++) = (wc <= 0x7F ? 0x0 | (wc & 0x7F) : 0x80 | (wc & 0x3F)); return (bytes); }
/* File: CAUITransportButton.h Abstract: Version: 1.0 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2013 Apple Inc. All Rights Reserved. Copyright © 2013 Apple Inc. All rights reserved. WWDC 2013 License NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013 Session. Please refer to the applicable WWDC 2013 Session for further information. IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EA1002 5/3/2013 */ #import <UIKit/UIKit.h> /* This UIButton subclass programatically draws a transport button with a particular drawing style. It features a fill color that can be an accent color. If the button has the recordEnabledButtonStyle, it pulses on and off. These buttons resize themselves dynamically at runtime so that their bounds is a minimum of 44 x 44 pts in order to make them easy to press. The button image will draw at the original size specified in the storyboard */ typedef enum { rewindButtonStyle = 1, pauseButtonStyle, playButtonStyle, recordButtonStyle, recordEnabledButtonStyle } CAUITransportButtonStyle; @interface CAUITransportButton : UIButton ; @property CAUITransportButtonStyle drawingStyle; @property CGColorRef fillColor; @end
#ifndef BOOF_VIEW_CONTROLLER_STATE_PRINT #define BOOF_VIEW_CONTROLLER_STATE_PRINT #include "ViewControllerState.h" class ViewControllerStatePrint : public ViewControllerState { public: static ViewControllerStatePtr Instance(); virtual void enter(ViewController* viewController); virtual void execute(); virtual void exit(); }; #endif
/* checks if merging of freed blocks seems to work correctly Author: Robert Rönngren 050218 */ #include <stdio.h> #include <stdlib.h> #include "brk.h" #include <unistd.h> #define SIZE 16384 int main(int argc, char * argv[]) { void *p1, *p2, *oldBrk, *newBrk1, *newBrk2; unsigned long largeSize = SIZE; #ifdef MMAP oldBrk = endHeap(); #else oldBrk = (void *) sbrk(0); #endif p1 = (void *)malloc(1); #ifdef MMAP newBrk1 = endHeap(); #else newBrk1 = (void *) sbrk(0); #endif largeSize = ((unsigned long)(newBrk1-oldBrk) > SIZE ? (unsigned long)(newBrk1-oldBrk) : SIZE); free(p1); printf("-- Testing merging of deallocated large blocks ( >= %u bytes)\n", (unsigned)largeSize); p1 = (void *)malloc(largeSize); p2 = (void *)malloc(largeSize); if(p1 == NULL || p2 == NULL) printf("* ERROR: unable to allocate memory of size %u bytes\n", (unsigned) largeSize); #ifdef MMAP newBrk1 = endHeap(); #else newBrk1 = (void *) sbrk(0); #endif free(p1); free(p2); p1 = (void *)malloc(largeSize * 2); if(p1 == NULL) printf("* ERROR: unable to allocate memory of size %u bytes\n", (unsigned)largeSize); #ifdef MMAP newBrk2 = endHeap(); #else newBrk2 = (void *) sbrk(0); #endif if(((double)(newBrk2 - oldBrk))/((double)(newBrk1 - oldBrk)) > 1) printf("* ERROR: not good enough usage of memory (probably incorrect merging of deallocated memory blocks)\nYour implementation used %u bytes more than expected\n", ((unsigned)(newBrk2-newBrk1))); else printf("Test passed OK\n"); printMem(); exit(0); }
#ifndef PICTUS_CNT_COLOR_HLS_H #define PICTUS_CNT_COLOR_HLS_H #include <wx/panel.h> #include <illa/color.h> #include <orz/geom.h> #include <wx/spinctrl.h> wxDECLARE_EVENT(COLOR_CHANGED_HLS, wxCommandEvent); namespace App { class ControlColorHls:public wxPanel { public: ControlColorHls(wxWindow *parent, wxWindowID winid); void SetHls(Img::HLSTriplet col); Img::HLSTriplet GetHls(); private: wxSpinCtrl *m_h, *m_l, *m_s; void OnChange(wxSpinEvent& evt); enum { HId, LId, SId }; DECLARE_EVENT_TABLE() }; } #endif
#ifndef BLACKPAWN_H #define BLACKPAWN_H #include "pawn.h" class BlackPawn : public Pawn { using Pawn::Pawn; bool moveValidator(const int x, const int y); }; #endif // BLACKPAWN_H
#ifndef NX_FOUNDATION_NXALLOCATOR_DEFAULT #define NX_FOUNDATION_NXALLOCATOR_DEFAULT /*----------------------------------------------------------------------------*\ | | Public Interface to Ageia PhysX Technology | | www.ageia.com | \*----------------------------------------------------------------------------*/ /** \addtogroup foundation @{ */ #include "Nx.h" #include "NxUserAllocator.h" #include <stdlib.h> #if defined(WIN32) && NX_DEBUG_MALLOC #include <crtdbg.h> #endif /** \brief Default memory allocator using standard C malloc / free / realloc. */ class NxAllocatorDefault { public: /** Allocates size bytes of memory. Compatible with the standard C malloc(). \param size Number of bytes to allocate. \param type A hint about what the memory will be used for. See #NxMemoryType. */ NX_INLINE void* malloc(size_t size, NxMemoryType type) { NX_UNREFERENCED_PARAMETER(type); return ::malloc(size); } /** Allocates size bytes of memory. Same as above, but with extra debug info fields. \param size Number of bytes to allocate. \param fileName File which is allocating the memory. \param line Line which is allocating the memory. \param className Name of the class which is allocating the memory. \param type A hint about what the memory will be used for. See #NxMemoryType. */ NX_INLINE void* mallocDEBUG(size_t size, const char* fileName, int line, const char* className, NxMemoryType type) { NX_UNREFERENCED_PARAMETER(type); NX_UNREFERENCED_PARAMETER(className); #ifdef _DEBUG #if defined(WIN32) && NX_DEBUG_MALLOC return ::_malloc_dbg(size, _NORMAL_BLOCK, fileName, line); #else NX_UNREFERENCED_PARAMETER(fileName); NX_UNREFERENCED_PARAMETER(line); // TODO: insert a Linux Debugger Function return ::malloc(size); #endif #else NX_UNREFERENCED_PARAMETER(fileName); NX_UNREFERENCED_PARAMETER(line); NX_UNREFERENCED_PARAMETER(size); NX_ASSERT(0);//Don't use debug malloc for release mode code! return 0; #endif } /** Resizes the memory block previously allocated with malloc() or realloc() to be size() bytes, and returns the possibly moved memory. Compatible with the standard C realloc(). \param memory Memory block to change the size of. \param size New size for memory block. */ NX_INLINE void* realloc(void* memory, size_t size) { return ::realloc(memory,size); } /** Frees the memory previously allocated by malloc() or realloc(). Compatible with the standard C free(). \param memory Memory to free. */ NX_INLINE void free(void* memory) { if(memory) ::free(memory); // Deleting null ptrs is valid, but still useless } /** Check a memory block is valid. */ NX_INLINE void check(void* memory) { NX_UNREFERENCED_PARAMETER(memory); } }; /** @} */ #endif //AGCOPYRIGHTBEGIN /////////////////////////////////////////////////////////////////////////// // Copyright (c) 2005 AGEIA Technologies. // All rights reserved. www.ageia.com /////////////////////////////////////////////////////////////////////////// //AGCOPYRIGHTEND
#ifndef SIDECAR_GUI_ESSCOPE_APP_H // -*- C++ -*- #define SIDECAR_GUI_ESSCOPE_APP_H #include "QtCore/QList" #include "QtGui/QImage" #include "GUI/AppBase.h" namespace Logger { class Log; } namespace SideCar { namespace GUI { class ChannelSelectorWindow; class ControlsWindow; class PresetsWindow; /** Namespace for the ESScope application. \image html ESScope.png */ namespace ESScope { class Configuration; class ConfigurationWindow; class MainWindow; class ViewEditor; /** Application class for the Master application. Creates and manages the floating tool windows. There is only one instance of this class created (in main.cc) for the life of the application. */ class App : public AppBase { Q_OBJECT using Super = AppBase; public: enum ToolsMenuAction { kShowChannelSelectorWindow, kShowConfigurationWindow, kShowControlsWindow, kShowViewEditor, kShowPresetsWindow, kNumToolsMenuActions }; /** Obtain the Log device for App instances \return Log device */ static Logger::Log& Log(); /** Obtain the singleton App object. \return App instance */ static App* GetApp() { return dynamic_cast<App*>(qApp); } /** Constructor. Creates floating tool windows. \param argc command-line argument count \param argv vector of command-line argument values */ App(int& argc, char** argv); QAction* getToolsMenuAction(ToolsMenuAction index) { return Super::getToolsMenuAction(index); } Configuration* getConfiguration() const { return configuration_; } ChannelSelectorWindow* getChannelSelectorWindow() const { return channelSelectorWindow_; } ConfigurationWindow* getConfigurationWindow() const { return configurationWindow_; } ControlsWindow* getControlsWindow() const { return controlsWindow_; } PresetsWindow* getPresetsWindow() const { return presetsWindow_; } ViewEditor* getViewEditor() const { return viewEditor_; } MainWindow* getMainWindow() const { return mainWindow_; } private slots: void applicationQuit(); private: void makeToolWindows(); MainWindowBase* makeNewMainWindow(const QString& objectName); Configuration* configuration_; ChannelSelectorWindow* channelSelectorWindow_; ConfigurationWindow* configurationWindow_; ControlsWindow* controlsWindow_; PresetsWindow* presetsWindow_; ViewEditor* viewEditor_; MainWindow* mainWindow_; }; } // end namespace ESScope } // end namespace GUI } // end namespace SideCar /** \file */ #endif
// // RKMappingOperationDataSource.h // RestKit // // Created by Blake Watters on 7/3/12. // Copyright (c) 2012 RestKit. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import <Foundation/Foundation.h> @class RKObjectMapping, RKMappingOperation, RKRelationshipMapping; /** An object that adopts the `RKMappingOperationDataSource` protocol is responsible for the retrieval or creation of target objects within an `RKMapperOperation` or `RKMappingOperation`. A data source is responsible for meeting the requirements of the underlying data store implementation and must return a key-value coding compliant object instance that can be used as the target object of a mapping operation. It is also responsible for commiting any changes necessary to the underlying data store once a mapping operation has completed its work. At a minimum, a data source must implement the `mappingOperation:targetObjectForRepresentation:withMapping:` method. This method is responsible for finding an existing object instance to be updated or creating a new object if no existing object could be found or the underlying data store does not support persistence. Object mapping operations which target `NSObject` derived classes will always result in mapping to new transient objects, while persistent data stores such as Core Data can be queried to retrieve existing objects for update. @see `RKManagedObjectMappingOperationDataSource` */ @protocol RKMappingOperationDataSource <NSObject> @required /** Asks the data source for the target object for an object mapping operation given an `NSDictionary` representation of the object's properties and the mapping object that will be used to perform the mapping. The `representation` value is a fragment of content from a deserialized response that has been identified as containing content that is mappable using the given mapping. @param mappingOperation The mapping operation requesting the target object. @param representation A dictionary representation of the properties to be mapped onto the retrieved target object. @param mapping The object mapping to be used to perform a mapping from the representation to the target object. @return A key-value coding compliant object to perform the mapping on to. */ - (id)mappingOperation:(RKMappingOperation *)mappingOperation targetObjectForRepresentation:(NSDictionary *)representation withMapping:(RKObjectMapping *)mapping inRelationship:(RKRelationshipMapping *)relationshipMapping; @optional /** Tells the data source to commit any changes to the underlying data store. @param mappingOperation The mapping operation that has completed its work. @param error A pointer to an error to be set in the event that the mapping operation could not be committed. @return A Boolean value indicating if the changes for the mapping operation were committed successfully. */ - (BOOL)commitChangesForMappingOperation:(RKMappingOperation *)mappingOperation error:(NSError **)error; /** Tells the data source to delete the existing value for a relationship that has been mapped with an assignment policy of `RKReplaceAssignmentPolicy`. @param mappingOperation The mapping operation that is executing. @param relationshipMapping The relationship mapping for which the existing value is being replaced. @param error A pointer to an error to be set in the event that the deletion operation could not be completed. @return A Boolean value indicating if the existing objects for the relationship were successfully deleted. */ - (BOOL)mappingOperation:(RKMappingOperation *)mappingOperation deleteExistingValueOfRelationshipWithMapping:(RKRelationshipMapping *)relationshipMapping error:(NSError **)error; @end
/** * @file light.c * @brief “_“”•”‚ÌŽÀ‘• * * Copyright (C) 2017 extsui, All rights reserved. */ #include "r_cg_macrodriver.h" #include "r_cg_tau.h" #include "r_cg_sau.h" #include "r_cg_userdefine.h" #include "iodefine.h" #include "light.h" #include <string.h> #pragma interrupt r_csi01_interrupt(vect=INTCSI01) #pragma interrupt r_tau0_channel1_interrupt(vect=INTTM01) static void light_move_to_next_pos_callback(void); #define PIN_nSCLR (P0_bit.no3) #define PIN_RCK (P0_bit.no6) /** “_“”—pƒf[ƒ^\‘¢‘Ì */ typedef struct { uint8_t data; ///< •\ަƒf[ƒ^ uint8_t brightness; ///< ‹P“x(0-255) } light_t; /** “_“”’†ƒf[ƒ^î•ñ */ static light_t light[NUM_OF_7SEG]; /** XV—pƒf[ƒ^î•ñ */ static light_t latch[NUM_OF_7SEG]; /** Œ»Ý‚Ì“_“”‰ÓŠ */ static int light_cur_pos; /* * ƒ_ƒCƒiƒ~ƒbƒN“_“”§Œä‚̃^ƒCƒ~ƒ“ƒOƒ`ƒƒ[ƒg * * «“_“”7ƒZƒOˆÊ’u * [0] [1] [2] * <-------------------><-------------------><---... * | * +-----“_“”ƒ}ƒXƒ^ŽüŠú * +--PWMÅ‘åŽüŠú( = “_“”ƒ}ƒXƒ^ŽüŠú - ƒ}[ƒWƒ“ŠúŠÔ(š1)) * | * <----------------> * <-----------><---><-><-----------><---><-><... * | ª | * | b +---PWM OFFŠúŠÔ(7ƒZƒOÁ“”) * | „¤-----INTTM01(š2) * +-----------------PWM ONŠúŠÔ(7ƒZƒO“_“”) * * š1: ‚±‚ÌŠúŠÔ‚ª’·‚¢‚ƏÁ“”ŽžŠÔ‚ª‘‚¦‚ďãŒÀ‹P“x‚ª‰º‚ª‚邽‚ß * ‚È‚é‚ׂ­’Z‚­‚µ‚½‚¢B‚µ‚©‚µA’Z‚­‚µ‰ß‚¬‚邯ƒf[ƒ^Žw’è‚ð * ˜A‘±‚µ‚čs‚Á‚½ê‡‚Ƀ`ƒ‰‚‚«‚ª”­¶‚·‚éB * š2: ‚±‚±‚ÅŽŸ‚ÌŽüŠú‚̐ݒè(TM00, TM01, 74HC595)‚ðs‚¤B * 7ƒZƒOÁ“”ŠúŠÔ’†(‹P“xÅ‘å‚̏ꍇ‚Å‚àƒ}[ƒWƒ“ŠúŠÔ’†)‚Ì‚½‚߁A * ˆÀ‘S‚ÉŽŸ‚ÌŽüŠú‚ðÝ’è‚Å‚«‚éB */ // ã‹L‚̐}‚́uƒ}[ƒWƒ“ŠúŠÔv‚Ì’lB // ’Z‚­‚ĊԂɍ‡‚¤‚È‚ç’Z‚¢•û‚ª—Ç‚¢B // 100us@(CLK=20MHz, DIV=16) ---> 250 // 50us ---> 125 #define LIGHT_PWM_BLANK_VALUE (125) /** “_“”ƒ}ƒXƒ^ŽüŠú‚ÌTDR’l(ƒ_ƒCƒiƒ~ƒbƒN“_“”ŽüŠú‚̑匳) */ static uint16_t light_master_cycle_value; /** PWMÅ‘åŽüŠú‚ÌTDR’l */ static uint16_t light_pwm_width_value; static __inline void set_pwm_duty(uint8_t duty); /** * “_“”•”‚̏‰Šú‰» */ void light_init(void) { PIN_nSCLR = 0; PIN_nSCLR = 1; PIN_RCK = 0; light_set_light_cycle(2000); memset(light, 0, sizeof(light)); memset(latch, 0, sizeof(latch)); light_cur_pos = 0; R_CSI01_Start(); // ƒ`ƒƒƒlƒ‹0: •\ަXV—pƒ^ƒCƒ} // ƒ`ƒƒƒlƒ‹1: ‹P“x—pƒ^ƒCƒ} R_TAU0_Channel0_Start(); } /** * •\ަƒf[ƒ^‚̐ݒè */ void light_set_data(const uint8_t data[]) { int i; for (i = 0; i < NUM_OF_7SEG; i++) { latch[i].data = data[i]; } } /** * ‹P“x‚̐ݒè */ void light_set_brightness(const uint8_t brightness[]) { int i; for (i = 0; i < NUM_OF_7SEG; i++) { latch[i].brightness = brightness[i]; } } int light_set_light_cycle(uint16_t light_cycle_us) { // ˆø”ƒ`ƒFƒbƒN if ((light_cycle_us < 500 ) || (50000 < light_cycle_us)) { return -1; } // ƒÊ•b‚©‚çƒJƒEƒ“ƒ^’l‚ւ̕ϊ· // E1ƒJƒEƒ“ƒg“–‚½‚è‚̃ʕb = CLOCK_HZ / TAU0_CHANNEL2_DIVISOR / 1000 / 1000 [us/cnt] // ¦ŽÀÛ‚ÌŒvŽZ‚́A¸“x‚ÌŠÖŒW‚ŏ‡”Ô‚ð•Ï‚¦‚Ä‚¢‚邱‚ƂɒˆÓB // ECLOCK_HZ=20MHzADIVISOR=16 ‚̏ꍇ‚́A1.25[us/cnt]B light_master_cycle_value = (uint16_t)((((CLOCK_HZ / 1000) / TAU0_CHANNEL0_DIVISOR) * (uint32_t)light_cycle_us) / 1000); light_pwm_width_value = light_master_cycle_value - LIGHT_PWM_BLANK_VALUE; return 0; } /** * •\ަ’†ƒf[ƒ^‚ðÝ’肵‚½ƒf[ƒ^‚ɍXV‚·‚é */ void light_update(void) { memcpy(light, latch, sizeof(light)); } /** * •\ަØ‚è‘Ö‚¦ƒR[ƒ‹ƒoƒbƒN * * Œ»Ý“_“”‚µ‚Ä‚¢‚é7ƒZƒO‚ðØ‚è‘Ö‚¦‚é */ void light_move_to_next_pos_callback(void) { static uint8_t shift_data[sizeof(light_t)]; static const uint8_t bit_table[] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, }; shift_data[0] = bit_table[light_cur_pos]; shift_data[1] = light[light_cur_pos].data; // uCSI01ŠJŽn`Š®—¹Š„‚荞‚݁v‚ÌŽžŠÔ‚ɂ‚¢‚āA // 1MHz‚̏ꍇ‚Í–ñ20usA5MHz‚̏ꍇ‚Í–ñ10us‚ƂȂÁ‚½B(@20MHz) // ËŠ„‚荞‚Ý“P”p‚É‚æ‚è–ñ6us‚ƂȂÁ‚½‚½‚߁A‚±‚ê‚ðÌ—p‚·‚éB R_CSI01_SendBlocking(shift_data, sizeof(shift_data)); set_pwm_duty(light[light_cur_pos].brightness); // “_“”ŽüŠúXV TDR00H = (uint8_t)((light_master_cycle_value & 0xFF00) >> 8); TDR00L = (uint8_t)((light_master_cycle_value & 0x00FF) >> 0); // œŽZ‚ðŽg—p‚µ‚Ä‚¢‚邪A–½—߃Œƒxƒ‹‚ł̓Vƒtƒg‰‰ŽZ‚É // ’u‚«Š·‚¦‚ç‚ê‚Ä‚¨‚èA”ƒÊ•b‚µ‚©‚©‚©‚ç‚È‚¢B light_cur_pos = (light_cur_pos + 1) % NUM_OF_7SEG; } /** * PWMo—͂̃fƒ…[ƒeƒB”ä(0-255)‚ðÝ’è‚·‚éB * * ƒƒ“ƒVƒ‡ƒbƒgEƒpƒ‹ƒX‹@”\‚ðŽg—p‚µ‚ÄŽÀŒ»‚·‚éB */ static __inline void set_pwm_duty(uint8_t duty) { uint8_t new_tdr01h, new_tdr01l; uint16_t tdr_duty_255 = light_pwm_width_value; uint16_t tdr_duty_x = (uint16_t)((uint32_t)tdr_duty_255 * duty >> 8); // TDR0nH¨TDR0nL‚̏‡”ԂɘA‘±‚ŏ‘‚«ž‚Þ•K—v‚ª‚ ‚é new_tdr01h = (uint8_t)((tdr_duty_x & 0xFF00) >> 8); new_tdr01l = (uint8_t)(tdr_duty_x & 0x00FF); TDR01H = new_tdr01h; TDR01L = new_tdr01l; } /*********************************************************************************************************************** * Function Name: r_tau0_channel1_interrupt * Description : This function INTTM01 interrupt service routine. * Arguments : None * Return Value : None ***********************************************************************************************************************/ static void __near r_tau0_channel1_interrupt(void) { /* Start user code. Do not edit comment generated here */ // PWMo—ÍŠ®—¹ƒ^ƒCƒ~ƒ“ƒO // ‚±‚±‚ÅŽŸ‚ÌŽüŠú‚ÆPWMƒfƒ…[ƒeƒB‚ðŠm’肵‚ÄTDR‚ɐݒ肵‚Ä‚¨‚­B // ˆ—ŽžŠÔ‚ª–ñ17us‚Ȃ̂ŃtƒŒ[ƒ€‚𗎂Ƃ³‚È‚¢‚悤‚É‚·‚邽‚߂ɂ́A // SPIŽóM1ƒoƒCƒg‚É‚©‚©‚鏈—ŽžŠÔ‚ª‚±‚Ì’lˆÈã‚Å‚ ‚é•K—v‚ª‚ ‚éB // ËSPIŽóMƒNƒƒbƒN400kHz‚̏ꍇ1ƒoƒCƒgŽóM‚ª20us‚Ȃ̂ŁA // ‚±‚±‚܂Ŏü”g”‚ð‰º‚°‚Ä‚â‚ê‚΃tƒŒ[ƒ€ƒƒX‚Í–³‚­‚È‚éB //DEBUG_PIN = 1; light_move_to_next_pos_callback(); //DEBUG_PIN = 0; // RCK‚Í—§‚¿ã‚ª‚è‚Å”½‰f PIN_RCK = 1; PIN_RCK = 0; /* End user code. Do not edit comment generated here */ }
// Copyright (c) 2012-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_LEVELDBWRAPPER_H #define BITCOIN_LEVELDBWRAPPER_H #include "serialize.h" #include "util.h" #include "version.h" #include <boost/filesystem/path.hpp> #include <leveldb/db.h> #include <leveldb/write_batch.h> class leveldb_error : public std::runtime_error { public: leveldb_error(const std::string &msg) : std::runtime_error(msg) {} }; void HandleError(const leveldb::Status &status) throw(leveldb_error); // Batch of changes queued to be written to a CLevelDBWrapper class CLevelDBBatch { friend class CLevelDBWrapper; private: leveldb::WriteBatch batch; public: template<typename K, typename V> void Write(const K& key, const V& value) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; leveldb::Slice slKey(&ssKey[0], ssKey.size()); CDataStream ssValue(SER_DISK, CLIENT_VERSION); ssValue.reserve(ssValue.GetSerializeSize(value)); ssValue << value; leveldb::Slice slValue(&ssValue[0], ssValue.size()); batch.Put(slKey, slValue); } template<typename K> void Erase(const K& key) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; leveldb::Slice slKey(&ssKey[0], ssKey.size()); batch.Delete(slKey); } }; class CLevelDBIterator { private: leveldb::Iterator *piter; public: CLevelDBIterator(leveldb::Iterator *piterIn) : piter(piterIn) {} ~CLevelDBIterator(); bool Valid(); void SeekToFirst(); void SeekToLast(); template<typename K> void Seek(const K& key) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; leveldb::Slice slKey(&ssKey[0], ssKey.size()); piter->Seek(slKey); } void Next(); void Prev(); template<typename K> bool GetKey(K& key) { leveldb::Slice slKey = piter->key(); try { CDataStream ssKey(slKey.data(), slKey.data() + slKey.size(), SER_DISK, CLIENT_VERSION); ssKey >> key; } catch(std::exception &e) { return false; } return true; } unsigned int GetKeySize() { return piter->key().size(); } template<typename V> bool GetValue(V& value) { leveldb::Slice slValue = piter->value(); try { CDataStream ssValue(slValue.data(), slValue.data() + slValue.size(), SER_DISK, CLIENT_VERSION); ssValue >> value; } catch(std::exception &e) { return false; } return true; } unsigned int GetValueSize() { return piter->value().size(); } }; class CLevelDBWrapper { private: // custom environment this database is using (may be NULL in case of default environment) leveldb::Env *penv; // database options used leveldb::Options options; // options used when reading from the database leveldb::ReadOptions readoptions; // options used when iterating over values of the database leveldb::ReadOptions iteroptions; // options used when writing to the database leveldb::WriteOptions writeoptions; // options used when sync writing to the database leveldb::WriteOptions syncoptions; // the database itself leveldb::DB *pdb; public: CLevelDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory = false, bool fWipe = false); ~CLevelDBWrapper(); template<typename K, typename V> bool Read(const K& key, V& value) throw(leveldb_error) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; leveldb::Slice slKey(&ssKey[0], ssKey.size()); std::string strValue; leveldb::Status status = pdb->Get(readoptions, slKey, &strValue); if (!status.ok()) { if (status.IsNotFound()) return false; LogPrintf("LevelDB read failure: %s\n", status.ToString().c_str()); HandleError(status); } try { CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION); ssValue >> value; } catch(std::exception &e) { return false; } return true; } template<typename K, typename V> bool Write(const K& key, const V& value, bool fSync = false) throw(leveldb_error) { CLevelDBBatch batch; batch.Write(key, value); return WriteBatch(batch, fSync); } template<typename K> bool Exists(const K& key) throw(leveldb_error) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; leveldb::Slice slKey(&ssKey[0], ssKey.size()); std::string strValue; leveldb::Status status = pdb->Get(readoptions, slKey, &strValue); if (!status.ok()) { if (status.IsNotFound()) return false; LogPrintf("LevelDB read failure: %s\n", status.ToString().c_str()); HandleError(status); } return true; } template<typename K> bool Erase(const K& key, bool fSync = false) throw(leveldb_error) { CLevelDBBatch batch; batch.Erase(key); return WriteBatch(batch, fSync); } bool WriteBatch(CLevelDBBatch &batch, bool fSync = false) throw(leveldb_error); // not available for LevelDB; provide for compatibility with BDB bool Flush() { return true; } bool Sync() throw(leveldb_error) { CLevelDBBatch batch; return WriteBatch(batch, true); } CLevelDBIterator *NewIterator() { return new CLevelDBIterator(pdb->NewIterator(iteroptions)); } }; #endif // BITCOIN_LEVELDBWRAPPER_H
#include "video.h" // Strings const char * const welcome = "Welcome to PotatOS"; const char * const test = "Color test"; void main() { char attr = style(WHITE, BROWN); write_string(offset(8,22), welcome, attr); int color_test = offset(11,0); write_string(color_test, test, attr); /* for(char i = BLACK; i <= WHITE; i++){ for(char j = BLACK; j <= WHITE; j++){ write_char(offset(i,64+j), 'C', style(j,i)); } } */ int data = 0x0123face; char buf[11]; htos(data, buf, 11); write_string(offset(16,0), buf, attr); }
#import "ASHNode.h" @class GameState; @class Hud; @interface HudNode : ASHNode @property (nonatomic, weak) GameState * state; @property (nonatomic, weak) Hud * hud; @end
/**********************************************************\ This file is distributed under the MIT License. See https://github.com/morzhovets/momo/blob/master/LICENSE for details. momo/stdish/pool_allocator.h namespace momo::stdish: class unsynchronized_pool_allocator \**********************************************************/ #pragma once #include "../MemPool.h" namespace momo { namespace stdish { /*! \brief Allocator with a pool of memory for containers like `std::list`, `std::forward_list`, `std::map`, `std::unordered_map`. It makes no sense to use this allocator for classes `momo::stdish`. \details Each copy of the container keeps its own memory pool. Memory is released not only after destruction of the object, but also in case of removal sufficient number of items. */ template<typename TValue, typename TBaseAllocator = std::allocator<char>, typename TMemPoolParams = MemPoolParams<>> class unsynchronized_pool_allocator { public: typedef TValue value_type; typedef TBaseAllocator base_allocator_type; typedef TMemPoolParams mem_pool_params; typedef value_type* pointer; typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef std::false_type propagate_on_container_copy_assignment; typedef std::true_type propagate_on_container_move_assignment; typedef std::true_type propagate_on_container_swap; private: typedef MemManagerStd<base_allocator_type, false> MemManager; typedef internal::MemManagerProxy<MemManager> MemManagerProxy; typedef mem_pool_params MemPoolParams; typedef momo::MemPool<MemPoolParams, MemManager> MemPool; template<typename Value> struct PoolAllocatorProxy : public unsynchronized_pool_allocator<Value, base_allocator_type, mem_pool_params> { typedef unsynchronized_pool_allocator<Value, base_allocator_type, mem_pool_params> PoolAllocator; MOMO_DECLARE_PROXY_CONSTRUCTOR(PoolAllocator) }; public: explicit unsynchronized_pool_allocator(const base_allocator_type& alloc = base_allocator_type()) : mMemPool(std::allocate_shared<MemPool>(alloc, pvGetMemPoolParams(), MemManager(alloc))) { } unsynchronized_pool_allocator(const unsynchronized_pool_allocator& alloc) noexcept : mMemPool(alloc.mMemPool) { } ~unsynchronized_pool_allocator() = default; unsynchronized_pool_allocator& operator=(const unsynchronized_pool_allocator& alloc) noexcept { mMemPool = alloc.mMemPool; return *this; } template<class Value> operator unsynchronized_pool_allocator<Value, base_allocator_type, mem_pool_params>() const noexcept { return PoolAllocatorProxy<Value>(mMemPool); } base_allocator_type get_base_allocator() const noexcept { return base_allocator_type(mMemPool->GetMemManager().GetByteAllocator()); } unsynchronized_pool_allocator select_on_container_copy_construction() const noexcept { return unsynchronized_pool_allocator(get_base_allocator()); } MOMO_NODISCARD pointer allocate(size_type count) { if (count == 1) { MemPoolParams memPoolParams = pvGetMemPoolParams(); bool equal = pvIsEqual(memPoolParams, mMemPool->GetParams()); if (!equal && mMemPool->GetAllocateCount() == 0) { *mMemPool = MemPool(memPoolParams, MemManager(get_base_allocator())); equal = true; } if (equal) return mMemPool->template Allocate<value_type>(); } return MemManagerProxy::template Allocate<value_type>(mMemPool->GetMemManager(), count * sizeof(value_type)); } void deallocate(pointer ptr, size_type count) noexcept { if (count == 1 && pvIsEqual(pvGetMemPoolParams(), mMemPool->GetParams())) return mMemPool->Deallocate(ptr); MemManagerProxy::Deallocate(mMemPool->GetMemManager(), ptr, count * sizeof(value_type)); } template<typename Value, typename... ValueArgs> void construct(Value* ptr, ValueArgs&&... valueArgs) { typedef typename momo::internal::ObjectManager<Value, MemManager> ::template Creator<ValueArgs...> ValueCreator; ValueCreator(mMemPool->GetMemManager(), std::forward<ValueArgs>(valueArgs)...)(ptr); } template<class Value> void destroy(Value* ptr) noexcept { momo::internal::ObjectManager<Value, MemManager>::Destroy(mMemPool->GetMemManager(), *ptr); } bool operator==(const unsynchronized_pool_allocator& alloc) const noexcept { return mMemPool == alloc.mMemPool; } bool operator!=(const unsynchronized_pool_allocator& alloc) const noexcept { return !(*this == alloc); } protected: explicit unsynchronized_pool_allocator(const std::shared_ptr<MemPool>& memPool) noexcept : mMemPool(memPool) { } private: static MemPoolParams pvGetMemPoolParams() noexcept { return MemPoolParams(sizeof(value_type), internal::ObjectAlignmenter<value_type>::alignment); } static bool pvIsEqual(const MemPoolParams& memPoolParams1, const MemPoolParams& memPoolParams2) noexcept { return memPoolParams1.GetBlockSize() == memPoolParams2.GetBlockSize() && memPoolParams1.GetBlockAlignment() == memPoolParams2.GetBlockAlignment(); } private: std::shared_ptr<MemPool> mMemPool; }; } // namespace stdish } // namespace momo
#include "types.h" #include "defs.h" #include "gci.h" #include "mist32.h" struct gci_hub_info *gci_hub; struct gci_hub_node *gci_hub_nodes; struct gci_node gci_nodes[4]; /* GCI */ void gciinit(void) { char *node; unsigned int i; gci_hub = (struct gci_hub_info *)((char *)sriosr() + GCI_OFFSET); gci_hub_nodes = (struct gci_hub_node *)((char *)gci_hub + GCI_HUB_HEADER_SIZE); //gci_nodes = malloc(sizeof(gci_node) * gci_hub->total); node = (char *)gci_hub + GCI_HUB_SIZE; for(i = 0; i < gci_hub->total; i++) { gci_nodes[i].node_info = (struct gci_node_info *)node; gci_nodes[i].device_area = node + GCI_NODE_SIZE; node += gci_hub_nodes[i].size; } }
#ifndef HANDLE_H_ #define HANDLE_H_ jfieldID getHandleField(JNIEnv* env, jobject obj); template <typename T> T* getHandle(JNIEnv* env, jobject obj) { auto handle = env->GetLongField(obj, getHandleField(env, obj)); return reinterpret_cast<T*>(handle); } template <typename T> void setHandle(JNIEnv* env, jobject obj, T* t) { auto handle = reinterpret_cast<jlong>(t); env->SetLongField(obj, getHandleField(env, obj), handle); } void clearHandle(JNIEnv* env, jobject obj); #endif
#ifndef _OMP_UTILS_H_ #define _OMP_UTILS_H_ namespace omp_par { template <class T,class StrictWeakOrdering> void merge(T A_,T A_last,T B_,T B_last,T C_,int p,StrictWeakOrdering comp); template <class T,class StrictWeakOrdering> void merge_sort(T A,T A_last,StrictWeakOrdering comp); template <class T> void merge_sort(T A,T A_last); template <class T> void merge_sort_ptrs(T A,T A_last); template <class T, class I> T reduce(T* A, I cnt); template <class T, class I> void scan(T* A, T* B,I cnt); } #include "ompUtils.tcc" #endif
// // Powerup.h // Cocos2DSimpleGame // // Created by Ted on 10/8/12. // Copyright (c) 2012 __MyCompanyName__. All rights reserved. // #import "CCSprite.h" #import "cocos2d.h" #import "GameState.h" #include <AudioToolbox/AudioToolbox.h> @interface Powerup : CCSprite{ int power; int freq; NSString *imgName; NSString *name; SystemSoundID mySound; NSString *powStr; bool collectable; } @property int power, height; @property int freq; @property bool collectable; @property (nonatomic, retain) NSString *imgName; @property (nonatomic, retain) NSString *name; @property SystemSoundID mySound; @property (nonatomic, retain) NSString *powStr; -(id) initSelf; - (int)calcFreq:(int)freq withMin:(int)min withDist:(int)dist; -(void)updatePosition:(GameState*)gs; -(void)collide:(GameState*)gs; @end
// DO NOT EDIT. This file is machine-generated and constantly overwritten. // Make changes to JCMVerse.h instead. @import CoreData; extern const struct JCMVerseAttributes { __unsafe_unretained NSString *book; __unsafe_unretained NSString *bookChapterVerse; __unsafe_unretained NSString *reference; __unsafe_unretained NSString *textESV; __unsafe_unretained NSString *textKJV; __unsafe_unretained NSString *textNASB; } JCMVerseAttributes; extern const struct JCMVerseRelationships { __unsafe_unretained NSString *chapter; __unsafe_unretained NSString *prophecies; } JCMVerseRelationships; @class KJVChapter; @class JCMProphecy; @interface JCMVerseID : NSManagedObjectID {} @end @interface _JCMVerse : NSManagedObject {} + (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_; + (NSString*)entityName; + (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_; @property (nonatomic, readonly, strong) JCMVerseID* objectID; @property (nonatomic, strong) NSNumber* book; @property (atomic) int16_t bookValue; - (int16_t)bookValue; - (void)setBookValue:(int16_t)value_; //- (BOOL)validateBook:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) NSNumber* bookChapterVerse; @property (atomic) int32_t bookChapterVerseValue; - (int32_t)bookChapterVerseValue; - (void)setBookChapterVerseValue:(int32_t)value_; //- (BOOL)validateBookChapterVerse:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) NSString* reference; //- (BOOL)validateReference:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) NSString* textESV; //- (BOOL)validateTextESV:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) NSString* textKJV; //- (BOOL)validateTextKJV:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) NSString* textNASB; //- (BOOL)validateTextNASB:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) KJVChapter *chapter; //- (BOOL)validateChapter:(id*)value_ error:(NSError**)error_; @property (nonatomic, strong) NSSet *prophecies; - (NSMutableSet*)propheciesSet; @end @interface _JCMVerse (PropheciesCoreDataGeneratedAccessors) - (void)addProphecies:(NSSet*)value_; - (void)removeProphecies:(NSSet*)value_; - (void)addPropheciesObject:(JCMProphecy*)value_; - (void)removePropheciesObject:(JCMProphecy*)value_; @end @interface _JCMVerse (CoreDataGeneratedPrimitiveAccessors) - (NSNumber*)primitiveBook; - (void)setPrimitiveBook:(NSNumber*)value; - (int16_t)primitiveBookValue; - (void)setPrimitiveBookValue:(int16_t)value_; - (NSNumber*)primitiveBookChapterVerse; - (void)setPrimitiveBookChapterVerse:(NSNumber*)value; - (int32_t)primitiveBookChapterVerseValue; - (void)setPrimitiveBookChapterVerseValue:(int32_t)value_; - (NSString*)primitiveReference; - (void)setPrimitiveReference:(NSString*)value; - (NSString*)primitiveTextESV; - (void)setPrimitiveTextESV:(NSString*)value; - (NSString*)primitiveTextKJV; - (void)setPrimitiveTextKJV:(NSString*)value; - (NSString*)primitiveTextNASB; - (void)setPrimitiveTextNASB:(NSString*)value; - (KJVChapter*)primitiveChapter; - (void)setPrimitiveChapter:(KJVChapter*)value; - (NSMutableSet*)primitiveProphecies; - (void)setPrimitiveProphecies:(NSMutableSet*)value; @end
/* tokenize.c -- This file is part of ctools * * Copyright (C) 2015 - David Oberhollenzer * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ #define TL_EXPORT #include "tl_iterator.h" #include "tl_string.h" typedef struct { tl_iterator super; tl_string *str; /* string to search throug */ tl_string current; /* the last extracted token */ tl_string seperators; /* string of seperator characters */ size_t offset; /* offset after the last substring */ } tl_token_iterator; #define STATE_NONE_FOUND 0 #define STATE_LAST_WAS_START 1 #define STATE_NONSEP_FOUND 2 static void token_iterator_destroy(tl_iterator *super) { tl_token_iterator *this = (tl_token_iterator *)super; tl_string_cleanup(&this->current); tl_string_cleanup(&this->seperators); free(this); } static int token_iterator_has_data(tl_iterator *this) { return !tl_string_is_empty(&((tl_token_iterator *)this)->current); } static void token_iterator_next(tl_iterator *super) { tl_token_iterator *this = (tl_token_iterator *)super; size_t first; char *ptr; tl_string_clear(&this->current); if (this->offset >= (this->str->data.used - 1)) return; /* find first non-serperator character */ ptr = (char *)this->str->data.data + this->offset; for (; *ptr; ++ptr, ++this->offset) { if ((*ptr & 0xC0) == 0x80) continue; if (!tl_utf8_strchr(tl_string_cstr(&this->seperators), ptr)) break; } if (!(*ptr)) return; first = this->offset; /* find next seperator character */ for (; *ptr; ++ptr, ++this->offset) { if ((*ptr & 0xC0) == 0x80) continue; if (tl_utf8_strchr(tl_string_cstr(&this->seperators), ptr)) break; } /* isolate */ if (*ptr) { tl_string_append_utf8_count(&this->current, (char *)this->str->data.data + first, this->offset - first); } else { tl_string_append_utf8(&this->current, (char *)this->str->data.data + first); } } static void token_iterator_reset(tl_iterator *super) { tl_token_iterator *this = (tl_token_iterator *)super; this->offset = 0; token_iterator_next(super); } static void* token_iterator_get_value(tl_iterator *this) { return &((tl_token_iterator *)this)->current; } tl_iterator *tl_string_tokenize(tl_string *str, const char *seperators) { tl_token_iterator *it; assert(str && seperators); it = calloc(1, sizeof(*it)); if (!it) return NULL; if (!tl_string_init(&it->seperators)) goto fail; if (!tl_string_append_utf8(&it->seperators, seperators)) goto failsep; if (!tl_string_init(&it->current)) goto failsep; it->str = str; ((tl_iterator*)it)->destroy = token_iterator_destroy; ((tl_iterator*)it)->reset = token_iterator_reset; ((tl_iterator*)it)->has_data = token_iterator_has_data; ((tl_iterator*)it)->next = token_iterator_next; ((tl_iterator*)it)->get_value = token_iterator_get_value; token_iterator_reset((tl_iterator* )it); return (tl_iterator*)it; failsep: tl_string_cleanup(&it->seperators); fail: free(it); return NULL; }
/* * imap/select.c - issues and handles IMAP SELECT commands, as well as common * responses from SELECT commands */ #define _POSIX_C_SOURCE 200809L #include <assert.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include "imap/imap.h" #include "internal/imap.h" #include "log.h" #include "util/list.h" #include "util/stringop.h" struct callback_data { void *data; char *mailbox; imap_callback_t callback; }; static void imap_select_callback(struct imap_connection *imap, void *data, enum imap_status status, const char *args) { struct callback_data *cbdata = data; list_pop(imap->select_queue); if (status != STATUS_OK) { if (cbdata->callback) { cbdata->callback(imap, cbdata->data, status, args); } return; } struct mailbox *mbox = get_mailbox(imap, cbdata->mailbox); mbox->selected = true; if (imap->selected) { free(imap->selected); } imap->selected = strdup(cbdata->mailbox); if (imap->select_queue->length) { struct callback_data *_cbdata = list_peek(imap->select_queue); imap_send(imap, imap_select_callback, _cbdata, "SELECT \"%s\"", _cbdata->mailbox); } else if (cbdata->callback) { cbdata->callback(imap, cbdata->data, status, args); } if (imap->events.mailbox_updated) { imap->events.mailbox_updated(imap, mbox); } free(cbdata->mailbox); free(cbdata); } void imap_select(struct imap_connection *imap, imap_callback_t callback, void *data, const char *mailbox) { if (mailbox_get_flag(imap, mailbox, "\\noselect")) { callback(imap, data, STATUS_PRE_ERROR, "Cannot select this mailbox"); return; } struct callback_data *cbdata = malloc(sizeof(struct callback_data)); cbdata->data = data; cbdata->mailbox = strdup(mailbox); cbdata->callback = callback; list_enqueue(imap->select_queue, cbdata); if (imap->select_queue->length > 1) { return; } imap_send(imap, imap_select_callback, cbdata, "SELECT \"%s\"", mailbox); } static const char *get_selected(struct imap_connection *imap) { char *selected = imap->selected; if (imap->select_queue->length) { selected = ((struct callback_data *)list_peek(imap->select_queue))->mailbox; } return selected; } void handle_imap_existsunseenrecent(struct imap_connection *imap, const char *token, const char *cmd, imap_arg_t *args) { assert(args); assert(args->type == IMAP_NUMBER); const char *selected = get_selected(imap); struct mailbox *mbox = get_mailbox(imap, selected); struct { const char *cmd; long *ptr; } ptrs[] = { { "EXISTS", &mbox->exists }, { "UNSEEN", &mbox->unseen }, { "RECENT", &mbox->recent } }; bool set = false; for (size_t i = 0; i < sizeof(ptrs) / (sizeof(void*) * 2); ++i) { if (strcmp(ptrs[i].cmd, cmd) == 0) { set = true; if (i == 0 /* EXISTS */) { int diff = args->num - mbox->exists; if (mbox->exists == -1) { diff = args->num; } if (diff > 0) { while (diff--) { struct mailbox_message *msg = calloc(1, sizeof(struct mailbox_message)); msg->index = mbox->messages->length; list_add(mbox->messages, msg); } } else if (diff == 0) { /* no-op */ } else { worker_log(L_ERROR, "Got EXISTS with negative diff, not supposed to happen"); } } *ptrs[i].ptr = args->num; break; } } if (set) { if (imap->events.mailbox_updated) { imap->events.mailbox_updated(imap, mbox); } } else { worker_log(L_DEBUG, "Got weird command %s", cmd); } } void handle_imap_uidnext(struct imap_connection *imap, const char *token, const char *cmd, imap_arg_t *args) { assert(args); assert(args->type == IMAP_NUMBER); const char *selected = get_selected(imap); struct mailbox *mbox = get_mailbox(imap, selected); mbox->nextuid = args->num; } void handle_imap_readwrite(struct imap_connection *imap, const char *token, const char *cmd, imap_arg_t *args) { const char *selected = get_selected(imap); struct mailbox *mbox = get_mailbox(imap, selected); mbox->read_write = true; if (imap->events.mailbox_updated) { imap->events.mailbox_updated(imap, mbox); } } void handle_imap_flags(struct imap_connection *imap, const char *token, const char *cmd, imap_arg_t *args) { const char *selected = get_selected(imap); struct mailbox *mbox = get_mailbox(imap, selected); free_flat_list(mbox->flags); mbox->flags = create_list(); bool perm = strcmp(cmd, "PERMANENTFLAGS") == 0; imap_arg_t *flags = args->list; while (flags) { if (flags->type == IMAP_ATOM) { struct mailbox_flag *flag = mailbox_get_flag(imap, mbox->name, flags->str); if (!flag) { flag = calloc(1, sizeof(struct mailbox_flag)); flag->name = strdup(flags->str); list_add(mbox->flags, flag); } flag->permanent = perm; } flags = flags->next; } }
/*Header file for translating functions*/ #ifndef __MCSG_H #define __MCSG_H #define MCSG_COMMAND_TYPE_FIELD 4 #define MCSG_STATE_RESPONSE_SIZE_FIELD 4 #define MCSG_INT_SIZE 4 #define MCSG_FLOAT_SIZE 8 #define MCSG_STRING_SIZE -1 #define MCSG_TYPE_MESSAGE_DEC 0 #define MCSG_TYPE_STATE_DEC 65536 #define MCSG_TYPE_PAYLOAD_DEC 131072 #define NO_AUTO_MCS #include "mcs.h" /*Buffers*/ typedef struct MCSGCommand { struct cJSON *cmd; struct MCSGCommand *next; } MCSGCommand; typedef struct MCSGEnumList { char *name; int value; struct MCSGEnumList *next; } MCSGEnumList; typedef struct MCSGCommandList { MCSGCommand *messages; MCSGCommand *states; MCSGCommand *payloads; MCSGEnumList *enums; } MCSGCommandList; /*Identify an individual json command, returning an integer identifier*/ int mcsg_type_identifier(cJSON *json); /*Translate to C and print the command depending on the type*/ void mcsg_message_translator(cJSON *json, FILE *out); void mcsg_state_translator(cJSON *json, FILE *out); void mcsg_payload_translator(cJSON *json, FILE *out); /*Take the complete json command list and place in buffers accordingly*/ MCSGCommandList *mcsg_commands_reader(cJSON *json); /*Translate and print a component from the enum list*/ void mcsg_enum_translator(MCSGEnumList *enum_list, FILE *out); /*Translate and print from the buffers*/ void mcsg_commands_translator(MCSGCommandList *commandlist, FILE *out); void mcsg_java_translator(MCSGEnumList *enum_list, FILE *out); #endif
// // LJAutoScrollView.h // Chitu // // Created by Jinxing Liao on 10/13/15. // Copyright © 2015 Jinxing. All rights reserved. // #import <UIKit/UIKit.h> @class LJAutoScrollView; @protocol LJAutoScrollViewDelegate <NSObject> @required - (UIView *)autoScrollView:(LJAutoScrollView *)autoScrollView customViewForIndex:(NSInteger)index; @optional - (NSInteger)numberOfPagesInAutoScrollView:(LJAutoScrollView *)autoScrollView; - (void)autoScrollView:(LJAutoScrollView *)autoScrollView didSelectItemAtIndex:(NSInteger)index; @end @interface LJAutoScrollView : UIView @property (nonatomic, assign) CGSize itemSize; @property (nonatomic, assign) NSInteger numberOfPages; /* set whether to show UIPageIndicator, default is YES */ @property (nonatomic, assign) BOOL showPageIndicator; /* If showPageIndicator, set the offset relative to super view, default is -20 */ @property (nonatomic, assign) CGFloat pageIndicatorOffset; /* Interval in seconds for scrollView to auto scroll, default is 5.0 */ @property (nonatomic, assign) CGFloat scrollInterval; @property (nonatomic, weak) id<LJAutoScrollViewDelegate> delegate; @property (nonatomic, strong) UIColor *pageIndicatorTintColor; @property (nonatomic, strong) UIColor *currentPageIndicatorTintColor; - (void)reloadData; - (void)startAutoScroll; - (void)stopAutoScroll; @end
//---------------------------------------------------------------------------- //Yume Engine //Copyright (C) 2015 arkenthera //This program is free software; you can redistribute it and/or modify //it under the terms of the GNU General Public License as published by //the Free Software Foundation; either version 2 of the License, or //(at your option) any later version. //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. //You should have received a copy of the GNU General Public License along //with this program; if not, write to the Free Software Foundation, Inc., //51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.*/ //---------------------------------------------------------------------------- // // File : <Filename> YumeGraphics.h // Date : 2.19.2016 // Comments : // //---------------------------------------------------------------------------- #ifndef __YumeDynamicLibrary_h__ #define __YumeDynamicLibrary_h__ //---------------------------------------------------------------------------- #include "YumeRequired.h" //---------------------------------------------------------------------------- #if YUME_PLATFORM == YUME_PLATFORM_WIN32 # define DYNLIB_HANDLE hInstance # define DYNLIB_LOAD( a ) LoadLibraryExA( a, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) # define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b ) # define DYNLIB_UNLOAD( a ) !FreeLibrary( a ) struct HINSTANCE__; typedef struct HINSTANCE__* hInstance; #elif YUME_PLATFORM == YUME_PLATFORM_LINUX # define DYNLIB_HANDLE void* # define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL) # define DYNLIB_GETSYM( a, b ) dlsym( a, b ) # define DYNLIB_UNLOAD( a ) dlclose( a ) #elif YUME_PLATFORM == YUME_PLATFORM_APPLE # define DYNLIB_HANDLE void* # define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL ) # define DYNLIB_GETSYM( a, b ) dlsym( a, b ) # define DYNLIB_UNLOAD( a ) dlclose( a ) #endif //---------------------------------------------------------------------------- namespace YumeEngine { class YumeAPIExport YumeDynamicLibrary : public DynamicLibAlloc { public: YumeDynamicLibrary(const YumeString& name); ~YumeDynamicLibrary(); bool Load(); void Unload(); const YumeString& GetName(void) const { return mName; } void* GetSymbol(const YumeString& strName) const throw(); protected: YumeString mName; YumeString dynlibError(void); DYNLIB_HANDLE mInst; }; } //---------------------------------------------------------------------------- #endif
#ifndef GLPROGRAM_H #define GLPROGRAM_H #include <GL/glew.h> #include <string> #include <memory> using namespace std; namespace material{ class Uniforms { public: int unifModelMatrix; int unifBlockAmbientLight; int unifDiffuseColor; int unifSpecularColor; int unifShininess; int unifDistanceToCamera; int unifMaxLightIntensity; int unifInvGamma; int unifMapSampler; int unifNormalMapSampler; int unifShadowMapSampler; int unifWorldMatrix; int unifProjectionMatrix; int unifDirLightColor; int unifDirLightVectorToLight; int unifDirLightIntensity; int unifPointLightColor; int unifPointLightPosition; int unifPointLightIntensity; int unifPointLightAttenuation; int unifAmbientLight; int unifDepthWorldMatrix; int unifSampleSize; int unifShadowMapSize; Uniforms(); }; class GLProgram{ private: int vertexShader; int fragmentShader; int tessEvaluationShader; int tessControlShader; int program; int attrPosition; int attrNormal; int attrUV; int attrTangent; shared_ptr<Uniforms> uniforms; public: GLProgram(); int getVertexShader()const; int getFragmentShader()const; int getTessControlShader()const; int getTessEvaluationShader()const; int getProgram()const; int getAttrPosition()const; int getAttrUV()const; int getAttrTangent()const; int getAttrNormal()const; shared_ptr<Uniforms> getUniforms()const; GLProgram& setVertexShader(int vertexShader); GLProgram& setFragmentShader(int fragmentShader); GLProgram& setTessEvaluationShader(int tessEvaluationShader); GLProgram& setTessControlShader(int tessControlShader); GLProgram& setProgram(int program); GLProgram& setAttrPosition(int attrPosition); GLProgram& setAttrUV(int attrUV); GLProgram& setAttrTangent(int attrTangent); GLProgram& setAttrNormal(int attrNormal); GLProgram& setUniforms(shared_ptr<Uniforms> uniforms); string getSourceFromFile(string filename); int compileShader(GLenum type, string source); int linkProgram(int vertexShader, int fragmentShader); //int linkProgramTessellation(int vertexShader, int fragmentShader, int tessControlShader, int tessEvaluationShader); ~GLProgram(); }; } #endif
#ifndef MW_INITMIXER_H #define MW_INITMIXER_H #include <SDL_mixer.h> namespace mw { class InitMixer { protected: InitMixer(); ~InitMixer(); InitMixer(const InitMixer&) = delete; InitMixer& operator=(const InitMixer&) = delete; private: static int nbrOfInstances; }; } // Namespace mw. #endif // MW_INITMIXER_H
// // UIPickerView+SIABlocks.h // SIATools // // Created by KUROSAKI Ryota on 2013/11/26. // Copyright (c) 2013-2014 SI Agency Inc. All rights reserved. // #import <UIKit/UIKit.h> @interface UIPickerView (SIABlocks) - (void)sia_setNumberOfComponentsUsingBlock:(NSInteger (^)())block; - (void)sia_setNumberOfRowsUsingBlock:(NSInteger (^)(NSInteger component))block; - (void)sia_setWidthUsingBlock:(CGFloat (^)(NSInteger component))block; - (void)sia_setRowHeightUsingBlock:(CGFloat (^)(NSInteger component))block; - (void)sia_setTitleUsingBlock:(NSString *(^)(NSInteger row, NSInteger component))block; - (void)sia_setAttributedTitleUsingBlock:(NSAttributedString *(^)(NSInteger row, NSInteger component))block; - (void)sia_setViewUsingBlock:(UIView *(^)(NSInteger row, NSInteger component, UIView *reusingView))block; - (void)sia_setDidSelectUsingBlock:(void (^)(NSInteger row, NSInteger component))block; @end
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #import <UIKit/UIKit.h> @interface RCCManager : NSObject + (instancetype)sharedInstance; + (instancetype)sharedIntance; -(void)initBridgeWithBundleURL:(NSURL *)bundleURL; -(void)initBridgeWithBundleURL:(NSURL *)bundleURL launchOptions:(NSDictionary *)launchOptions; -(RCTBridge*)getBridge; -(UIWindow*)getAppWindow; -(void)registerController:(UIViewController*)controller componentId:(NSString*)componentId componentType:(NSString*)componentType; -(id)getControllerWithId:(NSString*)componentId componentType:(NSString*)componentType; -(id)getDrawerController; -(void)unregisterController:(UIViewController*)vc; -(NSString*) getIdForController:(UIViewController*)vc; -(void)addSplashScreen; -(void)removeSplashScreen; -(void)clearModuleRegistry; @end
#ifndef vec3_h #define vec3_h #include <math.h> class vec3 { public: float x; float y; float z; vec3(); vec3(float x1, float y1, float z1) { x = x1; y = y1; z = z1; } inline vec3 operator-() const { return vec3(-x, -y, -z); } inline float length() const { return sqrt(x*x + y*y + z*z); } inline float squared_length() const { return x*x + y*y + z*z; } inline vec3& operator+= (const vec3& v) { x += v.x; y += v.y; z += v.z; return *this; } inline vec3& operator-= (const vec3& v) { x -= v.x; y -= v.y; z -= v.z; return *this; } inline vec3& operator*= (const vec3& v) { x *= v.x; y *= v.y; z *= v.z; return *this; } inline vec3& operator/= (const vec3& v) { x /= v.x; y /= v.y; z /= v.z; return *this; } inline vec3& operator*= (const float t) { x *= t; y *= t; z *= t; return *this; } inline vec3& operator/= (const float t) { x /= t; y /= t; z /= t; return *this; } inline vec3 operator+(const vec3& v) { return vec3(x + v.x, y + v.y, z + v.z); } inline vec3 operator-(const vec3& v) { return vec3(x - v.x, y - v.y, z - v.z); } inline vec3 operator*(const vec3& v) { return vec3(x * v.x, y * v.y, z * v.z); } inline vec3 operator/(const vec3& v) { return vec3(x/v.x, y/v.y, z/v.z); } inline vec3 operator*(const float t) { return vec3(x * t, y * t, z * t); } inline vec3 operator/(const float t) { return vec3(x / t, y / t, z / t); } inline float dot(const vec3& v) { return (x * v.x) + (y * v.y) + (z * v.z); } inline vec3 cross(const vec3& v) { return vec3((y * v.z - z * v.y), (-(x * v.z - z * v.x)), (x * v.y - y * v.x)); } }; inline std::istream& operator>>(std::istream& is, vec3& t) { is >> t.x >> t.y >> t.z; return is; } inline std::ostream& operator<<(std::ostream& os, const vec3& t) { os << "<" << t.x << ", " << t.y << ", " << t.z << ">"; return os; } #endif
#ifndef __wx__LevelMap__ #define __wx__LevelMap__ #include <iostream> #include "cocos2d.h" #include "popwindow.h" #include "CData.h" USING_NS_CC; using namespace std; class LevelMap:public CCLayer { public: CREATE_FUNC(LevelMap); private: ~LevelMap(); virtual bool init(); virtual void registerWithTouchDispatcher(); virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event); virtual void ccTouchMoved(CCTouch* touch, CCEvent* event); virtual void ccTouchEnded(CCTouch* touch, CCEvent* event); void adjustMap(bool isResetLevel); void clkBuilding(CCMenuItemImage * building); CCSize size; CCSprite* mapSp; CCSprite* mapLayer; CCPoint startP; CCPoint movingP; CCPoint endP; CCPoint distanceP; double offsetY; CCMenu* levelsMenu; bool isTouchMenu; int currentLevelId; int currentMap; int mapNum; CCDictionary* levelSpDic; buildingpop* buildpop; Json::Value data; }; #endif /* defined(__wx__LevelMap__) */
// Stack.h - Copyright 2013-2016 Will Cassella, All Rights Reserved #pragma once #include "Array.h" /** First ones in are the last ones out! */ template <typename T> struct Stack final { /////////////////////// /// Information /// public: static constexpr bool CopyConstructorSupported = Array<T>::CopyConstructorSupported; static constexpr bool CopyAssignmentSupported = Array<T>::CopyAssignmentSupported; /////////////////////// /// Inner Types /// public: /** Forward iterator for a mutable Stack */ using Iterator = typename Array<T>::ReverseIterator; /** Forward iterator for an immutable Stack */ using ConstIterator = typename Array<T>::ConstReverseIterator; //////////////////////// /// Constructors /// public: Stack() : _values() { // All done } Stack(const std::initializer_list<T>& init) : _values(init) { // All done } /////////////////// /// Methods /// public: /** Returns the number of elements in this Stack */ FORCEINLINE std::size_t Size() const { return _values.Size(); } /** Returns whether this Stack is empty */ FORCEINLINE bool IsEmpty() const { return _values.IsEmpty(); } /** Returns a reference to the first element in this Stack * WARNING: Check 'IsEmpty()' first */ FORCEINLINE T& Peek() { return _values.Last(); } /** Returns an immutable reference to the first element in this Stack * WARNING: Check 'IsEmpty()' first */ FORCEINLINE const T& Peek() const { return _values.Last(); } /** Puts a new element on the top of this Stack */ template <typename RelatedT, WHERE(std::is_constructible<T, RelatedT>::value)> FORCEINLINE void Push(RelatedT&& item) { _values.Add(std::forward<RelatedT>(item)); } /** Removes the element on the top of this Stack WARNING: Check 'IsEmpty()' first */ FORCEINLINE T Pop() { return _values.RemoveAt(_values.Size() - 1); } /** Deletes all elements in this Stack */ FORCEINLINE void Clear() { _values.Clear(); } /** Iteration Methods */ FORCEINLINE Iterator begin() { return _values.begin(); } FORCEINLINE ConstIterator begin() const { return _values.begin(); } FORCEINLINE Iterator end() { return _values.end(); } FORCEINLINE ConstIterator end() const { return _values.end(); } ///////////////////// /// Operators /// public: Stack& operator=(const std::initializer_list<T>& init) { Clear(); for (const auto& value : init) { Push(value); } return *this; } friend FORCEINLINE bool operator==(const Stack& lhs, const Stack& rhs) { return lhs._values == rhs._values; } friend FORCEINLINE bool operator!=(const Stack& lhs, const Stack& rhs) { return lhs._values != rhs._values; } //////////////// /// Data /// private: Array<T> _values; };
/* --------------------------The MIT License--------------------------- Copyright (c) 2013 Qi Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "event.h" int init_event(int sfd, struct epoll_event* event, struct epoll_event* events) { int s; int efd; if ((efd = epoll_create1 (0)) == -1) { perror ("epoll_create"); abort (); }; event->data.fd = sfd; event->events = EPOLLIN | EPOLLET; if ((s = epoll_ctl (efd, EPOLL_CTL_ADD, sfd, event)) == -1) { perror ("epoll_ctl"); abort (); } events = calloc (MQTTS_MAXEVENTS, sizeof (*event)); return efd; } void add_event(struct epoll_event* event, int efd, int fd, int mask) { /* mask ==> {EPOLLIN,EPOLLOUT} */ int s; event->data.fd = fd; event->events = mask | EPOLLET; if ((s = epoll_ctl (efd, EPOLL_CTL_ADD, fd, event)) == -1) { perror ("epoll_ctl"); abort (); } } void mod_event(struct epoll_event* event, int efd, int fd, int mask) { /* mask ==> {EPOLLIN,EPOLLOUT} */ int s; event->data.fd = fd; event->events = mask | EPOLLET; if ((s = epoll_ctl (efd, EPOLL_CTL_MOD, fd, event)) == -1) { perror ("epoll_ctl"); abort (); } }
#pragma once #include "Vector.h" #include "Matrix.h" #include "AxisIndex.h" #include "../../Engine/cnum.h" // for sincos /** * Mainly used as unit quaternions to describe rotations. * Rotating some vector v with a unit quaternion q works like this: * -# Embed it in R^4: v = (vx,vy,vz,0) * -# Conjugate with q: r(v) = q v q^-1 * * Quaternions derive from P4<double> and use w for the real part; x,y,z for the imaginary part */ class Quaternion : public P4d { public: Quaternion(double x_, double y_, double z_, double w_) : P4d(x_,y_,z_,w_) { } Quaternion operator * (const Quaternion &b) const { return Quaternion(w * b.x + x * b.w + y * b.z - z * b.y, w * b.y - x * b.z + y * b.w + z * b.x, w * b.z + x * b.y - y * b.x + z * b.w, w * b.w - x * b.x - y * b.y - z * b.z); } Quaternion &conjugate() { x = -x; y = -y; z = -z; return *this; } Quaternion operator - () const { return Quaternion(-x, -y, -z, -w); } Quaternion &invert() // multiplicative inverse { double q = -1.0 / absq(); w *= -q; x *= q; y *= q; z *= q; return *this; } Quaternion &to_unit() { P4d::to_unit(); if (!defined(x) || !defined(y) || !defined(z) || !defined(w)) { x = y = z = 0.0; w = 1.0; } return *this; } Quaternion exp() const { double e = std::exp(w); double m = x*x + y*y + z*z; double s, c; sincos(m, s, c); s *= e; c *= e; return Quaternion(s*x, s*y, s*z, c*w); } //--- to and from axis angle --------------------------------------------------------------------------------------- Quaternion(double angle, AxisIndex axis) { switch(axis) { case X_AXIS: sincos(0.5*angle, x, w); y = z = 0.0; break; case Y_AXIS: sincos(0.5*angle, y, w); x = z = 0.0; break; case Z_AXIS: sincos(0.5*angle, z, w); x = y = 0.0; break; } } Quaternion(double angle, const P3d &axis) { double r = axis.abs(); double s; sincos(0.5*angle, s, w); x = axis.x * s / r; y = axis.y * s / r; z = axis.z * s / r; } double axis_angle(P3d &axis) const { //if (a.w > 1.0 || a.w < -1.0) normalize(); double f = 1.0 / abs(); double wf = w*f; double s = sqrt(1.0 - wf*wf); double angle = 2.0 * acos(wf); if (s < 1e-12) { // if s is zero, the direction is not important axis.x = 1.0; axis.y = 0.0; axis.z = 0.0; } else { f /= s; axis.x = x*f; axis.y = y*f; axis.z = z*f; } return angle; } //--- to and from rotation matrix ---------------------------------------------------------------------------------- M3d rotation() const /// Quaternion to rotation matrix { // works for non-normalized ones too double Nq = absq(); double s = (Nq > 0.0) ? 2.0 / Nq : 0.0; double X = x*s, Y = y*s, Z = z*s; double wX = w*X, wY = w*Y, wZ = w*Z; double xX = x*X, xY = x*Y, xZ = x*Z; double yY = y*Y, yZ = y*Z, zZ = z*Z; M3d m; m.a11 = 1.0-(yY+zZ); m.a12 = xY-wZ; m.a13 = xZ+wY; m.a21 = xY+wZ; m.a22 = 1.0-(xX+zZ); m.a23 = yZ-wX; m.a31 = xZ-wY; m.a32 = yZ+wX; m.a33 = 1.0-(xX+yY); return m; } Quaternion(const M3d &m) /// Rotation matrix to quaternion : P4d(copysign(0.5*sqrt(1.0+m.a11-m.a22-m.a33), m.a32-m.a23), copysign(0.5*sqrt(1.0-m.a11+m.a22-m.a33), m.a13-m.a31), copysign(0.5*sqrt(1.0-m.a11-m.a22+m.a33), m.a21-m.a12), 0.5*sqrt(1.0 + m.a11 + m.a22 + m.a33) ) { } }; inline double dotproduct(const Quaternion &a, const Quaternion &b) { return a.P4d::operator* (b); }
#ifndef NETSI_HUB_CLI_VIEW_H #define NETSI_HUB_CLI_VIEW_H #include <list> #include "hardware/Network_State.h" #include "hardware/Hub.h" #include "view/cli/CLI_View.h" #include "view/cli/hardware/Network_State_CLI_View.h" namespace de { namespace njsm { namespace netsi { /** * @brief Command line interface view for controlling a Hub * * This class provides functions for a user to interact with the * Hub that has been selected. * It parses commands for controlling the Hub and returns information * about its success. */ class Hub_CLI_View : public CLI_View { protected: std::shared_ptr<Hub> m_model; /**< The model that is controlled by the view */ std::string m_name; /**< The string representing the Hub */ std::shared_ptr<Network_State_CLI_View> m_network; /**< The network that contains the Hub */ void log(std::list<std::string>); void disable_log(); public: Hub_CLI_View(std::shared_ptr<Hub>, std::shared_ptr<Network_State_CLI_View>, std::string&); virtual ~Hub_CLI_View() = default; virtual void show_state() const override; void show_usage() const; virtual std::string get_identifier() const override; virtual std::shared_ptr<Model> get_model() override; virtual std::shared_ptr<CLI_View> execute_command(std::list<std::string>) override; }; } } } #endif //NETSI_HUB_CLI_VIEW_H
/******************************************************************************** * The MIT License (MIT) * * * * Copyright (C) 2016 Alex Nolasco * * * *Permission is hereby granted, free of charge, to any person obtaining a copy * *of this software and associated documentation files (the "Software"), to deal * *in the Software without restriction, including without limitation the rights * *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * *copies of the Software, and to permit persons to whom the Software is * *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in * *all copies or substantial portions of the Software. * * * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * *THE SOFTWARE. * *********************************************************************************/ #import "HL7NullFlavorElement.h" @interface HL7CodeSystem : HL7NullFlavorElement <NSCopying, NSCoding> - (NSString *_Nullable)code; - (NSString *_Nullable)codeSystem; - (NSString *_Nullable)codeSystemName; - (NSString *_Nullable)displayName; - (BOOL)isCodeSystem:(NSString *_Nonnull)codeSystem; - (BOOL)isCodeSystem:(NSString *_Nonnull)codeSystem withValue:(NSString *_Nonnull)value; @end
#include <sys/iosupport.h> #include <malloc.h> #include <3ds.h> #include "core/clipboard.h" #include "core/screen.h" #include "core/util.h" #include "ui/error.h" #include "ui/mainmenu.h" #include "ui/ui.h" #include "ui/section/task/task.h" #define CURRENT_KPROCESS (*(void**) 0xFFFF9004) #define KPROCESS_PID_OFFSET_OLD (0xB4) #define KPROCESS_PID_OFFSET_NEW (0xBC) static bool backdoor_ran = false; static bool n3ds = false; static u32 old_pid = 0; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wreturn-type" static __attribute__((naked)) Result svcGlobalBackdoor(s32 (*callback)()) { asm volatile( "svc 0x30\n" "bx lr" ); } #pragma GCC diagnostic pop static s32 patch_pid_kernel() { u32 *pidPtr = (u32*) (CURRENT_KPROCESS + (n3ds ? KPROCESS_PID_OFFSET_NEW : KPROCESS_PID_OFFSET_OLD)); old_pid = *pidPtr; *pidPtr = 0; backdoor_ran = true; return 0; } static s32 restore_pid_kernel() { u32 *pidPtr = (u32*) (CURRENT_KPROCESS + (n3ds ? KPROCESS_PID_OFFSET_NEW : KPROCESS_PID_OFFSET_OLD)); *pidPtr = old_pid; backdoor_ran = true; return 0; } static bool attempt_patch_pid() { backdoor_ran = false; APT_CheckNew3DS(&n3ds); svcGlobalBackdoor(patch_pid_kernel); srvExit(); srvInit(); svcGlobalBackdoor(restore_pid_kernel); return backdoor_ran; } static void (*exit_funcs[16])()= {NULL}; static u32 exit_func_count = 0; static void* soc_buffer = NULL; void cleanup_services() { for(u32 i = 0; i < exit_func_count; i++) { if(exit_funcs[i] != NULL) { exit_funcs[i](); exit_funcs[i] = NULL; } } exit_func_count = 0; if(soc_buffer != NULL) { free(soc_buffer); soc_buffer = NULL; } } #define INIT_SERVICE(initStatement, exitFunc) (R_SUCCEEDED(res = (initStatement)) && (exit_funcs[exit_func_count++] = (exitFunc))) Result init_services() { Result res = 0; soc_buffer = memalign(0x1000, 0x100000); if(soc_buffer != NULL) { Handle tempAM = 0; if(R_SUCCEEDED(res = srvGetServiceHandle(&tempAM, "am:net"))) { svcCloseHandle(tempAM); if(INIT_SERVICE(amInit(), amExit) && INIT_SERVICE(cfguInit(), cfguExit) && INIT_SERVICE(acInit(), acExit) && INIT_SERVICE(ptmuInit(), ptmuExit) && INIT_SERVICE(pxiDevInit(), pxiDevExit) && INIT_SERVICE(httpcInit(0), httpcExit) && INIT_SERVICE(socInit(soc_buffer, 0x100000), (void (*)()) socExit)); } } else { res = R_FBI_OUT_OF_MEMORY; } if(R_FAILED(res)) { cleanup_services(); } return res; } static u32 old_time_limit = UINT32_MAX; void init() { gfxInitDefault(); Result romfsRes = romfsInit(); if(R_FAILED(romfsRes)) { util_panic("Failed to mount RomFS: %08lX", romfsRes); return; } if(R_FAILED(init_services())) { if(!attempt_patch_pid()) { util_panic("Kernel backdoor not installed.\nPlease run a kernel exploit and try again."); return; } Result initRes = init_services(); if(R_FAILED(initRes)) { util_panic("Failed to initialize services: %08lX", initRes); return; } } osSetSpeedupEnable(true); APT_GetAppCpuTimeLimit(&old_time_limit); Result cpuRes = APT_SetAppCpuTimeLimit(30); if(R_FAILED(cpuRes)) { util_panic("Failed to set syscore CPU time limit: %08lX", cpuRes); return; } AM_InitializeExternalTitleDatabase(false); screen_init(); ui_init(); task_init(); } void cleanup() { clipboard_clear(); task_exit(); ui_exit(); screen_exit(); if(old_time_limit != UINT32_MAX) { APT_SetAppCpuTimeLimit(old_time_limit); } osSetSpeedupEnable(false); cleanup_services(); romfsExit(); gfxExit(); } int main(int argc, const char* argv[]) { if(argc > 0 && envIsHomebrew()) { util_set_3dsx_path(argv[0]); } init(); mainmenu_open(); while(aptMainLoop() && ui_update()); cleanup(); return 0; }
/** * REXUS PIOneERS - Pi_1 * UART.h * Purpose: Function definitions for the UART class * * @author David Amison * @version 2.2 12/10/2017 */ #include <stdlib.h> #include <string> #include <error.h> #include "comms/pipes.h" #include "comms/transceiver.h" #include "logger/logger.h" #ifndef UART_H #define UART_H class UART { protected: int uart_filestream; private: int _baudrate; public: UART(int baudrate) { _baudrate = baudrate; setupUART(); } /** * Basic setup for UART communication protocol */ void setupUART(); ~UART(); }; class RXSM : public UART, public comms::Transceiver { Logger Log; int _index = 0; comms::Pipe _pipes; int _pid = 0; public: RXSM(int baudrate = 38400) : UART(baudrate), comms::Transceiver(uart_filestream), Log("/Docs/Logs/RXSM") { Log.start_log(); Log("INFO") << "Creating RXSM object"; return; } int sendMsg(std::string msg); int sendPacket(comms::Packet &p); int recvPacket(comms::Packet &p); bool status(); ~RXSM() { Log("INFO") << "Destroying RXSM object"; } void buffer(); void end_buffer(); }; class ImP : public UART { Logger Log; comms::Pipe _pipes; int _pid; public: ImP(int baudrate = 38400) : UART(baudrate), Log("/Docs/Logs/ImP") { Log.start_log(); return; } /** * Collect and save data from the ImP. Returned pipe receives all data from * the ImP as well. * * @param filename: Place to save data * @return Pipe for sending and receiving data. */ comms::Pipe startDataCollection(const std::string filename); bool status(); /** * Stop the process collecting data. * @return 0 = success, otherwise = failure */ int stopDataCollection(); }; class UARTException { public: UARTException(std::string error) { _error = error + " :" + std::strerror(errno); } const char * what() { return _error.c_str(); } private: std::string _error; }; #endif /* UART_H */
#ifndef __GL_GEOM #define __GL_GEOM #include "math.h" #include "r_defs.h" class Vector { public: Vector() { SetX(0.f); SetY(1.f); SetZ(0.f); m_length = 1.f; } Vector(float x, float y, float z) { SetX(x); SetY(y); SetZ(z); m_length=-1.0f; } Vector(float *v) { SetX(v[0]); SetY(v[1]); SetZ(v[2]); m_length=-1.0f; } Vector(vertex_t * v) { SetX(v->fx); SetY(v->fy); SetZ(0); } void Normalize() { float l = 1.f / Length(); SetX(X() * l); SetY(Y() * l); SetZ(Z() * l); m_length=1.0f; } void UpdateLength() { m_length = sqrtf((X() * X()) + (Y() * Y()) + (Z() * Z())); } void Set(float *v) { SetX(v[0]); SetY(v[1]); SetZ(v[2]); m_length=-1.0f; } void Set(float x, float y, float z) { SetX(x); SetY(y); SetZ(z); m_length=-1.0f; } float Length() { if (m_length<0.0f) UpdateLength(); return m_length; } float Dist(Vector &v) { Vector t(X() - v.X(), Y() - v.Y(), Z() - v.Z()); return t.Length(); } float Dot(Vector &v) { return (X() * v.X()) + (Y() * v.Y()) + (Z() * v.Z()); } Vector Cross(Vector &v); Vector operator- (Vector &v); Vector operator+ (Vector &v); Vector operator* (float f); Vector operator/ (float f); bool operator== (Vector &v); bool operator!= (Vector &v) { return !((*this) == v); } void GetRightUp(Vector &up, Vector &right); float operator[] (int index) const { return m_vec[index]; } float &operator[] (int index) { return m_vec[index]; } float X() const { return m_vec[0]; } float Y() const { return m_vec[1]; } float Z() const { return m_vec[2]; } void SetX(float x) { m_vec[0] = x; } void SetY(float y) { m_vec[1] = y; } void SetZ(float z) { m_vec[2] = z; } void Scale(float scale); Vector ProjectVector(Vector &a); Vector ProjectPlane(Vector &right, Vector &up); protected: float m_vec[3]; float m_length; }; class Plane { public: Plane() { m_normal.Set(0.f, 1.f, 0.f); m_d = 0.f; } void Init(float *v1, float *v2, float *v3); void Init(float a, float b, float c, float d); void Init(float *verts, int numVerts); void Set(secplane_t &plane); float DistToPoint(float x, float y, float z); bool PointOnSide(float x, float y, float z); bool PointOnSide(Vector &v) { return PointOnSide(v.X(), v.Y(), v.Z()); } bool ValidNormal() { return m_normal.Length() == 1.f; } float A() { return m_normal.X(); } float B() { return m_normal.Y(); } float C() { return m_normal.Z(); } float D() { return m_d; } const Vector &Normal() const { return m_normal; } protected: Vector m_normal; float m_d; }; class Matrix3x4 // used like a 4x4 matrix with the last row always being (0,0,0,1) { float m[3][4]; public: void MakeIdentity() { memset(m, 0, sizeof(m)); m[0][0] = m[1][1] = m[2][2] = 1.f; } void Translate(float x, float y, float z) { m[0][3] = m[0][0]*x + m[0][1]*y + m[0][2]*z + m[0][3]; m[1][3] = m[1][0]*x + m[1][1]*y + m[1][2]*z + m[1][3]; m[2][3] = m[2][0]*x + m[2][1]*y + m[2][2]*z + m[2][3]; } void Scale(float x, float y, float z) { m[0][0] *=x; m[1][0] *=x; m[2][0] *=x; m[0][1] *=y; m[1][1] *=y; m[2][1] *=y; m[0][2] *=z; m[1][2] *=z; m[2][2] *=z; } void Rotate(float ax, float ay, float az, float angle) { Matrix3x4 m1; Vector axis(ax, ay, az); axis.Normalize(); double c = cos(angle * M_PI/180.), s = sin(angle * M_PI/180.), t = 1 - c; double sx = s*axis.X(), sy = s*axis.Y(), sz = s*axis.Z(); double tx, ty, txx, tyy, u, v; tx = t*axis.X(); m1.m[0][0] = float( (txx=tx*axis.X()) + c ); m1.m[0][1] = float( (u=tx*axis.Y()) - sz); m1.m[0][2] = float( (v=tx*axis.Z()) + sy); ty = t*axis.Y(); m1.m[1][0] = float( u + sz); m1.m[1][1] = float( (tyy=ty*axis.Y()) + c ); m1.m[1][2] = float( (u=ty*axis.Z()) - sx); m1.m[2][0] = float( v - sy); m1.m[2][1] = float( u + sx); m1.m[2][2] = float( (t-txx-tyy) + c ); m1.m[0][3] = 0.f; m1.m[1][3] = 0.f; m1.m[2][3] = 0.f; *this = (*this) * m1; } Matrix3x4 operator *(const Matrix3x4 &other) { Matrix3x4 result; result.m[0][0] = m[0][0]*other.m[0][0] + m[0][1]*other.m[1][0] + m[0][2]*other.m[2][0]; result.m[0][1] = m[0][0]*other.m[0][1] + m[0][1]*other.m[1][1] + m[0][2]*other.m[2][1]; result.m[0][2] = m[0][0]*other.m[0][2] + m[0][1]*other.m[1][2] + m[0][2]*other.m[2][2]; result.m[0][3] = m[0][0]*other.m[0][3] + m[0][1]*other.m[1][3] + m[0][2]*other.m[2][3] + m[0][3]; result.m[1][0] = m[1][0]*other.m[0][0] + m[1][1]*other.m[1][0] + m[1][2]*other.m[2][0]; result.m[1][1] = m[1][0]*other.m[0][1] + m[1][1]*other.m[1][1] + m[1][2]*other.m[2][1]; result.m[1][2] = m[1][0]*other.m[0][2] + m[1][1]*other.m[1][2] + m[1][2]*other.m[2][2]; result.m[1][3] = m[1][0]*other.m[0][3] + m[1][1]*other.m[1][3] + m[1][2]*other.m[2][3] + m[1][3]; result.m[2][0] = m[2][0]*other.m[0][0] + m[2][1]*other.m[1][0] + m[2][2]*other.m[2][0]; result.m[2][1] = m[2][0]*other.m[0][1] + m[2][1]*other.m[1][1] + m[2][2]*other.m[2][1]; result.m[2][2] = m[2][0]*other.m[0][2] + m[2][1]*other.m[1][2] + m[2][2]*other.m[2][2]; result.m[2][3] = m[2][0]*other.m[0][3] + m[2][1]*other.m[1][3] + m[2][2]*other.m[2][3] + m[2][3]; return result; } Vector operator *(const Vector &vec) { Vector result; result.SetX(vec.X()*m[0][0] + vec.Y()*m[0][1] + vec.Z()*m[0][2] + m[0][3]); result.SetY(vec.X()*m[1][0] + vec.Y()*m[1][1] + vec.Z()*m[1][2] + m[1][3]); result.SetZ(vec.X()*m[2][0] + vec.Y()*m[2][1] + vec.Z()*m[2][2] + m[2][3]); return result; } void MultiplyVector(float *f3 , float *f3o) { float x = f3[0] * m[0][0] + f3[1] * m[0][1] + f3[2] * m[0][2] + m[0][3]; float y = f3[0] * m[1][0] + f3[1] * m[1][1] + f3[2] * m[1][2] + m[1][3]; float z = f3[0] * m[2][0] + f3[1] * m[2][1] + f3[2] * m[2][2] + m[2][3]; f3o[2] = z; f3o[1] = y; f3o[0] = x; } }; #endif
///////////////////////////////////////////////////////////////////////////// // Name: wx/unix/private/sockunix.h // Purpose: wxSocketImpl implementation for Unix systems // Authors: Guilhem Lavaux, Vadim Zeitlin // Created: April 1997 // Copyright: (c) 1997 Guilhem Lavaux // (c) 2008 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_UNIX_GSOCKUNX_H_ # define _WX_UNIX_GSOCKUNX_H_ # include <unistd.h> # include <sys/ioctl.h> // Under older (Open)Solaris versions FIONBIO is declared in this header only. // In the newer versions it's included by sys/ioctl.h but it's simpler to just // include it always instead of testing for whether it is or not. # ifdef __SOLARIS__ # include <sys/filio.h> # endif # include "wx/private/fdiomanager.h" # define wxCloseSocket close class wxSocketImplUnix : public wxSocketImpl, public wxFDIOHandler { public: wxSocketImplUnix(wxSocketBase& wxsocket) : wxSocketImpl(wxsocket) { m_fds[0] = m_fds[1] = -1; } wxSocketError GetLastError() const override; void ReenableEvents(wxSocketEventFlags flags) override { // Events are only ever used for non-blocking sockets. if (GetSocketFlags() & wxSOCKET_BLOCK) { return ; } // enable the notifications about input/output being available again in // case they were disabled by OnRead/WriteWaiting() // // notice that we'd like to enable the events here only if there is // nothing more left on the socket right now as otherwise we're going // to get a "ready for whatever" notification immediately (well, during // the next event loop iteration) and disable the event back again // which is rather inefficient but unfortunately doing it like this // doesn't work because the existing code (e.g. src/common/sckipc.cpp) // expects to keep getting notifications about the data available from // the socket even if it didn't read all the data the last time, so we // absolutely have to continue generating them EnableEvents(flags); } void UpdateBlockingState() override { // Make this int and not bool to allow passing it to ioctl(). int isNonBlocking = (GetSocketFlags() & wxSOCKET_BLOCK) == 0; ioctl(m_fd, FIONBIO, &isNonBlocking); DoEnableEvents(wxSOCKET_INPUT_FLAG | wxSOCKET_OUTPUT_FLAG, isNonBlocking); } // wxFDIOHandler methods void OnReadWaiting() override; void OnWriteWaiting() override; void OnExceptionWaiting() override; bool IsOk() const override { return m_fd != INVALID_SOCKET; } private: void DoClose() override { DisableEvents(); wxCloseSocket(m_fd); } // enable or disable notifications for socket input/output events void EnableEvents(int flags = wxSOCKET_INPUT_FLAG | wxSOCKET_OUTPUT_FLAG) { DoEnableEvents(flags, true); } void DisableEvents(int flags = wxSOCKET_INPUT_FLAG | wxSOCKET_OUTPUT_FLAG) { DoEnableEvents(flags, false); } // really enable or disable socket input/output events void DoEnableEvents(int flags, bool enable); protected: // descriptors for input and output event notification channels associated // with the socket int m_fds[2]; private: // notify the associated wxSocket about a change in socket state and shut // down the socket if the event is wxSOCKET_LOST void OnStateChange(wxSocketNotify event); // check if there is any input available, return 1 if yes, 0 if no or -1 on // error int CheckForInput(); // give it access to our m_fds friend class wxSocketFDBasedManager; }; // A version of wxSocketManager which uses FDs for socket IO: it is used by // Unix console applications and some X11-like ports (wxGTK and wxMotif but not // wxX11 currently) which implement their own port-specific wxFDIOManagers class wxSocketFDBasedManager : public wxSocketManager { public: wxSocketFDBasedManager() { m_fdioManager = NULL; } bool OnInit() override; void OnExit() override { } wxSocketImpl* CreateSocket(wxSocketBase& wxsocket) override { return new wxSocketImplUnix(wxsocket); } void Install_Callback(wxSocketImpl* socket_, wxSocketNotify event) override; void Uninstall_Callback(wxSocketImpl* socket_, wxSocketNotify event) override; protected: // get the FD index corresponding to the given wxSocketNotify wxFDIOManager::Direction GetDirForEvent(wxSocketImpl* socket, wxSocketNotify event); // access the FDs we store int& FD(wxSocketImplUnix* socket, wxFDIOManager::Direction d) { return socket->m_fds[d]; } wxFDIOManager* m_fdioManager; wxDECLARE_NO_COPY_CLASS(wxSocketFDBasedManager); }; #endif
/**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QT3DCORE_QTRANSFORM_P_H #define QT3DCORE_QTRANSFORM_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <private/qcomponent_p.h> QT_BEGIN_NAMESPACE namespace Qt3DCore { class QTransformPrivate : public QComponentPrivate { Q_DECLARE_PUBLIC(QTransform) public: QTransformPrivate(); ~QTransformPrivate(); // Stored in this order as QQuaternion is bigger than QVector3D // Operations are applied in the order of: // scale, rotation, translation QQuaternion m_rotation; QVector3D m_scale; QVector3D m_translation; QVector3D m_eulerRotationAngles; mutable QMatrix4x4 m_matrix; mutable bool m_matrixDirty; }; struct QTransformData { QQuaternion rotation; QVector3D scale; QVector3D translation; }; } // namespace Qt3DCore QT_END_NAMESPACE #endif // QT3DCORE_QTRANSFORM_P_H
struct stat; struct rtcdate; // system calls int date(struct rtcdate*); int fork(void); int exit(void) __attribute__((noreturn)); int wait(void); int pipe(int*); int write(int, void*, int); int read(int, void*, int); int close(int); int kill(int); int exec(char*, char**); int open(char*, int); int mknod(char*, short, short); int unlink(char*); int fstat(int fd, struct stat*); int link(char*, char*); int mkdir(char*); int chdir(char*); int dup(int); int getpid(void); char* sbrk(int); int sleep(int); int uptime(void); int alarm(int ticks, void (*handler)()); // ulib.c int stat(char*, struct stat*); char* strcpy(char*, char*); void *memmove(void*, void*, int); char* strchr(const char*, char c); int strcmp(const char*, const char*); void printf(int, char*, ...); char* gets(char*, int max); uint strlen(char*); void* memset(void*, int, uint); void* malloc(uint); void free(void*); int atoi(const char*);
#include <stdio.h> int len(char * s1, char * s2); int main() { char * s1 = "hello"; char * s2 = "strng"; printf("%d", len(s1, s2)); } int len(char * s1, char * s2) { int counter = 0; while ((*s1) != '\0' && (*s2) != '\0') { counter += 2; s1++; s2++; } while ((*s1) != '\0') { counter++; s1++; } while ((*s2) != '\0') { counter++; s2++; } return counter; }
/* Copyright (c) 2015 Johnny Dickinson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #ifdef _WIN32 #define NOMINMAX #include <Windows.h> #define semaphore_t HANDLE #else #include <semaphore.h> #define semaphore_t sem_t #endif #include <iostream> class Semaphore{ protected: semaphore_t s; int id; public: Semaphore(int initialCount){ static int num; #ifdef _WIN32 s = CreateSemaphore(NULL,0,initialCount,NULL); #else sem_init(&s,0,initialCount); #endif id = num; num++; } ~Semaphore(){ #ifdef _WIN32 CloseHandle(s); #else sem_destroy(&s); #endif } inline bool wait(){ #ifdef _WIN32 return 0==WaitForSingleObject(s,INFINITE); #else //return 0==sem_wait(&s); int result = sem_wait(&s); if(result != 0){ std::cout << "sem_wait failed: "; switch(errno){ case EINTR: std::cout << "interrupted"; break; case EINVAL: std::cout << "not a valid semaphore"; break; case EAGAIN: std::cout << "would block"; break; default: std::cout << errno; } return false; } return true; #endif } inline void post(){ #ifdef _WIN32 ReleaseSemaphore(s,1,NULL); #else sem_post(&s); #endif //std::cout << "posting 1 to sem " << id << std::endl; } void post(int count){ #ifdef _WIN32 ReleaseSemaphore(s,count,NULL); #else for(int i=0;i<count;i++){ sem_post(&s); } #endif //std::cout << "posting " << count << " to sem " << id << std::endl; } };
// // AppDelegate.h // DTKitDemo // // Created by ddhjy on 15/9/29. // Copyright © 2015年 ddhjy. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // ITorchManager.h // CardRecognizer // // Created by Vladimir Tchernitski on 20/01/16. // Copyright © 2016 Vladimir Tchernitski. All rights reserved. // #ifndef ITorchManager_h #define ITorchManager_h #include "IBaseObj.h" using namespace std; class ITorchDelegate; class ITorchManager : public IBaseObj { public: virtual ~ITorchManager() {} public: virtual void SetDelegate(const shared_ptr<ITorchDelegate>& delegate) = 0; virtual void SetStatus(bool status) = 0; virtual bool GetStatus() const = 0; virtual void IncrementCounter() = 0; virtual void ResetCounter() = 0; }; #endif /* ITorchManager_h */
// The MIT License (MIT) // Copyright (c) 2013 lailongwei<lailongwei@126.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __LLBC_OBJBASE_OBJECT_MACRO_H__ #define __LLBC_OBJBASE_OBJECT_MACRO_H__ #include "llbc/common/Common.h" __LLBC_NS_BEGIN // Object release macro, use for release object(not reset to nullptr after released). #define LLBC_Release(o) \ o->Release() \ // Object release macro, it check object and reset to nullptr after released. #define LLBC_XRelease(o) \ do { \ if (LIKELY(o)) { \ o->Release(); \ o = nullptr; \ } \ } while(0) \ // Object auto-release macro, use for auto release object(not reset to nullptr after auto-released). #define LLBC_AutoRelease(o) \ o->AutoRelease() \ // Object auto-release macro, it check object and reset to nullptr after auto-released. #define LLBC_XAutoRelease(o) \ do { \ if (LIKELY(o)) { \ o->AutoRelease(); \ o = nullptr; \ } \ } while (0) \ __LLBC_NS_END #endif // !__LLBC_OBJBASE_OBJECT_MACRO_H__
#pragma once // Each added app must include config.h void configRedraw(); extern GColor backColor; extern GColor foreColor; extern Layer *rootLayer; extern int dateStyle; #define ENTRYPOINTS(NAME) void redraw_ ## NAME (); void load_ ## NAME (); void unload_ ## NAME (); ENTRYPOINTS(words) ENTRYPOINTS(retro) ENTRYPOINTS(Perspective) ENTRYPOINTS(bit) ENTRYPOINTS(ill) ENTRYPOINTS(fuzzy) ENTRYPOINTS(toe)
// // AppDelegate.h // test0705 // Copyright © 2018年 lion. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // AppDelegate.h // FlyingDB // // Created by Paul Lee on 8/11/13. // Copyright (c) 2013 Paul Lee. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#ifndef defs_h #define defs_h #ifdef GB_INTERNAL // "Keyword" definitions #define likely(x) __builtin_expect((bool)(x), 1) #define unlikely(x) __builtin_expect((bool)(x), 0) #define internal __attribute__((visibility("internal"))) #if __clang__ #define unrolled _Pragma("unroll") #elif __GNUC__ >= 8 #define unrolled _Pragma("GCC unroll 8") #else #define unrolled #endif #define unreachable() __builtin_unreachable(); #define nodefault default: unreachable() #ifdef GB_BIG_ENDIAN #define LE16(x) __builtin_bswap16(x) #define LE32(x) __builtin_bswap32(x) #define LE64(x) __builtin_bswap64(x) #define BE16(x) (x) #define BE32(x) (x) #define BE64(x) (x) #else #define LE16(x) (x) #define LE32(x) (x) #define LE64(x) (x) #define BE16(x) __builtin_bswap16(x) #define BE32(x) __builtin_bswap32(x) #define BE64(x) __builtin_bswap64(x) #endif #endif #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) #define __builtin_bswap16(x) ({ typeof(x) _x = (x); _x >> 8 | _x << 8; }) #endif struct GB_gameboy_s; typedef struct GB_gameboy_s GB_gameboy_t; #endif
// AppDelegate.h // // Copyright (c) 2015 Auth0 (http://auth0.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#ifndef SDCARD_H_ #define SDCARD_H_ #include "NES.h" void load_rom(); #endif /* SDCARD_H_ */
///////////////////////////////////////////////////////////////////////////////////////////// // File: Rake.h // // Author: Liya Li // // Date: July 2005 // // Description: This class is used to generate seed in the flow field. Currently, all rakes // are axis-aligned. ///////////////////////////////////////////////////////////////////////////////////////////// #ifndef _RAKE_h_ #define _RAKE_h_ #include "header.h" #include "VectorMatrix.h" #include "Interpolator.h" enum RakeDim { LINE, PLANE, SOLID }; class SeedGenerator { public: SeedGenerator(const float min[3], const float max[3], const size_t numSeeds[3]); ~SeedGenerator(); void SetRakeDim(void); size_t GetRakeDim(void); void GetSeeds(VECTOR3* pSeeds, const bool bRandom); void GetSeeds(VECTOR3* pSeeds, vector<VECTOR3>& pPointSets); private: float rakeMin[3], rakeMax[3]; // minimal and maximal positions size_t numSeeds[3]; // number of seeds int rakeDimension; // 0, 1, 2, 3 }; class Rake { public: virtual void GenSeedRandom( const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed) = 0; virtual void GenSeedRegular(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed) = 0; }; class LineRake : public Rake { public: LineRake(); void GenSeedRandom(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed); void GenSeedRegular(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed); ~LineRake(); }; class PlaneRake : public Rake { public: PlaneRake(); void GenSeedRandom(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed); void GenSeedRegular(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed); ~PlaneRake(); }; class SolidRake : public Rake { public: SolidRake(); void GenSeedRandom(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed); void GenSeedRegular(const size_t numSeeds[3], const float min[3], const float max[3], VECTOR3* pSeed); ~SolidRake(); }; #endif
#ifndef _ALVISION_ALIGN_EXPOSURE_H_ #define _ALVISION_ALIGN_EXPOSURE_H_ #include "../../alvision.h" #include "../core/Algorithm.h" class AlignExposures : public Algorithm { public: static void Init(Handle<Object> target, std::shared_ptr<overload_resolution> overload); static Nan::Persistent<FunctionTemplate> constructor; virtual v8::Local<v8::Function> get_constructor(); static POLY_METHOD(New); static POLY_METHOD(process); }; #endif
// // ScanAnnotation.h // iPokeGo // // Created by Dimitri Dessus on 25/07/2016. // Copyright © 2016 Dimitri Dessus. All rights reserved. // #import <MapKit/MapKit.h> @interface ScanAnnotation : MKPointAnnotation @property double latitude; @property double longitude; @end
// // UILabel+Display.h // FindSomething // // Created by qifan.zhang on 2017/3/23. // Copyright © 2017年 qifan.zhang. All rights reserved. // #import <UIKit/UIKit.h> @interface UILabel (Display) - (void)show; - (void)hide; - (BOOL)isShow; - (void)replace:(BOOL)re; @end
// // AppDelegate.h // TextKit // // Created by Gao on 3/25/17. // Copyright © 2017 leave. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "TVSCVVVerificationOperation.h" #import "PBTextEntryViewControllerDelegate.h" @class NSString; @interface PBCVVVerificationOperation : TVSCVVVerificationOperation <PBTextEntryViewControllerDelegate> { CDUnknownBlockType _completion; // 120 = 0x78 } @property(copy, nonatomic) CDUnknownBlockType completion; // @synthesize completion=_completion; - (void).cxx_destruct; // IMP=0x000000010001fc88 - (void)textEntryDidCancel:(id)arg1; // IMP=0x000000010001fbac - (void)textEntry:(id)arg1 didSelectButtonAtIndex:(unsigned long long)arg2; // IMP=0x000000010001faa0 - (void)presentFailureAlertWithTitle:(id)arg1 message:(id)arg2 completion:(CDUnknownBlockType)arg3; // IMP=0x000000010001f6f8 - (void)presentAlertWithTitle:(id)arg1 message:(id)arg2 completion:(CDUnknownBlockType)arg3; // IMP=0x000000010001f42c // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
/******************************************************************************* The content of this file includes portions of the AUDIOKINETIC Wwise Technology released in source code form as part of the SDK installer package. Commercial License Usage Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology may use this file in accordance with the end user license agreement provided with the software or, alternatively, in accordance with the terms contained in a written agreement between you and Audiokinetic Inc. Version: v2017.1.2 Build: 6361 Copyright (c) 2006-2017 Audiokinetic Inc. *******************************************************************************/ ////////////////////////////////////////////////////////////////////// // // AkFilePackageLowLevelIODeferred.h // // Extends the CAkDefaultIOHookDeferred low level I/O hook with File // Package handling functionality. // // See AkDefaultIOHookBlocking.h for details on using the deferred // low level I/O hook. // // See AkFilePackageLowLevelIO.h for details on using file packages. // ////////////////////////////////////////////////////////////////////// #ifndef _AK_FILE_PACKAGE_LOW_LEVEL_IO_DEFERRED_H_ #define _AK_FILE_PACKAGE_LOW_LEVEL_IO_DEFERRED_H_ #include "../Common/AkFilePackageLowLevelIO.h" #include "AkDefaultIOHookDeferred.h" class CAkFilePackageLowLevelIODeferred : public CAkFilePackageLowLevelIO<CAkDefaultIOHookDeferred> { public: CAkFilePackageLowLevelIODeferred() {} virtual ~CAkFilePackageLowLevelIODeferred() {} // Override Cancel: The Windows platform SDK only permits cancellations of all transfers // for a given file handle. Since the packaged files share the same handle, we cannot do this. virtual void Cancel( AkFileDesc & in_fileDesc, // File descriptor. AkAsyncIOTransferInfo & io_transferInfo, // Transfer info to cancel. bool & io_bCancelAllTransfersForThisFile // Flag indicating whether all transfers should be cancelled for this file (see notes in function description). ) { if ( !IsInPackage( in_fileDesc ) ) { CAkDefaultIOHookDeferred::Cancel( in_fileDesc, // File descriptor. io_transferInfo, // Transfer info to cancel. io_bCancelAllTransfersForThisFile // Flag indicating whether all transfers should be cancelled for this file (see notes in function description). ); } } }; #endif //_AK_FILE_PACKAGE_LOW_LEVEL_IO_DEFERRED_H_
/* * Simple example of using Brotli C library for round-trip compress/decompress */ #include <stdint.h> // uint8_t. etc. #include <stdio.h> // fprintf, perror, fopen, etc. #include <stdlib.h> // malloc, free, exit #include <string.h> // strlen, strcat, memset, strerror // presumes Brotli library (with headers) is installed #include <brotli/encode.h> #include <brotli/decode.h> static void* malloc_orDie(size_t size) { void* const buff = malloc(size); if (buff) return buff; /* error */ perror(NULL); exit(3); } int main(int argc, const char** argv) { const char* const exeName = argv[0]; if (argc!=2) { printf("wrong arguments\n"); printf("usage:\n"); printf("%s DATA_TO_COMPRESS\n", exeName); return 1; } const uint8_t* const input_buffer = (uint8_t*)argv[1]; // Get the size of the input_buffer we wish to compress size_t input_size = strlen(argv[1]); // Calculate upper bound for size of compressed data given the size of the uncompressed input_buffer size_t const maxCompressedSize = BrotliEncoderMaxCompressedSize(input_size); // Allocate a buffer to hold the compressed data void* const encoded_buffer = malloc_orDie(maxCompressedSize); // The higher the quality, the slower the compression (and higher compression ratio). Range is from 0 to 11 int quality = BROTLI_DEFAULT_QUALITY; // Recommended sliding LZ77 window size. Encoder may reduce this value. Range is from 10 to 24 bits. int lgwin = BROTLI_DEFAULT_WINDOW; // Compression mode. Options are: BROTLI_MODE_GENERIC, BROTLI_MODE_TEXT (UTF-8 formatted text), or BROTLI_MODE_FONT BrotliEncoderMode mode = BROTLI_DEFAULT_MODE; // in: size of @p encoded_buffer; out: length of compressed data written to encoded_buffer size_t encoded_size = maxCompressedSize; // Performs one-shot memory-to-memory compression BROTLI_BOOL success = BrotliEncoderCompress(quality, lgwin, mode, input_size, input_buffer, &encoded_size, encoded_buffer); if (success != BROTLI_TRUE || encoded_size == 0) { fprintf(stderr, "error compressing '%s'\n", input_buffer); exit(8); } // TODO: Calculate the size for the decompressed data in a general way size_t maxDecompressedSize = input_size; // Allocate a buffer for the reconstructed data void* const decoded_buffer = malloc_orDie(maxDecompressedSize); // in: size of @p decoded_buffer; out: length of decompressed data written to decoded_buffer size_t decoded_size = maxDecompressedSize; // Performs one-shot memory-to-memory decompression BrotliDecoderResult result = BrotliDecoderDecompress(encoded_size, encoded_buffer, &decoded_size, decoded_buffer); if (BROTLI_DECODER_RESULT_SUCCESS != result) { fprintf(stderr, "error decompressing\n"); exit(7); } printf("Brotli compression ratio: %.3g\n", ((float)decoded_size)/encoded_size); free(encoded_buffer); free(decoded_buffer); return 0; }
#include "macros.h" #ifdef __cplusplus using namespace std; #endif EXTERN void* vrpn_Connection_New(int port); EXTERN void vrpn_Connection_Mainloop(void* conn);
// // DBMetadata.h // DropboxSDK // // Created by Brian Smith on 5/3/10. // Copyright 2010 Dropbox, Inc. All rights reserved. // @interface DBMetadata : NSObject <NSCoding> { BOOL thumbnailExists; long long totalBytes; NSDate* lastModifiedDate; NSDate *clientMtime; // file's mtime for display purposes only NSString* path; BOOL isDirectory; NSArray* contents; NSString* hash; NSString* humanReadableSize; NSString* root; NSString* icon; NSString* rev; long long revision; // Deprecated; will be removed in version 2. Use rev whenever possible BOOL isDeleted; NSString *filename; } - (id)initWithDictionary:(NSDictionary*)dict; @property (nonatomic, readonly) BOOL thumbnailExists; @property (nonatomic, readonly) long long totalBytes; @property (nonatomic, readonly) NSDate* lastModifiedDate; @property (nonatomic, readonly) NSDate* clientMtime; @property (nonatomic, readonly) NSString* path; @property (nonatomic, readonly) BOOL isDirectory; @property (nonatomic, readonly) NSArray* contents; @property (nonatomic, readonly) NSString* hash; @property (nonatomic, readonly) NSString* humanReadableSize; @property (nonatomic, readonly) NSString* root; @property (nonatomic, readonly) NSString* icon; @property (nonatomic, readonly) long long revision; // Deprecated, use rev instead @property (nonatomic, readonly) NSString* rev; @property (nonatomic, readonly) BOOL isDeleted; @property (nonatomic, readonly) NSString* filename; @property (nonatomic, readonly) NSInteger videoDuration; @end
// // RSContainer.h // CloudFilesSDKDemo // // Created by Mike Mayo on 10/25/11. // Copyright (c) 2011 Rackspace. All rights reserved. // #import "RSModel.h" @class RSStorageObject; /** The RSContainer class represents a container in your Cloud Files account. * A container is a storage compartment for your data and provides a way for you * to organize your data. You can think of a container as a folder, but unlike a folder, * it cannot be nested. * * Files stored in your account must be stored in a container. */ @interface RSContainer : RSModel /** The number of bytes used in the container */ @property (nonatomic) NSUInteger bytes; /** The number of files stored in the container */ @property (nonatomic) NSUInteger count; /** The name of the container */ @property (nonatomic, strong) NSString *name; /** Optional metadata associated with the container. Keys and values for the metadata * are strings. */ @property (nonatomic, strong) NSMutableDictionary *metadata; #pragma mark Get Objects /** Returns a request object that represents a request to retrieve a list of objects in the container */ - (NSURLRequest *)getObjectsRequest; /** Returns a request object that represents a request to retrieve a list of objects in the container. * * Possible parameters: * * limit: For an integer value n, limits the number of results to at most n values. marker Given a string value x, return object names greater in value than the specified marker. * * prefix: For a string value x, causes the results to be limited to object names beginning with the substring x. * * path: For a string value x, return the object names nested in the pseudo path (assuming preconditions are met - see below). * * delimiter: For a character c, return all the object names nested in the container (without the need for the directory marker objects). * @param params Request parameters */ - (NSURLRequest *)getObjectsRequest:(NSDictionary *)params; /** Retrieves a list of objects in the container. * @param successHandler Executes if successful * @param failureHandler Executes if not successful */ - (void)getObjects:(void (^)(NSArray *objects, NSError *jsonError))successHandler failure:(void (^)(NSHTTPURLResponse*, NSData*, NSError*))failureHandler; /** Returns a request object that represents a request to upload a file into the container * @param object The file to upload */ - (NSURLRequest *)uploadObjectRequest:(RSStorageObject *)object; /** Uploads a file into the container. * @param object The file to upload * @param successHandler Executes if successful * @param failureHandler Executes if not successful */ - (void)uploadObject:(RSStorageObject *)object success:(void (^)())successHandler failure:(void (^)(NSHTTPURLResponse*, NSData*, NSError*))failureHandler; /** Uploads a file into the container from the local filesystem. * @param object The file to upload * @param path The path for the file's data on the local filesystem * @param successHandler Executes if successful * @param failureHandler Executes if not successful */ - (void)uploadObject:(RSStorageObject *)object fromFile:(NSString *)path success:(void (^)())successHandler failure:(void (^)(NSHTTPURLResponse*, NSData*, NSError*))failureHandler; /** Returns a request object that represents a request to delete a file in the container * @param object The file to delete */ - (NSURLRequest *)deleteObjectRequest:(RSStorageObject *)object; /** Deletes a file in the container. * @param object The file to delete * @param successHandler Executes if successful * @param failureHandler Executes if not successful */ - (void)deleteObject:(RSStorageObject *)object success:(void (^)())successHandler failure:(void (^)(NSHTTPURLResponse*, NSData*, NSError*))failureHandler; @end
////////////// // Settings // ////////////// #define kDCIntrospectFlashOnRedrawColor [UIColor colorWithRed:1.0f green:0.0f blue:0.0f alpha:0.4f] // UIColor #define kDCIntrospectFlashOnRedrawFlashLength 0.03f // NSTimeInterval #define kDCIntrospectOpaqueColor [UIColor redColor] // UIColor #define kDCIntrospectTemporaryDisableDuration 10. // Seconds ////////////////// // Key Bindings // ////////////////// // '' is equivalent to page up (copy and paste this character to use) // '' is equivalent to page down (copy and paste this character to use) // Global // #define kDCIntrospectKeysInvoke @" " // starts introspector, [space] is always activates, this setting is ignored #define kDCIntrospectKeysToggleViewOutlines @"o" // shows outlines for all views #define kDCIntrospectKeysToggleNonOpaqueViews @"O" // changes all non-opaque view background colours to red (destructive) #define kDCIntrospectKeysToggleHelp @"?" // shows help #define kDCIntrospectKeysToggleFlashViewRedraws @"f" // toggle flashing on redraw for all views that implement [[DCIntrospect sharedIntrospector] flashRect:inView:] in drawRect: #define kDCIntrospectKeysToggleShowCoordinates @"c" // toggles the coordinates display #define kDCIntrospectKeysEnterBlockMode @"b" // enters block action mode // When introspector is invoked and a view is selected // #define kDCIntrospectKeysNudgeViewLeft @"a" // nudges the selected view in given direction #define kDCIntrospectKeysNudgeViewRight @"d" // #define kDCIntrospectKeysNudgeViewUp @"w" // #define kDCIntrospectKeysNudgeViewDown @"s" // #define kDCIntrospectKeysCenterInSuperview @"5" // centers the selected view in it's superview #define kDCIntrospectKeysIncreaseWidth @"D" // increases/decreases the width/height of selected view #define kDCIntrospectKeysDecreaseWidth @"A" // #define kDCIntrospectKeysIncreaseHeight @"W" // #define kDCIntrospectKeysDecreaseHeight @"S" // #define kDCIntrospectKeysLogCodeForCurrentViewChanges @"0" // prints code to the console of the changes to the current view. If the view has not been changed nothing will be printed. For example, if you nudge a view or change it's rect with the nudge keys, this will log '<#view#>.frame = CGRectMake(50.0, ..etc);'. Or if you set it's name using setName:forObject:accessedWithSelf: it will use the name provided, for example 'myView.frame = CGRectMake(...);'. Setting accessedWithSelf to YES would output 'self.myView.frame = CGRectMake(...);'. #define kDCIntrospectKeysIncreaseViewAlpha @"+" // increases/decreases the selected views alpha value #define kDCIntrospectKeysDecreaseViewAlpha @"-" // #define kDCIntrospectKeysSetNeedsDisplay @"k" // calls setNeedsDisplay on selected view #define kDCIntrospectKeysSetNeedsLayout @"l" // calls setNeedsLayout on selected view #define kDCIntrospectKeysReloadData @"r" // calls reloadData on selected view if it's a UITableView #define kDCIntrospectKeysLogProperties @"p" // logs all properties of the selected view #define kDCIntrospectKeysLogAccessibilityProperties @"q" // logs accessibility info (useful for automated view tests - thanks to @samsoffes for the idea) #define kDCIntrospectKeysLogViewRecursive @"v" // calls private method recursiveDescription which logs selected view heirachy #define kDCIntrospectKeysMoveUpInViewHierarchy @"y" // changes the selected view to it's superview #define kDCIntrospectKeysMoveBackInViewHierarchy @"t" // changes the selected view back to the previous view selected (after using the above command) #define kDCIntrospectKeysMoveDownToFirstSubview @"h" #define kDCIntrospectKeysMoveToNextSiblingView @"j" #define kDCIntrospectKeysMoveToPrevSiblingView @"g" #define kDCIntrospectKeysEnterGDB @"`" // enters GDB #define kDCIntrospectKeysDisableForPeriod @"~" // disables DCIntrospect for a given period (see kDCIntrospectTemporaryDisableDuration)
/******************************************************************************** ** Form generated from reading UI file 'settingrangedialog.ui' ** ** Created by: Qt User Interface Compiler version 5.3.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_SETTINGRANGEDIALOG_H #define UI_SETTINGRANGEDIALOG_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QDialog> #include <QtWidgets/QDialogButtonBox> #include <QtWidgets/QGridLayout> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QVBoxLayout> QT_BEGIN_NAMESPACE class Ui_SettingRangeDialog { public: QGridLayout *gridLayout; QVBoxLayout *verticalLayout; QHBoxLayout *horizontalLayout_4; QLabel *label; QHBoxLayout *horizontalLayout; QLineEdit *lineEdit; QLabel *label_3; QLineEdit *lineEdit_3; QHBoxLayout *horizontalLayout_3; QLabel *label_2; QHBoxLayout *horizontalLayout_2; QLineEdit *lineEdit_2; QLabel *label_4; QLineEdit *lineEdit_4; QDialogButtonBox *buttonBox; void setupUi(QDialog *SettingRangeDialog) { if (SettingRangeDialog->objectName().isEmpty()) SettingRangeDialog->setObjectName(QStringLiteral("SettingRangeDialog")); SettingRangeDialog->resize(298, 197); gridLayout = new QGridLayout(SettingRangeDialog); gridLayout->setObjectName(QStringLiteral("gridLayout")); verticalLayout = new QVBoxLayout(); verticalLayout->setObjectName(QStringLiteral("verticalLayout")); horizontalLayout_4 = new QHBoxLayout(); horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); label = new QLabel(SettingRangeDialog); label->setObjectName(QStringLiteral("label")); horizontalLayout_4->addWidget(label); horizontalLayout = new QHBoxLayout(); horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); lineEdit = new QLineEdit(SettingRangeDialog); lineEdit->setObjectName(QStringLiteral("lineEdit")); horizontalLayout->addWidget(lineEdit); label_3 = new QLabel(SettingRangeDialog); label_3->setObjectName(QStringLiteral("label_3")); horizontalLayout->addWidget(label_3); lineEdit_3 = new QLineEdit(SettingRangeDialog); lineEdit_3->setObjectName(QStringLiteral("lineEdit_3")); horizontalLayout->addWidget(lineEdit_3); horizontalLayout_4->addLayout(horizontalLayout); verticalLayout->addLayout(horizontalLayout_4); horizontalLayout_3 = new QHBoxLayout(); horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); label_2 = new QLabel(SettingRangeDialog); label_2->setObjectName(QStringLiteral("label_2")); horizontalLayout_3->addWidget(label_2); horizontalLayout_2 = new QHBoxLayout(); horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); lineEdit_2 = new QLineEdit(SettingRangeDialog); lineEdit_2->setObjectName(QStringLiteral("lineEdit_2")); horizontalLayout_2->addWidget(lineEdit_2); label_4 = new QLabel(SettingRangeDialog); label_4->setObjectName(QStringLiteral("label_4")); horizontalLayout_2->addWidget(label_4); lineEdit_4 = new QLineEdit(SettingRangeDialog); lineEdit_4->setObjectName(QStringLiteral("lineEdit_4")); horizontalLayout_2->addWidget(lineEdit_4); horizontalLayout_3->addLayout(horizontalLayout_2); verticalLayout->addLayout(horizontalLayout_3); gridLayout->addLayout(verticalLayout, 0, 0, 1, 1); buttonBox = new QDialogButtonBox(SettingRangeDialog); buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 1, 0, 1, 1); retranslateUi(SettingRangeDialog); QObject::connect(buttonBox, SIGNAL(accepted()), SettingRangeDialog, SLOT(accept())); QObject::connect(buttonBox, SIGNAL(rejected()), SettingRangeDialog, SLOT(reject())); QMetaObject::connectSlotsByName(SettingRangeDialog); } // setupUi void retranslateUi(QDialog *SettingRangeDialog) { SettingRangeDialog->setWindowTitle(QApplication::translate("SettingRangeDialog", "Dialog", 0)); label->setText(QApplication::translate("SettingRangeDialog", "\346\250\252\345\235\220\346\240\207(\346\225\264\346\225\260): ", 0)); label_3->setText(QApplication::translate("SettingRangeDialog", "--", 0)); label_2->setText(QApplication::translate("SettingRangeDialog", "\347\272\265\345\235\220\346\240\207(\346\225\264\346\225\260): ", 0)); label_4->setText(QApplication::translate("SettingRangeDialog", "--", 0)); } // retranslateUi }; namespace Ui { class SettingRangeDialog: public Ui_SettingRangeDialog {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_SETTINGRANGEDIALOG_H