text
stringlengths
4
6.14k
/* FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. *************************************************************************** * * * FreeRTOS tutorial books are available in pdf and paperback. * * Complete, revised, and edited pdf reference manuals are also * * available. * * * * Purchasing FreeRTOS documentation will not only help you, by * * ensuring you get running as quickly as possible and with an * * in-depth knowledge of how to use FreeRTOS, it will also help * * the FreeRTOS project to continue with its mission of providing * * professional grade, cross platform, de facto standard solutions * * for microcontrollers - completely free of charge! * * * * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * * * * Thank you for using FreeRTOS, and thank you for your support! * * * *************************************************************************** This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation AND MODIFIED BY the FreeRTOS exception. >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to distribute a combined work that includes FreeRTOS without being obliged to provide the source code for proprietary components outside of the FreeRTOS kernel. FreeRTOS 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 and the FreeRTOS license exception along with FreeRTOS; if not itcan be viewed here: http://www.freertos.org/a00114.html and also obtained by writing to Real Time Engineers Ltd., contact details for whom are available on the FreeRTOS WEB site. 1 tab == 4 spaces! *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * * not run, what could be wrong?" * * * * http://www.FreeRTOS.org/FAQHelp.html * * * *************************************************************************** http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, and our new fully thread aware and reentrant UDP/IP stack. http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell the code with commercial support, indemnification and middleware, under the OpenRTOS brand. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. */ /* Changes from V3.0.0 + ISRcode pulled inline to reduce stack-usage. + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. + Filename changed to a .c extension to allow stepping through code using F7. Changes from V3.0.1 */ /* * ISR for the tick. * This increments the tick count and, if using the preemptive scheduler, * performs a context switch. This must be identical to the manual * context switch in how it stores the context of a task. */ #ifndef _FREERTOS_DRIVERS_TICK_ISRTICK_C #define _FREERTOS_DRIVERS_TICK_ISRTICK_C { /* * Was the interrupt the SystemClock? */ if( bCCP1IF && bCCP1IE ) { /* * Reset the interrupt flag */ bCCP1IF = 0; /* * Maintain the tick count. */ vTaskIncrementTick(); #if configUSE_PREEMPTION == 1 { /* * Ask for a switch to the highest priority task * that is ready to run. */ uxSwitchRequested = pdTRUE; } #endif } } #pragma wizcpp uselib "$__PATHNAME__/Tick.c" #endif /* _FREERTOS_DRIVERS_TICK_ISRTICK_C */
#include "ruby.h" #include "extconf.h" #include "crc64_xz.h" VALUE Digest_CRC64XZ_update(VALUE self, VALUE data) { VALUE crc_ivar_name = rb_intern("@crc"); VALUE crc_ivar = rb_ivar_get(self, crc_ivar_name); crc64_t crc = NUM2ULONG(crc_ivar); const char *data_ptr = StringValuePtr(data); size_t length = RSTRING_LEN(data); crc = crc64_xz_update(crc,data_ptr,length); rb_ivar_set(self, crc_ivar_name, ULONG2NUM(crc)); return self; } void Init_crc64_xz_ext() { VALUE mDigest = rb_const_get(rb_cObject, rb_intern("Digest")); VALUE cCRC64XZ = rb_const_get(mDigest, rb_intern("CRC64XZ")); rb_define_method(cCRC64XZ, "update", Digest_CRC64XZ_update, 1); }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <IDELanguageSupportUI/IDEPlaygroundDataHandler.h> @interface IDEViewToyDataHandler : IDEPlaygroundDataHandler { } - (BOOL)handleData:(id)arg1 metaData:(id)arg2 version:(unsigned long long)arg3 executionParameters:(id)arg4 resultDate:(id)arg5 error:(id *)arg6; @end
double HML_NormalizationNumberAll(double x);
// // TranslucidFramework.h // TranslucidFramework // // Created by Lucas Ortis on 10/08/2016. // Copyright © 2016 Ekhoo. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TranslucidFramework. FOUNDATION_EXPORT double TranslucidFrameworkVersionNumber; //! Project version string for TranslucidFramework. FOUNDATION_EXPORT const unsigned char TranslucidFrameworkVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <TranslucidFramework/PublicHeader.h>
// Copyright(c) 2019 Jounayd Id Salah // Distributed under the MIT License (See accompanying file LICENSE.md file or copy at http://opensource.org/licenses/MIT). #pragma once #include <container/array/coDynamicArray.h> class coPack { public: coDynamicArray<coByte> data; };
/* Support files for GNU libc. Files in the system namespace go here. Files in the C namespace (ie those that do not start with an underscore) go in .c. */ #include <_ansi.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> #include <stdio.h> #include <time.h> #include <sys/time.h> #include <sys/times.h> #include <errno.h> #include <reent.h> #include "serial/rpi_serial.h" // int uart0_putc (int c); extern void *__bss_end; unsigned int heap_end=(unsigned int)&__bss_end; unsigned int prev_heap_end; /* Forward prototypes. */ int _system _PARAMS ((const char *)); int _rename _PARAMS ((const char *, const char *)); int isatty _PARAMS ((int)); clock_t _times _PARAMS ((struct tms *)); int _gettimeofday _PARAMS ((struct timeval *, struct timezone *)); void _raise _PARAMS ((void)); int _unlink _PARAMS ((void)); int _link _PARAMS ((void)); int _stat _PARAMS ((const char *, struct stat *)); int _fstat _PARAMS ((int, struct stat *)); caddr_t _sbrk _PARAMS ((int)); int _getpid _PARAMS ((int)); int _kill _PARAMS ((int, int)); void _exit _PARAMS ((int)); int _close _PARAMS ((int)); int _open _PARAMS ((const char *, int, ...)); int _write _PARAMS ((int, char *, int)); int _lseek _PARAMS ((int, int, int)); int _read _PARAMS ((int, char *, int)); void initialise_monitor_handles _PARAMS ((void)); /* Register name faking - works in collusion with the linker. */ register char * stack_ptr asm ("sp"); //static int //remap_handle (int fh) //{ //return 0; //} void initialise_monitor_handles (void) { } // 注意: 以下2つを有効にするとprintfが動かなくなる。 // static int // get_errno (void) // { // return(0); // } // static int // error (int result) // { // errno = get_errno (); // return result; // } int _read (int file, char * ptr, int len) { return len; } int _lseek (int file, int ptr, int dir) { return 0; } int _write (int file, char * ptr, int len) { int r; for(r=0;r<len;r++){ uart0_putc(ptr[r]); } return len; } int _open (const char * path, int flags, ...) { return 0; } int _close (int file) { return 0; } void _exit (int n) { while(1); } int _kill (int n, int m) { return(0); } int _getpid (int n) { return 1; n = n; } caddr_t _sbrk (int incr) { prev_heap_end = heap_end; if (heap_end + incr > stack_ptr) return (caddr_t) -1; heap_end += incr; return (caddr_t) prev_heap_end; } int _fstat (int file, struct stat * st) { return 0; } int _stat (const char *fname, struct stat *st) { return 0; } int _link (void) { return -1; } int _unlink (void) { return -1; } void _raise (void) { return; } int _gettimeofday (struct timeval * tp, struct timezone * tzp) { if(tp) { tp->tv_sec = 10; tp->tv_usec = 0; } if (tzp) { tzp->tz_minuteswest = 0; tzp->tz_dsttime = 0; } return 0; } clock_t _times (struct tms * tp) { clock_t timeval; timeval = 10; if (tp) { tp->tms_utime = timeval; /* user time */ tp->tms_stime = 0; /* system time */ tp->tms_cutime = 0; /* user time, children */ tp->tms_cstime = 0; /* system time, children */ } return timeval; }; int _isatty (int fd) { return 1; fd = fd; } int _system (const char *s) { if (s == NULL) return 0; errno = ENOSYS; return -1; } int _rename (const char * oldpath, const char * newpath) { errno = ENOSYS; return -1; }
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_NTH_H_ #define TYPEASVALUE_SRC_LIST_OPERATION_NTH_H_ #include "drop.h" #include "conditional/if.h" #include "operation/math.h" namespace tav { template < typename Index, typename List > using Nth = If< IsPair<Drop<Index, List>>, Head<Drop<Index, List>>, void >; template <typename List> using First = Nth<Size<0>, List>; template <typename List> using Second = Nth<Size<1>, List>; template <typename List> using Third = Nth<Size<2>, List>; } #endif // TYPEASVALUE_SRC_LIST_OPERATION_NTH_H_
#ifndef NODE_HASP_H #define NODE_HASP_H #include <v8.h> #include <node.h> #include <node_object_wrap.h> #include "hasp_api.h" #include "errors.h" #include "hasp.h" class NodeHasp : public node::ObjectWrap { public: static void Init(v8::Handle<v8::Object> exports); hasp_size_t get_size(v8::Isolate*); private: explicit NodeHasp(); ~NodeHasp(); static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static v8::Persistent<v8::Function> constructor; static void login(const v8::FunctionCallbackInfo<v8::Value>& args); static void logout(const v8::FunctionCallbackInfo<v8::Value>& args); static void get_size(const v8::FunctionCallbackInfo<v8::Value>& args); static void read(const v8::FunctionCallbackInfo<v8::Value>& args); static void write(const v8::FunctionCallbackInfo<v8::Value>& args); Hasp hasp; }; #endif // NODE_HASP_H
// // CommunityViewController.h // startMe // // Created by Matteo Gobbi on 31/07/13. // Copyright (c) 2013 Matteo Gobbi. All rights reserved. // #import "BaseViewController.h" #import "CustomTabBar.h" @interface CommunityViewController : BaseViewController @property (nonatomic, assign) BOOL chooseImage; @property (retain, nonatomic) IBOutlet CustomTabBar *myTabBar; @end
#ifndef GUIUTIL_H #define GUIUTIL_H #include <QString> #include <QObject> #include <QMessageBox> QT_BEGIN_NAMESPACE class QFont; class QLineEdit; class QWidget; class QDateTime; class QUrl; class QAbstractItemView; QT_END_NAMESPACE class SendCoinsRecipient; /** Utility functions used by the Castlecoin Qt UI. */ namespace GUIUtil { // Create human-readable string from date QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(qint64 nTime); // Render Castlecoin addresses in monospace font QFont bitcoinAddressFont(); // Set up widgets for address and amounts void setupAddressWidget(QLineEdit *widget, QWidget *parent); void setupAmountWidget(QLineEdit *widget, QWidget *parent); // Parse "castlecoin:" URI into recipient object, return true on succesful parsing // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out); bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); // HTML escaping for rich text controls QString HtmlEscape(const QString& str, bool fMultiLine=false); QString HtmlEscape(const std::string& str, bool fMultiLine=false); /** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing is selected. @param[in] column Data column to extract from the model @param[in] role Data role to extract from the model @see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress */ void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole); /** Get save file name, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. @param[in] parent Parent window (or 0) @param[in] caption Window caption (or empty, for default) @param[in] dir Starting directory (or empty, to default to documents directory) @param[in] filter Filter specification such as "Comma Separated Files (*.csv)" @param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix. */ QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedSuffixOut=0); /** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking. @returns If called from the GUI thread, return a Qt::DirectConnection. If called from another thread, return a Qt::BlockingQueuedConnection. */ Qt::ConnectionType blockingGUIThreadConnection(); // Determine whether a widget is hidden behind other windows bool isObscured(QWidget *w); // Open debug.log void openDebugLogfile(); /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ class ToolTipToRichTextFilter : public QObject { Q_OBJECT public: explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); protected: bool eventFilter(QObject *obj, QEvent *evt); private: int size_threshold; }; bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); /** Help message for Castlecoin-Qt, shown with --help. */ class HelpMessageBox : public QMessageBox { Q_OBJECT public: HelpMessageBox(QWidget *parent = 0); /** Show message box or print help message to standard output, based on operating system. */ void showOrPrint(); /** Print help message to console */ void printToConsole(); private: QString header; QString coreOptions; QString uiOptions; }; } // namespace GUIUtil #endif // GUIUTIL_H
// // bridge.h // sinaWeibo // // Created by 张俊凯 on 16/7/29. // Copyright © 2016年 张俊凯. All rights reserved. // #import "FMDB.h"
#ifndef __SYS_LOCK_H__ #define __SYS_LOCK_H__ /* dummy lock routines for single-threaded aps */ typedef int _LOCK_T; typedef int _LOCK_RECURSIVE_T; #include <_ansi.h> #define __LOCK_INIT(class,lock) static int lock = 0; #define __LOCK_INIT_RECURSIVE(class,lock) static int lock = 0; #define __lock_init(lock) (_CAST_VOID 0) #define __lock_init_recursive(lock) (_CAST_VOID 0) #define __lock_close(lock) (_CAST_VOID 0) #define __lock_close_recursive(lock) (_CAST_VOID 0) #define __lock_acquire(lock) (_CAST_VOID 0) #define __lock_acquire_recursive(lock) (_CAST_VOID 0) #define __lock_try_acquire(lock) (_CAST_VOID 0) #define __lock_try_acquire_recursive(lock) (_CAST_VOID 0) #define __lock_release(lock) (_CAST_VOID 0) #define __lock_release_recursive(lock) (_CAST_VOID 0) #endif /* __SYS_LOCK_H__ */
// // LanguagesViewController.h // Langy // // Created by Nicolas Santangelo on 12/25/14. // Copyright (c) 2014 Nicolas Santangelo. All rights reserved. // #import <Cocoa/Cocoa.h> #import "UserDefaultsManager.h" #import "AppFinder.h" #import "AppsPopUpButton.h" #import "InputSourceWithPopUpManager.h" #import "InputSourcePopUpButton.h" #import "InputSource.h" #import "StoredApps.h" #import "RememberLast.h" @interface LanguagesViewController : NSViewController<NSTableViewDataSource, NSTableViewDelegate> @property (weak) IBOutlet InputSourcePopUpButton *defaultInputSourcePopupButton; @property (weak) IBOutlet NSTableView *preferencesTableView; @property (assign) IBOutlet NSWindow *addPreferenceSheet; @property (weak) IBOutlet AppsPopUpButton *sheetAppsPopupButton; - (void)appear; - (IBAction)defatultInputSourceSelected:(id)sender; - (IBAction)appSelected:(id)sender; - (IBAction)removePreference:(id)sender; @end
//******************************************************************* // Copyright (C) 2007 Ball Aerspace & Technologies Corp // // LICENSE: See top level LICENSE.txt file. // // Author: Lucas Eckels // // Description: Nitf support class // //******************************************************************** // $Id: $ #ifndef ossimNitfImageDataMaskV2_1_HEADER #define ossimNitfImageDataMaskV2_1_HEADER #include <ossim/base/ossimConstants.h> #include <vector> #include <ostream> class OSSIMDLLEXPORT ossimNitfImageDataMaskV2_1 { public: ossimNitfImageDataMaskV2_1(); void setBlockCount(ossim_uint32 blockCount); void setBlockLengthInBytes(ossim_uint32 blockLength); void setIncludeBlock(ossim_uint32 blockNumber, bool included); void writeStream(std::ostream &out); private: std::vector<bool> theIncludedBlocks; ossim_uint32 theBlockLength; }; #endif
#include<stdio.h> #include<conio.h> #include<graphics.h> void b_fill(int x,int y,int f,int b) { int c; c=getpixel(x,y); if((c!=b)&&(c!=f)) { putpixel(x,y,f); delay(10); b_fill(x+1,y,f,b); b_fill(x,y+1,f,b); b_fill(x+1,y+1,f,b); b_fill(x-1,y-1,f,b); b_fill(x-1,y,f,b); b_fill(x,y-1,f,b); b_fill(x-1,y+1,f,b); b_fill(x+1,y-1,f,b); } } int main() { int gd=DETECT,gm; initgraph(&gd,&gm,""); //initgraph(&gd,&gm,"c:\\tc\\bgi"); rectangle(50,50,100,100); b_fill(55,55,10,15); getch(); return 0; }
// Copyright 2015, Google Inc. // All rights reserved. // [# filter: gtest\internal #] // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Injection point for custom user configurations. See README for details // // ** Custom implementation starts here ** #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
//================================================================================================= /*! // \file blaze/math/constraints/TVecMatMultExpr.h // \brief Constraint on the data type // // Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= #ifndef _BLAZE_MATH_CONSTRAINTS_TVECMATMULTEXPR_H_ #define _BLAZE_MATH_CONSTRAINTS_TVECMATMULTEXPR_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/math/typetraits/IsMatrix.h> #include <blaze/math/typetraits/IsRowVector.h> #include <blaze/math/typetraits/IsTVecMatMultExpr.h> #include <blaze/math/typetraits/Size.h> namespace blaze { //================================================================================================= // // MUST_BE_TVECMATMULTEXPR_TYPE CONSTRAINT // //================================================================================================= //************************************************************************************************* /*!\brief Constraint on the data type. // \ingroup math_constraints // // In case the given data type \a T is not a vector/matrix multiplication expression (i.e. a type // derived from the TVecMatMultExpr base class), a compilation error is created. */ #define BLAZE_CONSTRAINT_MUST_BE_TVECMATMULTEXPR_TYPE(T) \ static_assert( ::blaze::IsTVecMatMultExpr_v<T>, "Non-vector/matrix multiplication expression type detected" ) //************************************************************************************************* //================================================================================================= // // MUST_NOT_BE_TVECMATMULTEXPR_TYPE CONSTRAINT // //================================================================================================= //************************************************************************************************* /*!\brief Constraint on the data type. // \ingroup math_constraints // // In case the given data type \a T is a vector/matrix multiplication expression (i.e. a type // derived from the TVecMatMultExpr base class), a compilation error is created. */ #define BLAZE_CONSTRAINT_MUST_NOT_BE_TVECMATMULTEXPR_TYPE(T) \ static_assert( !::blaze::IsTVecMatMultExpr_v<T>, "Vector/matrix multiplication expression type detected" ) //************************************************************************************************* //================================================================================================= // // MUST_FORM_VALID_TVECMATMULTEXPR CONSTRAINT // //================================================================================================= //************************************************************************************************* /*!\brief Constraint on the data type. // \ingroup math_constraints // // In case the given data types \a T1 and \a T2 do not form a valid vector/matrix multiplication, // a compilation error is created. */ #define BLAZE_CONSTRAINT_MUST_FORM_VALID_TVECMATMULTEXPR(T1,T2) \ static_assert( ::blaze::IsRowVector_v<T1> && \ ::blaze::IsMatrix_v<T2> && \ ( ( ::blaze::Size_v<T1,0UL> == -1L ) || \ ( ::blaze::Size_v<T2,0UL> == -1L ) || \ ( ::blaze::Size_v<T1,0UL> == ::blaze::Size_v<T2,0UL> ) ) \ , "Invalid vector/matrix multiplication expression detected" ) //************************************************************************************************* } // namespace blaze #endif
#include <trlib/system.h> #include <trlib/syscall.h> int system_debug(debug_flags_t flag) { return syscall_debug(flag); } int system_pid() { return syscall_getpid(); } int system_parentpid() { return syscall_getparentpid(); } int system_execute(char** params) { return syscall_execute(params); } int system_kill(uint32_t pid) { return -1; } void system_exit(int code) { syscall_exit(code); }
// // NRAppDelegate.h // simpoll // // Copyright (c) 2016 Mikhail Naryshkin <nemissm@gmail.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <UIKit/UIKit.h> @interface NRAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UINavigationController *navigationController; @end
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include BOSS_CURL_U_curl_setup_h //original-code:"curl_setup.h" #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif #ifdef HAVE_NETDB_H #include <netdb.h> #endif #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> #endif #ifdef __VMS #include <in.h> #include <inet.h> #endif #ifdef HAVE_PROCESS_H #include BOSS_FAKEWIN_V_process_h //original-code:<process.h> #endif #include BOSS_CURL_U_urldata_h //original-code:"urldata.h" #include BOSS_CURL_U_sendf_h //original-code:"sendf.h" #include BOSS_CURL_U_hostip_h //original-code:"hostip.h" #include BOSS_CURL_U_hash_h //original-code:"hash.h" #include BOSS_CURL_U_share_h //original-code:"share.h" #include BOSS_CURL_U_strerror_h //original-code:"strerror.h" #include BOSS_CURL_U_url_h //original-code:"url.h" #include BOSS_CURL_U_curl_memory_h //original-code:"curl_memory.h" /* The last #include file should be: */ #include BOSS_CURL_U_memdebug_h //original-code:"memdebug.h" /*********************************************************************** * Only for builds using asynchronous name resolves **********************************************************************/ #ifdef CURLRES_ASYNCH /* * Curl_addrinfo_callback() gets called by ares, gethostbyname_thread() * or getaddrinfo_thread() when we got the name resolved (or not!). * * If the status argument is CURL_ASYNC_SUCCESS, this function takes * ownership of the Curl_addrinfo passed, storing the resolved data * in the DNS cache. * * The storage operation locks and unlocks the DNS cache. */ CURLcode Curl_addrinfo_callback(struct connectdata *conn, int status, struct Curl_addrinfo *ai) { struct Curl_dns_entry *dns = NULL; CURLcode result = CURLE_OK; conn->async.status = status; if(CURL_ASYNC_SUCCESS == status) { if(ai) { struct Curl_easy *data = conn->data; if(data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); dns = Curl_cache_addr(data, ai, conn->async.hostname, conn->async.port); if(!dns) { /* failed to store, cleanup and return error */ Curl_freeaddrinfo(ai); result = CURLE_OUT_OF_MEMORY; } if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); } else { result = CURLE_OUT_OF_MEMORY; } } conn->async.dns = dns; /* Set async.done TRUE last in this function since it may be used multi- threaded and once this is TRUE the other thread may read fields from the async struct */ conn->async.done = TRUE; /* IPv4: The input hostent struct will be freed by ares when we return from this function */ return result; } /* Call this function after Curl_connect() has returned async=TRUE and then a successful name resolve has been received. Note: this function disconnects and frees the conn data in case of resolve failure */ CURLcode Curl_async_resolved(struct connectdata *conn, bool *protocol_done) { CURLcode result; if(conn->async.dns) { conn->dns_entry = conn->async.dns; conn->async.dns = NULL; } result = Curl_setup_conn(conn, protocol_done); if(result) /* We're not allowed to return failure with memory left allocated in the connectdata struct, free those here */ Curl_disconnect(conn, FALSE); /* close the connection */ return result; } /* * Curl_getaddrinfo() is the generic low-level name resolve API within this * source file. There are several versions of this function - for different * name resolve layers (selected at build-time). They all take this same set * of arguments */ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp) { return Curl_resolver_getaddrinfo(conn, hostname, port, waitp); } #endif /* CURLRES_ASYNCH */
// // AccountingInfo.h // Quick-Accounting // // Created by Steven on 15/8/22. // Copyright © 2015年 Neva. All rights reserved. // #import <Foundation/Foundation.h> @interface AccountingInfo : NSObject @property (nonatomic, assign) double price; ///< 单价 @property (nonatomic, assign) double count; ///< 数量 @property (nonatomic, readonly) double result; ///< 计算结果 @property (nonatomic, readonly) BOOL isDirty; ///< 初始化以后是否修改过数据 @end
/* * Copyright (C) 2011 Google Inc. All Rights Reserved. * Copyright (C) 2017 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #pragma once #include <memory> #include <wtf/Forward.h> #include <wtf/OptionSet.h> #include <wtf/RefPtr.h> namespace WebCore { class SecurityOrigin; class SecurityOriginPolicy; class ContentSecurityPolicy; class URL; enum SandboxFlag { // See http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-sandbox for a list of the sandbox flags. SandboxNone = 0, SandboxNavigation = 1, SandboxPlugins = 1 << 1, SandboxOrigin = 1 << 2, SandboxForms = 1 << 3, SandboxScripts = 1 << 4, SandboxTopNavigation = 1 << 5, SandboxPopups = 1 << 6, // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12393 SandboxAutomaticFeatures = 1 << 7, SandboxPointerLock = 1 << 8, SandboxPropagatesToAuxiliaryBrowsingContexts = 1 << 9, SandboxTopNavigationByUserActivation = 1 << 10, SandboxDocumentDomain = 1 << 11, SandboxModals = 1 << 12, SandboxStorageAccessByUserActivation = 1 << 13, SandboxAll = -1 // Mask with all bits set to 1. }; typedef int SandboxFlags; class SecurityContext { public: SandboxFlags sandboxFlags() const { return m_sandboxFlags; } ContentSecurityPolicy* contentSecurityPolicy() { return m_contentSecurityPolicy.get(); } bool isSecureTransitionTo(const URL&) const; void enforceSandboxFlags(SandboxFlags mask); bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } SecurityOriginPolicy* securityOriginPolicy() const { return m_securityOriginPolicy.get(); } // Explicitly override the security origin for this security context. // Note: It is dangerous to change the security origin of a script context // that already contains content. void setSecurityOriginPolicy(RefPtr<SecurityOriginPolicy>&&); SecurityOrigin* securityOrigin() const; static SandboxFlags parseSandboxPolicy(const String& policy, String& invalidTokensErrorMessage); static bool isSupportedSandboxPolicy(StringView); enum MixedContentType { Inactive = 1 << 0, Active = 1 << 1, }; const OptionSet<MixedContentType>& foundMixedContent() const { return m_mixedContentTypes; } void setFoundMixedContent(MixedContentType type) { m_mixedContentTypes |= type; } bool geolocationAccessed() const { return m_geolocationAccessed; } void setGeolocationAccessed() { m_geolocationAccessed = true; } bool secureCookiesAccessed() const { return m_secureCookiesAccessed; } void setSecureCookiesAccessed() { m_secureCookiesAccessed = true; } bool isStrictMixedContentMode() const { return m_isStrictMixedContentMode; } void setStrictMixedContentMode(bool strictMixedContentMode) { m_isStrictMixedContentMode = strictMixedContentMode; } // This method implements the "Is the environment settings object settings a secure context?" algorithm from // the Secure Context spec: https://w3c.github.io/webappsec-secure-contexts/#settings-object (Editor's Draft, 17 November 2016) virtual bool isSecureContext() const = 0; protected: SecurityContext(); virtual ~SecurityContext(); void setContentSecurityPolicy(std::unique_ptr<ContentSecurityPolicy>); // It's only appropriate to call this during security context initialization; it's needed for // flags that can't be disabled with allow-* attributes, such as SandboxNavigation. void disableSandboxFlags(SandboxFlags mask) { m_sandboxFlags &= ~mask; } void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; } bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurityOrigin; } private: RefPtr<SecurityOriginPolicy> m_securityOriginPolicy; std::unique_ptr<ContentSecurityPolicy> m_contentSecurityPolicy; SandboxFlags m_sandboxFlags { SandboxNone }; OptionSet<MixedContentType> m_mixedContentTypes; bool m_haveInitializedSecurityOrigin { false }; bool m_geolocationAccessed { false }; bool m_secureCookiesAccessed { false }; bool m_isStrictMixedContentMode { false }; }; } // namespace WebCore
/** * OpenEBI * * Copyright (c) 2012 Kim H Blomqvist * Developed at the Department of Electronics at Aalto University * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __BOARD_H #define __BOARD_H void init_board(void); void init_twi(void); void init_usart0(void); #endif
// // Copyright 2009 High Order Bit, Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "FavoriteReposStateReader.h" #import "FavoriteReposStateSetter.h" @interface FavoriteReposState : NSObject <FavoriteReposStateReader, FavoriteReposStateSetter> { NSMutableArray * favoriteRepoKeys; } @end
// // NSArray+Overstep.h // extra-1. 交换方法, 越界不Crash // // Created by Wolf on 16/6/3. // Copyright © 2016年 Vincent-Xu. All rights reserved. // #import <Foundation/Foundation.h> @interface NSArray (Overstep) @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/TSCHChartInfo.h> @interface TSCHChartInfo (ApplyPreset) - (id)p_swapTuplesForApplyingPreset:(id)arg1 preservingAppearance:(_Bool)arg2; - (id)p_swapTuplesForApplyingPresetRemovingOverrides:(id)arg1; - (id)swapTuplesForApplyingPreset:(id)arg1 withBehavior:(unsigned long long)arg2; @end
#pragma once #include "stdafx.h" #include "IShapeView.h" #include "Difinition.h" using namespace std; typedef sf::Vector2f V2f; class CCircleView : public IShapeView { public: CCircleView(V2f const &pos, float radius, ShapeColor const &lineColor, ShapeColor const &fillColor); private: void draw(sf::RenderTarget& target, sf::RenderStates states) const override final; private: sf::CircleShape m_circle; };
// // SBVideoReviewView.h // CocoaBloc // // Created by Mark Glagola on 11/24/14. // Copyright (c) 2014 StageBloc. All rights reserved. // #import "SBReviewView.h" @interface SBVideoReviewView : SBReviewView @property (nonatomic, readonly, copy) NSURL *videoURL; - (instancetype) initWithFrame:(CGRect)frame videoURL:(NSURL*)videoURL; - (void) play; - (void) pause; - (void) restart; @end
// -*- C++ -*- // $Id: FT_ClientORB_export.h 14 2007-02-01 15:49:12Z mitza $ // Definition for Win32 Export directives. // This file is generated automatically by generate_export_file.pl TAO_FT_ClientORB // ------------------------------ #ifndef TAO_FT_CLIENTORB_EXPORT_H #define TAO_FT_CLIENTORB_EXPORT_H #include "ace/config-all.h" #if defined (TAO_AS_STATIC_LIBS) # if !defined (TAO_FT_CLIENTORB_HAS_DLL) # define TAO_FT_CLIENTORB_HAS_DLL 0 # endif /* ! TAO_FT_CLIENTORB_HAS_DLL */ #else # if !defined (TAO_FT_CLIENTORB_HAS_DLL) # define TAO_FT_CLIENTORB_HAS_DLL 1 # endif /* ! TAO_FT_CLIENTORB_HAS_DLL */ #endif #if defined (TAO_FT_CLIENTORB_HAS_DLL) && (TAO_FT_CLIENTORB_HAS_DLL == 1) # if defined (TAO_FT_CLIENTORB_BUILD_DLL) # define TAO_FT_ClientORB_Export ACE_Proper_Export_Flag # define TAO_FT_CLIENTORB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) # define TAO_FT_CLIENTORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) # else /* TAO_FT_CLIENTORB_BUILD_DLL */ # define TAO_FT_ClientORB_Export ACE_Proper_Import_Flag # define TAO_FT_CLIENTORB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) # define TAO_FT_CLIENTORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) # endif /* TAO_FT_CLIENTORB_BUILD_DLL */ #else /* TAO_FT_CLIENTORB_HAS_DLL == 1 */ # define TAO_FT_ClientORB_Export # define TAO_FT_CLIENTORB_SINGLETON_DECLARATION(T) # define TAO_FT_CLIENTORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) #endif /* TAO_FT_CLIENTORB_HAS_DLL == 1 */ // Set TAO_FT_CLIENTORB_NTRACE = 0 to turn on library specific tracing even if // tracing is turned off for ACE. #if !defined (TAO_FT_CLIENTORB_NTRACE) # if (ACE_NTRACE == 1) # define TAO_FT_CLIENTORB_NTRACE 1 # else /* (ACE_NTRACE == 1) */ # define TAO_FT_CLIENTORB_NTRACE 0 # endif /* (ACE_NTRACE == 1) */ #endif /* !TAO_FT_CLIENTORB_NTRACE */ #if (TAO_FT_CLIENTORB_NTRACE == 1) # define TAO_FT_CLIENTORB_TRACE(X) #else /* (TAO_FT_CLIENTORB_NTRACE == 1) */ # if !defined (ACE_HAS_TRACE) # define ACE_HAS_TRACE # endif /* ACE_HAS_TRACE */ # define TAO_FT_CLIENTORB_TRACE(X) ACE_TRACE_IMPL(X) # include "ace/Trace.h" #endif /* (TAO_FT_CLIENTORB_NTRACE == 1) */ #endif /* TAO_FT_CLIENTORB_EXPORT_H */ // End of auto generated file.
// Copyright (c) 2011-2014 The Bitcoin developers // Copyright (c) 2017-2019 The PIVX developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H #define BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H #include "walletmodel.h" #include <QAbstractTableModel> #include <QDateTime> #include <QStringList> class CWallet; class RecentRequestEntry { public: RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION), id(0) {} static const int CURRENT_VERSION = 1; int nVersion; int64_t id; QDateTime date; SendCoinsRecipient recipient; SERIALIZE_METHODS(RecentRequestEntry, obj) { unsigned int date_timet; SER_WRITE(obj, date_timet = obj.date.toTime_t()); READWRITE(obj.nVersion, obj.id, date_timet, obj.recipient); SER_READ(obj, obj.date = QDateTime::fromTime_t(date_timet)); } }; class RecentRequestEntryLessThan { public: RecentRequestEntryLessThan(int nColumn, Qt::SortOrder fOrder) : column(nColumn), order(fOrder) {} bool operator()(RecentRequestEntry& left, RecentRequestEntry& right) const; private: int column; Qt::SortOrder order; }; /** Model for list of recently generated payment requests / pivx: URIs. * Part of wallet model. */ class RecentRequestsTableModel : public QAbstractTableModel { Q_OBJECT public: explicit RecentRequestsTableModel(CWallet* wallet, WalletModel* parent); ~RecentRequestsTableModel(); enum ColumnIndex { Date = 0, Label = 1, Address = 2, Message = 3, Amount = 4, NUMBER_OF_COLUMNS }; /** @name Methods overridden from QAbstractTableModel @{*/ int rowCount(const QModelIndex& parent) const; int columnCount(const QModelIndex& parent) const; QVariant data(const QModelIndex& index, int role) const; bool setData(const QModelIndex& index, const QVariant& value, int role); QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex& parent) const; bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); Qt::ItemFlags flags(const QModelIndex& index) const; /*@}*/ const RecentRequestEntry& entry(int row) const { return list[row]; } void addNewRequest(const SendCoinsRecipient& recipient); void addNewRequest(const std::string& recipient); void addNewRequest(RecentRequestEntry& recipient); public Q_SLOTS: void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); void updateDisplayUnit(); private: WalletModel* walletModel; QStringList columns; QList<RecentRequestEntry> list; int64_t nReceiveRequestsMaxId; /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ void updateAmountColumnTitle(); /** Gets title for amount column including current display unit if optionsModel reference available. */ QString getAmountTitle(); }; #endif // BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H
/* Copyright (c) 2015 Ricardo Iván Vieitez Parra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #ifndef _RESTC_REQUEST_H #define _RESTC_REQUEST_H #ifdef __cplusplus extern "C" { #endif #include "_RESTc_Class.h" #include "RESTc_Request.h" struct RESTc_Request { void const * class; enum RESTc_Request_methods request_method; enum RESTc_Request_content_type content_type; void * uri; void * query_parameters; void * headers; void * body_parameters; }; #ifdef __cplusplus } #endif #endif
#import <Foundation/Foundation.h> #define TABLE_BACKGROUND_COLOR [UIColor colorWithRed:0.951 green:0.951 blue:0.951 alpha:1.000] @interface AppHelpers : NSObject + (NSString *)formatDate:(NSDate *)date; + (NSDate *)parseDateTime:(NSString *)dateTimeString; + (NSString *)numberToCurrency:(NSString *)number; + (NSString *)penceToDollars:(NSString *)pence; + (NSString *)dollarsToPence:(NSString *)dollars; + (UIBarButtonItem *)newCancelButton:(id)target; + (UIBarButtonItem *)newSaveButton:(id)target; + (UITextField *)newTableCellTextField:(id)delegate; + (void)showAlert:(NSString *)title withMessage:(NSString *)message; + (void)showAlertWithError:(NSError *)error; + (void)handleRemoteError:(NSError *)error; @end
#pragma once #include "common.h" #include "ci_map.h" #include "query_string.h" namespace crow { template <typename T> inline const std::string& get_header_value(const T& headers, const std::string& key) { if (headers.count(key)) { return headers.find(key)->second; } static std::string empty; return empty; } struct request { HTTPMethod method; std::string raw_url; std::string url; query_string url_params; ci_map headers; std::string body; void* middleware_context{}; request() : method(HTTPMethod::GET) { } request(HTTPMethod method, std::string raw_url, std::string url, query_string url_params, ci_map headers, std::string body) : method(method), raw_url(std::move(raw_url)), url(std::move(url)), url_params(std::move(url_params)), headers(std::move(headers)), body(std::move(body)) { } void add_header(std::string key, std::string value) { headers.emplace(std::move(key), std::move(value)); } const std::string& get_header_value(const std::string& key) { return crow::get_header_value(headers, key); } }; }
// // TMDBMedia.h // TMDBKit // // Created by Chao Ruan on 4/09/2015. // Copyright (c) 2015 Chao Ruan. All rights reserved. // #import <Foundation/Foundation.h> @class TMDBImageResponse; @class TMDBVideoResponse; @class TMDBCreditsResponse; @protocol TMDBMedia <NSObject> @property (nonatomic, assign, readonly) double voteAverage; @property (nonatomic, copy, readonly) NSString *title; @property (nonatomic, copy, readonly) NSString *overview; @property (nonatomic, copy, readonly) NSArray *posters; @property (nonatomic, copy, readonly) NSArray *backdrops; @property (nonatomic, copy, readonly) NSArray *videoKeys; @property (nonatomic, copy, readonly) NSArray *casts; @property (nonatomic, copy, readonly) NSArray *crews; - (void)updateWithImageResponse:(TMDBImageResponse*)response; - (void)updateWithVideoResponse:(TMDBVideoResponse*)response; - (void)updateWithCreditResponse:(TMDBCreditsResponse *)response; @end
// // SWDeck.h // SWCards // // Created by songlong on 16/5/23. // Copyright © 2016年 SaberGame. All rights reserved. // #import <Foundation/Foundation.h> @class SWHero; @class SWCard; @interface SWDeck : NSObject @property (nonatomic, strong) NSArray *cardsArray; @property (nonatomic, copy) NSString *iconName; @property (nonatomic, copy) NSString *deckName; @property (nonatomic, strong) SWHero *deckHero; + (NSInteger)deckCapacity; - (SWCard *)drawCard; @end
/*! @header Program loading from disk. This header provides two functions that can be used to load a program from a user-supplied FILE pointer, or from a path to a file on disk @language c @author Jakob Rieck */ #ifndef _PROGRAM_LOADING_H #define _PROGRAM_LOADING_H #include <stdio.h> #include <stdint.h> /*! @abstract Options for program loading @discussion Two options are available: One for binary loading, which refers to binaries consisting of machine instructions only, and one for programs distributed in textual form, where each line conforms to the grammar specified in the functions below. */ typedef enum { OPT_BINARY = 0, OPT_TEXTUAL } LOAD_OPTION; /*! @abstract Loads a program from a user supplied file that has not been opened. @see load_program_from_file */ int load_program_from_path(const LOAD_OPTION option, const char * input_file, uint32_t ** code_out, size_t * size_out); /*! @abstract Loads a program from a user supplied file. @discussion The file is assumed to be readable (not necessarily writable). There are two possible program formats: Either it is a binary file containing just the instructions encoded as little endian integers, or the program is supplied as a text file of the following format tag binary_vector description This input gets transformed and the program is returned. The actual output is returned in code_out and size_out. An error code is returned from the procedure. (0 on success) @param option One of the two options: binary or textual. @param input The input file. @param code_out Output parameter for the code image. The caller is responsible to release the memory returned in this parameter. @param size_out Output parameter for the size of the code image. @return An error code (0 on success) */ int load_program_from_file(const LOAD_OPTION option, FILE * input, uint32_t ** code_out, size_t * size_out); #endif // _PROGRAM_LOADING_H
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: GameState.h * Author: logan * * Created on May 17, 2017, 11:43 AM */ #ifndef GAMESTATE_H #define GAMESTATE_H #include "AssetManager.h" class GameState { public: GameState(); GameState(const GameState& orig); virtual ~GameState(); virtual void init(); virtual void handleEvents(sf::Event &event, sf::RenderWindow * window); virtual void update(); virtual void draw(sf::RenderWindow &window); private: AssetManager * assetManager; }; #endif /* GAMESTATE_H */
#import "MOBProjection.h" @interface MOBProjectionEPSG2025 : MOBProjection @end
/* * soundmodule.h * ============================================== * Denise Ratasich * 10.11.2012 */ #ifndef __SOUNDMODULE_H__ #define __SOUNDMODULE_H__ #include <avr/io.h> // e.g. uint8_t, uint16_t // soundmodule ports/pins // uses Timer 3 #define SM_PORT PORTF #define SM_PIN PINF #define SM_DDR DDRF #define SM_CLK PF0 #define SM_DATA PF1 #define SM_BUSY PF2 //sound definitions for driving in remote control mode #define SOUND_DRIVE_FORWARD 1 #define SOUND_DRIVE_BACKWARD 1 #define SOUND_DRIVE_LEFT 0 #define SOUND_DRIVE_RIGHT 0 #define SOUND_TURN_LEFT 14 #define SOUND_TURN_RIGHT 14 #define SOUND_STOP_SOFT 15 #define SOUND_STOP_IMMEDIATELY 19 //sound definitions for moving autonomous #define SOUND_MOVE_START 1 #define SOUND_TURN_HEAD 3 #define SOUND_TURN_RKDK_90 5 #define SOUND_TURN_RKDK_180 6 #define SOUND_RC_START 10 #define SOUND_CLOSE_WALL_FRONT 14 #define SOUND_CLOSE_WALL_LEFT 15 #define SOUND_CLOSE_WALL_RIGHT 18 #define SOUND_MEASURE_DISTANCE 0 #define SOUND_EMERGENCY_STOP 19 #define SOUND_NR_MAX SOUND_EMERGENCY_STOP //sound definitions for wait and react #define SOUND_NEAR_LEFT 0 #define SOUND_NEAR_RIGHT 0 #define SOUND_FAR_FRONT 1 #define SOUND_MID_FRONT 3 #define SOUND_NEAR_FRONT 19 #define SOUND_PERSON_LOST 12// 20 #define SOUND_WALK_A_STEP 18// 10// 8 //12 #define SOUND_WALK_STOP 16 //6 od 7 //sound definitions for move labyrinth #define SOUND_INIT 2 #define SOUND_START 1 #define SOUND_TURN 9 #define SOUND_FORWARD 18 void soundmodule_init(void); void soundmodule_playSound(uint8_t soundNr); uint8_t soundmodule_isReady(void); void soundmodule_sendCmd(uint16_t cmd); // Timer3 overflow ISR #endif
// // IUScreenSizeAdaptor.h // // Created by lhw on 16/3/25. // Copyright © 2016年 刘海文. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #define IUScreenSize [[UIScreen mainScreen] bounds].size #define IUScreenWidth IUScreenSize.width #define IUScreenHeight IUScreenSize.height #ifndef SCREEN_WIDTH #define SCREEN_WIDTH IUScreenWidth #endif #ifndef SCREEN_HEIGHT #define SCREEN_HEIGHT IUScreenHeight #endif #define IUScale_320 [IUScreenSizeAdaptor scaleFactorWithOriginalScreenWidth:320] #define IUScale_640 [IUScreenSizeAdaptor scaleFactorWithOriginalScreenWidth:640] #define IUScale_375 [IUScreenSizeAdaptor scaleFactorWithOriginalScreenWidth:375] #define IUScale_750 [IUScreenSizeAdaptor scaleFactorWithOriginalScreenWidth:750] #define IUScaleFrom320(n) floor(n*IUScale_320) #define IUScaleFrom640(n) floor(n*IUScale_640) #define IUScaleFrom375(n) floor(n*IUScale_375) #define IUScaleFrom750(n) floor(n*IUScale_750) #define kSF320(n) IUScaleFrom320(n) #define kSF640(n) IUScaleFrom640(n) #define kSF375(n) IUScaleFrom375(n) #define kSF750(n) IUScaleFrom750(n) @interface IUScreenSizeAdaptor : NSObject + (float)scaleFactorWithOriginalScreenWidth:(int)originalScreenWidth; @end
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Author: Satyanarayana Manyam #ifndef PAGESPEED_KERNEL_IMAGE_IMAGE_CONVERTER_H_ #define PAGESPEED_KERNEL_IMAGE_IMAGE_CONVERTER_H_ #include "pagespeed/kernel/base/basictypes.h" #include "pagespeed/kernel/base/string.h" #include "pagespeed/kernel/image/jpeg_optimizer.h" #include "pagespeed/kernel/image/scanline_status.h" #include "pagespeed/kernel/image/webp_optimizer.h" namespace net_instaweb { class MessageHandler; } namespace pagespeed { namespace image_compression { using net_instaweb::MessageHandler; class MultipleFrameReader; class MultipleFrameWriter; class PngReaderInterface; class ScanlineReaderInterface; class ScanlineWriterInterface; class ImageConverter { public: enum ImageType { IMAGE_NONE = 0, IMAGE_PNG, IMAGE_JPEG, IMAGE_WEBP }; // Converts image one line at a time, between different image // formats. Both 'reader' and 'writer' must be non-NULL. static ScanlineStatus ConvertImageWithStatus( ScanlineReaderInterface* reader, ScanlineWriterInterface* writer); inline static bool ConvertImage(ScanlineReaderInterface* reader, ScanlineWriterInterface* writer) { return ConvertImageWithStatus(reader, writer).Success(); } // Converts image frame by frame, and then line by line within each // frame, between different image formats. Both 'reader' and // 'writer' must be non-NULL. static ScanlineStatus ConvertMultipleFrameImage(MultipleFrameReader* reader, MultipleFrameWriter* writer); static bool ConvertPngToJpeg( const PngReaderInterface& png_struct_reader, const GoogleString& in, const JpegCompressionOptions& options, GoogleString* out, MessageHandler* handler); // Reads the PNG encoded in 'in' with 'png_struct_reader', encodes // it in WebP format using the options in 'config', and writes the // resulting WebP in 'out'. Note that if config.alpha_quality==0, // this function will fail when attempting to convert an image with // transparent pixels. Returns is_opaque set to true iff the 'in' // image was opaque. static bool ConvertPngToWebp( const PngReaderInterface& png_struct_reader, const GoogleString& in, const WebpConfiguration& config, GoogleString* out, bool* is_opaque, MessageHandler* handler); // Reads the PNG encoded in 'in' with 'png_struct_reader', encodes // it in WebP format using the options in 'config', and writes the // resulting WebP in 'out'. Note that if config.alpha_quality==0, // this function will fail when attempting to convert an image with // transparent pixels. Returns is_opaque set to true iff the 'in' // image was opaque. On entry, '*webp_writer' must be NULL; on exit, // it contains the WebpScanlineWriter instance that was used to // write the WebP, and the caller is responsible for deleting // it. Most clients will prefer to use the other form // ConvertPngToWebp. static bool ConvertPngToWebp( const PngReaderInterface& png_struct_reader, const GoogleString& in, const WebpConfiguration& config, GoogleString* out, bool* is_opaque, WebpScanlineWriter** webp_writer, MessageHandler* handler); // Optimizes the given png image, also converts to jpeg and take the // the one that has smaller size and set the output. Returns false // if both of them fails. static bool OptimizePngOrConvertToJpeg( const PngReaderInterface& png_struct_reader, const GoogleString& in, const JpegCompressionOptions& options, GoogleString* out, bool* is_out_png, MessageHandler* handler); // Populates 'out' with a version of the input image 'in' resulting // in the smallest size, and returns the corresponding // ImageType. The image formats that are candidates for the output // image are: lossless WebP, optimized PNG, custom JPEG (if // jpeg_options != NULL), and custom WebP (if webp_config != // NULL). To compensate for the loss in quality in the custom JPEG // and WebP (which are presumably lossy), these two formats must be // substantially smaller than the optimized PNG and the lossless // WebP in order to be chosen. In the case where none of these image // formats could be generated or the original image turns out to be // the smallest, copies the original image to 'out' and returns // IMAGE_NONE. static ImageType GetSmallestOfPngJpegWebp( // TODO(bmcquade): should be a ScanlineReaderInterface. const PngReaderInterface& png_struct_reader, const GoogleString& in, const JpegCompressionOptions* jpeg_options, const WebpConfiguration* webp_config, GoogleString* out, MessageHandler* handler); private: ImageConverter(); ~ImageConverter(); DISALLOW_COPY_AND_ASSIGN(ImageConverter); }; } // namespace image_compression } // namespace pagespeed #endif // PAGESPEED_KERNEL_IMAGE_IMAGE_CONVERTER_H_
#pragma once #ifdef __cplusplus extern "C" { #endif /// Called to initialize the Feather type kinds void initFeatherTypeKinds(); #ifdef __cplusplus } #endif
#include <stdio.h> int main() { float celsius, fahrenheit; printf("\nEnter temp in Celsius : "); scanf("%f", &celsius); fahrenheit = (1.8 * celsius) + (float) 32; printf("\nTemperature in Fahrenheit : %f ", fahrenheit); return (0); }
#pragma once #include "include/VirtualBox.h" #include <Windows.h> #include <vector> #include "VirtualMachine.h" #include "VBoxAppliance.h" class VirtualMachine; class VBoxMainController { public: VBoxMainController(); static bool exist(); std::wstring getVBoxVersion() const; std::wstring getVBoxManagePath(); VirtualMachine* getVMByNameOrUUID(std::wstring toSearch); static VBoxMainController* getInstance(); VBoxAppliance* appliance(); static void refreshCache(); IHost *getVirtualBoxIHost(); ~VBoxMainController(); private: static bool initialized; //VirtualBox Stuff HRESULT lastResult; IVirtualBoxClient *virtualBoxClient; IVirtualBox *virtualBox; //VirtualBox Wrapper Handler std::vector<VirtualMachine*> machinesCache; VBoxAppliance *vboxAppliance; static VBoxMainController* activeInstance; //Initialization void init(); void createVBoxClientInstance(); void createVBoxInstance(); std::wstring vBoxInstallDir; void invalidateCache(); };
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/ashchauhan/Desktop/SampleApp/OnePoint/Player/Web/Templates/TemplateTypes.java // // Created by ashchauhan on 3/11/14. // //#ifndef _TemplateTypes_H_ //#define _TemplateTypes_H_ //#include "java/lang/Enum.h" typedef enum { TemplateTypes_Grid = 0, TemplateTypes_Question = 1, TemplateTypes_Banner = 2, TemplateTypes_NavBar = 3, TemplateTypes_Error = 4, TemplateTypes_Layout = 5, } TemplateTypes; //#endif // _TemplateTypes_H_
// // XUISwitchCell.h // XXTExplorer // // Created by Zheng on 28/07/2017. // Copyright © 2017 Zheng. All rights reserved. // #import "XUIBaseCell.h" @interface XUISwitchCell : XUIBaseCell @property (nonatomic, strong) NSNumber *xui_negate; @property (nonatomic, strong) id xui_trueValue; @property (nonatomic, strong) id xui_falseValue; @end
#ifndef crypto_hash_sha512_H #define crypto_hash_sha512_H /* * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, * purposes, you might want to consider crypto_generichash() instead. * Unlike SHA512, crypto_generichash() is not vulnerable to length * extension attacks. */ #include <stddef.h> #include <stdint.h> #include <stdlib.h> #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" # endif extern "C" { #endif #define crypto_hash_sha512_BYTES 64U typedef struct crypto_hash_sha512_state { uint64_t state[8]; uint64_t count[2]; unsigned char buf[128]; } crypto_hash_sha512_state; size_t crypto_hash_sha512_statebytes(void); size_t crypto_hash_sha512_bytes(void); int crypto_hash_sha512(unsigned char *out, const unsigned char *in, unsigned long long inlen); int crypto_hash_sha512_init(crypto_hash_sha512_state *state); int crypto_hash_sha512_update(crypto_hash_sha512_state *state, const unsigned char *in, unsigned long long inlen); int crypto_hash_sha512_final(crypto_hash_sha512_state *state, unsigned char *out); #ifdef __cplusplus } #endif #endif
// Helper macros for constructing BPF bytecode. // // This code looks like it's doing unnecessary work, but most of the // safety checks are optimized away at compile time. // // All checks that should be optimized away have an error message with // the substring "BADBPF". If your compiled binary doesn't contain // that word, all these checks have disappeared. #include <err.h> #include <stddef.h> /* for offsetof */ #include <linux/filter.h> #include <linux/seccomp.h> // TODO(gnoack): Support bpf filters of arbitrary size. #define BPFSIZE 256 // TODO(gnoack): This should ideally be checked at compile time. #define _BPF_STMT(...) do { \ __code[__filter->len] = (struct sock_filter) BPF_STMT(__VA_ARGS__); \ __filter->len++; \ if (__filter->len >= BPFSIZE) { \ errx(1, "BPF code using too much space."); \ } \ } while(0); #define _BPF_JUMP(...) do { \ __code[__filter->len] = (struct sock_filter) BPF_JUMP(__VA_ARGS__); \ __filter->len++; \ if (__filter->len >= BPFSIZE) { \ errx(1, "BPF code using too much space."); \ } \ } while(0); #define _JMP(j) _BPF_STMT(BPF_JMP+BPF_JA+BPF_K, (j)) #define _JEQ(value, jt, jf) _BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, (value), (jt), (jf)) #define _RET(value) _BPF_STMT(BPF_RET+BPF_K, (value)) #define _OR(value) _BPF_STMT(BPF_ALU+BPF_OR+BPF_K, (value)) #define _AND(value) _BPF_STMT(BPF_ALU+BPF_AND+BPF_K, (value)) #define _SET_X_TO_A() _BPF_STMT(BPF_MISC+BPF_TAX, 0) #define _SET_A_TO_X() _BPF_STMT(BPF_MISC+BPF_TXA, 0) #define _NOP() _JMP(0) // Gets optimized away by the x86 BPF JIT. #define _LD_STRUCT_VALUE(field) \ _BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ offsetof(struct seccomp_data, field)) // TODO(gnoack): Double check whether LD_ARG(n) is platform independent. #define _LD_ARCH() _LD_STRUCT_VALUE(arch) #define _LD_NR() _LD_STRUCT_VALUE(nr) #define _LD_ARG(n) _LD_STRUCT_VALUE(args[n]) #define _RET_EQ(value, result) \ _JEQ((value), 0, 1); \ _RET((result)) #define _RET_NEQ(value, result) \ _JEQ((value), 1, 0); \ _RET((result)) // ------------------------------------------------------------------- // Define the implicit place to gather BPF code. // ------------------------------------------------------------------- #define BPFFILTER(name) \ struct sock_filter __code[BPFSIZE]; \ struct sock_fprog name = { \ .len = 0, \ .filter = __code, \ }; \ struct sock_fprog* __filter = &name; // Use this to append to an existing sock_fprog*. #define BPFINTO(progptr) \ struct sock_filter* __code = progptr->filter; \ struct sock_fprog* __filter = progptr; // ------------------------------------------------------------------- // Tracking labels in BPF code // ------------------------------------------------------------------- // In BPF, you can only jump downwards. At the callsite, we store the // current code position into a callsites struct with the label's name. // At the jump target where the label is declared, we retroactively // fill in the JT, JF or K values in the callsites. // // A well-optimizing compiler will optimize away most of the relevant // code, as long as the jumps are always skipping the same number of // instructions. #define _MAX_CALLSITES 10 typedef struct { int ip; enum { JT = 0, JF = 1, K = 2, } argtype; } callsite; typedef struct { callsite callsite[_MAX_CALLSITES]; int count; } callsites; #define DECLARELABEL(name) \ callsites __##name##_callsites = { .count = 0 }; #define TO_GENERIC(name, type) \ (__##name##_callsites.callsite[__##name##_callsites.count++] = \ (callsite) { .ip = __filter->len, .argtype = type, }, \ __##name##_callsites.count > _MAX_CALLSITES ? \ errx(1, "BADBPF: Too many callsites for " #name) : 0, \ 0) #define TO(name) TO_GENERIC(name, K) #define THEN_TO(name) TO_GENERIC(name, JT) #define ELSE_TO(name) TO_GENERIC(name, JF) // TODO(gnoack): Detect unknown callsite type at compile time. #define LABEL(name) \ for (int i=0; i<__##name##_callsites.count; i++) { \ int csip = __##name##_callsites.callsite[i].ip; \ switch (__##name##_callsites.callsite[i].argtype) { \ case K: \ __code[csip].k = __filter->len - csip - 1; \ break; \ case JT: \ __code[csip].jt = __filter->len - csip - 1; \ break; \ case JF: \ __code[csip].jf = __filter->len - csip - 1; \ break; \ default: \ errx(1, "Unknown callsite type. (Is " #name " called?)"); \ } \ }
/** * @file scheduler.h * @author Alex Thorne * @version 1.0 */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <Arduino.h> class Scheduler { public: Scheduler(void); void ScheduleFunction(void (*f)(void), uint16_t update_period_ms); void Update(void); private: //private vars uint16_t update_period; unsigned long last_update; void (*function)(void); }; #endif
// // TabBarView.h // Waratahs // // Created by Pruthvi on 20/02/14. // Copyright (c) 2014 Bryce Redd. All rights reserved. // #import <UIKit/UIKit.h> @interface TabBarView : UIView @property(nonatomic) CGPoint startPoint; @property(nonatomic) CGPoint endPoint; -(void)setLinesPath:(CGPoint)startPoint toPoint:(CGPoint)endPoint; @end
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "Stocks.h" float getTotalDollarAmount(void * S) { return (((Stock*)S)->closingSharePrice) * (((Stock*)S)->numberOfShares); } float getPercentChange(void * S) { float closing = (((Stock*)S)->closingSharePrice); float opening = (((Stock*)S)->openingSharePrice); return ((closing - opening) / opening); } float getPrice(void * S) { float closing = (((Stock*)S)->closingSharePrice); return closing; } void toString(void * S) { Stock * stock = (Stock*)S; printf("%s, Closing: %f, Opening: %f, Num %d, Change: %f, Total: %f \n", stock->stockSymbol, stock->closingSharePrice, stock->openingSharePrice, stock->numberOfShares, stock->getPercentChange(stock), stock->getTotalDollarAmount(stock)); } Stock * Stock_create(char *name, float closingSharePrice, float openingSharePrice, int numberOfShares){ int nameLen = strlen(name); Stock *stock = (Stock *) malloc (sizeof(Stock)); stock->stockSymbol = (char *) malloc(sizeof(char)*nameLen+1); strcpy(stock->stockSymbol, name); stock->closingSharePrice = closingSharePrice; stock->openingSharePrice = openingSharePrice; stock->numberOfShares = numberOfShares; stock->getPrice = getPrice; stock->getTotalDollarAmount = getTotalDollarAmount; stock->getPercentChange = getPercentChange; stock->toString = toString; }
#pragma once #include "layout_primitives.h" namespace agge { class layout_builder : noncopyable { public: struct state { real_t extent; count_t next; bool operator !() const; bool operator <(const state &rhs) const; }; public: layout_builder(positioned_glyphs_container_t &glyphs, glyph_runs_container_t &glyph_runs, text_lines_container_t &text_lines); void begin_style(const shared_ptr<font> &font_); std::pair<glyph_index_t, real_t> current_glyph(codepoint_t codepoint) const; void append_glyph(glyph_index_t index, real_t extent); void trim_current_line(const state &at); bool break_current_line(); const state &get_state() const; void break_current_line(const state &at, const state &resume_at); private: bool commit_line(); private: state _state; glyph_run *_current_run; text_line *_current_line; real_t _implicit_height; positioned_glyphs_container_t &_glyphs; glyph_runs_container_t &_glyph_runs; text_lines_container_t &_text_lines; }; inline void layout_builder::append_glyph(glyph_index_t index, real_t extent) { positioned_glyph &pg = _glyphs[static_cast<count_t>(_state.next++)]; pg.index = index; pg.d.dx = extent /* TODO: ... * stepping */, pg.d.dy = real_t(); _state.extent += extent; } inline const layout_builder::state &layout_builder::get_state() const { return _state; } }
#pragma once #include "BaseAction.h" class HunkerAction : public BaseAction { private: virtual void _Execute(float dTime); public: HunkerAction(Character* owner); ~HunkerAction(); #ifndef NETWORK_SERVER static HunkerAction* Read(RakNet::BitStream& bsIn); #endif #ifdef NETWORK_SERVER virtual void Write(RakNet::BitStream& bs); #endif };
#ifndef __TYPES_H__ #define __TYPES_H__ #if _MSC_VER>1300 typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; #else #include <stdint.h> #endif #endif
/// \file FileListNodeContext.h /// /// This file is part of RakNet Copyright 2003 Jenkins Software LLC /// /// Usage of RakNet is subject to the appropriate license agreement. #ifndef __FILE_LIST_NODE_CONTEXT_H #define __FILE_LIST_NODE_CONTEXT_H #include "BitStream.h" struct FileListNodeContext { FileListNodeContext() {} FileListNodeContext(unsigned char o, unsigned int f) : op(o), fileId(f) {} ~FileListNodeContext() {} unsigned char op; unsigned int fileId; }; inline RakNet::BitStream& operator<<(RakNet::BitStream& out, FileListNodeContext& in) { out.Write(in.op); out.Write(in.fileId); return out; } inline RakNet::BitStream& operator>>(RakNet::BitStream& in, FileListNodeContext& out) { in.Read(out.op); bool success = in.Read(out.fileId); assert(success); return in; } #endif
/* register_types.h */ void register_gdsqlite_types(); void unregister_gdsqlite_types();
#include <QFileSystemWatcher> #ifndef WATCHER_H #define WATCHER_H class Watcher : public QFileSystemWatcher { Q_OBJECT Q_PROPERTY(QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged) Q_PROPERTY(QString folderName READ folderName WRITE setFolderName NOTIFY folderNameChanged) QString m_fileName; QString m_folderName; public: Watcher(QObject *parent = 0); const QString& fileName() const { return m_fileName; } const QString folderName() const { return m_folderName; } signals: void fileNameChanged(const QString& fileName); void folderNameChanged(const QString& folderName); public slots: void setFileName(const QString&); void setFolderName(const QString&); void rmLastFileName(); private: // const QString& m_folderName; // const QString& m_fileName; }; #endif // WATCHER_H
/* Parser and operations for parsing objects, arrays, booleans, strings, and numbers. Parse functions return 1 on success. On failure they update the parser's 'err' field with an error message for printing. */ #include <stdlib.h> #include <lua.h> #include <lauxlib.h> #include "lex.h" #include "parse.h" #define MAX_ERR (1024) struct parser { struct lexer *lex; struct token *lookahead; // keep track of last token for deletion struct token *old; char err[MAX_ERR]; }; struct parser *parser_make(const char *str); static int parse_string(lua_State *L, struct parser *p); static int parse_number(lua_State *L, struct parser *p); static int parse_boolean(lua_State *L, struct parser *p); static int parse_array(lua_State *L, struct parser *p); static int parse_object(lua_State *L, struct parser *p); static int parse_token(lua_State *L, struct parser *p); // TODO: replace use of *p->pos with next(p) struct parser *parser_make(const char *str) { struct parser *p = malloc(sizeof(struct parser)); if (p == NULL) { return NULL; } p->lex = lex_make(str); if (p->lex == NULL) { return NULL; } p->lookahead = next_token(p->lex); p->old = NULL; return p; } struct token *next(struct parser *p) { struct token *tk; // TODO: remove TT_END checks, NULL indicates end of string if (p->lookahead == NULL || p->lookahead->typ == TT_END) return p->lookahead; if (p->old != NULL) free(p->old); tk = p->lookahead; p->old = tk; p->lookahead = next_token(p->lex); return tk; } struct token *peek(struct parser *p) { return p->lookahead; } static int parse_token(lua_State *L, struct parser *p) { struct token *tk; if ((tk = peek(p)) == NULL) { sprintf(p->err, "%d:%d: unexpected token %c", p->lex->line, p->lex->col, *p->lex->pos); lua_pushstring(L, p->err); lua_error(L); return 0; } switch (tk->typ) { case TT_STR: if (parse_string(L, p) != 1) return 0; break; case TT_NUM: if (parse_number(L, p) != 1) return 0; break; case TT_TRUE: case TT_FALSE: if (parse_boolean(L, p) != 1) return 0; break; case TT_NULL: lua_pushnil(L); next(p); break; case TT_AOPEN: if (parse_array(L, p) != 1) return 0; break; case TT_OOPEN: if (parse_object(L, p) != 1) return 0; break; default: sprintf(p->err, "couldn't parse token %s", tt_strings[tk->typ]); lua_pushstring(L, p->err); lua_error(L); } return 1; } // NOTE: assumes lookahead->typ is TT_TRUE or TT_FALSE static int parse_boolean(lua_State *L, struct parser *p) { struct token *tk = next(p); lua_pushboolean(L, tk->typ == TT_TRUE ? 1 : 0); return 1; } static int parse_number(lua_State *L, struct parser *p) { struct token *tk = next(p); int num; // TODO: hack while number parsing not implemented char *tmp = malloc(sizeof(char) * (tk->len + 1)); sprintf(tmp, "%.*s", tk->len, tk->str); num = atoi(tmp); free(tmp); lua_pushnumber(L, num); return 1; } static int parse_string(lua_State *L, struct parser *p) { struct token *tk = next(p); lua_pushlstring(L, tk->str, tk->len); return 1; } int l_parse(lua_State *L) { const char *jsonstring; struct parser *p; int n = lua_gettop(L); if (n != 1 || !lua_isstring(L, 1)) { lua_pushstring(L, "parse requires a single string argument"); lua_error(L); } jsonstring = lua_tostring(L, 1); if ((p = parser_make(jsonstring)) == NULL) { sprintf(p->err, "could not make parser"); lua_pushstring(L, p->err); lua_error(L); } if (!parse_token(L, p)) { free(p->lex); free(p); lua_pushstring(L, p->err); lua_error(L); } free(p->lex); if (p->old != NULL) free(p->old); free(p); return 1; } int expect(struct parser *p, tt typ) { struct token *tk = peek(p); if (tk == NULL) { sprintf(p->err, "%d:%d: unexpected token", p->lex->line, p->lex->col); if (*p->lex->pos == '\0') sprintf(p->err, "%s %s", p->err, "end of json"); else sprintf(p->err, "%s %c", p->err, *p->lex->pos); return 0; } if (tk->typ != typ) { sprintf(p->err, "%d:%d: expected %s but got %s", p->lex->line, p->lex->col, tt_strings[typ], tt_strings[tk->typ]); return 0; } next(p); return 1; } static int parse_array(lua_State *L, struct parser *p) { struct token *tk = peek(p); int index = 1; lua_newtable(L); if (!expect(p, TT_AOPEN)) return 0; for (; tk != NULL && tk->typ != TT_ACLOSE && tk->typ != TT_END; tk = peek(p)) { lua_pushnumber(L, index++); if (!parse_token(L, p)) return 0; lua_settable(L, -3); if (!expect(p, TT_COMMA)) break; } return expect(p, TT_ACLOSE); } static int parse_object(lua_State *L, struct parser *p) { struct token *tk = peek(p); lua_newtable(L); if (!expect(p, TT_OOPEN)) return 0; for (; tk != NULL && tk->typ != TT_OCLOSE && tk->typ != TT_END; tk = peek(p)) { if (!parse_string(L, p)) return 0; if (!expect(p, TT_COLON)) return 0; if (!parse_token(L, p)) return 0; lua_settable(L, -3); if (!expect(p, TT_COMMA)) break; } return expect(p, TT_OCLOSE); }
/*******************************************************************************/ /* Copyright (C) 1994 - 2007, Performance Dynamics Company */ /* */ /* This software is licensed as described in the file COPYING, which */ /* you should have received as part of this distribution. The terms */ /* are also available at http://www.perfdynamics.com/Tools/copyright.html. */ /* */ /* You may opt to use, copy, modify, merge, publish, distribute and/or sell */ /* copies of the Software, and permit persons to whom the Software is */ /* furnished to do so, under the terms of the COPYING file. */ /* */ /* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY */ /* KIND, either express or implied. */ /*******************************************************************************/ /* * mm1_test.c * * Check MSQ with m = 1 against standard node. * * Created by NJG on Wed, Apr 4, 2007 * * $Id: mm1_test.c,v 1.3 2009/04/03 02:19:40 pfeller Exp $ */ #include <stdio.h> #include <string.h> #include <math.h> #include "PDQ_Lib.h" //---------------------------------------------------------------------------- main() { //----- Model specific variables ----- int nodes; int streams; double arrivRate = 0.75; double servTime = 1.00; PDQ_Init("M/M/1 Test Cases"); streams = PDQ_CreateOpen("work", arrivRate); nodes = PDQ_CreateNode("Standard", CEN, FCFS); nodes = PDQ_CreateNode("Multinode", 1, MSQ); PDQ_SetDemand("Standard", "work", servTime); PDQ_SetDemand("Multinode", "work", servTime); PDQ_Solve(CANON); PDQ_Report(); } // main
/* * ProjectEuler/src/c/Problem119.c * * Digit power sum * =============== * Published on Friday, 7th April 2006, 06:00 pm * * The number 512 is interesting because it is equal to the sum of its digits * raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a * number with this property is 614656 = 284. We shall define an to be the nth * term of this sequence and insist that a number must contain at least two * digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30. */ #include <stdio.h> #include "ProjectEuler/ProjectEuler.h" #include "ProjectEuler/Problem119.h" int main(int argc, char** argv) { return 0; }
// »ªÇڿƼ¼°æÈ¨ËùÓÐ 2010-2011 // // ÎļþÃû£ºMainWindow.h // ¹¦ ÄÜ£ºÖ÷½çÃæ´°¿Ú¡£ // // ×÷ ÕߣºSharpui¿ª·¢×é // ʱ ¼ä£º2013-01-02 // // ============================================================================ #ifndef _MAINWINDOW_H_ #define _MAINWINDOW_H_ // // <Summary> // ÑÝʾ°´Å¥µÄCommandºÍÊý¾Ý°ó¶¨¹¦ÄÜ£» // Command¹¦ÄÜÔÊÐíÓû§¶¨ÒåµÄÊý¾Ý½ÓÊÕ²¢´¦Àí°´Å¥µÄµã»÷ÃüÁî // Êý¾Ý°ó¶¨¹¦ÄÜÑÝʾÁ˰´Å¥µÄÄÚÈݸù¾ÝÓû§Êý¾Ý±ä»¯¶ø±ä»¯¡£ // </Summary> // class BindingData : public suic::ICommand, public suic::NotifyPropChanged { public: BeginMember(BindingData, suic::NotifyPropChanged) MemberString(ButtonName) EndMember() RTTIOfClass(BindingData) BindingData() { _btnName = "Bind Button"; } bool CanExecute(suic::Object* target, suic::Object* param) { return false; } void Execute(suic::Object* target, suic::Object* param) { } suic::String GetButtonName() { return _btnName; } void SetButtonName(suic::String val) { _btnName = val; NotifyChanged("ButtonName"); } suic::String ToString() { return _btnName; } private: suic::String _btnName; }; class MainWindow : public suic::Window { public: MainWindow(); ~MainWindow(); void OnInitialized(suic::EventArg* e); void OnLoaded(suic::LoadedEventArg* e); void OnPopupWindow(suic::Element* sender, suic::RoutedEventArg* e); void OnCheckedChanged(suic::Element* sender, suic::RoutedEventArg* e); protected: // ´´½¨×Ô¼ºµÄ¿Ø¼þ¶ÔÏó bool OnBuild(suic::IXamlNode* pNode, suic::ObjectPtr& obj); void OnConnect(suic::IXamlNode* pNode, suic::Object* target); private: void RegisterButtonEvent(); }; #endif
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Collections\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_UNO_COLLECTIONS_LIST__FUSE_INPUT_KEY_RELEASED_HANDLER_H__ #define __APP_UNO_COLLECTIONS_LIST__FUSE_INPUT_KEY_RELEASED_HANDLER_H__ #include <app/Uno.Collections.IEnumerable__Fuse_Input_KeyReleasedHandler.h> #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Uno { namespace Collections { struct List1_Enumerator__Fuse_Input_KeyReleasedHandler; } } } namespace app { namespace Uno { namespace Collections { struct List__Fuse_Input_KeyReleasedHandler; struct List__Fuse_Input_KeyReleasedHandler__uType : ::uClassType { ::app::Uno::Collections::IEnumerable__Fuse_Input_KeyReleasedHandler __interface_0; }; List__Fuse_Input_KeyReleasedHandler__uType* List__Fuse_Input_KeyReleasedHandler__typeof(); ::uObject* List__Fuse_Input_KeyReleasedHandler__GetEnumerator_boxed(List__Fuse_Input_KeyReleasedHandler* __this); void List__Fuse_Input_KeyReleasedHandler___ObjInit(List__Fuse_Input_KeyReleasedHandler* __this); void List__Fuse_Input_KeyReleasedHandler___ObjInit_1(List__Fuse_Input_KeyReleasedHandler* __this, int capacity); void List__Fuse_Input_KeyReleasedHandler__Add(List__Fuse_Input_KeyReleasedHandler* __this, ::uDelegate* item); void List__Fuse_Input_KeyReleasedHandler__AddRange(List__Fuse_Input_KeyReleasedHandler* __this, ::uObject* items); void List__Fuse_Input_KeyReleasedHandler__BoundsCheck(List__Fuse_Input_KeyReleasedHandler* __this, int index); void List__Fuse_Input_KeyReleasedHandler__Clear(List__Fuse_Input_KeyReleasedHandler* __this); bool List__Fuse_Input_KeyReleasedHandler__Contains(List__Fuse_Input_KeyReleasedHandler* __this, ::uDelegate* item); void List__Fuse_Input_KeyReleasedHandler__EnsureCapacity(List__Fuse_Input_KeyReleasedHandler* __this); int List__Fuse_Input_KeyReleasedHandler__get_Count(List__Fuse_Input_KeyReleasedHandler* __this); ::uDelegate* List__Fuse_Input_KeyReleasedHandler__get_Item(List__Fuse_Input_KeyReleasedHandler* __this, int index); ::app::Uno::Collections::List1_Enumerator__Fuse_Input_KeyReleasedHandler List__Fuse_Input_KeyReleasedHandler__GetEnumerator(List__Fuse_Input_KeyReleasedHandler* __this); int List__Fuse_Input_KeyReleasedHandler__IndexOf(List__Fuse_Input_KeyReleasedHandler* __this, ::uDelegate* item); void List__Fuse_Input_KeyReleasedHandler__Insert(List__Fuse_Input_KeyReleasedHandler* __this, int index, ::uDelegate* item); List__Fuse_Input_KeyReleasedHandler* List__Fuse_Input_KeyReleasedHandler__New_1(::uStatic* __this); List__Fuse_Input_KeyReleasedHandler* List__Fuse_Input_KeyReleasedHandler__New_2(::uStatic* __this, int capacity); bool List__Fuse_Input_KeyReleasedHandler__Remove(List__Fuse_Input_KeyReleasedHandler* __this, ::uDelegate* item); void List__Fuse_Input_KeyReleasedHandler__RemoveAt(List__Fuse_Input_KeyReleasedHandler* __this, int index); void List__Fuse_Input_KeyReleasedHandler__set_Item(List__Fuse_Input_KeyReleasedHandler* __this, int index, ::uDelegate* value); void List__Fuse_Input_KeyReleasedHandler__Sort(List__Fuse_Input_KeyReleasedHandler* __this, ::uDelegate* comparer); ::uArray* List__Fuse_Input_KeyReleasedHandler__ToArray(List__Fuse_Input_KeyReleasedHandler* __this); struct List__Fuse_Input_KeyReleasedHandler : ::uObject { ::uStrong< ::uArray*> _data; int _used; int _version; ::uObject* GetEnumerator_boxed() { return List__Fuse_Input_KeyReleasedHandler__GetEnumerator_boxed(this); } void _ObjInit() { List__Fuse_Input_KeyReleasedHandler___ObjInit(this); } void _ObjInit_1(int capacity) { List__Fuse_Input_KeyReleasedHandler___ObjInit_1(this, capacity); } void Add(::uDelegate* item) { List__Fuse_Input_KeyReleasedHandler__Add(this, item); } void AddRange(::uObject* items) { List__Fuse_Input_KeyReleasedHandler__AddRange(this, items); } void BoundsCheck(int index) { List__Fuse_Input_KeyReleasedHandler__BoundsCheck(this, index); } void Clear() { List__Fuse_Input_KeyReleasedHandler__Clear(this); } bool Contains(::uDelegate* item) { return List__Fuse_Input_KeyReleasedHandler__Contains(this, item); } void EnsureCapacity() { List__Fuse_Input_KeyReleasedHandler__EnsureCapacity(this); } int Count() { return List__Fuse_Input_KeyReleasedHandler__get_Count(this); } ::uDelegate* Item(int index) { return List__Fuse_Input_KeyReleasedHandler__get_Item(this, index); } ::app::Uno::Collections::List1_Enumerator__Fuse_Input_KeyReleasedHandler GetEnumerator(); int IndexOf(::uDelegate* item) { return List__Fuse_Input_KeyReleasedHandler__IndexOf(this, item); } void Insert(int index, ::uDelegate* item) { List__Fuse_Input_KeyReleasedHandler__Insert(this, index, item); } bool Remove(::uDelegate* item) { return List__Fuse_Input_KeyReleasedHandler__Remove(this, item); } void RemoveAt(int index) { List__Fuse_Input_KeyReleasedHandler__RemoveAt(this, index); } void Item(int index, ::uDelegate* value) { List__Fuse_Input_KeyReleasedHandler__set_Item(this, index, value); } void Sort(::uDelegate* comparer) { List__Fuse_Input_KeyReleasedHandler__Sort(this, comparer); } ::uArray* ToArray() { return List__Fuse_Input_KeyReleasedHandler__ToArray(this); } }; }}} #include <app/Uno.Collections.List1_Enumerator__Fuse_Input_KeyReleasedHandler.h> namespace app { namespace Uno { namespace Collections { inline ::app::Uno::Collections::List1_Enumerator__Fuse_Input_KeyReleasedHandler List__Fuse_Input_KeyReleasedHandler::GetEnumerator() { return List__Fuse_Input_KeyReleasedHandler__GetEnumerator(this); } }}} #endif
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double GDGeoCocoaVersionNumber; FOUNDATION_EXPORT const unsigned char GDGeoCocoaVersionString[];
//Single Linked List - C Program source code #include<stdio.h> #include<stdlib.h> // Node declaration typedef struct Node { int data; struct Node *next; }node; // Insert node into list void insert(node *pointer, int data) { /* Iterate through the list till we encounter the last node.*/ while(pointer->next!=NULL) { pointer = pointer -> next; } /* Allocate memory for the new node and put data in it.*/ pointer->next = (node *)malloc(sizeof(node)); pointer = pointer->next; pointer->data = data; pointer->next = NULL; } // Search for a particular value int find(node *pointer, int key) { pointer = pointer -> next; //First node is dummy node. /* Iterate through the entire linked list and search for the key. */ while(pointer!=NULL) { if(pointer->data == key) //key is found. { return 1; } pointer = pointer -> next;//Search in the next node. } /*Key is not found */ return 0; } // Delete node containing specified data void delete(node *pointer, int data) { /* Go to the node for which the node next to it has to be deleted */ while(pointer->next!=NULL && (pointer->next)->data != data) { pointer = pointer -> next; } if(pointer->next==NULL) { printf("Element %d is not present in the list\n",data); return; } /* Now pointer points to a node and the node next to it has to be removed */ node *temp; temp = pointer -> next; /*temp points to the node which has to be removed*/ pointer->next = temp->next; /*We removed the node which is next to the pointer (which is also temp) */ free(temp); /* Beacuse we deleted the node, we no longer require the memory used for it . free() will deallocate the memory. */ return; } // print the entire list void print(node *pointer) { if(pointer==NULL) { return; } printf("%d ",pointer->data); print(pointer->next); } int main() { /* start always points to the first node of the linked list. temp is used to point to the last node of the linked list.*/ node *start,*temp; start = (node *)malloc(sizeof(node)); temp = start; temp -> next = NULL; /* Here in this code, we take the first node as a dummy node. The first node does not contain data, but it used because to avoid handling special cases in insert and delete functions. */ printf("1. Insert\n"); printf("2. Delete\n"); printf("3. Print\n"); printf("4. Find\n"); while(1) { int query; scanf("%d",&query); if(query==1) { int data; scanf("%d",&data); insert(start,data); } else if(query==2) { int data; scanf("%d",&data); delete(start,data); } else if(query==3) { printf("The list is "); print(start->next); printf("\n"); } else if(query==4) { int data; scanf("%d",&data); int status = find(start,data); if(status) { printf("Element Found\n"); } else { printf("Element Not Found\n"); } } } }
// // SuCaptureCodeView.h // SuUtility // // Created by KevinSu on 15/10/17. // Copyright (c) 2015年 SuXiaoMing. All rights reserved. // #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface SuCaptureCodeView : UIView /* 扫描二维码 */ + (void)startCaptureWithPreView:(UIView *)preView Content:(void(^)(BOOL *stop,AVMetadataMachineReadableCodeObject *content))content; @end
// // TestViewController.h // CardStackNavigationController // // Created by William Chang on 2013-09-05. // Copyright (c) 2013 William Chang. All rights reserved. // #import <UIKit/UIKit.h> @interface TestViewController : UIViewController @end
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "game.h" struct game_s { int nbMove; int nbPieces; piece *arrPieces; int height; int width; }; static int failure(char *msg) { fprintf(stderr, "Error : %s\n", msg); return EXIT_FAILURE; } game new_game(int width, int height, int nb_pieces, piece *pieces) { game newGame = malloc(sizeof (struct game_s)); if (!newGame) failure("new_game_hr alloc newGame"); newGame->nbMove = 0; newGame->nbPieces = nb_pieces; newGame->height = height; newGame->width = width; newGame->arrPieces = malloc(sizeof (piece) * nb_pieces); if (!newGame->arrPieces) { failure("new_game_hr alloc arrPieces"); return NULL; } for (int i = 0; i < nb_pieces; i++) { newGame->arrPieces[i] = new_piece_rh(0, 0, false, false); //Create new piece copy_piece(pieces[i], newGame->arrPieces[i]); //Overwrite new piece with the copy } return newGame; } game new_game_hr(int nb_pieces, piece *pieces) { game newGame = malloc(sizeof (struct game_s)); if (!newGame) failure("new_game_hr alloc newGame"); newGame->nbMove = 0; newGame->nbPieces = nb_pieces; newGame->height = 6; newGame->width = 6; newGame->arrPieces = malloc(sizeof (piece) * nb_pieces); if (!newGame->arrPieces) { failure("new_game_hr alloc arrPieces"); return NULL; } for (int i = 0; i < nb_pieces; i++) { newGame->arrPieces[i] = new_piece_rh(0, 0, false, false); //Create new piece copy_piece(pieces[i], newGame->arrPieces[i]); //Overwrite new piece with the copy } return newGame; } void delete_game(game g) { for (int i = 0; i < g->nbPieces; i++) delete_piece(g->arrPieces[i]); free(g->arrPieces); free(g); } void copy_game(cgame src, game dst) { if (!src || !dst) { failure("copy_game src or dst are NULL"); return; } for (int i = 0; i < dst->nbPieces; i++) delete_piece(dst->arrPieces[i]); free(dst->arrPieces); *dst = *src; dst->arrPieces = malloc(sizeof (piece) * src->nbPieces); if (!dst->arrPieces) { failure("copy_game alloc arrPieces"); return; } for (int i = 0; i < src->nbPieces; i++) { dst->arrPieces[i] = new_piece_rh(0, 0, false, false); //Create new piece copy_piece(src->arrPieces[i], dst->arrPieces[i]); //Overwrite new piece with the copy } } int game_nb_pieces(cgame g) { if (!g) { failure("game_nb_pieces g is NULL"); return -1; } return g->nbPieces; } cpiece game_piece(cgame g, int piece_num) { if (!g) { failure("game_piece g is NULL"); return NULL; } return g->arrPieces[piece_num]; } bool game_over_hr(cgame g) { if (!g) { failure("game_over_hr g is NULL"); return false; } return get_x(g->arrPieces[0]) == g->width - 2 && get_y(g->arrPieces[0]) == 3; } bool play_move(game g, int piece_num, dir d, int distance) { if (!g) { failure("play_move g is NULL"); return false; } piece tmp = new_piece_rh(0, 0, false, false); if (!tmp) { failure("play_move alloc tmp"); return false; } copy_piece(game_piece(g, piece_num), tmp); move_piece(tmp, d, distance); if (get_x(tmp) == get_x(game_piece(g, piece_num)) && get_y(tmp) == get_y(game_piece(g, piece_num))) { delete_piece(tmp); return false; } if (d == LEFT || d == RIGHT) { if ((get_x(tmp) + get_width(tmp)) > game_width(g) || get_x(tmp) < 0) { delete_piece(tmp); return false; } } else { if ((get_y(tmp) + get_height(tmp)) > game_height(g) || get_y(tmp) < 0) { delete_piece(tmp); return false; } } for (int i = 0; i < game_nb_pieces(g); i++) { if (i == piece_num) continue; if (intersect(tmp, game_piece(g, i))) { delete_piece(tmp); return false; } } delete_piece(g->arrPieces[piece_num]); g->arrPieces[piece_num] = tmp; g->nbMove += distance; return true; } int game_nb_moves(cgame g) { if (!g) { failure("game_nb_moves g is NULL"); return -1; } return g->nbMove; } int game_width(cgame g) { if (!g) { failure("game_width g is NULL"); return -1; } return g->width; } int game_height(cgame g) { if (!g) { failure("game_height g is NULL"); return -1; } return g->height; } int game_square_piece(game g, int x, int y) { if (!g) { failure("game_square_piece g is NULL"); return -1; } piece pieceTest = new_piece(x, y, 1, 1, 1, 1); for (int i = 0; i < game_nb_pieces(g); i++) { if (intersect(pieceTest, game_piece(g, i))) return i; } return -1; }
// // MyWalletVC.h // MaShangTong // // Created by q on 15/12/10. // Copyright © 2015年 NY. All rights reserved. // #import <UIKit/UIKit.h> @class MyMoney; @class MyChit; @class myWalletModel; @class GSrechargeVC; @interface MyWalletVC : UIViewController<UIAlertViewDelegate> @property (nonatomic,strong)MyMoney *moneyView; @property (nonatomic,strong)MyChit *chitView; @property (nonatomic,strong)GSrechargeVC *rechargeVC; @property (nonatomic,strong)myWalletModel *myWallet; @end
/* * Utils.h * * Created on: Mar 25, 2017 * Author: vgomeniuk */ #ifndef UTILS_H_ #define UTILS_H_ #include <iostream> #include <SDL.h> namespace particleapp { // Handle SDL events bool processEvents() { SDL_Event event; // Event handler while(SDL_PollEvent(&event)){ if (event.type == SDL_QUIT){ std::cout << "Close window event." << std::endl; return false; } } return true; }; } #endif /* UTILS_H_ */
#include "main.h" U16_T far AO_feedback[16]; U32_T far sum_feedback[16]; U8_T pic_cmd_index;// = GET_VERSION; U8_T count_read_pic_Rev = 0; U8_T get_verion; #define MAX_READ_FEEDBACK 1 extern UN_RELAY relay_value; #define STACK_PIC 50 typedef struct { U8_T cmd; U8_T value; U8_T flag; U8_T retry; }STR_PIC_CMD; typedef enum { WRITE_PIC_OK = 0,WAIT_PIC_FOR_WRITE}; STR_PIC_CMD far pic_wirte[STACK_PIC]; #define I2C_STOP_COND 0 // no used U8_T tmpdata[50]; U8_T I2C_RdmRead(U8_T cmd,U8_T *ptPktTemp,U16_T readLen) { u8 temp = 0; u8 i; IIC_Start(); IIC_Send_Byte(0xc0); //·¢ËÍÆ÷¼þµØÖ·0Xc0,дÊý¾Ý if(IIC_Wait_Ack()) { // IIC_Stop(); // return 0; } IIC_Send_Byte(cmd); //·¢Ë͵͵ØÖ· IIC_Wait_Ack1(); IIC_Start(); IIC_Send_Byte(0xc1); //½øÈë½ÓÊÕģʽ if(IIC_Wait_Ack()) { // IIC_Stop(); // return 0; } for(i = 0;i < readLen - 1;i++) { *ptPktTemp++ = IIC_Read_Byte(1); } *ptPktTemp++ = IIC_Read_Byte(0); IIC_Stop(); //²úÉúÒ»¸öÍ£Ö¹Ìõ¼þ return TRUE; } U8_T I2C_ByteWrite(U16_T cmd, U16_T byteData) { IIC_Start(); IIC_Send_Byte(0xc0); //·¢ËÍÆ÷¼þµØÖ·0Xc0,дÊý¾Ý IIC_Wait_Ack(); IIC_Send_Byte(cmd); //·¢Ë͵͵ØÖ· IIC_Wait_Ack(); IIC_Send_Byte(byteData); //·¢ËÍ×Ö½Ú IIC_Wait_Ack(); IIC_Stop(); //²úÉúÒ»¸öÍ£Ö¹Ìõ¼þ delay_ms(3); return TRUE; } void push_cmd_to_picstack(uint8 cmd, uint8 value) { U8_T i; for(i = 0;i < STACK_PIC;i++) { if(pic_wirte[i].flag == WRITE_PIC_OK) break; } if(i == STACK_PIC) { // stack full // tbd return; } else { pic_wirte[i].cmd = cmd; pic_wirte[i].value = value; pic_wirte[i].flag = WAIT_PIC_FOR_WRITE; pic_wirte[i].retry = 0; } } U8_T check_write_to_pic(void) { U8_T i; for(i = 0;i < STACK_PIC;i++) { if(pic_wirte[i].flag == WAIT_PIC_FOR_WRITE) // get current index, 1 -- WAIT_PIC_FOR_WRITE, 0 -- WRITE_PIC_OK { if(pic_wirte[i].retry < 5) { pic_wirte[i].retry++; break; } else { // retry 10 time, give up pic_wirte[i].flag = WRITE_PIC_OK; } } } if(i == STACK_PIC) // no WAIT_PIC_FOR_WRITE { return 0; // no cmd in pic stack } if(I2C_ByteWrite(pic_wirte[i].cmd, pic_wirte[i].value) == TRUE) { pic_wirte[i].flag = WRITE_PIC_OK; // without doing checksum } return 1; // write pic cmd } void PIC_initial_data(void) { pic_cmd_index = GET_VERSION; count_read_pic_Rev = 0; memset(pic_wirte,0,sizeof(STR_PIC_CMD) * STACK_PIC); get_verion = 0; } void PIC_refresh(void) { if((Modbus.mini_type == MINI_NEW_TINY) || (Modbus.mini_type == MINI_TINY_ARM)) return; if((Modbus.mini_type == MINI_TINY) && (Modbus.hardRev >= STM_TINY_REV)) { // TINY with ARM TOP, do not have PIC flag_output = 0; return; } // if((Modbus.mini_type == MINI_TINY) && (Modbus.hardRev >= STM_TINY_REV)) { // NEW ARM'S LB, do not have PIC return; } if(count_read_pic_Rev >= 10) { if(count_read_pic_Rev == 10) { count_read_pic_Rev = 100; generate_common_alarm(ALARM_LOST_PIC); } flag_output = 0; return; } check_write_to_pic(); if(pic_cmd_index == GET_VERSION) { count_read_pic_Rev++; if(I2C_RdmRead(GET_VERSION, tmpdata,1) == TRUE) { Modbus.PicVer = tmpdata[0]; //Setting_Info.reg.pro_info.frimware_pic = Modbus.PicVer; if(Modbus.PicVer > 0) // old code have trouble, maybe get 130 { get_verion = 1; } // if get right pic ver, dont need to send this cmd again } else { //I2C_Setup(I2C_ENB|I2C_STANDARD|I2C_MST_IE|I2C_7BIT|I2C_MASTER_MODE, 0xc7, 0x005A); } } else if(pic_cmd_index == READ_AO_FEEDBACK)// if(pic_cmd_index <= READ_AO12_FEEDBACK_H) // read cmd { U8_T i; #if MINI if(Setting_Info.reg.pro_info.firmware_c8051 < 30) // old top board { if(Modbus.mini_type == MINI_TINY) // tiny has 11 inputs { if(I2C_RdmRead(pic_cmd_index, tmpdata,24) == TRUE) { for(i = 0;i < 11;i++) { input_raw[i] = Filter(i,(U16_T)(tmpdata[i * 2] << 8) + tmpdata[i * 2 + 1]); } } } } #endif } if(get_verion != 1) { pic_cmd_index = GET_VERSION; } else { pic_cmd_index = READ_AO_FEEDBACK; } } void Read_feedback(void) { U8_T i,j; for(j = 0;j < MAX_READ_FEEDBACK;) if(I2C_RdmRead(READ_AO_FEEDBACK, tmpdata,24) == TRUE) { j++; for(i = 0;i < 12;i++) { if((Modbus.mini_type == MINI_TINY) && (i < 11)) // tiny has 11 inputs { input_raw[i] = Filter(i,(U16_T)(tmpdata[i * 2] << 8) + tmpdata[i * 2 + 1]); } else if(Modbus.mini_type == MINI_VAV && i < 6) { input_raw[i] = Filter(i,(U16_T)(tmpdata[i * 2] << 8) + tmpdata[i * 2 + 1]); } else // big and samll { if((Modbus.mini_type == MINI_SMALL) || (Modbus.mini_type == MINI_SMALL_ARM)) { // SMALL hardware maybe need fix a little bit if(i == 3) sum_feedback[0] += (U16_T)(tmpdata[i * 2] << 8) + tmpdata[i * 2 + 1]; else if(i <= 2) sum_feedback[i + 1] += (U16_T)(tmpdata[i * 2] << 8) + tmpdata[i * 2 + 1]; else AO_feedback[i] = 0; } else { sum_feedback[i] += (U16_T)(tmpdata[i * 2] << 8) + tmpdata[i * 2 + 1]; } if(j == MAX_READ_FEEDBACK) { AO_feedback[i] = (float)sum_feedback[i] * 1000 / 1017 / j; sum_feedback[i] = 0; } } } } }
#ifndef CMSCONTROLLER_H #define CMSCONTROLLER_H #include "applicationcontroller.h" #include "admins.h" class T_CONTROLLER_EXPORT CmsController : public ApplicationController { Q_OBJECT public: CmsController() { } CmsController(const CmsController &other); QString a; QString b; public slots: void index(); void show_operator(const QString &pk); void show_manager(const QString &pk); void entry(); void newmanager(); void createmanager(); void changemanager(const QString &managerID); void change(); void cgstatus(const QString &managerID); void create(); void admin_login(); void adminlogin(); void admin_center(const QString &adminID); void operator_login(); void operatorlogin(); void operator_center(const QString &operatorID); void list_operator(const QString &adminID); void list_log(const QString &adminID); void search_operator(); void search_manager(); void list_manager(); void delete_operator(const QString &pk); void change_status(const QString &operatorID); void refresh(); void edit(const QString &pk); void save(const QString &pk); void savemanager(const QString &pk); void remove(const QString &pk); private: void renderEntry(const QVariantMap &cms = QVariantMap()); void renderEdit(const QVariantMap &operators = QVariantMap()); void renderEdit2(const QVariantMap &assetsunitmanager = QVariantMap()); void renderEntry2(const QVariantMap &assetsunitmanager = QVariantMap()); //void renderChange(const QVariantMap &assetsunitmanager = QVariantMap()); }; T_DECLARE_CONTROLLER(CmsController, cmscontroller) #endif // CMSCONTROLLER_H
#ifndef COMMON_TEXT_FILE_H #define COMMON_TEXT_FILE_H #include <string> #include <vector> #include "common/macros.h" namespace sicxe { class TextFile { public: DISALLOW_COPY_AND_MOVE(TextFile); struct Position { Position(); Position(int the_row, int the_column, int the_size); int row; int column; int size; }; static const size_t kReadBufferSize; TextFile(); ~TextFile(); bool Open(const std::string& the_file_name); bool Save() const; bool Save(const std::string& destination) const; const std::string& file_name() const; void set_file_name(const std::string& new_file_name); const std::vector<std::string>& lines() const; std::vector<std::string>* mutable_lines(); private: std::string file_name_; std::vector<std::string> lines_; }; } // namespace sicxe #endif // COMMON_TEXT_FILE_H
// Copyright (c) 2014 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHAINPARAMSBASE_H #define BITCOIN_CHAINPARAMSBASE_H #include <string> #include <vector> /** * CBaseChainParams defines the base parameters (shared between dash-cli and dashd) * of a given instance of the Dash system. */ class CBaseChainParams { public: enum Network { MAIN, TESTNET, REGTEST, UNITTEST, MAX_NETWORK_TYPES }; const std::string& DataDir() const { return strDataDir; } int RPCPort() const { return nRPCPort; } protected: CBaseChainParams() {} int nRPCPort; std::string strDataDir; Network networkID; }; /** * Return the currently selected parameters. This won't change after app startup * outside of the unit tests. */ const CBaseChainParams& BaseParams(); /** Sets the params returned by Params() to those for the given network. */ void SelectBaseParams(CBaseChainParams::Network network); /** * Looks for -regtest or -testnet and returns the appropriate Network ID. * Returns MAX_NETWORK_TYPES if an invalid combination is given. */ CBaseChainParams::Network NetworkIdFromCommandLine(); /** * Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate. * Returns false if an invalid combination is given. */ bool SelectBaseParamsFromCommandLine(); /** * Return true if SelectBaseParamsFromCommandLine() has been called to select * a network. */ bool AreBaseParamsConfigured(); #endif // BITCOIN_CHAINPARAMSBASE_H
// // NDBAppContext.h // NDBAPIManager // // Created by TJBT on 15/9/15. // Copyright (c) 2015年 TIANJIN BEITA TECHNOLOGY CO.,LTD. All rights reserved. // #import <Foundation/Foundation.h> #import "JLYNetworkingConfiguration.h" NS_ASSUME_NONNULL_BEGIN @interface JLYAppContext : NSObject //凡是未声明成readonly的都是需要在初始化的时候由外面给的 @property (nonatomic, copy) NSString *channelID; //渠道号 @property (nonatomic, copy) NSString *appName; //应用名称 @property (nonatomic, assign) JLYAppType appType; @property (nonatomic, copy, readonly) NSString *cid; //城市id @property (nonatomic, copy, readonly) NSString *m; //设备名称 @property (nonatomic, copy, readonly) NSString *o; //系统名称 @property (nonatomic, copy, readonly) NSString *v; //系统版本 @property (nonatomic, copy, readonly) NSString *cv; //Bundle版本 @property (nonatomic, copy, readonly) NSString *from; //请求来源,值都是@"mobile" @property (nonatomic, copy, readonly) NSString *ostype2; //操作系统类型 @property (nonatomic, copy, readonly) NSString *qtime; //发送请求的时间 @property (nonatomic, copy, readonly) NSString *macid; @property (nonatomic, copy, readonly) NSString *uuid; @property (nonatomic, copy, readonly) NSString *udid2; @property (nonatomic, copy, readonly) NSString *uuid2; @property (nonatomic, copy, readonly) NSString *i; @property (nonatomic, copy, readonly) NSString *pm; //渠道号 @property (nonatomic, readonly) BOOL isReachable; // log相关的参数 @property (nonatomic, copy) NSString *currentPageNumber; //当前controller的pageNumber,记log用 @property (nonatomic, copy) NSString *uid; //登录用户token @property (nonatomic, copy) NSString *chatid; //登录用户chat id @property (nonatomic, copy) NSString *ccid; // 用户选择的城市id @property (nonatomic, copy, readonly) NSString *gcid; // 用户当前所在城市的id @property (nonatomic, copy, readonly) NSString *bp; //上一个页面的pageNumber,记log用 @property (nonatomic, copy, readonly) NSString *guid; @property (nonatomic, copy, readonly) NSString *net; @property (nonatomic, copy, readonly) NSString *ip; @property (nonatomic, copy, readonly) NSString *geo; @property (nonatomic, copy, readonly) NSString *ver; // log 版本 @property (nonatomic, copy, readonly) NSString *dvid; @property (nonatomic, copy, readonly) NSString *mac; @property (nonatomic, copy, readonly) NSString *p; @property (nonatomic, copy, readonly) NSString *os; @property (nonatomic, copy, readonly) NSString *app; @property (nonatomic, copy, readonly) NSString *ch; @property (nonatomic, copy, readonly) NSString *ct; @property (nonatomic, copy, readonly) NSString *pmodel; + (instancetype)sharedInstance; - (void)configWithChannelID:(NSString *)channelID appName:(NSString *)appName appType:(JLYAppType)appType ccid:(NSString *)ccid; @end NS_ASSUME_NONNULL_END
// // NSString+bundleVersion.h // ipPort.New // // Created by Dmitriy Zadoroghniy on 18.12.13. // Copyright (c) 2013 ipPort. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (bundleVersion) + (NSString *) bundleVersion; + (NSString *) bundleShortVersionString; @end
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17.c Label Definition File: CWE78_OS_Command_Injection.one_string.label.xml Template File: sources-sink-17.tmpl.c */ /* * @description * CWE: 78 OS Command Injection * BadSource: listen_socket Read data using a listen socket (server side) * GoodSource: Fixed string * Sink: system * BadSink : Execute command in data using system() * Flow Variant: 17 Control flow: for loops * * */ #include "std_testcase.h" #include <wchar.h> #ifdef _WIN32 #define FULL_COMMAND L"%WINDIR%\\system32\\cmd.exe /c dir " #else #include <unistd.h> #define FULL_COMMAND L"/bin/sh ls -la " #endif #ifdef _WIN32 #include <winsock2.h> #include <windows.h> #include <direct.h> #pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */ #define CLOSE_SOCKET closesocket #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define CLOSE_SOCKET close #define SOCKET int #endif #define TCP_PORT 27015 #define LISTEN_BACKLOG 5 #ifdef _WIN32 #define SYSTEM _wsystem #else /* NOT _WIN32 */ #define SYSTEM system #endif #ifndef OMITBAD void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_bad() { int i; wchar_t * data; wchar_t data_buf[100] = FULL_COMMAND; data = data_buf; for(i = 0; i < 1; i++) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = wcslen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ if (SYSTEM(data) <= 0) { printLine("command execution failed!"); exit(1); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() - use goodsource and badsink by changing the conditions on the for statements */ static void goodG2B() { int h; wchar_t * data; wchar_t data_buf[100] = FULL_COMMAND; data = data_buf; for(h = 0; h < 1; h++) { /* FIX: Append a fixed string to data (not user / external input) */ wcscat(data, L"*.*"); } /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ if (SYSTEM(data) <= 0) { printLine("command execution failed!"); exit(1); } } void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_good() { goodG2B(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
#pragma once #include <GL/glew.h> #include <vector> #define GLM_FORCE_RADIANS #include <glm/glm.hpp> #include <glm/gtx/quaternion.hpp> #include <Wretched/Math/Math.h> #include <Wretched/Core/Placement.h> #include <Wretched/System/Entity.h> #ifndef W_pi #define W_pi atan2(0.f, -1.f) #endif #ifndef W_degree #define W_degree atan2(0.f, -1.f)/180.f #endif #include <memory> namespace Wretched { namespace Lighting { struct Light; struct Manager { GLuint ssbo, program; std::vector<float> LightData; Manager(); ~Manager(); void load(); void clear(); void bind(int binding_index); void render(Entity &cam, Entity &light); }; struct Light { Placement::Placement placement; glm::vec3 color = glm::vec3(1.f); float LightType = 0.f; float cutoff = W_pi / 4.f, radius = 100.f, attenuation = 1.f, exponent = 1.f; enum Type { Point, Cone, Direction }; }; } }
/*---------------------------------------------------------------------------* * date.h - * Written By: Nicholas DiPasquale * Copyright (c) 2005-2009 N.I.E.Software *---------------------------------------------------------------------------*/ #pragma once #ifndef __DATE_H__ #define __DATE_H__ /*---------------------------------------------------------------------------*/ using namespace std; namespace niesoft { /*---------------------------------------------------------------------------*/ class Date : virtual public gc_cleanup { private: time_t _time; struct { int _year; int _month; int _day; int _hr; int _min; int _sec; }; /* const stirng FULL_MONTHS[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", }; const string SHORT_MONTHS[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", }; */ inline int calcMonth (int dayOfYear, int year) { int (*m)(int) = isLeapYear (year) ? dayInMonthLeap : dayInMonth; int accum = 0; for (int i = 0; i < 12; ++i) { accum += m(i); if (dayOfYear < accum) { return i; } } return -1; } inline int calcDayOfMonth (int dayOfYear, int year) { int (*m)(int) = isLeapYear (year) ? dayInMonthLeap : dayInMonth; for (int i = 0, accum = 0; 12; ++i) { accum += m (i); if (dayOfYear < accum) { return dayOfYear - (accum - m (i)) + 1; } } return -1; } inline static int dayInMonth (int month) { const int daysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, }; return daysInMonth[month]; } inline static int dayInMonthLeap (int month) { const int daysInMonth[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, }; return daysInMonth[month]; } inline bool isLeapYear (int year) { return ((year % 4) == 0) && ((year % 100) != 0) && ((year % 400) == 0); } public: explicit Date (time_t time = std::time (NULL)) : _time (time) { // time returns the time since 0:0:0,0 1 Jan 1970 _year = (_time / 31556926) + 1970; // This is day in year int dayOfYear = (_time / 86400) % (isLeapYear (_year) ? 366 : 365); dayOfYear -= (_year - 1972) / 4 + 1; _month = calcMonth (dayOfYear, _year); _day = calcDayOfMonth (dayOfYear, _year); _hr = (_time / 3600) % 24; _min = (_time / 60) % 60; _sec = _time % 60; } ~Date (void) { } inline time_t time (void) const { return _time; } inline operator time_t () const { return _time; } inline int year (void) const { return _year; } inline int month (void) const { return _month; } inline int day (void) const { return _day; } inline int hr (void) const { return _hr; } inline int min (void) const { return _min; } inline int sec (void) const { return _sec; } inline friend std::ostream &operator << (std::ostream &out, const Date &date) { return out << setfill ('0') << setw (4) << date._year << "-" << setw (2) << date._month << "-" << setw (2) << date._day << " " << setw (2) << date._hr << ":" << setw (2) << date._min << ":" << setw (2) << date._sec << " (UTC)" << setfill (' '); } }; /*---------------------------------------------------------------------------*/ }; // namespace niesoft; /*---------------------------------------------------------------------------*/ #endif // __DATE_H__
// Copyright (c) 2011-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 VOYACOIN_QT_TRANSACTIONFILTERPROXY_H #define VOYACOIN_QT_TRANSACTIONFILTERPROXY_H #include "amount.h" #include <QDateTime> #include <QSortFilterProxyModel> /** Filter the transaction list according to pre-specified rules. */ class TransactionFilterProxy : public QSortFilterProxyModel { Q_OBJECT public: explicit TransactionFilterProxy(QObject *parent = 0); /** Earliest date that can be represented (far in the past) */ static const QDateTime MIN_DATE; /** Last date that can be represented (far in the future) */ static const QDateTime MAX_DATE; /** Type filter bit field (all types) */ static const quint32 ALL_TYPES = 0xFFFFFFFF; static quint32 TYPE(int type) { return 1<<type; } enum WatchOnlyFilter { WatchOnlyFilter_All, WatchOnlyFilter_Yes, WatchOnlyFilter_No }; void setDateRange(const QDateTime &from, const QDateTime &to); void setAddressPrefix(const QString &addrPrefix); /** @note Type filter takes a bit field created with TYPE() or ALL_TYPES */ void setTypeFilter(quint32 modes); void setMinAmount(const CAmount& minimum); void setWatchOnlyFilter(WatchOnlyFilter filter); /** Set maximum number of rows returned, -1 if unlimited. */ void setLimit(int limit); /** Set whether to show conflicted transactions. */ void setShowInactive(bool showInactive); int rowCount(const QModelIndex &parent = QModelIndex()) const; protected: bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const; private: QDateTime dateFrom; QDateTime dateTo; QString addrPrefix; quint32 typeFilter; WatchOnlyFilter watchOnlyFilter; CAmount minAmount; int limitRows; bool showInactive; }; #endif // VOYACOIN_QT_TRANSACTIONFILTERPROXY_H
// // TabBarPickerSubItemsView.h // Pods // // Created by Giuseppe Nucifora on 17/07/15. // // #import <UIKit/UIKit.h> @class TabBarItem; @class TabBarSubItem; @class TabBarPickerSubItemsView; typedef NS_ENUM(NSInteger, TabBarPickerSubItemsViewType) { // Informational TabBarPickerSubItemsViewTypeDistance, TabBarPickerSubItemsViewTypeDateAndTime, TabBarPickerSubItemsViewTypePrice, TabBarPickerSubItemsViewTypeCheckBox, TabBarPickerSubItemsViewTypeButton }; @protocol TabBarPickerSubItemsViewDelegate <NSObject> @required - (void) tabBarPickerSubItemsView:(TabBarPickerSubItemsView*) tabBarPickerSubItemsView didSelectTabBarSubItem:(TabBarSubItem*) subItem forTabBarItem:(TabBarItem*) item; - (void) tabBarPickerSubItemsView:(TabBarPickerSubItemsView*) tabBarPickerSubItemsView didSelectTabBarSubItems:(NSArray*) subItems forTabBarItem:(TabBarItem*) item; - (void) tabBarPickerSubItemsView:(TabBarPickerSubItemsView*) tabBarPickerSubItemsView didResetTabBarSubItem:(TabBarSubItem*) subItem forTabBarItem:(TabBarItem*) item; - (void) tabBarPickerSubItemsView:(TabBarPickerSubItemsView*) tabBarPickerSubItemsView didResetTabBarSubItems:(NSArray*) subItems forTabBarItem:(TabBarItem*) item; @end @interface TabBarPickerSubItemsView : UIView /** * <#Description#> */ @property (nonatomic, assign) id<TabBarPickerSubItemsViewDelegate> delegate; /** * <#Description#> */ @property (nonatomic) BOOL needsLocalization; /** * <#Description#> */ @property (nonatomic, strong) UIView *localizationView; /** * <#Description#> */ @property (nonatomic, strong) TabBarItem *tabBarItemReference; @property (nonatomic,readonly) TabBarPickerSubItemsViewType type; @property (nonatomic, strong, readonly) NSDate *pickerSelectedDate; @property (nonatomic, strong, readonly) TabBarSubItem *selectedDate; @property (nonatomic, strong, readonly) TabBarSubItem *selectedDistance; @property (nonatomic, strong, readonly) TabBarSubItem *selectedMinPrice; @property (nonatomic, strong, readonly) TabBarSubItem *selectedMaxPrice; @property (nonatomic, strong, readonly) NSMutableArray *selectedAllergens; @property (nonatomic, strong, readonly) NSMutableArray *selectedTypes; - (instancetype) initWithType:(TabBarPickerSubItemsViewType) type subItems:(NSArray*) subItems; - (instancetype) initWithType:(TabBarPickerSubItemsViewType) type subItems:(NSArray*) subItems needsLocalization:(BOOL) needsLocalization; - (void) setItemName:(NSString *) itemName; @end
#pragma once #include "Joint Description.h" namespace StillDesign { namespace PhysX { ref class FixedJoint; public ref class FixedJointDescription : JointDescription { public: FixedJointDescription(); internal: FixedJointDescription( NxFixedJointDesc* desc ); internal: property NxFixedJointDesc* UnmanagedPointer { NxFixedJointDesc* get() new; } }; }; };
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_CONSENSUS_H #define BITCOIN_CONSENSUS_CONSENSUS_H #include <stdint.h> /** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */ static const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 4000000; // TODO LED /** The maximum allowed weight for a block, see BIP 141 (network rule) */ static const unsigned int MAX_BLOCK_WEIGHT = 4000000; // TODO LED /** The maximum allowed size for a block excluding witness data, in bytes (network rule) */ static const unsigned int MAX_BLOCK_BASE_SIZE = 60000; /** The maximum allowed number of signature check operations in a block (network rule) */ static const int64_t MAX_BLOCK_SIGOPS_COST = 8000; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 3600; static const int COINBASE_MATURITY_REGTEST = 100; /** Flags for nSequence and nLockTime locks */ enum { /* Interpret sequence numbers as relative lock-time constraints. */ LOCKTIME_VERIFY_SEQUENCE = (1 << 0), /* Use GetMedianTimePast() instead of nTime for end point timestamp. */ LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), }; #endif // BITCOIN_CONSENSUS_CONSENSUS_H
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Runtime\Implementation\Internal\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_UNO_RUNTIME_IMPLEMENTATION_INTERNAL_ARRAY_ENUMERABLE__FUSE_DRAWI_F31A18DF_H__ #define __APP_UNO_RUNTIME_IMPLEMENTATION_INTERNAL_ARRAY_ENUMERABLE__FUSE_DRAWI_F31A18DF_H__ #include <app/Uno.Collections.IEnumerable__Fuse_Drawing_GradientStop.h> #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Fuse { namespace Drawing { struct GradientStop; } } } namespace app { namespace Uno { namespace Runtime { namespace Implementation { namespace Internal { struct ArrayEnumerable__Fuse_Drawing_GradientStop; struct ArrayEnumerable__Fuse_Drawing_GradientStop__uType : ::uClassType { ::app::Uno::Collections::IEnumerable__Fuse_Drawing_GradientStop __interface_0; }; ArrayEnumerable__Fuse_Drawing_GradientStop__uType* ArrayEnumerable__Fuse_Drawing_GradientStop__typeof(); void ArrayEnumerable__Fuse_Drawing_GradientStop___ObjInit(ArrayEnumerable__Fuse_Drawing_GradientStop* __this, ::uArray* source); ::uObject* ArrayEnumerable__Fuse_Drawing_GradientStop__GetEnumerator(ArrayEnumerable__Fuse_Drawing_GradientStop* __this); ArrayEnumerable__Fuse_Drawing_GradientStop* ArrayEnumerable__Fuse_Drawing_GradientStop__New_1(::uStatic* __this, ::uArray* source); struct ArrayEnumerable__Fuse_Drawing_GradientStop : ::uObject { ::uStrong< ::uArray*> _source; void _ObjInit(::uArray* source) { ArrayEnumerable__Fuse_Drawing_GradientStop___ObjInit(this, source); } ::uObject* GetEnumerator() { return ArrayEnumerable__Fuse_Drawing_GradientStop__GetEnumerator(this); } }; }}}}} #endif
#import <UIKit/UIKit.h> @interface DocumentsView : UINavigationController <UITableViewDelegate, UITableViewDataSource> { UITableViewController *tableViewController; NSArray *documents; NSDictionary *urlsByName; } @property (nonatomic, weak) id documentsDelegate; @end
//****************************************************************************** // SCICHART® Copyright SciChart Ltd. 2011-2018. All rights reserved. // // Web: http://www.scichart.com // Support: support@scichart.com // Sales: sales@scichart.com // // VerticalChartView.h is part of the SCICHART® Examples. Permission is hereby granted // to modify, create derivative works, distribute and publish any part of this source // code whether for commercial, private or personal use. // // The SCICHART® examples are distributed in the hope that they will be useful, but // without any warranty. It is provided "AS IS" without warranty of any kind, either // expressed or implied. //****************************************************************************** #import "SingleChartLayout.h" @interface VerticalChartView : SingleChartLayout @end
#pragma once // C++. #include <vector> // DX. #include <dxgi.h> #include <dxgi1_2.h> #include <dxgi1_3.h> #include <dxgi1_4.h> #include <wrl.h> #include "d3dx12.h" using namespace Microsoft::WRL; // Local. #include "rg_dx12_data_types.h" namespace rga { class RgDx12Factory { public: RgDx12Factory() = delete; ~RgDx12Factory() = delete; // Create a hit group subobject. static void CreateHitGroupSubobject(CD3DX12_STATE_OBJECT_DESC* state_object_x, const RgDxrHitGroup& hit_group_data); // Create a shader config subobject. static void CreateShaderConfigSubobject(CD3DX12_STATE_OBJECT_DESC* state_object_x, uint32_t payload_size, uint32_t attribute_size); // Create a pipeline config subobject. static void CreatePipelineConfigSubobject(CD3DX12_STATE_OBJECT_DESC* state_object_x, uint32_t max_recursion_depth); // Create a subobjects-to-exports association subobject. static D3D12_STATE_SUBOBJECT* CreateSubobjectToExportsAssociationSubobject(const D3D12_STATE_SUBOBJECT* subobject_to_associate, const std::vector<std::wstring>& exports); // Create a local root signature subobject. static void CreateLocalRootSignatureSubobject(CD3DX12_STATE_OBJECT_DESC* state_object_x, ID3D12RootSignature* root_signature, const std::vector<std::wstring>& exports); // Create a global root signature subobject. static void CreateGlobalRootSignatureSubobject(CD3DX12_STATE_OBJECT_DESC* state_object_x, ID3D12RootSignature* root_signature); // Create a DXIL library subobject. // Upon a failure, nullptr is returned and an error message is set to error_msg. static void CreateDxilLibrarySubobject(CD3DX12_STATE_OBJECT_DESC* state_object_desc_x, const RgDxrDxilLibrary& dxil_lib_data, std::string& error_msg); // Destroy a hit group subobject that was created by this factory. static void DestroyHitGroupSubobject(D3D12_STATE_SUBOBJECT*& hit_group_subobject); // Destroy a DXIL library subobject that was created by this factory. static void DestroyDxilLibrarySubobject(D3D12_STATE_SUBOBJECT*& dxil_library_subobject); }; }
// // LineCtrlViewController.h // DTiseChart // // Created by Jo Shin on 2017/1/10. // Copyright © 2017年 studio.joshin. All rights reserved. // #import <UIKit/UIKit.h> @interface LineCtrlViewController : UIViewController @end
// Watchdog.h // Copyright 2016 Robin.Rowe@CinePaint.org // License open source MIT #ifndef Watchdog_h #define Watchdog_h #include <thread> #include <mutex> #include <condition_variable> #include "SystemCall.h" namespace portable { class Watchdog { typedef std::unique_lock<std::mutex> Lock; typedef std::chrono::milliseconds milliseconds; milliseconds delay; bool isGo; std::mutex m; std::condition_variable cv; void Run() { while(isGo && delay.count()) { Lock lock(m); const bool isTimeout=std::cv_status::timeout==cv.wait_for(lock,delay); if(isGo) { Action(isTimeout); } } } static void Main(Watchdog* self) { self->Run(); } public: Watchdog() : delay(0) , isGo(false) {} void Start(unsigned delay,const char* description= "") { isGo =true; this->delay = milliseconds(delay); std::thread worker(Main,this); PrintTask("Watchdog",description); worker.detach(); } virtual ~Watchdog() { isGo=false; } void Wake() { cv.notify_one(); } void Stop() { isGo=false; Wake(); } virtual void Action(bool isTimeout)=0; }; } #endif
// // LKQueueManagerTests.h // LKQueue // // Created by Hashiguchi Hiroshi on 11/07/27. // Copyright 2011年 __MyCompanyName__. All rights reserved. // #import <XCTest/XCTest.h> @class LKQueue; @interface LKQueueManagerTests : XCTestCase { } @property (nonatomic, strong) LKQueue* queue1; @property (nonatomic, strong) LKQueue* queue2; @property (nonatomic, strong) LKQueue* queue3; @end
// // LDEmoticonCell.h // OCThreeWeibo // // Created by 郑鸿钦 on 2017/6/10. // Copyright © 2017年 Leedian. All rights reserved. // #import <UIKit/UIKit.h> @class LDEmoticonCell; @class LDEmotion; @protocol LDEmoticonCellDelegate <NSObject> /// 表情 cell 选中表情模型 /// /// - parameter em: 表情模型/nil 表示删除 - (void)emoticonCellDidSelected:(LDEmoticonCell *)cell emoticon:(LDEmotion *)em; @end @interface LDEmoticonCell : UICollectionViewCell @property (nonatomic, weak) id<LDEmoticonCellDelegate> delegate; @property (nonatomic, strong) NSArray<LDEmotion *> *emoticons; @end
#pragma once #include <spotify/json.hpp> #include <SFML/Graphics/Rect.hpp> namespace spotify { namespace json { // See Vector2Codec.h for issues with making this generic. template<> struct default_codec_t<sf::Rect<double>> { typedef std::pair<double, double> DoublePair; typedef std::pair<DoublePair, DoublePair> DoublePairPair; static auto codec() { auto codec = codec::transform( codec::pair(codec::pair(codec::number<double>(), codec::number<double>()), codec::pair(codec::number<double>(), codec::number<double>())), [](sf::Rect<double> v) {return DoublePairPair{{v.left, v.top}, {v.width, v.height}}; }, [](DoublePairPair p) {return sf::Rect<double>(p.first.first, p.first.second, p.second.first, p.second.second); } ); return codec; } }; } }
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KADBLOCKENGINE_ADBLOCK_ENGINE_AD_FILTER_MANAGER_H_ #define KADBLOCKENGINE_ADBLOCK_ENGINE_AD_FILTER_MANAGER_H_ #include <vector> #include "kbase/basic_macros.h" #include "kbase/path.h" #include "adblock_engine/ad_filter.h" namespace abe { class AdFilterManager { public: AdFilterManager() = default; ~AdFilterManager() = default; DISALLOW_COPY(AdFilterManager); DISALLOW_MOVE(AdFilterManager); void LoadAdFilter(const kbase::Path& filter_file); void UnloadAdFilter(const kbase::Path& filter_file); bool ShouldBlockRequest(const std::string& request_url, const std::string& request_domain, unsigned int content_type, bool third_party) const; std::string GetElementHideContent(const std::string& request_domain) const; // Creates a snapshot file on disk for the AdFilter indicated by `filter_file`. void SnapshotAdFilter(const kbase::Path& filter_file) const; private: using AdFilterPair = std::pair<kbase::Path, AdFilter>; std::vector<AdFilterPair> ad_filters_; }; } // namespace abe #endif // KADBLOCKENGINE_ADBLOCK_ENGINE_AD_FILTER_MANAGER_H_
// // TPATravelPlanViewController.h // TripPlanner // // Created by Yuriy Berdnikov on 3/9/15. // Copyright (c) 2015 Yuriy Berdnikov. All rights reserved. // #import <UIKit/UIKit.h> @interface TPATravelPlanViewController : UIViewController @end
// // ChangeDateViewController.h // Roll Call // // Created by Kyle Conroy on Apr30. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> @class ChangeDateViewController; @protocol DateChangeDelegate <NSObject> - (void)changeDateViewController:(ChangeDateViewController *)changeDateViewController didChangeDate:(NSDate *)date; @end @interface ChangeDateViewController : UIViewController { IBOutlet UIDatePicker *myPickerView; NSDate *myDate; id <DateChangeDelegate> delegate; } @property(nonatomic, retain) IBOutlet UIDatePicker *myPickerView; @property(nonatomic, retain) NSDate *myDate; @property (nonatomic, assign) id <DateChangeDelegate> delegate; - (IBAction) doneDate; - (IBAction) cancelDate; @end
/* Shape.h - Library for abstract shapes. Created by Nick Anthony, March 1st, 2016. */ #include "Panel.h" class LEDShape { public: LEDShape(); void setShapeColor(int r, int g, int b); void setLocation(int x, int y); protected: int _red; int _green; int _blue; int _shapeArray[200][2]; int _row; int _col; private: };
//GUI #define CHANGEDGREEN Color::FromArgb(255,127,255,127) #define ERRORRED Color::FromArgb(255,255,127,127) //Settings #define PMAX 1000 #define PMIN 0 #define IMAX 100 #define IMIN 0 #define DMAX 100 #define DMIN 0 #define PPDefault 900.0 #define PIDefault 20 #define PDDefault 4 #define RPDefault 900 #define RIDefault 20 #define RDDefault 4 #define P 0 #define I 1 #define D 2 // Serial #define READTIMEOUT 500 #define WRITETIMEOUT 500
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> #include "skalibs/tai.h" #include "skalibs/djbunix.h" #include "bozCore/boztree.h" #define MAX_INSERT 16 #define MAXBUF_SIZE 256 typedef struct { uint64 i; char x[MAXBUF_SIZE]; } mytree_t; int main(int ac, char **av) { boztree_t t=BOZTREE_ZERO; mytree_t e; unsigned int found=0; unsigned int i; // int count=0; // // if(ac>1) // count=atoi(av[1]); // // fprintf(stderr, "Iterates with %u loops\n", count); BOZTREE_INIT(&t, mytree_t); for(i=0; i<MAX_INSERT; i++) { e.i = 0xFFAA5500 + i; fprintf(stderr, "\ninsert id(%016llx)\n", (long long int)e.i); memset(&e.x[0], 0, MAXBUF_SIZE); fprintf(stderr, "\tbefore insertion: search id(%016llx)\n", e.i); if(avltree_search(&t.a, &e.i, &found)) fprintf(stderr, "before insertion: found (SHOULD NOT BE PRINTED)\n"); boztree_insert(&t, (boztree_id_t*)&e); fprintf(stderr, "\tafter insertion: search id(%016llx)\n", e.i); if(avltree_search(&t.a, &e.i, &found)) fprintf(stderr, "\tafter insertion: found\n"); fprintf(stderr, "\tinsert: tree total size: %lu\n", avltree_len(&t.a)); } for(i=0; i<MAX_INSERT; i++) { e.i = 0xFFAA5500 + i; fprintf(stderr, "\n\tdelete id(%016llx)\n", e.i); boztree_delete(&t, e.i); fprintf(stderr, "\tafter delete: search id(%016llx)\n", e.i); if(avltree_search(&t.a, &e.i, &found)) fprintf(stderr, "\tafter delettion: found (SHOULD NOT BE PRINTED)\n"); fprintf(stderr, "\tdelete: tree total size: %lu\n", avltree_len(&t.a)); } exit(EXIT_SUCCESS); }
#pragma once #include "../animation.h" namespace ecs { namespace components { struct animation { animation(); float runtime; const rendering::animation *anim; }; } }
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Animations\0.11.3\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_FUSE_ANIMATIONS_MASTER_BASE1_G_F_W_RESULT__FUSE_ELEMENTS_STRETCH_SIZING_H__ #define __APP_FUSE_ANIMATIONS_MASTER_BASE1_G_F_W_RESULT__FUSE_ELEMENTS_STRETCH_SIZING_H__ #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Fuse { namespace Animations { struct MasterBase1_GFWResult__Fuse_Elements_StretchSizing; struct MasterBase1_GFWResult__Fuse_Elements_StretchSizing__uType : ::uStructType { }; MasterBase1_GFWResult__Fuse_Elements_StretchSizing__uType* MasterBase1_GFWResult__Fuse_Elements_StretchSizing__typeof(); struct MasterBase1_GFWResult__Fuse_Elements_StretchSizing { float Rest; float Full; }; }}} #endif