text
stringlengths
4
6.14k
// // MOInbox.h // MoEngage // // Created by Gautam on 05/03/15. // Copyright (c) 2015 alphadevs. All rights reserved. // #import <Foundation/Foundation.h> #import "MOInboxViewController.h" @interface MOInbox : NSObject #pragma MoEngage methods +(void)writeArrayToFile:(NSMutableArray *)anArray; +(NSDateFormatter *)dateFormatterWithFormat:(NSString *)format; #pragma Utility methods /** This method returns the height of the text for the text with the specified height, width and font. @param text The text @param widthValue The width @param font The font of the text. If not specified, system font will be used. */ +(CGFloat)findHeightForText:(NSString *)text havingWidth:(CGFloat)widthValue andFont:(UIFont *)font; /** This method returns the current width of the screen */ +(CGFloat)screenWidth; /** This method returns the current height of the screen */ +(CGFloat)screenHeight; /** This method returns @"HelveticaNeue" */ +(NSString *)helveticaFont; #pragma Inbox methods /** This methods add the inbox view controller as a child view controller to your controller. Alternatively, you can initialize and add inbox view controller as per your need. It is open source. @param controller This is your view controller. You will pass self here. */ +(MOInboxViewController *)initializeInboxOnController:(UIViewController *)controller; /** Use this method to get all the inbox messages in the storage. Max no. of messages stored = 100 */ +(NSArray *)getInboxMessages; /** This is AvenirNext-Regular size-16 */ +(UIFont *)defaultTextFont; /** This is AvenirNext-Bold size-16 */ +(UIFont *)defaultUnreadTextFont; /** Use this method to get new inbox messages. Reload table if new messages == YES, to get the new messages in the Inbox instantly. */ +(void)fetchInboxMessagesWithCompletion:(void(^) (BOOL newMessages))completion; @end
#ifndef BLOCK_FINDER_BLOCK_FINDER_H #define BLOCK_FINDER_BLOCK_FINDER_H #endif
#include <stdio.h> #include <stdlib.h> //左上,上,右上,左,右,左下,下,右下 int dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1}; int dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1}; int token_exists(char** matrix, int sizeX, int sizeY, int fromX, int fromY, char* token, int sizeT, int idx){ if(fromX < 0 || fromX > sizeX - 1 || fromY < 0 || fromY > sizeY - 1){ return 0; } if(matrix[fromX][fromY] != token[idx]){ return 0; } if(idx == sizeT - 1){ return 1; } idx++; int i=0; for(i=0;i<8;i++){ if(token_exists(matrix, sizeX, sizeY, fromX+dx[i], fromY+dy[i], token, sizeT, idx)){ return 1; } } return 0; // if(fromX > 0){ // if(token_exists(matrix, sizeX, sizeY, fromX-1, fromY, token, sizeT, idx)){ // return 1; // } // } // if(fromX < sizeX - 1){ // if(token_exists(matrix, sizeX, sizeY, fromX+1, fromY, token, sizeT, idx)){ // return 1; // } // } // if(fromY > 0){ // if(token_exists(matrix, sizeX, sizeY, fromX, fromY-1, token, sizeT, idx)){ // return 1; // } // } // if(fromY < sizeY - 1){ // if(token_exists(matrix, sizeX, sizeY, fromX, fromY+1, token, sizeT, idx)){ // return 1; // } // } // if(fromX > 0 && fromX < sizeX - 1){ // if(token_exists(matrix, sizeX, sizeY, fromX-1, fromY-1, token, sizeT, idx)){ // return 1; // } // } // if(fromX > 0 && fromY < sizeY - 1){ // if(token_exists(matrix, sizeX, sizeY, fromX-1, fromY+1, token, sizeT, idx)){ // return 1; // } // } // if(visited[fromX][fromY][6] == 0){ // if(token_exists(matrix, sizeX, sizeY, fromX+1, fromY-1, token, sizeT, idx)){ // return 1; // } // } // if(visited[fromX][fromY][7] == 0){ // if(token_exists(matrix, sizeX, sizeY, fromX+1, fromY+1, token, sizeT, idx)){ // return 1; // } // } // return 0; } int main(int argc, char const *argv[]) { char** matrix = (char**)malloc(sizeof(char*)*5); matrix[0] = "URLPM"; matrix[1] = "XPRET"; matrix[2] = "GIAET"; matrix[3] = "XTNZY"; matrix[4] = "XOQRS"; printf("%d\n", token_exists(matrix, 5, 5, 2, 2, "GIRL", 4, 0)); return 0; }
#include "FaceRecognizer.h" #ifndef __FF_FACERECOGNIZERBINDINGS_H_ #define __FF_FACERECOGNIZERBINDINGS_H_ namespace FaceRecognizerBindings { struct NewWorker : public FF::SimpleWorker { public: int num_components = 0; double threshold = DBL_MAX; bool unwrapOptionalArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return ( FF::IntConverter::optArg(0, &num_components, info) || FF::DoubleConverter::optArg(1, &threshold, info) ); } bool hasOptArgsObject(Nan::NAN_METHOD_ARGS_TYPE info) { return FF::isArgObject(info, 0); } bool unwrapOptionalArgsFromOpts(Nan::NAN_METHOD_ARGS_TYPE info) { v8::Local<v8::Object> opts = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); return ( FF::IntConverter::optProp(&num_components, "num_components", opts) || FF::DoubleConverter::optProp(&threshold, "threshold", opts) ); } }; struct TrainWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::FaceRecognizer> self; TrainWorker(cv::Ptr<cv::face::FaceRecognizer> self) { this->self = self; } std::vector<cv::Mat> images; std::vector<int> labels; std::string executeCatchCvExceptionWorker() { self->train(images, labels); return ""; } bool unwrapRequiredArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return ( Mat::ArrayConverter::arg(0, &images, info) || FF::IntArrayConverter::arg(1, &labels, info) ); } }; struct PredictWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::FaceRecognizer> self; PredictWorker(cv::Ptr<cv::face::FaceRecognizer> self) { this->self = self; } cv::Mat image; int label; double confidence; std::string executeCatchCvExceptionWorker() { self->predict(image, label, confidence); return ""; } v8::Local<v8::Value> getReturnValue() { v8::Local<v8::Object> ret = Nan::New<v8::Object>(); Nan::Set(ret, Nan::New("label").ToLocalChecked(), Nan::New(label)); Nan::Set(ret, Nan::New("confidence").ToLocalChecked(), Nan::New(confidence)); return ret; } bool unwrapRequiredArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return ( Mat::Converter::arg(0, &image, info) ); } }; } #endif
/* * ui_gp2x.c * * Written by * Mike Dawson <mike@gp2x.org> * Mustafa 'GnoStiC' Tufan <mtufan@gmail.com> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. * */ #include "vice.h" #include <stdio.h> #include "gp2xsys.h" #include "videoarch.h" #include "machine.h" #include "ui_gp2x.h" int num_checkmark_menu_items; char *last_attached_images[8]; int enabled_drives; int w; int drive8_status, drive8_half_track; int drive9_status, drive9_half_track; char *drive8_image, *drive9_image; float emu_speed, emu_fps; void ui_error(const char *text) { fprintf(stderr, "ui_error: %s\n", text); } void ui_display_drive_current_image(unsigned int drive_number, const char *image) { if (drive_number == 0) { drive8_image = (char *)image; } if (drive_number == 1) { drive9_image = (char *)image; } } void ui_update_menus(void) { /* needed */ } void ui_display_tape_current_image(void) { /* needed */ } void ui_display_tape_counter(void) { /* needed */ } void ui_display_tape_motor_status(void) { /* needed */ } void ui_display_tape_control_status(void) { /* needed */ } void ui_set_tape_status(void) { /* needed */ } void ui_display_recording(void) { /* needed */ } void ui_display_playback(void) { /* needed */ } void ui_init(void) { gp2xsys_init(1000, 8, 11025, 16, 1, 60); } void archdep_ui_init(void) { /* needed */ } void ui_init_finish(void) { /* needed */ } void ui_enable_drive_status(void) { /* needed */ } void ui_extend_image_dialog(void) { /* needed */ } void ui_display_drive_led(int drive_number, unsigned int led_pwm1, unsigned int led_pwm2) { int status = 0; if (led_pwm1 > 100) { status |= 1; } if (led_pwm2 > 100) { status |= 2; } if (drive_number == 0) { drive8_status = status; gp2x_battery_led(status); } if (drive_number == 1) { drive9_status = status; } } void ui_display_drive_track(unsigned int drive_number, unsigned int drive_base, unsigned int half_track_number) { if (drive_number == 0) { drive8_half_track = half_track_number; } if (drive_number == 1) { drive9_half_track = half_track_number; } } void ui_resources_init(void) { /* needed */ } void ui_cmdline_options_init(void) { /* needed */ } void ui_init_finalize(void) { /* needed */ } void ui_jam_dialog(void) { /* needed */ } void ui_shutdown(void) { /* needed */ } void ui_resources_shutdown(void) { /* needed */ } void _ui_menu_radio_helper(void) { /* needed */ } void ui_check_mouse_cursor(void) { /* needed */ } void ui_dispatch_events(void) { /* needed */ } void ui_display_speed(float speed, float frame_rate, int warp_enabled) { emu_speed = speed; emu_fps = frame_rate; }
// // NSMutableDictionary+KS.h // KSToolkit // // Created by bing.hao on 14/11/27. // Copyright (c) 2014年 bing.hao. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreGraphics/CoreGraphics.h> @interface NSMutableDictionary (KS) /** * @brief 添加一个任意类型值到字典中 */ - (void)add:(id)key objectValue:(id)obj; /** * @brief 添加一个String值到字典中 */ - (void)add:(NSString *)key stringValue:(NSString *)val; /** * @brief 添加一个Int值到字典中 */ - (void)add:(NSString *)key intValue:(NSInteger)val; /** * @brief 添加一个Double值到字典中 */ - (void)add:(NSString *)key doubleValue:(double)val; /** * @brief 添加一个Float值到字典中 */ - (void)add:(NSString *)key floatValue:(float)val; /** * @brief 添加一个Int64值到字典中 */ - (void)add:(NSString *)key int64Value:(int64_t)val; @end
/** ******************************************************************************* * @file Projects/Multi/Examples/IKS01A2/LSM6DSL_SingleDoubleTap/Inc/stm32l1xx_it.h * @author CL * @version V4.0.0 * @date 1-May-2017 * @brief header for stm32l1xx_it.c. ******************************************************************************* * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics 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. * ******************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32L1xx_IT_H #define __STM32L1xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void DebugMon_Handler(void); void SysTick_Handler(void); void EXTI9_5_IRQHandler( void ); void EXTI15_10_IRQHandler( void ); #ifdef __cplusplus } #endif #endif /* __STM32L1xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#pragma once #include "BaseInterface.h" #include "../Vector.h" typedef struct player_info_s { private: DWORD __pad0[2]; public: int m_nXuidLow; int m_nXuidHigh; char m_szPlayerName[128]; int m_nUserID; char m_szSteamID[33]; UINT m_nSteam3ID; char m_szFriendsName[128]; bool m_bIsFakePlayer; bool m_bIsHLTV; DWORD m_dwCustomFiles[4]; BYTE m_FilesDownloaded; private: int __pad1; } player_info_t; struct VMatrix { public: float* operator[](int i) { return m[i]; } const float* operator[](int i) const { return m[i]; } float *Base() { return &m[0][0]; } const float *Base() const { return &m[0][0]; } float m[4][4]; }; class CEngine extends BaseInterface { public: void GetScreenSize(int& width, int& height) { VCALL(5, Args(int&, int&))(width, height); } bool GetPlayerInfo(int index, player_info_t* info) { VRESULT(bool, 8, Args(int, player_info_t*))(index, info); } int GetLocalPlayer() { VRESULT(int, 12, Args())(); } void GetViewAngles(Vector& va) { VCALL(18, Args(Vector&))(va); } void SetViewAngles(Vector& va) { VCALL(19, Args(Vector&))(va); } VMatrix WorldToScreenMatrix() { //defines don't work for this typedef VMatrix(__thiscall* fn)(void*); return VMT::getvfunc<fn>(this, 37)(this); } }; extern CEngine* g_pEngine;
/* The MIT License (MIT) Copyright (c) <2010-2020> <wenshengming> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include "LServer.h" #include <map> using namespace std; class LMainLogicThread; class LServerManager { public: static LServerManager* GetServerManagerInstance(); ~LServerManager(); protected: LServerManager(); LServerManager(const LServerManager& sm); LServerManager& operator=(const LServerManager& sm); private: static LServerManager* m_pServerManagerInstance; public: // 添加一个新连接上来的服务器,因为没有服务器ID等信息,那么临时存放在待确任表中 bool AddNewUpServer(uint64_t un64SessionID, t_Session_Accepted& tsa); // 添加一个服务器 bool AddServer(uint64_t un64SessionID, unsigned char ucServerType, unsigned short usAreaID, unsigned short usGroupID, unsigned short usServerID); // 查找服务器 LServer* FindServer(uint64_t u64ServerID); LServer* FindServerBySessionID(uint64_t u64SessionID); LServer* FindServer(unsigned char ucServerType, unsigned short usAreaID, unsigned short usGroupID, unsigned short usServerID); // 移除服务器 void RemoveServerByNetWorkSessionID(uint64_t u64NetWorkSessionID); void RemoveServer(uint64_t u64ServerID); void RemoveServer(unsigned char ucServerType, unsigned short usAreaID, unsigned short usGroupID, unsigned short usServerID); bool SelectBestLobbyServerAndGameDBServer(uint64_t& uSelectedLobbyServerUniqueID, uint64_t& uSelectedGameDBServerUniqueID); public: // 向一个服务器发包 void SendPacketToServer(uint64_t u64ServerID, LPacketBroadCast* pPacket); void SendPacketToServer(unsigned char ucServerType, unsigned short usAreaID, unsigned short usGroupID, unsigned short usServerID, LPacketBroadCast* pPacket); // 向服务器类型广播数据包 void BroadCastToServersByServerType(unsigned char ucServerType, LPacketBroadCast* pPacket); // 向指定区的服务器广播数据包 void BroadCastToServersByServerArea(unsigned short usAreaID, LPacketBroadCast* pPacket); // 给某个服务器发送可以连接的服务器的ID信息 void SendPacketToServerCanConnectToServerInfos(uint64_t u64RegisterServerUniqueID); private: LServer* CreateServer(unsigned char ucServerType); private: map<uint64_t, LServer*> m_mapServers; map<uint64_t, LServer*> m_mapSessionToServers; map<uint64_t, LServer*> m_mapNewUpServers; // 新连接上来的服务器信息 public: void SetMainLogicThread(LMainLogicThread* pmlt); LMainLogicThread* GetMainLogicThread(); private: LMainLogicThread* m_pMainLogicThread; public: bool SelectBestGateServer(uint64_t& u64SelecttedGateServerSessionID); };
#ifdef __cplusplus extern "C" { #endif /** * Allocates a C++ exception. This function is part of the Itanium C++ ABI and * is provided externally. */ /* * Note: Recent versions of libsupc++ already provide a prototype for * __cxa__allocate_exception(). Since the libsupc++ version is defined with * _GLIBCXX_NOTHROW, clang gives a type mismatch error. */ #ifndef __cplusplus #undef CXA_ALLOCATE_EXCEPTION_SPECIFIER #define CXA_ALLOCATE_EXCEPTION_SPECIFIER #endif __attribute__((weak)) void *__cxa_allocate_exception(size_t thrown_size) CXA_ALLOCATE_EXCEPTION_SPECIFIER; /** * Initialises an exception object returned by __cxa_allocate_exception() for * storing an Objective-C object. The return value is the location of the * _Unwind_Exception structure within this structure, and should be passed to * the C++ personality function. */ __attribute__((weak)) struct _Unwind_Exception *objc_init_cxx_exception(id thrown_exception); /** * The GNU C++ exception personality function, provided by libsupc++ (GNU) or * libcxxrt (PathScale). */ __attribute__((weak)) DECLARE_PERSONALITY_FUNCTION(__gxx_personality_v0); /** * Frees an exception object allocated by __cxa_allocate_exception(). Part of * the Itanium C++ ABI. */ __attribute__((weak)) void __cxa_free_exception(void *thrown_exception); /** * Tests whether a C++ exception contains an Objective-C object, and returns if * if it does. The second argument is a pointer to a boolean value indicating * whether this is a valid object. */ __attribute__((weak)) void *objc_object_for_cxx_exception(void *thrown_exception, int *isValid); /** * Prints the type info associated with an exception. Used only when * debugging, not compiled in the normal build. */ __attribute__((weak)) void print_type_info(void *thrown_exception); /** * The exception class that we've detected that C++ runtime library uses. */ extern uint64_t cxx_exception_class; /** * The exception class that libsupc++ and libcxxrt use. */ const uint64_t gnu_cxx_exception_class = EXCEPTION_CLASS('G','N','U','C','C','+','+','\0'); /** * The exception class that libc++abi uses. */ const uint64_t llvm_cxx_exception_class = EXCEPTION_CLASS('C','L','N','G','C','+','+','\0'); #ifdef __cplusplus } #endif
/****************************************************************************** ** File: bsp_start.c ** ** This is governed by the NASA Open Source Agreement and may be used, ** distributed and modified only pursuant to the terms of that agreement. ** ** Copyright (c) 2004-2006, United States government as represented by the ** administrator of the National Aeronautics Space Administration. ** All rights reserved. ** ** Purpose: ** ** OSAL main entry point. ** ** History: ** ******************************************************************************/ /* ** Include Files */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "vxWorks.h" #include "sysLib.h" /* ** OSAL includes */ #include "common_types.h" #include "osapi.h" /* ** External Declarations */ void OS_Application_Startup(void); /****************************************************************************** ** Function: OS_BSPMain() ** ** Purpose: ** vxWorks/BSP Application entry point. ** ** Arguments: ** (none) ** ** Return: ** (none) */ void OS_BSPMain( void ) { int TicksPerSecond; /* ** Delay for one second. */ TicksPerSecond = sysClkRateGet(); (void) taskDelay( TicksPerSecond ); OS_printf("Starting Up OSAPI App.\n"); /* ** Call OSAL entry point. */ OS_Application_Startup(); /* ** Exit the main thread. ** in VxWorks we can delete all of the OS tasks if we want. */ }
/////////////////////////////////////////////////////////////////////////////// // btcache.h // // B-Tree-block-fixed-C version 1.20 Copyright (c) 1995-2015 David R. Van Wagner // See LICENSE.txt for licensing details // // btree@davevw.com // http://www.davevw.com /////////////////////////////////////////////////////////////////////////////// class BTCACHE { public: BTCACHE(BT::BTIDX index, void* node, size_t size, bool modified); ~BTCACHE(); bool add(BT::BTIDX index, void* node, size_t size, bool modified); bool update(BT::BTIDX index, void* node, size_t size); BTCACHE* find(BT::BTIDX index); void* get_node(); BT::BTIDX get_index(); BTCACHE* begin(); BTCACHE* end(); static void advance(BTCACHE*& p); static void rewind(BTCACHE*& p); static void del(BTCACHE*& p); void reorder(BTCACHE* p); int count(); bool modified; private: BTCACHE* prev; BTCACHE* next; BT::BTIDX idx; void* node; // disable copy constructor and assignment operator BTCACHE(const BTCACHE&); // not implemented BTCACHE& operator =(const BTCACHE&); // not implemented };
// // LUFileUtils.h // // Lunar Unity Mobile Console // https://github.com/SpaceMadness/lunar-unity-console // // Copyright 2017 Alex Lementuev, SpaceMadness. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import <Foundation/Foundation.h> NSString *LUGetDocumentsDir(void); NSString *LUGetDocumentsFile(NSString *name); BOOL LUFileExists(NSString *path);
#include "types.h" #include "user.h" #define PSIZE (4096) #include "mmu.h" #include "spinlock.h" #include "x86.h" #include "proc.h" #include "thread.h" void lock_init(lock_t *lock){ lock->locked = 0; } void lock_acquire(lock_t *lock){ while(xchg(&lock->locked,1) != 0); } void lock_release(lock_t *lock){ xchg(&lock->locked,0); } void *thread_yield(void) { tsleep(); return 0; } void *thread_create(void(*start_routine)(void*), void *arg){ int tid; void * stack = malloc(2 * 4096); void *garbage_stack = stack; // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ stack = stack + (4096 - (uint)stack % 4096); } if (stack == 0){ printf(1,"malloc fail \n"); return 0; } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); if(tid < 0){ printf(1,"clone fails\n"); return 0; } if(tid > 0){ //store threads on thread table return garbage_stack; } if(tid == 0){ printf(1,"tid = 0 return \n"); } // wait(); // free(garbage_stack); return 0; }
/** D3D11AppView.h */ #pragma once #include "pch.h" using namespace winrt; using namespace Windows; using namespace Windows::Devices::Input; using namespace Windows::Graphics::Display; using namespace Windows::ApplicationModel::Activation; using namespace Windows::ApplicationModel::Core; using namespace Windows::Foundation::Numerics; using namespace Windows::UI; using namespace Windows::UI::Core; using namespace Windows::UI::Composition; /** */ struct AppView : implements<AppView, IFrameworkView> { public: // IFrameworkView Methods. virtual void Initialize(const CoreApplicationView& applicationView); virtual void SetWindow(const CoreWindow& window); virtual void Load(const hstring& entryPoint); virtual void Run(); virtual void Uninitialize(); private: // Event handlers. void OnActivated(const CoreApplicationView& applicationView, const IActivatedEventArgs& args); void OnWindowSizeChanged(const CoreWindow& sender, const WindowSizeChangedEventArgs& args); void OnVisibilityChanged(const CoreWindow& sender, const VisibilityChangedEventArgs& args); void OnWindowClosed(const CoreWindow& sender, const CoreWindowEventArgs& args); void OnDpiChanged(const DisplayInformation& sender, const IInspectable& args); void OnOrientationChanged(const DisplayInformation& sender, const IInspectable& args); void OnDisplayContentsInvalidated(const DisplayInformation& sender, const IInspectable& args); void OnPointerPressed(const CoreWindow& sender, const PointerEventArgs& args); void OnPointerReleased(const CoreWindow& sender, const PointerEventArgs& args); void OnPointerWheelChanged(const CoreWindow& sender, const PointerEventArgs& args); void OnMouseMoved(const MouseDevice& sender, const MouseEventArgs& args); // Internal methods. void HandleDeviceLost(); void CreateDeviceResources(); void CreateWindowSizeDependentResources(); DXGI_MODE_ROTATION ComputeDisplayRotation(); float ConvertDipsToPixels(float dips); void UpdatePointerButtons(const PointerEventArgs& args); // Window state. bool m_windowClosed = false; bool m_windowVisible = true; // Cached window and display properties. CoreWindow m_window = nullptr; float m_dpi = -1.0f; // Direct3D objects. com_ptr<ID3D11Device3> m_device; com_ptr<ID3D11DeviceContext3> m_context; com_ptr<IDXGISwapChain3> m_swapChain; // Direct3D rendering objects. Required for 3D. com_ptr<ID3D11RenderTargetView1> m_renderTargetView; com_ptr<ID3D11DepthStencilView> m_depthStencilView; D3D11_VIEWPORT m_viewport = D3D11_VIEWPORT(); // Cached device properties. D3D_FEATURE_LEVEL m_featureLevel = D3D_FEATURE_LEVEL_9_1; Windows::Foundation::Size m_renderTargetSize = Windows::Foundation::Size(); Windows::Foundation::Size m_outputSize = Windows::Foundation::Size(); Windows::Foundation::Size m_logicalSize = Windows::Foundation::Size(); Windows::Graphics::Display::DisplayOrientations m_nativeOrientation = Windows::Graphics::Display::DisplayOrientations::None; Windows::Graphics::Display::DisplayOrientations m_currentOrientation = Windows::Graphics::Display::DisplayOrientations::None; // Transforms used for display orientation. DirectX::XMFLOAT4X4 m_orientationTransform; // Previous pointer position. Used to compute deltas. CoreCursor m_defaultCursor = nullptr; CoreCursor m_cursor = nullptr; };
#pragma once namespace PhysX { ref class RigidDynamic; /// <summary> /// Structure containing data that is computed for a wheel during concurrent calls to PxVehicleUpdates but which /// cannot be safely concurrently applied. /// </summary> public ref class VehicleWheelConcurrentUpdateData { //internal: //static PxVehicleWheelConcurrentUpdateData ToUnmanaged(VehicleWheelConcurrentUpdateData^ managed); // For some reason this data is private in the unmanaged class... public: property Matrix LocalPose; property RigidDynamic^ HitActor; property Vector3 HitActorForce; property Vector3 HitActorForcePosition; }; }
// // AutoCoding.m // // Version 2.0.3 // // Created by Nick Lockwood on 19/11/2011. // Copyright (c) 2011 Charcoal Design // // Distributed under the permissive zlib License // Get the latest version from here: // // https://github.com/nicklockwood/AutoCoding // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // // The following code is modified by Håvard Fossli (hfossli@agens.no) // and only resembles the original code in chunks #import <Foundation/Foundation.h> #ifndef AGClassHelperExtendsNSObject # define AGClassHelperExtendsNSObject 1 #endif @interface AGClassHelper : NSObject + (NSDictionary *)codablePropertiesForClass:(Class)aClass omit:(NSArray *)omit; + (NSDictionary *)codablePropertiesForInheritanceOfClass:(Class)topClass omit:(NSArray *)omit; + (NSDictionary *)dictionaryRepresentationForInstance:(id <NSObject>)instance omit:(NSArray *)omit; @end #if AGClassHelperExtendsNSObject @interface NSObject (Coding) + (NSArray *)uncodableProperties; - (NSDictionary *)allCodableProperties; - (NSDictionary *)dictionaryRepresentation; @end #endif
// // JLYAvatarBrowser.h // iOrder2.0 // // Created by TJBT on 16/5/5. // Copyright © 2016年 TIANJIN BEITA TECHNOLOGY CO.,LTD. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface JLYAvatarBrowser : NSObject /** * @brief 浏览头像 * * @param oldImageView 头像所在的imageView */ + (void)showImage:(UIImageView*)avatarImageView; @end NS_ASSUME_NONNULL_END
// // Copyright (c) 2017-2020 the rbfx project. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #pragma once #include <type_traits> namespace Urho3D { #ifndef URHO3D_TYPE_TRAIT /// Helper macro that creates type trait. Expression should be any well-formed C++ expression over template type U. #define URHO3D_TYPE_TRAIT(name, expr) \ template <typename U> struct name \ { \ template<typename T> static decltype((expr), std::true_type{}) func(std::remove_reference_t<T>*); \ template<typename T> static std::false_type func(...); \ using type = decltype(func<U>(nullptr)); \ static constexpr bool value{ type::value }; \ } #endif }
// // DMHYTorrent+CoreDataProperties.h // DMHY // // Created by 小笠原やきん on 16/2/28. // Copyright © 2016年 yaqinking. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. // #import "DMHYTorrent.h" NS_ASSUME_NONNULL_BEGIN @interface DMHYTorrent (CoreDataProperties) @property (nullable, nonatomic, retain) NSString *author; @property (nullable, nonatomic, retain) NSString *category; @property (nullable, nonatomic, retain) NSNumber *isDownloaded; @property (nullable, nonatomic, retain) NSNumber *isNewTorrent; @property (nullable, nonatomic, retain) NSString *link; @property (nullable, nonatomic, retain) NSString *magnet; @property (nullable, nonatomic, retain) NSDate *pubDate; @property (nullable, nonatomic, retain) NSString *title; @property (nullable, nonatomic, retain) DMHYKeyword *keyword; @end NS_ASSUME_NONNULL_END
#ifndef _UTILS_H_ #define _UTILS_H_ #include <string> #include <vector> namespace fw { struct Vertex; std::vector<Vertex> load_vertices_from_file(const std::string& filename); std::vector<unsigned int> load_indices_from_file(const std::string& filename); } //namespace fw #endif
/* * Author: Richard Ciampa * Course: CST337 * Date: 2/18/2016 */ #include <stdio.h> #include <string.h> char and_gate(char a, char b); int main(int argc, char *argv[]){ if(argc == 3 && (strlen(argv[1]) == strlen(argv[2]))){ //We only need the size of one because they are equal size_t argSize = strlen(argv[1]); //Print the result printf("Result of AND: "); //Loop through the command line args for(int i = 0; i < argSize; i++){ //Print the result printf("%c",and_gate(argv[1][i], argv[2][i])); } puts("\n"); } return 0; } char and_gate(char a, char b){ if(a == '0' || b == '0'){ return '0'; }else{ return '1'; } }
#include "calc.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void yyerror(char const *s){fprintf (stderr, "%s\n> ", s);} symrec *putsym (char const *sym_name, int sym_type) { symrec *ptr = (symrec *) malloc (sizeof (symrec)); ptr->name = (char *) malloc (strlen (sym_name) + 1); strcpy (ptr->name,sym_name); ptr->type = sym_type; ptr->value.var = 0; ptr->next = (struct symrec *)sym_table; sym_table = ptr; return ptr; } symrec *getsym (char const *sym_name) { symrec *ptr; for (ptr = sym_table; ptr != (symrec *) 0; ptr = (symrec *)ptr->next) if (strcmp (ptr->name, sym_name) == 0) return ptr; return 0; }
/* Copyright The kNet Project. 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. */ #pragma once /** @file DebugMemoryLeakCheck.h @brief Provides overloads of operators new and delete for tracking memory leaks. */ #if defined(_MSC_VER) && defined(_DEBUG) && defined(KNET_MEMORY_LEAK_CHECK) #include <new> #include <crtdbg.h> // On MSVC2008, include these files beforehand to avoid compilation errors from our operator new redefine. #if _MSC_VER == 1500 #include <ios> #include <map> #endif #ifndef _CRTDBG_MAP_ALLOC #define _CRTDBG_MAP_ALLOC #endif __forceinline static void *operator new(size_t size, const char *file, int line) { return _malloc_dbg(size, _NORMAL_BLOCK, file, line); } __forceinline static void *operator new[](size_t size, const char *file, int line) { return _malloc_dbg(size, _NORMAL_BLOCK, file, line); } __forceinline static void operator delete(void *ptr, const char *, int) { _free_dbg(ptr, _NORMAL_BLOCK); } __forceinline static void operator delete[](void *ptr, const char *, int) { _free_dbg(ptr, _NORMAL_BLOCK); } __forceinline static void *operator new(size_t size) { #ifdef DEBUG_CPP_NAME return _malloc_dbg(size, _NORMAL_BLOCK, DEBUG_CPP_NAME, 1); #else return _malloc_dbg(size, _NORMAL_BLOCK, "(No CPP Name)", 1); #endif } __forceinline static void *operator new[](size_t size) { #ifdef DEBUG_CPP_NAME return _malloc_dbg(size, _NORMAL_BLOCK, DEBUG_CPP_NAME " new[]", 1); #else return _malloc_dbg(size, _NORMAL_BLOCK, "(No CPP Name new[])", 1); #endif } __forceinline static void operator delete(void *ptr) { _free_dbg(ptr, _NORMAL_BLOCK); } __forceinline static void operator delete[](void *ptr) { _free_dbg(ptr, _NORMAL_BLOCK); } #define new new (__FILE__, __LINE__) #endif
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <VectorKit/VGLTextureProgram.h> // Not exported @interface VGLClutTextureProgram : VGLTextureProgram { int _uClutSampler; int _clutSampler; int _uVariation; float _variation; } + (id)fragName; @property(nonatomic) float variation; // @synthesize variation=_variation; @property(nonatomic) int clutSampler; // @synthesize clutSampler=_clutSampler; - (void)setup; @end
#pragma once #include "VertexTexture.h" namespace sim { struct TriangleTexture { VertexTexture p1; VertexTexture p2; VertexTexture p3; }; } // namespace sim
/* * wboxtest/crypto/rc4.c */ #include <rc4.h> #include <wboxtest.h> static void * rc4_setup(struct wboxtest_t * wbt) { return NULL; } static void rc4_clean(struct wboxtest_t * wbt, void * data) { } static void rc4_run(struct wboxtest_t * wbt, void * data) { uint8_t key[5] = { 'x', 'b', 'o', 'o', 't' }; uint8_t dat[256]; uint8_t tmp[256]; wboxtest_random_buffer((char *)dat, sizeof(dat)); memcpy(tmp, dat, sizeof(dat)); rc4_crypt(key, 5, tmp, sizeof(tmp)); rc4_crypt(key, 5, tmp, sizeof(tmp)); assert_memory_equal(dat, tmp, sizeof(dat)); } static struct wboxtest_t wbt_rc4 = { .group = "crypto", .name = "rc4", .setup = rc4_setup, .clean = rc4_clean, .run = rc4_run, }; static __init void rc4_wbt_init(void) { register_wboxtest(&wbt_rc4); } static __exit void rc4_wbt_exit(void) { unregister_wboxtest(&wbt_rc4); } wboxtest_initcall(rc4_wbt_init); wboxtest_exitcall(rc4_wbt_exit);
// // ZYLrcView.h // ZY的音乐 // // Created by 张亚超 on 15/11/5. // Copyright © 2015年 zhaoyan. All rights reserved. // #import "DRNRealTimeBlurView.h" @interface ZYLrcView : DRNRealTimeBlurView @property(nonatomic,copy)NSString *lrcname; @end
extern zend_class_entry *part_function_main_ce; ZEPHIR_INIT_CLASS(Part_Function_Main); PHP_METHOD(Part_Function_Main, loader); PHP_METHOD(Part_Function_Main, func_function); PHP_METHOD(Part_Function_Main, def_function); PHP_METHOD(Part_Function_Main, class_function); PHP_METHOD(Part_Function_Main, call_function); ZEND_BEGIN_ARG_INFO_EX(arginfo_part_function_main_loader, 0, 0, 1) ZEND_ARG_INFO(0, plang) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_part_function_main_func_function, 0, 0, 1) ZEND_ARG_INFO(0, plang) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_part_function_main_def_function, 0, 0, 1) ZEND_ARG_INFO(0, plang) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_part_function_main_class_function, 0, 0, 1) ZEND_ARG_INFO(0, plang) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_part_function_main_call_function, 0, 0, 1) ZEND_ARG_INFO(0, plang) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(part_function_main_method_entry) { PHP_ME(Part_Function_Main, loader, arginfo_part_function_main_loader, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) PHP_ME(Part_Function_Main, func_function, arginfo_part_function_main_func_function, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) PHP_ME(Part_Function_Main, def_function, arginfo_part_function_main_def_function, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) PHP_ME(Part_Function_Main, class_function, arginfo_part_function_main_class_function, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) PHP_ME(Part_Function_Main, call_function, arginfo_part_function_main_call_function, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) PHP_FE_END };
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2019 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 AURORACOIN_NODE_COINSTATS_H #define AURORACOIN_NODE_COINSTATS_H #include <amount.h> #include <uint256.h> #include <cstdint> class CCoinsView; struct CCoinsStats { int nHeight; uint256 hashBlock; uint64_t nTransactions; uint64_t nTransactionOutputs; uint64_t nBogoSize; uint256 hashSerialized; uint64_t nDiskSize; CAmount nTotalAmount; CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nBogoSize(0), nDiskSize(0), nTotalAmount(0) {} }; //! Calculate statistics about the unspent transaction output set bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats); #endif // AURORACOIN_NODE_COINSTATS_H
// ------- Preamble -------- // #include <avr/io.h> #include <util/delay.h> #define DELAY 100 /* ms */ static inline uint8_t LFSR8_step(uint8_t random); static inline uint16_t LFSR16(uint16_t random); int main(void) { // -------- Inits --------- // DDRB = 0xff; /* output on all LEDs */ uint16_t random = 123; /* can't init to 0, any other is ok */ // ------ Event loop ------ // while (1) { /* Display and output */ random = LFSR16(random); PORTB = (random >> 8); _delay_ms(DELAY); } /* End event loop */ return 0; } // ----------------- LFSR Routines ---------------- // inline uint8_t LFSR8_step(uint8_t random) { /* Takes an 8-bit number, takes one step in a () LFSR. [3, 4, 5, 7] is the set of taps for 8-bits that goes through the whole cycle before repeating. If you're really serious about randomness, you'll want a different algorithm. In fact, this is a great demo of how "predictable" the "pseudo-random" sequence is. Note that this is not a very efficient way to code this up, but it's meant mostly for teaching and is plenty fast because the compiler does an OK job with it. */ uint8_t tap1, tap2, tap3, tap4; uint8_t newBit; tap1 = 1 & (random >> 3); tap2 = 1 & (random >> 4); tap3 = 1 & (random >> 5); tap4 = 1 & (random >> 7); newBit = tap1 ^ tap2 ^ tap3 ^ tap4; random = ((random << 1) | newBit); return (random); } inline uint16_t LFSR16(uint16_t random) { // 3, 12, 14, 15 are the maximal taps for 16 bits. uint16_t tap1, tap2, tap3, tap4; uint16_t newBit; tap1 = 1 & (random >> 3); tap2 = 1 & (random >> 12); tap3 = 1 & (random >> 14); tap4 = 1 & (random >> 15); newBit = tap1 ^ tap2 ^ tap3 ^ tap4; random = ((random << 1) | newBit); return (random); }
#pragma once #include "BNode.hpp" namespace bjoernligan { namespace ai { class CanSeeEnemies : public BNode { public: CanSeeEnemies(); EBNodeStatus Process(); }; } }
#pragma once #ifdef ZEPHYR_COMMON_EXPORTS #define ZEPHYR_COMMON_API __declspec(dllexport) #else #define ZEPHYR_COMMON_API __declspec(dllimport) #endif #ifndef NOMINMAX #define NOMINMAX #endif #include "GeometryMath.h"
#pragma once #include "jai_socket_define.h" namespace jai { class IPv4 { public: typedef in_addr_t IPType; typedef uint16_t PortType; protected: IPType mIP = INADDR_NONE; public: IPv4() = default; IPv4(const IPv4 & ) = default; IPType getAddressValue() const { return mIP; } void setAddressValue(IPType value) { mIP = value; } IPv4(std::string const & host_name); bool isValidAddress() const; void setAddress(uint8_t ip0, uint8_t ip1, uint8_t ip2, uint8_t ip3); void setHostAddress(std::string const & host_name); std::string getAddressString() const; }; class IPInfo { protected: addrinfo * mAddress = nullptr; IPInfo(IPInfo const & ) = delete; public: IPInfo() = default; void operator = (IPInfo const &) = delete; ~IPInfo(); addrinfo * getAddressInfo() const { return mAddress; } bool isValidAddress() const; void setHostAddress(std::string const & host_name, std::string const & service = "", addrinfo * hints = nullptr); void setLocalAddress(std::string const & service = "", addrinfo * hints = nullptr); AddressFamily getDefaultAF() const; bool isIPv6() const; bool isIPv4() const; void cleanAddress(); public: static std::string GetAddressString(addrinfo * addr); }; }
// // client.h // client // // Created by Chris Kleeschulte on 4/16/15. // Copyright (c) 2015 bitpay. All rights reserved. // #import <Foundation/Foundation.h> #import "constants.h" #import "keyutils.h" typedef enum { POS, MERCHANT } facade; typedef enum { PAIRING, TOKEN } codeType; @interface BPBitPay : NSObject @property NSString *name; @property NSString *pem; @property NSString *sin; @property (nonatomic, retain, getter = getHost) NSString *host; - (id) initWithName: (NSString *)name pem: (NSString *)pem; - (NSString *) requestClientAuthorizationWithFacade: (facade)type error: (NSError **)error; - (NSString *) authorizeClient: (NSString *)pairingCode error: (NSError **)error; @end
// // SimpleDemoDetailController.h // CoreAnimation // // Created by apple on 16/2/18. // Copyright © 2016年 HQ. All rights reserved. // #import "RootViewController.h" typedef enum : NSUInteger { HQDynamicTypeSnap = 0, HQDynamicTypePush, HQDynamicTypeAttachment, HQDynamicTypeSpring, } HQDynamicType; @interface SimpleDemoDetailController : RootViewController @property (assign, nonatomic) HQDynamicType type; @end
// // ViewController.h // HZYScanView // // Created by Michael-Nine on 2017/6/15. // Copyright © 2017年 Michael. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#import "BTUIThemedView.h" typedef NS_OPTIONS(NSUInteger, BTUICardFormOptionalFields) { BTUICardFormOptionalFieldsNone = 0, BTUICardFormOptionalFieldsCvv = 1 << 0, BTUICardFormOptionalFieldsPostalCode = 1 << 1, BTUICardFormOptionalFieldsPhoneNumber= 1 << 2, BTUICardFormOptionalFieldsAll = BTUICardFormOptionalFieldsCvv | BTUICardFormOptionalFieldsPostalCode | BTUICardFormOptionalFieldsPhoneNumber }; typedef NS_ENUM(NSUInteger, BTUICardFormField) { BTUICardFormFieldNumber = 0, BTUICardFormFieldExpiration, BTUICardFormFieldCvv, BTUICardFormFieldPostalCode, BTUICardFormFieldPhoneNumber, }; @protocol BTUICardFormViewDelegate; @interface BTUICardFormView : BTUIThemedView @property (nonatomic, weak) IBOutlet id<BTUICardFormViewDelegate> delegate; @property (nonatomic, assign, readonly) BOOL valid; /// The card number. /// /// If you set a card number longer than is allowed by the card type, /// it will not be set. @property (nonatomic, copy) NSString *number; /// The card CVV /// /// @note this field is only visible when specified in `optionalFields` @property (nonatomic, copy) NSString *cvv; /// The card billing address postal code for AVS verifications /// /// @note this field is only visible when specified in `optionalFields` @property (nonatomic, copy) NSString *postalCode; /// The card expiration month @property (nonatomic, copy, readonly) NSString *expirationMonth; /// The card expiration year @property (nonatomic, copy, readonly) NSString *expirationYear; /// A phone number @property (nonatomic, copy, readonly) NSString *phoneNumber; /// Sets the card form view's expiration date /// /// @param expirationDate The expiration date. Passing in `nil` will clear the /// card form's expiry field. - (void)setExpirationDate:(NSDate *)expirationDate; /// Sets the card form view's expiration date /// /// @param expirationMonth The expiration month /// @param expirationYear The expiration year. Two-digit years are assumed to be 20xx. - (void)setExpirationMonth:(NSInteger)expirationMonth year:(NSInteger)expirationYear; /// Immediately present a top level error message to the user. /// /// @param field Field to mark invalid. - (void)showTopLevelError:(NSString *)message; /// Immediately present a field-level error to the user. /// /// @note We do not support field-level error descriptions. This method highlights the field to indicate invalidity. /// @param field The invalid field - (void)showErrorForField:(BTUICardFormField)field; /// Configure whether to support complete alphanumeric postal codes. /// /// If NO, allows only digit entry. /// /// Defaults to YES @property (nonatomic, assign) BOOL alphaNumericPostalCode; /// Which fields should be included. /// /// Defaults to BTUICardFormOptionalFieldsAll @property (nonatomic, assign) BTUICardFormOptionalFields optionalFields; /// Whether to provide feedback to the user via vibration /// /// Defaults to YES @property (nonatomic, assign) BOOL vibrate; @end /// Delegate protocol for receiving updates about the card form @protocol BTUICardFormViewDelegate <NSObject> @optional /// The card form data has updated. - (void)cardFormViewDidChange:(BTUICardFormView *)cardFormView; - (void)cardFormViewDidBeginEditing:(BTUICardFormView *)cardFormView; - (void)cardFormViewDidEndEditing:(BTUICardFormView *)cardFormView; @end
// // MGArrowItem.h // MGMiaoBo // // Created by ming on 16/9/12. // Copyright © 2016年 ming. All rights reserved. // #import "MGSettingItem.h" @interface MGArrowItem : MGSettingItem /** 保存跳转的控制器的类型 */ @property (nonatomic, assign) Class descVcClass; @end
// // main.c // BeerSong // // Created by edwardtoday on 12/16/14. // Copyright (c) 2014 edwardtoday. All rights reserved. // #include <stdio.h> void singSongFor(int numberOfBottles) { if (numberOfBottles == 0) { printf("There are simply no more bottles of beer on the wall.\n\n"); } else { printf("%d bottles of beer on the wall. %d bottles of beer.\n", numberOfBottles, numberOfBottles); int oneFewer = numberOfBottles - 1; printf("Take one down, pass it around, %d bottles of beer on the wall.\n\n", oneFewer); singSongFor(oneFewer); // This function calls it self! // Print a message just before the function ends printf("Put a bottle in the recycling, %d empty bottles in the bin.\n", numberOfBottles); } } int main(int argc, const char *argv[]) { // We could sing 99 verses, but 4 is easier to think about singSongFor(4); return 0; }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "CDStructures.h" #import <IDEFoundation/IDEDistributionProcessingStep.h> @class IDEDistributionItem; @interface IDEDistributionItemProcessingStep : IDEDistributionProcessingStep { } + (_Bool)runsPerDistributionItem; @property(readonly) IDEDistributionItem *distributionItem; - (id)requiredInputContextPropertyNames; @end
// Copyright (c) 2014 Jan Böker // MIT License #ifndef GUI_EMUTHREAD_H #define GUI_EMUTHREAD_H #include <QObject> #include <QThread> #include <QSize> #include <atomic> class Sound_Queue; namespace gameboy { class Core; } class ScreenWidget; class EmuThread : public QThread { Q_OBJECT public: EmuThread(gameboy::Core *, ScreenWidget *); virtual ~EmuThread(); void run(); std::atomic<bool> stopped; std::atomic<bool> soundEnabled; std::atomic<bool> singleStep; private: gameboy::Core *gameboyCore; ScreenWidget *screenWidget; Sound_Queue *soundQueue; }; #endif
// // RulerView.h // WTRequestCenter // // Created by SongWentong on 14/10/30. // Copyright (c) 2014年 song. All rights reserved. // @import UIKit; @interface RulerView : UIView { NSInteger animationIndex; UIView *animateView; UIView *animateView2; UIView *animateView3; } @end
/********************************************************************** The following code is derived, directly or indirectly, from the SystemC source code Copyright (c) 1996-2008 by all Contributors. All Rights reserved. The contents of this file are subject to the restrictions and limitations set forth in the SystemC Open Source License Version 3.0 (the "License"); You may not use this file except in compliance with such restrictions and limitations. You may obtain instructions on how to receive a copy of the License at http://www.systemc.org/. Software distributed by Contributors under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. *********************************************************************/ //===================================================================== /// @file example_system_top.h /// @brief This class instantiates components that compose the TLM2 /// example system called at_1_phase //===================================================================== // Original Authors: // Anna Keist, ESLX // Bill Bunton, ESLX // Jack Donovan, ESLX //===================================================================== #ifndef __EXAMPLE_SYSTEM_TOP_H__ #define __EXAMPLE_SYSTEM_TOP_H__ #include "reporting.h" // common reporting code #include "at_target_1_phase.h" // at memory target #include "initiator_top.h" // processor abstraction initiator #include "models/SimpleBusAT.h" // Bus/Router Implementation /// Top wrapper Module class example_system_top : public sc_core::sc_module // SC base class { public: /// Constructor example_system_top ( sc_core::sc_module_name name); //Member Variables =========================================================== private: SimpleBusAT<2, 2> m_bus; ///< simple bus at_target_1_phase m_at_target_1_phase_1; ///< instance 1 target at_target_1_phase m_at_target_1_phase_2; ///< instance 2 target initiator_top m_initiator_1; ///< instance 1 initiator initiator_top m_initiator_2; ///< instance 2 initiator }; #endif /* __EXAMPLE_SYSTEM_TOP_H__ */
#ifndef _DPP_WAYPOINT_SEQUENCE_PLANNER_H_ #define _DPP_WAYPOINT_SEQUENCE_PLANNER_H_ #include <dpp/planner/DubinsVehiclePathPlanner.h> namespace dpp { #define DPP_SEQUENCE_ID_NOT_SET -1 typedef struct Waypoint { double x; double y; } Waypoint; typedef struct WaypointSequenceTransform { int oldIndex; int newIndex; } WaypointSequenceTransform; typedef std::vector<Waypoint> WaypointList; class WaypointSequencePlanner : private DubinsVehiclePathPlanner { public: using DubinsVehiclePathPlanner::DtspPlanningAlgorithm; using DubinsVehiclePathPlanner::algorithm; using PathPlanner::algorithmName; using DubinsPathPlanner::initialHeading; using DubinsPathPlanner::turnRadius; using PathPlanner::waypointCount; using PathPlanner::cost; using PathPlanner::haveSolution; WaypointSequencePlanner(double turnRadius = 1.0, double initialHeading = 0.0, Algorithm *alg = new AlternatingDtsp) : DubinsVehiclePathPlanner(turnRadius, alg), m_sequenceTransformList(m_G) { m_initialHeading = initialHeading; } ~WaypointSequencePlanner() { } bool solve(void) { return planWaypointSequence(); } bool planWaypointSequence(void); int newWaypointSequenceId(int oldIndex); std::vector<int> newWaypointSequenceList(void); // FIXME move some of these functions up to the PathPlanner abstract class and overload them? void addWaypoints(const WaypointList list); int addWaypoint(const Waypoint waypoint); bool containsWaypoint(double x, double y); bool containsWaypoint(Waypoint waypoint) { return containsWaypoint(waypoint.x, waypoint.y); } private: ogdf::NodeArray<WaypointSequenceTransform> m_sequenceTransformList; std::vector<ogdf::node> m_originalNodeList, m_newNodeList; }; } // dpp #endif // _DPP_WAYPOINT_SEQUENCE_PLANNER_H_
// // ModalVCViewController.h // BlockDemo // // Created by 鑫鑫 on 2017/4/11. // Copyright © 2017年 zhangxinxin. All rights reserved. // #import <UIKit/UIKit.h> @interface ModalVCViewController : UIViewController // 在要modal的控制器B声明一个带参数block属性 @property (nonatomic ,copy) void(^valueBlcok)(NSString *value); @end
// This file is distributed under the MIT license. // See the LICENSE file for details. #pragma once #ifndef VSNRAY_DETAIL_ALGORITHM_H #define VSNRAY_DETAIL_ALGORITHM_H 1 #include <algorithm> #include <cstddef> #include <functional> #include <iterator> #include <type_traits> #include "macros.h" namespace visionaray { namespace algo { //------------------------------------------------------------------------------------------------- // copy // // Copies the range [first,...,last) to another range beginning at d_first. // // Custom implementation to run in CUDA kernels, resorts to std::copy otherwise. // template <typename T, typename U> VSNRAY_FUNC U copy(T first, T last, U d_first) { #ifdef __CUDA_ARCH__ while (first != last) { *d_first++ = *first++; } return d_first; #else return std::copy(first, last, d_first); #endif } //------------------------------------------------------------------------------------------------- // counting_sort trivial key // namespace detail { struct trivial_key { template < typename T, typename = typename std::enable_if<std::is_integral<T>::value>::type > T operator()(T val) { return val; } }; } // detail //------------------------------------------------------------------------------------------------- // counting_sort // // Sorts items based on integer keys in [0..k). // // [in] FIRST // Start of the input sequence. // // [in] LAST // End of the input sequence. // // [out] OUT // Start of the output sequence. // // [in,out] COUNTS // Modifiable counts sequence. // // [in] KEY // Sort key function object. // // Complexity: O(n + k) // template < typename InputIt, typename OutputIt, typename Counts, typename Key = detail::trivial_key > void counting_sort(InputIt first, InputIt last, OutputIt out, Counts counts, Key key = Key()) { static_assert( std::is_integral<decltype(key(*first))>::value, "counting_sort requires integral key type" ); std::fill(std::begin(counts), std::end(counts), 0); for (auto it = first; it != last; ++it) { ++counts[key(*it)]; } for (size_t m = 1; m < counts.size(); ++m) { counts[m] += counts[m - 1]; } for (auto it = first; it != last; ++it) { out[--counts[key(*it)]] = *it; } } //------------------------------------------------------------------------------------------------- // insert_sorted // // Inserts an element into the sorted sequence [first,...,last) so that the // sequence is sorted afterwards. // // It is the user's responsibility to ensure that the sequence is sorted // according to the condition argument COND provided to this function! // // Parameters: // // [in] ITEM // The element to insert. // // [in,out] FIRST // Start of the sorted sequence. // // [in,out] LAST // End of the sorted sequence. // // [in] COND // Conditional function that, given to elements, returns the 'smaller' // one in terms of the order of the sorted sequence. // // Complexity: O(n) // template <typename T, typename RandIt, typename Cond> VSNRAY_FUNC void insert_sorted(T const& item, RandIt first, RandIt last, Cond cond) { RandIt it = first; RandIt pos = last; while (it < last) { if (cond(item, *it)) { pos = it; break; } ++it; } it = (pos != last) ? last - 1 : last; while (it > pos) { *it = *(it - 1); --it; } if (pos != last) { *pos = item; } } //------------------------------------------------------------------------------------------------- // reorder // // Reorders the elements in [data, data + count) according to the indices stored // in [indices, indices + count). // The list of indices must form a permutation of [0,1,2,...,count). // // Effectively this algorithms sorts the indices while shuffling the elements // in data accordingly. // // Parameters: // // [in,out] INDICES // On entry, contains a permutation of [0,...,count). // On exit, contains the identity permutation [0,1,2,...,count). // // [in,out] DATA // On entry, contains the list of elements to be sorted according to the // list of indices. // On exit, contains [data[I[0]], data[I[1]], ...), where I denotes the // list of indices on entry. // // [in] COUNT // The number of indices and data elements. // Must be >= 0. // template <typename RanIt1, typename RanIt2, typename Int> void reorder_n(RanIt1 indices, RanIt2 data, Int count) { for (Int i = 0; i < count; ++i) { auto inext = indices[i]; // assert(inext >= 0); // assert(inext < count); if (i == inext) continue; auto temp = std::move(data[i]); auto j = i; // auto inextnext = indices[inext]; for (;;) { // assert(inextnext != j && "cycle detected"); indices[j] = j; if (inext == i) { data[j] = std::move(temp); break; } else { data[j] = std::move(data[inext]); j = inext; inext = indices[j]; // assert(inext >= 0); // assert(inext < count); // inextnext = indices[inext]; // assert(inextnext >= 0); // assert(inextnext < count); } } } } template <typename RanIt1, typename RanIt2> void reorder(RanIt1 indices_first, RanIt1 indices_last, RanIt2 data) { auto count = std::distance(indices_first, indices_last); reorder_n(indices_first, data, count); } } // namespace algo } // namespace visionaray #endif // VSNRAY_DETAIL_ALGORITHM_H
#import <UIKit/UIKit.h> @interface KnCPinViewController : UIViewController typedef enum { PIN_DEFAULT, PIN_CURRENT, PIN_SET, PIN_CONFIRM, PIN_CANCELABLE } PIN_MODE; @property (nonatomic, weak) IBOutlet UIView *digitsSuperView; @property (nonatomic, weak) IBOutlet UILabel *titleLabel; @property (nonatomic, weak) IBOutlet UIView *digit0; @property (nonatomic, weak) IBOutlet UIView *digit1; @property (nonatomic, weak) IBOutlet UIView *digit2; @property (nonatomic, weak) IBOutlet UIView *digit3; @property (nonatomic, weak) IBOutlet UIButton *deleteButton; @property (nonatomic, weak) IBOutlet UIButton *cancelButton; -(IBAction)deleteCancelButtonPressed:(id)sender; -(IBAction)pinButtonPressed:(UIButton*)sender; @property (nonatomic, copy) void (^completionBlock)(BOOL success); -(id)initConfigureMode; -(id)initCancelable; @end
#import "SignEventEntity.h" @interface SignEvent : SignEventEntity @end
#import <UIKit/UIKit.h> @interface UIFont (Rochester) + (instancetype)rochesterRegularFontOfSize:(CGFloat)size; @end
template <class T> int HML_CompareMeanOfVectors(T *a, T *b, int VHML_N); template <class T> int HML_CompareMeanOfVectors(T *a, T *b, int VHML_N1, int VHML_N2);
#ifndef METRICSCALCULATION_H #define METRICSCALCULATION_H #include "Fast_Include.h" #include <string> class MetricCounter { public: int getValue(); virtual void init(); virtual void goIn(VTP_TreeP &tree); virtual void goOut(VTP_TreeP &tree); protected: int no,stop; virtual void visitIn(VTP_TreeP &tree) = 0; virtual void visitOut(VTP_TreeP &tree) = 0; virtual bool evaluateStopping(VTP_TreeP &tree) = 0; }; class NoDecisions:public MetricCounter { protected: void visitIn(VTP_TreeP &tree); void visitOut(VTP_TreeP &tree); bool evaluateStopping(VTP_TreeP &tree); }; class CountOperators:public MetricCounter { public: CountOperators(std::string op_name); protected: void visitIn(VTP_TreeP &tree); void visitOut(VTP_TreeP &tree); bool evaluateStopping(VTP_TreeP &tree); private: std::string op_name; }; class MaxNesting:public MetricCounter { public: void init(); protected: void visitIn(VTP_TreeP &tree); void visitOut(VTP_TreeP &tree); bool evaluateStopping(VTP_TreeP &tree); private: int current; }; class CountStatement:public MetricCounter { protected: void visitIn(VTP_TreeP &tree); void visitOut(VTP_TreeP &tree); bool evaluateStopping(VTP_TreeP &tree); }; class CountCodeLine:public MetricCounter { public: void init(); protected: void visitIn(VTP_TreeP &tree); void visitOut(VTP_TreeP &tree); bool evaluateStopping(VTP_TreeP &tree); private: int last; }; #endif //METAMODELEXTRACTOR_H
// Copyright (c) 2011-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The YUP 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_GUICONSTANTS_H #define BITCOIN_QT_GUICONSTANTS_H /* Milliseconds between model updates */ static const int MODEL_UPDATE_DELAY = 250; /* AskPassphraseDialog -- Maximum passphrase length */ static const int MAX_PASSPHRASE_SIZE = 1024; /* Yup GUI -- Size of icons in status bar */ static const int STATUSBAR_ICONSIZE = 16; static const bool DEFAULT_SPLASHSCREEN = true; /* Invalid field background style */ #define STYLE_INVALID "background:#FF8080" /* Transaction list -- unconfirmed transaction */ #define COLOR_UNCONFIRMED QColor(128, 128, 128) /* Transaction list -- negative amount */ #define COLOR_NEGATIVE QColor(255, 0, 0) /* Transaction list -- bare address (without label) */ #define COLOR_BAREADDRESS QColor(140, 140, 140) /* Transaction list -- TX status decoration - open until date */ #define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255) /* Transaction list -- TX status decoration - offline */ #define COLOR_TX_STATUS_OFFLINE QColor(192, 192, 192) /* Transaction list -- TX status decoration - default color */ #define COLOR_BLACK QColor(51, 51, 51) /* Tooltips longer than this (in characters) are converted into rich text, so that they can be word-wrapped. */ static const int TOOLTIP_WRAP_THRESHOLD = 80; /* Maximum allowed URI length */ static const int MAX_URI_LENGTH = 255; /* QRCodeDialog -- size of exported QR Code image */ #define EXPORT_IMAGE_SIZE 256 /* Number of frames in spinner animation */ #define SPINNER_FRAMES 35 #define QAPP_ORG_NAME "YUP" #define QAPP_ORG_DOMAIN "yup.org" #define QAPP_APP_NAME_DEFAULT "YUP-Qt" #define QAPP_APP_NAME_TESTNET "YUP-Qt-testnet" #endif // BITCOIN_QT_GUICONSTANTS_H
#include <string.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include "scanner.h" void initScanner(Scanner* scanner, const char* source) { scanner->start = source; scanner->current = source; } void freeScanner(Scanner* scanner) { free(scanner); } static char advance(Scanner* scanner) { scanner->current++; return scanner->current[-1]; } static char peek(Scanner* scanner) { return scanner->current[0]; } static bool isAtEnd(Scanner* scanner) { return peek(scanner) == '\0'; } static void skipWhitespace(Scanner* scanner) { for(;;) { char ch = *scanner->current; switch(ch) { case ' ': case ',': case '\r': case '\n': case '\t': advance(scanner); break; default: return; } } } static Token newToken(Scanner* scanner, TokenType type) { Token token; token.type = type; token.start = scanner->start; token.length = (int) (scanner->current - scanner->start); return token; } static Token newErrorToken(const char* message) { Token token; token.type = TOKEN_ERROR; token.start = message; token.length = (int)strlen(message); return token; } static bool isDigit(char ch) { return ch >= '0' && ch <= '9'; } static bool isAlphabetic(char ch) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_' || ch == '-' || ch == '?' || ch == '!' || ch == '+' || ch == '*' || ch == '/' || ch == '='; } static bool isSymbol(Scanner* scanner, const char* name) { int tokenLength = (int) (scanner->current - scanner->start); int nameLength = (int) strlen(name); if (tokenLength != nameLength) { return false; } return memcmp(scanner->start, name, strlen(name)) == 0; } static Token scanComment(Scanner* scanner) { while(peek(scanner) != '\n' && peek(scanner) != '\r' && !isAtEnd(scanner)) { advance(scanner); } advance(scanner); return newToken(scanner, TOKEN_COMMENT); } static Token scanString(Scanner* scanner) { scanner->start++; while(peek(scanner) != '"' && !isAtEnd(scanner)) { advance(scanner); if (peek(scanner) == '\\') { advance(scanner); } } if (isAtEnd(scanner)) { return newErrorToken("Unterminated string."); } Token token = newToken(scanner, TOKEN_STRING); advance(scanner); return token; } static Token scanCharacter(Scanner* scanner) { advance(scanner); return newToken(scanner, TOKEN_CHARACTER); } static Token scanNumber(Scanner* scanner) { while(!isAtEnd(scanner) && (isDigit(peek(scanner)) || peek(scanner) == '.')) { advance(scanner); } return newToken(scanner, TOKEN_NUMBER); } static Token scanSymbol(Scanner* scanner) { while(!isAtEnd(scanner) && (isAlphabetic(peek(scanner)) || isDigit(peek(scanner)))) { advance(scanner); } if (isSymbol(scanner, "true")) { return newToken(scanner, TOKEN_TRUE); } else if (isSymbol(scanner, "false")) { return newToken(scanner, TOKEN_FALSE); } else if (isSymbol(scanner, "nil")) { return newToken(scanner, TOKEN_NIL); } return newToken(scanner, TOKEN_SYMBOL); } Token scanToken(Scanner* scanner) { skipWhitespace(scanner); scanner->start = scanner->current; if (isAtEnd(scanner)) { return newToken(scanner, TOKEN_EOF); } char ch = advance(scanner); switch(ch) { case ';': return scanComment(scanner); case '(': return newToken(scanner, TOKEN_LPAREN); case ')': return newToken(scanner, TOKEN_RPAREN); case '[': return newToken(scanner, TOKEN_LSQUARE); case ']': return newToken(scanner, TOKEN_RSQUARE); case '\\': return scanCharacter(scanner); case '"': return scanString(scanner); default: { if (isDigit(ch)) { return scanNumber(scanner); } if (ch == '+' || ch == '-') { char n = peek(scanner); if (isDigit(n)) { return scanNumber(scanner); } } if (isAlphabetic(ch)) { return scanSymbol(scanner); } return newToken(scanner, TOKEN_EOF); } } } void dumpToken(Token token) { fprintf(stdout, "t: %.*s\n", token.length, token.start); }
#ifndef NET_H #define NET_H #endif // NET_H #pragma once #include <iostream> #include<opencv2\core\core.hpp> #include<opencv2\highgui\highgui.hpp> //#include<iomanip> #include"Function.h" namespace liu { class Net { public: //Integer vector specifying the number of neurons in each layer including the input and output layers. std::vector<int> layer_neuron_num; std::string activation_function = "sigmoid"; int output_interval = 10; float learning_rate; float accuracy = 0.; std::vector<double> loss_vec; float fine_tune_factor = 1.01; protected: std::vector<cv::Mat> layer; std::vector<cv::Mat> weights; std::vector<cv::Mat> bias; std::vector<cv::Mat> delta_err; cv::Mat output_error; cv::Mat target; cv::Mat board; float loss; public: Net() {}; ~Net() {}; //Initialize net:genetate weights matrices¡¢layer matrices and bias matrices // bias default all zero void initNet(std::vector<int> layer_neuron_num_); //Initialise the weights matrices. void initWeights(int type = 0, double a = 0., double b = 0.1); //Initialise the bias matrices. void initBias(cv::Scalar& bias); //Forward void forward(); //Forward void backward(); //Train,use accuracy_threshold void train(cv::Mat input, cv::Mat target, float accuracy_threshold); //Train,use loss_threshold void Net::train(cv::Mat input, cv::Mat target_, float loss_threshold, bool draw_loss_curve = false); //Test void test(cv::Mat &input, cv::Mat &target_); //Predict,just one sample int predict_one(cv::Mat &input); //Predict,more than one samples std::vector<int> predict(cv::Mat &input); //Save model; void save(std::string filename); //Load model; void load(std::string filename); protected: //initialise the weight matrix.if type =0,Gaussian.else uniform. void initWeight(cv::Mat &dst, int type, double a, double b); //Activation function cv::Mat activationFunction(cv::Mat &x, std::string func_type); //Compute delta error void deltaError(); //Update weights void updateWeights(); }; //Get sample_number samples in XML file,from the start column. void get_input_label(std::string filename, cv::Mat& input, cv::Mat& label, int sample_num, int start = 0); // Draw loss curve void draw_curve(cv::Mat& board, std::vector<double> points); }
#include "Facemark.h" #include "FacemarkAAMData.h" #if CV_VERSION_GREATER_EQUAL(3, 4, 0) #ifndef __FF_FACEMARKBINDINGS_H_ #define __FF_FACEMARKBINDINGS_H_ namespace FacemarkBindings { struct LoadModelWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::Facemark> self; LoadModelWorker(cv::Ptr<cv::face::Facemark> self) { this->self = self; } std::string model; std::string executeCatchCvExceptionWorker() { self->loadModel(model); return ""; } bool unwrapRequiredArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return (FF::StringConverter::arg(0, &model, info)); } }; struct FitWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::Facemark> self; FitWorker(cv::Ptr<cv::face::Facemark> self) { this->self = self; } cv::Mat image; std::vector<cv::Rect> faces; std::vector<std::vector<cv::Point2f>> landmarks; std::string executeCatchCvExceptionWorker() { self->fit(image, faces, landmarks); return ""; } v8::Local<v8::Value> getReturnValue() { v8::Local<v8::Value> ret = Point2::ArrayOfArraysWithCastConverter<cv::Point2f>::wrap(landmarks); return ret; } bool unwrapRequiredArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return (Mat::Converter::arg(0, &image, info) || Rect::ArrayWithCastConverter<cv::Rect>::arg(1, &faces, info)); } }; #if CV_VERSION_MAJOR <= 3 && CV_VERSION_MINOR < 2 struct AddTrainingSampleWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::Facemark> self; AddTrainingSampleWorker(cv::Ptr<cv::face::Facemark> self) { this->self = self; } bool results; cv::Mat image; std::vector<cv::Point2f> landmarks; std::string executeCatchCvExceptionWorker() { results = self->addTrainingSample(image, landmarks); return ""; } v8::Local<v8::Value> getReturnValue() { v8::Local<v8::Value> ret = Nan::New<v8::Boolean>(results); return ret; } bool unwrapRequiredArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return (Mat::Converter::arg(0, &image, info) || Point2::ArrayWithCastConverter<cv::Point2f>::arg( 1, &landmarks, info)); } }; struct GetDataWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::Facemark> self; GetDataWorker(cv::Ptr<cv::face::Facemark> self) { this->self = self; } cv::face::FacemarkAAM::Data data; std::string executeCatchCvExceptionWorker() { self->getData(&data); return ""; } v8::Local<v8::Value> getReturnValue() { v8::Local<v8::Value> ret = InstanceConverter<FacemarkAAMData, cv::face::FacemarkAAM::Data>::wrap(data); return ret; } }; struct GetFacesWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::Facemark> self; GetFacesWorker(cv::Ptr<cv::face::Facemark> self) { this->self = self; } cv::Mat image; std::vector<cv::Rect> faces; std::string executeCatchCvExceptionWorker() { self->getFaces(image, faces); return ""; } v8::Local<v8::Value> getReturnValue() { v8::Local<v8::Value> ret = Rect::ArrayConverter::wrap(faces); return ret; } bool unwrapRequiredArgs(Nan::NAN_METHOD_ARGS_TYPE info) { return (Mat::Converter::arg(0, &image, info)); } }; struct TrainingWorker : public CatchCvExceptionWorker { public: cv::Ptr<cv::face::Facemark> self; TrainingWorker(cv::Ptr<cv::face::Facemark> self) { this->self = self; } std::string executeCatchCvExceptionWorker() { self->training(); return ""; } }; #endif } #endif #endif
/* Copyright ©1995, Juri Munkki All rights reserved. File: CLogicDelay.h Created: Wednesday, November 22, 1995, 7:47 Modified: Wednesday, November 22, 1995, 8:58 */ #pragma once #include "CLogic.h" #define DELAY_PIPELINE 32 class CLogicDelay : public CLogic { public: long theDelay; long scheduledFrame[DELAY_PIPELINE]; virtual void FrameAction(); virtual void BeginScript(); virtual CAbstractActor *EndScript(); };
#include <stdio.h> void print_star(int n); int main(void) { int num = 3; //scanf("%d",&num); print_star(num); return 0 ; } void print_star(int n) { int row,col; for (row = 0;row < n ; row++ ) //控制行 3行 { for ( col = 0; col < n + row ; col++ ) { if ( col < n -row - 1 ) printf(" "); else printf("*"); } printf("\n"); } }
/* sequentialCalcOptFlow.h */ #ifndef INCLUDE_SEQUENTIALCALCOPTFLOW_H #define INCLUDE_SEQUENTIALCALCOPTFLOW_H //----------------------------------------------------------------------- // include files //----------------------------------------------------------------------- #include <mutex> #include <opencv2/opencv.hpp> //----------------------------------------------------------------------- // grobal variable declaration //----------------------------------------------------------------------- extern std::mutex opt_flow_mtx; //----------------------------------------------------------------------- // function prototype //----------------------------------------------------------------------- void sequentialCalcOptFlow(cv::Mat& curr, cv::Mat& flow, bool& break_flag); //----------------------------------------------------------------------- #endif // INCLUDE_SEQUENTIALCALCOPTFLOW_H
// // VRAppDelegate.h // DynamicQuestionnaire // // Created by Richard Warrender on 14/03/2014. // Copyright (c) 2014 Vivid Reflection. All rights reserved. // #import <UIKit/UIKit.h> #import "VRQuestionnaire.h" #import "VRQuestionViewController.h" @interface VRAppDelegate : UIResponder <UIApplicationDelegate, VRQuestionViewControllerDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UINavigationController *navController; @property (strong, nonatomic) VRQuestionnaire *qnaire; @end
#pragma once #include <stdint.h> namespace SiCKL { typedef int32_t symbol_id_t; typedef int32_t member_id_t; const symbol_id_t invalid_symbol = -1; const symbol_id_t temp_symbol = -2; const symbol_id_t member_symbol = -3; struct NodeType { enum Type { Invalid = -1, // Flow Control Program, ConstData, OutData, Main, Block, If, ElseIf, Else, While, ForInRange, // Variable Declaration OutVar, ConstVar, Var, Literal, // Binary Operators Assignment, // Comparison Equal, NotEqual, Greater, GreaterEqual, Less, LessEqual, LogicalAnd, LogicalOr, LogicalNot, BitwiseAnd, BitwiseOr, BitwiseXor, BitwiseNot, LeftShift, RightShift, // Arithmetic UnaryMinus, Add, Subtract, Multiply, Divide, Modulo, // Functions Constructor, Cast, Function, Sample1D,// sample from 1D buffer Sample2D,// sample from 2d buffer Member,// member variable access GetIndex,// get the index we're working on GetNormalizedIndex,// get normalized index we're working on }; }; // each type is denoted by a bit struct ReturnType { enum Type { # define SHIFT(X) (1 << X) Invalid = -1, Void = SHIFT(0), Bool = SHIFT(1), Int = SHIFT(2), UInt = SHIFT(3), Float = SHIFT(4), Int2 = SHIFT(5), UInt2 = SHIFT(6), Float2 = SHIFT(7), Int3 = SHIFT(8), UInt3 = SHIFT(9), Float3 = SHIFT(10), Int4 = SHIFT(11), UInt4 = SHIFT(12), Float4 = SHIFT(13), // Buffer types Buffer1D = SHIFT(30), Buffer2D = SHIFT(31), # undef SHIFT }; }; struct BuiltinFunction { enum Func { Invalid = -1, // info Index, NormalizedIndex, // trigonometry Sin, Cos, Tan, ASin, ACos, ATan, SinH, CosH, TanH, ASinH, ACosH, ATanH, // exponential functions Pow, Exp, Log, Exp2, Log2, Sqrt, // common Abs, Sign, Floor, Ceiling, Min, Max, Clamp, IsNan, IsInf, // vector math Length, Distance, Dot, Cross, Normalize, }; }; }
// // AlipaySDK.h // AlipaySDK // // Created by antfin on 17-10-24. // Copyright (c) 2017年 AntFin. All rights reserved. // //////////////////////////////////////////////////////// ///////////////// 支付宝标准版本支付SDK /////////////////// /////////// version:15.5.5 motify:2018.05.09 /////////// //////////////////////////////////////////////////////// #import <UIKit/UIKit.h> #import "APayAuthInfo.h" typedef void(^CompletionBlock)(NSDictionary *resultDic); @interface AlipaySDK : NSObject /** * 创建支付单例服务 * * @return 返回单例对象 */ + (AlipaySDK *)defaultService; /** * 用于设置SDK使用的window,如果没有自行创建window无需设置此接口 */ @property (nonatomic, weak) UIWindow *targetWindow; /** * 支付接口 * * @param orderStr 订单信息 * @param schemeStr 调用支付的app注册在info.plist中的scheme * @param completionBlock 支付结果回调Block,用于wap支付结果回调(非跳转钱包支付) */ - (void)payOrder:(NSString *)orderStr fromScheme:(NSString *)schemeStr callback:(CompletionBlock)completionBlock; /** * 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url * * @param resultUrl 支付结果url * @param completionBlock 支付结果回调 */ - (void)processOrderWithPaymentResult:(NSURL *)resultUrl standbyCallback:(CompletionBlock)completionBlock; /** * 获取交易token。 * * @return 交易token,若无则为空。 */ - (NSString *)fetchTradeToken; /** * 是否已经使用过 * * @return YES为已经使用过,NO反之 */ - (BOOL)isLogined; /** * 获取当前版本号 * * @return 当前版本字符串 */ - (NSString *)currentVersion; /** * 測試所用,realse包无效 * * @param url 测试环境 */ - (void)setUrl:(NSString *)url; ////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////h5 拦截支付入口/////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// /** * 从h5链接中获取订单串并支付接口(自版本15.4.0起,推荐使用该接口) * * @param urlStr 拦截的 url string * * @return YES为成功获取订单信息并发起支付流程;NO为无法获取订单信息,输入url是普通url */ - (BOOL)payInterceptorWithUrl:(NSString *)urlStr fromScheme:(NSString *)schemeStr callback:(CompletionBlock)completionBlock; /** * 从h5链接中获取订单串接口(自版本15.4.0起已废弃,请使用payInterceptorWithUrl...) * * @param urlStr 拦截的 url string * * @return 获取到的url order info */ - (NSString*)fetchOrderInfoFromH5PayUrl:(NSString*)urlStr; /** * h5链接获取到的订单串支付接口(自版本15.4.0起已废弃,请使用payInterceptorWithUrl...) * * @param orderStr 订单信息 * @param schemeStr 调用支付的app注册在info.plist中的scheme * @param completionBlock 支付结果回调Block */ - (void)payUrlOrder:(NSString *)orderStr fromScheme:(NSString *)schemeStr callback:(CompletionBlock)completionBlock; ////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////授权2.0////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// /** * 快登授权2.0 * * @param infoStr 授权请求信息字符串 * @param schemeStr 调用授权的app注册在info.plist中的scheme * @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效, 需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果 */ - (void)auth_V2WithInfo:(NSString *)infoStr fromScheme:(NSString *)schemeStr callback:(CompletionBlock)completionBlock; /** * 处理授权信息Url * * @param resultUrl 钱包返回的授权结果url * @param completionBlock 授权结果回调 */ - (void)processAuth_V2Result:(NSURL *)resultUrl standbyCallback:(CompletionBlock)completionBlock; ////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////授权1.0 (授权1.0接口即将废弃,请使用授权2.0接口)/////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// /** * 快登授权 * @param authInfo 需授权信息 * @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效, 需要调用方在appDelegate中调用processAuthResult:standbyCallback:方法获取授权结果 */ - (void)authWithInfo:(APayAuthInfo *)authInfo callback:(CompletionBlock)completionBlock; /** * 处理授权信息Url * * @param resultUrl 钱包返回的授权结果url * @param completionBlock 授权结果回调 */ - (void)processAuthResult:(NSURL *)resultUrl standbyCallback:(CompletionBlock)completionBlock; @end
#ifndef __MUSIC_PLAYER_H__ #define __MUSIC_PLAYER_H__ #include "basicplayer.h" class MusicPlayer : public BasicPlayer { public: static MusicPlayer* getInstance(); // NOTE: this function should be virtual, // implements pure virtual function BasicPlayer::playFile() void playFile(const QString& fname); virtual void pause(); // NOTE: this function should be virtual virtual QString getName() { return "MusicPlayer"; } protected: MusicPlayer(); static MusicPlayer* _instance; }; #endif // __MUSIC_PLAYER_H__
// // KHSplashScreenDataSource.h // Streak Club // // Created by Kevin Hwang on 3/25/15. // Copyright (c) 2015 Kevin Hwang. All rights reserved. // #import <Foundation/Foundation.h> @class KHSplashScreenInfo; @interface KHSplashScreenDataSource : NSObject - (KHSplashScreenInfo *)viewInfoForIndex:(NSUInteger)index; /// @brief Returns the number of splash screens there are. - (NSUInteger)count; @end
#include "semaforos.h" int main(int argc, char* argv[]) { int semid, i; key_t key; if (argc != 1) { printf("forma de uso: %s", argv[0]); return -1; } if ( (key = ftok("/dev/null", 65)) == (key_t) -1 ) { perror("ftok"); return -1; } if ( (semid = semget(key, 6, 0666 | IPC_CREAT)) < 0 ) { perror("semget"); return -1; } for (i = 0; i < 5; ++i) { semctl(semid, i, SETVAL, 1); } semctl(semid, FOOTMAN, SETVAL, 4); return 0; }
//////////////////////////////////////////////////////////////////////////////// // // Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_COLMODIFIED #define INCLUDED_COLMODIFIED #include <ColTypeDate.h> class ColumnModified : public ColumnTypeDate { public: ColumnModified (); }; #endif ////////////////////////////////////////////////////////////////////////////////
#ifndef ACTION_REPLAY_REFLECTION_PREPARATION_H__ # define ACTION_REPLAY_REFLECTION_PREPARATION_H__ # include <action_replay/macros.h> # include <action_replay/stddef.h> # ifdef ACTION_REPLAY_CLASS_DEFINITION # undef ACTION_REPLAY_CLASS_DEFINITION # endif /* ACTION_REPLAY_CLASS_DEFINITION */ # ifdef ACTION_REPLAY_CLASS_FIELD # undef ACTION_REPLAY_CLASS_FIELD # endif /* ACTION_REPLAY_CLASS_FIELD */ # ifdef ACTION_REPLAY_CLASS_METHOD # undef ACTION_REPLAY_CLASS_METHOD # endif /* ACTION_REPLAY_CLASS_METHOD */ # define ACTION_REPLAY_CLASS_DEFINITION( name ) # define ACTION_REPLAY_CLASS_FIELD( type, name ) \ ACTION_REPLAY_CLASS_METHOD( type, name ) # define ACTION_REPLAY_CLASS_METHOD( type, name ) \ { \ ACTION_REPLAY_STRINGIFY( type ), \ ACTION_REPLAY_STRINGIFY( name ), \ offsetof( ACTION_REPLAY_CURRENT_CLASS, name ) \ }, #endif /* ACTION_REPLAY_REFLECTION_PREPARATION_H__ */
#ifndef COMMON_H #define COMMON_H //#ifndef _DEBUG #pragma warning( disable : 4312 4267 4311 4244 ) //#endif extern BYTE cardDeck[32]; extern BYTE trumps; extern BYTE downCards[32]; extern BYTE playaCards[4][8]; extern BYTE playaFlags[4][4]; extern BYTE playaCardPosVal[4][8]; extern BYTE cardTable[4]; extern BYTE startPlayer; extern BYTE gameStartPlayer; extern BYTE animationCards[4]; extern BYTE lastHand[4]; extern BYTE lastWinner; extern BYTE cardCount[4]; extern BYTE bCardPlayable; extern BYTE winSets; extern BYTE lostSets; extern BYTE winPoints; extern BYTE lostPoints; extern BYTE rounds; extern BYTE bIsLastSeporu; extern BYTE bTrumpsNotYet; extern BYTE bCheatMode; extern BYTE bCheatApplied; extern HFONT hSinFontSm; extern HFONT hSinFontMe; extern HFONT hSinFontL; extern BYTE bSndOn; extern HANDLE hDealSound; extern HANDLE hSelectSnd; extern HANDLE hCutSnd; extern HBITMAP *phBitmap[32]; extern HBITMAP *phCoverBitmap; extern int WIN_X;// 700 extern int WIN_Y;// 550 extern int STATUS_R_X;// (WIN_X - WIN_Y) extern int STATUS_R_Y;// WIN_Y #define tcWIN_X 710 #define tcWIN_Y 576 #define STATUS_WIDTH (cWIN_X - cWIN_Y) extern int cWIN_X; extern int cWIN_Y; extern int CARD_X; //71 extern int CARD_Y; //96 extern int CARD_GAP; // (CARD_X / 5) #define CARD_OFFSET_X 10 #define CARD_OFFSET_Y 10 // Player cards positions #define PLAYA1_CARD_X(y) ((y - (CARD_X + (7 * CARD_GAP))) / 2) #define PLAYA1_CARD_Y(y) (y - CARD_Y - CARD_OFFSET_Y) #define PLAYA2_CARD_X(y) (y - CARD_X - CARD_OFFSET_X) #define PLAYA2_CARD_Y(y) ((y - (CARD_Y - (CARD_GAP * 7))) / 2) #define PLAYA3_CARD_X(y) ((y - (CARD_X - (7 * CARD_GAP))) / 2) #define PLAYA3_CARD_Y CARD_OFFSET_Y #define PLAYA4_CARD_X CARD_OFFSET_X #define PLAYA4_CARD_Y(y) ((y - (CARD_Y + (CARD_GAP * 7))) / 2) // Card Table Cards Positions #define CT_P1_X(y) ((y - CARD_X) / 2) + CARD_GAP #define CT_P1_Y(y) (y / 2) #define CT_P2_X(y) (y / 2) #define CT_P2_Y(y) ((y - CARD_Y) / 2) - CARD_GAP #define CT_P3_X(y) ((y - CARD_X) / 2) - CARD_GAP #define CT_P3_Y(y) ((y / 2) - CARD_Y) #define CT_P4_X(y) ((y / 2) - CARD_X) #define CT_P4_Y(y) ((y - CARD_Y) / 2) + CARD_GAP // Card table card identifiers #define CT_PLAYER_1 32 #define CT_PLAYER_2 33 #define CT_PLAYER_3 34 #define CT_PLAYER_4 35 #define RHS_STATUSID 80 // last hand cards #define LAST_HAND1 82 #define LAST_HAND2 83 #define LAST_HAND3 84 #define LAST_HAND4 85 // animation card id #define ANICARD_P1 90 #define ANICARD_P2 91 #define ANICARD_P3 92 #define ANICARD_P4 93 // trumpgetting Cards #define TRMP_GET_SPADE 95 #define TRMP_GET_HEART 96 #define TRMP_GET_CLUBS 97 #define TRMP_GET_DIAMO 98 // card const #define NO_CARD 100 // return val, means cannot find a card #define BLANK_CARD 101 // used in playaCards, means no card is there // down card const #define CARD_UP 0 #define CARD_DOWN 1 // player const #define NO_PLAYER 100 // timer const #define TIMER_CLEAR 1 #define TIMER_PLAY 2 #define TIMER_PLAY_START 3 #define TIMER_WAITTILL_TRUMPS 4 enum OOMBI_DECK { SPADE_7, // 0 SPADE_8, SPADE_9, SPADE_10, SPADE_J, SPADE_Q, SPADE_K, SPADE_A, HEART_7, // 8 HEART_8, HEART_9, HEART_10, HEART_J, HEART_Q, HEART_K, HEART_A, CLUBS_7, // 16 CLUBS_8, CLUBS_9, CLUBS_10, CLUBS_J, CLUBS_Q, CLUBS_K, CLUBS_A, DIAMO_7, // 24 DIAMO_8, DIAMO_9, DIAMO_10, DIAMO_J, DIAMO_Q, DIAMO_K, DIAMO_A // 31 }; enum OOMBI_CARDTYPE { OO_SPADE, OO_HEART, OO_CLUBS, OO_DIAMO }; enum OOMBI_CARDVAL { OO_RANK_1, OO_RANK_2, OO_RANK_3, OO_RANK_4, OO_RANK_5, OO_RANK_6, OO_RANK_7, OO_RANK_8 }; enum OOMBI_PLAYER { PLAYER_1, PLAYER_2, PLAYER_3, PLAYER_4 }; // Player Flags #define NO_SPADE 0x01 #define NO_HEART 0x02 #define NO_CLUBS 0x04 #define NO_DIAMO 0x08 #include "Deck_Func.h" #include "Oombi_play.h" #include "Win_Msgs.h" #include "CardDeck.h" #include "Play_win.h" #include "Rhs_Statusbar.h" #include "FontMem.h" #include "Animation.h" #include "Msgbox.h" #include "Menu.h" #include "About.h" #include "LastHand.h" #endif // _COMMON_H
// ZFilterJson.h // By PaintDream (paintdream@paintdream.com) // 2015-6-10 // #ifndef __ZFILTERJSON_H__ #define __ZFILTERJSON_H__ #include "../../../Core/Interface/IFilterBase.h" namespace PaintsNow { class ZFilterJson final : public IFilterBase { public: virtual IStreamBase* CreateFilter(IStreamBase& streamBase); }; } #endif // __ZFILTERJSON_H__
#pragma once //------------------------------------------------------------------------------ /** @class Oryol::_priv::mtlTextureFactory @ingroup _priv @brief Metal implementation of textureFactory */ #include "Resource/ResourceState.h" #include "Gfx/Core/gfxPointers.h" #include "Core/Containers/Map.h" #include "Gfx/mtl/mtl_decl.h" namespace Oryol { namespace _priv { class texture; class mtlTextureFactory { public: /// constructor mtlTextureFactory(); /// destructor ~mtlTextureFactory(); /// setup with a pointer to the state wrapper object void Setup(const gfxPointers& ptrs); /// discard the factory void Discard(); /// return true if the object has been setup bool IsValid() const; /// setup resource ResourceState::Code SetupResource(texture& tex); /// setup with input data ResourceState::Code SetupResource(texture& tex, const void* data, int32 size); /// discard the resource void DestroyResource(texture& tex); private: /// setup the TextureAttrs object in texture void setupTextureAttrs(texture& tex); /// create a render-target texture ResourceState::Code createRenderTarget(texture& tex); /// create a texture from pixel-data in memory ResourceState::Code createFromPixelData(texture& tex, const void* data, int32 size); /// create an empty texture ResourceState::Code createEmptyTexture(texture& tex); /// create a sampler state object and set in texture object void createSamplerState(texture& tex); /// release sampler state object of texture void releaseSamplerState(texture& tex); gfxPointers pointers; bool isValid; // cache to re-use existing sampler state objects struct SamplerCacheItem { ORYOL_OBJC_TYPED_ID(MTLSamplerState) mtlSamplerState; int32 useCount; }; Map<uint32, SamplerCacheItem> samplerCache; }; } // namespace _priv } // namespace Oryol
// // This file is part of nuBASIC // Copyright (c) Antonino Calderone (antonino.calderone@gmail.com) // All rights reserved. // Licensed under the MIT License. // See COPYING file in the project root for full license information. // /* -------------------------------------------------------------------------- */ #ifndef __NU_FOR_LOOP_RTDATA_H__ #define __NU_FOR_LOOP_RTDATA_H__ /* -------------------------------------------------------------------------- */ #include "nu_flag_map.h" #include "nu_prog_pointer.h" #include "nu_variant.h" #include <sstream> /* -------------------------------------------------------------------------- */ namespace nu { /* -------------------------------------------------------------------------- */ struct for_loop_ctx_t { enum { FLG_FIRST_EXEC }; flag_map_t flag; for_loop_ctx_t() noexcept { flag.define(FLG_FIRST_EXEC, true); } for_loop_ctx_t(const for_loop_ctx_t&) = default; for_loop_ctx_t& operator=(const for_loop_ctx_t&) = default; prog_pointer_t pc_for_stmt; prog_pointer_t pc_next_stmt; variant_t step; variant_t end_counter; }; /* -------------------------------------------------------------------------- */ struct for_loop_rtdata_t : public std::map<std::string, for_loop_ctx_t> { void trace(std::stringstream& ss); void cleanup_data(const std::string& proc_ctx); }; /* -------------------------------------------------------------------------- */ } /* -------------------------------------------------------------------------- */ #endif // __NU_FOR_LOOP_RTDATA_H__
// // UIColor+GDIAdditions.h // GDI iOS Core // // Created by Grant Davis on 2/3/12. // Copyright (c) 2012 Grant Davis Interactive, LLC. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in the // Software without restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the // Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface UIColor(GDIAdditions) + (UIColor *)colorWithRGBHex:(NSUInteger)hex; + (UIColor *)colorWithRGBHex:(NSUInteger)hex alpha:(CGFloat)alpha; + (UIColor *)colorWithARGBHex:(NSUInteger)hex; + (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha rgbDivisor:(CGFloat)divisor; + (UIColor *)randomColor; + (UIColor *)randomColorWithAlpha:(CGFloat)alpha; + (UIColor *)interpolateBetweenColor:(UIColor *)color1 color:(UIColor *)color2 amount:(CGFloat)amount; @end
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12). // // Copyright (C) 1997-2019 Steve Nygard. // #import <Foundation/NSSortDescriptor.h> @class NSString; @interface IDECodeModuleDefaultSortDescriptor : NSSortDescriptor { NSString *_executableName; } - (void).cxx_destruct; - (long long)compareObject:(id)arg1 toObject:(id)arg2; - (id)initWithExecutableURL:(id)arg1; @end
/* * atapi.h * puzzleOS * * Created by Dmitry on 19.05.09. * Copyright 2009 Dmitry Obukhov. All rights reserved. * */ #ifndef _ATAPI_H_ #define _ATAPI_H_ #define ATA_PRIMARY_IDE 0x1F0 #define ATA_SECONDERY_IDE 0x170 #define ATA_PORT_DATA 0x0 #define ATA_PORT_ERROR 0x1 #define ATA_PORT_SECT_COUNT 0x2 #define ATA_PORT_SECT_NUM 0x3 #define ATA_PORT_CYL_LOW 0x4 #define ATA_PORT_CYL_HIGH 0x5 #define ATA_PORT_DRV_HEAD 0x6 #define ATA_PORT_STATUS 0x7 #define ATA_PORT_COMMAND 0x7 typedef struct atapi_device { uint32 initialized; char name[40]; uint32 packet_size; uint16 cmd_reg; uint32 master; } atapi_device_t; void atapi_init(); #endif
// // YLeftViewController.h // YReaderDemo // // Created by yanxuewen on 2016/12/8. // Copyright © 2016年 yxw. All rights reserved. // #import <UIKit/UIKit.h> @interface YLeftViewController : YBaseViewController @end
//================================================================================================= /*! // \file blazemark/eigen/SMatTDMatMult.h // \brief Header file for the Eigen sparse matrix/transpose dense matrix multiplication kernel // // 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 _BLAZEMARK_EIGEN_SMATTDMATMULT_H_ #define _BLAZEMARK_EIGEN_SMATTDMATMULT_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blazemark/system/Types.h> namespace blazemark { namespace eigen { //================================================================================================= // // KERNEL FUNCTIONS // //================================================================================================= //************************************************************************************************* /*!\name Eigen kernel functions */ //@{ double smattdmatmult( size_t N, size_t F, size_t steps ); //@} //************************************************************************************************* } // namespace eigen } // namespace blazemark #endif
/* logger.c - a simplified implementation of the logger(1) utility. * * The `logger(1)` utility is a command-line interface for the syslog * facility, which is a centralised service receiving logs from multiple * sources and being able to distribute logged messages to different * locations (including communicating to different machines over the * network.) * * This program will log the given message to syslog, allowing the user * to specify the ident(ifier) and the log level. For convenience, the * `LOG_PERROR` is used when logging so that the logged message can * be checked on standard error. * * Usage: * * $ ./logger -i logger_test -l info "my log message" * Options: * * -i: sets the program ident. Defaults to `_LOGGER`. * -l: sets the log level. Defaults to `info`. Accepted * values are: `emerg`, `alert`, `crit`, `err`, `warning`, * `notice`, `info` and `debug`. * * Author: Renato Mascarenhas Costa */ #define _XOPEN_SOURCE /* getopt function */ #include <syslog.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define DEFAULT_IDENT ("_LOGGER") #define DEFAULT_LOG_LEVEL (LOG_INFO) #ifndef BUF_SIZ # define BUF_SIZ (1024) #endif static void helpAndLeave(const char *progname, int status); static int parse_level(const char *level, int *out); int main(int argc, char *argv[]) { if (argc < 2) helpAndLeave(argv[0], EXIT_FAILURE); int opt; int level = DEFAULT_LOG_LEVEL; char *ident = DEFAULT_IDENT; char *message; /* command-line parsing */ opterr = 0; while ((opt = getopt(argc, argv, "+i:l:")) != -1) { switch(opt) { case '?': helpAndLeave(argv[0], EXIT_FAILURE); break; case 'i': ident = optarg; break; case 'l': if ((parse_level(optarg, &level)) == -1) helpAndLeave(argv[0], EXIT_FAILURE); break; } } message = argv[optind]; if (message == NULL) helpAndLeave(argv[0], EXIT_FAILURE); /* sets default syslog options */ openlog(ident, LOG_CONS | LOG_PID | LOG_PERROR, LOG_USER); /* write message to the log */ syslog(level, "%s", message); return EXIT_SUCCESS; } /* Parses a string indicating a log level and assigns the corresponding log level * constant to the `out` parameter. * * emerg => LOG_EMERG * alert => LOG_ALERT * crit => LOG_CRIT * err => LOG_ERR * warning => LOG_WARNING * notice => LOG_NOTICE * info => LOG_INFO * debug => LOG_DEBUG * * Returns 0 if the level was recognised or -1 otherwise. */ static int parse_level(const char *level, int *out) { if (!strncmp(level, "emerg", BUF_SIZ)) { *out = LOG_EMERG; } else if (!strncmp(level, "alert", BUF_SIZ)) { *out = LOG_ALERT; } else if (!strncmp(level, "crit", BUF_SIZ)) { *out = LOG_CRIT; } else if (!strncmp(level, "err", BUF_SIZ)) { *out = LOG_ERR; } else if (!strncmp(level, "warning", BUF_SIZ)) { *out = LOG_WARNING; } else if (!strncmp(level, "notice", BUF_SIZ)) { *out = LOG_NOTICE; } else if (!strncmp(level, "info", BUF_SIZ)) { *out = LOG_INFO; } else if (!strncmp(level, "debug", BUF_SIZ)) { *out = LOG_DEBUG; } else { return -1; } return 0; } static void helpAndLeave(const char *progname, int status) { FILE *stream = stderr; if (status == EXIT_SUCCESS) stream = stdout; fprintf(stream, "Usage: %s [-i ident] [-l level] message\n", progname); exit(status); }
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import <UIKit/UIKit.h> @interface IGTestStoryboardCell : UICollectionViewCell @property (nonatomic, weak) id delegate; @property (weak, nonatomic) IBOutlet UILabel *label; @end
/* * plastichunt: desktop geocaching browser * * Copyright © 2012 Michael Schutte <michi@uiae.at> * * This program is free software. You are permitted to use, copy, modify and * redistribute it according to the terms of the MIT License. See the COPYING * file for details. */ /* Includes {{{1 */ #include "ph-zoom-action.h" #include "ph-zoom-tool-item.h" /* Properties {{{1 */ enum { PH_ZOOM_ACTION_PROP_0, PH_ZOOM_ACTION_PROP_ADJUSTMENT }; /* Private data {{{1 */ #define PH_ZOOM_ACTION_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE((obj), PH_TYPE_ZOOM_ACTION, \ PHZoomActionPrivate)) struct _PHZoomActionPrivate { GtkAdjustment *adjustment; /* underlying zoom adjustment */ }; /* Forward declarations {{{1 */ static void ph_zoom_action_class_init(PHZoomActionClass *cls); static void ph_zoom_action_init(PHZoomAction *action); static void ph_zoom_action_dispose(GObject *object); static void ph_zoom_action_set_property(GObject *object, guint id, const GValue *value, GParamSpec *param); static void ph_zoom_action_get_property(GObject *object, guint id, GValue *value, GParamSpec *param); static void ph_zoom_action_connect_proxy(GtkAction *parent_action, GtkWidget *proxy); /* Standard GObject code {{{1 */ G_DEFINE_TYPE(PHZoomAction, ph_zoom_action, GTK_TYPE_ACTION) /* * Class initialization code. */ static void ph_zoom_action_class_init(PHZoomActionClass *cls) { GObjectClass *g_obj_cls = G_OBJECT_CLASS(cls); GtkActionClass *action_cls = GTK_ACTION_CLASS(cls); g_obj_cls->dispose = ph_zoom_action_dispose; g_obj_cls->set_property = ph_zoom_action_set_property; g_obj_cls->get_property = ph_zoom_action_get_property; action_cls->toolbar_item_type = PH_TYPE_ZOOM_TOOL_ITEM; action_cls->connect_proxy = ph_zoom_action_connect_proxy; g_object_class_install_property(g_obj_cls, PH_ZOOM_ACTION_PROP_ADJUSTMENT, g_param_spec_object("adjustment", "zoom adjustment", "underlying adjustment associated with the map", GTK_TYPE_ADJUSTMENT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_type_class_add_private(cls, sizeof(PHZoomActionPrivate)); } /* * Instance initialization code. */ static void ph_zoom_action_init(PHZoomAction *action) { PHZoomActionPrivate *priv = PH_ZOOM_ACTION_GET_PRIVATE(action); action->priv = priv; } /* * Drop references to other objects. */ static void ph_zoom_action_dispose(GObject *object) { PHZoomAction *action = PH_ZOOM_ACTION(object); if (action->priv->adjustment != NULL) { g_object_unref(action->priv->adjustment); action->priv->adjustment = NULL; } if (G_OBJECT_CLASS(ph_zoom_action_parent_class)->dispose != NULL) G_OBJECT_CLASS(ph_zoom_action_parent_class)->dispose(object); } /* * Property mutator. */ static void ph_zoom_action_set_property(GObject *object, guint id, const GValue *value, GParamSpec *param) { PHZoomAction *action = PH_ZOOM_ACTION(object); switch (id) { case PH_ZOOM_ACTION_PROP_ADJUSTMENT: ph_zoom_action_set_adjustment(action, GTK_ADJUSTMENT(g_value_get_object(value))); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, id, param); } } /* * Property accessor. */ static void ph_zoom_action_get_property(GObject *object, guint id, GValue *value, GParamSpec *param) { } /* Action implementation {{{1 */ /* * Connect the zoom slider widget to the adjustment. */ static void ph_zoom_action_connect_proxy(GtkAction *parent_action, GtkWidget *proxy) { PHZoomAction *action = PH_ZOOM_ACTION(parent_action); PHZoomToolItem *item = PH_ZOOM_TOOL_ITEM(proxy); ph_zoom_tool_item_set_adjustment(item, action->priv->adjustment); if (GTK_ACTION_CLASS(ph_zoom_action_parent_class)->connect_proxy != NULL) GTK_ACTION_CLASS(ph_zoom_action_parent_class)->connect_proxy( parent_action, proxy); } /* Public interface {{{1 */ /* * Create a new zoom action instance with the specified name. */ GtkAction * ph_zoom_action_new(const gchar *name, GtkAdjustment *adjustment) { g_return_val_if_fail(name != NULL, NULL); g_return_val_if_fail(adjustment == NULL || GTK_IS_ADJUSTMENT(adjustment), NULL); return GTK_ACTION(g_object_new(PH_TYPE_ZOOM_ACTION, "name", name, "adjustment", adjustment, NULL)); } /* * Set the zoom adjustment on the action and all its proxies. */ void ph_zoom_action_set_adjustment(PHZoomAction *action, GtkAdjustment *adjustment) { GSList *proxies; g_return_if_fail(action != NULL && PH_IS_ZOOM_ACTION(action)); g_return_if_fail(adjustment == NULL || GTK_IS_ADJUSTMENT(adjustment)); if (action->priv->adjustment == adjustment) return; if (action->priv->adjustment != NULL) g_object_unref(action->priv->adjustment); action->priv->adjustment = adjustment; if (action->priv->adjustment != NULL) g_object_ref(action->priv->adjustment); proxies = gtk_action_get_proxies(GTK_ACTION(action)); while (proxies != NULL) { PHZoomToolItem *item = PH_ZOOM_TOOL_ITEM(proxies->data); ph_zoom_tool_item_set_adjustment(item, action->priv->adjustment); proxies = proxies->next; } } /* }}} */ /* vim: set sw=4 sts=4 et cino=(0,Ws tw=80 fdm=marker: */
// // AppDelegate.h // iphoneTcpExam // // Created by 马秉尧 on 2016/12/21. // Copyright © 2016年 Hprose. All rights reserved. // #import <UIKit/UIKit.h> #import "Hprose.h" @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic) HproseClient *client; @end
#ifndef CSVOUTPUT_H #define CSVOUTPUT_H #include <iostream> #include <string> #include "../output/ClusterEditingOutput.h" namespace ysk { class CSVOutput : public ClusterEditingOutput { public: CSVOutput(ClusterEditingInstance& inst, ClusterEditingSolutions& solutions, std::string filename, std::string suffix, std::string label) : ClusterEditingOutput(inst, solutions, filename, suffix, label) { } void writeHeader(std::string label, size_t solution, size_t numberOfNodes, size_t numberOfClusters); void writeBeginNodes(size_t numberOfNodes); void writeEndNodes(); void writeNode(int nodeId, std::string name, size_t cluster, bool isLast); void writeBeginEdges(); void writeEdge(int sourceId, int targetId, std::string name, double weight, bool modified); void writeEndEdges(); void writeBeginCluster(size_t cluster); void writeEndCluster(bool isLast); void writeFooter(); }; } // namespace ysk #endif /* CSVOUTPUT_H */
#ifndef __extra_h__ #define __extra_h__ #include "myclass.h" class extra : public myclass { public: extra(); protected: }; #endif // __extra_h__
#include "PPMCreator.h" #include <stdio.h> #define TEST_IMAGE_FILE_NAME "test_image.ppm" #define TEST_IMAGE_X_SIZE (800u) #define TEST_IMAGE_Y_SIZE (600u) #define TEST_IMAGE_BYTE_SIZE (TEST_IMAGE_X_SIZE * TEST_IMAGE_Y_SIZE) static unsigned char testImageData[TEST_IMAGE_BYTE_SIZE]; static PPMCREATOR_imageData data; int main(void) { FILE* file = fopen(TEST_IMAGE_FILE_NAME, "wb"); unsigned int testImageIndex = 0u; unsigned char pixelVal = 0u; for(; testImageIndex < TEST_IMAGE_BYTE_SIZE; ++testImageIndex) { testImageData[testImageIndex] = pixelVal; if(0u == (testImageIndex % TEST_IMAGE_X_SIZE)) { pixelVal += 1u; } } PPMCREATOR_createGrayscaleImage(TEST_IMAGE_X_SIZE, TEST_IMAGE_Y_SIZE, testImageData, &data); (void) printf("%s", data.imageData); if(file) { fwrite(data.imageData, data.imageByteSize, 1, file); } fclose(file); return 0; }
#import <UIKit/UIKit.h> UIKIT_EXTERN NSString * const MHzRequestURL; /** 全局统一间距 */ UIKIT_EXTERN CGFloat const MHzMargin ; /** gourp样式下最前面那个cell默认的Y值 */ UIKIT_EXTERN CGFloat const MHzGroupFirstCellY ; /** 导航栏的最大Y值(底部) */ UIKIT_EXTERN CGFloat const MHzNavBarBottom ; /** TabBar的高度 */ UIKIT_EXTERN CGFloat const MHzTabBarH ; /** 标题栏的高度 */ UIKIT_EXTERN CGFloat const MHzTitlesViewH ;
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: Classes/javax/lang/model/element/Modifier.java // #include "../../../../J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_JavaxLangModelElementModifier") #ifdef RESTRICT_JavaxLangModelElementModifier #define INCLUDE_ALL_JavaxLangModelElementModifier 0 #else #define INCLUDE_ALL_JavaxLangModelElementModifier 1 #endif #undef RESTRICT_JavaxLangModelElementModifier #pragma clang diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #if !defined (JavaxLangModelElementModifier_) && (INCLUDE_ALL_JavaxLangModelElementModifier || defined(INCLUDE_JavaxLangModelElementModifier)) #define JavaxLangModelElementModifier_ #define RESTRICT_JavaLangEnum 1 #define INCLUDE_JavaLangEnum 1 #include "../../../../java/lang/Enum.h" typedef NS_ENUM(NSUInteger, JavaxLangModelElementModifier_Enum) { JavaxLangModelElementModifier_Enum_PUBLIC = 0, JavaxLangModelElementModifier_Enum_PROTECTED = 1, JavaxLangModelElementModifier_Enum_PRIVATE = 2, JavaxLangModelElementModifier_Enum_ABSTRACT = 3, JavaxLangModelElementModifier_Enum_STATIC = 4, JavaxLangModelElementModifier_Enum_FINAL = 5, JavaxLangModelElementModifier_Enum_TRANSIENT = 6, JavaxLangModelElementModifier_Enum_VOLATILE = 7, JavaxLangModelElementModifier_Enum_SYNCHRONIZED = 8, JavaxLangModelElementModifier_Enum_NATIVE = 9, JavaxLangModelElementModifier_Enum_STRICTFP = 10, }; @interface JavaxLangModelElementModifier : JavaLangEnum < NSCopying > + (JavaxLangModelElementModifier *)PUBLIC; + (JavaxLangModelElementModifier *)PROTECTED; + (JavaxLangModelElementModifier *)PRIVATE; + (JavaxLangModelElementModifier *)ABSTRACT; + (JavaxLangModelElementModifier *)STATIC; + (JavaxLangModelElementModifier *)FINAL; + (JavaxLangModelElementModifier *)TRANSIENT; + (JavaxLangModelElementModifier *)VOLATILE; + (JavaxLangModelElementModifier *)SYNCHRONIZED; + (JavaxLangModelElementModifier *)NATIVE; + (JavaxLangModelElementModifier *)STRICTFP; #pragma mark Public - (NSString *)description; #pragma mark Package-Private + (IOSObjectArray *)values; + (JavaxLangModelElementModifier *)valueOfWithNSString:(NSString *)name; - (id)copyWithZone:(NSZone *)zone; - (JavaxLangModelElementModifier_Enum)toNSEnum; @end J2OBJC_STATIC_INIT(JavaxLangModelElementModifier) /*! INTERNAL ONLY - Use enum accessors declared below. */ FOUNDATION_EXPORT JavaxLangModelElementModifier *JavaxLangModelElementModifier_values_[]; inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_PUBLIC(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, PUBLIC) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_PROTECTED(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, PROTECTED) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_PRIVATE(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, PRIVATE) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_ABSTRACT(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, ABSTRACT) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_STATIC(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, STATIC) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_FINAL(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, FINAL) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_TRANSIENT(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, TRANSIENT) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_VOLATILE(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, VOLATILE) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_SYNCHRONIZED(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, SYNCHRONIZED) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_NATIVE(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, NATIVE) inline JavaxLangModelElementModifier *JavaxLangModelElementModifier_get_STRICTFP(); J2OBJC_ENUM_CONSTANT(JavaxLangModelElementModifier, STRICTFP) FOUNDATION_EXPORT IOSObjectArray *JavaxLangModelElementModifier_values(); FOUNDATION_EXPORT JavaxLangModelElementModifier *JavaxLangModelElementModifier_valueOfWithNSString_(NSString *name); FOUNDATION_EXPORT JavaxLangModelElementModifier *JavaxLangModelElementModifier_fromOrdinal(NSUInteger ordinal); J2OBJC_TYPE_LITERAL_HEADER(JavaxLangModelElementModifier) #endif #pragma clang diagnostic pop #pragma pop_macro("INCLUDE_ALL_JavaxLangModelElementModifier")
/* * Copyright 2017 Dietrich Epp. * * This file is part of UnRez. UnRez is licensed under the terms of the MIT * license. For more information, see LICENSE.txt. */ #include "defs.h" #include <errno.h> #include <stdlib.h> #include <string.h> #include <sysexits.h> void opt_parse_true(void *value, const char *option, const char *arg) { int *ptr = value; (void)option; (void)arg; *ptr = 1; } void parse_options(const struct option *opt, int *argc, char ***argv) { const struct option *optr; char **args = *argv, *arg, *oname, *eq, *param; int i = 0, j = 0, n = *argc; while (i < n) { arg = args[i++]; if (*arg != '-') { args[j++] = arg; continue; } oname = arg + 1; if (*oname == '-') { oname++; if (*oname == '\0') { while (i < n) { args[j++] = args[i++]; } break; } } eq = strchr(oname, '='); if (eq != NULL) { *eq = '\0'; param = eq + 1; } else { param = NULL; } for (optr = opt; optr->name != NULL; optr++) { if (strcmp(oname, optr->name) == 0) { break; } } if (optr->name == NULL) { dief(EX_USAGE, "unknown option '%s'", arg); } if (optr->has_arg) { if (param == NULL) { if (i >= n) { dief(EX_USAGE, "missing parameter for '%s'", arg); } param = args[i++]; } } else { if (param != NULL) { dief(EX_USAGE, "unexpected parameter for '%s'", arg); } } optr->parse(optr->value, arg, param); } *argc = j; }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_17.c Label Definition File: CWE122_Heap_Based_Buffer_Overflow__sizeof.label.xml Template File: sources-sink-17.tmpl.c */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Initialize the source buffer using the size of a pointer * GoodSource: Initialize the source buffer using the size of the DataElementType * Sink: * BadSink : Print then free data * Flow Variant: 17 Control flow: for loops * * */ #include "std_testcase.h" #ifndef OMITBAD void CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_17_bad() { int i; int64_t * data; /* Initialize data */ data = NULL; for(i = 0; i < 1; i++) { /* INCIDENTAL: CWE-467 (Use of sizeof() on a pointer type) */ /* FLAW: Using sizeof the pointer and not the data type in malloc() */ data = (int64_t *)malloc(sizeof(data)); *data = 2147483643LL; } /* POTENTIAL FLAW: Attempt to use data, which may not have enough memory allocated */ printLongLongLine(*data); free(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() - use goodsource and badsink by changing the conditions on the for statements */ static void goodG2B() { int h; int64_t * data; /* Initialize data */ data = NULL; for(h = 0; h < 1; h++) { /* FIX: Using sizeof the data type in malloc() */ data = (int64_t *)malloc(sizeof(*data)); *data = 2147483643LL; } /* POTENTIAL FLAW: Attempt to use data, which may not have enough memory allocated */ printLongLongLine(*data); free(data); } void CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_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()..."); CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_17_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_17_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
/* * Automat.h * * Created on: Jan 20, 2017 * Author: Raphael Hippe */ #pragma once #include "ExpIIExp.h" #include "ExpII.h" #include "Identifier.h" #include "Index.h" #ifndef ExpIIIndex_H_ #define ExpIIIndex_H_ class ExpIIIndex : public ExpII { private: Identifier* identifier; Index* index; NodeType type; public: ExpIIIndex(); void addNode(Identifier* identifier); void addNode(Index* index); Identifier* getIdentifier(); Index* getIndex(); NodeType getType(); void typeCheck(); void makeCode(std::ofstream &code); virtual ~ExpIIIndex(); }; #endif /* ExpIIIndex_H_ */
// // AppDelegate.h // Reader // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "DBGQueue.h" #import "IDEKeyDrivenNavigableItemRepresentedObject.h" @class DVTDocumentLocation, DVTFileDataType, IDEFileReference, NSImage, NSString; @interface DBGQueue (DBGNavigableItemPropertySupport) <IDEKeyDrivenNavigableItemRepresentedObject> - (double)heightOfRow; - (BOOL)isGroupHeader:(id)arg1; @property(readonly) NSString *navigableItem_name; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) DVTDocumentLocation *navigableItem_contentDocumentLocation; @property(readonly) DVTFileDataType *navigableItem_documentType; @property(readonly) IDEFileReference *navigableItem_fileReference; @property(readonly) NSString *navigableItem_groupIdentifier; @property(readonly) NSImage *navigableItem_image; @property(readonly) BOOL navigableItem_isLeaf; @property(readonly) BOOL navigableItem_isMajorGroup; @property(readonly) NSString *navigableItem_toolTip; @property(readonly) Class superclass; @end
#ifndef BLOCKDIAGBLOCKDIAGMATRIXMULTIPLYKERNEL_H #define BLOCKDIAGBLOCKDIAGMATRIXMULTIPLYKERNEL_H #include "../modules/matrix.h" __global__ void BlockDiagBlockDiagMatrixMultiplyKernel(Matrix, Matrix, Matrix, int); #endif
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import <Foundation/Foundation.h> #import <XCTest/XCTest.h> NS_ASSUME_NONNULL_BEGIN /** Static Fixtures for FBXCTestKitTests */ @interface FBXCTestKitFixtures : NSObject /** Creates a new temporary directory. @return path to temporary directory. */ + (NSString *)createTemporaryDirectory; /** A build of Apple's 'Table Search' Sample Application. Source is available at: https://developer.apple.com/library/ios/samplecode/TableSearch_UISearchController/Introduction/Intro.html#//apple_ref/doc/uid/TP40014683 @return path to the application. */ + (NSString *)tableSearchApplicationPath; + (NSString *)testRunnerApp; /** An iOS Unit Test XCTest Target. @return path to the Unit Test Bundle. */ + (NSString *)iOSUnitTestBundlePath; /** An Mac Unit Test XCTest Target. @return path to the Unit Test Bundle. */ + (NSString *)macUnitTestBundlePath; /** An Mac UITest XCTest Target. @return path to the UITest Bundle. */ + (NSString *)macUITestBundlePath; /** An Mac Application used for hosting tests @return path to the Application. */ + (NSString *)macCommonAppPath; /** A build of Application used by macUITestBundlePath. @return path to the Application. */ + (NSString *)macUITestAppTargetPath; /** A build of Application used by iOSUITestBundlePath. @return path to the Application. */ + (NSString *)iOSUITestAppTargetPath; /** An iOS UI Test XCTest Target. @return path to the UI Test Bundle. */ + (NSString *)iOSUITestBundlePath; /** An iOS App Test XCTest Target. @return path to the App Test Bundle. */ + (NSString *)iOSAppTestBundlePath; @end /** Conveniences for getting fixtures. */ @interface XCTestCase (FBXCTestKitTests) /** An iOS Unit Test XCTest Target. Will check that the bundle is codesigned, and sign it if is not. @return path to the Unit Test Bundle. */ - (nullable NSString *)iOSUnitTestBundlePath; /** An iOS UITest XCTest Target. Will check that the bundle is codesigned, and sign it if is not. @return path to the UITest Bundle. */ - (nullable NSString *)iOSUITestBundlePath; /** An iOS AppTest XCTest Target. Will check that the bundle is codesigned, and sign it if is not. @return path to the AppTest Bundle. */ - (nullable NSString *)iOSAppTestBundlePath; @end NS_ASSUME_NONNULL_END
#import "MOBProjection.h" @interface MOBProjectionEPSG6061 : MOBProjection @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "WCCanvasComponent.h" #import "WCCanvasImageLoaderObserver.h" @class MMProgressViewEx, NSString, UIImageView; @interface WCCanvasPureImageComponent : WCCanvasComponent <WCCanvasImageLoaderObserver> { UIImageView *_m_imageView; MMProgressViewEx *_loadingView; } + (struct CGSize)calcSizeForCanvasItem:(id)arg1 dataItem:(id)arg2 orientation:(long long)arg3; @property(retain, nonatomic) MMProgressViewEx *loadingView; // @synthesize loadingView=_loadingView; @property(retain, nonatomic) UIImageView *m_imageView; // @synthesize m_imageView=_m_imageView; - (void).cxx_destruct; - (void)ImageDidFail:(id)arg1; - (void)ImageDidLoad:(id)arg1 Url:(id)arg2; - (void)configureWithCanvasItem:(id)arg1 dataItem:(id)arg2 orientation:(long long)arg3; - (void)layoutSubviews; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
#ifndef __CUBE_TIMER_QUEUE_H__ #define __CUBE_TIMER_QUEUE_H__ #include <set> #include <map> #include <cstdint> #include <functional> namespace cube { typedef uint64_t TimerId; typedef std::function<void()> TimerTask; struct Timer { TimerId timer_id; TimerTask task; int64_t expiration_ms; int64_t interval_ms; bool operator<(const Timer &rhs) const { if (expiration_ms != rhs.expiration_ms) return expiration_ms < rhs.expiration_ms; return timer_id < rhs.timer_id; } }; class TimerQueue { public: TimerId AddTimer(const TimerTask &task, int64_t expiration_ms, int64_t interval_ms); void RemoveTimer(TimerId timer_id); // next_expiration == -1 when no timers int Expire(int64_t now_ms, int64_t &next_expiration); private: static TimerId NextTimerId(); static TimerId m_next_timer_id; // atomic void AddTimer(const Timer &timer); private: std::set<Timer> m_timers; std::map<TimerId, int64_t> m_timer_expiration; }; } #endif
#pragma once namespace dh { namespace util { class NonCopyable { public: NonCopyable() {} ~NonCopyable() {} private: NonCopyable(const NonCopyable&) = delete; NonCopyable& operator = (const NonCopyable&) = delete; }; } }
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. /** * Utilities for converting data from/to strings. */ #ifndef VOYACOIN_UTILSTRENCODINGS_H #define VOYACOIN_UTILSTRENCODINGS_H #include <stdint.h> #include <string> #include <vector> #define BEGIN(a) ((char*)&(a)) #define END(a) ((char*)&((&(a))[1])) #define UBEGIN(a) ((unsigned char*)&(a)) #define UEND(a) ((unsigned char*)&((&(a))[1])) #define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) /** This is needed because the foreach macro can't get over the comma in pair<t1, t2> */ #define PAIRTYPE(t1, t2) std::pair<t1, t2> std::string SanitizeString(const std::string& str); std::vector<unsigned char> ParseHex(const char* psz); std::vector<unsigned char> ParseHex(const std::string& str); signed char HexDigit(char c); bool IsHex(const std::string& str); std::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid = NULL); std::string DecodeBase64(const std::string& str); std::string EncodeBase64(const unsigned char* pch, size_t len); std::string EncodeBase64(const std::string& str); std::vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid = NULL); std::string DecodeBase32(const std::string& str); std::string EncodeBase32(const unsigned char* pch, size_t len); std::string EncodeBase32(const std::string& str); std::string i64tostr(int64_t n); std::string itostr(int n); int64_t atoi64(const char* psz); int64_t atoi64(const std::string& str); int atoi(const std::string& str); /** * Convert string to signed 32-bit integer with strict parse error feedback. * @returns true if the entire string could be parsed as valid integer, * false if not the entire string could be parsed or when overflow or underflow occurred. */ bool ParseInt32(const std::string& str, int32_t *out); template<typename T> std::string HexStr(const T itbegin, const T itend, bool fSpaces=false) { std::string rv; static const char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; rv.reserve((itend-itbegin)*3); for(T it = itbegin; it < itend; ++it) { unsigned char val = (unsigned char)(*it); if(fSpaces && it != itbegin) rv.push_back(' '); rv.push_back(hexmap[val>>4]); rv.push_back(hexmap[val&15]); } return rv; } template<typename T> inline std::string HexStr(const T& vch, bool fSpaces=false) { return HexStr(vch.begin(), vch.end(), fSpaces); } /** * Format a paragraph of text to a fixed width, adding spaces for * indentation to any added line. */ std::string FormatParagraph(const std::string in, size_t width=79, size_t indent=0); /** * Timing-attack-resistant comparison. * Takes time proportional to length * of first argument. */ template <typename T> bool TimingResistantEqual(const T& a, const T& b) { if (b.size() == 0) return a.size() == 0; size_t accumulator = a.size() ^ b.size(); for (size_t i = 0; i < a.size(); i++) accumulator |= a[i] ^ b[i%b.size()]; return accumulator == 0; } #endif // VOYACOIN_UTILSTRENCODINGS_H
// // FileManager.h // SimpleLogger // // Created by Bill Burgess on 9/6/19. // Copyright © 2019 Simply Made Apps Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface FileManager : NSObject + (BOOL)filenameIsCurrentDay:(NSString *)filename; + (NSString *)filenameForDate:(NSDate *)date; + (NSString *)fullFilePathForFilename:(NSString *)filename; + (void)writeLogEntry:(NSString *)log toFilename:(NSString *)filename; + (void)removeFile:(NSString *)filename; + (void)truncateFilesBeyondRetentionForDate:(NSDate *)date; + (NSDate *)lastRetentionDateForDate:(NSDate *)date; + (void)removeAllLogFiles; + (NSArray *)logFiles; @end
// PackBits algorithm implemented by Matthew Clark // Updated to creating GBitmap from resource and new line-repeat compression by Ron64 // Version 1.4 // MIT license 2015 Matthew Clark and Ron64 #pragma once GBitmap* gbitmap_create_from_pbt(uint32_t resource); #ifdef PBL_COLOR GBitmap* gbitmap_create_from_pbt_with_color(uint32_t resource, GColor color_0, GColor color_1); #endif
#ifndef OPTIONSDIALOG_H #define OPTIONSDIALOG_H #include <QDialog> namespace Ui { class OptionsDialog; } class OptionsModel; class MonitoredDataMapper; class QValidatedLineEdit; /** Preferences dialog. */ class OptionsDialog : public QDialog { Q_OBJECT public: explicit OptionsDialog(QWidget *parent = 0); ~OptionsDialog(); void setModel(OptionsModel *model); void setMapper(); protected: bool eventFilter(QObject *object, QEvent *event); private slots: /* enable only apply button */ void enableApplyButton(); /* disable only apply button */ void disableApplyButton(); /* enable apply button and OK button */ void enableSaveButtons(); /* disable apply button and OK button */ void disableSaveButtons(); /* set apply button and OK button state (enabled / disabled) */ void setSaveButtonState(bool fState); void on_resetButton_clicked(); void on_okButton_clicked(); void on_cancelButton_clicked(); void on_applyButton_clicked(); void showRestartWarning_Proxy(); void showRestartWarning_Lang(); void handleProxyIpValid(QValidatedLineEdit *object, bool fState); signals: void proxyIpValid(QValidatedLineEdit *object, bool fValid); private: Ui::OptionsDialog *ui; OptionsModel *model; MonitoredDataMapper *mapper; bool fRestartWarningDisplayed_Proxy; bool fRestartWarningDisplayed_Lang; bool fProxyIpValid; }; #endif // OPTIONSDIALOG_H