text
stringlengths
4
6.14k
#import <Cocoa/Cocoa.h> @interface AbstractWindow : NSWindow @end
static void ngx_show_version_info(void); static ngx_int_t ngx_add_inherited_sockets(ngx_cycle_t *cycle); static ngx_int_t ngx_get_options(int argc, char *const *argv); static ngx_int_t ngx_process_options(ngx_cycle_t *cycle); static ngx_int_t ngx_save_argv(ngx_cycle_t *cycle, int argc, char *const *argv); static void *ngx_core_module_create_conf(ngx_cycle_t *cycle); static char *ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf); static char *ngx_set_user(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_set_env(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_load_module(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static ngx_uint_t ngx_show_help; static ngx_uint_t ngx_show_version; static ngx_uint_t ngx_show_configure; static u_char *ngx_prefix; static u_char *ngx_conf_file; static u_char *ngx_conf_params; static char *ngx_signal; static char **ngx_os_environ;
// // LogInScreen.h // Student Study // // Created by Pavel Gatilov on 8/3/13. // Copyright (c) 2013 Pavel Gatilov. All rights reserved. // #import <UIKit/UIKit.h> #import "DrupalServices.h" @interface LogInScreen : UIViewController <UITextFieldDelegate, DrupalServicesDelegate> @property (weak, nonatomic) IBOutlet UITextField *emailTextField; @property (weak, nonatomic) IBOutlet UITextField *passwordTextField; - (IBAction) logInButtonClicked:(UIButton *) sender; - (IBAction) forgottenPasswordButtonClicked: (UIButton *) sender; @end
#include <stdio.h> #include <limits.h> #include <assert.h> #define STACK_SIZE 64 int stack[STACK_SIZE]; int top = -1; void push(int x) { if(top < STACK_SIZE-1) { stack[++top] = x; } else { puts("stack is full"); } } int pop() { int ret = INT_MIN; if( top>=0 ) { ret = stack[top--]; } else { puts("stack is empty"); } return ret; } int peek() { int ret = INT_MIN; if(top >= 0) { ret = stack[top]; } else { puts("stack is empty"); } return ret; } int size() { return top+1; } void test() { push(1); push(2); assert(2 == pop()); assert(1 == pop()); assert(INT_MIN == pop()); push(3); assert(3 == pop()); assert(INT_MIN == pop()); } int main(int argc, char** argv) { int ret = 0; test(); push(1); push(2); push(3); push(4); push(5); push(6); push(7); push(8); printf("peek: %d\n", peek()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); push(70); push(80); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); printf("pop : %d\n", pop()); return ret; }
#ifndef COMMON_SCALAR_GRID_H #define COMMON_SCALAR_GRID_H #include <cereal/archives/xml.hpp> #include <iostream> #include <string> #include <openvdb/openvdb.h> #include "canary/canary.h" #include "common/metagrid.h" #include "common/primitives.h" namespace common { template<Index N1, Index N2, typename T> class ScalarGrid { public: typedef typename openvdb::tree::Tree3<T, N1, N2>::Type TreeT; typedef typename openvdb::Grid<TreeT> GridT; typedef T ValueType; template<typename ValueT> struct ValueConverter { using Type = ScalarGrid<N1, N2, ValueT>; }; // constructor ScalarGrid(); ScalarGrid(int x, int y, int z, float voxel_len = 1, T background = T(0), std::string name = "data"); ScalarGrid(Coord global_dims, float voxel_len = 1, T background = T(0), std::string name = "data"); private: // members MetaGrid metagrid_; T background_; // background value float voxel_len_; // length of each voxel std::string name_; typename GridT::Ptr data_; // openvdb grid with data typename GridT::Accessor accessor_; // grid accessor public: // methods void InitializePartition( const MetaGrid &metagrid, float voxel_len = 1, T background = T(0), std::string name = "data"); inline int dims(size_t i) const { return metagrid_.dims(i); } inline float voxel_len() const { return voxel_len_; } inline T get(int i, int j, int k) const { return accessor_.getValue(Coord(i,j,k)); } inline T get(Coord c) const { return accessor_.getValue(c); } inline void set(int i, int j, int k, T value) { accessor_.setValue(Coord(i,j,k), value); } inline void set(Coord c, T value) { accessor_.setValue(c, value); } inline bool isOn(int i, int j, int k) const { return accessor_.isValueOn(Coord(i,j,k)); } inline bool isOn(Coord c) const { return accessor_.isValueOn(c); } inline typename GridT::Ptr data() { return data_; } inline typename GridT::Ptr const_data() const { return data_; } // Get metagrid. const MetaGrid& metagrid() const { return metagrid_; } // metagrid() // Empty the grid, so that all voxels become inactive bakground. void Clear(); // Fill all values to a given constant -- may not be optimally sparse. void Fill(T value); // Make the grid sparse by pruning. void Prune(T tolerance = T(0)); // Copy to another grid. void CopyTo(ScalarGrid<N1, N2, T> &to); // Number of active cells within the given bounding box. int Count(CoordBBox box) const; // Number of cells equal to given value, in the provided bounding box. int Count(CoordBBox box, T value) const; // Interpolate to give posiition. Use spatial_order interpolation // (spatial_order = 1 means linear interpolation). T Interpolate(const Vec3<T> &ijk, int spatial_order) const; // IO void Load(std::string file_name); void WriteVDB(std::string file_name) const; void Write(std::string file_name, bool text=false) const; void WriteCheckpoint() const { std::string checkpoint = "/tmp/" + name_ + "_" + std::to_string(metagrid_.rank()); Write(checkpoint, false); } // Send and receive data. void SendGhostData( canary::CanaryTaskContext *task_context, int ghost_width) const; int ReceiveGhostData( canary::CanaryTaskContext *task_context, int ghost_width); // Serialization and deserialization methods. // Serialize ghost regions and return rank for the neighboring partition. // If there is no neighbor in the given direction (boundary), return -1. int SerializeGhost( int di, int dj, int dk, int ghost_width, canary::CanaryOutputArchive &archive) const; int SerializeGhost( const Coord neighbor_dir, int ghost_width, canary::CanaryOutputArchive &archive) const; void DeserializeGhost( int ghost_width, canary::CanaryInputArchive &archive); // Serialization and deserialization methods using archive. template <class Archive> void save(Archive &ar) const { ar(metagrid_, background_, voxel_len_, name_); CoordBBox bbox = data_->evalActiveVoxelBoundingBox(); SerializeDense(bbox, ar); //bbox.expand(metagrid_.bbox()); //const Coord start = bbox.min(); //const Coord end = bbox.max(); //ar(start[0], start[1], start[2]); //ar(end[0], end[1], end[2]); //for (int i = start[0]; i <= end[0]; ++i) { // for (int j = start[1]; j <= end[1]; ++j) { // for (int k = start[2]; k <= end[2]; ++k) { // Coord c(i, j, k); // bool mask = isOn(c); // T v = get(c); // ar(mask, v); // } // for k // } // for j //} // for i } template <class Archive> void load(Archive &ar) { ar(metagrid_, background_, voxel_len_, name_); InitializePartition(metagrid_, voxel_len_, background_, name_); DeserializeHelper(ar); //Coord start, end; //ar(start[0], start[1], start[2]); //ar(end[0], end[1], end[2]); //for (int i = start[0]; i <= end[0]; ++i) { // for (int j = start[1]; j <= end[1]; ++j) { // for (int k = start[2]; k <= end[2]; ++k) { // Coord c(i, j, k); // bool mask; // T v; // ar(mask, v); // if (mask) { // set(i, j, k, v); // } // } // for k // } // for j //} // for i } private: // Helper serialization/deserialization methods. void SerializeDense( const CoordBBox box, canary::CanaryOutputArchive &archive) const; void DeserializeHelper(canary::CanaryInputArchive &archive); }; // class ScalarGrid } // namespace common #endif // COMMON_SCALAR_GRID_H
/* * light weight WS2812 lib V2.0b * * Controls WS2811/WS2812/WS2812B RGB-LEDs * Author: Tim (cpldcpu@gmail.com) * * Jan 18th, 2014 v2.0b Initial Version * Nov 29th, 2015 v2.3 Added SK6812RGBW support * * License: GNU GPL v2 (see License.txt) */ #include "light_ws2812.h" #include <avr/interrupt.h> #include <avr/io.h> #include <util/delay.h> // Setleds for standard RGB void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) { ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); } void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask) { ws2812_sendarray_mask((uint8_t*)ledarray,leds+leds+leds,pinmask); _delay_us(ws2812_resettime); } // Setleds for SK6812RGBW void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) { ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(ws2812_pin)); _delay_us(ws2812_resettime); } void ws2812_sendarray(uint8_t *data,uint16_t datlen) { ws2812_sendarray_mask(data,datlen,_BV(ws2812_pin)); } /* This routine writes an array of bytes with RGB values to the Dataout pin using the fast 800kHz clockless WS2811/2812 protocol. */ // Timing in ns #define w_zeropulse 400 #define w_onepulse 850 #define w_totalperiod 1250 // Fixed cycles used by the inner loop #define w_fixedlow 2 #define w_fixedhigh 4 #define w_fixedtotal 8 // Insert NOPs to match the timing, if possible #define w_zerocycles (((F_CPU/1000)*w_zeropulse )/1000000) #define w_onecycles (((F_CPU/1000)*w_onepulse )/1000000) //+500000 #define w_totalcycles (((F_CPU/1000)*w_totalperiod )/1000000) //+500000 // w1 - nops between rising edge and falling edge - low #define w1 (w_zerocycles-w_fixedlow) // w2 nops between fe low and fe high #define w2 (w_onecycles-w_fixedhigh-w1) // w3 nops to complete loop #define w3 (w_totalcycles-w_fixedtotal-w1-w2) #if w1>0 #define w1_nops w1 #else #define w1_nops 0 #endif // The only critical timing parameter is the minimum pulse length of the "0" // Warn or throw error if this timing can not be met with current F_CPU settings. #define w_lowtime ((w1_nops+w_fixedlow)*1000000)/(F_CPU/1000) #if w_lowtime>550 #error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?" #elif w_lowtime>450 #warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)." #warning "Please consider a higher clockspeed, if possible" #endif #if w2>0 #define w2_nops w2 #else #define w2_nops 0 #endif #if w3>0 #define w3_nops w3 #else #define w3_nops 0 #endif #define w_nop1 "nop \n\t" #define w_nop2 "rjmp .+0 \n\t" #define w_nop4 w_nop2 w_nop2 #define w_nop8 w_nop4 w_nop4 #define w_nop16 w_nop8 w_nop8 void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi) { uint8_t curbyte,ctr,masklo; uint8_t sreg_prev; ws2812_DDRREG |= maskhi; // Enable output masklo =~maskhi&ws2812_PORTREG; maskhi |= ws2812_PORTREG; sreg_prev=SREG; cli(); while (datlen--) { curbyte=*data++; asm volatile( " ldi %0,8 \n\t" "loop%=: \n\t" " out %2,%3 \n\t" // '1' [01] '0' [01] - re #if (w1_nops&1) w_nop1 #endif #if (w1_nops&2) w_nop2 #endif #if (w1_nops&4) w_nop4 #endif #if (w1_nops&8) w_nop8 #endif #if (w1_nops&16) w_nop16 #endif " sbrs %1,7 \n\t" // '1' [03] '0' [02] " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low " lsl %1 \n\t" // '1' [04] '0' [04] #if (w2_nops&1) w_nop1 #endif #if (w2_nops&2) w_nop2 #endif #if (w2_nops&4) w_nop4 #endif #if (w2_nops&8) w_nop8 #endif #if (w2_nops&16) w_nop16 #endif " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high #if (w3_nops&1) w_nop1 #endif #if (w3_nops&2) w_nop2 #endif #if (w3_nops&4) w_nop4 #endif #if (w3_nops&8) w_nop8 #endif #if (w3_nops&16) w_nop16 #endif " dec %0 \n\t" // '1' [+2] '0' [+2] " brne loop%=\n\t" // '1' [+3] '0' [+4] : "=&d" (ctr) : "r" (curbyte), "I" (_SFR_IO_ADDR(ws2812_PORTREG)), "r" (maskhi), "r" (masklo) ); } SREG=sreg_prev; }
/** * \file * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page 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. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef _SAM4E_DACC_INSTANCE_ #define _SAM4E_DACC_INSTANCE_ /* ========== Register definition for DACC peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_DACC_CR (0x400B8000U) /**< \brief (DACC) Control Register */ #define REG_DACC_MR (0x400B8004U) /**< \brief (DACC) Mode Register */ #define REG_DACC_CHER (0x400B8010U) /**< \brief (DACC) Channel Enable Register */ #define REG_DACC_CHDR (0x400B8014U) /**< \brief (DACC) Channel Disable Register */ #define REG_DACC_CHSR (0x400B8018U) /**< \brief (DACC) Channel Status Register */ #define REG_DACC_CDR (0x400B8020U) /**< \brief (DACC) Conversion Data Register */ #define REG_DACC_IER (0x400B8024U) /**< \brief (DACC) Interrupt Enable Register */ #define REG_DACC_IDR (0x400B8028U) /**< \brief (DACC) Interrupt Disable Register */ #define REG_DACC_IMR (0x400B802CU) /**< \brief (DACC) Interrupt Mask Register */ #define REG_DACC_ISR (0x400B8030U) /**< \brief (DACC) Interrupt Status Register */ #define REG_DACC_ACR (0x400B8094U) /**< \brief (DACC) Analog Current Register */ #define REG_DACC_WPMR (0x400B80E4U) /**< \brief (DACC) Write Protection Mode Register */ #define REG_DACC_WPSR (0x400B80E8U) /**< \brief (DACC) Write Protection Status Register */ #define REG_DACC_TPR (0x400B8108U) /**< \brief (DACC) Transmit Pointer Register */ #define REG_DACC_TCR (0x400B810CU) /**< \brief (DACC) Transmit Counter Register */ #define REG_DACC_TNPR (0x400B8118U) /**< \brief (DACC) Transmit Next Pointer Register */ #define REG_DACC_TNCR (0x400B811CU) /**< \brief (DACC) Transmit Next Counter Register */ #define REG_DACC_PTCR (0x400B8120U) /**< \brief (DACC) Transfer Control Register */ #define REG_DACC_PTSR (0x400B8124U) /**< \brief (DACC) Transfer Status Register */ #else #define REG_DACC_CR (*(__O uint32_t*)0x400B8000U) /**< \brief (DACC) Control Register */ #define REG_DACC_MR (*(__IO uint32_t*)0x400B8004U) /**< \brief (DACC) Mode Register */ #define REG_DACC_CHER (*(__O uint32_t*)0x400B8010U) /**< \brief (DACC) Channel Enable Register */ #define REG_DACC_CHDR (*(__O uint32_t*)0x400B8014U) /**< \brief (DACC) Channel Disable Register */ #define REG_DACC_CHSR (*(__I uint32_t*)0x400B8018U) /**< \brief (DACC) Channel Status Register */ #define REG_DACC_CDR (*(__O uint32_t*)0x400B8020U) /**< \brief (DACC) Conversion Data Register */ #define REG_DACC_IER (*(__O uint32_t*)0x400B8024U) /**< \brief (DACC) Interrupt Enable Register */ #define REG_DACC_IDR (*(__O uint32_t*)0x400B8028U) /**< \brief (DACC) Interrupt Disable Register */ #define REG_DACC_IMR (*(__I uint32_t*)0x400B802CU) /**< \brief (DACC) Interrupt Mask Register */ #define REG_DACC_ISR (*(__I uint32_t*)0x400B8030U) /**< \brief (DACC) Interrupt Status Register */ #define REG_DACC_ACR (*(__IO uint32_t*)0x400B8094U) /**< \brief (DACC) Analog Current Register */ #define REG_DACC_WPMR (*(__IO uint32_t*)0x400B80E4U) /**< \brief (DACC) Write Protection Mode Register */ #define REG_DACC_WPSR (*(__I uint32_t*)0x400B80E8U) /**< \brief (DACC) Write Protection Status Register */ #define REG_DACC_TPR (*(__IO uint32_t*)0x400B8108U) /**< \brief (DACC) Transmit Pointer Register */ #define REG_DACC_TCR (*(__IO uint32_t*)0x400B810CU) /**< \brief (DACC) Transmit Counter Register */ #define REG_DACC_TNPR (*(__IO uint32_t*)0x400B8118U) /**< \brief (DACC) Transmit Next Pointer Register */ #define REG_DACC_TNCR (*(__IO uint32_t*)0x400B811CU) /**< \brief (DACC) Transmit Next Counter Register */ #define REG_DACC_PTCR (*(__O uint32_t*)0x400B8120U) /**< \brief (DACC) Transfer Control Register */ #define REG_DACC_PTSR (*(__I uint32_t*)0x400B8124U) /**< \brief (DACC) Transfer Status Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAM4E_DACC_INSTANCE_ */
/* * msque.hpp * Created on: 2012-8-30 * Author: qianqians * msque: */ #ifndef _MSQUE_H #define _MSQUE_H #include <functional> #include <atomic> #include "../container/detail/_hazard_ptr.h" #include "../pool/objpool.h" namespace Fossilizid { namespace container{ template <typename T, typename _Allocator = std::allocator<T> > class msque{ private: struct _list_node{ _list_node () {_next = 0;} _list_node (const T & val) : data(val) {_next = 0;} ~_list_node () {} T data; std::atomic<_list_node *> _next; }; struct _list{ std::atomic<_list_node *> _begin; std::atomic<_list_node *> _end; std::atomic_uint32_t _size; }; typedef Fossilizid::container::detail::_hazard_ptr<_list_node> _hazard_ptr; typedef Fossilizid::container::detail::_hazard_system<_list_node> _hazard_system; typedef Fossilizid::container::detail::_hazard_ptr<_list> _hazard_list_ptr; typedef Fossilizid::container::detail::_hazard_system<_list> _hazard_list_; typedef typename _Allocator::template rebind<_list_node>::other _node_alloc; typedef typename _Allocator::template rebind<_list>::other _list_alloc; public: msque(void) : _hazard_sys(std::bind(&msque::put_node, this, std::placeholders::_1)), _hazard_list(std::bind(&msque::put_list, this, std::placeholders::_1)){ __list.store(get_list()); } ~msque(void){ put_list(__list.load()); } /* * que is empty */ bool empty(){ return (__list.load()->_size.load() == 0); } /* * get que size */ std::size_t size(){ return __list.load()->_size.load(); } /* * clear this que */ void clear(){ _list * _new_list = get_list(); _list * _old_list = __list.exchange(_new_list); put_list(_old_list); } /* * push a element to que */ void push(const T & data){ _list_node * _node = get_node(data); _hazard_list_ptr * _hp_list; _hazard_list.acquire(&_hp_list, 1); _hazard_ptr * _hp; _hazard_sys.acquire(&_hp, 1); while(1){ _hp_list->_hazard = __list.load(); _hp->_hazard = _hp_list->_hazard->_end.load(); _list_node * next = _hp->_hazard->_next.load(); if(next != 0){ _hp_list->_hazard->_end.compare_exchange_weak(_hp->_hazard, next); continue; } if(_hp->_hazard != _hp_list->_hazard->_end.load()){ continue; } if (_hp->_hazard->_next.compare_exchange_weak(next, _node)){ _hp_list->_hazard->_end.compare_exchange_weak(_hp->_hazard, _node); _hp_list->_hazard->_size++; break; } } _hazard_sys.release(_hp); _hazard_list.release(_hp_list); } /* * pop a element form que if empty return false */ bool pop(T & data){ bool ret = true; _hazard_list_ptr * _hp_list; _hazard_list.acquire(&_hp_list, 1); _hazard_ptr * _hp_node[2]; _hazard_sys.acquire(_hp_node, 2); while(1){ _hp_list->_hazard = __list.load(); _hp_node[0]->_hazard = _hp_list->_hazard->_begin.load(); _hp_node[1]->_hazard = _hp_node[0]->_hazard->_next.load(); if(_hp_node[1]->_hazard == 0){ ret = false; break; } if(_hp_node[0]->_hazard != _hp_list->_hazard->_begin.load()){ _hp_node[0]->_hazard = _hp_list->_hazard->_begin.load(); continue; } if(_hp_list->_hazard->_begin.compare_exchange_strong(_hp_node[0]->_hazard, _hp_node[1]->_hazard)){ data = _hp_node[1]->_hazard->data; _hazard_sys.retire(_hp_node[0]->_hazard); _hp_list->_hazard->_size--; break; } } _hazard_list.release(_hp_list); _hazard_sys.release(_hp_node[0]); _hazard_sys.release(_hp_node[1]); return ret; } private: _list * get_list(){ _list * __list = __list_alloc.allocate(1); while(__list == 0){__list = __list_alloc.allocate(1);} new (__list) _list(); __list->_size = 0; _list_node * _node = get_node(); _node->_next.store(0); __list->_begin.store(_node); __list->_end.store(_node); return __list; } void put_list(_list * _p){ _list_node * _node = _p->_begin; do{ _list_node * _tmp = _node; _node = _node->_next; _hazard_sys.retire(_tmp); }while(_node != 0); __list_alloc.deallocate(_p, 1); } _list_node * get_node(){ _list_node * _node = pool::objpool<_list_node>::allocator(1); new (_node) _list_node(); return _node; } _list_node * get_node(const T & data){ _list_node * _node = pool::objpool<_list_node>::allocator(1); new (_node) _list_node(data); return _node; } void put_node(_list_node * _p){ pool::objpool<_list_node>::deallocator(_p, 1); } private: std::atomic<_list *> __list; _list_alloc __list_alloc; _node_alloc __node_alloc; _hazard_system _hazard_sys; _hazard_list_ _hazard_list; }; } /* Hemsleya */ } /* container */ #endif //_MSQUE_H
// // Flue.h // Flue // // Created by Juri Pakaste on 09/02/16. // Copyright © 2016 Juri Pakaste. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for Flue. FOUNDATION_EXPORT double FlueVersionNumber; //! Project version string for Flue. FOUNDATION_EXPORT const unsigned char FlueVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Flue/PublicHeader.h>
// // Created by Ivan Chua on 15/4/8. // Copyright (c) 2015 MeiYou. All rights reserved. // #import <Foundation/Foundation.h> #import "LanguagesManager.h" #define IMYString(key) [[IMYLanguageManager sharedInstance] localizedStringForKey:key value:nil] @interface IMYLanguageManager : LanguagesManager @end
/* * Copyright (C) 2013 to 2014 by Felipe Lavratti * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the * Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef FONTS_H_ #define FONTS_H_ #include "types.h" extern font_t *ubuntu_monospace_16; #endif /* FONTS_H_ */
// // NSString+Networking.h // BMNetworking // // Created by fenglh on 2017/1/20. // Copyright © 2017年 BlueMoon. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (Networking) /** Returns a lowercase NSString for md5 hash. */ - (nullable NSString *)md5String; @end
#ifndef __DETECTOR_H_INCLUDED__ #define __DETECTOR_H_INCLUDED__ #include <opencv2\core\core.hpp> #include <boost\circular_buffer.hpp> #include <opencv2\objdetect\objdetect.hpp> #include <opencv2\highgui\highgui.hpp> #include <opencv2\imgproc\imgproc.hpp> #include <opencv2\features2d\features2d.hpp> #include <opencv2\video\video.hpp> #include <iostream> #include <vector> #include "frame.h" using namespace std; using namespace cv; class Detector { private: vector<Rect> recognizedObjects; CascadeClassifier objectClassifier; public: bool initialize(String xmlPath, bool loadFromOpenCV); bool detect(Mat* frame, Rect* faceRect); }; #endif
#ifndef AXLIB_CARBON_H #define AXLIB_CARBON_H #include <Carbon/Carbon.h> #include <unistd.h> #include <string> #include <map> struct ax_application; struct carbon_event_handler { EventTargetRef EventTarget; EventHandlerUPP EventHandler; EventTypeSpec EventType[2]; EventHandlerRef CurHandler; }; bool AXLibInitializeCarbonEventHandler(carbon_event_handler *Carbon, std::map<pid_t, ax_application> *AXApplications); void CarbonWhitelistProcess(std::string Name); #endif
// // ViewController.h // CYMulitiTableDemo // // Created by sinocare on 2017/6/15. // Copyright © 2017年 Yu Cheng. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#ifndef GAME_H_ #define GAME_H_ #include <memory> #include <vector> #include "player_input.h" #include "player.h" #include "level_id.h" #include "object.h" #include "background.h" #include "tile.h" #include "item.h" #include "enemy.h" class Game { public: static std::unique_ptr<Game> create(); virtual ~Game() = default; virtual bool init() = 0; virtual void update(unsigned game_tick, const PlayerInput& player_input) = 0; virtual const Player& get_player() const = 0; virtual LevelId get_level_id() const = 0; virtual int get_tile_width() const = 0; virtual int get_tile_height() const = 0; virtual const Background& get_background() const = 0; virtual const Tile& get_tile(int tile_x, int tile_y) const = 0; virtual const Item& get_item(int tile_x, int tile_y) const = 0; virtual const std::vector<Enemy>& get_enemies() const = 0; virtual const std::vector<Object>& get_objects() const = 0; virtual unsigned get_score() const = 0; virtual unsigned get_num_ammo() const = 0; virtual unsigned get_num_lives() const = 0; virtual std::string get_debug_info() const = 0; }; #endif // GAME_H_
#pragma once #include "data/tileSource.h" #include "labels/labelCollider.h" #include "scene/styleContext.h" #include "scene/drawRule.h" namespace Tangram { class DataLayer; class StyleBuilder; class Tile; class TileSource; struct Feature; struct Properties; struct TileData; class TileBuilder { public: TileBuilder(std::shared_ptr<Scene> _scene); ~TileBuilder(); StyleBuilder* getStyleBuilder(const std::string& _name); std::shared_ptr<Tile> build(TileID _tileID, const TileData& _data, const TileSource& _source); const Scene& scene() const { return *m_scene; } private: // Determine and apply DrawRules for a @_feature void applyStyling(const Feature& _feature, const SceneLayer& _layer); std::shared_ptr<Scene> m_scene; StyleContext m_styleContext; DrawRuleMergeSet m_ruleSet; LabelCollider m_labelLayout; fastmap<std::string, std::unique_ptr<StyleBuilder>> m_styleBuilder; fastmap<uint32_t, std::shared_ptr<Properties>> m_selectionFeatures; }; }
#ifndef UNIFORM_DIS_FUNCTION_H #define UNIFORM_DIS_FUNCTION_H #include <memory> #include <vector> #include <string> #include <random> #include "Function.h" #include "Configuration.h" #include "PrototypeManager.h" #include "Random.h" #include "Individual.h" namespace adef { /** @brief UniformDisFunction generates random numbers according to the uniform distribution. @tparam T The type of the object. It must be arithmetic type. UniformDisFunction has the following feature: - generate(): return the random number according to the uniform distribution. - record(): record parameters into the lower bound and/or upper bound component. - update(): update values of the lower bound and upper bound. @par Requirement record parameters into Function: - name "lower_bound" - name "upper_bound" . ADEF supports many kinds of UniformDisFunction: - IntegerUniformDisFunction. - RealUniformDisFunction. @par The configuration UniformDisFunction has extra configurations: - member - name: "lower_bound" - value: object configuration which is the class derived from Function. - member - name: "upper_bound" - value: object configuration which is the class derived from Function. . See setup() for the details. */ template<typename T> class UniformDisFunction : public Function<T> { static_assert(std::is_arithmetic<T>::value, "UniformDisFunction contains only arithmetic type"); public: /// The type of the object. using Object = typename Function<T>::Object; /** @brief The default constructor with seed value 1. The default value of the lower bound is 0, upper bound is 1. */ UniformDisFunction() : lower_bound_(0), upper_bound_(1) { } /** @brief The constructor with the given seed. @param seed The seed value of the pseudo-random number generator. */ UniformDisFunction(unsigned int seed) : lower_bound_(0), upper_bound_(1) { } /** @brief The copy constructor, but the pseudo-random number generator renews. */ UniformDisFunction(const UniformDisFunction& rhs) : Function<T>(rhs), lower_bound_(rhs.lower_bound_), upper_bound_(rhs.upper_bound_) { } /** @brief Clone the current class. @sa clone_impl() */ std::shared_ptr<UniformDisFunction> clone() const { return std::dynamic_pointer_cast<UniformDisFunction>(clone_impl()); } /** @brief Set up the internal states. If @em SomeThing is the ::RealUniformDisFunction and has the following configuration: - lower_bound: ::RealConstantFunction of value 0.0 - upper_bound: ::RealConstantFunction of value 1.0 . its configuration should be - JSON configuration @code "SomeThing" : { "classname" : "RealUniformDisFunction", "lower_bound" : { "classname" : "RealConstantFunction", "value" : 0.0 }, "upper_bound" : { "classname" : "RealConstantFunction", "value" : 1.0 } } @endcode . */ void setup(const Configuration& config, const PrototypeManager& pm) override { auto lower_bound_config = config.get_config("lower_bound"); auto lower_bound = make_and_setup_type<BaseFunction>(lower_bound_config, pm); lower_bound->set_function_name("lower_bound"); Function<T>::add_function(lower_bound); auto upper_bound_config = config.get_config("upper_bound"); auto upper_bound = make_and_setup_type<BaseFunction>(upper_bound_config, pm); upper_bound->set_function_name("upper_bound"); Function<T>::add_function(upper_bound); lower_bound_ = 0; upper_bound_ = 1; } Object generate() override { return generate_impl<>(); } void update() override { auto lower_bound = Function<T>::get_function("lower_bound"); lower_bound->update(); lower_bound_ = lower_bound->generate(); auto upper_bound = Function<T>::get_function("upper_bound"); upper_bound->update(); upper_bound_ = upper_bound->generate(); } unsigned int number_of_parameters() const override { return 0; } private: /// The value of the lower bound. Object lower_bound_; /// The value of the upper bound. Object upper_bound_; private: template<typename U = Object> U generate_impl( std::enable_if_t<std::is_integral<U>::value>* = nullptr) { std::uniform_int_distribution<> uniform(lower_bound_, upper_bound_); return BaseFunction::random_->generate(uniform); } template<typename U = Object> U generate_impl( std::enable_if_t<std::is_floating_point<U>::value>* = nullptr) { std::uniform_real_distribution<> uniform(lower_bound_, upper_bound_); return BaseFunction::random_->generate(uniform); } std::shared_ptr<Prototype> clone_impl() const override { return std::make_shared<UniformDisFunction>(*this); } }; /** @brief IntegerUniformDisFunction is the UniformDisFunction that controls the integer number. */ using IntegerUniformDisFunction = UniformDisFunction<int>; /** @brief RealUniformDisFunction is the UniformDisFunction that controls the real number. */ using RealUniformDisFunction = UniformDisFunction<double>; } #endif // UNIFORM_DIS_FUNCTION_H
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @class NSString; @protocol TNDROtherReasonDialogDelegate <NSObject> - (void)reportWithMessage:(NSString *)arg1; @end
#ifndef PhysicsEngine_H #define PhysicsEngine_H #include <Ogre.h> #include <btBulletDynamicsCommon.h> #include <OgreDebugDrawer.h> #include <MyMotionState.h> #include "Monster.h" #include "AudioController.h" class PhysicsEngine : public Ogre::Singleton<PhysicsEngine> { public: PhysicsEngine(Ogre::SceneManager* sceneManger); ~PhysicsEngine(); static PhysicsEngine& getSingleton(); static PhysicsEngine* getSingletonPtr(); void updatePhysics(btScalar deltatime, btScalar maxSteps); void worldDebug(); btRigidBody* createRigidBody(Ogre::SceneNode* node, btCollisionShape* shape,btVector3& position,btQuaternion& orientation,btScalar mass,btVector3& inertia); void detecCollision(); void addRigidBody(btRigidBody* r); void deleteRigidBody(btRigidBody* r); btDiscreteDynamicsWorld* getWorld(){ return _world; } int getScore(){ return score; }; int getCoreDamage(){ return coreDamage; }; bool getCoreDamaged(){ return coreDamaged; }; void setCoreDamaged(bool hit){ coreDamaged = hit; }; private: std::vector<btRigidBody*> rigidBodies; btBroadphaseInterface* _broadphase; btDefaultCollisionConfiguration* _collisionConf; btCollisionDispatcher* _dispatcher; btSequentialImpulseConstraintSolver* _solver; OgreDebugDrawer* _mDebugDrawer; btDiscreteDynamicsWorld* _world; int score; int coreDamage; bool coreDamaged; }; #endif
// // AppDelegate.h // SSWrapper // // Created by Quincy Yan on 2017/1/28. // Copyright © 2017年 Quincy Yan. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class NSEntityMapping, NSMutableArray, NSMutableDictionary, NSSQLEntity; // Not exported @interface _NSSQLEntityMigrationDescription : NSObject { NSEntityMapping *_entityMapping; NSMutableDictionary *_sqlValuesByColumnName; NSMutableDictionary *_sourceEntitiesByToOneWithNewEntityKey; NSSQLEntity *_dstEntity; NSSQLEntity *_srcEntity; int _migrationType; NSMutableArray *_addedManyToManys; NSMutableArray *_removedManyToManys; NSMutableArray *_transformedManyToManys; NSMutableArray *_processedTransforms; NSMutableArray *_pendingTransforms; } @property(readonly) int migrationType; // @synthesize migrationType=_migrationType; @property(readonly) NSEntityMapping *entityMapping; // @synthesize entityMapping=_entityMapping; @property(readonly) NSSQLEntity *destinationEntity; // @synthesize destinationEntity=_dstEntity; @property(readonly) NSSQLEntity *sourceEntity; // @synthesize sourceEntity=_srcEntity; - (id)nextPropertyTransform; - (id)transformedManyToManys; - (id)removedManyToManys; - (id)addedManyToManys; - (id)sqlValueForColumnName:(id)arg1 migrationContext:(struct _NSSQLMigrationContext)arg2; - (void)_populateSQLValuesByPropertyFromTransforms:(id)arg1 migrationContext:(struct _NSSQLMigrationContext)arg2; - (void)_populateSQLValuesForVirtualToOnesWithMigrationContext:(struct _NSSQLMigrationContext)arg1; - (id)_unmappedRelationshipForFormerlyVirtualToOne:(id)arg1 migrationContext:(struct _NSSQLMigrationContext)arg2; - (void)_populateSQLValuesForDestinationToOne:(id)arg1 fromSourceToOne:(id)arg2; - (id)sourceEntitiesByToOneWithNewEntityKey; - (void)_generateSQLValueMappingsWithMigrationContext:(struct _NSSQLMigrationContext)arg1; - (void)dealloc; - (id)initWithEntityMapping:(id)arg1 sourceEntity:(id)arg2 destinationEntity:(id)arg3; @end
/* ** Copyright (C) 2016-2021 Arseny Vakhrushev <arseny.vakhrushev@me.com> ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and associated documentation files (the "Software"), to deal ** in the Software without restriction, including without limitation the rights ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: ** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ** THE SOFTWARE. */ #include "common.h" static int m_data(lua_State *L) { bson_oid_t *oid = checkObjectID(L, 1); lua_pushlstring(L, (const char *)oid->bytes, sizeof oid->bytes); return 1; } static int m_hash(lua_State *L) { pushInt32(L, bson_oid_hash(checkObjectID(L, 1))); return 1; } static int m__tostring(lua_State *L) { char buf[25]; bson_oid_to_string(checkObjectID(L, 1), buf); lua_pushstring(L, buf); return 1; } static int m__eq(lua_State *L) { lua_pushboolean(L, bson_oid_equal(checkObjectID(L, 1), checkObjectID(L, 2))); return 1; } static const luaL_Reg funcs[] = { {"data", m_data}, {"hash", m_hash}, {"__tostring", m__tostring}, {"__eq", m__eq}, {0, 0} }; int newObjectID(lua_State *L) { size_t len; const char *str = lua_tolstring(L, 1, &len); if (str) { luaL_argcheck(L, bson_oid_is_valid(str, len), 1, "invalid format"); bson_oid_init_from_string(lua_newuserdata(L, sizeof(bson_oid_t)), str); } else { if (!lua_isnoneornil(L, 1)) return typeError(L, 1, "string"); bson_oid_init(lua_newuserdata(L, sizeof(bson_oid_t)), 0); } setType(L, TYPE_OBJECTID, funcs); return 1; } void pushObjectID(lua_State *L, const bson_oid_t *oid) { bson_oid_copy(oid, lua_newuserdata(L, sizeof *oid)); setType(L, TYPE_OBJECTID, funcs); } bson_oid_t *checkObjectID(lua_State *L, int idx) { return luaL_checkudata(L, idx, TYPE_OBJECTID); } bson_oid_t *testObjectID(lua_State *L, int idx) { return luaL_testudata(L, idx, TYPE_OBJECTID); }
/****************************************************************************** The most basic example program to write a line of text in to the terminal using the USART library for pic16 mcus. Compiler: Microchip XC8 v1.12 (http://www.microchip.com/xc) IDE: Microchip MPLABX MCU: PIC16F877A Frequency: 20MHz NOTICE NO PART OF THIS WORK CAN BE COPIED, DISTRIBUTED OR PUBLISHED WITHOUT A WRITTEN PERMISSION FROM EXTREME ELECTRONICS INDIA. THE LIBRARY, NOR ANY PART OF IT CAN BE USED IN COMMERCIAL APPLICATIONS. IT IS INTENDED TO BE USED FOR HOBBY, LEARNING AND EDUCATIONAL PURPOSE ONLY. IF YOU WANT TO USE THEM IN COMMERCIAL APPLICATION PLEASE WRITE TO THE AUTHOR. WRITTEN BY: AVINASH GUPTA me@avinashgupta.com *******************************************************************************/ #include <xc.h> #include "usart_pic16.h" // Configuration Byte #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled) #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled) #pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled) #pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off) #pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control) #pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off) void main() { //Initialize USART with baud rate 9600 USARTInit(9600); //Write intro text USARTWriteLine("***********************************************"); USARTWriteLine("USART Test"); USARTWriteLine("----------"); USARTWriteLine("Type a character on keyboard"); USARTWriteLine("it will reach the PIC MCU via the serial line"); USARTWriteLine("PIC MCU will return the same character but "); USARTWriteLine("enclosed in a <>"); USARTWriteLine("--"); USARTWriteLine("For example if you type 'a' you will see <a>"); USARTWriteLine("appear on serial terminal."); USARTWriteLine(" "); USARTWriteLine("This checks both way serial transfers."); USARTWriteLine(""); USARTWriteLine("Copyright (C) 2008-2013"); USARTWriteLine("www.eXtremeElectronics.co.in"); USARTWriteLine("***********************************************"); USARTGotoNewLine(); USARTGotoNewLine(); while(1) { //Get the amount of data waiting in USART queue uint8_t n= USARTDataAvailable(); //If we have some data if(n!=0) { //Read it char data=USARTReadData(); //And send back USARTWriteChar('<'); USARTWriteChar(data); USARTWriteChar('>'); } } }
#ifndef ASCIIMAP_H #define ASCIIMAP_H #ifdef _MSC_VER #include "pstdint.h" #else #include <stdint.h> #endif class AsciiMap { char *map_;//final map int mapWidth_; int mapHeight_; public: AsciiMap(); ~AsciiMap(); char* getMap(int aMapWidth, int aMapHeight, unsigned long aAreaUid, unsigned long aViewerRoom); //void printMap(); }; #endif // ASCIIMAP_H
#pragma once #include "gep/gepmodule.h" #include "gep/threading/thread.h" #include "gep/threading/semaphore.h" #include "gep/container/DynamicArray.h" #include "gep/container/Queue.h" #include "gep/types.h" #include <functional> namespace gep { // forward declarations class TaskQueue; /// \brief interface for a task class ITask { public: /// \brief executes the task virtual void execute() = 0; }; class StandardTask : public ITask { std::function<void()> m_executable; public: StandardTask(const std::function<void()>& executable) : m_executable(executable) { GEP_ASSERT(m_executable, "Executable object is invalid."); } virtual ~StandardTask() {} virtual void execute() override { if(m_executable) m_executable(); } }; /// \brief Groups together tasks which can be executed in parallel class GEP_API TaskGroup { friend class TaskQueue; friend class TaskWorker; private: bool m_isExecuting; TaskQueue* m_pTaskQueue; std::function<void(ArrayPtr<ITask*>)> m_finishedCallback; volatile uint32 m_numRemainingTasks; DynamicArray<ITask*> m_tasks; TaskGroup(TaskQueue* pTaskQueue); void reset(); void taskFinished(); public: /// \brief adds a task to the task group void addTask(ITask* pTask); /// \brief sets a function which should be called when the task group finished inline void setOnFinished(std::function<void(ArrayPtr<ITask*>)> onFinished) { GEP_ASSERT(!m_isExecuting); m_finishedCallback = onFinished; } }; /// \brief worker which executes a single task at a time /// each worker has its own task queue /// if the task queue is empty it tries to steal tasks from other workers class GEP_API TaskWorker : public Thread { friend class TaskQueue; private: TaskQueue* m_pTaskQueue; TaskGroup* m_pActiveGroup; Semaphore m_hasWorkSemaphore; DynamicArray<ITask*> m_tasks; Mutex m_tasksMutex; inline void setActiveGroup(TaskGroup* pGroup) { m_pActiveGroup = pGroup; } void addTasks(ArrayPtr<ITask*> tasks); // runs a single task Result runSingleTask(); // tries to steal tasks from other task workers Result stealTasks(); // runs tasks until there is no more work void runTasks(); public: TaskWorker(TaskQueue* pTaskQueue); virtual void run() override; }; /// \brief Manages tasks class GEP_API TaskQueue { friend class TaskWorker; friend class TaskGroup; private: bool m_isRunning; TaskGroup* m_currentTaskGroup; Mutex m_schedulingMutex; Queue<TaskGroup*> m_remainingTaskGroups; DynamicArray<TaskGroup*> m_unusedTaskGroups; DynamicArray<TaskWorker*> m_worker; TaskWorker m_localWorker; void scheduleNextGroup(); public: TaskQueue(); ~TaskQueue(); /// \brief creates a new task group TaskGroup* createGroup(); /// \brief deletes a task group (previously created with createGroup) void deleteGroup(TaskGroup*); /// \brief schedules a task group for execution, it should at least contain 1 task void scheduleForExecution(TaskGroup* group); /// \brief tries to run a single task from the queue /// \return SUCCESS if successfull, FAILURE otherwise Result runSingleTask(); /// \brief runs tasks until there is no more work void runTasks(); /// \brief stops execution of tasks, blocks until all tasks are stopped void stop(); }; }
// // YJInnerViewController.h // YJThief // // Created by ddn on 2017/8/9. // Copyright © 2017年 Zyj163. All rights reserved. // #import <UIKit/UIKit.h> @interface YJInnerViewController : UIViewController @end
// // NSColor+Hexadecimal.h // Ase2Clr // // Created by Ramon Poca on 22/04/14. // Copyright (c) 2014 Ramon Poca. All rights reserved. // #import <Cocoa/Cocoa.h> @interface NSColor (Hexadecimal) + (NSColor *)colorWithHexString:(NSString *)hexString; @end
int ImmediateLogout(void); int ConnectionLost(void); void QueryCarrierDropped(void); void StartHeartBeat(int recordActivity); void StopHeartBeat(void); void RecordActivity(void); void CheckInactivity(void); void HandleKeepAlive(void); void SetCharacterSetPassthrough(char enabled);
#include <assert.h> extern int a; int b; int main() { assert(a == 0); assert(b == 0); a = 1; assert(a == 1); assert(b == 0); b = 2; assert(a == 1); assert(b == 2); return 0; }
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Collections\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_UNO_COLLECTIONS_LIST1_ENUMERATOR__FUSE_ANIMATIONS_MIXER_HANDLE_F_84E891C8_H__ #define __APP_UNO_COLLECTIONS_LIST1_ENUMERATOR__FUSE_ANIMATIONS_MIXER_HANDLE_F_84E891C8_H__ #include <app/Uno.Collections.IEnumerator.h> #include <app/Uno.Collections.IEnumerator__Fuse_Animations_MixerHandle_Fuse_E-2bd15cb5.h> #include <app/Uno.IDisposable.h> #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Fuse { namespace Animations { struct MixerHandle__Fuse_Elements_Element; } } } namespace app { namespace Uno { namespace Collections { struct List__Fuse_Animations_MixerHandle_Fuse_Elements_Element_; } } } namespace app { namespace Uno { namespace Collections { struct List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_; struct List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___uType : ::uStructType { ::app::Uno::Collections::IEnumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_ __interface_0; ::app::Uno::IDisposable __interface_1; ::app::Uno::Collections::IEnumerator __interface_2; }; List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___uType* List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___typeof(); void List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element____ObjInit(List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* __this, ::app::Uno::Collections::List__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* source); void List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___Dispose(List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* __this); ::app::Fuse::Animations::MixerHandle__Fuse_Elements_Element* List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___get_Current(List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* __this); bool List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___MoveNext(List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* __this); List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_ List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___New_1(::uStatic* __this, ::app::Uno::Collections::List__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* source); void List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___Uno_Collections_IEnumerator_Reset(List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* __this); struct List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element_ { ::uStrong< ::app::Uno::Collections::List__Fuse_Animations_MixerHandle_Fuse_Elements_Element_*> _source; int _version; int _iterator; ::uStrong< ::app::Fuse::Animations::MixerHandle__Fuse_Elements_Element*> _current; void _ObjInit(::app::Uno::Collections::List__Fuse_Animations_MixerHandle_Fuse_Elements_Element_* source) { List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element____ObjInit(this, source); } void Dispose() { List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___Dispose(this); } ::app::Fuse::Animations::MixerHandle__Fuse_Elements_Element* Current() { return List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___get_Current(this); } bool MoveNext() { return List1_Enumerator__Fuse_Animations_MixerHandle_Fuse_Elements_Element___MoveNext(this); } }; }}} #endif
/* List object interface */ /* Another generally useful object type is an list of object pointers. This is a mutable type: the list items can be changed, and items can be added or removed. Out-of-range indices or non-list objects are ignored. *** WARNING *** PyList_SetItem does not increment the new item's reference count, but does decrement the reference count of the item it replaces, if not nil. It does *decrement* the reference count if it is *not* inserted in the list. Similarly, PyList_GetItem does not increment the returned item's reference count. */ #ifndef Py_LISTOBJECT_H #define Py_LISTOBJECT_H typedef struct { PyObject_VAR_HEAD PyObject **ob_item; } PyListObject; PyAPI_DATA(PyTypeObject) PyList_Type; #define PyList_Check(op) PyObject_TypeCheck(op, &PyList_Type) #define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type) PyAPI_FUNC(PyObject *) PyList_New(int size); PyAPI_FUNC(int) PyList_Size(PyObject *); PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, int); PyAPI_FUNC(int) PyList_SetItem(PyObject *, int, PyObject *); PyAPI_FUNC(int) PyList_Insert(PyObject *, int, PyObject *); PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, int, int); PyAPI_FUNC(int) PyList_SetSlice(PyObject *, int, int, PyObject *); PyAPI_FUNC(int) PyList_Sort(PyObject *); PyAPI_FUNC(int) PyList_Reverse(PyObject *); PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *); /* Macro, trading safety for speed */ #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v)) #define PyList_GET_SIZE(op) (((PyListObject *)(op))->ob_size) #endif /* !Py_LISTOBJECT_H */
#ifndef IR_rangeZone_detection_h #define IR_rangeZone_detection_h #include "Arduino.h" class IR_rangeZone_detection { public: IR_rangeZone_detection(); float irDistance(int irLedPin, int irReceivePin); float irDetect(int irLedPin, int irReceiverPin, long frequency); float getLeftDistance(); float getRightDistance(); }; #endif
#include <stdio.h> #include <stdlib.h> #include "beespleen.h" int main() { knot start; start.x = 1; start.y = 0; knot mid1; mid1.x = 3; mid1.y = 15; knot mid2; mid2.x = 7; mid2.y = 45; knot end; end.x = 30; end.y = -150; start.prev = NULL; start.next = &mid1; mid1.prev = &start; mid1.next = &mid2; mid2.prev = &mid1; mid2.next = &end; end.prev = &mid2; end.next = NULL; calcKnotDeriv(&start); poly *p = calcPolynomialWith1stDeriv(&start, &end); printf("a: %f, b: %f, c: %f, d: %f\n", p->a, p->b, p->c, p->d); printf("knot' - 1: %f, 2: %f, 3:%f, 4:%f\n", start.p, mid1.p, mid2.p, end.p); return 0; }
//------------------------------------------------------------------- // MetaInfo Framework (MIF) // https://github.com/tdv/mif // Created: 03.2017 // Copyright (C) 2016-2021 tdv //------------------------------------------------------------------- #ifndef __MIF_APPLICATION_ID_CONFIG_H__ #define __MIF_APPLICATION_ID_CONFIG_H__ // MIF #include "mif/common/crc32.h" namespace Mif { namespace Application { namespace Id { namespace Service { namespace Config { enum { Json = Common::Crc32("Mif.Application.Service.Config.Json"), Xml = Common::Crc32("Mif.Application.Service.Config.Xml") }; } // namespace Config } // namespace Service } // namespace Id } // namespace Application } // namespace Mif #endif // !__MIF_APPLICATION_ID_CONFIG_H__
// // Ingredient.h // Dish by.me // // Created by 전수열 on 13. 4. 2.. // Copyright (c) 2013년 Joyfl. All rights reserved. // #import <Foundation/Foundation.h> @interface Ingredient : NSObject @property (nonatomic, strong) NSString *name; @property (nonatomic, strong) NSString *amount; + (id)ingredientFromDictionary:(NSDictionary *)dictionary; @end
/* Copyright (c) 2013 Katsuma Tanaka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <UIKit/UIKit.h> #import <AssetsLibrary/AssetsLibrary.h> #import <QuartzCore/QuartzCore.h> // Delegate #import "QBAssetCollectionViewControllerDelegate.h" #import "QBImagePickerAssetCellDelegate.h" #import "QBImageEditerViewControllerDelegate.h" // Controllers #import "QBImagePickerController.h" @interface QBAssetCollectionViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, QBImagePickerAssetCellDelegate,QBImageEditerViewControllerDelegate> @property (nonatomic, assign) id<QBAssetCollectionViewControllerDelegate> delegate; @property (nonatomic, retain) ALAssetsGroup *assetsGroup; @property (nonatomic, assign) CGSize imageSize; @property (nonatomic, assign) QBImagePickerFilterType filterType; @property (nonatomic, assign) BOOL showsCancelButton; @property (nonatomic, assign) BOOL fullScreenLayoutEnabled; @property (nonatomic, assign) BOOL showsHeaderButton; @property (nonatomic, assign) BOOL showsFooterDescription; @property (nonatomic, assign) BOOL allowsMultipleSelection; @property (nonatomic, assign) BOOL allowsEdit; @property (nonatomic, assign) BOOL limitsMinimumNumberOfSelection; @property (nonatomic, assign) BOOL limitsMaximumNumberOfSelection; @property (nonatomic, assign) NSUInteger minimumNumberOfSelection; @property (nonatomic, assign) NSUInteger maximumNumberOfSelection; @end
#ifndef __STATE_H__ #define __STATE_H__ struct Input; class NPC; class State { public: State() {} virtual ~State() {} virtual void Enter(NPC& player, const Input& input) = 0; virtual State* HandleInput(NPC& player, const Input& input) = 0; virtual State* Update(NPC& player, const Input& input) = 0; }; #endif // __STATE_H__
/* * Copyright (c) 2012, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, CAB F.78, Universitaetstr 6, CH-8092 Zurich. */ #ifndef __TI_TWL6030_H__ #define __TI_TWL6030_H__ #include <barrelfish/types.h> #include <errors/errno.h> void ti_twl6030_init(void); void ti_twl6030_scan(void); void ti_twl6030_vmmc_pr(void); errval_t ti_twl6030_set_vmmc_vsel(int millis); void ti_twl6030_vmmc_on(void); void ti_twl6030_vmmc_off(void); #endif // __TI_TWL6030_H__
// // GMUCoreDataStackManager.h // GitMenu // // Created by Morgan Lieberthal on 1/22/16. // Copyright © 2016 J. Morgan Lieberthal. All rights reserved. // @import Cocoa; @interface GMUCoreDataStackManager : NSObject + (instancetype)sharedManager; /// Managed object model for the framework. @property(nonatomic, strong, readonly) NSManagedObjectModel *managedObjectModel; /// Primary persistent store coordinator. @property(nonatomic, strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; /// URL for the CoreData store file. @property(nonatomic, readonly) NSURL *storeURL; /// URL for the shared application group container directory. @property(nonatomic, readonly) NSURL *sharedContainerDirectory; @end
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SCRIPT_STANDARD_H #define BITCOIN_SCRIPT_STANDARD_H #include "script/interpreter.h" #include "uint256.h" #include <boost/variant.hpp> #include <stdint.h> class CKeyID; class CScript; /** A reference to a CScript: the Hash160 of its serialization (see script.h) */ class CScriptID : public uint160 { public: CScriptID() : uint160() {} CScriptID(const CScript& in); CScriptID(const uint160& in) : uint160(in) {} }; static const unsigned int MAX_OP_RETURN_RELAY = 80; //!< bytes extern unsigned nMaxDatacarrierBytes; /** * Mandatory script verification flags that all new blocks must comply with for * them to be valid. (but old blocks may not comply with) Currently just P2SH, * but in the future other flags may be added. * * Failing one of these tests may trigger a DoS ban - see CheckInputs() for * details. */ static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; /** * Standard script verification flags that standard transactions will comply * with. However scripts violating these flags may still be present in valid * blocks and we must accept those blocks. */ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | // SCRIPT_VERIFY_DERSIG is always enforced SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_MINIMALDATA | SCRIPT_VERIFY_NULLDUMMY | SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS | SCRIPT_VERIFY_CLEANSTACK | SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | SCRIPT_VERIFY_LOW_S; /** For convenience, standard but not mandatory verify flags. */ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; enum txnouttype { TX_NONSTANDARD, // 'standard' transaction types: TX_PUBKEY, TX_PUBKEYHASH, TX_SCRIPTHASH, TX_MULTISIG, TX_NULL_DATA, }; class CNoDestination { public: friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } }; /** * A txout script template with a specific destination. It is either: * * CNoDestination: no destination set * * CKeyID: TX_PUBKEYHASH destination * * CScriptID: TX_SCRIPTHASH destination * A CTxDestination is the internal data type encoded in a bitcoin address */ typedef boost::variant<CNoDestination, CKeyID, CScriptID> CTxDestination; /** Check whether a CTxDestination is a CNoDestination. */ bool IsValidDestination(const CTxDestination& dest); const char* GetTxnOutputType(txnouttype t); bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet); int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions); bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet); CScript GetScriptForDestination(const CTxDestination& dest); CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys); // insightexplorer boost::optional<CTxDestination> DestFromAddressHash(int scriptType, uint160& addressHash); #endif // BITCOIN_SCRIPT_STANDARD_H
/** * @file http_server.h * * @brief Simple HTTP server for runtime system configuration * * @author Aaron Perley (aperley@andrew.cmu.edu) */ #ifndef __http_server_h_ #define __http_server_h_ /** @brief http client connection state */ typedef struct { int fd; } http_client_conn_t; /** @brief http request data */ typedef struct { unsigned int method; char *url; char *body; bool complete; } http_req_t; /** * @brief callback to handle http connecton * * @param client_conn client connection state * @param req request data */ typedef void (*http_req_handler_t)(http_client_conn_t *client_conn, http_req_t *req); void http_server_run(int port, http_req_handler_t req_handler); int http_client_send(http_client_conn_t *client_conn, const char *buf); #endif /* __http_server_h_ */
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */ #pragma once #include <vector> #include <map> #include <sstream> #include <string> #include "ifcpp/model/GlobalDefines.h" #include "ifcpp/model/BasicTypes.h" #include "ifcpp/model/BuildingObject.h" // TYPE IfcChangeActionEnum = ENUMERATION OF (NOCHANGE ,MODIFIED ,ADDED ,DELETED ,NOTDEFINED); class IFCQUERY_EXPORT IfcChangeActionEnum : virtual public BuildingObject { public: enum IfcChangeActionEnumEnum { ENUM_NOCHANGE, ENUM_MODIFIED, ENUM_ADDED, ENUM_DELETED, ENUM_NOTDEFINED }; IfcChangeActionEnum() = default; IfcChangeActionEnum( IfcChangeActionEnumEnum e ) { m_enum = e; } ~IfcChangeActionEnum() = default; virtual const char* className() const { return "IfcChangeActionEnum"; } virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options ); virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const; virtual const std::wstring toString() const; static shared_ptr<IfcChangeActionEnum> createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map ); IfcChangeActionEnumEnum m_enum; };
// // BLCredentialsListController.h // Blurt Mobile // // Created by Peter Iannucci on 6/24/13. // Copyright (c) 2013 Peter Iannucci. All rights reserved. // #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> #import "BLDetailViewController.h" @interface BLCredentialsListController : UITableViewController <NSFetchedResultsControllerDelegate> @property (strong, nonatomic) BLDetailViewController *detailViewController; @property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; @property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <Foundation/NSString.h> @interface NSString (NSDecimalExtension) - (CDStruct_5fe7aead)decimalValue; @end
// // AppDelegate.h // NewsDemo // // Created by Tsz on 15/11/21. // Copyright © 2015年 Tsz. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
//****************************************************************************** // IRremote // Version 2.0.1 June, 2015 // Copyright 2009 Ken Shirriff // For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html // // Modified by Paul Stoffregen <paul@pjrc.com> to support other boards and timers // // Interrupt code based on NECIRrcv by Joe Knapp // http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556 // Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/ // // JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post) // Whynter A/C ARC-110WD added by Francesco Meschia //****************************************************************************** #ifndef IRremoteint_h #define IRremoteint_h //------------------------------------------------------------------------------ // This handles definition and access to global variables // #ifdef IR_GLOBAL # define EXTERN #else # define EXTERN extern #endif //------------------------------------------------------------------------------ // Information for the Interrupt Service Routine // #define RAWBUF 101 // Maximum length of raw duration buffer #include <stdint.h> typedef struct { // The fields are ordered to reduce memory over caused by struct-padding uint8_t rcvstate; // State Machine state uint8_t recvpin; // Pin connected to IR data from detector uint8_t blinkpin; uint8_t blinkflag; // true -> enable blinking of pin on IR processing uint8_t rawlen; // counter of entries in rawbuf unsigned int timer; // State timer, counts 50uS ticks. unsigned int rawbuf[RAWBUF]; // raw data uint8_t overflow; // Raw buffer overflow occurred } irparams_t; // ISR State-Machine : Receiver States #define STATE_IDLE 2 #define STATE_MARK 3 #define STATE_SPACE 4 #define STATE_STOP 5 #define STATE_OVERFLOW 6 // Allow all parts of the code access to the ISR data // NB. The data can be changed by the ISR at any time, even mid-function // Therefore we declare it as "volatile" to stop the compiler/CPU caching it EXTERN volatile irparams_t irparams; //------------------------------------------------------------------------------ // Defines for setting and clearing register bits // #ifndef cbi # define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) #endif #ifndef sbi # define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) #endif //------------------------------------------------------------------------------ // Pulse parms are ((X*50)-100) for the Mark and ((X*50)+100) for the Space. // First MARK is the one after the long gap // Pulse parameters in uSec // // Due to sensor lag, when received, Marks tend to be 100us too long and // Spaces tend to be 100us too short #define MARK_EXCESS 100 // Upper and Lower percentage tolerances in measurements #define TOLERANCE 25 #define LTOL (1.0 - (TOLERANCE/100.)) #define UTOL (1.0 + (TOLERANCE/100.)) // Minimum gap between IR transmissions #define _GAP 5000 #define GAP_TICKS (_GAP/USECPERTICK) #define TICKS_LOW(us) ((int)(((us)*LTOL/USECPERTICK))) #define TICKS_HIGH(us) ((int)(((us)*UTOL/USECPERTICK + 1))) //------------------------------------------------------------------------------ // IR detector output is active low // #define MARK 0 #define SPACE 1 // All board specific stuff has been moved to its own file, included here. #include "boarddefs.h" #endif
// // EPChooseDeviceController.h // Elephrame // // Created by Jennifer on 7/15/14. // Copyright (c) 2014 Folse. All rights reserved. // #import "FSTableViewController.h" @interface EPChooseDeviceController : FSTableViewController @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <UIKit/UIStatusBarItemView.h> // Not exported @interface UIStatusBarThermalColorItemView : UIStatusBarItemView { int _thermalColor; _Bool _sunlightMode; } - (id)_color; - (id)contentsImage; - (_Bool)updateForNewData:(id)arg1 actions:(int)arg2; @end
// // Created by per on 23.03.18. // #ifndef DEEPRTS_ADDUNIT_H #define DEEPRTS_ADDUNIT_H #include "StateChange.h" class Game; class AddUnit: StateChange{ int id; int type; int player_id; AddUnit(int id, int type, int player_id): id(id), type(type), player_id(player_id){} void apply(Game *game); void apply_reverse(Game *game); }; #endif //DEEPRTS_ADDUNIT_H
#ifndef _PARLIST_H_A582D4E6_E956_4290_997F_692458C8FAC6_ #define _PARLIST_H_A582D4E6_E956_4290_997F_692458C8FAC6_ #include "lodbc.h" typedef struct par_data{ union{ struct{ SQLPOINTER buf; SQLULEN bufsize; } strval; lua_Number numval; char boolval; } value; SQLSMALLINT sqltype; SQLULEN parsize; SQLSMALLINT digest; SQLLEN ind; int get_cb; /* reference to callback */ struct par_data *next; } par_data; LODBC_INTERNAL int par_data_setparinfo(par_data* par, lua_State *L, SQLHSTMT hstmt, SQLSMALLINT i); /* Create params ** only memory allocation error */ LODBC_INTERNAL int par_data_create_unknown(par_data** ptr, lua_State *L); /* ** Ensure that in list at least n params ** only memory allocation error */ LODBC_INTERNAL int par_data_ensure_nth (par_data **par, lua_State *L, int n, par_data **res); LODBC_INTERNAL void par_data_free(par_data* next, lua_State *L); /* ** assign new type to par_data. ** if there error while allocate memory then strval.buf will be NULL */ LODBC_INTERNAL void par_data_settype(par_data* par, SQLSMALLINT sqltype, SQLULEN parsize, SQLSMALLINT digest, SQLULEN bufsize); LODBC_INTERNAL par_data* par_data_nth(par_data* p, int n); LODBC_INTERNAL int par_init_cb(par_data *par, lua_State *L, SQLUSMALLINT sqltype); LODBC_INTERNAL int par_call_cb(par_data *par, lua_State *L, int nparam); #endif
// // TAASGoogleResponse.h // TAAS-proxy // // Created by Marshall Rose on 6/31/14. // Copyright (c) 2014 The Thing System. All rights reserved. // #import "HTTPDataResponse.h" @interface TAASGoogleResponse : HTTPDataResponse - (id)initWithPath:(NSString *)path; @end
#ifndef __WIN32_LINK_H__ #define __WIN32_LINK_H__ #endif
#include <stdio.h> #include "common.h" #define ASIZE 1024 #define STEP 128 #define ITERS 4 float arrA[ASIZE]; float arrB[ASIZE]; __attribute__ ((noinline)) float loop(int zero) { int i, iters; float t1; for(iters=zero; iters < ITERS; iters+=1) { for(i=zero; i < ASIZE; i+=1) { arrA[i]=arrA[i]*3.2; } t1+=arrA[ASIZE-1]; } return t1; } int main(int argc, char* argv[]) { argc&=10000; ROI_BEGIN(); int t=loop(argc); ROI_END(); volatile float a = t; }
#include "interrupts.h" void treat_undef(void) { klog("Bad Exception handled: UNDEF!\n", 30, RED); while (1) {} } void treat_unused(void) { klog("Bad Exception handled: UNUSED!\n", 31, RED); while (1) {} } void treat_fiq(void) { klog("Bad Exception handled: FIQ!\n", 28, RED); while (1) {} } void treat_swi(int r0, int r1, int r2, int r3) { uint32_t number = 0; asm volatile ("ldrb %0, [lr, #-2]" : "=r" (number)); ((funcptr)syscall_table[number])(r0, r1, r2, r3); } void treat_pref_abort(void) { // DO STH HERE IF NECESSARY... } void treat_data_abort(void) { uint32_t addr, fault_addr; asm volatile("mov %[addr], lr" : [addr]"=r"(addr)); asm volatile("mrc p15, 0, %[addr], c6, c0, 0" : [addr]"=r"(fault_addr)); klog("DATA ABORT!\n", 12, BLUE); while (1) {} } void treat_irq(void) { timerarm->clr_irq = IRQ_TIMERARM; schedule(); } static void vector(void) { asm volatile( "b treat_reset\n" "b treat_undef\n" "b swi_handler\n" "b treat_pref_abort\n" "b treat_data_abort\n" "b treat_unused\n" "b irq_handler\n" "b treat_fiq\n" ); } void init_interrupts(void) { klog("[", 1, WHITE); klog("...", 3, RED); klog("]", 1, WHITE); interrupts = (s_interrupts *)BASE_INTERRUPTS; asm volatile ("mcr p15, 0, %[addr], c12, c0, 0" :: [addr]"r"(&vector)); asm volatile ("cpsie i"); interrupts->irq_en0 = IRQ_TIMERARM; wait(HUMAN_TIME / 2); klog("\b\b\b\bOK", 6, GREEN); klog("]\tInterrupt vector initialized!\n", 32, WHITE); }
// // LinkedList.h // iDB // // Created by Aaron Hayman on 6/28/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import <Foundation/Foundation.h> @class FlxLinkListIterator; @interface FlxLinkedList : NSObject <NSFastEnumeration, NSCopying> @property NSUInteger count; @property (nonatomic, readonly) NSArray *array; + (FlxLinkedList *) listWithObject:(id)object; + (FlxLinkedList *) linkedListFromArray:(NSArray *)array; + (FlxLinkedList *) linkedListFromArray:(NSArray *)array reverseEnumeration:(BOOL)reverse; - (id) initWithValue:(id)value; - (void) push:(id)value; - (id) peek; - (id) pop; - (void) add:(id)value; - (void) deleteList; - (NSUInteger) count; - (FlxLinkListIterator *) newIterator; - (id) objectAtIndexedSubscript:(NSUInteger)index; @end @interface FlxLinkListIterator : NSObject <NSFastEnumeration> - (id) initWithLinkedList:(FlxLinkedList *)list; - (id) next; - (id) removeCurrent; - (void) alterCurrentTo:(id)value; - (void) insertInFrontOfCurrent:(id)value; - (void) insertAfterCurrent:(id)value; @end
#include <stdint.h> #include "error.h" #include "strobe.h" #include "chip_reset.h" tcvr_error_t RESET_strobe_reset(uint8_t *status) { return STROBE_command_strobe(SRES, status); }
#ifndef CLIENTMODEL_H #define CLIENTMODEL_H #include <QObject> class OptionsModel; class AddressTableModel; class TransactionTableModel; class CWallet; QT_BEGIN_NAMESPACE class QDateTime; class QTimer; QT_END_NAMESPACE enum BlockSource { BLOCK_SOURCE_NONE, BLOCK_SOURCE_REINDEX, BLOCK_SOURCE_DISK, BLOCK_SOURCE_NETWORK }; /** Model for EquiTrader network client. */ class ClientModel : public QObject { Q_OBJECT public: explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0); ~ClientModel(); OptionsModel *getOptionsModel(); int getNumConnections() const; int getNumBlocks() const; int getNumBlocksAtStartup(); double getVerificationProgress() const; QDateTime getLastBlockDate() const; //! Return true if client connected to testnet bool isTestNet() const; //! Return true if core is doing initial block download bool inInitialBlockDownload() const; //! Return true if core is importing blocks enum BlockSource getBlockSource() const; //! Return conservative estimate of total number of blocks, or 0 if unknown int getNumBlocksOfPeers() const; //! Return warnings to be displayed in status bar QString getStatusBarWarnings() const; QString formatFullVersion() const; QString formatBuildDate() const; bool isReleaseVersion() const; QString clientName() const; QString formatClientStartupTime() const; private: OptionsModel *optionsModel; int cachedNumBlocks; int cachedNumBlocksOfPeers; bool cachedReindexing; bool cachedImporting; int numBlocksAtStartup; QTimer *pollTimer; void subscribeToCoreSignals(); void unsubscribeFromCoreSignals(); signals: void numConnectionsChanged(int count); void numBlocksChanged(int count, int countOfPeers); void alertsChanged(const QString &warnings); //! Asynchronous message notification void message(const QString &title, const QString &message, unsigned int style); public slots: void updateTimer(); void updateNumConnections(int numConnections); void updateAlert(const QString &hash, int status); }; #endif // CLIENTMODEL_H
/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- Copyright (c) 2006-2012, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the assimp team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of the assimp team. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ /** Defines a post processing step to limit the number of bones affecting a single vertex. */ #ifndef AI_DEBONEPROCESS_H_INC #define AI_DEBONEPROCESS_H_INC #include <vector> #include <utility> #include "BaseProcess.h" #include "../mesh.h" #include "../scene.h" class DeboneTest; namespace Assimp { #if (!defined AI_DEBONE_THRESHOLD) # define AI_DEBONE_THRESHOLD 1.0f #endif // !! AI_DEBONE_THRESHOLD // --------------------------------------------------------------------------- /** This post processing step removes bones nearly losslessly or according to * a configured threshold. In order to remove the bone, the primitives affected by * the bone are split from the mesh. The split off (new) mesh is boneless. At any * point in time, bones without affect upon a given mesh are to be removed. */ class DeboneProcess : public BaseProcess { public: DeboneProcess(); ~DeboneProcess(); public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. * A bitwise combination of #aiPostProcessSteps. * @return true if the process is present in this flag fields, * false if not. */ bool IsActive( unsigned int pFlags) const; // ------------------------------------------------------------------- /** Called prior to ExecuteOnScene(). * The function is a request to the process to update its configuration * basing on the Importer's configuration property list. */ void SetupProperties(const Importer* pImp); protected: // ------------------------------------------------------------------- /** Executes the post processing step on the given imported data. * At the moment a process is not supposed to fail. * @param pScene The imported data to work at. */ void Execute( aiScene* pScene); // ------------------------------------------------------------------- /** Counts bones total/removable in a given mesh. * @param pMesh The mesh to process. */ bool ConsiderMesh( const aiMesh* pMesh); /// Splits the given mesh by bone count. /// @param pMesh the Mesh to split. Is not changed at all, but might be superfluous in case it was split. /// @param poNewMeshes Array of submeshes created in the process. Empty if splitting was not necessary. void SplitMesh(const aiMesh* pMesh, std::vector< std::pair< aiMesh*,const aiBone* > >& poNewMeshes) const; /// Recursively updates the node's mesh list to account for the changed mesh list void UpdateNode(aiNode* pNode) const; // ------------------------------------------------------------------- // Apply transformation to a mesh void ApplyTransform(aiMesh* mesh, const aiMatrix4x4& mat)const; public: /** Number of bones present in the scene. */ unsigned int mNumBones; unsigned int mNumBonesCanDoWithout; float mThreshold; bool mAllOrNone; /// Per mesh index: Array of indices of the new submeshes. std::vector< std::vector< std::pair< unsigned int,aiNode* > > > mSubMeshIndices; }; } // end of namespace Assimp #endif // AI_DEBONEPROCESS_H_INC
# /* ******************************************************************** # * * # * (C) Copyright Paul Mensonides 2003-2005. * # * * # * Distributed under the Boost Software License, Version 1.0. * # * (See accompanying file LICENSE). * # * * # * See http://chaos-pp.sourceforge.net for most recent version. * # * * # ******************************************************************** */ # # ifndef CHAOS_PREPROCESSOR_REPETITION_X_DELINEATE_SHIFTED_H # define CHAOS_PREPROCESSOR_REPETITION_X_DELINEATE_SHIFTED_H # # include <chaos/preprocessor/arithmetic/dec.h> # include <chaos/preprocessor/comparison/not_equal.h> # include <chaos/preprocessor/config.h> # include <chaos/preprocessor/control/if.h> # include <chaos/preprocessor/control/iif.h> # include <chaos/preprocessor/facilities/empty.h> # include <chaos/preprocessor/facilities/optional.h> # include <chaos/preprocessor/lambda/call.h> # include <chaos/preprocessor/lambda/ops.h> # include <chaos/preprocessor/recursion/basic.h> # include <chaos/preprocessor/recursion/buffer.h> # include <chaos/preprocessor/recursion/expr.h> # include <chaos/preprocessor/recursion/phase.h> # include <chaos/preprocessor/seq/core.h> # include <chaos/preprocessor/tuple/eat.h> # # /* CHAOS_PP_DELINEATE_SHIFTED_X */ # # if CHAOS_PP_VARIADICS # define CHAOS_PP_DELINEATE_SHIFTED_X(size, count, sep, ...) CHAOS_PP_DELINEATE_SHIFTED_X_S(CHAOS_PP_STATE(), size, count, sep, __VA_ARGS__) # define CHAOS_PP_DELINEATE_SHIFTED_X_ CHAOS_PP_LAMBDA(CHAOS_PP_DELINEATE_SHIFTED_X_ID)() # else # define CHAOS_PP_DELINEATE_SHIFTED_X(size, count, sep, macro, data) CHAOS_PP_DELINEATE_SHIFTED_X_S(CHAOS_PP_STATE(), size, count, sep, macro, data) # endif # # define CHAOS_PP_DELINEATE_SHIFTED_X_ID() CHAOS_PP_DELINEATE_SHIFTED_X # # /* CHAOS_PP_DELINEATE_SHIFTED_X_S */ # # if CHAOS_PP_VARIADICS # define CHAOS_PP_DELINEATE_SHIFTED_X_S(s, size, count, sep, ...) \ CHAOS_IP_DELINEATE_SHIFTED_X_U(s, size, count, sep, CHAOS_PP_NON_OPTIONAL(__VA_ARGS__), CHAOS_PP_PACK_OPTIONAL(__VA_ARGS__)) \ /**/ # define CHAOS_PP_DELINEATE_SHIFTED_X_S_ CHAOS_PP_LAMBDA(CHAOS_PP_DELINEATE_SHIFTED_X_S_ID)() # else # define CHAOS_PP_DELINEATE_SHIFTED_X_S(s, size, count, sep, macro, data) CHAOS_IP_DELINEATE_SHIFTED_X_U(s, size, count, sep, macro, (data)) # endif # # define CHAOS_PP_DELINEATE_SHIFTED_X_S_ID() CHAOS_PP_DELINEATE_SHIFTED_X_S # # define CHAOS_IP_DELINEATE_SHIFTED_X_U(s, size, count, sep, macro, pd) \ CHAOS_IP_DELINEATE_SHIFTED_X_I( \ CHAOS_PP_NEXT(s), (CHAOS_PP_NEXT(s)), CHAOS_PP_FIXED_S(s, size), \ CHAOS_PP_DEC(count), CHAOS_PP_EMPTY, sep, macro, CHAOS_PP_CALL(macro), pd \ ) \ /**/ # define CHAOS_IP_DELINEATE_SHIFTED_X_INDIRECT() CHAOS_IP_DELINEATE_SHIFTED_X_I # define CHAOS_IP_DELINEATE_SHIFTED_X_I(s, jump, fix, count, s1, s2, macro, _m, pd) \ CHAOS_PP_IIF(CHAOS_PP_NOT_EQUAL(s, fix))( \ CHAOS_PP_IIF(CHAOS_PP_NOT_EQUAL(s, CHAOS_PP_PREV(fix)))( \ CHAOS_IP_DELINEATE_SHIFTED_X_II, CHAOS_IP_DELINEATE_SHIFTED_X_III \ ), \ CHAOS_IP_DELINEATE_SHIFTED_X_V \ )(CHAOS_PP_PHASE(0), s, jump, fix, count, s1, s2, macro, _m, pd) \ /**/ # define CHAOS_IP_DELINEATE_SHIFTED_X_II(_, s, jump, fix, count, s1, s2, macro, _m, pd) \ _(1, CHAOS_PP_EXPR_S)(s)( \ CHAOS_IP_DELINEATE_SHIFTED_X_III(_, s, (CHAOS_PP_NEXT(s)) jump, fix, count, s1, s2, macro, _m, pd) \ ) \ /**/ # define CHAOS_IP_DELINEATE_SHIFTED_X_III(_, s, jump, fix, count, s1, s2, macro, _m, pd) \ CHAOS_PP_IF(count)( \ CHAOS_IP_DELINEATE_SHIFTED_X_IV, CHAOS_PP_TUPLE_EAT(10) CHAOS_PP_OBSTRUCT() \ )(_, s, jump, fix, count, s1, s2, macro, _m, pd) \ /**/ # define CHAOS_IP_DELINEATE_SHIFTED_X_IV(_, s, jump, fix, count, s1, s2, macro, _m, pd) \ _(1, CHAOS_PP_EXPR_S)(s)(_(1, CHAOS_IP_DELINEATE_SHIFTED_X_INDIRECT)()( \ CHAOS_PP_NEXT(s), jump, fix, CHAOS_PP_DEC(count), s2, s2, macro, _m, pd \ )) \ _(0, _m)()(s, macro, count _(0, CHAOS_PP_EXPOSE)(pd)) _(1, s1)() \ /**/ # define CHAOS_IP_DELINEATE_SHIFTED_X_V(_, s, jump, fix, count, s1, s2, macro, _m, pd) \ CHAOS_IP_DELINEATE_SHIFTED_X_VI(CHAOS_PP_SEQ_HEAD(jump), CHAOS_PP_SEQ_TAIL(jump), fix, count, s1, s2, macro, _m, pd) \ /**/ # define CHAOS_IP_DELINEATE_SHIFTED_X_VI(s, jump, fix, count, s1, s2, macro, _m, pd) \ CHAOS_PP_IIF(CHAOS_PP_NOT_EQUAL(s, CHAOS_PP_PREV(fix)))( \ CHAOS_IP_DELINEATE_SHIFTED_X_II, CHAOS_IP_DELINEATE_SHIFTED_X_III \ )(CHAOS_PP_PHASE(1), s, CHAOS_PP_IIF(CHAOS_PP_SEQ_IS_NIL(jump))((s), jump), fix, count, s1, s2, macro, _m, pd) \ /**/ # # endif
// // NSString+GUID.h // FishLamp // // Created by Mike Fullerton on 6/3/11. // Copyright (c) 2013 GreenTongue Software LLC, Mike Fullerton. // The FishLamp Framework is released under the MIT License: http://fishlamp.com/license // #import "FLCocoaRequired.h" #import "FishLampCore.h" @interface NSString (GUID) + (NSString*) guidString; + (NSString*) zeroGuidString; @end
#ifndef DBPROPHYSICSMASTER_EFFECTOR_WIND_H #define DBPROPHYSICSMASTER_EFFECTOR_WIND_H class Effector_Wind : public Effector { public: Effector_Wind(int id); virtual ~Effector_Wind(){}; virtual bool canHandleParticles(){return true;} virtual bool canHandleCloth(){return true;} virtual bool canHandleRagdoll(){return true;} #ifdef USINGMODULE_P virtual void onUpdateParticles(); #endif #ifdef USINGMODULE_C virtual void onUpdateCloth(); #endif #ifdef USINGMODULE_R virtual void onUpdateRagdoll(); #endif virtual int childClassID(){return classID;} //static const int classID='WIND'; //int classID; static const int classID; void setAmount(const Vector3& amt) { wind=amt; windSizeSqr=wind.MagSqr(); } private: Vector3 wind; float windSizeSqr; }; EFFECTOR_PLUGIN_INTERFACE(Effector_Wind); #endif
#ifndef MODEL_COLLECTION_CHAINITERATOR_H #define MODEL_COLLECTION_CHAINITERATOR_H #include <iostream> #include "chainelement.h" #include "../../Model/Node/abstractnode.h" using namespace Model::Node; using namespace std; namespace Model { namespace Collection { template <typename T> class Chain; /** * Iterator for collection of chains */ template <typename T> class ChainIterator { public: ChainIterator(Chain<T> *chain) { this->chain = chain; position = 0; currentChainElement = NULL; isIterationStarted = false; } T current() { return NULL == currentChainElement ? NULL : currentChainElement->getContent(); } ChainElement<T> *getCurrentChainElement() { return currentChainElement; } T next() { if(position == chain->getSize()) return NULL; if(true == isIterationStarted && NULL != currentChainElement) { currentChainElement = currentChainElement->getNext(); position++; } else { position = 0; isIterationStarted = true; currentChainElement = chain->getFirstChainElement(); } if(NULL == currentChainElement) return NULL; return current(); } void removeCurrent() { if(NULL == currentChainElement) return; if(NULL != currentChainElement->getNext()) currentChainElement->getNext()->setPrevious(currentChainElement->getPrevious()); if(NULL != currentChainElement->getPrevious()) currentChainElement->getPrevious()->setNext(currentChainElement->getNext()); if(chain->getFirstChainElement() == currentChainElement) chain->setFirstChainElement(currentChainElement->getNext()); if(chain->getLastChainElement() == currentChainElement) chain->setLastChainElement(currentChainElement->getPrevious()); ChainElement<T> *previous = currentChainElement->getPrevious(); delete currentChainElement; if(NULL == previous) { position = 0; isIterationStarted = false; currentChainElement = chain->getFirstChainElement(); } else { currentChainElement = previous; } chain->setSize(chain->getSize() - 1); if(0 < position) position--; if(0 == chain->getSize()) { isIterationStarted = false; position = 0; currentChainElement = NULL; } } void replaceCurrent(T newObject) { if(NULL == currentChainElement) return; ChainElement<T> *previous = currentChainElement->getPrevious(); ChainElement<T> *next = currentChainElement->getNext(); ChainElement<T> *newElement = new ChainElement<T>(newObject); newElement->setPrevious(previous); if(NULL != previous) { previous->setNext(newElement); } newElement->setNext(next); if(NULL != next) { next->setPrevious(newElement); } if(chain->getFirstChainElement() == currentChainElement) { chain->setFirstChainElement(newElement); } if(chain->getLastChainElement() == currentChainElement) { chain->setLastChainElement(newElement); } currentChainElement->setPrevious(NULL); currentChainElement->setNext(NULL); delete currentChainElement; currentChainElement = newElement; } bool hasNext() { if(false == isIterationStarted) { return (0 < chain->getSize()); }; if(true == (currentChainElement && currentChainElement->getNext())) return true; return false; } protected: Chain<T> *chain; ChainElement<T> *currentChainElement; unsigned long long position; bool isIterationStarted; }; }} #include "chainiterator.cpp" #endif // MODEL_COLLECTION_CHAINITERATOR_H
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // // Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. #ifndef EIGEN_HASHMATRIX_H #define EIGEN_HASHMATRIX_H template<typename _Scalar, int _Flags> struct ei_traits<HashMatrix<_Scalar, _Flags> > { typedef _Scalar Scalar; enum { RowsAtCompileTime = Dynamic, ColsAtCompileTime = Dynamic, MaxRowsAtCompileTime = Dynamic, MaxColsAtCompileTime = Dynamic, Flags = SparseBit | _Flags, CoeffReadCost = NumTraits<Scalar>::ReadCost, SupportedAccessPatterns = RandomAccessPattern }; }; // TODO reimplement this class using custom linked lists template<typename _Scalar, int _Flags> class HashMatrix : public SparseMatrixBase<HashMatrix<_Scalar, _Flags> > { public: EIGEN_GENERIC_PUBLIC_INTERFACE(HashMatrix) class InnerIterator; protected: typedef typename std::map<int, Scalar>::iterator MapIterator; typedef typename std::map<int, Scalar>::const_iterator ConstMapIterator; public: inline int rows() const { return m_innerSize; } inline int cols() const { return m_data.size(); } inline const Scalar& coeff(int row, int col) const { const MapIterator it = m_data[col].find(row); if (it!=m_data[col].end()) return Scalar(0); return it->second; } inline Scalar& coeffRef(int row, int col) { return m_data[col][row]; } public: inline void startFill(int /*reserveSize = 1000 --- currently unused, don't generate a warning*/) {} inline Scalar& fill(int row, int col) { return coeffRef(row, col); } inline void endFill() {} ~HashMatrix() {} inline void shallowCopy(const HashMatrix& other) { EIGEN_DBG_SPARSE(std::cout << "HashMatrix:: shallowCopy\n"); // FIXME implement a true shallow copy !! resize(other.rows(), other.cols()); for (int j=0; j<this->outerSize(); ++j) m_data[j] = other.m_data[j]; } void resize(int _rows, int _cols) { if (cols() != _cols) { m_data.resize(_cols); } m_innerSize = _rows; } inline HashMatrix(int rows, int cols) : m_innerSize(0) { resize(rows, cols); } template<typename OtherDerived> inline HashMatrix(const MatrixBase<OtherDerived>& other) : m_innerSize(0) { *this = other.derived(); } inline HashMatrix& operator=(const HashMatrix& other) { if (other.isRValue()) { shallowCopy(other); } else { resize(other.rows(), other.cols()); for (int col=0; col<cols(); ++col) m_data[col] = other.m_data[col]; } return *this; } template<typename OtherDerived> inline HashMatrix& operator=(const MatrixBase<OtherDerived>& other) { return SparseMatrixBase<HashMatrix>::operator=(other); } protected: std::vector<std::map<int, Scalar> > m_data; int m_innerSize; }; template<typename Scalar, int _Flags> class HashMatrix<Scalar,_Flags>::InnerIterator { public: InnerIterator(const HashMatrix& mat, int col) : m_matrix(mat), m_it(mat.m_data[col].begin()), m_end(mat.m_data[col].end()) {} InnerIterator& operator++() { m_it++; return *this; } Scalar value() { return m_it->second; } int index() const { return m_it->first; } operator bool() const { return m_it!=m_end; } protected: const HashMatrix& m_matrix; typename HashMatrix::ConstMapIterator m_it; typename HashMatrix::ConstMapIterator m_end; }; #endif // EIGEN_HASHMATRIX_H
/* --COPYRIGHT--,BSD_EX * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************* * * MSP430 CODE EXAMPLE DISCLAIMER * * MSP430 code examples are self-contained low-level programs that typically * demonstrate a single peripheral function or device feature in a highly * concise manner. For this the code may rely on the device's power-on default * register values and settings such as the clock configuration and care must * be taken when combining code from several examples to avoid potential side * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware * for an API functional library-approach to peripheral configuration. * * --/COPYRIGHT--*/ //****************************************************************************** // MSP430F22x4 Demo - WDT, Toggle P1.0, Interval Overflow ISR, 32kHz ACLK // // Description: Toggle P1.0 using software timed by WDT ISR. Toggle rate is // exactly 250ms based on 32kHz ACLK WDT clock source. In this example the // WDT is configured to divide 32768 watch-crystal(2^15) by 2^13 with an ISR // triggered @ 4Hz. // ACLK = LFXT1 = 32768Hz, MCLK = SMCLK = default DCO ~1.2MHz // //* External watch crystal installed on XIN XOUT is required for ACLK *// // // MSP430F22x4 // ----------------- // /|\| XIN|- // | | | 32kHz // --|RST XOUT|- // | | // | P1.0|-->LED // // A. Dannenberg // Texas Instruments Inc. // April 2006 // Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.41A //****************************************************************************** #include <msp430.h> int main(void) { WDTCTL = WDT_ADLY_250; // WDT 250ms, ACLK, interval timer IE1 |= WDTIE; // Enable WDT interrupt P1DIR |= 0x01; // Set P1.0 to output direction __bis_SR_register(LPM3_bits + GIE); // Enter LPM3 w/interrupt } // Watchdog Timer interrupt service routine #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector = WDT_VECTOR __interrupt void watchdog_timer(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(WDT_VECTOR))) watchdog_timer (void) #else #error Compiler not supported! #endif { P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR }
/* * ev.c * * Created on: Jan 14, 2015 * Author: elisescu */ #include "ev.h" #include <stdlib.h> #ifndef _WIN32 #include <sys/select.h> #else #include <winsock2.h> #endif #include <errno.h> // PRIVATE DECLARATIONS enum { IO_PENDING_ADD, IO_PENDING_REMOVE }; typedef struct list { struct list *next; ev_io *io; } list_t; #define LIST(l) ((list_t*)(l)) #define LIST_NEW_EL(new_el, el_data) ((new_el) = malloc(sizeof(list_t)), (new_el)->io = (el_data), new_el) #define LIST_ITERATE(list) (list_t *el = LIST(list); el != NULL; el = el->next) #define LIST_ITERATOR() (el) #define SELECT_TIMEOUT_SEC (1) static list_t first_el = { .next = NULL, .io = NULL }; static struct ev_loop EV_DEFAULT_S = { .running = 0, .ev_ios = NULL, .no_fds = 0 }; void loop_add_io(struct ev_loop *loop, ev_io *io); void loop_remove_io(struct ev_loop *loop, ev_io *io); void loop_display_ios(struct ev_loop *loop); // PUBLIC API functions or declarations struct ev_loop *EV_DEFAULT = &EV_DEFAULT_S; int ev_io_init(ev_io *io, io_callbacks io_cb, int fd, int flag) { ev_vb("Init ev_io with fd = %d", fd); io->cb = io_cb; io->fd = fd; io->flags = flag; return EV_OK; } void ev_io_start(struct ev_loop *loop, ev_io *io) { ev_vb("Starting ev_io with fd = %d", io->fd); pthread_mutex_lock(&loop->mutex); loop_add_io(loop, io); pthread_mutex_unlock(&loop->mutex); #ifdef DEBUG ev_vb("Currently having %d io events in the loop: ", loop->no_fds); loop_display_ios(loop); #endif } void ev_io_stop(struct ev_loop *loop, ev_io *io) { ev_vb("Stopping ev_io with fd = %d", io->fd); pthread_mutex_lock(&loop->mutex); loop_remove_io(loop, io); pthread_mutex_unlock(&loop->mutex); #ifdef DEBUG ev_vb("Currently having %d io events in the loop: ", loop->no_fds); loop_display_ios(loop); #endif } void ev_run(struct ev_loop *loop, int flags) { ev_vb("Starting the loop"); ev_io** cbs; struct timeval tv; pthread_mutex_init(&loop->mutex, NULL); loop->running = 1; while (1) { pthread_mutex_lock(&loop->mutex); int r = loop->running; pthread_mutex_unlock(&loop->mutex); if (!r) { ev_vb("Stopping the loop..."); break; } FD_ZERO(&loop->readfds); FD_ZERO(&loop->writefds); pthread_mutex_lock(&loop->mutex); for (list_t *el = ((list_t*)(loop->ev_ios)); el != NULL; el = el->next) { if (el->io->flags | EV_READ) FD_SET(el->io->fd, &loop->readfds); if (el->io->flags | EV_WRITE) FD_SET(el->io->fd, &loop->writefds); } pthread_mutex_unlock(&loop->mutex); // wait for one or more socket being ready tv.tv_sec = SELECT_TIMEOUT_SEC; tv.tv_usec = 0; int rc= select(FD_SETSIZE, &loop->readfds, NULL, NULL, &tv); if (rc == 0) continue; if (rc < 0) { if (errno == EINTR) continue; ev_error("Error when doing select on our sockets"); perror("select"); return; } ev_vb("Got event on %d sockets out of %d monitoring", rc, loop->no_fds); // loop over our sockets cbs = (ev_io**) malloc(rc*sizeof(ev_io *)); int no = 0; pthread_mutex_lock(&loop->mutex); for (list_t *el = ((list_t*)(loop->ev_ios)); el != NULL; el = el->next) { if (FD_ISSET(el->io->fd, &loop->readfds) && el->io->flags | EV_READ) { cbs[no]=el->io; no++; } } pthread_mutex_unlock(&loop->mutex); for (int i = 0; i < no; i++) { ev_vb("Calling the callback for fd %d ", cbs[i]->fd); cbs[i]->cb(loop, cbs[i], 0); } free(cbs); } } void ev_break(struct ev_loop *loop, int how) { ev_vb("Stopping the loop"); pthread_mutex_lock(&loop->mutex); loop->running = 0; pthread_mutex_unlock(&loop->mutex); } // PRIVATE FUNCTIONS void loop_add_io(struct ev_loop *loop, ev_io *io) { // first element if (loop->no_fds == 0) { list_t *first_el = LIST_NEW_EL(first_el, io); first_el->next = NULL; loop->ev_ios = (void*) first_el; loop->no_fds = 1; } else { list_t *new_el = LIST_NEW_EL(new_el, io); new_el->next = LIST(loop->ev_ios); loop->ev_ios = (void *) new_el; loop->no_fds++; } } void loop_display_ios(struct ev_loop *loop) { for (list_t *el = LIST(loop->ev_ios); el != NULL; el = el->next) { ev_info("element: %d", el->io->fd); } } void loop_remove_io(struct ev_loop *loop, ev_io *io) { for (list_t *el = LIST(loop->ev_ios); el->next != NULL; el = el->next) { // found it in the middle if (el->next != NULL && el->next->io == io) { ev_vb("Found element after first pos. Removing it..."); list_t *ol = el->next; el->next = el->next->next; free(ol); loop->no_fds--; break; } else if (el->io == io) { // found it on the first pos ev_vb("Found element on the first pos. Removing it..."); list_t *ol = LIST(loop->ev_ios); loop->ev_ios = (void *) el->next; free(ol); loop->no_fds--; break; } } }
// Copyright (c) 2011-2020 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 SYSCOIN_QT_PSBTOPERATIONSDIALOG_H #define SYSCOIN_QT_PSBTOPERATIONSDIALOG_H #include <QDialog> #include <psbt.h> #include <qt/clientmodel.h> #include <qt/walletmodel.h> namespace Ui { class PSBTOperationsDialog; } /** Dialog showing transaction details. */ class PSBTOperationsDialog : public QDialog { Q_OBJECT public: explicit PSBTOperationsDialog(QWidget* parent, WalletModel* walletModel, ClientModel* clientModel); ~PSBTOperationsDialog(); void openWithPSBT(PartiallySignedTransaction psbtx); public Q_SLOTS: void signTransaction(); void broadcastTransaction(); void copyToClipboard(); void saveTransaction(); private: Ui::PSBTOperationsDialog* m_ui; PartiallySignedTransaction m_transaction_data; WalletModel* m_wallet_model; ClientModel* m_client_model; enum class StatusLevel { INFO, WARN, ERR }; size_t couldSignInputs(const PartiallySignedTransaction &psbtx); void updateTransactionDisplay(); std::string renderTransaction(const PartiallySignedTransaction &psbtx); void showStatus(const QString &msg, StatusLevel level); void showTransactionStatus(const PartiallySignedTransaction &psbtx); }; #endif // SYSCOIN_QT_PSBTOPERATIONSDIALOG_H
// // NSObject+Utility.h // CodingForiPad // // Created by zwm on 15/7/25. // Copyright (c) 2015年 coding. All rights reserved. // #import <Foundation/Foundation.h> @class CODataResponse; @interface NSObject (Utility) - (BOOL)checkDataResponse:(CODataResponse *)response; - (void)showAlert:(NSString *)title message:(NSString *)message; - (void)showError:(NSError *)error; - (void)showErrorInHudWithError:(NSError *)error; - (void)showErrorMessageInHud:(NSString *)error; - (void)showProgressHud; - (void)showProgressHudWithMessage:(NSString *)message; - (void)showSuccess:(NSString *)success; - (void)showErrorWithStatus:(NSString *)status; - (void)showInfoWithStatus:(NSString *)status; - (void)dismissProgressHud; // 老式的 - (id)handleResponse:(id)responseJSON; - (id)handleResponse:(id)responseJSON autoShowError:(BOOL)autoShowError; @end
// // HokutosaiTwitterViewController.h // Hokutosai // // Created by Shuka Takakuma on 2014/04/04. // Copyright (c) 2014年 Shuka Takakuma. All rights reserved. // #import <UIKit/UIKit.h> @interface HokutosaiTwitterViewController : UIViewController @end
#include "../framework.h" static const char *name = "who"; static const char *opt = "--who"; static const char *usage = " --who" " Show who is logged in\n" " (username, tty, from, login_time)\n"; static mod_info_t info[] = { {"username"}, {"tty"}, {"from"}, {"login_time"} }; static void collect_record(module_t *mod) { if (!list_empty(&mod->record_list)) list_del_init(&mod->record_list); // 只会保留最后一次查询结果 get_login_user(&mod->record_list); } static size_t record_to_str(module_t *mod) { login_user_t *entry = NULL; size_t ret = 0; if (list_empty(&mod->record_list)) return -1; list_for_each_entry(entry, &mod->record_list, list) ret += snprintf( mod->record + ret, LEN_1M, "%s=%s,%s,%s,%ld;\n", name, entry->user, entry->tty, entry->from, entry->login_time); return ret; } static void free_record_list(list_head_t *head) { login_user_t *tmp = NULL; login_user_t *entry = NULL; FREE_LIST_HEAD(entry, tmp, head, list); } void mod_who_register() { register_mod_fileds( name, info, opt, usage, STRUCT_ARRAY_SIZE(info), collect_record, record_to_str, free_record_list); }
#ifndef tests_h #define tests_h void list_tests(void); void vector_tests(void); void scanner_tests(void); void env_tests(void); void sb_tests(void); #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double Pods_HelloBerwin_TestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_HelloBerwin_TestsVersionString[];
// // AppDelegate.h // Example // // Created by Wu Kong on 8/6/16. // Copyright © 2016 wukong. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#pragma once #include "..\stklib\OfficeASE.h" class NetAseEx : public OfficeASE { protected: int m_Type; int m_Icon; TCHAR m_Name[32]; public: // Link information int LinkTo[10]; int LinkType[10]; int LinkCount; // Class for link condition class LinkCondition { public: int LinkFrom; int LinkTo; int LinkCount; int LinkType; } LinkCond[500]; int LinkCondCount; NetAseEx(); virtual ~NetAseEx(); int GetType(); void SetType(int); int GetIconId(); void SetIconId(int); TCHAR* GetName(); void SetName(TCHAR*); virtual void Action(ActorStatusElement**, int*, GameStatus*); virtual void DoubleClickAction(); virtual void PopupMenuInit(HMENU, ActorStatusElement**, int*); virtual void PopupMenuAction(int, int, int, ActorStatusElement**, int*); };
#import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> #import "CDZTracker.h" @interface CDZTrackerViewController : UITableViewController @property (nonatomic, strong) CDZTracker *tracker; // Designated initializer - (id)init; // called by somebody when the given location has been posted to the server - (void)tracker:(CDZTracker *)tracker didUpdateLocation:(CLLocation *)location; - (void)presentQueuedMessage; - (void)presentMessage:(NSString *)message withAppInForeground:(BOOL)inForeground; @end
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // EstimoteSDK #define COCOAPODS_POD_AVAILABLE_EstimoteSDK #define COCOAPODS_VERSION_MAJOR_EstimoteSDK 1 #define COCOAPODS_VERSION_MINOR_EstimoteSDK 3 #define COCOAPODS_VERSION_PATCH_EstimoteSDK 0 // MRProgress #define COCOAPODS_POD_AVAILABLE_MRProgress #define COCOAPODS_VERSION_MAJOR_MRProgress 0 #define COCOAPODS_VERSION_MINOR_MRProgress 4 #define COCOAPODS_VERSION_PATCH_MRProgress 1 // MRProgress/ActivityIndicator #define COCOAPODS_POD_AVAILABLE_MRProgress_ActivityIndicator #define COCOAPODS_VERSION_MAJOR_MRProgress_ActivityIndicator 0 #define COCOAPODS_VERSION_MINOR_MRProgress_ActivityIndicator 4 #define COCOAPODS_VERSION_PATCH_MRProgress_ActivityIndicator 1 // MRProgress/Blur #define COCOAPODS_POD_AVAILABLE_MRProgress_Blur #define COCOAPODS_VERSION_MAJOR_MRProgress_Blur 0 #define COCOAPODS_VERSION_MINOR_MRProgress_Blur 4 #define COCOAPODS_VERSION_PATCH_MRProgress_Blur 1 // MRProgress/Circular #define COCOAPODS_POD_AVAILABLE_MRProgress_Circular #define COCOAPODS_VERSION_MAJOR_MRProgress_Circular 0 #define COCOAPODS_VERSION_MINOR_MRProgress_Circular 4 #define COCOAPODS_VERSION_PATCH_MRProgress_Circular 1 // MRProgress/Helper #define COCOAPODS_POD_AVAILABLE_MRProgress_Helper #define COCOAPODS_VERSION_MAJOR_MRProgress_Helper 0 #define COCOAPODS_VERSION_MINOR_MRProgress_Helper 4 #define COCOAPODS_VERSION_PATCH_MRProgress_Helper 1 // MRProgress/Icons #define COCOAPODS_POD_AVAILABLE_MRProgress_Icons #define COCOAPODS_VERSION_MAJOR_MRProgress_Icons 0 #define COCOAPODS_VERSION_MINOR_MRProgress_Icons 4 #define COCOAPODS_VERSION_PATCH_MRProgress_Icons 1 // MRProgress/MessageInterceptor #define COCOAPODS_POD_AVAILABLE_MRProgress_MessageInterceptor #define COCOAPODS_VERSION_MAJOR_MRProgress_MessageInterceptor 0 #define COCOAPODS_VERSION_MINOR_MRProgress_MessageInterceptor 4 #define COCOAPODS_VERSION_PATCH_MRProgress_MessageInterceptor 1 // MRProgress/NavigationBarProgress #define COCOAPODS_POD_AVAILABLE_MRProgress_NavigationBarProgress #define COCOAPODS_VERSION_MAJOR_MRProgress_NavigationBarProgress 0 #define COCOAPODS_VERSION_MINOR_MRProgress_NavigationBarProgress 4 #define COCOAPODS_VERSION_PATCH_MRProgress_NavigationBarProgress 1 // MRProgress/Overlay #define COCOAPODS_POD_AVAILABLE_MRProgress_Overlay #define COCOAPODS_VERSION_MAJOR_MRProgress_Overlay 0 #define COCOAPODS_VERSION_MINOR_MRProgress_Overlay 4 #define COCOAPODS_VERSION_PATCH_MRProgress_Overlay 1 // MRProgress/Stopable #define COCOAPODS_POD_AVAILABLE_MRProgress_Stopable #define COCOAPODS_VERSION_MAJOR_MRProgress_Stopable 0 #define COCOAPODS_VERSION_MINOR_MRProgress_Stopable 4 #define COCOAPODS_VERSION_PATCH_MRProgress_Stopable 1 // MRProgress/WeakProxy #define COCOAPODS_POD_AVAILABLE_MRProgress_WeakProxy #define COCOAPODS_VERSION_MAJOR_MRProgress_WeakProxy 0 #define COCOAPODS_VERSION_MINOR_MRProgress_WeakProxy 4 #define COCOAPODS_VERSION_PATCH_MRProgress_WeakProxy 1
/* * File: Task_ObjectFollowing.h * Author: Jianing Chen * * Created on 04 November 2014, 21:37 */ #ifndef TASK_OBJECTFOLLOWING_H #define TASK_OBJECTFOLLOWING_H #include <el.h> #define TASK_OBJECT_RED 0 #define TASK_OBJECT_GREEN 1 #define TASK_OBJECT_BLUE 2 extern el_uint8 Task_ObjectColor; extern int vision_mass_red; extern int vision_bias_red; extern int vision_mass_green; extern int vision_bias_green; extern int vision_mass_blue; extern int vision_bias_blue; void Task_ObjectFollowing_Setup(); void Task_ObjectFollowing_Clear(); #endif /* TASK_OBJECTFOLLOWING_H */
/**************************************************************************** ** ** Copyright (C) 2015 Intel Corporation. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QNETWORKDATAGRAM_P_H #define QNETWORKDATAGRAM_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of the Network Access API. This header file may change from // version to version without notice, or even be removed. // // We mean it. // #include <QtNetwork/qhostaddress.h> QT_BEGIN_NAMESPACE class QIpPacketHeader { public: QIpPacketHeader(const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0) : destinationAddress(dstAddr), ifindex(0), hopLimit(-1), destinationPort(port) {} void clear() { senderAddress.clear(); destinationAddress.clear(); ifindex = 0; hopLimit = -1; } QHostAddress senderAddress; QHostAddress destinationAddress; uint ifindex; int hopLimit; quint16 senderPort; quint16 destinationPort; }; QT_END_NAMESPACE #endif // QNETWORKDATAGRAM_P_H
#pragma once #include "CM5/ListCtrlEx.h" #include "afxcmn.h" #include "afxdtctl.h" // CBacnetProgramDebug dialog class CBacnetProgramDebug : public CDialogEx { DECLARE_DYNAMIC(CBacnetProgramDebug) public: CBacnetProgramDebug(CWnd* pParent = NULL); // standard constructor virtual ~CBacnetProgramDebug(); // Dialog Data enum { IDD = IDD_DIALOG_BACNET_PROGRAM_DEBUG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: ListCtrlEx::CListCtrlEx m_program_debug_list; void Initial_List(unsigned int list_type); int Fresh_Program_List(unsigned int list_type); LRESULT Fresh_Program_Debug_Item(WPARAM wParam,LPARAM lParam); virtual BOOL OnInitDialog(); virtual BOOL PreTranslateMessage(MSG* pMsg); virtual void OnCancel(); afx_msg void OnClose(); afx_msg void OnNMClickListProgramDebug(NMHDR *pNMHDR, LRESULT *pResult); CDateTimeCtrl m_prg_debug_variable_time_picker; afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnNMKillfocusDatetimepickerPrgVariable(NMHDR *pNMHDR, LRESULT *pResult); };
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ /* * * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ #include "mpiimpl.h" /* -- Begin Profiling Symbol Block for routine MPI_Bsend_init */ #if defined(HAVE_PRAGMA_WEAK) #pragma weak MPI_Bsend_init = PMPI_Bsend_init #elif defined(HAVE_PRAGMA_HP_SEC_DEF) #pragma _HP_SECONDARY_DEF PMPI_Bsend_init MPI_Bsend_init #elif defined(HAVE_PRAGMA_CRI_DUP) #pragma _CRI duplicate MPI_Bsend_init as PMPI_Bsend_init #elif defined(HAVE_WEAK_ATTRIBUTE) int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) __attribute__((weak,alias("PMPI_Bsend_init"))); #endif /* -- End Profiling Symbol Block */ /* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build the MPI routines */ #ifndef MPICH_MPI_FROM_PMPI #undef MPI_Bsend_init #define MPI_Bsend_init PMPI_Bsend_init #endif #undef FUNCNAME #define FUNCNAME MPI_Bsend_init /*@ MPI_Bsend_init - Builds a handle for a buffered send Input Parameters: + buf - initial address of send buffer (choice) . count - number of elements sent (integer) . datatype - type of each element (handle) . dest - rank of destination (integer) . tag - message tag (integer) - comm - communicator (handle) Output Parameters: . request - communication request (handle) .N ThreadSafe .N Fortran .N Errors .N MPI_SUCCESS .N MPI_ERR_COMM .N MPI_ERR_COUNT .N MPI_ERR_TYPE .N MPI_ERR_RANK .N MPI_ERR_TAG .seealso: MPI_Buffer_attach @*/ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { static const char FCNAME[] = "MPI_Bsend_init"; int mpi_errno = MPI_SUCCESS; MPID_Request *request_ptr = NULL; MPID_Comm *comm_ptr = NULL; MPID_MPI_STATE_DECL(MPID_STATE_MPI_BSEND_INIT); MPIR_ERRTEST_INITIALIZED_ORDIE(); MPIU_THREAD_CS_ENTER(ALLFUNC,); MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_BSEND_INIT); /* Validate handle parameters needing to be converted */ # ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS; { MPIR_ERRTEST_COMM(comm, mpi_errno); } MPID_END_ERROR_CHECKS; } # endif /* HAVE_ERROR_CHECKING */ /* Convert MPI object handles to object pointers */ MPID_Comm_get_ptr( comm, comm_ptr ); /* Validate parameters if error checking is enabled */ # ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS; { MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE ); if (mpi_errno) goto fn_fail; MPIR_ERRTEST_COUNT(count, mpi_errno); MPIR_ERRTEST_DATATYPE(datatype, "datatype", mpi_errno); MPIR_ERRTEST_SEND_RANK(comm_ptr, dest, mpi_errno); MPIR_ERRTEST_SEND_TAG(tag, mpi_errno); MPIR_ERRTEST_ARGNULL(request,"request",mpi_errno); /* Validate datatype object */ if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) { MPID_Datatype *datatype_ptr = NULL; MPID_Datatype_get_ptr(datatype, datatype_ptr); MPID_Datatype_valid_ptr(datatype_ptr, mpi_errno); if (mpi_errno) goto fn_fail; MPID_Datatype_committed_ptr(datatype_ptr, mpi_errno); if (mpi_errno) goto fn_fail; } } MPID_END_ERROR_CHECKS; } # endif /* HAVE_ERROR_CHECKING */ /* ... body of routine ... */ mpi_errno = MPID_Bsend_init(buf, count, datatype, dest, tag, comm_ptr, MPID_CONTEXT_INTRA_PT2PT, &request_ptr); if (mpi_errno != MPI_SUCCESS) goto fn_fail; MPIR_SENDQ_REMEMBER(request_ptr, dest, tag, comm_ptr->context_id); /* return the handle of the request to the user */ MPIU_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle); /* ... end of body of routine ... */ fn_exit: MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_BSEND_INIT); MPIU_THREAD_CS_EXIT(ALLFUNC,); return mpi_errno; fn_fail: /* --BEGIN ERROR HANDLING-- */ # ifdef HAVE_ERROR_CHECKING { mpi_errno = MPIR_Err_create_code( mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_bsend_init", "**mpi_bsend_init %p %d %D %i %t %C %p", buf, count, datatype, dest, tag, comm, request); } # endif mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno ); goto fn_exit; /* --END ERROR HANDLING-- */ }
#ifndef ESCENA_H #define ESCENA_H #include <iostream> #include <vector> #include "objeto3D.h" class Escena { public: Escena(); ~Escena(); void Abrir(char* path); void Dibujar(); int getNumObjetos(); std::vector<Objeto3D> objetos; }; #endif // ESCENA_H
#ifndef INFO_MANAGER_H #define INFO_MANAGER_H #include <QObject> #include <Info/cpu_info.h> #include <Info/disk_info.h> #include <Info/memory_info.h> #include <Info/network_info.h> #include <Info/system_info.h> #include <Info/process_info.h> #include <Utils/format_util.h> class InfoManager { public: static InfoManager *ins(); quint8 getCpuCoreCount() const; QList<int> getCpuPercents() const; quint64 getSwapUsed() const; quint64 getSwapTotal() const; quint64 getMemUsed() const; quint64 getMemTotal() const; void updateMemoryInfo(); quint64 getRXbytes() const; quint64 getTXbytes() const; QList<Disk> getDisks() const; void updateDiskInfo(); QFileInfoList getCrashReports() const; QFileInfoList getAppLogs() const; QFileInfoList getAppCaches() const; void updateProcesses(); QList<Process> getProcesses() const; QString getUserName() const; private: InfoManager(); static InfoManager *_instance; private: CpuInfo ci; DiskInfo di; MemoryInfo mi; NetworkInfo ni; SystemInfo si; ProcessInfo pi; }; #endif // INFO_MANAGER_H
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Elements\0.11.3\Internal\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_FUSE_INTERNAL_I_IMAGE_CONTAINER_OWNER_H__ #define __APP_FUSE_INTERNAL_I_IMAGE_CONTAINER_OWNER_H__ #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Fuse { namespace Internal { ::uInterfaceType* IImageContainerOwner__typeof(); struct IImageContainerOwner { void(*__fp_OnParamChanged)(void*); void(*__fp_OnSizingChanged)(void*); void(*__fp_OnSourceChanged)(void*); static void OnParamChanged(::uObject* __this) { ((IImageContainerOwner*)uGetInterfacePtr(__this, IImageContainerOwner__typeof()))->__fp_OnParamChanged((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0)); } static void OnSizingChanged(::uObject* __this) { ((IImageContainerOwner*)uGetInterfacePtr(__this, IImageContainerOwner__typeof()))->__fp_OnSizingChanged((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0)); } static void OnSourceChanged(::uObject* __this) { ((IImageContainerOwner*)uGetInterfacePtr(__this, IImageContainerOwner__typeof()))->__fp_OnSourceChanged((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0)); } }; }}} #endif
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "UIButton.h" #import "FriendAsistSessionExt.h" @class CPushContact, NSString; @interface MMSayHelloButton : UIButton <FriendAsistSessionExt> { CPushContact *m_oLastVerifyContact; NSString *m_nsUsrName; unsigned int m_uiUnReadCount; double m_fHeight; } - (void).cxx_destruct; - (void)onFriendAssistUnreadCountChanged; - (unsigned int)GetUnReadCount; - (void)UpdateView; - (void)dealloc; - (id)initWithUsrName:(id)arg1 Height:(double)arg2; @end
/* :ts=4 * $VER: retroScreenToBitmap.c $Revision$ (27-Mar-2019) * * This file is part of retromode. * * Copyright (c) 2019 LiveForIt Software. * MIT License. * * $Id$ * * $Log$ * * */ #include <exec/exec.h> #include <proto/exec.h> #include <dos/dos.h> #include <exec/types.h> #include <libraries/retromode.h> #include <proto/retromode.h> #include <stdarg.h> #include <libbase.h> /****** retromode/main/retroScreenToBitmap ****************************************** * * NAME * retroScreenToBitmap -- Description * * SYNOPSIS * void retroScreenToBitmap(struct retroScreen * screen, int fromX, * int fromY, int width, int height, struct BitMap * bitmap, * int toX, int toY); * * FUNCTION * * INPUTS * screen - * fromX - * fromY - * width - * height - * bitmap - * toX - * toY - * * RESULT * This function does not return a result * * EXAMPLE * * NOTES * * BUGS * * SEE ALSO * ***************************************************************************** * */ void _retromode_retroScreenToBitmap(struct RetroModeIFace *Self, struct retroScreen * screen, int fromX, int fromY, int width, int height, struct BitMap * bitmap, int toX, int toY) { int x,y; APTR lock; unsigned char *BitMapMemory; uint32 BitMapBytesPerRow; uint32 BitMapWidth; uint32 BitMapHeight; unsigned char *src_memory; unsigned char *des_memory; unsigned char *inner_src_memory; unsigned char *inner_des_memory; BitMapWidth = GetBitMapAttr( bitmap, BMA_ACTUALWIDTH ); BitMapHeight = GetBitMapAttr( bitmap, BMA_HEIGHT ); lock = LockBitMapTags( bitmap, LBM_BytesPerRow, &BitMapBytesPerRow, LBM_BaseAddress, &BitMapMemory, TAG_END); if (lock) { // handel negative clipping I think. if (fromX<0) { toX-=fromX; width+=fromX; fromX = 0;} // - & - is + if (fromY<0) { toY-=fromY; height+=fromY; fromY = 0;} // - & - is + if (toX<0) { fromX-=toX; width+=toX; toX = 0; } // - & - is + if (toY<0) { fromY-=toY; height+=toY; toY = 0; } // - & - is + // make sure realWidth is inside source, and destination if (toX+width>BitMapWidth) width = BitMapWidth - toX; if (fromX+width>screen->realWidth) width = screen->realWidth - fromX; // make sure realHeight is inside source, and destination if (toY+height>BitMapHeight) height = BitMapHeight - toY; if (fromY+height>screen->realHeight) height = screen->realHeight - fromY; // we now know the limit, we can now do the job, safely. des_memory = BitMapMemory + (BitMapBytesPerRow * toY) + toX; src_memory = screen -> Memory[ screen -> double_buffer_draw_frame ] + (screen -> realWidth * fromY) + fromX; for(y=0;y<height;y++) { inner_src_memory = src_memory; inner_des_memory = des_memory; for(x=0;x<width;x++) { *inner_des_memory++ = *inner_src_memory++; } src_memory += screen -> realWidth; des_memory += BitMapBytesPerRow; } UnlockBitMap( lock ); } }
/* Dokan : user-mode file system library for Windows Copyright (C) 2008 Hiroki Asakawa info@dokan-dev.net http://dokan-dev.net/en This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 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 Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define WIN32_NO_STATUS #include <windows.h> #undef WIN32_NO_STATUS #include <ntstatus.h> #include <stdio.h> #include "dokani.h" ULONG DOKANAPI DokanVersion() { return DOKAN_VERSION; } ULONG DOKANAPI DokanDriverVersion() { ULONG version = 0; ULONG ret = 0; if (SendToDevice(DOKAN_GLOBAL_DEVICE_NAME, IOCTL_TEST, NULL, // InputBuffer 0, // InputLength &version, // OutputBuffer sizeof(ULONG), // OutputLength &ret)) { return version; } return STATUS_SUCCESS; }
#include "bliss.h" // We map 16-bits values onto the histogram static const int HISTOGRAM_SIZE = 32769; // Number of passes in histogram smoothing static const int N_PASSES = 300; // Limits of the integral on the histogram static const int INTEGRAL_INF = 0; static const int INTEGRAL_SUP = 2000; float bl_amplitude_sort(struct bl_song const * const song) { // Start and end offsets of the data in the sample_array int start; int end; // Histogram array float histogram[HISTOGRAM_SIZE]; // Smoothed histogram array float histogram_smooth[HISTOGRAM_SIZE]; // Integral of the histogram float histogram_integral = 0; // Zero initialize histograms for(int i = 0; i < HISTOGRAM_SIZE; ++i) { histogram[i] = 0.; histogram_smooth[i] = 0.; } // Fill-in histograms // Find beginning of data for(start = 0; ((int16_t*)song->sample_array)[start] == 0; ++start) ; // Find end of data for(end = song->nSamples - 1; ((int16_t*)song->sample_array)[end] == 0; --end) ; // Add values to the histogram int16_t* p16 = (int16_t*)song->sample_array + start; for(int i = start; i <= end; ++i) { histogram[abs(*p16)] += 1; ++p16; } // Compute smoothed histogram with a FIR filter for(int g = 0; g <= N_PASSES; ++g) { histogram_smooth[0] = histogram[0]; histogram_smooth[1] = 1. / 4. * ( histogram[0] + (2 * histogram[1]) + histogram[2] ); histogram_smooth[2] = 1. / 9. * ( histogram[0] + (2 * histogram[1]) + (3 * histogram[2]) + (2 * histogram[3]) + histogram[4] ); for(int i = 3; i < HISTOGRAM_SIZE - 5; ++i) { histogram_smooth[i] = 1. / 27. * ( histogram[i-3] + (3 * histogram[i-2]) + (6 * histogram[i-1]) + (7 * histogram[i]) + (6 * histogram[i+1]) + (3 * histogram[i+2]) + histogram[i+3] ); } for(int i = 3; i < HISTOGRAM_SIZE - 5; ++i) { histogram[i] = histogram_smooth[i]; } } // Normalize it (optional) for(int i = 0; i < HISTOGRAM_SIZE; ++i) { histogram_smooth[i] /= (start - end); histogram_smooth[i] *= 100.; histogram_smooth[i] = fabs(histogram_smooth[i]); } // Compute integral of the smoothed histogram for(int i = INTEGRAL_INF; i <= INTEGRAL_SUP; ++i) { histogram_integral += histogram_smooth[i]; } // Return final score, weighted by coefficients in order to have -4 for a panel of calm songs, // and 4 for a panel of loud songs. (only useful if you want an absolute « Loud » and « Calm » result return (-0.2f * histogram_integral + 6.0f); }
// // XMNShareView.h // XMNShareMenuExample // // Created by XMFraker on 16/1/25. // Copyright © 2016年 XMFraker. All rights reserved. // #import <UIKit/UIKit.h> typedef void(^XMNSelectedBlock)(NSUInteger tag,NSString *title); @interface XMNShareView : UIView /** * shareContentView的头部view 默认nil */ @property (nonatomic, strong) UIView *headerView; /** * shareContentView的底部view 默认nil */ @property (nonatomic, strong) UIView *footerView; /** 默认每行显示的数量 最多两行超过的均在第二行显示 默认9 */ @property (nonatomic, assign) NSUInteger itemsPerLine; @property (nonatomic, copy) void(^selectedBlock)(NSUInteger tag, NSString *title); /** * 显示shareView * * @param animated 是否使用动画 */ - (void)showUseAnimated:(BOOL)animated; /** * 隐藏shareView * * @param animated 是否使用动画 */ - (void)dismissUseAnimated:(BOOL)animated; /** * 初始化shareView * * @param items 需要显示的item的array */ - (void)setupShareViewWithItems:(NSArray *)items; @end
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double ScanTouchVersionNumber; FOUNDATION_EXPORT const unsigned char ScanTouchVersionString[];
#ifndef ILOGGER_H #define ILOGGER_H #include <string> namespace Drivers { class ILogger { public: virtual void log(std::string out) = 0; virtual void log(std::string out, std::string info) = 0; }; } #endif
// // YYIViewController.h // DYSHelpers // // Created by 丁玉松 on 07/30/2015. // Copyright (c) 2015 丁玉松. All rights reserved. // @import UIKit; @interface YYIViewController : UIViewController @end
#include "misc.h" #include <stdint.h> /* CONVENTIONS: All data structures for stacks have the prefix */ /* "stk_" to prevent name conflicts. */ /* */ /* Function names: Each word in a function name begins with */ /* a capital letter. An example funcntion name is */ /* CreateRedTree(a,b,c). Furthermore, each function name */ /* should begin with a capital letter to easily distinguish */ /* them from variables. */ /* */ /* Variable names: Each word in a variable name begins with */ /* a capital letter EXCEPT the first letter of the variable */ /* name. For example, int newLongInt. Global variables have */ /* names beginning with "g". An example of a global */ /* variable name is gNewtonsConstant. */ /* if DATA_TYPE is undefined then stack.h and stack.c will be code for */ /* stacks of void *, if they are defined then they will be stacks of the */ /* appropriate data_type */ #ifndef DATA_TYPE #define DATA_TYPE void * #endif typedef struct stk_stack_node { DATA_TYPE info; struct stk_stack_node * next; } stk_stack_node; typedef struct stk_stack { stk_stack_node * top; stk_stack_node * tail; int64_t stackSize; } stk_stack ; /* These functions are all very straightforward and self-commenting so */ /* I didn't think additional comments would be useful */ stk_stack * StackJoin(stk_stack * stack1, stk_stack * stack2); stk_stack * StackCreate(); void StackPush(stk_stack * theStack, DATA_TYPE newInfoPointer); void * StackPop(stk_stack * theStack); int StackNotEmpty(stk_stack *);
#ifndef __IPYKERNEL_PROFILE_H__ #define __IPYKERNEL_PROFILE_H__ typedef struct Profile { char* ip; char* transport; int iopub_port; int shell_port; int control_port; int stdin_port; int hb_port; char* key; char* signature_scheme; } Profile; void init_profile(Profile* profile, const char* existing); void free_profile(Profile* profile); #endif // __IPYKERNEL_PROFILE_H__
/************************************************************************** * * \file * * \brief Management of the USB host mass-storage task. * * This file manages the USB host mass-storage task. * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page 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. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * ***************************************************************************/ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef _HOST_MASS_STORAGE_TASK_H_ #define _HOST_MASS_STORAGE_TASK_H_ //_____ I N C L U D E S ____________________________________________________ #include "conf_usb.h" #if USB_HOST_FEATURE == false #error host_mass_storage_task.h is #included although USB_HOST_FEATURE is disabled #endif #include "usb_host_task.h" //_____ M A C R O S ________________________________________________________ #define Is_host_ms_configured() (ms_connected && !Is_host_suspended()) //_____ D E F I N I T I O N S ______________________________________________ //_____ D E C L A R A T I O N S ____________________________________________ extern volatile bool ms_connected; extern void host_mass_storage_task_init(void); #ifdef FREERTOS_USED extern void host_mass_storage_task(void *pvParameters); #else extern void host_mass_storage_task(void); #endif extern void host_sof_action(void); #endif // _HOST_MASS_STORAGE_TASK_H_
/** * @file * @author Denise Ratasich * @date 14.10.2013 * * @brief Header file of sampling methods. */ #ifndef __ESTIMATION_SAMPLING_H__ #define __ESTIMATION_SAMPLING_H__ #include <Eigen/Dense> using namespace Eigen; namespace probability { /** * @brief Samples a random vector with normal distribution. * * @param mean The mean of the normal distribution. * @param covariance The covariance of the normal distribution. * @return The sample x ~ N(mean,covariance). * * @note When sampling with non-diagonal covariance this function * might be inefficient (Cholesky decomposition is applied everytime * the covariance changes). * @note The covariance must be symmetric and positive definite. */ VectorXd sampleNormalDistribution(VectorXd mean, MatrixXd covariance); /** * @brief Samples a random vector with uniform distribution. * * The probability of a continious uniform distribution is * \f$1/|R|\f$ for each sample, where \f$R \subseteq R^N\f$ is the * region under the pdf. * * @param a The lower bound of the uniform distribution. * @param b The upper bound of the uniform distribution. * @return The sample x ~ U(a,b). * * @note The random variables are assumed to be independent, * i.e. each sample is constructed of random numbers in between the * given bounds a and b. In the two-dimensional case this means the * area where x can occur is a rectangle, and can't be e.g. a * circle. */ VectorXd sampleUniformDistribution(VectorXd a, VectorXd b); } #endif
#ifndef LOFILE_H #define LOFILE_H #include "types.h" namespace Overlay { static const int Attack = 0; static const int Damage = 1; static const int Special = 2; static const int Land = 3; static const int Liftoff = 4; static const int Shields = 5; } class LoFile { public: static LoFile GetOverlay(ImageType image_id, int type); Point32 GetValues(Image *img, int index); Point GetPosition(Image *img, int index); void SetImageOffset(Image *img); bool IsValid() const { return addr != nullptr; } private: LoFile(void * addr_) { addr = (int8_t *)addr_; } int8_t *addr; }; #endif // LOFILE_H
#pragma once #include "Field.h" #include "Particle.h" class MagneticField: public Field { double _force; public: /////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////// MagneticField(int id); /////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////// void setForce(double force); double getForce(); /////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////// void applyForce (Particle* pParticle); };
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "DYAnalyzerFinding.h" @interface DYAnalyzerFinding (GPUDYAnalyzerFindingAdditions) @property(readonly, nonatomic) BOOL isRedundantOrInefficientState; @property(readonly, nonatomic) unsigned long long severity; @property(readonly, nonatomic) int issueType; @end
// // LCDComputerSystemCh2ViewController.h // LHiOSAccumulatesInObjectiveC // // Created by lihui on 2017/6/25. // Copyright © 2017年 Lihux. All rights reserved. // #import "LCViewController.h" @interface LCDComputerSystemCh2ViewController : LCViewController @end
#include "rbuv_timer.h" VALUE cRbuvTimer; struct rbuv_timer_s { uv_timer_t *uv_handle; VALUE cb_on_close; VALUE cb_on_timeout; }; typedef struct rbuv_timer_s rbuv_timer_t; static VALUE rbuv_timer_alloc(VALUE klass); static void rbuv_timer_mark(rbuv_timer_t *rbuv_timer); static void rbuv_timer_free(rbuv_timer_t *rbuv_timer); /* Private methods */ static void rbuv_timer_on_timeout(uv_timer_t *uv_timer); static void rbuv_timer_on_timeout_no_gvl(uv_timer_t *uv_timer); VALUE rbuv_timer_alloc(VALUE klass) { rbuv_timer_t *rbuv_timer; rbuv_timer = malloc(sizeof(*rbuv_timer)); rbuv_handle_alloc((rbuv_handle_t *)rbuv_timer); rbuv_timer->cb_on_timeout = Qnil; return Data_Wrap_Struct(klass, rbuv_timer_mark, rbuv_timer_free, rbuv_timer); } void rbuv_timer_mark(rbuv_timer_t *rbuv_timer) { assert(rbuv_timer); rbuv_handle_mark((rbuv_handle_t *)rbuv_timer); rb_gc_mark(rbuv_timer->cb_on_timeout); } void rbuv_timer_free(rbuv_timer_t *rbuv_timer) { assert(rbuv_timer); RBUV_DEBUG_LOG_DETAIL("rbuv_timer: %p, uv_handle: %p", rbuv_timer, rbuv_timer->uv_handle); rbuv_handle_free((rbuv_handle_t *)rbuv_timer); } /* * @overload initialize(loop=nil) * Create a new handle that fires on specified timeouts. * * @param loop [Rbuv::Loop, nil] loop object where this handle runs, if it is * +nil+ then it the runs the handle in the {Rbuv::Loop.default} * @return [Rbuv::Timer] */ static VALUE rbuv_timer_initialize(int argc, VALUE *argv, VALUE self) { VALUE loop; rbuv_timer_t *rbuv_timer; rbuv_loop_t *rbuv_loop; int uv_ret; rb_scan_args(argc, argv, "01", &loop); if (loop == Qnil) { loop = rbuv_loop_s_default(cRbuvLoop); } Data_Get_Struct(self, rbuv_timer_t, rbuv_timer); Data_Get_Struct(loop, rbuv_loop_t, rbuv_loop); rbuv_timer->uv_handle = malloc(sizeof(*rbuv_timer->uv_handle)); uv_ret = uv_timer_init(rbuv_loop->uv_handle, rbuv_timer->uv_handle); if (uv_ret < 0) { free(rbuv_timer->uv_handle); rbuv_timer->uv_handle = NULL; rb_raise(eRbuvError, "%s", uv_strerror(uv_ret)); } rbuv_timer->uv_handle->data = (void *)self; return self; } /* * @overload start(timeout, repeat) * Start the timer. * @param timeout [Number] the timeout in millisecond. * @param repeat [Number] the repeat interval in millisecond. * @yieldparam timer [self] itself * @return [self] itself */ VALUE rbuv_timer_start(VALUE self, VALUE timeout, VALUE repeat) { VALUE block; uint64_t uv_timeout; uint64_t uv_repeat; rbuv_timer_t *rbuv_timer; rb_need_block(); block = rb_block_proc(); uv_timeout = NUM2ULL(timeout); uv_repeat = NUM2ULL(repeat); Data_Get_Handle_Struct(self, rbuv_timer_t, rbuv_timer); rbuv_timer->cb_on_timeout = block; RBUV_DEBUG_LOG_DETAIL("rbuv_timer: %p, uv_handle: %p, rbuv_timer_on_timeout: %p, timer: %s", rbuv_timer, rbuv_timer->uv_handle, rbuv_timer_on_timeout, RSTRING_PTR(rb_inspect(self))); uv_timer_start(rbuv_timer->uv_handle, rbuv_timer_on_timeout, uv_timeout, uv_repeat); return self; } /* * Stop the timer. * * @return [self] itself */ VALUE rbuv_timer_stop(VALUE self) { rbuv_timer_t *rbuv_timer; Data_Get_Handle_Struct(self, rbuv_timer_t, rbuv_timer); uv_timer_stop(rbuv_timer->uv_handle); return self; } VALUE rbuv_timer_repeat_get(VALUE self) { rbuv_timer_t *rbuv_timer; VALUE repeat; Data_Get_Handle_Struct(self, rbuv_timer_t, rbuv_timer); repeat = ULL2NUM(uv_timer_get_repeat(rbuv_timer->uv_handle)); return repeat; } VALUE rbuv_timer_repeat_set(VALUE self, VALUE repeat) { rbuv_timer_t *rbuv_timer; uint64_t uv_repeat; uv_repeat = NUM2ULL(repeat); Data_Get_Handle_Struct(self, rbuv_timer_t, rbuv_timer); uv_timer_set_repeat(rbuv_timer->uv_handle, uv_repeat); return repeat; } void rbuv_timer_on_timeout(uv_timer_t *uv_timer) { rb_thread_call_with_gvl((rbuv_rb_blocking_function_t) rbuv_timer_on_timeout_no_gvl, uv_timer); } void rbuv_timer_on_timeout_no_gvl(uv_timer_t *uv_timer) { VALUE timer; rbuv_timer_t *rbuv_timer; timer = (VALUE)uv_timer->data; Data_Get_Handle_Struct(timer, struct rbuv_timer_s, rbuv_timer); rb_funcall(rbuv_timer->cb_on_timeout, id_call, 1, timer); } void Init_rbuv_timer() { cRbuvTimer = rb_define_class_under(mRbuv, "Timer", cRbuvHandle); rb_define_alloc_func(cRbuvTimer, rbuv_timer_alloc); rb_define_method(cRbuvTimer, "initialize", rbuv_timer_initialize, -1); rb_define_method(cRbuvTimer, "start", rbuv_timer_start, 2); rb_define_method(cRbuvTimer, "stop", rbuv_timer_stop, 0); rb_define_method(cRbuvTimer, "repeat", rbuv_timer_repeat_get, 0); rb_define_method(cRbuvTimer, "repeat=", rbuv_timer_repeat_set, 1); } /* This have to be declared after Init_* so it can replace YARD bad assumption * for parent class beeing RbuvHandle not Rbuv::Handle. * Also it need some text after document-class statement otherwise YARD won't * parse it */ /* * Document-class: Rbuv::Timer < Rbuv::Handle * A Timer handle will run the supplied callback after the specified amount of * seconds. * * @!attribute [rw] repeat * @note If the +repeat+ value is set from a timer callback it does not * immediately take effect. If the timer was non-repeating before, it will * have been stopped. If it was repeating, then the old repeat value will * have been used to schedule the next timeout. * @return [Number] the repeat interval in millisecond. */