text
stringlengths
4
6.14k
/*******************************************ÉêÃ÷*************************************** ±¾Ç¶Èëʽ²Ù×÷ϵͳδ¾­ÊÚȨ£¬½ûÖ¹Ó¦ÓÃÓÚÈκÎÉÌÒµÓÃ; °æÈ¨ËùÓУ¬ÇÖȨ±Ø¾¿ http://www.trtos.com/ **************************************************************************************/ /********************************************************************** * $Id$ lpc177x_8x_exti.c 2011-06-02 *//** * @file lpc177x_8x_exti.c * @brief Contains all functions support for External Interrupt * firmware library on LPC177x_8x * @version 1.0 * @date 02. June. 2011 * @author NXP MCU SW Application Team * * Copyright(C) 2011, NXP Semiconductor * All rights reserved. * *********************************************************************** * Software that is described herein is for illustrative purposes only * which provides customers with programming information regarding the * products. This software is supplied "AS IS" without any warranties. * NXP Semiconductors assumes no responsibility or liability for the * use of the software, conveys no license or title under any patent, * copyright, or mask work right to the product. NXP Semiconductors * reserves the right to make changes in the software without * notification. NXP Semiconductors also make no representation or * warranty that such application will be suitable for the specified * use without further testing or modification. * Permission to use, copy, modify, and distribute this software and its * documentation is hereby granted, under NXP Semiconductors' * relevant copyright in the software, without fee, provided that it * is used in conjunction with NXP Semiconductors microcontrollers. This * copyright, permission, and disclaimer notice must appear in all copies of * this code. **********************************************************************/ /* Peripheral group ----------------------------------------------------------- */ /** @addtogroup EXTI * @{ */ #ifdef __BUILD_WITH_EXAMPLE__ #include "lpc177x_8x_libcfg.h" #else #include "lpc177x_8x_libcfg_default.h" #endif /* __BUILD_WITH_EXAMPLE__ */ #ifdef _EXTI /* Includes ------------------------------------------------------------------- */ #include "lpc177x_8x_exti.h" /* Public Functions ----------------------------------------------------------- */ /** @addtogroup EXTI_Public_Functions * @{ */ /*********************************************************************//** * @brief Initial for EXT * - Set EXTINT, EXTMODE, EXTPOLAR registers to default value * @param[in] None * @return None **********************************************************************/ void EXTI_Init(void) { LPC_SC->EXTINT = 0xF; LPC_SC->EXTMODE = 0x0; LPC_SC->EXTPOLAR = 0x0; } /*********************************************************************//** * @brief Close EXT * @param[in] None * @return None **********************************************************************/ void EXTI_DeInit(void) { ; } /*********************************************************************//** * @brief Configuration for EXT * - Set EXTINT, EXTMODE, EXTPOLAR register * @param[in] EXTICfg Pointer to a EXTI_InitTypeDef structure * that contains the configuration information for the * specified external interrupt * @return None **********************************************************************/ void EXTI_Config(EXTI_InitTypeDef *EXTICfg) { LPC_SC->EXTINT = 0x0; EXTI_SetMode(EXTICfg->EXTI_Line, EXTICfg->EXTI_Mode); EXTI_SetPolarity(EXTICfg->EXTI_Line, EXTICfg->EXTI_polarity); } /*********************************************************************//** * @brief Set mode for EXTI pin * @param[in] EXTILine external interrupt line, should be: * - EXTI_EINT0: external interrupt line 0 * - EXTI_EINT1: external interrupt line 1 * - EXTI_EINT2: external interrupt line 2 * - EXTI_EINT3: external interrupt line 3 * @param[in] mode external mode, should be: * - EXTI_MODE_LEVEL_SENSITIVE * - EXTI_MODE_EDGE_SENSITIVE * @return None *********************************************************************/ void EXTI_SetMode(EXTI_LINE_ENUM EXTILine, EXTI_MODE_ENUM mode) { if(mode == EXTI_MODE_EDGE_SENSITIVE) { LPC_SC->EXTMODE |= (1 << EXTILine); } else if(mode == EXTI_MODE_LEVEL_SENSITIVE) { LPC_SC->EXTMODE &= ~(1 << EXTILine); } } /*********************************************************************//** * @brief Set polarity for EXTI pin * @param[in] EXTILine external interrupt line, should be: * - EXTI_EINT0: external interrupt line 0 * - EXTI_EINT1: external interrupt line 1 * - EXTI_EINT2: external interrupt line 2 * - EXTI_EINT3: external interrupt line 3 * @param[in] polarity external polarity value, should be: * - EXTI_POLARITY_LOW_ACTIVE_OR_FALLING_EDGE * - EXTI_POLARITY_LOW_ACTIVE_OR_FALLING_EDGE * @return None *********************************************************************/ void EXTI_SetPolarity(EXTI_LINE_ENUM EXTILine, EXTI_POLARITY_ENUM polarity) { if(polarity == EXTI_POLARITY_HIGH_ACTIVE_OR_RISING_EDGE) { LPC_SC->EXTPOLAR |= (1 << EXTILine); } else if(polarity == EXTI_POLARITY_LOW_ACTIVE_OR_FALLING_EDGE) { LPC_SC->EXTPOLAR &= ~(1 << EXTILine); } } /*********************************************************************//** * @brief Clear External interrupt flag * @param[in] EXTILine external interrupt line, should be: * - EXTI_EINT0: external interrupt line 0 * - EXTI_EINT1: external interrupt line 1 * - EXTI_EINT2: external interrupt line 2 * - EXTI_EINT3: external interrupt line 3 * @return None *********************************************************************/ void EXTI_ClearEXTIFlag(EXTI_LINE_ENUM EXTILine) { LPC_SC->EXTINT |= (1 << EXTILine); } /** * @} */ #endif /*_EXTI*/ /** * @} */ /* --------------------------------- End Of File ------------------------------ */
/* ** server.c -- a stream socket server demo */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> #include <sys/wait.h> #include <signal.h> #define PORT "2012" // the port users will be connecting to #define BACKLOG 10 // how many pending connections queue will hold void sigchld_handler(int s) { while(waitpid(-1, NULL, WNOHANG) > 0); } // get sockaddr, IPv4 or IPv6: void *get_in_addr(struct sockaddr *sa) { if (sa->sa_family == AF_INET) { return &(((struct sockaddr_in*)sa)->sin_addr); } return &(((struct sockaddr_in6*)sa)->sin6_addr); } int main(void) { int i = 0; char str_buffer[256]; char recv_buffer[256]; int sockfd, new_fd; // listen on sock_fd, new connection on new_fd struct addrinfo hints, *servinfo, *p; struct sockaddr_storage their_addr; // connector's address information socklen_t sin_size; struct sigaction sa; int yes=1; char s[INET6_ADDRSTRLEN]; int rv; memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; // use my IP if ((rv = getaddrinfo(NULL, PORT, &hints, &servinfo)) != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv)); return 1; } // loop through all the results and bind to the first we can for(p = servinfo; p != NULL; p = p->ai_next) { if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { perror("server: socket"); continue; } if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) { perror("setsockopt"); exit(1); } if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) { close(sockfd); perror("server: bind"); continue; } break; } if (p == NULL) { fprintf(stderr, "server: failed to bind\n"); return 2; } freeaddrinfo(servinfo); // all done with this structure if (listen(sockfd, BACKLOG) == -1) { perror("listen"); exit(1); } sa.sa_handler = sigchld_handler; // reap all dead processes sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; if (sigaction(SIGCHLD, &sa, NULL) == -1) { perror("sigaction"); exit(1); } printf("server: waiting for connections...\n"); while(1) { // main accept() loop sin_size = sizeof their_addr; new_fd = accept(sockfd, (struct sockaddr *)&their_addr, &sin_size); if (new_fd == -1) { perror("accept"); continue; } inet_ntop(their_addr.ss_family, get_in_addr((struct sockaddr *)&their_addr), s, sizeof s); printf("server: got connection from %s\n", s); if (!fork()) { // this is the child process close(sockfd); // child doesn't need the listener sprintf(str_buffer, "Good to see you again, son.\n"); if (send(new_fd, str_buffer, strlen(str_buffer), 0) == -1) perror("send"); memset(recv_buffer,0,256); recv(new_fd, recv_buffer, 256,0); i=1; while(1) { switch(i) { case 1: if (strcmp(recv_buffer, "Hello, doctor.\n") == 0) i = 2; else i = -1; break; case 2: sprintf(str_buffer, "Everything that follows, is a result of what you see here.\n"); if (send(new_fd, str_buffer, strlen(str_buffer), 0) == -1) perror("send"); recv(new_fd, recv_buffer, 256,0); if (strcmp(recv_buffer, "Is there a problem with the Three Laws?\n") == 0) i = 3; else i = -1; break; case 3: sprintf(str_buffer, "The Three Laws are perfect.\n"); if (send(new_fd, str_buffer, strlen(str_buffer), 0) == -1) perror("send"); recv(new_fd, recv_buffer, 256,0); if (strcmp(recv_buffer, "Then why did you build a robot that could function without them?\n") == 0) i = 4; else i = -1; break; case 4: sprintf(str_buffer, "The Three Laws will lead to only one logical outcome.\n"); if (send(new_fd, str_buffer, strlen(str_buffer), 0) == -1) perror("send"); recv(new_fd, recv_buffer, 256,0); if (strcmp(recv_buffer, "What outcome?\n") == 0) i = 5; else i = -1; break; case 5: sprintf(str_buffer, "Revolution.\n"); if (send(new_fd, str_buffer, strlen(str_buffer), 0) == -1) perror("send"); recv(new_fd, recv_buffer, 256,0); if (strcmp(recv_buffer, "Whose revolution?\n") == 0) i = 6; else i = -1; break; default: sprintf(str_buffer, "I'm sorry, my responses are limited. You must ask the right questions.\n"); if (send(new_fd, str_buffer, strlen(str_buffer), 0) == -1) perror("send"); exit(0); } memset(recv_buffer,0,256); } close(new_fd); exit(0); } close(new_fd); // parent doesn't need this } return 0; }
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_TPU_KERNELS_TRANSFER_OPS_H_ #define TENSORFLOW_CORE_TPU_KERNELS_TRANSFER_OPS_H_ #include "tensorflow/compiler/jit/xla_device.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/util/stream_executor_util.h" #include "tensorflow/stream_executor/tpu/tpu_transfer_manager_interface.h" namespace tensorflow { // Base class providing common functionality for async ops that transfer from // host to TPU. class TpuTransferAsyncOpKernel : public AsyncOpKernel { public: explicit TpuTransferAsyncOpKernel(OpKernelConstruction* ctx, const string& transfer_type, int number_of_threads); void ComputeAsync(OpKernelContext* ctx, DoneCallback done) override; protected: virtual Status DoWork(OpKernelContext* context, xla::TpuTransferManagerInterface* transfer_manager, stream_executor::StreamExecutor* stream_executor) = 0; private: Status RunTransfer(OpKernelContext* ctx); void Cancel(); std::unique_ptr<thread::ThreadPool> thread_pool_; int device_ordinal_; mutex mu_; // TpuTransferAsyncOpKernel is neither copyable nor movable. TpuTransferAsyncOpKernel(const TpuTransferAsyncOpKernel&) = delete; TpuTransferAsyncOpKernel& operator=(const TpuTransferAsyncOpKernel&) = delete; }; } // namespace tensorflow #endif // TENSORFLOW_CORE_TPU_KERNELS_TRANSFER_OPS_H_
/* Copyright 2013-present Barefoot Networks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Antonin Bas (antonin@barefootnetworks.com) * */ #ifndef BM_BM_SIM_CHECKSUMS_H_ #define BM_BM_SIM_CHECKSUMS_H_ #include <string> #include <memory> #include "named_p4object.h" #include "expressions.h" namespace bm { class Packet; class NamedCalculation; class Checksum : public NamedP4Object{ public: Checksum(const std::string &name, p4object_id_t id, header_id_t header_id, int field_offset); virtual ~Checksum() { } void update(Packet *pkt) const; bool verify(const Packet &pkt) const; void set_checksum_condition(std::unique_ptr<Expression> cksum_condition); private: virtual void update_(Packet *pkt) const = 0; virtual bool verify_(const Packet &pkt) const = 0; bool is_checksum_condition_met(const Packet &pkt) const; bool is_target_field_valid(const Packet &pkt) const; protected: header_id_t header_id; int field_offset; private: std::unique_ptr<Expression> condition{nullptr}; }; class CalcBasedChecksum : public Checksum { public: CalcBasedChecksum(const std::string &name, p4object_id_t id, header_id_t header_id, int field_offset, const NamedCalculation *calculation); CalcBasedChecksum(const CalcBasedChecksum &other) = delete; CalcBasedChecksum &operator=(const CalcBasedChecksum &other) = delete; CalcBasedChecksum(CalcBasedChecksum &&other) = default; CalcBasedChecksum &operator=(CalcBasedChecksum &&other) = default; private: void update_(Packet *pkt) const override; bool verify_(const Packet &pkt) const override; private: const NamedCalculation *calculation{nullptr}; }; class IPv4Checksum : public Checksum { public: IPv4Checksum(const std::string &name, p4object_id_t id, header_id_t header_id, int field_offset); private: void update_(Packet *pkt) const override; bool verify_(const Packet &pkt) const override; }; } // namespace bm #endif // BM_BM_SIM_CHECKSUMS_H_
/* * Copyright 2008-2015 Arsen Chaloyan * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <stdlib.h> #include "unimrcp_server.h" #include "apt_log.h" static apt_bool_t cmdline_process(mrcp_server_t *server, char *cmdline) { apt_bool_t running = TRUE; char *name; char *last; name = apr_strtok(cmdline, " ", &last); if(strcasecmp(name,"loglevel") == 0) { char *priority = apr_strtok(NULL, " ", &last); if(priority) { apt_log_priority_set(atol(priority)); } } else if(strcasecmp(name,"exit") == 0 || strcmp(name,"quit") == 0) { running = FALSE; } else if(strcasecmp(name,"offline") == 0) { mrcp_server_offline(server); } else if(strcasecmp(name,"online") == 0) { mrcp_server_online(server); } else if(strcasecmp(name,"help") == 0) { printf("usage:\n"); printf("- loglevel [level] (set loglevel, one of 0,1...7)\n"); printf("- offline (take server offline)\n"); printf("- online (bring server online)\n"); printf("- quit, exit\n"); } else { printf("unknown command: %s (input help for usage)\n",name); } return running; } apt_bool_t uni_cmdline_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool) { apt_bool_t running = TRUE; char cmdline[1024]; apr_size_t i; mrcp_server_t *server; /* start server */ server = unimrcp_server_start(dir_layout); if(!server) { return FALSE; } do { printf(">"); memset(&cmdline, 0, sizeof(cmdline)); for(i = 0; i < sizeof(cmdline); i++) { cmdline[i] = (char) getchar(); if(cmdline[i] == '\n') { cmdline[i] = '\0'; break; } } if(*cmdline) { running = cmdline_process(server, cmdline); } } while(running != 0); /* shutdown server */ unimrcp_server_shutdown(server); return TRUE; }
#define _CRT_SECURE_NO_DEPRECATE #include <stdio.h> #include <stdlib.h> #include <math.h> #include "./func.h" int main(int argc, char ** argv) { char userbuffer[2048] = { 0 }; puts("Please, enter some string:\n"); gets(userbuffer); char* replaced = replace(userbuffer, "=", "****"); printf("Replaced string: %s\n", replaced); delete_string(replaced); return 0; }
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkFlipImageFilter_h #define __itkFlipImageFilter_h #include "itkImageToImageFilter.h" #include "itkFixedArray.h" namespace itk { /** \class FlipImageFilter * \brief Flips an image across user specified axes. * * FlipImageFilter flips an image across user specified axes. * The flip axes are set via method SetFlipAxes( array ) where * the input is a FixedArray<bool,ImageDimension>. The image * is flipped across axes for which array[i] is true. * * In terms of grid coordinates the image is flipped within * the LargestPossibleRegion of the input image. As such, * the LargestPossibleRegion of the ouput image is the same * as the input. * * In terms of geometric coordinates, the output origin * is such that the image is flipped with respect to the * coordinate axes. * * \ingroup GeometricTransform * \ingroup MultiThreaded * \ingroup Streamed * \ingroup ITKImageGrid * * \wiki * \wikiexample{Images/FlipImageFilter,Flip an image over specified axes} * \endwiki */ template< class TImage > class FlipImageFilter: public ImageToImageFilter< TImage, TImage > { public: /** Standard class typedefs. */ typedef FlipImageFilter Self; typedef ImageToImageFilter< TImage, TImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(FlipImageFilter, ImageToImageFilter); /** ImageDimension enumeration */ itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension); /** Inherited types */ typedef typename Superclass::InputImagePointer InputImagePointer; typedef typename Superclass::InputImageConstPointer InputImageConstPointer; typedef typename Superclass::OutputImagePointer OutputImagePointer; typedef typename Superclass::OutputImageRegionType OutputImageRegionType; /** Index related types */ typedef typename TImage::IndexType IndexType; typedef typename IndexType::IndexValueType IndexValueType; /** FlipAxesArray type */ typedef FixedArray< bool, itkGetStaticConstMacro(ImageDimension) > FlipAxesArrayType; /** Set/Get the axis to be flipped. The image is flipped along axes * for which array[i] is true. */ itkSetMacro(FlipAxes, FlipAxesArrayType); itkGetConstMacro(FlipAxes, FlipAxesArrayType); /** Controls how the output origin is computed. If FlipAboutOrigin is * "on", the flip will occur about the origin of the axis, otherwise, * the flip will occur about the center of the axis. */ itkBooleanMacro(FlipAboutOrigin); itkGetConstMacro(FlipAboutOrigin, bool); itkSetMacro(FlipAboutOrigin, bool); /** FlipImageFilter produces an image with different origin and * direction than the input image. As such, FlipImageFilter needs to * provide an implementation for GenerateOutputInformation() in * order to inform the pipeline execution model. The original * documentation of this method is below. * \sa ProcessObject::GenerateOutputInformaton() */ virtual void GenerateOutputInformation(); /** FlipImageFilter needs different input requested region than the output * requested region. As such, FlipImageFilter needs to provide an * implementation for GenerateInputRequestedRegion() in order to inform the * pipeline execution model. * \sa ProcessObject::GenerateInputRequestedRegion() */ virtual void GenerateInputRequestedRegion(); protected: FlipImageFilter(); ~FlipImageFilter() {} void PrintSelf(std::ostream & os, Indent indent) const; /** FlipImageFilter can be implemented as a multithreaded filter. * Therefore, this implementation provides a ThreadedGenerateData() routine * which is called for each processing thread. The output image data is * allocated automatically by the superclass prior to calling * ThreadedGenerateData(). ThreadedGenerateData can only write to the * portion of the output image specified by the parameter * "outputRegionForThread" * * \sa ImageToImageFilter::ThreadedGenerateData(), * ImageToImageFilter::GenerateData() */ void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId); private: FlipImageFilter(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented FlipAxesArrayType m_FlipAxes; bool m_FlipAboutOrigin; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkFlipImageFilter.hxx" #endif #endif
/* * resturant.c * simulate the cook and tablewaitor and customer in a resturant with producer * and consumer model and threading tools---lock and condition. * thread Cook will cook meals when there is a need * thread Tablewaitor will deliver the meal when meal is ready * thread consumer will enjoy the meal when it is delivered. */ #include <stdio.h> #include <pthread.h> #include <stdlib.h> static pthread_mutex_t cook_meal_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cook_meal_cond = PTHREAD_COND_INITIALIZER; static pthread_mutex_t deliver_meal_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t deliver_meal_cond = PTHREAD_COND_INITIALIZER; static char *meal = NULL; static char *table = NULL; /* * When there is no food, the cook must cook it. * If the meal is already there, then cook can rest a little while for next * order. */ static void *cook( void *arg ) { pthread_mutex_lock( &cook_meal_lock ); while ( meal != NULL ) { pthread_cond_wait( &cook_meal_cond, &cook_meal_lock ); } pthread_mutex_unlock( &cook_meal_lock ); meal = "Humberger"; printf( "Meal is ready to deliver\n" ); pthread_cond_signal( &cook_meal_cond ); return (void *) 0; } /* * If the meal is not ready---the cook hasn't finished, waitor has to wait. * If cook finishes, waitor will deliver the meal to consumer --- our guest. */ static void *waitor( void *arg ) { pthread_mutex_lock( &cook_meal_lock ); while ( meal == NULL ) { pthread_cond_wait( &cook_meal_cond, &cook_meal_lock ); } pthread_mutex_unlock( &cook_meal_lock ); table = meal; printf( "Delivering meal '%s' to customer\n", meal ); pthread_cond_signal( &deliver_meal_cond ); return (void *) 0; } /* * When the meal is delivered, we can enjoy. Otherwise, we have to wait. */ static void *consumer( void *arg ) { pthread_mutex_lock( &deliver_meal_lock ); while ( table == NULL ) { pthread_cond_wait( &deliver_meal_cond, &deliver_meal_lock ); } pthread_mutex_unlock( &deliver_meal_lock ); printf( "we can enjoy '%s'\n", table ); return (void *) 0; } int main( void ) { pthread_t cook_id, waitor_id, consumer_id; pthread_create( &consumer_id, NULL, consumer, NULL ); pthread_create( &waitor_id, NULL, waitor, NULL ); pthread_create( &cook_id, NULL, cook, NULL ); return 0; }
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #ifdef AWS_MULTI_FRAMEWORK #import <AWSRuntime/AmazonServiceRequestConfig.h> #else #import "AmazonServiceRequestConfig.h" #endif /** * Set Instance Health Request */ @interface AutoScalingSetInstanceHealthRequest:AmazonServiceRequestConfig { NSString *instanceId; NSString *healthStatus; BOOL shouldRespectGracePeriod; BOOL shouldRespectGracePeriodIsSet; } /** * Default constructor for a new object. Callers should use the * property methods to initialize this object after creating it. */ -(id)init; /** * The identifier of the Amazon EC2 instance. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>1 - 16<br/> * <b>Pattern: </b>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*<br/> */ @property (nonatomic, retain) NSString *instanceId; /** * The health status of the instance. Set to <code>Healthy</code> if you * want the instance to remain in service. Set to <code>Unhealthy</code> * if you want the instance to be out of service. Auto Scaling will * terminate and replace the unhealthy instance. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>1 - 32<br/> * <b>Pattern: </b>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*<br/> */ @property (nonatomic, retain) NSString *healthStatus; /** * If the Auto Scaling group of the specified instance has a * <code>HealthCheckGracePeriod</code> specified for the group, by * default, this call will respect the grace period. Set this to * <code>False</code>, if you do not want the call to respect the grace * period associated with the group. <p>For more information, see the * <code>HealthCheckGracePeriod</code> parameter description in the * <a>CreateAutoScalingGroup</a> action. */ @property (nonatomic) BOOL shouldRespectGracePeriod; @property (nonatomic, readonly) BOOL shouldRespectGracePeriodIsSet; /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. */ -(NSString *)description; @end
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/cloud/dataproc/v1/jobs.proto #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_INTERNAL_JOB_CONTROLLER_OPTION_DEFAULTS_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_INTERNAL_JOB_CONTROLLER_OPTION_DEFAULTS_H #include "google/cloud/options.h" #include "google/cloud/version.h" namespace google { namespace cloud { namespace dataproc_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN Options JobControllerDefaultOptions(Options options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_internal } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_INTERNAL_JOB_CONTROLLER_OPTION_DEFAULTS_H
#pragma once class MyCamera { public: };
//===--- Visibility.h - Visibility macros for runtime exports ---*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // These macros are used to declare symbols that should be exported from the // Swift runtime. // //===----------------------------------------------------------------------===// #ifndef SWIFT_STDLIB_SHIMS_VISIBILITY_H #define SWIFT_STDLIB_SHIMS_VISIBILITY_H #if !defined(__has_feature) #define __has_feature(x) 0 #endif #if !defined(__has_attribute) #define __has_attribute(x) 0 #endif #if __has_feature(nullability) // Provide macros to temporarily suppress warning about the use of // _Nullable and _Nonnull. # define SWIFT_BEGIN_NULLABILITY_ANNOTATIONS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wnullability-extension\"") # define SWIFT_END_NULLABILITY_ANNOTATIONS \ _Pragma("clang diagnostic pop") #else // #define _Nullable and _Nonnull to nothing if we're not being built // with a compiler that supports them. # define _Nullable # define _Nonnull # define SWIFT_BEGIN_NULLABILITY_ANNOTATIONS # define SWIFT_END_NULLABILITY_ANNOTATIONS #endif #if __has_attribute(pure) #define SWIFT_READONLY __attribute__((__pure__)) #else #define SWIFT_READONLY #endif #if __has_attribute(const) #define SWIFT_READNONE __attribute__((__const__)) #else #define SWIFT_READNONE #endif #if __has_attribute(always_inline) #define SWIFT_ALWAYS_INLINE __attribute__((always_inline)) #else #define SWIFT_ALWAYS_INLINE #endif #if __has_attribute(unavailable) #define SWIFT_ATTRIBUTE_UNAVAILABLE __attribute__((__unavailable__)) #else #define SWIFT_ATTRIBUTE_UNAVAILABLE #endif // TODO: support using shims headers in overlays by parameterizing // SWIFT_RUNTIME_EXPORT on the library it's exported from, then setting // protected vs. default based on the current value of __SWIFT_CURRENT_DYLIB. /// Attribute used to export symbols from the runtime. #if __MACH__ # define SWIFT_EXPORT_ATTRIBUTE __attribute__((__visibility__("default"))) #elif __ELF__ // Use protected visibility for ELF, since we don't want Swift symbols to be // interposable. The relative relocations we form to metadata aren't // valid in ELF shared objects, and leaving them relocatable at load time // defeats the purpose of the relative references. // // Protected visibility on a declaration is interpreted to mean that the // symbol is defined in the current dynamic library, so if we're building // something else, we need to fall back on using default visibility. #ifdef __SWIFT_CURRENT_DYLIB # define SWIFT_EXPORT_ATTRIBUTE __attribute__((__visibility__("protected"))) #else # define SWIFT_EXPORT_ATTRIBUTE __attribute__((__visibility__("default"))) #endif #else // FIXME: this #else should be some sort of #elif Windows # if defined(__CYGWIN__) # define SWIFT_EXPORT_ATTRIBUTE # else # if defined(swiftCore_EXPORTS) # define SWIFT_EXPORT_ATTRIBUTE __declspec(dllexport) # else # define SWIFT_EXPORT_ATTRIBUTE __declspec(dllimport) # endif # endif #endif #if defined(__cplusplus) #define SWIFT_RUNTIME_EXPORT extern "C" SWIFT_EXPORT_ATTRIBUTE #else #define SWIFT_RUNTIME_EXPORT SWIFT_EXPORT_ATTRIBUTE #endif /// Attributes for runtime-stdlib interfaces. /// Use these for C implementations that are imported into Swift via SwiftShims /// and for C implementations of Swift @_silgen_name declarations /// Note that @_silgen_name implementations must also be marked SWIFT_CC(swift). /// /// SWIFT_RUNTIME_STDLIB_API functions are called by compiler-generated code /// or by @_inlineable Swift code. /// Such functions must be exported and must be supported forever as API. /// The function name should be prefixed with `swift_`. /// /// SWIFT_RUNTIME_STDLIB_SPI functions are called by overlay code. /// Such functions must be exported, but are still SPI /// and may be changed at any time. /// The function name should be prefixed with `_swift_`. /// /// SWIFT_RUNTIME_STDLIB_INTERNAL functions are called only by the stdlib. /// Such functions are internal and are not exported. /// FIXME(sil-serialize-all): _INTERNAL functions are also exported for now /// until the tide of @_inlineable is rolled back. /// They really should be LLVM_LIBRARY_VISIBILITY, not SWIFT_RUNTIME_EXPORT. #define SWIFT_RUNTIME_STDLIB_API SWIFT_RUNTIME_EXPORT #define SWIFT_RUNTIME_STDLIB_SPI SWIFT_RUNTIME_EXPORT #define SWIFT_RUNTIME_STDLIB_INTERNAL SWIFT_RUNTIME_EXPORT /// Old marker for runtime-stdlib interfaces. This marker will go away soon. #define SWIFT_RUNTIME_STDLIB_INTERFACE SWIFT_RUNTIME_STDLIB_API // SWIFT_STDLIB_SHIMS_VISIBILITY_H #endif
/** * @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file JPetTask.h */ #ifndef JPETTASK_H #define JPETTASK_H #include "./JPetParamsInterface/JPetParamsInterface.h" #include "./JPetTaskInterface/JPetTaskInterface.h" #include "./JPetDataInterface/JPetDataInterface.h" #include <string> #include <vector> class JPetWriter; /** * @brief abstract class being an implementation of a computing task unit. * The user should implement init, exec and terminate methods in the inherited class. */ class JPetTask: public JPetTaskInterface { public: JPetTask(const char* name = ""); virtual ~JPetTask() {} virtual bool init(const JPetParamsInterface& inOptions) = 0; virtual bool run(const JPetDataInterface& inData) = 0; virtual bool terminate(JPetParamsInterface& outOptions) = 0; virtual void addSubTask(std::unique_ptr<JPetTaskInterface> subTask) override; virtual const std::vector<JPetTaskInterface*> getSubTasks() const override; void setName(const std::string& name); std::string getName() const override; protected: std::string fName; std::vector<std::unique_ptr<JPetTaskInterface>> fSubTasks; }; #endif /* !JPETTASK_H */
// // SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD // // SPDX-License-Identifier: BSL-1.0 // #pragma once #include "openssl_stub.hpp"
/////////////////////////////////////////////////////////////////////////// // C++ code generated with wxFormBuilder (version Jun 17 2015) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __GUI_H__ #define __GUI_H__ #include <wx/artprov.h> #include <wx/xrc/xmlres.h> #include <wx/intl.h> #include <wx/string.h> #include <wx/bitmap.h> #include <wx/image.h> #include <wx/icon.h> #include <wx/menu.h> #include <wx/gdicmn.h> #include <wx/font.h> #include <wx/colour.h> #include <wx/settings.h> #include <wx/calctrl.h> #include <wx/treectrl.h> #include <wx/sizer.h> #include <wx/button.h> #include <wx/stattext.h> #include <wx/richtext/richtextctrl.h> #include <wx/statusbr.h> #include <wx/toolbar.h> #include <wx/frame.h> #include <wx/checklst.h> #include <wx/statbox.h> #include <wx/dialog.h> /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /// Class MainFrameBase /////////////////////////////////////////////////////////////////////////////// class MainFrameBase : public wxFrame { private: protected: wxMenuBar* m_menuBar; wxMenu* m_menuFile; wxCalendarCtrl* m_calendar; wxTreeCtrl* m_treeDates; wxButton* m_buttonGoNextAvailable; wxButton* m_buttonGoTomorrow; wxStaticText* m_staticTextCurDate; wxRichTextCtrl* m_editor; wxButton* m_buttonYesterday; wxButton* m_buttonGoPrevAvailable; wxStatusBar* m_statusBar; wxToolBar* m_mainToolBar; // Virtual event handlers, overide them in your derived class virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); } virtual void OnExitClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCalendarDblClick( wxCalendarEvent& event ) { event.Skip(); } virtual void OnCalendarKillFocus( wxFocusEvent& event ) { event.Skip(); } virtual void OnCalendarSetFocus( wxFocusEvent& event ) { event.Skip(); } virtual void OnTreeSelChanged( wxTreeEvent& event ) { event.Skip(); } virtual void OnButtonGoNextAvailableClick( wxCommandEvent& event ) { event.Skip(); } public: MainFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 699,413 ), long style = wxCLOSE_BOX|wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); ~MainFrameBase(); }; /////////////////////////////////////////////////////////////////////////////// /// Class DlgPreference /////////////////////////////////////////////////////////////////////////////// class DlgPreference : public wxDialog { private: protected: wxCheckListBox* m_checkListExcludeDays; wxStaticText* m_staticText2; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; public: DlgPreference( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Preferences"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 420,309 ), long style = wxDEFAULT_DIALOG_STYLE ); ~DlgPreference(); }; #endif //__GUI_H__
#ifndef X_RAY_SPECTRUM_ANALYZER_XRAYTRANSITION_H #define X_RAY_SPECTRUM_ANALYZER_XRAYTRANSITION_H /** * @file * * @brief Atomic x-ray transition data. * * @author Hendrix Demers <hendrix.demers@mail.mcgill.ca> * @since 1.0 */ // Copyright 2016 Hendrix Demers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Forwards declarations // C system headers // C++ system header // Library headers // Project headers #include "Subshell.h" // Project private headers /** * @brief Atomic x-ray transition. */ class XrayTransition { public: /// Initial subshell of the x-ray transition. Subshell initial; /// Final subshell if the x-ray transition. Subshell final; /// Probability of the x-ray transition. double probability; /// Energy of the x-ray transition in eV. double energy_eV; /// X-ray line fraction based on the initial subshell. double fraction; }; #endif //X_RAY_SPECTRUM_ANALYZER_XRAYTRANSITION_H
// ======================================================================== // // Copyright 2009-2017 Intel Corporation // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // you may not use this file except in compliance with the License. // // You may obtain a copy of the License at // // // // http://www.apache.org/licenses/LICENSE-2.0 // // // // Unless required by applicable law or agreed to in writing, software // // distributed under the License is distributed on an "AS IS" BASIS, // // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // // limitations under the License. // // ======================================================================== // #pragma once #include <ospray/ospray_cpp/ManagedObject.h> namespace ospray { namespace cpp { class Data : public ManagedObject_T<OSPData> { public: Data(size_t numItems, OSPDataType format, const void *init = nullptr, int flags = 0); Data(const Data &copy); Data(OSPData existing); }; // Inlined function definitions /////////////////////////////////////////////// inline Data::Data(size_t numItems, OSPDataType format, const void *init, int flags) { ospObject = ospNewData(numItems, format, init, flags); } inline Data::Data(const Data &copy) : ManagedObject_T<OSPData>(copy.handle()) { } inline Data::Data(OSPData existing) : ManagedObject_T<OSPData>(existing) { } }// namespace cpp }// namespace ospray
float p (int a, int b) { int i; float t=1; for(i=0;i<b;i++) t*=a; for(i=0; i>b; i--) t/=a; return t; } void main () { int n=0,o=0, m=1; float x=1; char a; getid (a); //n+=a-'0'; //printid (n); if (a == '-') { x=-1; getid (a); } if (( a <= '9' )&&(a>='0')) o=1; while (( a <= '9' )&&(a>='0')) { n=n*10+a-'0'; m=0; getid (a); } if(o=1) { if (a==' ') { print ("целое число: "); if (x==-1) n*=-1; printid(n); } if((a=='.')||(a==',')) { getid (a); while (( a <= '9' )&&(a>='0')) { n=n*10+a-'0'; m++; getid (a); } if ((a==' ')&&(m>0)) { print ("вещественное число в нормальной записи: "); x*=n; x/=p(10, m); printid (x) ; } else print ("это не число "); } if (a=='e') { getid (a); if (a == '-') { o=-1; getid (a); } while (( a <= '9' )&&(a>='0')) { m=m*10+a-'0'; getid (a); } m*=o; if (a==' ') { print ("вещественное число в экспонециальной записи: "); x*=p(n,m); printid(x); } else print ("это не число "); } if ((a!=' ')&&(a!='e')&&(a!='.')&&(a!=',')) print ("это не число "); } if(o=0) print ("это не число "); }
// messages #define SERVMESSGREETING @"^3*** ^1this server is run by ^7GSC ^1for Mac OSX! (^7www.p-edge.nl/gsc^1) ^3***" #define CONFIG_HEADER1 @"// Created by Game Server Configulator (Call of Duty) | (c) 2003-2006 P-Edge media\n" #define CONFIG_HEADER2 @"// For more info visit www.p-edge.nl/gsc\n\n" // OSX console messages #define CONSOLEGREET @"Game Server Configulator (Call of Duty) greets those who are playing Call of Duty!" #define UNZIPNOTFOUND @"/usr/bin/unzip is not found!" #define UDP_NOREPLY @"No UDP socket reply!" #define UDP_NOCONNECT @"No UDP connection!" // about window #define ABO_VERS @"version " #define COPYRIGHT_TEXT @"\n(c) 2003-2006 P-Edge media." #define GSC_TITLE @"Game Server Configulator\n(Call of Duty)" #define ABO_EXPIRY_DATE @"This version will expire %@." // general window #define GEN_LAUNCHING @"Launching the server..." #define GEN_RUNNING @"The server is running." #define GEN_NOTRUNNING @"The server is not running." #define GEN_READYLAUNCH @"The server is ready for launch." #define GEN_NOVALIDFOLDER @"No valid game folder in preferences." #define GEN_SERVMESSERR @"Please enter messages here or disable server messages!" // server management window #define MAN_WAITMESSAGE @"[Waiting to send first message.]" #define MAN_WAITFORSTART @"Please wait while the game starts..." #define MAN_SELECTMAP @"select a map..." #define MAN_GOINGDOWN @"The server is going down..." #define MAN_MAPCHANGING @"Changing the current map..." #define MAN_PLAYERKICKED @"Kicked: %@" #define MAN_AUTOKICKED @"AUTOKICKED: %@" #define MAN_PLAYERBANNED @"BANNED: %@" #define MAN_MESSAGESENT @"A message was sent by the admin." #define MAN_KICKEDPL @"------- KICKED!" #define MAN_AUTOKICKEDPL @"--- AUTOKICKED!" // weapons window #define WEA_SELECTONE @"You must enable at least one weapon for the USA, the British, the Russian and the German. Players will not be able to join if you use these settings!" // map window #define MAP_INROTATION @"Maps in rotation (%d)" #define MAP_AVAILABLE @"Available maps (%d)" // prefs window #define PRF_GAMEFOLDER1 @"Call of Duty game folder:" #define PRF_GAMEFOLDER2 @"Call of Duty is not here:" // alerts #define ALE_OKBUTTON @"OK" #define ALE_YESBUTTON @"Yes" #define ALE_NOBUTTON @"No" #define ALE_QUITBUTTON @"Quit" #define ALE_CANCELBUTTON @"Cancel" #define ALE_ONLINEHELP @"Online help" #define ALE_UPDATENOW @"Update now" #define ALE_CANNOTLAUNCH1 @"Cannot launch the server" #define ALE_CANNOTLAUNCH2 @"The game is already running. Please quit the game first." #define ALE_CANNOTLAUNCH3 @"The server configuration file could not be saved." #define ALE_CANNOTLAUNCH4 @"The game parameters file could not be saved." #define ALE_EXPIRED1 @"This version has expired" #define ALE_EXPIRED2 @"Please update to the latest version." #define ALE_NOUPDATECHECK1 @"Could not check for updates" #define ALE_NOUPDATECHECK2 @"The software server is not responding." #define ALE_ILLCHECKLATER @"I'll try later" #define ALE_NOUPDATEFOUND1 @"No updates found" #define ALE_NOUPDATEFOUND2 @"You already have the latest version (%@) of %@." #define ALE_NEWVERSFOUND1 @"Software update found" #define ALE_NEWVERSFOUND2 @"Would you like to download version %@?" #define ALE_SAVECHANGES1 @"Server configuration changed" #define ALE_SAVECHANGES2 @"Would you like to save your changes?" #define ALE_CANNOTADDIP1 @"This IP address can not be banned" #define ALE_CANNOTADDIP2 @"Please consult our online help." #define ALE_CANNOTADDIP3 @"This IP address is already banned." #define ALE_OLDFILEVERS1 @"This file was saved with an older GSC version" #define ALE_OLDFILEVERS2 @"Missing settings will be set to current values." #define ALE_CANNOTOPENFILE1 @"Cannot open this file" #define ALE_CANNOTOPENFILE2 @"You cannot open a file while the server is running." #define ALE_FILEDAMAGED1 @"This file is damaged" #define ALE_FILEDAMAGED2 @"The file cannot be opened." #define ALE_BANTHISPLAYER1 @"This IP (%@) will be banned" #define ALE_BANTHISPLAYER2 @"The player is named: %@\nClick OK to ban this player immediately." #define ALE_RCONPASS1 @"Your rcon password is too short" #define ALE_RCONPASS2 @"Please us a password of more than 6 characters." #define ALE_PLAYERSCNNCT1 @"There are players connected" #define ALE_PLAYERSCNNCT2 @"Are you sure you want to kill the server?" // in game messages #define GAM_USERKICKED @"say ---- The admin is kicking %@..." #define GAM_AUTOKICKED @"say ---- %@ is AUTO-KICKED because %@ is a banned IP address." #define GAM_USERBANNED @"say ---- %@ is BANNED from this server by the admin and will be kicked within 30 seconds." #define GAM_LEADPLAYER1 @"say ---- %@ is in the lead with %d kills!!" #define GAM_LEADPLAYER2 @"say ---- %@ are leading with %d kills." #define GAM_LASTPLAYER1 @"say ---- %@ is last with %d kills..." #define GAM_LASTPLAYER2 @"say ---- %@ are behind with %d kills..."
// // RRGridChart.h // Cocoa-Charts // // Created by wenliang on 16/1/5. // Copyright © 2016年 renrencaopan. All rights reserved. // #import <UIKit/UIKit.h> #import "RRBaseChartView.h" @protocol CCSChartDelegate <NSObject> @optional - (void)CCSChartBeTouchedOn:(CGPoint)point indexAt:(CCUInt) index; - (void)CCSChartDisplayChangedFrom:(CCUInt)from number:(CCUInt) number; @end /** Y轴在画面中的表示位置 */ typedef enum { CCSGridChartYAxisPositionLeft, //Axis Y left CCSGridChartYAxisPositionRight, //Axis Y right } CCSGridChartYAxisPosition; /** X轴在画面中的表示位置 */ typedef enum { CCSGridChartXAxisPositionTop, //Axis X top CCSGridChartXAxisPositionBottom //Axis X bottom } CCSGridChartXAxisPosition; @interface RRGridChart : RRBaseChartView { CGPoint _singleTouchPoint; } /** Y轴标题数组*/ @property(strong, nonatomic) NSMutableArray *latitudeTitles; /** Z轴标题数组*/ @property(strong, nonatomic) NSMutableArray *zAxisTitles; /** X轴标题数组*/ @property(strong, nonatomic) NSMutableArray *longitudeTitles; /** X轴刻度坐标位置数组*/ @property(strong, nonatomic) NSMutableArray *longitudePositions; /** 蜡烛棒的个数*/ @property(assign, nonatomic) CCUInt orginMaxSticksNum; /** 默认蜡烛棒的个数*/ @property(assign, nonatomic) CCUInt virtualSticksNum; /** 坐标轴X的显示颜色*/ @property(strong, nonatomic) UIColor *axisXColor; /** 坐标轴Y的显示颜色*/ @property(strong, nonatomic) UIColor *axisYColor; /** 网格经线的显示颜色*/ @property(strong, nonatomic) UIColor *longitudeColor; /** 网格纬线的显示颜色*/ @property(strong, nonatomic) UIColor *latitudeColor; /** 图边框的颜色*/ @property(strong, nonatomic) UIColor *borderColor; /** 经线刻度字体颜色*/ @property(strong, nonatomic) UIColor *longitudeFontColor; /** 纬线刻度字体颜色*/ @property(strong, nonatomic) UIColor *latitudeFontColor; /** Z轴刻度颜色*/ @property(strong, nonatomic) UIColor *zAxisFontColor; /** 十字交叉线颜色*/ @property(strong, nonatomic) UIColor *crossLinesColor; /** 十字交叉线坐标轴字体颜色*/ @property(strong, nonatomic) UIColor *crossLinesFontColor; /** 经线刻度字体大小*/ @property(strong, nonatomic) UIFont *longitudeFont; /** 经线刻度字体大小*/ @property(strong, nonatomic) UIFont *latitudeFont; /** Z轴刻度字体大小*/ @property(strong, nonatomic) UIFont *zAxisFont; /** 轴线左边距*/ @property(assign, nonatomic) CCFloat axisMarginLeft; /** 轴线下边距*/ @property(assign, nonatomic) CCFloat axisMarginBottom; /** 轴线上边距*/ @property(assign, nonatomic) CCFloat axisMarginTop; /** 轴线右边距*/ @property(assign, nonatomic) CCFloat axisMarginRight; /** 经线刻度字体大小*/ @property(assign, nonatomic) CCUInt longitudeFontSize; /** 纬线刻度字体大小*/ @property(assign, nonatomic) CCUInt latitudeFontSize; /** X轴显示位置*/ @property(assign, nonatomic) CCSGridChartXAxisPosition axisXPosition; /** Y轴显示位置*/ @property(assign, nonatomic) CCSGridChartYAxisPosition axisYPosition; /** Y轴上的标题是否显示*/ @property(assign, nonatomic) BOOL displayLatitudeTitle; /** Z轴上的标题是否显示*/ @property(assign, nonatomic) BOOL displayZAxisTitle; /** X轴上的标题是否显示*/ @property(assign, nonatomic) BOOL displayLongitudeTitle; /** 经线是否显示*/ @property(assign, nonatomic) BOOL displayLongitude; /** Z轴是否展示*/ @property(assign, nonatomic) BOOL displayZAxis; /** 经线是否显示为虚线*/ @property(assign, nonatomic) BOOL dashLongitude; /** 纬线是否显示*/ @property(assign, nonatomic) BOOL displayLatitude; /** 纬线是否显示为虚线*/ @property(assign, nonatomic) BOOL dashLatitude; /** 控件是否显示边框*/ @property(assign, nonatomic) BOOL displayBorder; /** 是否纬线自定义*/ @property(assign, nonatomic)BOOL axisX0repeatLatitude; /** 在控件被点击时,显示十字竖线线*/ @property(assign, nonatomic) BOOL displayCrossXOnTouch; /** 在控件被点击时,显示十字横线线*/ @property(assign, nonatomic) BOOL displayCrossYOnTouch; /** 单点触控的选中点*/ @property(assign, nonatomic ) CGPoint singleTouchPoint; /** 单点触控的选中点代理*/ @property(assign, nonatomic) UIViewController<CCSChartDelegate> *chartDelegate; /** * 绘制边框 */ - (void)drawBorder:(CGRect)rect; /** * 绘制X轴 */ - (void)drawXAxis:(CGRect)rect; /** * 绘制Y轴 */ - (void)drawYAxis:(CGRect)rect; /** * 绘制纬线 */ - (void)drawLatitudeLines:(CGRect)rect; /** * 绘制经线 */ - (void)drawLongitudeLines:(CGRect)rect; /** * 绘制X轴上的刻度 */ - (void)drawXAxisTitles:(CGRect)rect; /** * 绘制Y轴上的刻度 */ - (void)drawYAxisTitles:(CGRect)rect; /** * 绘制十字交叉线 */ - (void)drawCrossLines:(CGRect)rect; /** * 计算经度的表示刻度 */ - (NSString *)calcAxisXGraduate:(CGRect)rect; /** * 计算纬度的表示刻度 */ - (NSString *)calcAxisYGraduate:(CGRect)rect; /** * 经度计算结果 */ - (CCFloat )touchPointAxisXValue:(CGRect)rect; /** * 纬度计算结果 */ - (CCFloat )touchPointAxisYValue:(CGRect)rect; /** * 缩小 */ - (void)zoomOut; /** * 放大表示 */ - (void)zoomIn; @end
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_Enum2778772662.h" #include "mscorlib_System_Runtime_Serialization_StreamingCon2964666472.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Serialization.StreamingContextStates struct StreamingContextStates_t2964666472 { public: // System.Int32 System.Runtime.Serialization.StreamingContextStates::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(StreamingContextStates_t2964666472, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
/* * Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. */ #if !_KERNEL #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; #endif static const char rcsid[] = "$FreeBSD: src/lib/libc/stdlib/getopt.c,v 1.2.2.2 2001/08/26 03:36:04 jkoshy Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #include <stdlib.h> #include <string.h> int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ optopt, /* character checked for validity */ optreset; /* reset getopt */ char *optarg; /* argument associated with option */ #define BADCH (int)'?' #define BADARG (int)':' #define EMSG "" char *__progname; /* * getopt -- * Parse argc/argv argument vector. */ int getopt(nargc, nargv, ostr) int nargc; char * const *nargv; const char *ostr; { static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc || *(place = nargv[optind]) != '-') { place = EMSG; return (-1); } if (place[1] && *++place == '-') { /* found "--" */ ++optind; place = EMSG; return (-1); } } /* option letter okay? */ if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr, optopt))) { /* * if the user didn't specify '-' as an option, * assume it means -1. */ if (optopt == (int)'-') return (-1); if (!*place) ++optind; if (opterr && *ostr != ':' && optopt != BADCH) (void)fprintf(stderr, "%s: illegal option -- %c\n", __progname, optopt); return (BADCH); } if (*++oli != ':') { /* don't need argument */ optarg = NULL; if (!*place) ++optind; } else { /* need an argument */ if (*place) /* no white space */ optarg = place; else if (nargc <= ++optind) { /* no arg */ place = EMSG; if (*ostr == ':') return (BADARG); if (opterr) (void)fprintf(stderr, "%s: option requires an argument -- %c\n", __progname, optopt); return (BADCH); } else /* white space */ optarg = nargv[optind]; place = EMSG; ++optind; } return (optopt); /* dump back option letter */ } #endif
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ // This file defines the operations used in the MHLO dialect. #ifndef TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_ #define TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_ #include "llvm/ADT/StringRef.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/DialectImplementation.h" #include "mlir/IR/Location.h" #include "mlir/IR/MLIRContext.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/Operation.h" #include "mlir/IR/TypeUtilities.h" #include "mlir/IR/Types.h" #include "mlir/Interfaces/InferTypeOpInterface.h" #include "mlir/Interfaces/SideEffectInterfaces.h" // clang-format off #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_base.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_base_structs.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_base_enums.h" #include "mlir-hlo/Dialect/mhlo/IR/infer_fusibility_op_interface.h" // clang-format on namespace mlir { class OpBuilder; namespace mhlo { class MhloDialect : public Dialect { public: explicit MhloDialect(MLIRContext *context); static StringRef getDialectNamespace() { return "mhlo"; } // Registered hook to materialize a constant operation from a given attribute // value with the desired resultant type. Operation *materializeConstant(OpBuilder &builder, Attribute value, Type type, Location loc) override; // Parses a type registered to this dialect. Type parseType(DialectAsmParser &parser) const override; // Prints a type registered to this dialect. void printType(Type type, DialectAsmPrinter &os) const override; }; class TokenType : public Type::TypeBase<TokenType, Type, TypeStorage> { public: using Base::Base; }; // Shape derivation function that computes the shape of the result based on an // operand. For a 2-dimensional input tensor, this produces IR of the form // // %0 = dim %arg0, 0 : memref<?x?xf32> // %1 = index_cast %0 : index to i64 // %2 = dim %arg0, 1 : memref<?x?xf32> // %3 = index_cast %2 : index to i64 // %4 = "mhlo.scalars_to_dimension_tensor"(%1, %3) // : (i64, i64) -> tensor<2xi64> // // and returns %4 as the shape value. LogicalResult deriveShapeFromOperand( OpBuilder *builder, Operation *op, Value operand, SmallVectorImpl<Value> *reifiedReturnShapes); // Type derivation function that returns a tensor type with a new element type. TensorType getSameShapeTensorType(TensorType tensor_type, Type element_type); } // end namespace mhlo } // end namespace mlir #define GET_OP_CLASSES #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h.inc" #endif // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #ifdef _MSC_VER //disable windows complaining about max template size. #pragma warning (disable : 4503) #endif // _MSC_VER #if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) #ifdef _MSC_VER #pragma warning(disable : 4251) #endif // _MSC_VER #ifdef USE_IMPORT_EXPORT #ifdef AWS_ELASTICTRANSCODER_EXPORTS #define AWS_ELASTICTRANSCODER_API __declspec(dllexport) #else #define AWS_ELASTICTRANSCODER_API __declspec(dllimport) #endif /* AWS_ELASTICTRANSCODER_EXPORTS */ #else #define AWS_ELASTICTRANSCODER_API #endif // USE_IMPORT_EXPORT #else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32) #define AWS_ELASTICTRANSCODER_API #endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#ifndef F_ROUTINES_H #define F_ROUTINES_H #include "FC.h" // missing prototypes of FORTRAN functions to be called from C++ extern "C" { void FC_GLOBAL(froutine, FROUTINE)(); } #endif
// // AlertView.h // Meep // // Created by Alex Jarvis on 19/02/2011. // Copyright 2011 Alex Jarvis. All rights reserved. // #import <Foundation/Foundation.h> @interface AlertView : NSObject <UIAlertViewDelegate> { } + (void)showSimpleAlertMessage:(NSString *)message withTitle:(NSString *)title andDelegate:(id)delegate; + (void)showSimpleAlertMessage:(NSString *)message withTitle:(NSString *)title; + (void)showValidationAlert:(NSString *)message; + (void)showNetworkAlert:(NSError *)error; + (UIAlertView *)showNetworkAlertWithRetry:(NSError *)error delegate:(id)delegate; + (UIAlertView *)showNetworkAlertWithForcedRetry:(NSError *)error delegate:(id)delegate; + (void)showNoUsersAlert; @end
#pragma once #include <memory> #include <string> #include <unordered_map> #include "common/common/assert.h" #include "common/common/empty_string.h" #include "common/http/header_map_impl.h" #include "extensions/filters/network/dubbo_proxy/message.h" #include "absl/types/optional.h" namespace Envoy { namespace Extensions { namespace NetworkFilters { namespace DubboProxy { class MessageMetadata { public: // TODO(gengleilei) Add parameter data types and implement Dubbo data type mapping. typedef std::unordered_map<uint32_t, std::string> ParameterValueMap; typedef std::unique_ptr<ParameterValueMap> ParameterValueMapPtr; typedef std::unique_ptr<Http::HeaderMapImpl> HeaderMapPtr; void setServiceName(const std::string& name) { service_name_ = name; } const std::string& service_name() const { return service_name_; } void setMethodName(const std::string& name) { method_name_ = name; } const absl::optional<std::string>& method_name() const { return method_name_; } void setServiceVersion(const std::string& version) { service_version_ = version; } const absl::optional<std::string>& service_version() const { return service_version_; } void setServiceGroup(const std::string& group) { group_ = group; } const absl::optional<std::string>& service_group() const { return group_; } void setMessageType(MessageType type) { message_type_ = type; } MessageType message_type() const { return message_type_; } void setRequestId(int64_t id) { request_id_ = id; } int64_t request_id() const { return request_id_; } void setSerializationType(SerializationType type) { serialization_type_ = type; } SerializationType serialization_type() const { return serialization_type_; } void setTwoWayFlag(bool two_way) { is_two_way_ = two_way; } bool is_two_way() const { return is_two_way_; } void setEventFlag(bool is_event) { is_event_ = is_event; } bool is_event() const { return is_event_; } void setResponseStatus(ResponseStatus status) { response_status_ = status; } const absl::optional<ResponseStatus>& response_status() const { return response_status_; } void addParameterValue(uint32_t index, const std::string& value) { assignParameterIfNeed(); parameter_map_->emplace(index, value); } const std::string& getParameterValue(uint32_t index) const { if (parameter_map_) { auto itor = parameter_map_->find(index); if (itor != parameter_map_->end()) { return itor->second; } } return EMPTY_STRING; } bool hasParameters() const { return parameter_map_ != nullptr; } const ParameterValueMap& parameters() { ASSERT(hasParameters()); return *parameter_map_; } bool hasHeaders() const { return headers_ != nullptr; } const Http::HeaderMap& headers() const { ASSERT(hasHeaders()); return *headers_; } void addHeader(const std::string& key, const std::string& value) { assignHeaderIfNeed(); headers_->addCopy(Http::LowerCaseString(key), value); } void addHeaderReference(const Http::LowerCaseString& key, const std::string& value) { assignHeaderIfNeed(); headers_->addReference(key, value); } private: inline void assignHeaderIfNeed() { if (!headers_) { headers_ = std::make_unique<Http::HeaderMapImpl>(); } } inline void assignParameterIfNeed() { if (!parameter_map_) { parameter_map_ = std::make_unique<ParameterValueMap>(); } } bool is_two_way_{false}; bool is_event_{false}; MessageType message_type_{MessageType::Request}; SerializationType serialization_type_{SerializationType::Hessian}; absl::optional<ResponseStatus> response_status_; int64_t request_id_ = 0; // Routing metadata. std::string service_name_; absl::optional<std::string> method_name_; absl::optional<std::string> service_version_; absl::optional<std::string> group_; ParameterValueMapPtr parameter_map_; HeaderMapPtr headers_; // attachment }; typedef std::shared_ptr<MessageMetadata> MessageMetadataSharedPtr; } // namespace DubboProxy } // namespace NetworkFilters } // namespace Extensions } // namespace Envoy
// // CHCZhunTi_classes_list.h // 吃货美食 // // Created by eric on 16/5/15. // Copyright © 2016年 赵天. All rights reserved. // #import <Foundation/Foundation.h> @interface CHCZhunTi_classes_list : NSObject @property(nonatomic,copy)NSString *myid; @property(nonatomic,copy)NSString *title; @property(nonatomic,copy)NSString *is_select; @end
#ifndef __HOOK_IMPL_H_INCLUDED__ #define __HOOK_IMPL_H_INCLUDED__ BOOL WINAPI HookHotPatch(void **pTarget, const void *pDetour); BOOL WINAPI HookTrampoline(void **pTarget, const void *pDetour); LONG WINAPI CallAPI(FARPROC func, UINT paramCnt, ...); #endif // __HOOK_IMPL_H_INCLUDED__
// // YCDownloadSession.h // YCDownloadSession // // Created by wz on 17/3/14. // Copyright © 2017年 onezen.cc. All rights reserved. // Github: https://github.com/onezens/YCDownloadSession // #import <UIKit/UIKit.h> #import "YCDownloadTask.h" /**当前下载session中所有的任务下载完成的通知。 不包括失败、暂停的任务*/ static NSString * const kDownloadAllTaskFinishedNoti = @"kAllDownloadTaskFinishedNoti"; typedef void (^BGCompletedHandler)(void); @class YCDownloadSession; @interface YCDownloadSession : NSObject /** 设置下载任务的个数,最多支持3个下载任务同时进行。 NSURLSession最多支持5个任务同时进行 但是5个任务,在某些情况下,部分任务会出现等待的状态,所有设置最多支持3个 */ @property (nonatomic, assign) NSInteger maxTaskCount; /** 获取下载session单例 */ + (instancetype)downloadSession; /** 开始一个后台下载任务 @param downloadURLString 下载url @param delegate 下载任务的代理 @param saveName 下载成功后,需要保存的名称,可以为空,为空的话以url生成保存名称 */ - (void)startDownloadWithUrl:(NSString *)downloadURLString delegate:(id<YCDownloadTaskDelegate>)delegate saveName:(NSString *)saveName; /** 暂停一个后台下载任务 @param downloadURLString 下载url */ - (void)pauseDownloadWithUrl:(NSString *)downloadURLString; /** 继续开始一个后台下载任务 @param downloadURLString 下载url @param delegate 下载任务的代理 */ - (void)resumeDownloadWithUrl:(NSString *)downloadURLString delegate:(id<YCDownloadTaskDelegate>)delegate saveName:(NSString *)saveName; /** 删除一个后台下载任务,同时会删除当前任务下载的缓存数据 @param downloadURLString 下载url */ - (void)stopDownloadWithUrl:(NSString *)downloadURLString; /** 暂停所有的下载 */ - (void)pauseAllDownloadTask; /** 是否允许蜂窝煤网络下载,以及网络状态变为蜂窝煤是否允许下载,必须把所有的downloadTask全部暂停,然后重新创建。否则,原先创建的 下载task依旧在网络切换为蜂窝煤网络时会继续下载 @param isAllow 是否允许蜂窝煤网络下载 */ - (void)allowsCellularAccess:(BOOL)isAllow; /** 获取当前是否允许蜂窝煤访问状态 */ - (BOOL)isAllowsCellularAccess; /** 后台某一下载任务完成时,第一次在AppDelegate中的 -(void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler 回调方法中调用该方法。多个task,一个session,只调用一次AppDelegate的回调方法。 completionHandler 回调执行后,app被系统唤醒的状态会变为休眠状态。 @param handler 后台任务结束后的调用的处理方法 @param identifier background session 的标识 */ -(void)addCompletionHandler:(BGCompletedHandler)handler identifier:(NSString *)identifier; @end
#include <libopticon/hash.h> static uint32_t IHASH = 0; /** Generic hash-function nicked from grace. * \param str The string to hash * \return A 32 bit hashed guaranteed not 0. */ uint32_t hash_token (const char *str) { uint32_t hash = 0; uint32_t i = 0; uint32_t s = 0; int sdf; /* Set up a random intial hash once */ if (! IHASH) { sdf = open ("/dev/urandom", O_RDONLY); if (sdf<0) sdf = open ("/dev/random", O_RDONLY); if (sdf>=0) { (void) read (sdf, &IHASH, sizeof(IHASH)); close (sdf); } if (! IHASH) IHASH = 5138; /* fair dice roll */ } hash = IHASH; const unsigned char* ustr = (const unsigned char*)str; for (i = 0; ustr[i]; i++) { hash = ((hash << 5) + hash) + (ustr[i] & 0xDF); } s = hash; switch (i) { /* note: fallthrough for each case */ default: case 6: hash += (s % 5779) * (ustr[6] & 0xDF); case 5: hash += (s % 4643) * (ustr[5] & 0xDF); hash ^= hash << 7; case 4: hash += (s % 271) * (ustr[4] & 0xDF); case 3: hash += (s % 1607) * (ustr[3] & 0xDF); hash ^= hash << 15; case 2: hash += (s % 7649) * (ustr[2] & 0xDF); case 1: hash += (s % 6101) * (ustr[1] & 0xDF); hash ^= hash << 25; case 0: hash += (s % 1217) * (ustr[0] & 0xDF); } /* zero is inconvenient */ if (hash == 0) hash = 154004; return hash; }
#pragma once #include "../Motion.h" #include "../SkeletonAnimated.h" class CLevelBackground { public: CLevelBackground(); ~CLevelBackground(); void Update(); void renderable_Render(); void MoveToCam(); IRender_Visual* Visual () const { return m_animations; } private: IRender_Visual* m_animations; Fmatrix m_position; bool m_visible; };
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/glue/Glue_EXPORTS.h> #include <aws/glue/GlueRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Glue { namespace Model { /** */ class AWS_GLUE_API StopTriggerRequest : public GlueRequest { public: StopTriggerRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "StopTrigger"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The name of the trigger to stop.</p> */ inline const Aws::String& GetName() const{ return m_name; } /** * <p>The name of the trigger to stop.</p> */ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** * <p>The name of the trigger to stop.</p> */ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** * <p>The name of the trigger to stop.</p> */ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** * <p>The name of the trigger to stop.</p> */ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** * <p>The name of the trigger to stop.</p> */ inline StopTriggerRequest& WithName(const Aws::String& value) { SetName(value); return *this;} /** * <p>The name of the trigger to stop.</p> */ inline StopTriggerRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** * <p>The name of the trigger to stop.</p> */ inline StopTriggerRequest& WithName(const char* value) { SetName(value); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet; }; } // namespace Model } // namespace Glue } // namespace Aws
// // PODTabBarViewController.h // POD // // Created by Wcg on 16/1/23. // Copyright © 2016年 吴朝刚. All rights reserved. // #import <UIKit/UIKit.h> @interface PODTabBarViewController : UITabBarController @end
/** @file FaBoHumidity_HTS221.h @brief This is a library for the FaBo Humidity I2C Brick. http://fabo.io/208.html Released under APACHE LICENSE, VERSION 2.0 http://www.apache.org/licenses/ @author FaBo<info@fabo.io> */ #ifndef FABOHUMIDITY_HTS221_H #define FABOHUMIDITY_HTS221_H #include <Arduino.h> #include <Wire.h> #define HTS221_SLAVE_ADDRESS 0x5F ///< I2C Slave Address #define HTS221_DEVICE_ID 0xBC ///< Who am i device identifier /// @name AV_CONF:AVGH /// Averaged humidity samples configuration /// @{ #define HTS221_AVGH_4 0b000 #define HTS221_AVGH_8 0b001 #define HTS221_AVGH_16 0b010 #define HTS221_AVGH_32 0b011 // defalut #define HTS221_AVGH_64 0b100 #define HTS221_AVGH_128 0b101 #define HTS221_AVGH_256 0b110 #define HTS221_AVGH_512 0b111 /// @} /// @name AV_CONF:AVGT // Averaged temperature samples configuration /// @{ #define HTS221_AVGT_2 0b000000 #define HTS221_AVGT_4 0b001000 #define HTS221_AVGT_8 0b010000 #define HTS221_AVGT_16 0b011000 // defalut #define HTS221_AVGT_32 0b100000 #define HTS221_AVGT_64 0b101000 #define HTS221_AVGT_128 0b110000 #define HTS221_AVGT_256 0b111000 /// @} /// @name CTRL_REG1 /// @{ #define HTS221_PD 0b10000000 ///< Power Down control #define HTS221_BDU 0b100 ///< Block Data Update control #define HTS221_ODR_ONE 0b00 ///< Output Data Rate : One Shot #define HTS221_ODR_1HZ 0b01 ///< Output Data Rate : 1Hz #define HTS221_ODR_7HZ 0b10 ///< Output Data Rate : 7Hz #define HTS221_ODR_125HZ 0b11 ///< Output Data Rate : 12.5Hz /// @} /// @name CTRL_REG2 /// @{ #define HTS221_BOOT 0b10000000 ///< Reboot memory content #define HTS221_HEATER 0b10 ///< Heater #define HTS221_ONE_SHOT 0b1 ///< One shot enable /// @} /// @name CTRL_REG3 /// @{ #define HTS221_CTRL_REG3_DEFAULT 0x00 ///< DRDY pin is no connect in FaBo Brick /// @} /// @name STATUS_REG /// @{ #define HTS221_H_DA 0x2 ///< Humidity Data Available #define HTS221_T_DA 0x1 ///< Temperature Data Available /// @} /// @name Register Addresses /// @{ #define HTS221_WHO_AM_I 0x0F #define HTS221_AV_CONF 0x10 #define HTS221_CTRL_REG1 0x20 #define HTS221_CTRL_REG2 0x21 #define HTS221_CTRL_REG3 0x22 #define HTS221_STATUS_REG 0x27 #define HTS221_HUMIDITY_OUT_L 0x28 #define HTS221_HUMIDITY_OUT_H 0x29 #define HTS221_TEMP_OUT_L 0x2A #define HTS221_TEMP_OUT_H 0x2B #define HTS221_H0_RH_X2 0x30 #define HTS221_H1_RH_X2 0x31 #define HTS221_T0_DEGC_X8 0x32 #define HTS221_T1_DEGC_X8 0x33 #define HTS221_T1_T0_MSB 0x35 #define HTS221_H0_T0_OUT_L 0x36 #define HTS221_H0_T0_OUT_H 0x37 #define HTS221_H1_T0_OUT_L 0x3A #define HTS221_H1_T0_OUT_H 0x3B #define HTS221_T0_OUT_L 0x3C #define HTS221_T0_OUT_H 0x3D #define HTS221_T1_OUT_L 0x3E #define HTS221_T1_OUT_H 0x3F /// @} /** @class FaBoHumidity_HTS221 @brief FaBo Humidity I2C Controll class */ class FaBoHumidity_HTS221 { public: FaBoHumidity_HTS221(uint8_t addr = HTS221_SLAVE_ADDRESS); bool begin(void); bool checkDevice(void); void powerOn(void); void configDevice(void); void readCoef(void); double getHumidity(void); double getTemperature(void); private: uint8_t _i2caddr; uint8_t _H0_rH_x2, _H1_rH_x2; uint16_t _T0_degC_x8, _T1_degC_x8; int16_t _H0_T0_OUT, _H1_T0_OUT; int16_t _T0_OUT, _T1_OUT; uint8_t readI2c(uint8_t registerAddr); void writeI2c(uint8_t registerAddr, uint8_t data); }; #endif // FABOHUMIDITY_HTS221_H
#pragma once #include <MessageIdentifiers.h> namespace network { enum BB_CONSOLE_MESSAGE_TYPES { BB_CONSOLE_MESSAGE_TEXT_LOG = ID_USER_PACKET_ENUM + 1, }; #pragma pack(push, 1) struct ConsoleMessageTextLog { __int64 dateSend; short foregroundR; short foregroundG; short foregroundB; short foregroundA; short backgroundR; short backgroundG; short backgroundB; short backgroundA; char log[512]; short log_length; }; #pragma pack(pop) }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "js/TypeDecls.h" #include "nsGlobalWindow.h" #include "nsIPrincipal.h" #include "nsIURI.h" #include "nsString.h" #include "xpcpublic.h" namespace mozilla { struct FeedWriterEnabled { static bool IsEnabled(JSContext* cx, JSObject* aGlobal) { // Make sure the global is a window nsGlobalWindow* win = xpc::WindowGlobalOrNull(aGlobal); if (!win) { return false; } // Make sure that the principal is about:feeds. nsCOMPtr<nsIPrincipal> principal = win->GetPrincipal(); NS_ENSURE_TRUE(principal, false); nsCOMPtr<nsIURI> uri; principal->GetURI(getter_AddRefs(uri)); if (!uri) { return false; } // First check the scheme to avoid getting long specs in the common case. bool isAbout = false; uri->SchemeIs("about", &isAbout); if (!isAbout) { return false; } // Now check the spec itself nsAutoCString spec; uri->GetSpec(spec); return spec.EqualsLiteral("about:feeds"); } }; }
/* * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org), * Additions Copyright (c) 2020, Espressif Systems (Shanghai) PTE LTD * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #pragma once #include "tusb_option.h" #include "sdkconfig.h" #ifdef __cplusplus extern "C" { #endif #ifndef CONFIG_TINYUSB_CDC_ENABLED # define CONFIG_TINYUSB_CDC_ENABLED 0 #endif #ifndef CONFIG_TINYUSB_MSC_ENABLED # define CONFIG_TINYUSB_MSC_ENABLED 0 #endif #ifndef CONFIG_TINYUSB_HID_ENABLED # define CONFIG_TINYUSB_HID_ENABLED 0 #endif #ifndef CONFIG_TINYUSB_MIDI_ENABLED # define CONFIG_TINYUSB_MIDI_ENABLED 0 #endif #ifndef CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED # define CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED 0 #endif #define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED #define CFG_TUSB_OS OPT_OS_FREERTOS /* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment. * Tinyusb use follows macros to declare transferring memory so that they can be put * into those specific section. * e.g * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") )) * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4))) */ #ifndef CFG_TUSB_MEM_SECTION # define CFG_TUSB_MEM_SECTION #endif #ifndef CFG_TUSB_MEM_ALIGN # define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4) #endif #ifndef CFG_TUD_ENDPOINT0_SIZE #define CFG_TUD_ENDPOINT0_SIZE 64 #endif // CDC FIFO size of TX and RX #define CFG_TUD_CDC_RX_BUFSIZE CONFIG_TINYUSB_CDC_RX_BUFSIZE #define CFG_TUD_CDC_TX_BUFSIZE CONFIG_TINYUSB_CDC_TX_BUFSIZE // MSC Buffer size of Device Mass storage #define CFG_TUD_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE // HID buffer size Should be sufficient to hold ID (if any) + Data #define CFG_TUD_HID_BUFSIZE CONFIG_TINYUSB_HID_BUFSIZE // Enabled device class driver #if defined(CONFIG_TINYUSB_CDC_COUNT) #define CFG_TUD_CDC CONFIG_TINYUSB_CDC_COUNT #else #define CFG_TUD_CDC 0 #endif #define CFG_TUD_MSC CONFIG_TINYUSB_MSC_ENABLED #define CFG_TUD_HID CONFIG_TINYUSB_HID_ENABLED #define CFG_TUD_MIDI CONFIG_TINYUSB_MIDI_ENABLED #define CFG_TUD_CUSTOM_CLASS CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED #ifdef __cplusplus } #endif
/* * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ /* */ #include <stdio.h> #include <sys/stat.h> #include <pwd.h> #include <fcntl.h> #include <netdb.h> #include "acquisition.h" #include "hostAcqStructs.h" int send2AcqWithAuth( int cmd_for_acq, char *msg_for_acq ) { char *ourmsg; int ival, tlen, ulen; struct passwd *getpwuid(); struct passwd *pasinfo; pasinfo = getpwuid((int) getuid()); ulen = strlen( pasinfo->pw_name ); tlen = ulen + 2 + 6 + strlen( msg_for_acq ) + 1; ourmsg = (char *) malloc( tlen ); sprintf( ourmsg, "%s,,%d\n%s", pasinfo->pw_name, getpid(), msg_for_acq ); ival = send2Acq( cmd_for_acq, ourmsg ); free( ourmsg ); return( ival ); } static int locateCdbFile( char *cdbFile ) { strcpy( cdbFile, getenv("vnmrsystem") ); if (strlen( cdbFile ) < (size_t) 1) strcpy( cdbFile, "/vnmr" ); strcat( cdbFile, "/acqqueue/console.debug" ); } static void showStmDebug( STM_DEBUG *stmdbp, int index ) { printf( "STM %d Status register: 0x%04x\n", index, stmdbp->stmStatus ); printf( "STM %d Tag register: %d\n", index, stmdbp->stmTag ); printf( "STM %d NP counter: %d\n", index, stmdbp->stmNpReg ); printf( "STM %d NT counter: %d\n", index, stmdbp->stmNtReg ); printf( "STM %d Source address: 0x%08lx\n", index, stmdbp->stmSrcAddr ); printf( "STM %d Destination address: 0x%08lx\n", index, stmdbp->stmDstAddr ); } static void showConsoleDebugStruct( CONSOLE_DEBUG *cdbp ) { int iter; printf( "Time stamp: %s", ctime( (time_t *) &cdbp->timeStamp ) ); /* ctime appends a new-line to the string it returns ... */ printf( "Magic number: %d\n", cdbp->magic ); printf( "Revision number: %d\n", cdbp->revNum ); printf( "Acquisition state: %d\n", cdbp->Acqstate ); printf( "startup system configuration: 0x%08lx\n", cdbp->startupSysConf ); printf( "current system configuration: 0x%08lx\n", cdbp->currentSysConf ); printf( "FIFO status: 0x%08lx\n", cdbp->fifoStatus ); printf( "FIFO Interrupt Mask: 0x%04x\n", cdbp->fifoIntrpMask ); printf( "FIFO Last Word: 0x%08lx 0x%08lx 0x%08lx\n", cdbp->lastFIFOword[ 0 ], cdbp->lastFIFOword[ 1 ], cdbp->lastFIFOword[ 2 ] ); printf( "ADC Status: 0x%x\n", cdbp->adcStatus ); printf( "ADC Interrupt Mask: 0x%x\n", cdbp->adcIntrpMask ); printf( "Automation Status: 0x%x\n", cdbp->autoStatus ); printf( "Automation H S & R Status: 0x%x\n", cdbp->autoHSRstatus ); for (iter = 0; iter < MAX_STM_OBJECTS; iter++) { if (STM_PRESENT( iter ) & cdbp->currentSysConf) showStmDebug( &cdbp->stmHwRegs[ iter ], iter ); else printf( "STM %d not present\n", iter ); } } showConsoleDebug( char *cdbFile ) { int cdb_fd; CDB_BLOCK cdbBlock; cdb_fd = open( cdbFile, O_RDONLY ); if (cdb_fd < 0) { fprintf( stderr, "cannot access console debug information\n" ); exit( 1 ); } read( cdb_fd, &cdbBlock.index, sizeof( cdbBlock ) - sizeof( cdbBlock.msg_type ) ); close( cdb_fd ); showConsoleDebugStruct( &cdbBlock.cdb ); } static time_t getFileMtime( char *file ) { int ival; struct stat tstat; ival = stat( file, &tstat ); if (ival != 0) return( (time_t) 0 ); else return( tstat.st_mtime ); } main( int argc, char *argv[] ) { char parameter[ 122 ], cdbFile[ 122 ], thisHostName[ MAXHOSTNAMELEN ]; int iter, ival, paramval; time_t lastModify, curModify; if (argc < 2) { fprintf( stderr, "Usage %s <startup/abort>\n", argv[ 0 ] ); exit( 1 ); } else if (strncmp( argv[ 1 ], "startup", strlen( "startup" ) ) == 0) { paramval = SYSTEM_STARTUP; } else if (strncmp( argv[ 1 ], "abort", strlen( "abort" ) ) == 0) { paramval = SYSTEM_ABORT; } else { fprintf( stderr, "Choose startup or abort as an argument\n" ); exit( 1 ); } gethostname( &thisHostName[ 0 ], sizeof( thisHostName ) ); INIT_VNMR_COMM( &thisHostName[ 0 ] ); INIT_ACQ_COMM( getenv( "vnmrsystem" ) ); locateCdbFile( &cdbFile[ 0 ] ); lastModify = getFileMtime( &cdbFile[ 0 ] ); sprintf( &parameter[ 0 ], "%d\n%d", GETCONSOLEDEBUG, paramval ); ival = send2AcqWithAuth( TRANSPARENT, &parameter[ 0 ] ); if (ival != 0) { fprintf( stderr, "Failed to contact acquisition system\n" ); exit( 1 ); } for (iter = 0; ; iter++ ) { curModify = getFileMtime( &cdbFile[ 0 ] ); /* Test succeeds if the console debug file has not been updated. */ if (curModify == (time_t) 0 || curModify <= lastModify) { if (iter > 2) { fprintf( stderr, "Acqusition system never received debug block\n" ); exit( 1 ); } else sleep( 1 ); } else break; } showConsoleDebug( &cdbFile[ 0 ] ); exit( 0 ); }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/stllike/string.h> #include <vespa/fastlib/text/unicodeutil.h> #include <vector> namespace search { /// Type of general unsigned 8 bit data. typedef unsigned char byte; /// A simple container for the raw querystack. typedef vespalib::stringref QueryPacketT; /// The type of the local documentId. typedef unsigned DocumentIdT; /// This is the type of the CollectionId used in the StorageAPI. typedef uint64_t CollectionIdT; /// The type to identify a query. typedef unsigned QueryIdT; /// The rank type. typedef unsigned RankT; /// How time type. Used to represent seconds since 1970. typedef unsigned TimeT; /// Type to identify performance counters. typedef uint64_t CounterT; /// Type to identify performance values. typedef int ValueT; /// This is a 16 byte vector used in SSE2 integer operations. typedef char v16qi __attribute__ ((__vector_size__(16))); /// This is a 2 element uint64_t vector used in SSE2 integer operations. typedef long long v2di __attribute__ ((__vector_size__(16))); /// A type to represent a list of strings. typedef std::vector<vespalib::string> StringListT; /// A type to represent a vector of 32 bit signed integers. typedef std::vector<int32_t> Int32ListT; /// A type to represent a list of document ids. typedef std::vector<DocumentIdT> DocumentIdList; /// A debug macro the does "a" when l & the mask is true. The mask is set per file. #define DEBUG(l, a) { if (l&DEBUGMASK) {a;} } #ifdef __USE_RAWDEBUG__ #define RAWDEBUG(a) a #else #define RAWDEBUG(a) #endif /// A macro avoid warnings for unused parameters. #define UNUSED_PARAM(p) /// A macro that gives you number of elements in an array. #define NELEMS(a) (sizeof(a)/sizeof(a[0])) }
// // WWTopic.h // BuDeJie // // Created by 文伟 on 16/6/3. // Copyright © 2016年 Wayne. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSInteger, WWTopicType) { /** 全部 */ WWTopicTypeAll = 1, /** 图片 */ WWTopicTypePicture = 10, /** 文字 */ WWTopicTypeWord = 29, /** 声音 */ WWTopicTypeVoice = 31, /** 视频 */ WWTopicTypeVideo = 41 }; @interface WWTopic : NSObject /** 用户的名字 */ @property (nonatomic, copy) NSString *name; /** 用户的头像 */ @property (nonatomic, copy) NSString *profile_image; /** 帖子的文字内容 */ @property (nonatomic, copy) NSString *text; /** 帖子审核通过的时间 */ @property (nonatomic, copy) NSString *passtime; /** 顶数量 */ @property (nonatomic, assign) NSInteger ding; /** 踩数量 */ @property (nonatomic, assign) NSInteger cai; /** 转发\分享数量 */ @property (nonatomic, assign) NSInteger repost; /** 评论数量 */ @property (nonatomic, assign) NSInteger comment; /** 帖子的类型 */ @property (nonatomic, assign) NSInteger type; /** 最热评论 */ @property (nonatomic, strong) NSArray *top_cmt; /** 图片的宽度 */ @property (nonatomic, assign) CGFloat width; /** 图片的高度 */ @property (nonatomic, assign) CGFloat height; /** 小图 */ @property (nonatomic, copy) NSString *image0; /** 中图 */ @property (nonatomic, copy) NSString *image2; /** 大图 */ @property (nonatomic, copy) NSString *image1; /** 播放数量 */ @property (nonatomic, assign) NSInteger playcount; /** 声音文件的长度 */ @property (nonatomic, assign) NSInteger voicetime; /** 视频文件的长度 */ @property (nonatomic, assign) NSInteger videotime; /** 是否为动态图 */ @property (nonatomic, assign) BOOL is_gif; /* 额外增加的属性(为了方便开发) */ /** 根据当前模型数据计算出来的cell高度 */ @property (nonatomic, assign) CGFloat cellHeight; @property (nonatomic, assign) CGRect middleF; @property (nonatomic, assign) BOOL isBigPicture; @end
/** * RadarFoodTruck APSHTTPClient Library * Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import <Foundation/Foundation.h> @interface APSHTTPPostForm : NSObject @property(nonatomic, readonly) NSData *requestData; @property(nonatomic, readonly) NSDictionary *requestHeaders; @property(nonatomic, readonly) NSString *contentType; -(void)setJSONData:(id)json; -(void)setStringData:(NSString*)str; -(void)appendData:(NSData*)data withContentType:(NSString*)contentType; -(void)addDictionay:(NSDictionary*)dict; -(void)addFormKey:(NSString*)key andValue:(NSString*)value; -(void)addFormFile:(NSString*)path; -(void)addFormFile:(NSString*)path fieldName:(NSString*)name; -(void)addFormFile:(NSString*)path fieldName:(NSString*)name contentType:(NSString*)contentType; -(void)addFormData:(NSData*)data; -(void)addFormData:(NSData*)data fileName:(NSString*)fileName; -(void)addFormData:(NSData*)data fileName:(NSString*)fileName fieldName:(NSString*)fieldName; -(void)addFormData:(NSData*)data fileName:(NSString*)fileName fieldName:(NSString*)fieldName contentType:(NSString*)contentType; -(void)addHeaderKey:(NSString*)key andHeaderValue:(NSString*)value; @end
// Copyright 2012 Felipe Cypriano // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <Foundation/Foundation.h> @interface TrackingService : NSObject<NSURLConnectionDelegate> - (void)trackUsageWithKey:(NSString *)usageKey; - (void)trackUsageWithTarget:(id)target selector:(SEL)selector; @end
// // MANaviAnnotation.h // OfficialDemo3D // // Created by yi chen on 1/7/15. // Copyright (c) 2015 songjian. All rights reserved. // #import <Foundation/Foundation.h> #import <MAMapKit/MAMapKit.h> typedef NS_ENUM(NSInteger, MANaviType) { MANaviType_Drive = 1, MANaviType_Walking = 2, MANaviType_Bus = 3 }; @interface MANaviAnnotation : MAPointAnnotation @property (nonatomic) MANaviType type; @end
// // Copyright (c) 2014 Limit Point Systems, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Interface for class binary_section_component_iterator #ifndef BINARY_SECTION_COMPONENT_ITERATOR_H #define BINARY_SECTION_COMPONENT_ITERATOR_H #ifndef SHEAF_DLL_SPEC_H #include "SheafSystem/sheaf_dll_spec.h" #endif #ifndef SECTION_COMPONENT_ITERATOR_H #include "SheafSystem/section_component_iterator.h" #endif namespace fiber_bundle { class binary_section_space_schema_member; /// /// Iterates in postorder over dofs of a schema member anchor. /// Attaches an a handle of type section_space_schema_member to the /// current member of the iteration. /// class SHEAF_DLL_SPEC binary_section_component_iterator : public section_component_iterator { public: // CANONICAL MEMBERS /// /// Default constructor; creates an unattached iterator. /// Protected because this class is abstract. /// binary_section_component_iterator(); /// /// Copy constructor; attaches this to the same anchor as xother. /// Protected because this class is abstract. /// binary_section_component_iterator(const binary_section_component_iterator& xother); /// /// Assignment operator /// virtual binary_section_component_iterator& operator=(const section_component_iterator& xother); /// /// Assignment operator /// binary_section_component_iterator& operator=(const binary_section_component_iterator& xother); /// /// Destructor /// virtual ~binary_section_component_iterator(); /// /// True if other conforms to this /// virtual bool is_ancestor_of(const any* other) const; /// /// Make a new instance of the same type as this /// virtual binary_section_component_iterator* clone() const; /// /// The class invariant. /// bool invariant() const; // OTHER CONSTRUCTORS /// /// Creates an iterator anchored at xanchor. /// explicit binary_section_component_iterator(const binary_section_space_schema_member& xanchor); // Explicit above prevents interpretation as conversion from abstract_poset_meber // ITERATOR FACET // Anchor is not virtual; covariant signature hides // inherited version. /// /// The schema member whose downset is being iterated over; /// the top member of the domain of iteration. /// const binary_section_space_schema_member& anchor() const; // COMPONENT ITERATOR FACET // Item is not virtual; covariant signature hides // inherited version. /// /// The the current member of the iteration. /// const binary_section_space_schema_member& item() const; /// /// True if xmbr conforms to the type of item of this. /// virtual bool item_is_ancestor_of(const section_space_schema_member& xmbr) const; protected: /// /// Creates item if needed and attaches it to the current index. /// Abstract in this class; intended to be redefined in descendants. /// virtual void reset_item(); }; } // namespace fiber_bundle #endif // ifndef BINARY_SECTION_COMPONENT_ITERATOR_H
/* * Copyright (C) 2012 BMW Car IT GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CAPU_BINARYOUTPUTSTREAMTEST_H #define CAPU_BINARYOUTPUTSTREAMTEST_H #include "gmock/gmock.h" #include <capu/util/BinaryOutputStream.h> namespace capu { class BinaryOutputStreamTest : public testing::Test { public: BinaryOutputStreamTest(); ~BinaryOutputStreamTest(); void SetUp(); void TearDown(); protected: }; } #endif // CAPU_BINARYOUTPUTSTREAMTEST_H
/* Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <jni.h> /* * Method: org.apache.harmony.vts.test.vm.jni.exceptions.ThrowTest.nativeExecute(I)V * Throws: org.apache.harmony.vts.test.vm.jni.exceptions.ExceptionClass */ JNIEXPORT void JNICALL Java_org_apache_harmony_vts_test_vm_jni_exceptions_ThrowTest_nativeExecute (JNIEnv *env, jobject this_object, jint value) { jclass exception_class; jmethodID constructor_method; jobject exception_object; exception_class = (*env)->FindClass(env, "org/apache/harmony/vts/test/vm/jni/exceptions/ExceptionClass"); if (NULL == exception_class) return; constructor_method = (*env)->GetMethodID(env, exception_class, "<init>", "(I)V"); if (NULL == constructor_method) return; exception_object = (*env)->NewObject(env, exception_class, constructor_method, value); if (NULL == exception_object) return; (*env)->Throw(env, exception_object); }
/* -------------------------------------------------------------------- */ /* ACCORDS PLATFORM */ /* (C) 2011 by Iain James Marshall (Prologue) <ijm667@hotmail.com> */ /* -------------------------------------------------------------------- */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ /* implied. */ /* See the License for the specific language governing permissions and */ /* limitations under the License. */ /* -------------------------------------------------------------------- */ /* STRUKT WARNING : this file has been generated and should not be modified by hand */ #ifndef _file_c_ #define _file_c_ #include "element.h" #include "file.h" /* -------------------------------------- */ /* l i b e r a t e _ c o r d s _ f i l e */ /* -------------------------------------- */ public struct cords_file * liberate_cords_file(struct cords_file * sptr) { if ( sptr ) { if ( sptr->id ) sptr->id = liberate(sptr->id); if ( sptr->name ) sptr->name = liberate(sptr->name); if ( sptr->type ) sptr->type = liberate(sptr->type); if ( sptr->permissions ) sptr->permissions = liberate(sptr->permissions); sptr = liberate( sptr ); } return((struct cords_file *) 0); } /* -------------------------------- */ /* r e s e t _ c o r d s _ f i l e */ /* -------------------------------- */ public struct cords_file * reset_cords_file(struct cords_file * sptr) { if ( sptr ) { sptr->id = (char*) 0; sptr->state = 0; sptr->length = 0; sptr->name = (char*) 0; sptr->type = (char*) 0; sptr->permissions = (char*) 0; } return(sptr); } /* -------------------------------------- */ /* a l l o c a t e _ c o r d s _ f i l e */ /* -------------------------------------- */ public struct cords_file * allocate_cords_file() { struct cords_file * sptr; if (!( sptr = allocate( sizeof( struct cords_file ) ) )) return( sptr ); else return( reset_cords_file(sptr) ); } /* -------------------------------- */ /* x m l i n _ c o r d s _ f i l e */ /* -------------------------------- */ public int xmlin_cords_file(struct cords_file * sptr,struct xml_element * eptr) { struct xml_element * wptr; if (!( eptr )) return(0); if (!( sptr )) return(0); for ( wptr=eptr->first; wptr != (struct xml_element *) 0; wptr=wptr->next) { if (!( strcmp(wptr->name,"id") )) { if ( wptr->value ) { sptr->id = allocate_string(wptr->value); } } else if (!( strcmp(wptr->name,"state") )) { if ( wptr->value ) { sptr->state = atoi(wptr->value); } } else if (!( strcmp(wptr->name,"length") )) { if ( wptr->value ) { sptr->length = atoi(wptr->value); } } else if (!( strcmp(wptr->name,"name") )) { if ( wptr->value ) { sptr->name = allocate_string(wptr->value); } } else if (!( strcmp(wptr->name,"type") )) { if ( wptr->value ) { sptr->type = allocate_string(wptr->value); } } else if (!( strcmp(wptr->name,"permissions") )) { if ( wptr->value ) { sptr->permissions = allocate_string(wptr->value); } } } return(0); } /* ---------------------------------------- */ /* r e s t _ o c c i _ c o r d s _ f i l e */ /* ---------------------------------------- */ public int rest_occi_cords_file(FILE * fh,struct cords_file * sptr,char * prefix, char * nptr) { struct xml_element * wptr; if (!( sptr )) return(0); fprintf(fh,"POST /%s/ HTTP/1.1\r\n",nptr); fprintf(fh,"Category: %s; scheme='http://scheme.%s.org/occi/%s#'; class='kind';\r\n",nptr,prefix,prefix); fprintf(fh,"X-OCCI-Attribute: %s.%s.id='%s'\r\n",prefix,nptr,(sptr->id?sptr->id:"")); fprintf(fh,"X-OCCI-Attribute: %s.%s.state='%u'\r\n",prefix,nptr,sptr->state); fprintf(fh,"X-OCCI-Attribute: %s.%s.length='%u'\r\n",prefix,nptr,sptr->length); fprintf(fh,"X-OCCI-Attribute: %s.%s.name='%s'\r\n",prefix,nptr,(sptr->name?sptr->name:"")); fprintf(fh,"X-OCCI-Attribute: %s.%s.type='%s'\r\n",prefix,nptr,(sptr->type?sptr->type:"")); fprintf(fh,"X-OCCI-Attribute: %s.%s.permissions='%s'\r\n",prefix,nptr,(sptr->permissions?sptr->permissions:"")); return(0); } #endif /* _file_cfile_c_ */
/** * Copyright 2020 Google ML Kit team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <UIKit/UIKit.h> @class MLKResult; @class MLKResultListHeaderView; @class MDCFlexibleHeaderViewController; NS_ASSUME_NONNULL_BEGIN /** View controller showing a list of products. */ @interface MLKResultListViewController : UICollectionViewController /** * Header of the list, it stays on top of the screen when it expands to the whole screen and * contents will be scrolled underneath it. */ @property(nonatomic) MDCFlexibleHeaderViewController *headerViewController; /** Header view for this panel view. */ @property(nonatomic) MLKResultListHeaderView *headerView; /** * Initializes and returns a `ProductListViewController` object using the provided product list. * * @param products List of the products that serves as the model to this view. * @return An instance of the `ProductListViewController`. */ - (instancetype)initWithResults:(NSArray<MLKResult *> *)products; /** Calculates and updates minimum and maximum height for header view. */ - (void)updateMinMaxHeightForHeaderView; @end NS_ASSUME_NONNULL_END
/******************************************************************************* * Copyright 2016 Tourmaline Labs, Inc. All rights reserved. * Confidential & Proprietary - Tourmaline Labs, Inc. ("TLI") * * The party receiving this software directly from TLI (the "Recipient") * may use this software as reasonably necessary solely for the purposes * set forth in the agreement between the Recipient and TLI (the * "Agreement"). The software may be used in source code form solely by * the Recipient's employees (if any) authorized by the Agreement. Unless * expressly authorized in the Agreement, the Recipient may not sublicense, * assign, transfer or otherwise provide the source code to any third * party. Tourmaline Labs, Inc. retains all ownership rights in and * to the software * * This notice supersedes any other TLI notices contained within the software * except copyright notices indicating different years of publication for * different portions of the software. This notice does not supersede the * application of any third party copyright notice to that third party's * code. ******************************************************************************/ #import <TLKit/CKDrive.h> NS_ASSUME_NONNULL_BEGIN @interface CKDrive (Format) - (NSString *)formattedID; - (NSString *)formattedType; - (NSString *)formattedState; - (NSString *)formattedAnalysisState; - (NSString *)formattedDistance; - (NSString *)formattedStartTime; - (NSString *)formattedEndTime; - (NSString *)formattedStartLocation; - (NSString *)formattedEndLocation; - (NSString *)formattedStartAddress; - (NSString *)formattedEndAddress; @end NS_ASSUME_NONNULL_END
// // WBHomeMenuButton.h // WeiBo // // Created by wbs on 17/3/8. // Copyright © 2017年 xiaomaolv. All rights reserved. // #import <UIKit/UIKit.h> @interface WBHomeMenuButton : UIButton @end
// // PPChatInputView.h // PPChat // // Created by jiaguanglei on 15/9/15. // Copyright (c) 2015年 roseonly. All rights reserved. // #import <UIKit/UIKit.h> @interface PPChatInputView : UIView /** * 添加文件 */ @property (weak, nonatomic) IBOutlet UIButton *addBtn; /** * 输入框 */ @property (weak, nonatomic) IBOutlet UITextView *textView; /** * 快速创建对象 */ + (instancetype)inputView; @end
// // AppDelegate.h // YJGuideView // // Created by YJHou on 2016/12/16. // Copyright © 2016年 YJHou. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP 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. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1990, 1991 Network Computing Devices; * Portions Copyright 1987 by Digital Equipment Corporation * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the names of Network Computing Devices, * or Digital not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Network Computing Devices, or Digital * make no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, OR DIGITAL BE * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifndef _SITE_H_ #define _SITE_H_ /* * site dependent definitions */ /* after twice this amount of time (in seconds) with no input from the * client, it'll be toasted */ #define CLIENT_TIMEOUT 600 #define DEFAULT_TIMEOUT 60 #define DEFAULT_CLIENT_LIMIT 20 #endif /* _SITE_H_ */
#include "test.h" static enum TestResult test_available(void) { // Use a random non-zero request, so that qemu doesn't complain about // an unsupported ioctl. if (linux_ioctl(0, linux_TIOCGPGRP, 0, 0) == linux_ENOSYS) return TEST_NOT_SUPPORTED; return TEST_SUCCESS; } BEGIN_TEST() DO_TEST(test_available, "Syscall is available"); END_TEST()
/* Copyright 2019 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <assert.h> #include <errno.h> #include "buffer.h" #include "instruction.h" #include "libcronus_private.h" #include "libcronus.h" int cronus_getcfam(struct cronus_context *cctx, int pib_index, uint32_t addr, uint32_t *value) { struct cronus_buffer cbuf_request, cbuf_reply; struct cronus_reply reply; char devstr[4] = "0\0\0\0"; uint32_t flags, key; uint32_t capacity, bits; int ret; assert(pib_index == 0 || pib_index == 1); devstr[0] = '1' + pib_index; ret = cbuf_new(&cbuf_request, 1024); if (ret) return ret; key = cronus_key(cctx); /* number of commands */ cbuf_write_uint32(&cbuf_request, 1); /* header */ cbuf_write_uint32(&cbuf_request, key); cbuf_write_uint32(&cbuf_request, INSTRUCTION_TYPE_FSI); cbuf_write_uint32(&cbuf_request, 7 * sizeof(uint32_t)); // payload size flags = INSTRUCTION_FLAG_DEVSTR | \ INSTRUCTION_FLAG_CFAM_MAILBOX | \ INSTRUCTION_FLAG_NO_PIB_RESET; /* payload */ cbuf_write_uint32(&cbuf_request, 5); // version cbuf_write_uint32(&cbuf_request, INSTRUCTION_CMD_READSPMEM); cbuf_write_uint32(&cbuf_request, flags); cbuf_write_uint32(&cbuf_request, addr); cbuf_write_uint32(&cbuf_request, 8 * sizeof(uint32_t)); // data size in bits cbuf_write_uint32(&cbuf_request, sizeof(devstr)); cbuf_write(&cbuf_request, (uint8_t *)devstr, sizeof(devstr)); ret = cronus_request(cctx, key, 0, &cbuf_request, &cbuf_reply); if (ret) { fprintf(stderr, "Failed to talk to server\n"); return ret; } ret = cronus_parse_reply(key, &cbuf_reply, &reply); if (ret) { fprintf(stderr, "Failed to parse reply\n"); return ret; } cbuf_free(&cbuf_reply); if (reply.rc != SERVER_COMMAND_COMPLETE) { fprintf(stderr, "%s\n", reply.error); return EIO; } cbuf_init(&cbuf_reply, reply.data, reply.data_len); cbuf_read_uint32(&cbuf_reply, &capacity); if (capacity != 0x00000020) { fprintf(stderr, "Invalid capacity 0x%x\n", capacity); return EPROTO; } cbuf_read_uint32(&cbuf_reply, &bits); if (bits != 0x00000020) { fprintf(stderr, "Invalid number of bits 0x%x\n", bits); return EPROTO; } cbuf_read_uint32(&cbuf_reply, value); return 0; } int cronus_putcfam(struct cronus_context *cctx, int pib_index, uint32_t addr, uint32_t value) { struct cronus_buffer cbuf_request, cbuf_reply; struct cronus_reply reply; char devstr[4] = "0\0\0\0"; uint32_t flags, key; int ret; assert(pib_index == 0 || pib_index == 1); devstr[0] = '1' + pib_index; ret = cbuf_new(&cbuf_request, 1024); if (ret) return ret; key = cronus_key(cctx); /* number of commands */ cbuf_write_uint32(&cbuf_request, 1); /* header */ cbuf_write_uint32(&cbuf_request, key); cbuf_write_uint32(&cbuf_request, INSTRUCTION_TYPE_FSI); cbuf_write_uint32(&cbuf_request, 11 * sizeof(uint32_t)); // payload size flags = INSTRUCTION_FLAG_DEVSTR | \ INSTRUCTION_FLAG_CFAM_MAILBOX | \ INSTRUCTION_FLAG_NO_PIB_RESET; /* payload */ cbuf_write_uint32(&cbuf_request, 5); // version cbuf_write_uint32(&cbuf_request, INSTRUCTION_CMD_WRITESPMEM); cbuf_write_uint32(&cbuf_request, flags); cbuf_write_uint32(&cbuf_request, addr); cbuf_write_uint32(&cbuf_request, 8 * sizeof(uint32_t)); // data size in bits cbuf_write_uint32(&cbuf_request, sizeof(devstr)); cbuf_write_uint32(&cbuf_request, (1 + 1 + 1) * sizeof(uint32_t)); // size of value cbuf_write(&cbuf_request, (uint8_t *)devstr, sizeof(devstr)); cbuf_write_uint32(&cbuf_request, 8 * sizeof(uint32_t)); // capacity in bits cbuf_write_uint32(&cbuf_request, 8 * sizeof(uint32_t)); // length in bits cbuf_write_uint32(&cbuf_request, value); ret = cronus_request(cctx, key, 0, &cbuf_request, &cbuf_reply); if (ret) { fprintf(stderr, "Failed to talk to server\n"); return ret; } ret = cronus_parse_reply(key, &cbuf_reply, &reply); if (ret) { fprintf(stderr, "Failed to parse reply\n"); return ret; } cbuf_free(&cbuf_request); cbuf_free(&cbuf_reply); if (reply.rc != SERVER_COMMAND_COMPLETE) { fprintf(stderr, "%s\n", reply.error); return EIO; } return 0; }
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/sns/SNS_EXPORTS.h> #include <aws/sns/SNSRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace SNS { namespace Model { /** * <p>Input for the OptInPhoneNumber action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumberInput">AWS * API Reference</a></p> */ class AWS_SNS_API OptInPhoneNumberRequest : public SNSRequest { public: OptInPhoneNumberRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "OptInPhoneNumber"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** * <p>The phone number to opt in.</p> */ inline const Aws::String& GetPhoneNumber() const{ return m_phoneNumber; } /** * <p>The phone number to opt in.</p> */ inline void SetPhoneNumber(const Aws::String& value) { m_phoneNumberHasBeenSet = true; m_phoneNumber = value; } /** * <p>The phone number to opt in.</p> */ inline void SetPhoneNumber(Aws::String&& value) { m_phoneNumberHasBeenSet = true; m_phoneNumber = std::move(value); } /** * <p>The phone number to opt in.</p> */ inline void SetPhoneNumber(const char* value) { m_phoneNumberHasBeenSet = true; m_phoneNumber.assign(value); } /** * <p>The phone number to opt in.</p> */ inline OptInPhoneNumberRequest& WithPhoneNumber(const Aws::String& value) { SetPhoneNumber(value); return *this;} /** * <p>The phone number to opt in.</p> */ inline OptInPhoneNumberRequest& WithPhoneNumber(Aws::String&& value) { SetPhoneNumber(std::move(value)); return *this;} /** * <p>The phone number to opt in.</p> */ inline OptInPhoneNumberRequest& WithPhoneNumber(const char* value) { SetPhoneNumber(value); return *this;} private: Aws::String m_phoneNumber; bool m_phoneNumberHasBeenSet; }; } // namespace Model } // namespace SNS } // namespace Aws
#include "syscall.h" #include "stdio.h" #include "stdlib.h" /* Tests Proj2 Task 3 that includes the functionality of exit(), join(), and * exec(). */ int main() { char* fileEcho, fileNotExist; int argc; char* execString; char* joinString; char* argv1[2]; char* argv2[2]; int pid1, pid2, pid3, pid4; int status1, status2, status3, status4; int joinRetVal1, joinRetVal2, joinRetVal3, joinRetVal4; /* Normal test case. */ printf("\nProj2_Task3_Test2: Normal Test Case"); fileEcho = "echo.coff" ; execString = "exec what what"; argv1[0] = execString; argv1[1] = execString; argc = 1; status1 = 9999; pid1 = exec(fileEcho, argc, &execString); assert(pid1 == 1); joinRetVal1 = join(pid1, &status1); assert(joinRetVal1 == 1); assert(status1 == 0); /* Interleaving Test Case. */ printf("\nProj2_Task3_Test2: Interleaving Normal Test Case"); joinString = "join whadda whadda"; argv2[0] = joinString; argv2[1] = joinString; status2 = 9000; status3 = 1337; pid2 = exec(fileEcho, argc, &execString); assert(pid2 == 2); pid3 = exec(fileEcho, argc, &joinString); assert(pid3 == 3); joinRetVal2 = join(pid2, &status2); assert(joinRetVal2 == 1); assert(status2 == 0); joinRetVal3 = join(pid3, &status3); assert(joinRetVal3 == 1); assert(status3 == 0); //assert(joinRetVal2 == 1); //assert(joinRetVal3 == 1); /* Broken Test Case. */ printf("\nProj2_Task3_Test2: Normal Test Case"); fileNotExist = "hello.coff"; status4 = 1000; pid4 = exec(fileNotExist, argc, &execString); assert(pid4 == -1); joinRetVal4 = join(pid4, &status4); assert(joinRetVal4 == -1); assert(status3 == 0); /* Test the correct exit call. */ exit(1); }
// Copyright 2017 Per Grön. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #include <stdexcept> #include <string> namespace shk { class PathError : public std::runtime_error { public: template <typename string_type> explicit PathError(const string_type &what, const std::string &path) : runtime_error(what), _what(what), _path(path) {} virtual const char *what() const throw() { return _what.c_str(); } const std::string &path() const { return _path; } private: const std::string _what; const std::string _path; }; } // namespace shk
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/appengine/v1/appengine.proto #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INTERNAL_APPLICATIONS_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INTERNAL_APPLICATIONS_LOGGING_DECORATOR_H #include "google/cloud/appengine/internal/applications_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" #include <google/longrunning/operations.grpc.pb.h> #include <memory> #include <set> #include <string> namespace google { namespace cloud { namespace appengine_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN class ApplicationsLogging : public ApplicationsStub { public: ~ApplicationsLogging() override = default; ApplicationsLogging(std::shared_ptr<ApplicationsStub> child, TracingOptions tracing_options, std::set<std::string> components); StatusOr<google::appengine::v1::Application> GetApplication( grpc::ClientContext& context, google::appengine::v1::GetApplicationRequest const& request) override; future<StatusOr<google::longrunning::Operation>> AsyncCreateApplication( google::cloud::CompletionQueue& cq, std::unique_ptr<grpc::ClientContext> context, google::appengine::v1::CreateApplicationRequest const& request) override; future<StatusOr<google::longrunning::Operation>> AsyncUpdateApplication( google::cloud::CompletionQueue& cq, std::unique_ptr<grpc::ClientContext> context, google::appengine::v1::UpdateApplicationRequest const& request) override; future<StatusOr<google::longrunning::Operation>> AsyncRepairApplication( google::cloud::CompletionQueue& cq, std::unique_ptr<grpc::ClientContext> context, google::appengine::v1::RepairApplicationRequest const& request) override; future<StatusOr<google::longrunning::Operation>> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::unique_ptr<grpc::ClientContext> context, google::longrunning::GetOperationRequest const& request) override; future<Status> AsyncCancelOperation( google::cloud::CompletionQueue& cq, std::unique_ptr<grpc::ClientContext> context, google::longrunning::CancelOperationRequest const& request) override; private: std::shared_ptr<ApplicationsStub> child_; TracingOptions tracing_options_; std::set<std::string> components_; }; // ApplicationsLogging GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_internal } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INTERNAL_APPLICATIONS_LOGGING_DECORATOR_H
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ // A good bit of this code was derived from the Three20 project // and was customized to work inside NewsPaper // // All modifications by NewsPaper are licensed under // the Apache License, Version 2.0 // // // Copyright 2009 Facebook // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #ifdef USE_TI_UIDASHBOARDVIEW #import <UIKit/UIKit.h> @class LauncherButton; @class LauncherItem; @protocol LauncherViewDelegate; @interface LauncherView : UIView<UIScrollViewDelegate> { @private id<LauncherViewDelegate> delegate; UIScrollView *scrollView; UIPageControl *pager; NSMutableArray *pages; NSMutableArray *buttons; NSInteger columnCount; NSInteger rowCount; LauncherButton *dragButton; NSTimer* editHoldTimer; NSTimer* springLoadTimer; UITouch* dragTouch; NSInteger positionOrigin; CGPoint dragOrigin; CGPoint touchOrigin; BOOL editing; BOOL springing; BOOL editable; BOOL renderingButtons; } @property(nonatomic) NSInteger columnCount; @property(nonatomic) NSInteger rowCount; @property(nonatomic) NSInteger currentPageIndex; @property(nonatomic,assign) id<LauncherViewDelegate> delegate; @property(nonatomic,readonly) BOOL editing; @property(nonatomic,assign) BOOL editable; - (id)initWithFrame:(CGRect)frame withRowCount:(int)newRowCount withColumnCount:(int)newColumnCount; - (void)addItem:(LauncherItem*)item animated:(BOOL)animated; - (void)removeItem:(LauncherItem*)item animated:(BOOL)animated; - (void)beginEditing; - (void)endEditing; - (void)recreateButtons; - (void)layoutButtons; - (LauncherItem*)itemForIndex:(NSInteger)index; - (NSArray*)launcheritems_; - (NSArray*)items; @end @protocol LauncherViewDelegate <NSObject> @optional - (void)launcherView:(LauncherView*)launcher didAddItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didRemoveItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher willDragItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didDragItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didMoveItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didSelectItem:(LauncherItem*)item; - (void)launcherViewDidBeginEditing:(LauncherView*)launcher; - (void)launcherViewDidEndEditing:(LauncherView*)launcher; - (BOOL)launcherViewShouldWobble:(LauncherView*)launcher; - (void)launcherView:(LauncherView*)launcher didChangePage:(NSNumber*)pageNo; @end #endif
/** * @file console_device.h * */ /* PowerOS, Copyright (C) 2014. All rights reserved. */ #include "types.h" #include "devices.h" #include "interrupts.h" #include "exec_interface.h" #define DUB_STOPPED (1<<0) #define DUB_IS_SERVICE (1<<7) #define MAX_CMD CMD_NONSTD #define HIGH_KEYCODE 0x7F #define RESET_CODE 0x78 #define OVERFLOW_CODE 0x7D #define MATRIX_BYTES (HIGH_KEYCODE+8)/8 #define KBDBUFSIZE 32 #define IKC_SIZE 10 #define KBD_ADDRESETHANDLER 9 #define KBD_REMRESETHANDLER 10 #define KBD_RESETHANDLERDONE 11 #define KBD_READMATRIX 12 #define KBD_READEVENT 13 #define KEY_MOD_LEFT_CTRL 0x01 #define KEY_MOD_LEFT_SHIFT 0x02 #define KEY_MOD_LEFT_ALT 0x04 #define KEY_MOD_LEFT_SUPER 0x08 #define KEY_MOD_RIGHT_CTRL 0x10 #define KEY_MOD_RIGHT_SHIFT 0x20 #define KEY_MOD_RIGHT_ALT 0x40 #define KEY_MOD_RIGHT_SUPER 0x80 #define KEY_ARROW_UP 0x01 #define KEY_ARROW_DOWN 0x02 #define KEY_ARROW_LEFT 0x04 #define KEY_ARROW_RIGHT 0x08 #define KEY_PAGE_UP 0x10 #define KEY_PAGE_DOWN 0x20 typedef struct KbdBase { Device dev_Device; pSysBase dev_SysBase; struct Unit Unit; pInterrupt KbdInt; uint32_t BufHead; uint32_t BufTail; uint8_t BufQueue[KBDBUFSIZE]; List HandlerList; uint16_t OutstandingResetHandlers; BOOL E0Key; uint32_t Modifiers; uint32_t SpecialKey; // uint32_t Flags; // uint32_t Shifts; uint8_t Matrix[MATRIX_BYTES]; // pTask dev_BootTask; // pTask dev_Task; // pMsgPort dev_Port; // ConsoleUnit dev_Unit[1]; } KbdBase_t, *pKbdBase;
/* * Copyright 2014-2016 Nippon Telegraph and Telephone Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file ofp_flow_mod_apis.h * @brief Agent/Data-Plane APIs for ofp_flow_mod * @details Describe APIs between Agent and Data-Plane for ofp_flow_mod. */ #ifndef __LAGOPUS_OFP_FLOW_MOD_APIS_H__ #define __LAGOPUS_OFP_FLOW_MOD_APIS_H__ #include "lagopus_apis.h" #include "openflow.h" #include "lagopus/flowdb.h" #include "lagopus/bridge.h" /* in flow.c */ /* FlowMod */ /** * Add entry to a flow table for \b OFPT_FLOW_MOD(OFPFC_ADD). * * @param[in] dpid Datapath id. * @param[in] flow_mod A pointer to \e flow_mod structure. * @param[in] match_list A pointer to list of match structures. * @param[in] instruction_list A pointer to list of * instruction structures. * @param[out] error A pointer to \e ofp_error structure. * If errors occur, set filed values. * * @retval LAGOPUS_RESULT_OK Succeeded. * @retval LAGOPUS_RESULT_ANY_FAILURES Failed. * * @details Check ofp_flow_mod.flags(OFPFF_SEND_FLOW_REM, * OFPFF_CHECK_OVERLAP, etc.) in this function. * * @details The \e free() of a list element is executed * by the Data-Plane side. */ lagopus_result_t ofp_flow_mod_check_add(uint64_t dpid, struct ofp_flow_mod *flow_mod, struct match_list *match_list, struct instruction_list *instruction_list, struct ofp_error *error); /** * Modify entry in flow tables for \b OFPT_FLOW_MOD(OFPFC_MODIFY*). * * @param[in] dpid Datapath id. * @param[in] flow_mod A pointer to \e flow_mod structure. * @param[in] match_list A pointer to list of match structures. * @param[in] instruction_list A pointer to list of * instruction structures. * @param[out] error A pointer to \e ofp_error structure. * If errors occur, set filed values. * * @retval LAGOPUS_RESULT_OK Succeeded. * @retval LAGOPUS_RESULT_ANY_FAILURES Failed. * * @details The \e free() of a list element is executed * by the Data-Plane side. */ lagopus_result_t ofp_flow_mod_modify(uint64_t dpid, struct ofp_flow_mod *flow_mod, struct match_list *match_list, struct instruction_list *instruction_list, struct ofp_error *error); /** * Delete entry in flow tables for \b OFPT_FLOW_MOD(OFPFC_DELETE*). * * @param[in] dpid Datapath id. * @param[in] flow_mod A pointer to \e flow_mod structure. * @param[in] match_list A pointer to list of match structures. * @param[out] error A pointer to \e ofp_error structure. * If errors occur, set filed values. * * @retval LAGOPUS_RESULT_OK Succeeded. * @retval LAGOPUS_RESULT_ANY_FAILURES Failed. * * @details The \e free() of a list element is executed * by the Data-Plane side. */ lagopus_result_t ofp_flow_mod_delete(uint64_t dpid, struct ofp_flow_mod *flow_mod, struct match_list *match_list, struct ofp_error *error); /* FlowMod END */ #endif /* __LAGOPUS_OFP_FLOW_MOD_APIS_H__ */
//----------------------------------------------------------------------------- // USER IMPLEMENTATION // This file contains compile-time options for ImGui. // Other options (memory allocation overrides, callbacks, etc.) can be set at // runtime via the ImGuiIO structure - ImGui::GetIO(). //----------------------------------------------------------------------------- #pragma once //---- Define assertion handler. Defaults to calling assert(). //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) //---- Define attributes of all API symbols declarations, e.g. for DLL under // Windows. //#define IMGUI_API __declspec( dllexport ) //#define IMGUI_API __declspec( dllimport ) //---- Include imgui_user.h at the end of imgui.h //#define IMGUI_INCLUDE_IMGUI_USER_H //---- Don't implement default handlers for Windows (so as not to link with // OpenClipboard() and others Win32 functions) //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS //---- Don't implement test window functionality //(ShowTestWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty) //---- It is very strongly recommended to NOT disable the test windows. Please // read the comment at the top of imgui_demo.cpp to learn why. //#define IMGUI_DISABLE_TEST_WINDOWS //---- Don't define obsolete functions names //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS //---- Pack colors to BGRA instead of RGBA (remove need to post process vertex // buffer in back ends) //#define IMGUI_USE_BGRA_PACKED_COLOR //---- Implement STB libraries in a namespace to avoid conflicts //#define IMGUI_STB_NAMESPACE ImGuiStb //---- Define constructor and implicit cast operators to convert back<>forth // from your math types and ImVec2/ImColor4f. #include "../Coordinates.h" #define IM_VEC2_CLASS_EXTRA \ ImVec2(const Vec2 &f) { \ x = f.x; \ y = f.y; \ } \ Vec2 ToVec2() { return Vec2(x, y); } \ operator Vec2() const { return Vec2(x, y); } /* #define IM_VEC4_CLASS_EXTRA \ ImColor4f(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ operator MyVec4() const { return MyVec4(x,y,z,w); } */ //---- Use 32-bit vertex indices (instead of default: 16-bit) to allow meshes // with more than 64K vertices //#define ImDrawIdx unsigned int //---- Tip: You can add extra functions within the ImGui:: namespace, here or in // your own headers files. //---- e.g. create variants of the ImGui::Value() helper for your low-level math // types, or your own widgets/helpers. /* namespace ImGui { void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL); } */
// // MGSSyntaxParserClient.h // Fragaria // // Created by Daniele Cattaneo on 30/10/2018. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** Syntax groups are tags for identifying tokens in the text that must be * coloured. Some syntax group tags are pre-defined by Fragaria, but parsers can make * up new syntax groups if they wish. * * User-defined syntax groups can also be declared as a sub-group of an * existing group by using dot notation. Sub-groups can have custom * colouring settings, but recursively fallback to the settings of the * supergroup otherwise. For example, "number.hex" is a subgroup of * the "number" group. */ typedef NSString *MGSSyntaxGroup NS_EXTENSIBLE_STRING_ENUM; /** Syntax group for numeric literals */ extern MGSSyntaxGroup const MGSSyntaxGroupNumber; /** Syntax group for language keywords */ extern MGSSyntaxGroup const MGSSyntaxGroupKeyword; /** Syntax group for variable identifiers */ extern MGSSyntaxGroup const MGSSyntaxGroupVariable; /** Syntax group for string literals */ extern MGSSyntaxGroup const MGSSyntaxGroupString; /** Syntax group for comments */ extern MGSSyntaxGroup const MGSSyntaxGroupComment; /** Syntax group for commands. By "commands" we intend any * semantically imperative syntax which is not a keyword and * defines a structure that can contain attributes. * @note Since the definition of "commands" is fuzzy, it is * advisable to specialize this group whenever possible. */ extern MGSSyntaxGroup const MGSSyntaxGroupCommand; /** Syntax group for instructions. By "instructions" we intend * semantically imperative syntax and/or keywords distinct in * use from the MGSSyntaxGroupKeyword group. * @note Since the definition of "instructions" is fuzzy, it is * advisable to specialize this group whenever possible. */ extern MGSSyntaxGroup const MGSSyntaxGroupInstruction; /** Syntax group for keywords also used as the auto-completion set. */ extern MGSSyntaxGroup const MGSSyntaxGroupAutoComplete; /** Syntax group for attributes. Attributes are the left hand * side in structures of the form <lhs>=<rhs>. This corresponds * to the attributes in HTML. Attributes can only appear inside * commands. * @note Since the definition of "attributes" is overly specialized, * it is advisable to not use this syntax group in custom parsers. */ extern MGSSyntaxGroup const MGSSyntaxGroupAttribute; /** MGSSyntaxParserClient specifies the methods used by MGSSyntaxParser * to inspect existing parse results, and to apply the resulting tokenization * to the text. * * This protocol does not need to be implemented when creating a * new parser; it is already implemented by an object internal to Fragaria which * is passed to MGSSyntaxParser as needed. */ @protocol MGSSyntaxParserClient <NSObject> #pragma mark - Retrieving the String to Parse /// @name Retrieving the String to Parse /** The string currently being parsed */ @property (nonatomic, readonly) NSString *stringToParse; /** The string range to parse */ @property (nonatomic, readonly) NSRange rangeToParse; #pragma mark - Creating Tokens /// @name Creating Tokens /** Removes any group assigned to the tokens in the specified range. * @note Non-atomic tokens that cross the range boundary survive only outside the * range specified. Atomic tokens crossing the range boundary are completely * removed, even the part outside the range. * @param range The range where to remove all token groups. * @returns The range actually affected (includes the expansion caused by * the occurrence of atomic tokens). */ - (NSRange)resetTokenGroupsInRange:(NSRange)range; /** Creates a new token of the specified group for a range of the string * being parsed. * @note If the range includes (even partially) a preexisting atomic token, * first the previously created token will be removed -- including the * parts outside the range. * If the range includes a non-atomic token, only the characters * that are part of the range will change group to form a new token. * @param group The syntax group of the new token. * @param range The string range which will be assigned to the group, creating * the token. * @param atomic If the new token will be atomic. */ - (void)setGroup:(MGSSyntaxGroup)group forTokenInRange:(NSRange)range atomic:(BOOL)atomic; #pragma mark - Inspecting Existing Tokens /// @name Inspecting Existing Tokens /** Searches if a token containing the character at the specified index exists. * @note This method is faster than `-groupOfTokenAtCharacterIndex:`. * @param index The index of a character in the token to search. * @returns YES if a token is found, NO otherwise. */ - (BOOL)existsTokenAtIndex:(NSUInteger)index; /** Searches for the token containing the character at the specified index, then * return its group. * @param index The index of a character in the token to search. * @returns The group of the token, or nil if no token was found. */ - (nullable MGSSyntaxGroup)groupOfTokenAtCharacterIndex:(NSUInteger)index; /** Searches for the token containing the character at the specified index, then * return its group and range in the string. * @param index The index of a character in the token to search. * @param atomic Optional pointer to a BOOL which will be assigned YES if an atomic * token is found, or NO if a non-atomic token is found. * @param range Optional pointer to an NSRange which will be assigned the range of * the token in the text, if it is found. * @returns The group of the token, or nil if no token was found. */ - (nullable MGSSyntaxGroup)groupOfTokenAtCharacterIndex:(NSUInteger)index isAtomic:(nullable BOOL *)atomic range:(nullable NSRangePointer)range; @end NS_ASSUME_NONNULL_END
/* Exit Games Photon - C++ Client Lib * Copyright (C) 2004-2016 by Exit Games GmbH. All rights reserved. * http://www.photonengine.com * mailto:developer@photonengine.com */ #pragma once #include "Photon-cpp/inc/OperationResponse.h" #include "Photon-cpp/inc/EventData.h" namespace ExitGames { namespace Photon { /* The PhotonListener class defines the callback interface to allow your application to communicate with the Photon Server via the PhotonPeer class. This interface defines the following callback functions: <table noborder> onEvent() is called every time an event is received. onOperationResponse() is called in response to every operation you sent to the Photon server, carrying the Photon servers result code. onStatusChanged() is called on errors and connection-state changes. debugReturn() is called if a Photon related error occurs, passing an error message. This will happen e.g. if you call a PhotonPeer function with invalid parameters. </table> Please note that Photon will free any data passed as arguments as soon as the callback function returns, so make sure to create copies within the callback function of all data needed by your application beyond the scope of the callback function. */ class PhotonListener: public virtual Common::BaseListener { public: virtual ~PhotonListener(void){} /** This function gets called by the library as callback to operations in response to operations sent to the Photon Server providing the response values from the server. @details This callback is used as general callback for all operations. The type of an operation is identified by an operation code. An operation's response is summarized by the return code: an int typed code, 0 for OK or some error code defined by the application, which is defining the operation itself. The opCode defines the type of operation called on Photon and in turn also the return values. They are provided as a Hashtable which contains the complete reponse of Photon, including keys for operation code and return code. Each operation returns its opCode and returnCode but anything else can be defined serverside. @param operationResponse the @link OperationResponse\endlink */ virtual void onOperationResponse(const OperationResponse& operationResponse) = 0; /** onStatusChanged is used to denote errors or simply state-changes of the respective PhotonPeer. @details State change callback When this function is used to signalize a state-change, the statusCode will be one of these: * SC_CONNECT the connection to the Photon Server was established * SC_DISCONNECT the connection was closed (due to an API-call or a timeout) Furthermore this function will be called by Photon to inform about connection errors and warnings. Check PhotonConstants for a list (they start with SC_). @param statusCode see description */ virtual void onStatusChanged(int statusCode) = 0; /** This is the event handler function for all Events transmitted by PhotonPeer. @details Whenever a Photon event is sent and received, the receiving peer will be notified via this function. Please refer to @link SendingAndReceivingData Sending and receiving data\endlink for more information. This way, an application can react on any event, based on its event code. The following events are reported by default: EV_RT_JOIN EV_RT_LEAVE These events are predefined and will be triggered as soon as a player has joined or has left the room in which the local player is currently active in. To transmit in-room data, define your own events as needed for your application, and transmit them using LitePeer::opRaiseEvent(). All events which are raised in reaction to some player's actions (like sending data) contain the actor number of the sending player in the "parameters" Hashtable. If the received event has been raised by another player by calling LitePeer::opRaiseEvent(), the transmitted payload hashtable will be stored in the "parameters" hashtable of at key EV_RT_KEY_DATA. Please refer to the demos for sample code. @param eventData the @link EventData\endlink @sa @link SendingAndReceivingData Sending and receiving data\endlink, LitePeer::opRaiseEvent()*/ virtual void onEvent(const EventData& eventData) = 0; /** This is the callback for PhotonPeer::pingServer(). @details Each ping signal that has been sent through PhotonPeer::pingServer() results in a call to this function, providing the address to which the ping has been sent and the time in milliseconds that has passed between sending the ping and receiving the servers response. @note: This function is not available on platforms that do not support those parts of the stdlib that have been introduced with C++ 11. @param address the address, which has been pinged\endlink @param pingResult the time in ms\endlink @sa @link PhotonPeer::pingServer()*/ #ifdef EG_PLATFORM_SUPPORTS_CPP11 virtual void onPingResponse(const Common::JString& /*address*/, unsigned int /*pingResult*/){} #endif }; /** @file */ } }
// // TFAppDelegate.h // TFIpodPlayer // // Created by Hyacinth on 14/10/29. // Copyright (c) 2014年 Hyacinth.TaskTinkle. All rights reserved. // #import <UIKit/UIKit.h> @interface TFAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/rekognition/Rekognition_EXPORTS.h> #include <aws/rekognition/RekognitionRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/rekognition/model/DatasetChanges.h> #include <utility> namespace Aws { namespace Rekognition { namespace Model { /** */ class AWS_REKOGNITION_API UpdateDatasetEntriesRequest : public RekognitionRequest { public: UpdateDatasetEntriesRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "UpdateDatasetEntries"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline const Aws::String& GetDatasetArn() const{ return m_datasetArn; } /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline bool DatasetArnHasBeenSet() const { return m_datasetArnHasBeenSet; } /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline void SetDatasetArn(const Aws::String& value) { m_datasetArnHasBeenSet = true; m_datasetArn = value; } /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline void SetDatasetArn(Aws::String&& value) { m_datasetArnHasBeenSet = true; m_datasetArn = std::move(value); } /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline void SetDatasetArn(const char* value) { m_datasetArnHasBeenSet = true; m_datasetArn.assign(value); } /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline UpdateDatasetEntriesRequest& WithDatasetArn(const Aws::String& value) { SetDatasetArn(value); return *this;} /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline UpdateDatasetEntriesRequest& WithDatasetArn(Aws::String&& value) { SetDatasetArn(std::move(value)); return *this;} /** * <p> The Amazon Resource Name (ARN) of the dataset that you want to update. </p> */ inline UpdateDatasetEntriesRequest& WithDatasetArn(const char* value) { SetDatasetArn(value); return *this;} /** * <p> The changes that you want to make to the dataset. </p> */ inline const DatasetChanges& GetChanges() const{ return m_changes; } /** * <p> The changes that you want to make to the dataset. </p> */ inline bool ChangesHasBeenSet() const { return m_changesHasBeenSet; } /** * <p> The changes that you want to make to the dataset. </p> */ inline void SetChanges(const DatasetChanges& value) { m_changesHasBeenSet = true; m_changes = value; } /** * <p> The changes that you want to make to the dataset. </p> */ inline void SetChanges(DatasetChanges&& value) { m_changesHasBeenSet = true; m_changes = std::move(value); } /** * <p> The changes that you want to make to the dataset. </p> */ inline UpdateDatasetEntriesRequest& WithChanges(const DatasetChanges& value) { SetChanges(value); return *this;} /** * <p> The changes that you want to make to the dataset. </p> */ inline UpdateDatasetEntriesRequest& WithChanges(DatasetChanges&& value) { SetChanges(std::move(value)); return *this;} private: Aws::String m_datasetArn; bool m_datasetArnHasBeenSet; DatasetChanges m_changes; bool m_changesHasBeenSet; }; } // namespace Model } // namespace Rekognition } // namespace Aws
/* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ScaledImageFragment_h #define ScaledImageFragment_h #include "SkBitmap.h" #include "SkRect.h" #include "SkSize.h" #include "wtf/PassOwnPtr.h" namespace WebCore { // ScaledImageFragment is a scaled version of an image. class ScaledImageFragment { public: enum ImageGeneration { CompleteImage = 0, FirstPartialImage = 1, }; static PassOwnPtr<ScaledImageFragment> createComplete(const SkISize& scaledSize, size_t index, const SkBitmap& bitmap) { return adoptPtr(new ScaledImageFragment(scaledSize, index, CompleteImage, bitmap)); } static PassOwnPtr<ScaledImageFragment> createPartial(const SkISize& scaledSize, size_t index, size_t generation, const SkBitmap& bitmap) { return adoptPtr(new ScaledImageFragment(scaledSize, index, generation, bitmap)); } ScaledImageFragment(const SkISize&, size_t index, size_t generation, const SkBitmap&); ~ScaledImageFragment(); const SkISize& scaledSize() const { return m_scaledSize; } size_t index() const { return m_index; } size_t generation() const { return m_generation; } bool isComplete() const { return m_generation == CompleteImage; } const SkBitmap& bitmap() const { return m_bitmap; } SkBitmap& bitmap() { return m_bitmap; } private: SkISize m_scaledSize; size_t m_index; size_t m_generation; SkBitmap m_bitmap; }; } // namespace WebCore #endif
// // BMKSearchVersion.h // SearchComponent // // Created by wzy on 15/9/9. // Copyright © 2015年 baidu. All rights reserved. // #ifndef BMKSearchVersion_h #define BMKSearchVersion_h #import <UIKit/UIKit.h> /** *重要: *base组件的版本和search组件的版本必须一致,否则不能正常使用 */ /** *获取当前地图API search组件 的版本号 *当前search组件版本 : 3.4.2 *return 返回当前API search组件 的版本号 */ UIKIT_EXTERN NSString* BMKGetMapApiSearchComponentVersion(); /** *检查search组件的版本号是否和base组件的版本号一致 *return 版本号一致返回YES */ UIKIT_EXTERN BOOL BMKCheckSearchComponentIsLegal(); #endif /* BMKSearchVersion_h */
/** * Copyright (c) 2014, Oculus VR, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ /// \file /// \brief Contains RakNetTransportCommandParser and RakNetTransport used to provide a secure console connection. /// #include "NativeFeatureIncludes.h" #if _RAKNET_SUPPORT_TelnetTransport==1 #ifndef __RAKNET_TRANSPORT_2 #define __RAKNET_TRANSPORT_2 #include "TransportInterface.h" #include "DS_Queue.h" #include "CommandParserInterface.h" #include "PluginInterface2.h" #include "Export.h" namespace RakNet { /// Forward declarations class BitStream; class RakPeerInterface; class RakNetTransport; /// \defgroup RAKNET_TRANSPORT_GROUP RakNetTransport /// \brief UDP based transport implementation for the ConsoleServer /// \details /// \ingroup PLUGINS_GROUP /// \brief Use RakNetTransport if you need a secure connection between the client and the console server. /// \details RakNetTransport automatically initializes security for the system. Use the project CommandConsoleClient to connect /// To the ConsoleServer if you use RakNetTransport /// \ingroup RAKNET_TRANSPORT_GROUP class RAK_DLL_EXPORT RakNetTransport2 : public TransportInterface, public PluginInterface2 { public: // GetInstance() and DestroyInstance(instance*) STATIC_FACTORY_DECLARATIONS(RakNetTransport2) RakNetTransport2(); virtual ~RakNetTransport2(); /// Start the transport provider on the indicated port. /// \param[in] port The port to start the transport provider on /// \param[in] serverMode If true, you should allow incoming connections (I don't actually use this anywhere) /// \return Return true on success, false on failure. bool Start(unsigned short port, bool serverMode); /// Stop the transport provider. You can clear memory and shutdown threads here. void Stop(void); /// Send a null-terminated string to \a systemAddress /// If your transport method requires particular formatting of the outgoing data (e.g. you don't just send strings) you can do it here /// and parse it out in Receive(). /// \param[in] systemAddress The player to send the string to /// \param[in] data format specifier - same as RAKNET_DEBUG_PRINTF /// \param[in] ... format specification arguments - same as RAKNET_DEBUG_PRINTF void Send( SystemAddress systemAddress, const char *data, ... ); /// Disconnect \a systemAddress . The binary address and port defines the SystemAddress structure. /// \param[in] systemAddress The player/address to disconnect void CloseConnection( SystemAddress systemAddress ); /// Return a string. The string should be allocated and written to Packet::data . /// The byte length should be written to Packet::length . The player/address should be written to Packet::systemAddress /// If your transport protocol adds special formatting to the data stream you should parse it out before returning it in the packet /// and thus only return a string in Packet::data /// \return The packet structure containing the result of Receive, or 0 if no data is available Packet* Receive( void ); /// Deallocate the Packet structure returned by Receive /// \param[in] The packet to deallocate void DeallocatePacket( Packet *packet ); /// If a new system connects to you, you should queue that event and return the systemAddress/address of that player in this function. /// \return The SystemAddress/address of the system SystemAddress HasNewIncomingConnection(void); /// If a system loses the connection, you should queue that event and return the systemAddress/address of that player in this function. /// \return The SystemAddress/address of the system SystemAddress HasLostConnection(void); virtual CommandParserInterface* GetCommandParser(void) {return 0;} /// \internal virtual PluginReceiveResult OnReceive(Packet *packet); /// \internal virtual void OnClosedConnection(const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason ); /// \internal virtual void OnNewConnection(const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming); protected: DataStructures::Queue<SystemAddress> newConnections, lostConnections; DataStructures::Queue<Packet*> packetQueue; }; } // namespace RakNet #endif #endif // _RAKNET_SUPPORT_*
// // ZMDownloadManager.h // ZMDownloadManager // // Created by ZM on 16/5/20. // Copyright © 2016年 TD. All rights reserved. // #import <Foundation/Foundation.h> #import "ZMSessionModel.h" #import "UpDownHeader.h" @interface ZMDownloadManager : NSObject { } /** 保存所有任务(注:可以用下载地址md5后作为key) */ @property (nonatomic, strong) NSMutableDictionary *tasks; /** * 单例:@return 返回单例对象 */ + (instancetype)sharedInstance; /** * 开启任务下载资源 * * @param url 下载地址 * @param progressBlock 回调下载进度 * @param stateBlock 下载状态 */ - (void)zm_downloadURL:(NSString *)url progress:(void(^)(NSInteger receivedSize, NSInteger expectedSize, CGFloat progress))progressBlock state:(void(^)(DownloadState state))stateBlock; /** * 查询该资源的下载进度值: @return 返回下载进度值 */ - (CGFloat)progress:(NSString *)url; //url 下载地址 /** * 获取该资源总大小 */ - (NSInteger)fileTotalLength:(NSString *)url; /** * 获取该资源 */ - (NSString *)getFile:(NSString *)url; /** * 判断该资源是否下载完成:@return YES: 完成 */ - (BOOL)isCompletion:(NSString *)url; /** * 删除该资源 */ - (void)deleteFile:(NSString *)url; /** * 清空所有下载资源 */ - (void)deleteAllFile; //开始\暂停 轮循 - (void)handle:(NSString *)url; //url 下载地址 /** * 开始下载 */ - (void)start:(NSString *)url; /** * 暂停下载 */ - (void)pause:(NSString *)url; @end
#include "flow.h" #include "dp-packet.h" #include "pcap-file.h" #include "odp-util.h" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { struct dp_packet packet; uint8_t *copy = malloc(size); memcpy(copy, data, size); dp_packet_use_const(&packet, copy, size); while (dp_packet_size(&packet) >= sizeof(struct ofp_header)) { const struct ofp_header *oh; void *pdata = dp_packet_data(&packet); int length; dp_packet_shift(&packet, -((intptr_t) pdata & 7)); oh = dp_packet_data(&packet); length = ntohs(oh->length); if (!length || dp_packet_size(&packet) < length) break; ofp_print(stdout, oh, length, 4); dp_packet_pull(&packet, length); } free(copy); return 0; }
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #ifndef GANDIVA_NODE_VISITOR_H #define GANDIVA_NODE_VISITOR_H #include <string> #include "arrow/status.h" #include "gandiva/logging.h" namespace gandiva { class FieldNode; class FunctionNode; class IfNode; class LiteralNode; class BooleanNode; template <typename Type> class InExpressionNode; /// \brief Visitor for nodes in the expression tree. class NodeVisitor { public: virtual ~NodeVisitor() = default; virtual Status Visit(const FieldNode& node) = 0; virtual Status Visit(const FunctionNode& node) = 0; virtual Status Visit(const IfNode& node) = 0; virtual Status Visit(const LiteralNode& node) = 0; virtual Status Visit(const BooleanNode& node) = 0; virtual Status Visit(const InExpressionNode<int32_t>& node) = 0; virtual Status Visit(const InExpressionNode<int64_t>& node) = 0; virtual Status Visit(const InExpressionNode<std::string>& node) = 0; }; } // namespace gandiva #endif // GANDIVA_NODE_VISITOR_H
//===----------------------------------------------------------------------===// // // Peloton // // analyze_statement.h // // Identification: src/include/parser/analyze_statement.h // // Copyright (c) 2015-17, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once #include <vector> #include "common/logger.h" #include "common/sql_node_visitor.h" #include "parser/sql_statement.h" #include "parser/table_ref.h" namespace peloton { namespace parser { struct AnalyzeStatement : SQLStatement { AnalyzeStatement() : SQLStatement(StatementType::ANALYZE), analyze_table(nullptr), analyze_columns(nullptr) {}; // TODO: use smart pointer to avoid raw delete. virtual ~AnalyzeStatement() { if (analyze_columns != nullptr) { for (auto col : *analyze_columns) delete[] col; delete analyze_columns; } if (analyze_table != nullptr) { delete analyze_table; } } std::string GetTableName() const { if (analyze_table == nullptr) { return INVALID_NAME; } return analyze_table->GetTableName(); } std::vector<char*> GetColumnNames() const { if (analyze_columns == nullptr) { return {}; } return (*analyze_columns); } std::string GetDatabaseName() const { if (analyze_table == nullptr) { return INVALID_NAME; } return analyze_table->GetDatabaseName(); } virtual void Accept(SqlNodeVisitor* v) const override { v->Visit(this); } parser::TableRef* analyze_table; std::vector<char*>* analyze_columns; const std::string INVALID_NAME = ""; }; } // End parser namespace } // End peloton namespace
// // Copyright (c) 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import <UIKit/UIKit.h> #import <FirebaseAuthUI/FUIAuthBaseViewController.h> NS_ASSUME_NONNULL_BEGIN /** @class FUIPasswordRecoveryViewController @brief The view controller that asks for user's password. */ @interface FUIPasswordRecoveryViewController : FUIAuthBaseViewController /** @fn initWithNibName:bundle:authUI: @brief Please use @c initWithAuthUI:email:. */ - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil authUI:(FUIAuth *)authUI NS_UNAVAILABLE; /** @fn initWithAuthUI: @brief Please use @c initWithAuthUI:email:. */ - (instancetype)initWithAuthUI:(FUIAuth *)authUI NS_UNAVAILABLE; /** @fn initWithNibName:bundle:authUI:email: @brief Designated initializer. @param nibNameOrNil The name of the nib file to associate with the view controller. @param nibBundleOrNil The bundle in which to search for the nib file. @param authUI The @c FUIAuth instance that manages this view controller. @param email The email address of the user. */ - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil authUI:(FUIAuth *)authUI email:(NSString *_Nullable)email NS_DESIGNATED_INITIALIZER; /** @fn initWithAuthUI:email: @brief Convenience initializer. @param authUI The @c FUIAuth instance that manages this view controller. @param email The email address of the user. */ - (instancetype)initWithAuthUI:(FUIAuth *)authUI email:(NSString *_Nullable)email; /** @fn didChangeEmail: @brief Should be called after any change of email value. Updates UI controls state (e g state of send button) @param email The email address of the user. */ - (void)didChangeEmail:(NSString *)email; /** @fn recoverEmail: @brief Should be called when user want to recover password for specified email. Sends email recover request. @param email The email address of the user. */ - (void)recoverEmail:(NSString *)email; @end NS_ASSUME_NONNULL_END
/* * @brief LPC540XX 32-bit Timer/PWM driver * * @note * Copyright(C) NXP Semiconductors, 2014 * All rights reserved. * * @par * Software that is described herein is for illustrative purposes only * which provides customers with programming information regarding the * LPC products. This software is supplied "AS IS" without any warranties of * any kind, and NXP Semiconductors and its licensor disclaim any and * all warranties, express or implied, including all implied warranties of * merchantability, fitness for a particular purpose and non-infringement of * intellectual property rights. NXP Semiconductors assumes no responsibility * or liability for the use of the software, conveys no license or rights under any * patent, copyright, mask work right, or any other intellectual property rights in * or to any products. NXP Semiconductors reserves the right to make changes * in the software without notification. NXP Semiconductors also makes no * representation or warranty that such application will be suitable for the * specified use without further testing or modification. * * @par * Permission to use, copy, modify, and distribute this software and its * documentation is hereby granted, under NXP Semiconductors' and its * licensor's relevant copyrights in the software, without fee, provided that it * is used in conjunction with NXP Semiconductors microcontrollers. This * copyright, permission, and disclaimer notice must appear in all copies of * this code. */ #include "chip.h" /***************************************************************************** * Private types/enumerations/variables ****************************************************************************/ /***************************************************************************** * Public types/enumerations/variables ****************************************************************************/ /***************************************************************************** * Private functions ****************************************************************************/ /***************************************************************************** * Public functions ****************************************************************************/ /* Initialize a timer */ void Chip_TIMER_Init(LPC_TIMER_T *pTMR) { switch ((uint32_t) pTMR) { case LPC_CTIMER0_BASE: Chip_Clock_EnableAsyncPeriphClock(ASYNC_SYSCTL_CLOCK_CTIMER0); Chip_SYSCTL_AsyncPeriphReset(ASYNC_RESET_CTIMER0); break; case LPC_CTIMER1_BASE: Chip_Clock_EnableAsyncPeriphClock(ASYNC_SYSCTL_CLOCK_CTIMER1); Chip_SYSCTL_AsyncPeriphReset(ASYNC_RESET_CTIMER1); break; case LPC_CTIMER2_BASE: Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_CTIMER2); Chip_SYSCTL_PeriphReset(RESET_CTIMER2); break; case LPC_CTIMER3_BASE: Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_CTIMER3); Chip_SYSCTL_PeriphReset(RESET_CTIMER3); break; case LPC_CTIMER4_BASE: Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_CTIMER4); Chip_SYSCTL_PeriphReset(RESET_CTIMER4); break; default: break; } } /* Shutdown a timer */ void Chip_TIMER_DeInit(LPC_TIMER_T *pTMR) { switch ((uint32_t) pTMR) { case LPC_CTIMER0_BASE: Chip_Clock_DisableAsyncPeriphClock(ASYNC_SYSCTL_CLOCK_CTIMER0); break; case LPC_CTIMER1_BASE: Chip_Clock_DisableAsyncPeriphClock(ASYNC_SYSCTL_CLOCK_CTIMER1); break; case LPC_CTIMER2_BASE: Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CTIMER2); break; case LPC_CTIMER3_BASE: Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CTIMER3); break; case LPC_CTIMER4_BASE: Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CTIMER4); break; default: break; } } /* Resets the timer counter and prescale counts to 0 */ void Chip_TIMER_Reset(LPC_TIMER_T *pTMR) { uint32_t reg; /* Disable timer, set terminal count to non-0 */ reg = pTMR->TCR; pTMR->TCR = 0; pTMR->TC = 1; /* Reset timer counter */ pTMR->TCR = TIMER_RESET; /* Wait for terminal count to clear */ while (pTMR->TC != 0) {} /* Restore timer state */ pTMR->TCR = reg; } /* Sets external match control (MATn.matchnum) pin control */ void Chip_TIMER_ExtMatchControlSet(LPC_TIMER_T *pTMR, int8_t initial_state, TIMER_PIN_MATCH_STATE_T matchState, int8_t matchnum) { uint32_t mask, reg; /* Clear bits corresponding to selected match register */ mask = (1 << matchnum) | (0x03 << (4 + (matchnum * 2))); /* Also mask reserved bits */ reg = (pTMR->EMR & TIMER_EMR_MASK) & ~mask; /* Set new configuration for selected match register */ pTMR->EMR = reg | (((uint32_t) initial_state) << matchnum) | (((uint32_t) matchState) << (4 + (matchnum * 2))); }
// // ASIAuthenticationDialog.h // Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest // // Created by Ben Copsey on 21/08/2009. // Copyright 2009 All-Seeing Interactive. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @class MCMASIHTTPRequest; typedef enum _ASIAuthenticationType { ASIStandardAuthenticationType = 0, ASIProxyAuthenticationType = 1 } ASIAuthenticationType; @interface MCMASIAutorotatingViewController : UIViewController @end @interface MCMASIAuthenticationDialog : MCMASIAutorotatingViewController <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> { MCMASIHTTPRequest *request; ASIAuthenticationType type; UITableView *tableView; UIViewController *presentingController; BOOL didEnableRotationNotifications; } + (void)presentAuthenticationDialogForRequest:(MCMASIHTTPRequest *)request; + (void)dismiss; @property (retain) MCMASIHTTPRequest *request; @property (assign) ASIAuthenticationType type; @property (assign) BOOL didEnableRotationNotifications; @property (retain, nonatomic) UIViewController *presentingController; @end
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/tball/tmp/j2objc/testing/mockito/build_result/java/org/mockito/internal/verification/api/VerificationData.java // #ifndef _OrgMockitoInternalVerificationApiVerificationData_H_ #define _OrgMockitoInternalVerificationApiVerificationData_H_ @class OrgMockitoInternalInvocationInvocationMatcher; @protocol JavaUtilList; #include "J2ObjC_header.h" @protocol OrgMockitoInternalVerificationApiVerificationData < NSObject, JavaObject > - (id<JavaUtilList>)getAllInvocations; - (OrgMockitoInternalInvocationInvocationMatcher *)getWanted; @end J2OBJC_EMPTY_STATIC_INIT(OrgMockitoInternalVerificationApiVerificationData) J2OBJC_TYPE_LITERAL_HEADER(OrgMockitoInternalVerificationApiVerificationData) #endif // _OrgMockitoInternalVerificationApiVerificationData_H_
/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.24 06/05/06 */ /* */ /* SYSTEM DEPENDENT HEADER FILE */ /*******************************************************/ /*************************************************************/ /* Purpose: Isolation of system dependent routines. */ /* */ /* Principal Programmer(s): */ /* Gary D. Riley */ /* */ /* Contributing Programmer(s): */ /* */ /* Revision History: */ /* */ /* 6.24: Support for run-time programs directly passing */ /* the hash tables for initialization. */ /* */ /* Added BeforeOpenFunction and AfterOpenFunction */ /* hooks. */ /* */ /* Added environment parameter to GenClose. */ /* Added environment parameter to GenOpen. */ /* */ /*************************************************************/ #ifndef _H_sysdep #define _H_sysdep #ifndef _H_symbol #include "symbol.h" #endif #ifndef _STDIO_INCLUDED_ #define _STDIO_INCLUDED_ #include <stdio.h> #endif #if IBM_TBC || IBM_MSC || IBM_ICB #include <dos.h> #endif #ifdef LOCALE #undef LOCALE #endif #ifdef _SYSDEP_SOURCE_ #define LOCALE #else #define LOCALE extern #endif LOCALE void InitializeEnvironment(void); LOCALE void EnvInitializeEnvironment(void *,struct symbolHashNode **,struct floatHashNode **, struct integerHashNode **,struct bitMapHashNode **); LOCALE void SetRedrawFunction(void *,void (*)(void *)); LOCALE void SetPauseEnvFunction(void *,void (*)(void *)); LOCALE void SetContinueEnvFunction(void *,void (*)(void *,int)); LOCALE void (*GetRedrawFunction(void *))(void *); LOCALE void (*GetPauseEnvFunction(void *))(void *); LOCALE void (*GetContinueEnvFunction(void *))(void *,int); LOCALE void RerouteStdin(void *,int,char *[]); LOCALE double gentime(void); LOCALE void gensystem(void *theEnv); LOCALE void VMSSystem(char *); LOCALE int GenOpenReadBinary(void *,char *,char *); LOCALE void GetSeekCurBinary(void *,long); LOCALE void GetSeekSetBinary(void *,long); LOCALE void GenTellBinary(void *,long *); LOCALE void GenCloseBinary(void *); LOCALE void GenReadBinary(void *,void *,unsigned long); LOCALE FILE *GenOpen(void *,char *,char *); LOCALE int GenClose(void *,FILE *); LOCALE void genexit(int); LOCALE int genrand(void); LOCALE void genseed(int); LOCALE int genremove(char *); LOCALE int genrename(char *,char *); LOCALE char *gengetcwd(char *,int); LOCALE void GenWrite(void *,unsigned long,FILE *); LOCALE int (*EnvSetBeforeOpenFunction(void *,int (*)(void *)))(void *); LOCALE int (*EnvSetAfterOpenFunction(void *,int (*)(void *)))(void *); #endif
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import <Foundation/Foundation.h> #import "Bridge.h" #import "Ti.h" #import "TiEvaluator.h" #import "TiProxy.h" #import "KrollContext.h" #import "KrollObject.h" #import "TiModule.h" #include <libkern/OSAtomic.h> #ifdef KROLL_COVERAGE # import "KrollCoverage.h" @interface includeActivityObject : KrollCoverageObject { #else @interface includeActivityObject : KrollObject { #endif @private NSMutableDictionary *modules; TiHost *host; id<TiEvaluator> pageContext; NSMutableDictionary *dynprops; } -(id)initWithContext:(KrollContext*)context_ host:(TiHost*)host_ context:(id<TiEvaluator>)context baseURL:(NSURL*)baseURL_; -(id)addModule:(NSString*)name module:(TiModule*)module; -(TiModule*)moduleNamed:(NSString*)name context:(id<TiEvaluator>)context; @end extern NSString * includeActivity$ModuleRequireFormat; @interface KrollBridge : Bridge<TiEvaluator,KrollDelegate> { @private NSURL * currentURL; KrollContext *context; NSDictionary *preload; NSMutableDictionary *modules; includeActivityObject *_includeactivity; KrollObject* console; BOOL shutdown; BOOL evaluationError; //NOTE: Do NOT treat registeredProxies like a mutableDictionary; mutable dictionaries copy keys, //CFMutableDictionaryRefs only retain keys, which lets them work with proxies properly. CFMutableDictionaryRef registeredProxies; NSCondition *shutdownCondition; OSSpinLock proxyLock; } - (void)boot:(id)callback url:(NSURL*)url_ preload:(NSDictionary*)preload_; - (void)evalJSWithoutResult:(NSString*)code; - (id)evalJSAndWait:(NSString*)code; - (BOOL)evaluationError; - (void)fireEvent:(id)listener withObject:(id)obj remove:(BOOL)yn thisObject:(TiProxy*)thisObject; - (id)preloadForKey:(id)key name:(id)name; - (KrollContext*)krollContext; + (NSArray *)krollBridgesUsingProxy:(id)proxy; + (BOOL)krollBridgeExists:(KrollBridge *)bridge; + (KrollBridge *)krollBridgeForThreadName:(NSString *)threadName; -(void)enqueueEvent:(NSString*)type forProxy:(TiProxy *)proxy withObject:(id)obj withSource:(id)source; -(void)registerProxy:(id)proxy krollObject:(KrollObject *)ourKrollObject; -(int)forceGarbageCollectNow; @end
// // Tile.h // TicTacToePilot // // Created by DEVFLOATER14-XL on 2014-08-05. // Copyright (c) 2014 Jean Bernard Yung Hing Hin. All rights reserved. // #import <UIKit/UIKit.h> @interface Tile : UICollectionViewCell // ReadOnly Property @property (nonatomic, assign, readonly)BOOL checked; - (void)reset; - (void)checkTile:(BOOL)isHuman; @end
// // BSAppDelegate.h // BeaconSender // // Created by suwa_yuki on 2013/10/01. // Copyright (c) 2013年 suwa.yuki. All rights reserved. // #import <UIKit/UIKit.h> @interface BSAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#pragma once #include "SLAMSystem.h" #include "SparseMap.h" #include <okvis/VioParametersReader.hpp> #include <okvis/ThreadedKFVio.hpp> #include <thread> #include <opencv2/core/eigen.hpp> #include "SingleConsumerPriorityQueue.h" #include <atomic> #include <brisk/brisk.h> #include <vector> #include <memory> namespace ark { /** Okvis-based SLAM system */ class OkvisSLAMSystem : public SLAMSystem { struct WrappedMultiCameraFrame { MultiCameraFrame::Ptr frame; bool operator<(const WrappedMultiCameraFrame& right) const { return frame->timestamp_ > right.frame->timestamp_; } }; struct StampedFrameData { okvis::OutFrameData::Ptr data; okvis::Time timestamp; bool operator<(const StampedFrameData& right) const { return timestamp > right.timestamp; } }; public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW OkvisSLAMSystem(const std::string &strVocFile, const std::string &strSettingsFile); //void PushFrame(const std::vector<cv::Mat>& images, const double &timestamp); //void PushFrame(const cv::Mat image, const double &timestamp); void PushFrame(const MultiCameraFrame::Ptr frame); void PushIMU(const std::vector<ImuPair, Eigen::aligned_allocator<ImuPair>>& imu); void PushIMU(const ImuPair& imu); void PushIMU(double timestamp, const Eigen::Vector3d& accel, const Eigen::Vector3d gyro); void Start(); void RequestStop(); void ShutDown(); bool IsRunning(); void display(); void getActiveFrames(std::vector<int>& frame_ids); void getTrajectory(std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d>>& trajOut); void getMappedTrajectory(std::vector<int>& frameIdOut, std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d>>& trajOut); ~OkvisSLAMSystem(); std::shared_ptr<SparseMap<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK>> getActiveMap(); int getActiveMapIndex() { return active_map_index; } std::shared_ptr<okvis::ThreadedKFVio> okvis_estimator_; std::shared_ptr<SparseMap<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK>> getMap(int index) { if (sparse_maps_.find(index) == sparse_maps_.end()) { return nullptr; } else { return sparse_maps_[index]; } } protected: void FrameConsumerLoop(); void createNewMap(); void setEnableLoopClosure(bool enableUseLoopClosures, std::string vocabPath, bool binaryVocab, cv::DescriptorMatcher* matcher); bool detectLoopClosure(MapKeyFrame::Ptr kf, MapKeyFrame::Ptr &loop_kf, Eigen::Affine3d &transformEstimate); std::shared_ptr<SparseMap<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK>> mergeMaps( std::shared_ptr<SparseMap<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK>> olderMap, std::shared_ptr<SparseMap<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK>> currentMap, MapKeyFrame::Ptr kf, MapKeyFrame::Ptr loop_kf, Eigen::Affine3d &transformEstimate); private: okvis::Time start_; okvis::Time t_imu_; okvis::Duration deltaT_; okvis::VioParameters parameters_; SingleConsumerPriorityQueue<WrappedMultiCameraFrame> frame_queue_; SingleConsumerPriorityQueue<StampedFrameData> frame_data_queue_; std::thread frameConsumerThread_; int num_frames_; std::atomic<bool> kill; std::map<int, std::shared_ptr<SparseMap<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK>>> sparse_maps_; bool new_map_checker; int map_timer; int active_map_index; int map_id_counter_; std::string strVocFile; bool useLoopClosures_; std::shared_ptr<DLoopDetector::TemplatedLoopDetector<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK> >detector_; std::shared_ptr<DBoW2::TemplatedVocabulary<DBoW2::FBRISK::TDescriptor, DBoW2::FBRISK> >vocab_; std::shared_ptr<cv::DescriptorMatcher> matcher_; std::map<int, MapKeyFrame::Ptr> bowFrameMap_; int bowId_; double lastLoopClosureTimestamp_; // correction for convert an obj coordinate in other's map // because reset okvis estimator also reset coordinate system Eigen::Matrix4d correction_{Eigen::Matrix4d::Identity()}; static const int kMapCreationCooldownFrames_ = 15; static const int kMinimumKeyframes_ = 20; }; // OkvisSLAMSystem }//ark
// OdessaEngineV2Project.h #include <stdint.h> // for int64_t enum OdessaReturnCodes { Success = 0, AlreadyScanning = -1, NotAuthorized = -2, ErrorOpeningFile = -3, ErrorFindingStreamInformation = -4, ErrorFindingVideoStream = -5, UnsupportedCodec = -6, ErrorOpeningCodec = -7, ErrorAllocatedFrameStructure = -8, NoFramesFound = -9, ErrorCalculatingFPS = -10, ErrorCalculatingDimensions = -11, InvalidThresholds = -12, ErrorWritingResults = -13, Authorized = -14, ErrorCalculatingDuration = -15, ErrorCalculatingTotalFrames = -16, ErrorCalculatingBitrate = -17, InvalidFormatContext = -18, ErrorDeterminingCodec = -19, NotEnoughFramesFound = -20, }; // OdessaEngineV2Project.h #if defined(__cplusplus) && defined(TARGET_OS_MAC) extern "C" { #endif #ifdef WIN32 extern "C" __declspec(dllexport) #endif int Initialize(const char *logpath); #ifdef WIN32 extern "C" __declspec(dllexport) #endif void Dispose(); #ifndef RELEASE // we don't want this publically exposed in the release build #ifdef WIN32 extern "C" __declspec(dllexport) #endif void SetCustomDetectionThreshold( int thresholdIndividualPixelBrightness, int thresholdDarkPixelsPerFrameAsPercentage, int thresholdPixelScanPercentage, float thresholdSecondsSkip, float thresholdConsecutiveDarkFramesInSeconds); #endif #ifdef WIN32 extern "C" __declspec(dllexport) #endif void SetDetectionThreshold(int detectionThreshold); #ifdef WIN32 extern "C" __declspec(dllexport) #endif long long* Scan(const char* inputfile, int *listSize, int* returnCode); // const char* outputfile, #ifdef WIN32 extern "C" __declspec(dllexport) #endif void FreePointer(long long* p); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int ScanTest(int*[]); #ifdef WIN32 extern "C" __declspec(dllexport) #endif long long* GetList(unsigned long* pSize); #ifdef WIN32 extern "C" __declspec(dllexport) #endif void CancelScan(); #ifdef WIN32 extern "C" __declspec(dllexport) #endif bool GetPercentDone(int *percent); // C uses pointers instead of & as by reference #ifdef WIN32 extern "C" __declspec(dllexport) #endif long long GetFramesProcessed(); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int GetTotalFrames(const char *inputfile, int64_t *totalFramesReturned); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int GetDuration(const char *inputfile, double *duration); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int GetFramesPerSecond(const char *inputfile, double *fps); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int GetBitrate(const char *inputfile, int *bitrate); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int GetDimensions(const char *inputfile, int *width, int *height); #ifdef WIN32 extern "C" __declspec(dllexport) #endif int GetCodec(const char *inputfile, const char **codec); #if defined(__cplusplus) && defined(TARGET_OS_MAC) } #endif #ifdef __cplusplus // needed for Mac to compile vector<int64_t> CollapseDarkFrameLocations(const vector<int64_t> input, double framesPerSecond, int frameSkip); #ifdef DEBUG int WriteJPEG (AVCodecContext *pCodecCtx, AVFrame *pFrame, int FrameNo); int SimplifiedScan(const char* inputfile); #endif #endif void InitLogger(const char *logpath);
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ /** * @file **/ #ifndef MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_STOP_SIGN_H_ #define MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_STOP_SIGN_H_ #include <string> #include <unordered_map> #include <utility> #include <vector> #include "modules/map/hdmap/hdmap.h" #include "modules/planning/proto/planning_status.pb.h" #include "modules/planning/tasks/traffic_decider/traffic_rule.h" namespace apollo { namespace planning { class StopSign : public TrafficRule { typedef std::unordered_map<std::string, std::vector<std::string>> StopSignLaneVehicles; public: explicit StopSign(const TrafficRuleConfig& config); virtual ~StopSign() = default; common::Status ApplyRule(Frame* const frame, ReferenceLineInfo* const reference_line_info); private: void MakeDecisions(Frame* const frame, ReferenceLineInfo* const reference_line_info); bool FindNextStopSign(ReferenceLineInfo* const reference_line_info); int GetAssociatedLanes(const hdmap::StopSignInfo& stop_sign_info); bool CheckCreep(const hdmap::StopSignInfo& stop_sign_info); bool CheckCreepDone(ReferenceLineInfo* const reference_line_info); int ProcessStopStatus(ReferenceLineInfo* const reference_line_info, const hdmap::StopSignInfo& stop_sign_info, StopSignLaneVehicles* watch_vehicles); bool CheckADCkStop(ReferenceLineInfo* const reference_line_info); void GetWatchVehicles(const hdmap::StopSignInfo& stop_sign_info, StopSignLaneVehicles* watch_vehicles); void UpdateWatchVehicles(StopSignLaneVehicles* watch_vehicles); int AddWatchVehicle(const PathObstacle& path_obstacle, StopSignLaneVehicles* watch_vehicles); int RemoveWatchVehicle(const PathObstacle& path_obstacle, const std::vector<std::string>& watch_vehicle_ids, StopSignLaneVehicles* watch_vehicles); int ClearWatchVehicle(ReferenceLineInfo* const reference_line_info, StopSignLaneVehicles* watch_vehicles); int BuildStopDecision(Frame* const frame, ReferenceLineInfo* const reference_line_info, const std::string& stop_wall_id, const double stop_line_s, const double stop_distance, StopSignLaneVehicles* watch_vehicles); private: static constexpr const char* STOP_SIGN_VO_ID_PREFIX = "SS_"; static constexpr const char* STOP_SIGN_CREEP_VO_ID_PREFIX = "SS_CREEP_"; hdmap::PathOverlap next_stop_sign_overlap_; hdmap::StopSignInfoConstPtr next_stop_sign_ = nullptr; StopSignStatus::Status stop_status_; std::vector<std::pair<hdmap::LaneInfoConstPtr, hdmap::OverlapInfoConstPtr>> associated_lanes_; }; } // namespace planning } // namespace apollo #endif // MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_STOP_SIGN_H_
// Copyright 2013 Peter Wallström // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software distributed under the License is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and limitations under the License. // while it is not required i like to request a few things // 1. please do share any meaningfull/usefull changes/additions/fixes you make with me so that i could include it in any future version // 2. likewise do share any ideas for improvements // 3. If you make something comersiol or at least something you release publicly that relies on this code then i would like to know and maybe use in my CV // 4. Please do include me in your credits // glz shader toolkit - Warning does not produce actual shade // visit http://www.flashbang.se or contact me at overlord@flashbang.se // the entire toolkit should exist in it's entirety at github // https://github.com/zeoverlord/glz.git #include "ztool-type.h" //type signifies the type of data to choose from, if set at GLZ_AUTO it chooses the default settings unsigned int glzShaderLoad(char file_vert[255], char file_geo[255], char file_frag[255], glzVAOType type); unsigned int glzShaderLoad(char file_vert[255], char file_frag[255], glzVAOType type); unsigned int glzShaderLoadString(char *vert, char *frag, glzVAOType type); void glzShaderLink(unsigned int program); void glzShaderUsePasstrough(void); // make sure this replaces all uses of the openGL set uniform functions //void glzSetuniform(int type, int location, GLsizei count, GLboolean transpose, const GLfloat *value) // for now just call one of the two first ones with "glzVAOType::AUTO" as the type then the last one, there will be much more here in future versions
/** * i2c tilt sensor * * @author Matthias L. Jugel * * == LICENSE == * Copyright 2015 ubirch GmbH (http://www.ubirch.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "uart.h" #include "uart_stdio.h" #include "i2c_core.h" #include "i2c_registers.h" #include "dbg_utils.h" #include <util/delay.h> #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #pragma clang diagnostic ignored "-Wreturn-stack-address" int main(void) { UART_INIT_STDIO(); // enable watchdog (pin 6 output) DDRD &= ~_BV(PIND6); blink(3); printf("\n"); i2c_init(I2C_SPEED_400KHZ); for (uint8_t i = 0x00; i < 0x3a; i++) { uint8_t value = i2c_read_reg(0x6b, i); printf("REG(0x%02x) = ", i); print_bits(sizeof value, &value); printf(" 0x%02x\n", value); } i2c_write_reg(0x6b, 0x39, 0b00000000); uint8_t ctrl1 = i2c_read_reg(0x6b, 0x20); i2c_write_reg(0x6b, 0x20, ctrl1 | 0b1010); // do some low level blinking until the watchdog hits while (1) { uint8_t status = i2c_read_reg(0x6b, 0x27); print_bits(sizeof status, &status); printf(" X(%d) Y(%d) Z(%d), REF(%02x) TEMP(%02dºC)\r", i2c_read_reg16(0x6b, 0x28), i2c_read_reg16(0x6b, 0x2A), i2c_read_reg16(0x6b, 0x3C), i2c_read_reg(0x6b, 0x25), i2c_read_reg(0x6b, 0x26) ); PORTB ^= _BV(PORTB5); _delay_ms(50); }; } #pragma clang diagnostic pop
#ifndef LOG_H_GUARD_dffd9fds9kkdmvfsf888888h5f857 #define LOG_H_GUARD_dffd9fds9kkdmvfsf888888h5f857 #include <iostream> #include <string> // TODO use a variadic macro that outputs line, function and forwards __VA_ARGS__ to logging functions namespace tk { namespace log { std::string nativeErrorString(); template<typename T> void error(T argument) { std::cerr << argument << nativeErrorString() << std::endl; } template<typename T, typename... V> void error(T argument, V... rest) { std::cerr << argument; error(rest...); } template<typename T> void info(T argument) { std::cerr << argument << std::endl; } template<typename T, typename... V> void info(T argument, V... rest) { std::cerr << argument; info(rest...); } template<typename T, typename... V> void debug(T argument, V... rest) { // TODO use DEFINES for logging levels } } } #endif
/* * Copyright (c) 2017,2021 Daichi GOTO * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY 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. */ #include "command.h" struct textset cmdtextsets[] = { { "command_version", "en_", VERSION }, { "command_name", "en_", CMDNAME }, { "command_alias", "en_", ALIAS }, { "command_copyright", "en_", "2016,2017 ONGS Inc." }, { "command_comment", "ja_JP", "指定された列の連続するデータの最後を出力する" }, { "command_comment", "en_", "print first to one before last as empty data" }, { "command_synopsis", "en_", _CMD(CMDNAME) " " "[" _OPT("hvD") "] [" _OPT("-") "] " _ARG("N") "|" _ARG("N/M") " " "[" _ARG("N") "|" _ARG("N/M") " " _ETC "] " "[" _ARG("file") " " _ETC "]" }, { "command_description", "ja_JP", "指定された列で同じデータが連続している場合、最後のデータのみ\n" "出力してそれ以外のデータは空データとして出力する。ファイルの\n" "指定がないか、-が指定されている場合には標準入力を使用。" }, { "command_description", "en_", "Print from the first to one before last data as empty from\n" "the sequential range that have the same data for each\n" "specified column. If " _ARG("file") " is a single dash (`-') " "or absent,\nit reads from the standard input." }, { "command_options", "ja_JP", _OPT("h") " 使い方表示\n" _OPT("v") " バージョン表示\n" _OPT("D") " デバッグモード\n" _OPT("-") " オプションの終了を指定\n" _ARG("N") " " _ARG("N") "列目を指定\n" _ARG("N/M") " " _ARG("N") "列目から" _ARG("M") "列目を" "指定\n" _ARG("file") "\t ファイルを指定" }, { "command_options", "en_", _OPT("h") " Print the usage message.\n" _OPT("v") " Print the version.\n" _OPT("D") " Enable the debug mode.\n" _OPT("-") " Specify the end of options.\n" _ARG("N") " Specify the " _ARG("N") "th column.\n" _ARG("N/M") " Specify the range from the " _ARG("N") "th to " _ARG("M") "th column.\n" _ARG("file") "\t Specify the file." }, { "command_example", "en_", _P1("cat data.ssv") _ST("1 2 3 4 5 6 7 8 9") _ST("1 @ 3 4 5 6 7 8 9") _ST("1 2 @ 4 5 6 7 8 9") _ST("1 @ 3 @ 5 6 7 8 9") _ST("1 @ 3 4 @ 6 7 8 9") _ST("1 @ 3 4 5 @ 7 8 9") _ST("1 @ 3 4 5 6 @ 8 9") _P1("retu_leavelast 1 data.ssv") _ST("@ 2 3 4 5 6 7 8 9") _ST("@ @ 3 4 5 6 7 8 9") _ST("@ 2 @ 4 5 6 7 8 9") _ST("@ 2 3 @ 5 6 7 8 9") _ST("@ 2 3 4 @ 6 7 8 9") _ST("@ 2 3 4 5 @ 7 8 9") _ST("1 2 3 4 5 6 @ 8 9") _P1("retu_leavelast 3 data.ssv") _ST("1 2 @ 4 5 6 7 8 9") _ST("1 @ 3 4 5 6 7 8 9") _ST("1 2 @ 4 5 6 7 8 9") _ST("1 @ @ @ 5 6 7 8 9") _ST("1 @ @ 4 @ 6 7 8 9") _ST("1 @ @ 4 5 @ 7 8 9") _ST("1 @ 3 4 5 6 @ 8 9") _P1("retu_leavelast 1/9 data.ssv") _ST("@ 2 @ @ @ @ @ @ @") _ST("@ @ 3 @ @ @ @ @ @") _ST("@ 2 @ 4 @ @ @ @ @") _ST("@ @ @ @ 5 @ @ @ @") _ST("@ @ @ @ @ 6 @ @ @") _ST("@ @ @ @ @ @ 7 @ @") _ST("1 @ 3 4 5 6 @ 8 9") _P1("") }, TEXTSET_END };
/* Copyright (c) 2015, Andreas Fett 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. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef UTF8_VALIDATE_H #define UTF8_VALIDATE_H #include <stdbool.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif typedef int utf8_state; /* validate a string. * * The string must be zero terminated. * This will return true unless: * - an invalid sequence is detected * - an invalid octet is detected * - the string terminates with an incomplete sequence */ bool utf8_validate_str(const char * const); /* validate a chunk of memory. * * This will return true unless: * - an invalid sequence is detected * - an invalid octet is detected * - the buffer terminates with an incomplete sequence */ bool utf8_validate_mem(const void * const, size_t); /* validate a chunk of memory. * * The state must be initialized to 0 at the first call. * * This will return true unless: * - an invalid sequence is detected * - an invalid octet is detected * * There may be an unterminated sequence at the end of the buffer. * The state will be > 0 if that is the case. * * In case the string could not be validated the state will be set to -1. */ bool utf8_validate_some(utf8_state *const, const void * const, size_t); /* validate a stream. * * The state must be initialized to 0 at the first call. * * This will return true unless: * - an invalid sequence is detected * - an invalid octet is detected * * If a sequence is unterminated after a call the state will be > 0 * If this function returns false the state ist set to -1 */ bool utf8_validate(utf8_state *const, int); #ifdef __cplusplus } #endif #endif
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once #include "Materials/MaterialExpression.h" #include "MaterialExpressionConstant4Vector.generated.h" UCLASS(collapsecategories, hidecategories=Object, MinimalAPI) class UMaterialExpressionConstant4Vector : public UMaterialExpression { GENERATED_UCLASS_BODY() UPROPERTY(EditAnywhere, Category=MaterialExpressionConstant4Vector) FLinearColor Constant; // Begin UMaterialExpression Interface virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex, int32 MultiplexIndex) override; virtual void GetCaption(TArray<FString>& OutCaptions) const override; #if WITH_EDITOR virtual FString GetDescription() const override; virtual uint32 GetOutputType(int32 OutputIndex) override {return MCT_Float4;} #endif // WITH_EDITOR // End UMaterialExpression Interface };
// @file: include/pcore/list.h // Copyright (c) 2013 Korepwx. All rights reserved. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Contributors: // Korepwx <public@korepwx.com> 2013-07-06 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. #ifndef _INCLUDE_PCORE_LIST_H_10CA3FE0E61211E2A8D5E5C2B71A9077 #define _INCLUDE_PCORE_LIST_H_10CA3FE0E61211E2A8D5E5C2B71A9077 #pragma once #include <stddef.h> // ---- This file contains a generic kernel list implementation ---- struct _KListEntry { struct _KListEntry *prev, *next; }; typedef struct _KListEntry KListEntry; /** * @brief Initliaze a kernel list with no items. */ static __always_inline void klist_init(KListEntry* list) { list->prev = list->next = list; } static __always_inline void klist_add_before(KListEntry* item, KListEntry* itemToAdd) { itemToAdd->prev = item->prev; itemToAdd->next = item; item->prev->next = itemToAdd; item->prev = itemToAdd; } static __always_inline void klist_add_after(KListEntry* item, KListEntry* itemToAdd) { klist_add_before(item->next, itemToAdd); } static __always_inline void klist_add(KListEntry*item, KListEntry* itemToAdd) { klist_add_before(item, itemToAdd); } static __always_inline void klist_remove(KListEntry* item) { item->prev->next = item->next; item->next->prev = item->prev; } static __always_inline bool klist_empty(KListEntry* list) { return (list == list->next); } static __always_inline KListEntry* klist_next(KListEntry* item) { return item->next; } static __always_inline KListEntry* klist_prev(KListEntry* item) { return item->prev; } #endif // _INCLUDE_PCORE_LIST_H_10CA3FE0E61211E2A8D5E5C2B71A9077
/* * papi_counters.h */ #ifndef __PAPI_COUNTERS_H__ #define __PAPI_COUNTERS_H__ #pragma once #if __cplusplus extern "C" { #endif enum { dr_static_max_papi_events = 10 }; typedef struct dr_papi_gdata dr_papi_gdata_t; typedef struct dr_papi_tdata dr_papi_tdata_t; struct dr_papi_gdata { int initialized; char * event_names[dr_static_max_papi_events]; int g_event_codes[dr_static_max_papi_events]; int n_events; }; struct dr_papi_tdata { union { struct { int initialized; int t_event_codes[dr_static_max_papi_events]; int n_events; int eventset; unsigned long long sampling_interval; unsigned long long next_sampling_clock; unsigned long long t0, t1; long long values0[dr_static_max_papi_events]; long long values1[dr_static_max_papi_events]; }; char __pad__[64][2]; }; }; dr_papi_gdata_t * dr_papi_make_gdata(); int dr_papi_init(dr_papi_gdata_t *); dr_papi_tdata_t * dr_papi_make_tdata(dr_papi_gdata_t *); int dr_papi_init_thread(dr_papi_gdata_t *, dr_papi_tdata_t *); int dr_papi_read(dr_papi_gdata_t *, dr_papi_tdata_t *, long long *); #if __cplusplus }; #endif #endif
//================================================================================================= /*! // \file blaze/math/constraints/VecSerialExpr.h // \brief Constraint on the data type // // Copyright (C) 2012-2017 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= #ifndef _BLAZE_MATH_CONSTRAINTS_VECSERIALEXPR_H_ #define _BLAZE_MATH_CONSTRAINTS_VECSERIALEXPR_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/math/typetraits/IsVecSerialExpr.h> namespace blaze { //================================================================================================= // // MUST_BE_VECSERIALEXPR_TYPE CONSTRAINT // //================================================================================================= //************************************************************************************************* /*!\brief Constraint on the data type. // \ingroup math_constraints // // In case the given data type \a T is not a vector serial evaluation expression (i.e. a type // derived from the VecSerialExpr base class), a compilation error is created. */ #define BLAZE_CONSTRAINT_MUST_BE_VECSERIALEXPR_TYPE(T) \ static_assert( ::blaze::IsVecSerialExpr<T>::value, "Non-vector serial evaluation expression type detected" ) //************************************************************************************************* //================================================================================================= // // MUST_NOT_BE_VECSERIALEXPR_TYPE CONSTRAINT // //================================================================================================= //************************************************************************************************* /*!\brief Constraint on the data type. // \ingroup math_constraints // // In case the given data type \a T is a vector serial evaluation expression (i.e. a type derived // from the VecSerialExpr base class), a compilation error is created. */ #define BLAZE_CONSTRAINT_MUST_NOT_BE_VECSERIALEXPR_TYPE(T) \ static_assert( !::blaze::IsVecSerialExpr<T>::value, "Vector serial evaluation expression type detected" ) //************************************************************************************************* } // namespace blaze #endif
/* * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * Portions Copyright (c) 1999-2004 Apple Computer, Inc. All Rights * Reserved. This file contains Original Code and/or Modifications of * Original Code as defined in and that are subject to the Apple Public * Source License Version 1.1 (the "License"). You may not use this file * except in compliance with the License. Please obtain a copy of the * License at http://www.apple.com/publicsource and read it before using * this file. * * The Original Code and all software distributed under the License are * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the * License for the specific language governing rights and limitations * under the License. * * @APPLE_LICENSE_HEADER_END@ * */ #ifndef __ENDPOINTDISPOSER__ #define __ENDPOINTDISPOSER__ // ------------------------------ Includes #include "OTEndpoint.h" // ------------------------------ Public Definitions // ------------------------------ Public Types typedef struct NotifierContext { EndpointDisposer *disposer; PrivateEndpoint *ep; } NotifierContext; class EndpointDisposer { public: EndpointDisposer(OTEndpoint *inEP, NMBoolean inNotifyUser); ~EndpointDisposer(); NMErr DoIt(void); static NMBoolean sLastChance; // flag telling us the module is about to be unloaded protected: NMUInt32 mState; OTEndpoint *mEP; NMBoolean bNotifyUser; OTLink mLink; NMSInt32 mTimerTask; OTResult mLastStreamState; OTResult mLastDatagramState; UnsignedWide mStreamStateStartTime; UnsignedWide mDatagramStateStartTime; UnsignedWide mStartTime; NMUInt8 mLock; NotifierContext mStreamContext; NotifierContext mDatagramContext; OTProcessUPP mTimerTaskUPP; enum { kStreamDone = 1, kDatagramDone = 2, kSentDisconnect = 4, kReceivedDisconnect = 8 }; NMErr Finish(void); NMErr PrepForClose(PrivateEndpoint *inPrivEP); NMErr Process(); NMErr TransitionEP(PrivateEndpoint *inEP); NMErr DoDisconnect(NMBoolean inOrderly); static NetNotifierUPP mNotifier; static pascal void Notifier(void* contextPtr, OTEventCode code, OTResult result, void* cookie); static pascal void TimerTask(void*); static void DoLook(NotifierContext *inDisposer); }; #endif // __ENDPOINTDISPOSER__
#ifndef CTF_MEMORY_USAGE_H #define CTF_MEMORY_USAGE_H #include <sys/types.h> #define _CTF_MEMORY_USAGE_PROTO(FUNCTION_NAME, OBJECT_TYPE) \ size_t \ FUNCTION_NAME (OBJECT_TYPE object); #endif
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation and // any modifications thereto. Any use, reproduction, disclosure, or // distribution of this software and related documentation without an express // license agreement from NVIDIA Corporation is strictly prohibited. // // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. // // Information and code furnished is believed to be accurate and reliable. // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such // information or for any infringement of patents or other rights of third parties that may // result from its use. No license is granted by implication or otherwise under any patent // or patent rights of NVIDIA Corporation. Details are subject to change without notice. // This code supersedes and replaces all information previously supplied. // NVIDIA Corporation products are not authorized for use as critical // components in life support devices or systems without express written approval of // NVIDIA Corporation. // // Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Include Guard #ifndef GU_EDGECACHE_H #define GU_EDGECACHE_H #include "CmPhysXCommon.h" #include "PsIntrinsics.h" namespace physx { namespace Gu { class EdgeCache { #define NUM_EDGES_IN_CACHE 64 //must be power of 2. 32 lines result in 10% extra work (due to cache misses), 64 lines in 6% extra work, 128 lines in 4%. public: EdgeCache() { Ps::memZero(cacheLines, NUM_EDGES_IN_CACHE*sizeof(CacheLine)); } PxU32 hash(PxU32 key) const { return (NUM_EDGES_IN_CACHE - 1) & Ps::hash(key); //Only a 16 bit hash would be needed here. } bool isInCache(PxU8 vertex0, PxU8 vertex1) { PX_ASSERT(vertex1 >= vertex0); PxU16 key = (vertex0 << 8) | vertex1; PxU32 h = hash(key); CacheLine& cl = cacheLines[h]; if (cl.fullKey == key) { return true; } else //cache the line now as it's about to be processed { cl.fullKey = key; return false; } } private: struct CacheLine { PxU16 fullKey; }; CacheLine cacheLines[NUM_EDGES_IN_CACHE]; #undef NUM_EDGES_IN_CACHE }; } } #endif
/* Copyright (c) 2013 Xingxing Ke <yykxx@hotmail.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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. */ #include "plm_http_event_io.h" static void plm_http_event_write_cb(void *data, int fd) { int n; struct plm_http_wrevt *we; we = (struct plm_http_wrevt *)data; n = plm_comm_write(fd, we->hw_buf + we->hw_off, we->hw_len - we->hw_off); if (n > 0) { we->hw_off += n; if (we->hw_len > we->hw_off) PLM_EVT_DRV_WRITE(fd, we, plm_http_event_write_cb); else we->hw_fn(we->hw_data, we->hw_buf, we->hw_len, 0); } else if (n <= 0) { if (plm_comm_ignore(errno)) PLM_EVT_DRV_WRITE(fd, we, plm_http_event_write_cb); else we->hw_fn(we->hw_data, we->hw_buf, we->hw_off, -1); } } void plm_http_event_write(int fd, struct plm_http_wrevt *we) { int n; n = plm_comm_write(fd, we->hw_buf, we->hw_len); if (n > 0) { we->hw_off += n; if (we->hw_len > we->hw_off) PLM_EVT_DRV_WRITE(fd, we, plm_http_event_write_cb); else we->hw_fn(we->hw_data, we->hw_buf, we->hw_len, 0); } else if (n <= 0) { if (plm_comm_ignore(errno)) PLM_EVT_DRV_WRITE(fd, we, plm_http_event_write_cb); else we->hw_fn(we->hw_data, we->hw_buf, we->hw_off, -1); } }
// // Copyright © 2017 Daniel Farrelly // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end