text
stringlengths
4
6.14k
#include <pebble.h> #include "enamel.h" #include <pebble-events/pebble-events.h> static Window *s_main_window; static TextLayer *s_time_layer; static void main_window_load(Window *window) { // Get information about the Window Layer *window_layer = window_get_root_layer(window); GRect bounds = layer_get_bounds(window_layer); // Create the TextLayer with specific bounds s_time_layer = text_layer_create( GRect(0, PBL_IF_ROUND_ELSE(58, 52), bounds.size.w, 50) ); // Add it as a child layer to the Window's root layer layer_add_child(window_layer, text_layer_get_layer(s_time_layer)); } static void main_window_unload(Window *window) { // Destroy TextLayer text_layer_destroy(s_time_layer); } static void update_time() { // Get a tm structure time_t temp = time(NULL); struct tm *tick_time = localtime(&temp); // Write the current hours and minutes into a buffer static char s_buffer[8]; strftime(s_buffer, sizeof(s_buffer), clock_is_24h_style() ? "%H:%M" : "%I:%M", tick_time); text_layer_set_background_color(s_time_layer, enamel_get_BACKGROUND_COLOR()); text_layer_set_text_color(s_time_layer, enamel_get_TEXT_COLOR()); text_layer_set_text(s_time_layer, s_buffer); text_layer_set_font(s_time_layer, fonts_get_system_font(FONT_KEY_BITHAM_42_BOLD)); text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter); } static void tick_handler(struct tm *tick_time, TimeUnits units_changed) { update_time(); } static void enamel_register_settings_received_cb() { update_time(); } static void init(void) { // Initialize Enamel to register App Message handlers and restores settings enamel_init(); // Register our callback enamel_register_settings_received(enamel_register_settings_received_cb); // call pebble-events app_message_open function events_app_message_open(); s_main_window = window_create(); window_set_window_handlers(s_main_window, (WindowHandlers) { .load = main_window_load, .unload = main_window_unload, }); window_stack_push(s_main_window, true); // Register with TickTimerService tick_timer_service_subscribe(MINUTE_UNIT, tick_handler); update_time(); } static void deinit(void) { window_destroy(s_main_window); // Deinit Enamel to unregister App Message handlers and save settings enamel_deinit(); } int main(void) { init(); app_event_loop(); deinit(); }
/* vim: set tabstop=2 expandtab: */ #ifndef MTAB_CHECK_LOOP_H #define MTAB_CHECK_LOOP_H #include "util/configure.h" #include "util/srv.h" #include "mtab_checker.h" void ST_init_check_loop( ST_CONFIG c, ST_SRV_BUFF b, ST_MTAB_ENTRIES me ); void ST_check_loop(void); void ST_break_check_loop(void); #endif
#ifndef INPUT_H_INCLUDED #define INPUT_H_INCLUDED int handle_key(Eria *state, char const *s); int handle_text(Eria *state, char const *s); #endif
/* * PCDReader.h * * Created on: 2014.04.02. * Author: Balint */ #ifndef PCDREADER_H_ #define PCDREADER_H_ #include <opencv2/core/core.hpp> #include <sstream> #include <iostream> #include <fstream> class PCDReader { public: PCDReader(); virtual ~PCDReader(); void read(const char * filename, cv::Mat& xyz, std::vector<int>& rgbas); }; #endif /* PCDREADER_H_ */
// // NearLifeViewController.h // QiPinTong // // Created by taylor on 2017/3/25. // Copyright © 2017年 ShiJiJiaLian. All rights reserved. // #import <UIKit/UIKit.h> @interface NearLifeViewController : UIViewController @end
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "GameFramework/GameModeBase.h" #include "EnvSearcherGameModeBase.generated.h" /** * */ UCLASS() class ENVSEARCHER_API AEnvSearcherGameModeBase : public AGameModeBase { GENERATED_BODY() };
/* * Copyright (c) 2013-2014 ADTECH GmbH * Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING) * * Author: Andreas Pohl */ #ifndef _TASKS_DISPOSABLE_H_ #define _TASKS_DISPOSABLE_H_ #include <atomic> namespace tasks { /*! * \brief Base class for objects/tasks that can be deleted. * * We implement a simplistic garbage collector using timer tasks. If * a task with auto_delete enabled can't be deleted directly by a * worker thread, a dispose_task gets created that periodically tries * to delete the task. */ class disposable { public: disposable() : m_can_dispose(true) {} virtual ~disposable() {} /*! * \brief Check if a task can be disposed or not. * * \return True if the task can be disposed. False otherwise. */ inline bool can_dispose() const { return m_can_dispose; } /*! * \brief Mark a task for being not disposable. */ inline void disable_dispose() { m_can_dispose = false; } /*! * \brief Mark a task for being disposable. */ inline void enable_dispose() { m_can_dispose = true; } /*! \brief Dispose an object. * * Dispose is called to delete a task. Instead of calling delete * directly we enable for hooking in here. This is required by * the net_io_task for example to stop the watcher. */ virtual void dispose(worker*) = 0; private: std::atomic<bool> m_can_dispose; }; } // tasks #endif // _TASKS_DISPOSABLE_H_
// // NNReloadMapper.h // UIKitWorkarounds // // Created by Nick Tymchenko on 26/01/16. // Copyright © 2016 Nick Tymchenko. All rights reserved. // #import <Foundation/Foundation.h> @class NNReloadOperations; NS_ASSUME_NONNULL_BEGIN @interface NNReloadMapper : NSObject - (instancetype)initWithReloadOperations:(NNReloadOperations *)operations NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; - (NSUInteger)sectionBeforeToSectionAfter:(NSUInteger)sectionBefore; - (NSUInteger)sectionAfterToSectionBefore:(NSUInteger)sectionAfter; - (NSIndexPath *)indexPathBeforeToIndexPathAfter:(NSIndexPath *)indexPathBefore; - (NSIndexPath *)indexPathAfterToIndexPathBefore:(NSIndexPath *)indexPathAfter; @end NS_ASSUME_NONNULL_END
/** * This header is generated by class-dump-z 0.1-11o. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. */ #import <UIKit/UILabel.h> #import "UIKit-Structs.h" @class NSString; @interface UITableViewCountView : UILabel { NSString* _countString; int _count; } -(id)initWithFrame:(CGRect)frame withCountString:(id)countString withCount:(int)count; -(void)dealloc; -(void)setCountString:(id)string withCount:(int)count; -(void)setCount:(int)count; -(int)count; @end
/* Copyright (c) 2008-2014 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "array.h" #include "ioloop.h" #include "str.h" #include "var-expand.h" #include "acl-plugin.h" #include "acl-lookup-dict.h" #include "acl-shared-storage.h" #include "index/shared/shared-storage.h" #define SHARED_NS_RETRY_SECS (60*60) static bool acl_ns_prefix_exists(struct mail_namespace *ns) { struct mailbox *box; const char *vname; enum mailbox_existence existence; bool ret; if (ns->list->mail_set->mail_shared_explicit_inbox) return FALSE; vname = t_strndup(ns->prefix, ns->prefix_len-1); box = mailbox_alloc(ns->list, vname, 0); ret = mailbox_exists(box, FALSE, &existence) == 0 && existence == MAILBOX_EXISTENCE_SELECT; mailbox_free(&box); return ret; } static void acl_shared_namespace_add(struct mail_namespace *ns, struct mail_storage *storage, const char *userdomain) { static struct var_expand_table static_tab[] = { { 'u', NULL, "user" }, { 'n', NULL, "username" }, { 'd', NULL, "domain" }, { '\0', NULL, NULL } }; struct shared_storage *sstorage = (struct shared_storage *)storage; struct mail_namespace *new_ns = ns; struct var_expand_table *tab; struct mailbox_list_iterate_context *iter; const struct mailbox_info *info; const char *p, *mailbox; string_t *str; if (strcmp(ns->user->username, userdomain) == 0) { /* skip ourself */ return; } p = strchr(userdomain, '@'); tab = t_malloc(sizeof(static_tab)); memcpy(tab, static_tab, sizeof(static_tab)); tab[0].value = userdomain; tab[1].value = p == NULL ? userdomain : t_strdup_until(userdomain, p); tab[2].value = p == NULL ? "" : p + 1; str = t_str_new(128); var_expand(str, sstorage->ns_prefix_pattern, tab); mailbox = str_c(str); if (shared_storage_get_namespace(&new_ns, &mailbox) < 0) return; /* check if there are any mailboxes really visible to us */ iter = mailbox_list_iter_init(new_ns->list, "*", MAILBOX_LIST_ITER_RETURN_NO_FLAGS); while ((info = mailbox_list_iter_next(iter)) != NULL) break; (void)mailbox_list_iter_deinit(&iter); if (info == NULL && !acl_ns_prefix_exists(new_ns)) { /* no visible mailboxes, remove the namespace */ mail_namespace_destroy(new_ns); } } int acl_shared_namespaces_add(struct mail_namespace *ns) { struct acl_user *auser = ACL_USER_CONTEXT(ns->user); struct acl_mailbox_list *alist = ACL_LIST_CONTEXT(ns->list); struct mail_storage *storage = mail_namespace_get_default_storage(ns); struct acl_lookup_dict_iter *iter; const char *name; i_assert(ns->type == MAIL_NAMESPACE_TYPE_SHARED); i_assert(strcmp(storage->name, MAIL_SHARED_STORAGE_NAME) == 0); if (ioloop_time < alist->last_shared_add_check + SHARED_NS_RETRY_SECS) { /* already added, don't bother rechecking */ return 0; } alist->last_shared_add_check = ioloop_time; iter = acl_lookup_dict_iterate_visible_init(auser->acl_lookup_dict); while ((name = acl_lookup_dict_iterate_visible_next(iter)) != NULL) { T_BEGIN { acl_shared_namespace_add(ns, storage, name); } T_END; } return acl_lookup_dict_iterate_visible_deinit(&iter); }
// // MTActionCell.h // MTCellControl // // Created by Misha Tavkhelidze on 04/05/2014. // Copyright (c) 2014 misha.tavkhelidze@gmail.com. All rights reserved. // #import <Cocoa/Cocoa.h> @interface MTActionCell : NSActionCell @end
// // STHomeViewController.h // 0120-网易新闻首页框架 // // Created by 李松涛 on 15-1-30. // Copyright (c) 2015年 lst. All rights reserved. // #import <UIKit/UIKit.h> @interface STHomeViewController : UIViewController @end
// // GJStaticTableCellMaker.h // StaticTableView // // Created by zhangxudong on 2017/11/1. // Copyright © 2017年 xudongzhang. All rights reserved. // #import <Foundation/Foundation.h> #import "GCStaticCellMakerProtocol.h" @interface GJStaticTableCellMaker : NSObject <GCStaticCellMakerProtocol> @property (nonatomic ,strong ,readonly)UITableViewCell * cell; @property (nonatomic ,strong) void (^gj_commitEditCB)(id<GCStaticCellMakerProtocol> cellMaker); @property (nonatomic ,assign) BOOL gj_canEdit; @property (nonatomic ,assign) UITableViewCellEditingStyle gj_cellEditingStyle; @property (nonatomic ,strong) void (^gj_willDisplayCellCB) (__kindof UITableViewCell * cell); @property (nonatomic ,assign) CGFloat gj_cellHeight; @property (nonatomic ,strong) void (^gj_cellSelectedCB) (__kindof UITableViewCell * cell) ; @end
/******************************************************************************* USB Peripheral Library Template Implementation File Name: usb_ALL_Interrupt_Default.h Summary: USB PLIB Template Implementation Description: This header file contains template implementations For Feature : ALL_Interrupt and its Variant : Default For following APIs : PLIB_USB_AllInterruptEnable PLIB_USB_ExistsALL_Interrupt *******************************************************************************/ //DOM-IGNORE-BEGIN /******************************************************************************* Copyright (c) 2012 released Microchip Technology Inc. All rights reserved. Microchip licenses to you the right to use, modify, copy and distribute Software only when embedded on a Microchip microcontroller or digital signal controller that is integrated into your product or third party product (pursuant to the sublicense terms in the accompanying license agreement). You should refer to the license agreement accompanying this Software for additional information regarding your rights and obligations. SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. *******************************************************************************/ //DOM-IGNORE-END #ifndef _USB_ALL_INTERRUPT_DEFAULT_H #define _USB_ALL_INTERRUPT_DEFAULT_H #include "driver/usb/usbfs/src/templates/usbfs_registers.h" //****************************************************************************** /* Function : USB_AllInterruptEnable_Default Summary: Implements Default variant of PLIB_USB_AllInterruptEnable Description: This template implements the Default variant of the PLIB_USB_AllInterruptEnable function. */ PLIB_TEMPLATE void USB_AllInterruptEnable_Default ( USB_MODULE_ID index , USB_INTERRUPTS usbInterruptsFlag , USB_ERROR_INTERRUPTS usbErrorInterruptsFlag , USB_OTG_INTERRUPTS otgInterruptFlag ) { volatile usb_registers_t * usb = ((usb_registers_t *)(index)); usb->UxIE.w = usbInterruptsFlag; usb->UxEIE.w = usbErrorInterruptsFlag; usb->UxOTGIE.w = otgInterruptFlag; } //****************************************************************************** /* Function : USB_InterruptEnableGet_Default Summary: Implements Default variant of PLIB_USB_InterruptEnableGet Description: This template implements the Default variant of the PLIB_USB_InterruptEnableGet function. */ PLIB_TEMPLATE USB_INTERRUPTS USB_InterruptEnableGet_Default ( USB_MODULE_ID index ) { volatile usb_registers_t * usb = ((usb_registers_t *)(index)); return (USB_INTERRUPTS)( usb->UxIE.w ); } //****************************************************************************** /* Function : USB_ExistsALL_Interrupt_Default Summary: Implements Default variant of PLIB_USB_ExistsALL_Interrupt Description: This template implements the Default variant of the PLIB_USB_ExistsALL_Interrupt function. */ #define PLIB_USB_ExistsALL_Interrupt PLIB_USB_ExistsALL_Interrupt PLIB_TEMPLATE bool USB_ExistsALL_Interrupt_Default( USB_MODULE_ID index ) { return true; } #endif /*_USB_ALL_INTERRUPT_DEFAULT_H*/ /****************************************************************************** End of File */
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/tball/tmp/j2objc/junit/build_result/java/junit/textui/TestRunner.java // #ifndef _JunitTextuiTestRunner_H_ #define _JunitTextuiTestRunner_H_ #include "J2ObjC_header.h" #include "junit/runner/BaseTestRunner.h" @class IOSClass; @class IOSObjectArray; @class JavaIoPrintStream; @class JavaLangThrowable; @class JunitFrameworkTestResult; @class JunitTextuiResultPrinter; @protocol JunitFrameworkTest; #define JunitTextuiTestRunner_SUCCESS_EXIT 0 #define JunitTextuiTestRunner_FAILURE_EXIT 1 #define JunitTextuiTestRunner_EXCEPTION_EXIT 2 @interface JunitTextuiTestRunner : JunitRunnerBaseTestRunner #pragma mark Public - (instancetype)init; - (instancetype)initWithJavaIoPrintStream:(JavaIoPrintStream *)writer; - (instancetype)initWithJunitTextuiResultPrinter:(JunitTextuiResultPrinter *)printer; - (JunitFrameworkTestResult *)doRunWithJunitFrameworkTest:(id<JunitFrameworkTest>)test; - (JunitFrameworkTestResult *)doRunWithJunitFrameworkTest:(id<JunitFrameworkTest>)suite withBoolean:(jboolean)wait; + (void)mainWithNSStringArray:(IOSObjectArray *)args; + (void)runWithIOSClass:(IOSClass *)testClass; + (JunitFrameworkTestResult *)runWithJunitFrameworkTest:(id<JunitFrameworkTest>)test; + (void)runAndWaitWithJunitFrameworkTest:(id<JunitFrameworkTest>)suite; - (void)setPrinterWithJunitTextuiResultPrinter:(JunitTextuiResultPrinter *)printer; - (JunitFrameworkTestResult *)startWithNSStringArray:(IOSObjectArray *)args; - (void)testEndedWithNSString:(NSString *)testName; - (void)testFailedWithInt:(jint)status withJunitFrameworkTest:(id<JunitFrameworkTest>)test withJavaLangThrowable:(JavaLangThrowable *)t; - (void)testStartedWithNSString:(NSString *)testName; #pragma mark Protected - (JunitFrameworkTestResult *)createTestResult; - (void)pauseWithBoolean:(jboolean)wait; - (void)runFailedWithNSString:(NSString *)message; - (JunitFrameworkTestResult *)runSingleMethodWithNSString:(NSString *)testCase withNSString:(NSString *)method withBoolean:(jboolean)wait; @end J2OBJC_EMPTY_STATIC_INIT(JunitTextuiTestRunner) J2OBJC_STATIC_FIELD_GETTER(JunitTextuiTestRunner, SUCCESS_EXIT, jint) J2OBJC_STATIC_FIELD_GETTER(JunitTextuiTestRunner, FAILURE_EXIT, jint) J2OBJC_STATIC_FIELD_GETTER(JunitTextuiTestRunner, EXCEPTION_EXIT, jint) FOUNDATION_EXPORT void JunitTextuiTestRunner_init(JunitTextuiTestRunner *self); FOUNDATION_EXPORT JunitTextuiTestRunner *new_JunitTextuiTestRunner_init() NS_RETURNS_RETAINED; FOUNDATION_EXPORT void JunitTextuiTestRunner_initWithJavaIoPrintStream_(JunitTextuiTestRunner *self, JavaIoPrintStream *writer); FOUNDATION_EXPORT JunitTextuiTestRunner *new_JunitTextuiTestRunner_initWithJavaIoPrintStream_(JavaIoPrintStream *writer) NS_RETURNS_RETAINED; FOUNDATION_EXPORT void JunitTextuiTestRunner_initWithJunitTextuiResultPrinter_(JunitTextuiTestRunner *self, JunitTextuiResultPrinter *printer); FOUNDATION_EXPORT JunitTextuiTestRunner *new_JunitTextuiTestRunner_initWithJunitTextuiResultPrinter_(JunitTextuiResultPrinter *printer) NS_RETURNS_RETAINED; FOUNDATION_EXPORT void JunitTextuiTestRunner_runWithIOSClass_(IOSClass *testClass); FOUNDATION_EXPORT JunitFrameworkTestResult *JunitTextuiTestRunner_runWithJunitFrameworkTest_(id<JunitFrameworkTest> test); FOUNDATION_EXPORT void JunitTextuiTestRunner_runAndWaitWithJunitFrameworkTest_(id<JunitFrameworkTest> suite); FOUNDATION_EXPORT void JunitTextuiTestRunner_mainWithNSStringArray_(IOSObjectArray *args); J2OBJC_TYPE_LITERAL_HEADER(JunitTextuiTestRunner) #endif // _JunitTextuiTestRunner_H_
// // AppDelegate.h // NGFramework // // Created by Kyle Turner on 9/24/14. // Copyright (c) 2014 nGen Works. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #define ROL(x, c) (((x) << (c)) | ((x) >> (32 - (c)))) const uint32_t constants[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee , 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 , 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be , 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 , 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa , 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8 , 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed , 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a , 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c , 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70 , 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05 , 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665 , 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039 , 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1 , 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1 , 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; const uint32_t shifts[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21}; void intToCharBytes(uint32_t, uint8_t); uint32_t charToIntBytes(const uint8_t *); void md5(const uint8_t *, int, uint8_t *); void extendInput(const uint8_t *, int, uint8_t **, int *);
//================================================================================================= /*! // \file blaze/util/TypeList.h // \brief Header file for the Unique class template // // Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= #ifndef _BLAZE_UTIL_TYPELIST_UNIQUE_H_ #define _BLAZE_UTIL_TYPELIST_UNIQUE_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/util/typelist/Append.h> #include <blaze/util/typelist/Erase.h> #include <blaze/util/typelist/TypeList.h> namespace blaze { //================================================================================================= // // CLASS DEFINITION // //================================================================================================= //************************************************************************************************* /*!\brief Erasing all duplicates from a type list. // \ingroup typelist // // The Unique class can be used to erase all duplicates from a type list \a TList. In order to // erase all duplicates, the Unique class has to be instantiated for a particular type list. // The following example gives an impression of the use of the Unique class: \code // Defining a temporary type list containing the types int and float twice using Tmp = blaze::TypeList< float, int, double, int, float >; // Removing all duplicates from the type list using NoDuplicates = blaze::Unique<Tmp>::Type; \endcode */ template< typename TL > // Type of the type list struct Unique; //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Spezialization of the Unique class for an empty type list. // \ingroup typelist */ template<> struct Unique< TypeList<> > { using Type = TypeList<>; }; /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Spezialization of the Unique class for a general type list. // \ingroup typelist */ template< typename T // Type of the head of the type list , typename... Ts > // Types of the tail of the type list struct Unique< TypeList<T,Ts...> > { private: using TL1 = typename Unique< TypeList<Ts...> >::Type; using TL2 = typename Erase<TL1,T>::Type; public: using Type = typename Append< TypeList<T>, TL2 >::Type; }; /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*!\brief Auxiliary alias declaration for the Unique class template. // \ingroup type_traits // // The Unique_t alias declaration provides a convenient shortcut to access the nested \a Type // of the Unique class template. For instance, given the type list \a TL the following two type // definitions are identical: \code using Type1 = typename Unique<TL>::Type; using Type2 = Unique_t<TL>; \endcode */ template< typename TL > // Type of the type list using Unique_t = typename Unique<TL>::Type; //************************************************************************************************* } // namespace blaze #endif
#include <stdio.h> #include <apr_general.h> #include <apr_file_io.h> #include <apr_strings.h> #define BUF_SIZE 1024 int main(int argc,const char *argv[]) { apr_status_t rv; apr_pool_t *mp; apr_size_t fsize; apr_file_t *fp; const char *fname; if(argc<2) { printf("usage %s \n",argv[0]); return 0; } else { fname=argv[1]; printf("usage %s\n ",fname); } apr_initialize(); apr_pool_create(&mp,NULL); rv=apr_file_open(&fp,fname,APR_READ|APR_FOPEN_READ|APR_FOPEN_CREATE|APR_OS_DEFAULT,mp); if(rv != APR_SUCCESS) { return -1; } char *buf[BUF_SIZE]; fsize=strlen(*buf); rv=apr_file_read(fp,buf,&fsize); if(rv !=APR_SUCCESS) { return -1; } printf("file read success :rv=%l nbytes=%d\n",rv,fsize); apr_file_close(fp); apr_pool_destroy(mp); apr_terminate(); return 0; }
// // APExtension.h // Captain Black // // Created by Captain Black on 16/6/1. // Copyright © 2016年 www.aipai.com. All rights reserved. // #ifndef APExtension_h #define APExtension_h #import "UIColor+APExtension.h" #import "UIImage+APExtension.h" #import "UIWindow+APExtension.h" #import "UIView+APExtension.h" #import "NSData+APExtension.h" #import "NSDate+APExtension.h" #import "NSString+APExtension.h" #import "NSDictionary+APExtension.h" #import "UIResponder+APExtension.h" #endif /* APExtension_h */
/* * Generated by class-dump 3.3.3 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard. */ #import <Message/MFMessageSortingValue.h> @interface _MFMessageSortingValueDateReceived : MFMessageSortingValue { double _dateReceivedAsTimeIntervalSince1970; } - (double)dateReceivedAsTimeIntervalSince1970; - (void)setDateReceivedAsTimeIntervalSince1970:(double)arg1; - (id)description; @end
C $Header$ C $Name$ #ifdef ALLOW_PTRACERS # ifdef AUTODIFF_PTRACERS_SPLIT_FILES CADJ STORE pTracer(:,:,:,:,:,1:PTRACERS_num) CADJ & = tapelev4, key = ilev_4 CADJ STORE gpTrNm1(:,:,:,:,:,1:PTRACERS_num) CADJ & = tapelev4, key = ilev_4 # else CADJ STORE pTracer = tapelev4, key = ilev_4 CADJ STORE gpTrNm1 = tapelev4, key = ilev_4 # endif #endif /* ALLOW_PTRACERS */
// Copyright (c) 2016 Antony Arciuolo. See License.txt regarding use. // Standard structs and definitions for the bitmap (.bmp) image file format. #pragma once #include <cstdint> #include <cassert> static const uint16_t bmp_signature = 0x4d42; // 'BM' enum bmp_compression { rgb = 0, rle8 = 1, rle4 = 2, bitfields = 3, jpeg = 4, png = 5, }; struct bmp_rgbquad { uint8_t rgbBlue; uint8_t rgbGreen; uint8_t rgbRed; uint8_t rgbReserved; }; struct bmp_ciexyz { int32_t ciexyzX; int32_t ciexyzY; int32_t ciexyzZ; }; struct bmp_ciexyztriple { bmp_ciexyz ciexyzRed; bmp_ciexyz ciexyzGreen; bmp_ciexyz ciexyzBlue; }; struct bmp_infoheader { uint32_t biSize; int32_t biWidth; int32_t biHeight; uint16_t biPlanes; uint16_t biBitCount; uint32_t biCompression; uint32_t biSizeImage; int32_t biXPelsPerMeter; int32_t biYPelsPerMeter; uint32_t biClrUsed; uint32_t biClrImportant; }; struct bmp_v4infoheader { uint32_t bV4Size; int32_t bV4Width; int32_t bV4Height; uint16_t bV4Planes; uint16_t bV4BitCount; uint32_t bV4V4Compression; uint32_t bV4SizeImage; int32_t bV4XPelsPerMeter; int32_t bV4YPelsPerMeter; uint32_t bV4ClrUsed; uint32_t bV4ClrImportant; uint32_t bV4RedMask; uint32_t bV4GreenMask; uint32_t bV4BlueMask; uint32_t bV4AlphaMask; uint32_t bV4CSType; bmp_ciexyztriple bV4Endpoints; uint32_t bV4GammaRed; uint32_t bV4GammaGreen; uint32_t bV4GammaBlue; }; struct bmp_v5infoheader { uint32_t bv5Size; int32_t bv5Width; int32_t bv5Height; uint16_t bv5Planes; uint16_t bv5BitCount; uint32_t bv5v5Compression; uint32_t bv5SizeImage; int32_t bv5XPelsPerMeter; int32_t bv5YPelsPerMeter; uint32_t bv5ClrUsed; uint32_t bv5ClrImportant; uint32_t bv5RedMask; uint32_t bv5GreenMask; uint32_t bv5BlueMask; uint32_t bv5AlphaMask; uint32_t bv5CSType; bmp_ciexyztriple bv5Endpoints; uint32_t bv5GammaRed; uint32_t bv5GammaGreen; uint32_t bv5GammaBlue; uint32_t bv5Intent; uint32_t bv5ProfileData; uint32_t bv5ProfileSize; uint32_t bv5Reserved; }; struct bmp_info { bmp_infoheader bmiHeader; bmp_rgbquad bmiColors[1]; }; #pragma pack(push,2) struct bmp_header { uint16_t bfType; uint32_t bfSize; uint16_t bfReserved1; uint16_t bfReserved2; uint32_t bfOffBits; }; #pragma pack(pop) static_assert(sizeof(bmp_infoheader) == 40, "size mismatch"); static_assert(sizeof(bmp_v4infoheader) == 108, "size mismatch"); static_assert(sizeof(bmp_v5infoheader) == 124, "size mismatch"); static_assert(sizeof(bmp_info) == 44, "size mismatch"); static_assert(sizeof(bmp_header) == 14, "size mismatch");
@class NSString, NSObject; #import "../O2GEnum.h" #import "../O2GRequestParamsEnum.h" #import "O2GOrderType.h" #import "IAddRef.h" #import "IO2GRow.h" #import "IO2GColumn.h" #import "io2gtable.h" #import "IO2GTimeFrame.h" #import "IO2GRequest.h" #import "./Readers/IO2GSystemProperties.h" #import "./Readers/IO2GMarketDataSnapshotResponseReader.h" #import "./Readers/IO2GTimeConverter.h" #import "./Readers/IO2GTablesUpdatesReader.h" #import "./Readers/IO2GOrderResponseReader.h" #import "./IO2GPermissionChecker.h" #import "./IO2GTradingSettingsProvider.h" #import "io2gresponse.h" #import "IO2GLoginRules.h" #import "IO2GSession.h" #import "O2GTransport.h"
#include "message.h" PUBLIC void make_msg(struct MESSAGE *msg,u_int32 send_pid,u_int32 recv_pid,u_int32 type,u_int32 block){ msg->send_pid=send_pid; msg->recv_pid=recv_pid; msg->type=type; msg->msg_status=MSG_STATUS_VALID; msg->block=block; }
/* * rt_round_snf.h * * Real-Time Workshop code generation for Simulink model "Template_test.mdl". * * Model Version : 1.13 * Real-Time Workshop version : 7.3 (R2009a) 15-Jan-2009 * C source code generated on : Thu Mar 20 15:08:38 2014 * * Target selection: nidll_vxworks.tlc * Note: GRT includes extra infrastructure and instrumentation for prototyping * Embedded hardware selection: 32-bit Generic * Code generation objectives: Unspecified * Validation result: Not run */ #ifndef RTW_HEADER_rt_round_snf_h_ #define RTW_HEADER_rt_round_snf_h_ #include "rtwtypes.h" extern real_T rt_round_snf(const real_T xr); #endif /* RTW_HEADER_rt_round_snf_h_ */
// // VideoPlayerControlDelegate.h // VideoPlayer // // Created by 陈阳阳 on 2017/6/26. // Copyright © 2017年 cyy. All rights reserved. // #import <Foundation/Foundation.h> @class VideoPlayerControl; @protocol VideoPlayerControlDelegate <NSObject> // 播放 - (void)play:(UIButton *)playButton; // 暂停 - (void)pause:(UIButton *)playButton; // 全屏 - (void)fullscreen:(UIButton *)fullscreenButton playerControl:(VideoPlayerControl *)control; @end
#ifndef INCLUDE_GUARD_C9909392_C859_4CE1_9899_FAB3645CFAB9 #define INCLUDE_GUARD_C9909392_C859_4CE1_9899_FAB3645CFAB9 #include "icon.h" #define CLOCK_ICON 9 typedef struct { icon_data mBase; int32_t h; int32_t m; int32_t s; } clock_icon_data; typedef Icon ClockIcon; ClockIcon *clock_icon_create(GRect aFromFrame, GRect aToFrame); void clock_icon_destroy(ClockIcon *aIcon); void clock_icon_update_time(ClockIcon *aIcon); bool clock_icon_shows_second_hand(); #endif
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdbool.h> bool isUnique(char str[]) { //one of the most brilliant ideas was that instead of a dictionary // histogram we would use in any of the other languages, we can avoid that // implementation by just using an array, assuming ASCII int histogram[128]; for (int i=0; i < 128; i++) histogram[i]=0; int length = (int)strlen(str); for (int i=0; i < length; i++) { if (histogram[(int)str[i]] != 0) { //we found a repeated letter return false; } else { //count and move on histogram[(int)str[i]]+=1; } } //if no false was triggered, must be true return true; } int main(int argc, char* argv[]) { if (argc > 1) { for (int i=1; i < argc; i++) { printf("argument: %s IsUnique? %s\n", argv[i], isUnique(argv[i]) ? "Yes" : "No"); } } return EXIT_SUCCESS; } //const char* x is the same thing as char x[]? No.
// // NSDictionary+VDEnhance.h // NSDictionary-Enhance // // Created by vilyever on 15/8/11. // Copyright (c) 2015年 vilyever. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDictionary (VDEnhance) #pragma mark Methods #pragma mark Public Class Method + (NSDictionary *)vd_dictionaryWithDictionary:(NSDictionary *)firstDictionary mergeWithDictionary:(NSDictionary *)secondDictionary; + (NSDictionary *)vd_switchKeyObjectWithDictionary:(NSDictionary *)dictionary; #pragma mark Public Instance Method @end
// // LFHButton.h // LoveFlyHome // // Created by Lefeng on 16/5/31. // Copyright © 2016年 Lefeng. All rights reserved. // #import <UIKit/UIKit.h> @interface LFHButton : UIButton - (void)LFHButtonontentWithImage:(NSString *)images Title:(NSString *)title width:(CGFloat)width height:(CGFloat)height; @end
// // STGSoundPicker.h // Coco Storage // // Created by Lukas Tenbrink on 09.09.14. // Copyright (c) 2014 Lukas Tenbrink. All rights reserved. // #import <Cocoa/Cocoa.h> @class STGSoundPicker; @protocol STGSoundPickerDelegate <NSObject> @optional - (void)soundPicker:(STGSoundPicker *)view choseSound:(NSString *)sound; @end @interface STGSoundPicker : NSView @property (nonatomic, assign) IBOutlet id<STGSoundPickerDelegate> delegate; @property (nonatomic, assign) BOOL enabled; @property (nonatomic, retain) NSString *selectedSound; @end
/** * Created by TekuConcept on 8/3/2016. */ #ifndef C_THRUSTERS_H #define C_THRUSTERS_H #include <Arduino.h> #include <Servo.h> //#define DEBUG #ifdef DEBUG #define DMSG(msg) Serial.println(msg); #else #define DMSG(msg) (void)(msg); #endif #define HW_MOD_LIN1 0 #define HW_MOD_ANG1 1 #define HW_MOD_LIN2 2 #define HW_MOD_ANG2 3 #define HW_MOD_LIN3 4 #define HW_MOD_ANG3 5 #define HW_MOD_RESET 6 #define HW_RD 0 #define HW_WR 1 #define HW_DIFF 500 #define HW_IDLE 1500 #define HW_FORWARD 2000 #define HW_REVERSE 1000 #define HW_A_FIRST 0 #define HW_A_SECOND 1 #define HW_B_FIRST 2 #define HW_B_SECOND 3 #define HW_C_FIRST 4 #define HW_C_SECOND 5 #define HW_SOFT_RESET 6 #define HW_HARD_RESET 7 #define HW_TRIM_RESET 6 void HW_configure( int aPairFirst, int aPairSecond, int bPairFirst, int bPairSecond, int cPairFirst, int cPairSecond); void HW_set_modifier(uint8_t index, float value); float HW_get_modifier(uint8_t index); void HW_reset_modifiers(); void HW_set_thruster(uint8_t index, uint16_t value); uint16_t HW_get_thruster(uint8_t index); void HW_soft_reset(); // stops thrust and resets modifiers void HW_hard_reset(); // resets all values to startup defaults void HW_set_trim(uint8_t index, float value); float HW_get_trim(uint8_t index); void HW_reset_trim(); #endif
/* Copyright (c) 2015 Heinrich Fink <hfink@toolsonair.com> * Copyright (c) 2014 ToolsOnAir Broadcast Engineering GmbH * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef TOA_FRAME_BENDER_GL_CONTEXT_H #define TOA_FRAME_BENDER_GL_CONTEXT_H #include <string> #include <thread> #include "Utils.h" #include "Logging.h" #include <glad/glad.h> struct GLFWwindow; namespace toa { namespace frame_bender { namespace gl { class Window; // TODO: actually, you could implement moving. That makes sense here. class Context final : public ::toa::frame_bender::utils::NoCopyingOrMoving { public: typedef struct GLFWwindow * Handle; enum class DebugSeverity : GLenum { LOW = GL_DEBUG_SEVERITY_LOW_ARB, MEDIUM = GL_DEBUG_SEVERITY_MEDIUM_ARB, HIGH = GL_DEBUG_SEVERITY_HIGH_ARB, COUNT = 3 }; /** * Returns true if the calling thread has some Context * attached. */ static bool this_thread_has_context(); // TODO: document that create_shared also sets the new context // as the active context of the calling thread. std::unique_ptr<Context> create_shared(std::string name) const; ~Context(); /** * Attaches this context to the calling thread. If the context * is already attached to another thread (is_attached returns * true), then this will throw an exception. A context can * only be attached to a single thread at a time. */ void attach(); /** * Detaches this context from the calling thread. If the context * is not attached to the calling thread, this will throw * an exception. The context can only be detached from the * thread that was attached to it. */ void detach(); /** * Returns true, if this context is attached to the calling * thread. */ bool is_attached_to_this_thread() const; /** * Returns true, if this context is attached to any thread, i.e. * checks whether it can be attached to a new thread. */ bool is_attached_to_any_thread() const; bool debug_logging_is_enabled() const; const Handle handle() const; bool has_debug_enabled() const; friend class Window; private: // throws if this is not debug context, or ARB_debug_output is // not supported. // TODO: document that these functions require the context be // set as "current" (activated) void enable_debug_logging(); void disable_debug_logging(); void force_detach(); static std::string get_string_from_gl_debug_source(GLenum source); static std::string get_string_from_gl_debug_type(GLenum type); static std::string get_string_from_gl_severity(GLenum severity); static logging::Severity get_severity_from_gl_severity(GLenum severity); static void gl_arb_debug_callback ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam); Context( std::string name, Handle wnd, bool has_debug_enabled, bool owns_handle ); Handle handle_; const bool has_debug_enabled_; const bool owns_handle_; const std::string name_; bool debug_logging_is_enabled_; std::thread::id attached_thread_; }; std::ostream& operator<< (std::ostream& out, const Context::DebugSeverity& v); std::istream& operator>>(std::istream& in, Context::DebugSeverity& v); } } } #endif // TOA_FRAME_BENDER_GL_CONTEXT_H
#pragma once #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include <Windows.h> #include <system_error> namespace CryptoApi { static void ThrowSysError() { auto code = ::GetLastError(); auto err = std::error_code(code, std::system_category()); throw std::system_error(err); } static void ThrowSysError(const char* msg) { auto code = ::GetLastError(); auto err = std::error_code(code, std::system_category()); throw std::system_error(err, msg); } static void ThrowSysError(unsigned int code) { auto err = std::error_code(code, std::system_category()); throw std::system_error(err); } static void ThrowSysError(unsigned int code, const char* msg) { auto err = std::error_code(code, std::system_category()); throw std::system_error(err, msg); } }
#pragma once class State { public: State(){}; virtual ~State(){}; int getCurrentID() { return currentID; } protected: State(int id); int currentID; };
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Beardcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_ECCRYPTOVERIFY_H #define BITCOIN_ECCRYPTOVERIFY_H #include <vector> #include <cstdlib> class uint256; namespace eccrypto { bool Check(const unsigned char *vch); bool CheckSignatureElement(const unsigned char *vch, int len, bool half); } // eccrypto namespace #endif // BITCOIN_ECCRYPTOVERIFY_H
/* * Options - processing command line arguments * Copyright (c) 2016 rksdna * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef ERRORS_H #define ERRORS_H enum { DONE = 0, INVALID_OPTION, INTERNAL_ERROR, CUSTOM_1_ERROR, CUSTOM_2_ERROR // Append custom errors here }; #endif
#ifndef __PDDL__CONTEXT_H #define __PDDL__CONTEXT_H #include <functional> #include <pddl/Mode.h> #include <pddl/Tokenizer.h> namespace pddl { //////////////////////////////////////////////////////////////////////////////////////////////////// // // Context // //////////////////////////////////////////////////////////////////////////////////////////////////// struct Context { constexpr static const char *auxiliaryPrefix() { return "__plasp_"; } // TODO: replace std::string with char * using WarningCallback = std::function<void (tokenize::Location &&, const std::string &)>; Context() = default; ~Context() = default; explicit Context(Tokenizer &&tokenizer, WarningCallback warningCallback, Mode mode = Mode::Strict) : tokenizer{std::move(tokenizer)}, warningCallback{warningCallback}, mode{mode} { } Context(const Context &other) = delete; Context &operator=(const Context &other) = delete; Context(Context &&other) = default; Context &operator=(Context &&other) = default; Tokenizer tokenizer; WarningCallback warningCallback; Mode mode; }; //////////////////////////////////////////////////////////////////////////////////////////////////// } #endif
/* Unicamp - Universidade Estadual de Campinas FT - Faculdade de Tecnologia Limeira - SP Prof. Dr. Andre F. de Angelis Maio/2015 */ #ifndef MENU_H #define MENU_H #include <string> #include <vector> using namespace std; class Menu { private: string titulo; vector<string> opcoes; public: Menu(string titulo, vector<string> opcoes); const virtual int getEscolha(); }; #endif /* fim de arquivo */
/* kernel.c It's the common kernel, each CPU family has it's own implementation of the kernel in boot/bootloader/?/kernel.c which call this kernel. */ #include <prototype-os/boot/bootloader/x86/asm.h> #include <prototype-os/types.h> #include <prototype-os/kernel.h> po_kernel __kernel; void show_cursor(void); void move_cursor(u8 x, u8 y); extern void scrollup(unsigned int); extern void print(char *); extern kY; extern kattr; // the common kernel void main() { __kernel.mode = KERNEL_MODE_TEXT; kattr = 0x5E; print("Here is the main !\n"); kattr = 0x4E; print("Hello world\n"); //show_cursor(); while (1); }
/* * test-rtc.h * * Copyright (c) 2017 Lix N. Paulian (lix@paulian.net) * * 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. * * Created on: 16 Apr 2017 (LNP) */ #ifndef TEST_TEST_RTC_H_ #define TEST_TEST_RTC_H_ void test_rtc (void); #endif /* TEST_TEST_RTC_H_ */
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @class NSString; @interface Xcode3SourceTreeDescriptor : NSObject { NSString *_settingName; NSString *_displayName; NSString *_path; } - (void).cxx_destruct; @property(copy) NSString *path; - (void)_setPath:(id)arg1; @property(copy) NSString *displayName; - (void)_setDisplayName:(id)arg1; @property(copy) NSString *settingName; - (void)_setSettingName:(id)arg1; - (void)didChange; @end
#ifndef SHOWDESIGNER_H #define SHOWDESIGNER_H #include "Fixture.h" #include <QThread> #include <QSerialPort> #include <QString> #include <QList> #include <QByteArray> #include <QMutex> /** * @brief The ShowDesigner class interfaces to the Elation Show Designer 2 lighting controller. * * */ class ShowDesigner : public QThread { Q_OBJECT public: enum Functions { eUnknown = -1, eScene = 0, eFixture = 4, eFixtureGroup = 5 }; enum ActiveFunction { eActiveFuncInvalid = -1, eActiveFuncScene = 0x00, eActiveFuncShow = 0x01, eActiveFuncPreset = 0x02, eActiveFuncChase = 0x04, eActiveFuncFixture = 0x06, eActiveFuncFixtureGroup = 0x07, eActiveFuncNone = 0xff }; struct Response { quint8 start; quint8 cmd; qint16 length; QByteArray payload; }; explicit ShowDesigner(QObject *parent = 0); ~ShowDesigner(); bool ConnectToShowDesigner(const QString &port); QString GetErrorString() const; quint16 GetPageNo(); bool SendCmd(const char *data, qint64 count); bool PushButton(int button); bool SelectScene(int scene); bool RequestPageUp(); bool RequestPageDown(); bool RequestFixtures(); bool SetFixtureChannel(quint8 fixNum, quint8 channel, quint8 value); bool RequestScenes(quint16 pageNo = 0); bool RequestPageNo(); bool SelectFunction( enum Functions func); bool ToFixture(Response &resp, Fixture &fix); void SetFixtures(QMap<quint8,Fixture> fixtures); QMap<quint8,Fixture> GetFixtures(); Fixture GetFixtureByNum(quint8 fixNum); void Decode(QByteArray &data); void test(); signals: void pageChanged(quint16 pageNo); void fixturesChanged(); void fixtureChanged(quint8 fixId); void channelChanged(quint8 fixId, quint8 channelNum); protected: void run() Q_DECL_OVERRIDE; private: bool ProcessResp(struct Response &resp); // flag to indicate thread is running/should exit bool mRun; // serial port object to communicate with show designer QSerialPort mPort; // true if serial port is open and has been connected to show designer bool mIsConnected; // string containing last error message QString mErrorString; // array of bytes read from serial port QByteArray mReadData; // response struct used in decoding serial port data struct Response mResp; // mutex for serializing access to serial port object mutable QMutex mMutex; // map of fixture objects QMap<quint8,Fixture> mFixtures; // map of selected buttons QMap<quint8, bool> mSelectedButtons; // map of scenes QMap<quint8, QString> mScenes; // selected page number on the controller qint8 mPageNo; // the actively selected function on the show designer enum ActiveFunction mActiveFunc; // current function enum Functions mFunc; // last button "pushed" int mPushedButton; // selected scene int mSelectedScene; }; #endif // SHOWDESIGNER_H
// // WXOMessageInputView.h // testFreeOpenIM // // Created by Jai Chen on 15/1/13. // Copyright (c) 2015年 taobao. All rights reserved. // #import <UIKit/UIKit.h> #import "YWInputViewPlugin.h" @class YWIMKit; #define kWXOMessageInputViewMinRecordLenght 1.0 @interface YWMessageInputView : UIView /** * 输入框文本 */ @property (nonatomic, readwrite) NSString *text; /** * 文本选择范围,您可以使用该信息,确保能够在正确的位置修改输入框文本 */ @property (nonatomic, readwrite) NSRange selectedRange; /** * more面板容器View,可往里添加自定义pluginView * @note 一般不要直接添加子view,如果希望添加子view,请使用下面的push和pop函数 */ @property (nonatomic, readonly) UIView *morePanelContentView; /** * 语音输入功能开关,默认 NO,即默认打开语音输入 */ @property (nonatomic, assign, readwrite) BOOL disableAudioInput; @property (nonatomic, readonly) UIViewController *controllerRef; @property (nonatomic, weak) YWIMKit *imkit; #pragma mark - plugin // 加载移除pluginContentView /** * 添加子view */ - (void)pushContentViewOfPlugin:(id <YWInputViewPluginProtocol>)plugin; /** * 移除子view */ - (void)popContentViewOfPlugin:(id <YWInputViewPluginProtocol>)plugin; // 往更多面板中添加与删除item /** * 在最后添加新的item */ - (void)addPlugin:(id <YWInputViewPluginProtocol>)plugin; /** * 移除某个item */ - (void)removePlugin:(id <YWInputViewPluginProtocol>)plugin; /** * 移除所有item,包含前置插件 */ - (void)removeAllPlugins; /** * 获取plugin列表,包含前置插件 */ - (NSArray *)allPluginList; /** * 刷新 */ - (void)reloadPluginData; /** * 激活某个plugin,相当于手动按下这个插件。一般用在希望进入聊天页面就激活某个输入插件的场景 */ - (void)activatePlugin:(id<YWInputViewPluginProtocol>)plugin; /** * plugin如果需要通知到对方己方当前的输入状态,可以调用下面两个API,告知输入框发送当前用户正在使用该插件 * * plugin进入编辑状态(通知YWMessageInputView更新输入状态) */ - (void)pluginWillBeginEdit:(id <YWInputViewPluginProtocol>)plugin; /** * plugin结束编辑状态(通知YWMessageInputView更新输入状态) */ - (void)pluginDidEndEdit:(id <YWInputViewPluginProtocol>)plugin; @end
#include "_css_draw.h" static inline void _update_shift( int vox[3], const struct DrawObj *draw_obj, const struct ShiftDrawPair *pair) { const int shift = pair->shift; const struct DrawObj *child_obj = pair->obj; struct SeriesObj *obj = draw_obj->obj; switch(obj->fill_direction) { case X_AXIS_FILL: vox[0] += shift * draw_obj->basic.cos_th; vox[1] += shift * draw_obj->basic.sin_th; _justify_d(vox, &child_obj->basic, &draw_obj->basic); break; case Y_AXIS_FILL: // rotate 90°, reduced trygonometry functions vox[0] += shift * -draw_obj->basic.sin_th; vox[1] += shift * draw_obj->basic.cos_th; _justify_v(vox, &child_obj->basic, &draw_obj->basic); break; case HORIZONTAL_FILL: vox[2] += shift; _justify_vd(vox, &child_obj->basic, &draw_obj->basic); break; } } void css_draw_series(struct DrawObj *draw_obj, struct DrawInnerInfo *inner_info) { struct SeriesObj *obj = draw_obj->obj; if (!obj) return; struct ShiftDrawPair **pairs = obj->pairs; if (!pairs) return; struct ShiftDrawPair* pair = NULL; size_t index = 0; while((pair = pairs[index++])) { int vox[3] = COPY_VOX(inner_info->vox); _update_shift(vox, draw_obj, pair); struct DrawInfo draw_info = { .img=inner_info->img, .vox=vox, .filter=inner_info->filter, }; draw_component(pair->obj, &draw_info, NULL); } int *out_vox = inner_info->out_vox; if (out_vox) { out_vox[0] = draw_obj->basic.width; out_vox[1] = draw_obj->basic.depth; out_vox[2] = draw_obj->basic.height; } }
/******************************************************************************* Copyright (c) The Taichi MPM Authors (2018- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *******************************************************************************/ #pragma once #include "mpm.h" #include "particles.h" #include <taichi/math/angular.h> #include <taichi/geometry/mesh.h> TC_NAMESPACE_BEGIN template <int dim> class RigidBoundaryParticle : public MPMParticle<dim> { public: using Base = MPMParticle<dim>; using typename Base::Vector; using typename Base::Matrix; using Base::pos; using ElementType = typename RigidBody<dim>::ElementType; RigidBody<dim> *rigid = nullptr; ElementType untransformed_element; Vector offset; Vector original_normal; bool climb_rudder = false; TC_IO_DEF_WITH_BASE(rigid, offset, untransformed_element, original_normal, climb_rudder); RigidBoundaryParticle() : Base() { Base::is_rigid_ = true; } void initialize(const Config &config) override { Base::initialize(config); rigid = config.get_ptr<RigidBody<dim>>("rigid"); offset = config.get<Vector>("offset"); original_normal = config.get<Vector>("normal"); climb_rudder = config.get("climb_rudder", false); } void align_with_rigid_body() { pos = get_anchor_point(); this->set_velocity( rigid->velocity + rigid->angular_velocity.cross(rigid->rotation.rotate(offset))); } Vector get_normal() const { return rigid->rotation.rotate(original_normal); } real get_allowed_dt(const real &dx) const override { return 0.0f; } std::string get_name() const override { return "rigid_boundary"; } Vector get_anchor_point() const { return transform(rigid->get_centroid_to_world(), offset); } ElementType get_world_space_element() const { return untransformed_element.get_transformed(rigid->get_mesh_to_world()); } Vector3 get_debug_info() const override { return Vector3((real)climb_rudder, 0, 0); } }; TC_NAMESPACE_END
// // RKVersioningCommand.h // RobotKit // // Created by Brian Smith on 5/27/11. // Copyright 2011 Orbotix Inc. All rights reserved. // /*! @file */ #import <Foundation/Foundation.h> #import <RobotKit/RKDeviceCommand.h> @class RKRobot; /*! * @brief Class that encapsulates a request for version information from the robot. * * This is a simple command that requires no parameters. The version information is returned * in the response. * * @sa RKVersioningResponse */ @interface RKVersioningCommand : RKDeviceCommand { } @end
// // Line.h // Memetro // // Created by Christian Bongardt on 25/09/13. // Copyright (c) 2013 memetro. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @interface Line : NSManagedObject @property (nonatomic, retain) NSNumber * transport_id; @property (nonatomic, retain) NSNumber * city_id; @property (nonatomic, retain) NSNumber * number; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSNumber * id; @end
// // MAFShareTool.h // ShareHelp // // Created by 高赛 on 2017/7/12. // Copyright © 2017年 高赛. All rights reserved. // #import <Foundation/Foundation.h> /** 登陆授权回调 0 成功,1 取消授权,2 授权失败,3 没有网络 */ typedef void (^LoginBlock)(int status, NSString *accessToken, NSString *openID); /** 获取用户信息回调 0 成功,1 失败 */ typedef void (^GetInfoBlock)(int status, NSDictionary *info, NSString *erroMsg); typedef void (^WechatGetAuthInfoBlock)(BOOL isSuccess,NSString *access_token,NSString *refresh_token,NSString *openid,NSString *errmsg); typedef void (^WechatGetInfoBlock)(BOOL isSuccess, NSDictionary *info, NSString *errmsg); typedef void (^WeiboGetAuthInfoBlock)(BOOL isSuccess,NSDictionary *userInfo,NSDictionary *requestUserInfo); typedef void (^WeiboShareBlock)(BOOL isSuccess,NSDictionary *requestUserInfo); @interface MAFShareTool : NSObject @property (nonatomic, copy) LoginBlock loginBlock; @property (nonatomic, copy) GetInfoBlock getInfoBlock; @property (nonatomic, copy) WechatGetAuthInfoBlock wechatAuthBlock; @property (nonatomic, copy) WechatGetInfoBlock wechatInfoBlock; @property (nonatomic, copy) WeiboGetAuthInfoBlock weiboAuthBlock; @property (nonatomic, copy) WeiboShareBlock weiboShareBlock; + (MAFShareTool *)sharedInstance; #pragma mark 初始化SDK /** 初始化腾讯qqSDK */ - (void)initTencentSDKWithAppID:(NSString *)appID; /** 初始化微信sdk */ - (void)initWechatSDKWithAppID:(NSString *)appID; /** 初始化微博 */ - (void)initWeiboSdkWithAppid:(NSString *)appid; #pragma mark 腾讯qq /** 腾讯qq发起授权 */ - (void)qqLoginWithLoginBlock:(LoginBlock )loginBlock; /** 获取授权后的信息 */ - (void)qqGetInfoWithBlock:(GetInfoBlock )getInfoBlock; /** qq消息分享纯文本消息 */ - (void)shareQQTextMessageWithText:(NSString *)text; /** qq消息分享纯图片消息 */ - (void)shareQQImageMessageWithImageData:(NSData *)data; /** qq消息分享网络链接分享 */ - (void)shareQQNetMessageWithUrl:(NSURL *)url andTitle:(NSString *)title andDescription:(NSString *)description andPreviewImageUrl:(NSURL *)previewImageUrl; /** qq空间纯文本分享 */ - (void)shareQZoneTextMessageWithText:(NSString *)text; /** qq空间网络链接分享 */ - (void)shareQZoneNetMessageWithUrl:(NSURL *)url andTitle:(NSString *)title andDescription:(NSString *)description andPreviewImageUrl:(NSURL *)previewImageUrl; #pragma mark 微信 /** 获取微信授权 */ - (void)wechatLoginWithWechatSecret:(NSString *)secret withGetAuthBlock:(WechatGetAuthInfoBlock )block; /** 获取微信授权后用户信息 */ - (void)wechatGetInfoWithAccessToken:(NSString *)accessToken withOpenid:(NSString *)openID withGetInfoBlock:(WechatGetInfoBlock )block; /** 分享纯文字,type:0 消息,1 朋友圈 */ - (void)shareWXTextWithText:(NSString *)text withType:(int )type; /** 分享图片,thumbImg:缩略图,imgData图片数据,type:0 消息,1 朋友圈 */ - (void)shareWXImageWithThumbImg:(UIImage *)thumbImg withImageData:(NSData *)imgData withType:(int )type; /** 分享网页thumberImg:缩略图 url:网址链接 type:0 消息,1 朋友圈 */ - (void)shareWXWebWithTitle:(NSString *)title withDescription:(NSString *)description withThumberImg:(UIImage *)thumberImg withUrl:(NSString *)url withType:(int )type; #pragma mark 微博 - (void)weiboGetAuthWithRedirectUrl:(NSString *)redirectUrl withRequestUserInfo:(NSDictionary *)requestUserInfo withAuthBlock:(WeiboGetAuthInfoBlock )block; /** 分享文字,图片 */ - (void)shareWeiboText:(NSString *)text withImageData:(NSData *)imageData withRedirectURL:(NSString *)redirectURL withAccessToken:(NSString *)accessToken withRequestUserInfo:(NSDictionary *)requestUserInfo withShareBlock:(WeiboShareBlock )block; /** 分享文字,链接 */ - (void)shareWeiboURLTitle:(NSString *)title withDescription:(NSString *)description withThumbImgData:(NSData *)thumbImgData withUrl:(NSString *)url withRedirectURL:(NSString *)redirectURL withAccessToken:(NSString *)accessToken withRequestUserInfo:(NSDictionary *)requestUserInfo withShareBlock:(WeiboShareBlock )block; #pragma mark 系统回调方法 - (BOOL)HandleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; - (BOOL)HandleOpenURL:(NSURL *)url; @end
// // XYPlaceholderTextView.h // MyWeiboJingXuan // // Created by yuan on 16/7/29. // Copyright (c) 2016年 袁小荣. All rights reserved. // 拥有占位文字功能的TextView #import <UIKit/UIKit.h> @interface XYPlaceholderTextView : UITextView /** 占位文字 */ @property (nonatomic, strong) NSString *placeholder; /** 占位文字的颜色 */ @property (nonatomic, strong) UIColor *placeholderColor; @end
// // AppDelegate.h // UITextFieldShowcases // // Created by Ryan Lee on 22/3/2016. // Copyright © 2016 Ryan Lee. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
extern int __VERIFIER_nondet_int(); extern void __VERIFIER_error(); int id(int x) { if (x==0) return 0; int ret = id(x-1) + 1; if (ret > 3) return 3; return ret; } void main() { int input = __VERIFIER_nondet_int(); int result = id(input); if (result == 5) { __VERIFIER_error(); } }
// // UIColor+JLColorKit.h // JLToolsAndCategories // // Created by Long Jiang on 16/4/14. // Copyright © 2016年 Long. All rights reserved. // #import <UIKit/UIKit.h> @interface UIColor (JLColorKit) ///根据hex字符串得到颜色 + (UIColor *)jl_colorWithHex:(NSString *)string; @end
#include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Andrii Tymkiv"); MODULE_DESCRIPTION("Say hello and goodbye"); MODULE_VERSION("0.22"); static char *name = "user"; module_param(name, charp, S_IRUGO); //just can be read MODULE_PARM_DESC(name, "The name to display"); ///< parameter description static int __init hello_init(void){ printk(KERN_INFO "Hello, %s!\n", name); return 0; } static void __exit hello_exit(void){ printk(KERN_INFO "Goodbye, %s !\n", name); } module_init(hello_init); module_exit(hello_exit);
// // YCJobDeViewController.h // 家长界 // // Created by taylor on 2016/12/19. // Copyright © 2016年 西部家联. All rights reserved. // #import <UIKit/UIKit.h> #import "QPTBaseViewController.h" @interface YCComDeViewController : QPTBaseViewController @end
// // NSString+YCYSize.h // // Created by Jakey on 15/5/22. // Copyright (c) 2015年 www.skyfox.org. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface NSString (YCYSize) /** * @brief 计算文字的高度 * * @param font 字体(默认为系统字体) * @param width 约束宽度 */ - (CGFloat)ycy_heightWithFont:(UIFont *)font constrainedToWidth:(CGFloat)width; /** * @brief 计算文字的宽度 * * @param font 字体(默认为系统字体) * @param height 约束高度 */ - (CGFloat)ycy_widthWithFont:(UIFont *)font constrainedToHeight:(CGFloat)height; /** * @brief 计算文字的大小 * * @param font 字体(默认为系统字体) * @param width 约束宽度 */ - (CGSize)ycy_sizeWithFont:(UIFont *)font constrainedToWidth:(CGFloat)width; /** * @brief 计算文字的大小 * * @param font 字体(默认为系统字体) * @param height 约束高度 */ - (CGSize)ycy_sizeWithFont:(UIFont *)font constrainedToHeight:(CGFloat)height; /** * @brief 反转字符串 * * @param strSrc 被反转字符串 * * @return 反转后字符串 */ + (NSString *)ycy_reverseString:(NSString *)strSrc; @end
/* * USBUsart.h * * Created: 02.12.2012 07:30:52 * Author: Jörg */ #ifndef USBUSART_H_ #define USBUSART_H_ #include "ByteReceiver.h" typedef void (*pfCharReceived)( char ch ); class USBUsart : public ByteReceiver { public: USBUsart( pfCharReceived _receivedFunc ); USBUsart( ByteReceiver *byteReceiver ); //static USBUsart instance; static void cyclic(); static bool isInitialized(); static bool char_avail(void); static char getch(void); static void putch( char c ); virtual void received( BYTE data ); private: static bool initialized; static pfCharReceived receivedFunc; static ByteReceiver *byteReceiver; }; #endif /* USBUSART_H_ */
/* * Copyright (C) 2011 Igalia S.L. * * 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 INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PlatformContextCairo_h #define PlatformContextCairo_h #if USE(CAIRO) #include "GraphicsContext.h" #include "RefPtrCairo.h" #include "ShadowBlur.h" namespace WebCore { class GraphicsContextPlatformPrivate; struct GraphicsContextState; // Much like PlatformContextSkia in the Skia port, this class holds information that // would normally be private to GraphicsContext, except that we want to allow access // to it in Font and Image code. This allows us to separate the concerns of Cairo-specific // code from the platform-independent GraphicsContext. class PlatformContextCairo { WTF_MAKE_NONCOPYABLE(PlatformContextCairo); public: PlatformContextCairo(cairo_t*); ~PlatformContextCairo(); cairo_t* cr() { return m_cr.get(); } void setCr(cairo_t* cr) { m_cr = cr; } GraphicsContextPlatformPrivate* graphicsContextPrivate() { return m_graphicsContextPrivate; } void setGraphicsContextPrivate(GraphicsContextPlatformPrivate* graphicsContextPrivate) { m_graphicsContextPrivate = graphicsContextPrivate; } ShadowBlur& shadowBlur() { return m_shadowBlur; } Vector<float>& layers() { return m_layers; } void save(); void restore(); void setGlobalAlpha(float); float globalAlpha() const; void pushImageMask(cairo_surface_t*, const FloatRect&); void drawSurfaceToContext(cairo_surface_t*, const FloatRect& destRect, const FloatRect& srcRect, GraphicsContext&); void setImageInterpolationQuality(InterpolationQuality); InterpolationQuality imageInterpolationQuality() const; enum PatternAdjustment { NoAdjustment, AdjustPatternForGlobalAlpha }; void prepareForFilling(const GraphicsContextState&, PatternAdjustment); enum AlphaPreservation { DoNotPreserveAlpha, PreserveAlpha }; void prepareForStroking(const GraphicsContextState&, AlphaPreservation = PreserveAlpha); private: void clipForPatternFilling(const GraphicsContextState&); RefPtr<cairo_t> m_cr; // Keeping a pointer to GraphicsContextPlatformPrivate here enables calling // Windows-specific methods from CairoOperations (where only PlatformContextCairo // can be leveraged). GraphicsContextPlatformPrivate* m_graphicsContextPrivate { nullptr }; class State; State* m_state; WTF::Vector<State> m_stateStack; // GraphicsContext is responsible for managing the state of the ShadowBlur, // so it does not need to be on the state stack. ShadowBlur m_shadowBlur; // Transparency layers. Vector<float> m_layers; }; } // namespace WebCore #endif // USE(CAIRO) #endif // PlatformContextCairo_h
/* Copyright (c) 2013, Rasmus Zakarias, Aarhus University 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 Rasmus Winther Zakarias at Aarhus University. 4. Neither the name of Aarhus 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 Rasmus Zakarias at Aarhus University ''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 Rasmus Zakarias at Aarhus University BE LIABLE FOR ANY, 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. Created: 2014-10-26 Author: Rasmus Winther Zakarias, rwl@cs.au.dk Changes: 2014-10-26 14:27: Initial version created */ /* * Ring.h * * For large fields the overhead of calling through an interface * is proportionally small enough that it doesn't matter. * * For small fields we want the metal right under our fingers and using * this interface is not recommended. * * */ #ifndef RING_H #define RING_H #include <osal.h> typedef struct _ring_element_ { /*! * Modify this instance to be the mul-inverse of it self. * * \return RC_OK on success. */ RC(*inv)(void); /*! * Modify this instance to be the quotient with {other}. * * \param other - The other element to add * * \return RC_OK on success. Otherwise this element has not * changed due to some error. */ RC(*div)(struct _ring_element_ * other); /*! * Modify this instance to be the difference with {other}. * * \param other - The other element to add * * \return RC_OK on success. Otherwise this element has not * changed due to some error. */ RC(*sub)(struct _ring_elmement_ * other); /*! * Modify this instance to be the sum with {other}. * * \param other - The other element to add * * \return RC_OK on success. Otherwise this element has not * changed due to some error. */ RC (*add)(struct _ring_element_ * other); /*! * Modify this instance to be the product with {other}. * * \param other - The other element to multiply * * \return RC_OK on success. Otherwise this element has not * changed due to some error. */ RC (*mul)(struct _ring_element_ * other); /*! * Suppose {other} has an interpretation as an integer. * Modify this instance to be the element obtained by * multiplying this instance with it self {other}-times. * * \param other - The other element to exponentiate this * element to. * * \return RC_OK on success. Otherwise this element has not * changed due to some error . */ RC (*pow)(struct _ring_element_ * other); /*! * Modify this instance to be the {i}th power. * * \param i - integer times to mul. this instance with itself * * \return RC_OK on success. Otherwise this element has not * changed due to some error . */ RC(*powi)(ull i); /*! * Make a copy of this element. * * \param rc - optionally a return code can be obtained * * \return element to fresh pointer on success, NULL otherwise. */ struct _ring_element_ * (*copy)(RC * rc); void * impl; } * RE; typedef struct _ring_ { // rc optional RE(*zero)(RC * rc); // rc optional RE(*one)(RC * rc); // rc optional RE(*from_ull)(ull v, RC * rc); // rc optional, {str} is in base16 RE(*from_cstr)(const char * str, RC * rc); // serialize element out in base 16 RC(*to_cstr)(RE elm, char * out, uint lout); void * impl; } * Ring; /*! * Create a Ring that approximates the Integers limitted by the * memory of our machine. */ Ring TheIntegers_New(OE oe); void TheIntegers_Destroy(Ring * r); // --- Number theoretical support for TheIntegers /*! * Return the next prime greater than {re} allocated * and managed in the context of {theintegers}. * * \param theintegers - context to create prime in * \param re - offset for finde next prime * * \return a highly proble prime (accoding to gmp doc). * * see: https://gmplib.org/manual/Number-Theoretic-Functions.html */ RE TheIntegers_NextPrime(Ring theintegers, RE re); /*! * Create a Ring where computation is done modulo p for * some number p. * */ Ring Zp_New(OE oe, RE p); void Zp_Destroy(Ring * r); #endif
// // DataParser.h // Memetro // // Created by Christian Bongardt on 19/09/13. // Copyright (c) 2013 memetro. All rights reserved. // #import <Foundation/Foundation.h> @class User; @class City; @class Country; @class Transport; @class Line; @class Station; @interface DataParser : NSObject + (instancetype)sharedInstance; -(BOOL) parseSync:(NSData *) data; -(BOOL) parseStaticData:(NSData *) data; -(BOOL) parseUserEdit:(NSData *) data; -(BOOL) save; @property (strong,nonatomic) NSManagedObjectContext *managedObjectContext; @property (strong,nonatomic) NSDictionary *parsedData; @property (strong,nonatomic) NSArray *alerts; @property (strong,nonatomic) User *user; -(User *) getUser; -(NSArray *) getLinesStations; -(NSArray *) getCountries; -(Country *) getCountryWithId:(NSNumber *) id; -(NSArray *) getCities; -(NSArray *) getCitiesWithCountryId:(NSNumber *) id; -(City *) getCity:(NSNumber *) id; -(NSArray *) getStations; -(Station *) getStation:(NSNumber *)id; -(NSArray *) getStationsOfLines:(NSArray *)lineIds; -(NSArray *) getStationsOfTransportId:(NSNumber *) id; -(NSArray *) getLines; -(Line *) getLine:(NSNumber *)id; -(NSArray *) getLinesOfTransportId:(NSNumber *) id andCityId:(NSNumber *) cityId; -(NSArray *) getLinesOfStations:(NSNumber *) id; -(NSArray *) getTransports; -(Transport *) getTransport:(NSNumber *) id; -(NSArray *) getTransportsOfCityId:(NSNumber *)cityId; @end
// // SFScene.h // GLES // // Created by Justin Van Eaton on 9/27/10. // Copyright 2010 Stinware. All rights reserved. // #import <Foundation/Foundation.h> #import "SFCommon.h" #import "SFLayer.h" @class SFLayer; @interface SFScene : NSObject { NSMutableArray *layers; GLfloat backgroundRed; GLfloat backgroundGreen; GLfloat backgroundBlue; } - (id)init; - (void)drawWithVersion:(SFOpenGLVersion)version; - (void)addLayer:(SFLayer *)inObject; - (void)removeLayer:(SFLayer *)inObject; - (void)setBackgroundColorWithRed:(GLfloat)red andGreen:(GLfloat)green andBlue:(GLfloat)blue; @end
#include <CLuce/Component/Point2.h> CLUCE_MACRO_EXPORT Luce_Point2 Luce_Point2_Create() { return Luce_Component_Point2_Create(); } CLUCE_MACRO_EXPORT int Luce_Point2_Destroy(Luce_Point2* location) { return Luce_Component_Point2_Destroy(location); } CLUCE_MACRO_EXPORT int Luce_Point2_Initializer(void* memory) { return Luce_Component_Point2_Initializer(memory); } CLUCE_MACRO_EXPORT int Luce_Point2_Destroyer(void* memory) { return Luce_Component_Point2_Destroyer(memory); } CLUCE_MACRO_EXPORT int Luce_Point2_Compare(Luce_Point2 lhs, Luce_Point2 rhs) { return Luce_Component_Point2_Compare(lhs, rhs); } CLUCE_MACRO_EXPORT int Luce_Point2_Equal(Luce_Point2 lhs, Luce_Point2 rhs) { return Luce_Component_Point2_Equal(lhs, rhs); } CLUCE_MACRO_EXPORT int Luce_Point2_Assign(Luce_Component_Point2 lhs, Luce_Component_Point2 rhs) { return Luce_Component_Point2_Assign(lhs, rhs); } CLUCE_MACRO_EXPORT Luce_Utility_Int32 Luce_Point2_GetX(Luce_Point2 location) { return Luce_Component_Point2_GetX(location); } CLUCE_MACRO_EXPORT int Luce_Point2_SetX(Luce_Point2 location, Luce_Utility_Int32 x) { return Luce_Component_Point2_SetX(location, x); } CLUCE_MACRO_EXPORT Luce_Utility_Int32 Luce_Point2_GetY(Luce_Point2 location) { return Luce_Component_Point2_GetY(location); } CLUCE_MACRO_EXPORT int Luce_Point2_SetY(Luce_Point2 location, Luce_Utility_Int32 y) { return Luce_Component_Point2_SetY(location, y); } CLUCE_MACRO_EXPORT Luce_Point2F Luce_Point2F_Create() { return Luce_Component_Point2F_Create(); } CLUCE_MACRO_EXPORT int Luce_Point2F_Destroy(Luce_Point2F* location) { return Luce_Component_Point2F_Destroy(location); } CLUCE_MACRO_EXPORT int Luce_Point2F_Initializer(void* memory) { return Luce_Component_Point2F_Initializer(memory); } CLUCE_MACRO_EXPORT int Luce_Point2F_Destroyer(void* memory) { return Luce_Component_Point2F_Destroyer(memory); } CLUCE_MACRO_EXPORT int Luce_Point2F_Compare(Luce_Point2F lhs, Luce_Point2F rhs) { return Luce_Component_Point2F_Compare(lhs, rhs); } CLUCE_MACRO_EXPORT int Luce_Point2F_Equal(Luce_Point2F lhs, Luce_Point2F rhs) { return Luce_Component_Point2F_Equal(lhs, rhs); } CLUCE_MACRO_EXPORT int Luce_Point2F_Assign(Luce_Component_Point2 lhs, Luce_Component_Point2 rhs) { return Luce_Component_Point2F_Assign(lhs, rhs); } CLUCE_MACRO_EXPORT Luce_Utility_Real32 Luce_Point2F_GetX(Luce_Point2F location) { return Luce_Component_Point2F_GetX(location); } CLUCE_MACRO_EXPORT int Luce_Point2F_SetX(Luce_Point2F location, Luce_Utility_Real32 x) { return Luce_Component_Point2F_SetX(location, x); } CLUCE_MACRO_EXPORT Luce_Utility_Real32 Luce_Point2F_GetY(Luce_Point2F location) { return Luce_Component_Point2F_GetY(location); } CLUCE_MACRO_EXPORT int Luce_Point2F_SetY(Luce_Point2F location, Luce_Utility_Real32 y) { return Luce_Component_Point2F_SetY(location, y); }
/* Copyright (c) 2015 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "mail-storage.h" #include "push-notification-drivers.h" #include "push-notification-events.h" #include "push-notification-event-mailboxsubscribe.h" #include "push-notification-txn-mbox.h" #define EVENT_NAME "MailboxSubscribe" static void push_notification_event_mailboxsubscribe_debug_mbox (struct push_notification_txn_event *event ATTR_UNUSED) { i_debug("%s: Mailbox was subscribed to", EVENT_NAME); } static void push_notification_event_mailboxsubscribe_event( struct push_notification_txn *ptxn, struct push_notification_event_config *ec, struct push_notification_txn_mbox *mbox) { struct push_notification_event_mailboxsubscribe_data *data; data = p_new(ptxn->pool, struct push_notification_event_mailboxsubscribe_data, 1); data->subscribe = TRUE; push_notification_txn_mbox_set_eventdata(ptxn, mbox, ec, data); } /* Event definition */ extern struct push_notification_event push_notification_event_mailboxsubscribe; struct push_notification_event push_notification_event_mailboxsubscribe = { .name = EVENT_NAME, .mbox = { .debug_mbox = push_notification_event_mailboxsubscribe_debug_mbox }, .mbox_triggers = { .subscribe = push_notification_event_mailboxsubscribe_event } };
#pragma once #include <vector> #include <queue> #include <string> #include <climits> #include <cmath> #include <stack> #include <set> #include <sstream> #include <algorithm> #include <unordered_map> using namespace std; class TrieNode { public: TrieNode() { for (int i = 0; i < 26; i++) child[i] = NULL; isWord = false; } TrieNode *child[26]; bool isWord; }; class Trie { private: TrieNode* root; public: /** Initialize your data structure here. */ Trie() { root = new TrieNode(); } /** Inserts a word into the trie. */ void insert(string word) { TrieNode *p = root; int len = word.size(); for (int i = 0; i < len; i++) { if (!p->child[word[i] - 'a']) { p->child[word[i] - 'a'] = new TrieNode(); } p = p->child[word[i] - 'a']; } p->isWord = true; } /** Returns if the word is in the trie. */ bool search(string word) { TrieNode *p = root; int len = word.size(); for (int i = 0; i < len; i++) { if (!p->child[word[i] - 'a']) { return false; } p = p->child[word[i] - 'a']; } if (p->isWord) return true; return false; } /** Returns if there is any word in the trie that starts with the given prefix. */ bool startsWith(string prefix) { TrieNode *p = root; int len = prefix.size(); for (int i = 0; i < len; i++) { if (!p->child[prefix[i] - 'a']) { return false; } p = p->child[prefix[i] - 'a']; } return true; } };
/* -*- C -*- *********************************************** Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, 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 Stichting Mathematisch Centrum or CWI or Corporation for National Research Initiatives or CNRI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. While CWI is the initial source for this software, a modified version is made available by the Corporation for National Research Initiatives (CNRI) at the Internet address ftp://ftp.python.org. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM OR CNRI 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. ******************************************************************/ /* Module configuration */ /* This file contains the table of built-in modules. See init_builtin() in import.c. */ #include "Python.h" extern void initos2(); extern void initsignal(); #ifdef WITH_THREAD extern void initthread(); #endif extern void init_codecs(); extern void init_csv(); extern void init_locale(); extern void init_random(); extern void init_sre(); extern void init_symtable(); extern void init_weakref(); extern void initarray(); extern void initbinascii(); extern void initcPickle(); extern void initcStringIO(); extern void initcollections(); extern void initcmath(); extern void initdatetime(); extern void initdl(); extern void initerrno(); extern void initfcntl(); extern void init_functools(); extern void init_heapq(); extern void initimageop(); extern void inititertools(); extern void initmath(); extern void init_md5(); extern void initoperator(); extern void initrgbimg(); extern void init_sha(); extern void init_sha256(); extern void init_sha512(); extern void initstrop(); extern void init_struct(); extern void inittermios(); extern void inittime(); extern void inittiming(); extern void initxxsubtype(); extern void initzipimport(); #if !HAVE_DYNAMIC_LOADING extern void init_curses(); extern void init_curses_panel(); extern void init_hotshot(); extern void init_testcapi(); extern void initbsddb185(); extern void initbz2(); extern void initfpectl(); extern void initfpetest(); extern void initparser(); extern void initpwd(); extern void initunicodedata(); extern void initzlib(); #ifdef USE_SOCKET extern void init_socket(); extern void initselect(); #endif #endif /* -- ADDMODULE MARKER 1 -- */ extern void PyMarshal_Init(); extern void initimp(); extern void initgc(); struct _inittab _PyImport_Inittab[] = { {"os2", initos2}, {"signal", initsignal}, #ifdef WITH_THREAD {"thread", initthread}, #endif {"_codecs", init_codecs}, {"_csv", init_csv}, {"_locale", init_locale}, {"_random", init_random}, {"_sre", init_sre}, {"_symtable", init_symtable}, {"_weakref", init_weakref}, {"array", initarray}, {"binascii", initbinascii}, {"cPickle", initcPickle}, {"cStringIO", initcStringIO}, {"collections", initcollections}, {"cmath", initcmath}, {"datetime", initdatetime}, {"dl", initdl}, {"errno", initerrno}, {"fcntl", initfcntl}, {"_functools", init_functools}, {"_heapq", init_heapq}, {"imageop", initimageop}, {"itertools", inititertools}, {"math", initmath}, {"_md5", init_md5}, {"operator", initoperator}, {"rgbimg", initrgbimg}, {"_sha", init_sha}, {"_sha256", init_sha256}, {"_sha512", init_sha512}, {"strop", initstrop}, {"_struct", init_struct}, {"termios", inittermios}, {"time", inittime}, {"timing", inittiming}, {"xxsubtype", initxxsubtype}, {"zipimport", initzipimport}, #if !HAVE_DYNAMIC_LOADING {"_curses", init_curses}, {"_curses_panel", init_curses_panel}, {"_hotshot", init_hotshot}, {"_testcapi", init_testcapi}, {"bsddb185", initbsddb185}, {"bz2", initbz2}, {"fpectl", initfpectl}, {"fpetest", initfpetest}, {"parser", initparser}, {"pwd", initpwd}, {"unicodedata", initunicodedata}, {"zlib", initzlib}, #ifdef USE_SOCKET {"_socket", init_socket}, {"select", initselect}, #endif #endif /* -- ADDMODULE MARKER 2 -- */ /* This module "lives in" with marshal.c */ {"marshal", PyMarshal_Init}, /* This lives it with import.c */ {"imp", initimp}, /* These entries are here for sys.builtin_module_names */ {"__main__", NULL}, {"__builtin__", NULL}, {"sys", NULL}, {"exceptions", NULL}, /* This lives in gcmodule.c */ {"gc", initgc}, /* Sentinel */ {0, 0} };
/* * LintillaIvm.h * * Created on: 23.01.2014 * Author: niklausd */ #ifndef LINTILLAIVM_H_ #define LINTILLAIVM_H_ #include <Ivm.h> const int wlan_max_length = 32; /** * Lintilla Inventory Management Capabilities (cumulative) * - Version 0: DeviceId (addr 0) * - Version 1: IVMVersion (addr 1) * - Version 2: BatteryVoltageSenseFactor (addr 2,3; float*1000 as unsigned short int, high byte: addr 2, low byte: addr 3) * - Version 3: WLAN Access Parameters (addr 4, WLAN_SSID unsigned char [32]; addr 36, WLAN_PASS unsigned char [32]) */ class LintillaIvm: public Ivm { public: LintillaIvm(); virtual ~LintillaIvm(); void setBattVoltageSenseFactor(float battVoltageSenseFactor); float getBattVoltageSenseFactor(); void setWlanSSID(const char* ssid, int length); int getWlanSSID(char* out); void setWlanPASS(const char* pass, int length); int getWlanPASS(char* out); private: void maintainVersionChange(); void writeToIvm(const unsigned int addr, const char* in, int length); int readFromIvm(const unsigned int addr, char* out, int length); private: /** * Current Version of the Lintilla Inventory Management Capabilities. */ const static unsigned char s_currentVersion; /** * */ const static unsigned int s_ivmBattVoltSensFactAddrHigh; const static unsigned int s_ivmWlanSsidAddr; const static unsigned int s_ivmWlanPassAddr; /** * */ const static unsigned int s_ivmBattVoltSensFactAddrLow; const static float s_battSensFactorDefault; const static float s_battSensFactor1; const static float s_battSensFactor2; const static float s_battSensFactor3; const static float s_battSensFactor4; const static float s_battSensFactor5; private: // forbidden default functions LintillaIvm& operator = (const LintillaIvm& ); // assignment operator LintillaIvm(const LintillaIvm& src); // copy constructor }; #endif /* LINTILLAIVM_H_ */
/* Copyright © 2014 Bart Massey */ /* Fibonacci Numbers via recursion. */ #include <assert.h> #include <stdio.h> #include <stdlib.h> int fib(int n) { if (n == 0 || n == 1) return 1; return fib(n - 2) + fib(n - 1); } int main(int argc, char *argv[]) { int n; assert(argc == 2); n = atoi(argv[1]); assert(n > 0); printf("%d\n", fib(n)); return 0; }
//////////////////////////////////////////////////////////////////////////////// // Effect.h // Furiosity // // Created by Bojan Endrovski on 04/07/14. // Copyright (c) 2014 Bojan Endrovski. All rights reserved. //////////////////////////////////////////////////////////////////////////////// #pragma once // STL #include <map> #include <memory> // Fr #include "Resource.h" #include "Frmath.h" #include "Color.h" #include "gl.h" using std::string; using std::weak_ptr; using std::unique_ptr; namespace Furiosity { class Effect; /// /// Effect Basically a handle to a Shader /// class Effect : public ResourceHandle<Shader> { protected: /// Protects againts errors when editing shaders on the fly // ShaderParameter nonValidEffectParameter; public: /// Create new effect from a vertex shader file path and /// a pixel shader path. Effect(const string& vertexShaderPath, const string& pixelShaderPath); }; }
// // MKRole.h // MKSDK // // Created by 熙文 张 on 17/6/16. // Copyright © 2017年 张熙文. All rights reserved. // #import <Foundation/Foundation.h> @interface MKRole : NSObject /** * 服务器Id */ @property (nonatomic, strong) NSString *serverId; /** * 服务器名称 */ @property (nonatomic, strong) NSString *serverName; /** * 角色Id */ @property (nonatomic, strong) NSString *roleId; /** * 角色名称 */ @property (nonatomic, strong) NSString *roleName; /** * 角色等级 */ @property (nonatomic, assign) NSUInteger roleLevel; /** * 登陆时间 */ @property (nonatomic, strong) NSString *loginTime; @end
// ==== Keys ========================================================================= #define KEYS_PIN A0 #define DEBOUNCE_DELAY 50 uint8_t lastKeyPressed = 0; int lastKeyReading = 0; int stableKeyReading = 0; // No key pressed long lastDebounceTime = 0; long key_pressed_time = -100000; void loop_keys() { int unstableKeyReading; unstableKeyReading = (analogRead(KEYS_PIN) + 135/2) / 135; if (lastKeyReading != unstableKeyReading) { lastDebounceTime = millis(); } lastKeyReading = unstableKeyReading; if (millis() - lastDebounceTime > DEBOUNCE_DELAY) { stableKeyReading = unstableKeyReading; } if (stableKeyReading != lastKeyPressed) { // Serial.print("Triggering key event, stableKeyReading: "); // Serial.println(stableKeyReading); switch (stableKeyReading) { case 1: key1_event(); break; case 2: key2_event(); break; case 3: key3_event(); break; case 4: key4_event(); break; case 5: key5_event(); break; case 6: key6_event(); break; default: break; } key_pressed_time = millis(); lastKeyPressed = stableKeyReading; } }
/* * minisat.h - Python binding for MiniSat * * This source code is licensed under the MIT License. * See the file COPYING for more details. * * @author: Taku Fukushima <tfukushima@dcl.info.waseda.ac.jp> */ #ifndef PYTHON_MINISAT_H_ #define PYTHON_MINISAT_H_ #ifdef __cplusplus extern "C" { #endif typedef void* minisat_solver; extern int minisat_lit_pos_var(int value); extern int minisat_lit_neg_var(int value); // Constructor/Destroctor extern minisat_solver minisat_new(); extern void minisat_free(minisat_solver solver); // Problem specification extern int minisat_new_var(minisat_solver solver); extern int minisat_add_clause(minisat_solver solver, int *lits, int len); // Solving extern int minisat_simplify(minisat_solver solver); extern int minisat_solve(minisat_solver solver); extern int minisat_solve_with_assumps(minisat_solver solver, int *lits, int len); // Variables extern int minisat_model_value(minisat_solver solver, int var); extern int minisat_assined_size(minisat_solver solver); extern int minisat_var_size(minisat_solver solver); extern int minisat_clause_size(minisat_solver solver); #ifdef __cplusplus } #endif #endif // PYTHON_MINISAT_H_
/** * The MIT License (MIT) * * Copyright (c) 2013-2018 Igor Zinken - http://www.igorski.nl * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __MWENGINE__WAVEFORMS_H_INCLUDED__ #define __MWENGINE__WAVEFORMS_H_INCLUDED__ namespace MWEngine { class WaveForms { public: enum types { SINE, TRIANGLE, SAWTOOTH, SQUARE, NOISE, PWM, KARPLUS_STRONG, TABLE }; }; } // E.O namespace MWEngine #endif
//%2005//////////////////////////////////////////////////////////////////////// // // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; // IBM Corp.; EMC Corporation, The Open Group. // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // EMC Corporation; VERITAS Software Corporation; The Open Group. // // 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. // //============================================================================== // // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) // // Modified By: Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) // //%///////////////////////////////////////////////////////////////////////////// #include <iostream> #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Array.h> #include <Pegasus/Common/String.h> PEGASUS_NAMESPACE_BEGIN typedef struct _trapHeader { char destination[255]; char snmpType[10]; char enterprise[255]; char trapOid[255]; int variable_packets; } trapHeader; typedef struct _trapData { char vbOid[255]; char vbType[255]; char vbValue[512]; } trapData; class snmpDeliverTrap { public: snmpDeliverTrap() { } virtual ~snmpDeliverTrap() { } virtual void deliverTrap( const String& trapOid, const String& securityName, const String& targetHost, const Uint16& targetHostFormat, const String& otherTargetHostFormat, const Uint32& portNumber, const Uint16& snmpVersion, const String& engineID, const Array<String>& vbOids, const Array<String>& vbTypes, const Array<String>& vbValues) = 0; }; PEGASUS_NAMESPACE_END
// // SSMessagesViewController.h // Messages // // Created by Sam Soffes on 3/10/10. // Copyright 2010-2011 Sam Soffes. All rights reserved. // // This is an abstract class for displaying a UI similar to Apple's SMS application. A subclass should override the // messageStyleForRowAtIndexPath: and textForRowAtIndexPath: to customize this class. // #import "SSMessageTableViewCell.h" @class SSTextField; @interface SSMessagesViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate> { @private UITableView *_tableView; UIImageView *_inputBackgroundView; SSTextField *_textField; UIButton *_sendButton; UIImage *_leftBackgroundImage; UIImage *_rightBackgroundImage; } @property (nonatomic, retain, readonly) UITableView *tableView; @property (nonatomic, retain, readonly) UIImageView *inputBackgroundView; @property (nonatomic, retain, readonly) SSTextField *textField; @property (nonatomic, retain, readonly) UIButton *sendButton; @property (nonatomic, retain) UIImage *leftBackgroundImage; @property (nonatomic, retain) UIImage *rightBackgroundImage; - (SSMessageStyle)messageStyleForRowAtIndexPath:(NSIndexPath *)indexPath; - (NSString *)textForRowAtIndexPath:(NSIndexPath *)indexPath; - (NSString *)getInputText; - (void)send:(id)sender; @end
#ifndef BUDGETWIN_H #define BUDGETWIN_H #include <Window.h> #include <Box.h> #include <TextControl.h> #include <ListView.h> #include <ListItem.h> #include <ScrollView.h> #include <time.h> #include "ColumnListView.h" #include <Button.h> #include <MenuField.h> #include <Menu.h> #include <MenuItem.h> #include <StringView.h> #include <RadioButton.h> #include "ReportGrid.h" #include "Budget.h" class CurrencyBox; class BudgetWindow : public BWindow { public: BudgetWindow(const BRect &frame); ~BudgetWindow(void); void MessageReceived(BMessage *msg); private: void BuildStatsAndEditor(void); void BuildBudgetSummary(void); void BuildCategoryList(void); void RefreshCategories(void); void RefreshBudgetSummary(void); void RefreshBudgetGrid(void); void GenerateBudget(const bool &zero); void CalcStats(const char *cat, Fixed &high, Fixed &low, Fixed &avg); void HandleCategorySelection(void); void SetPeriod(const BudgetPeriod &period); BMenuBar *fBar; BView *fBackView; BColumnListView *fCategoryList; BRow *fIncomeRow, *fSpendingRow; BColumnListView *fBudgetSummary; BRow *fSummaryIncomeRow, *fSummarySpendingRow, *fSummaryTotalRow; BBox *fCatBox; CurrencyBox *fAmountBox; BStringView *fAmountLabel; BRadioButton *fMonthly, *fWeekly, *fQuarterly, *fAnnually; BColumnListView *fCatStat; BRow *fStatAverageRow, *fStatHighestRow, *fStatLowestRow; ReportGrid fIncomeGrid, fSpendingGrid; }; #endif
#ifndef ROM_H #define ROM_H #include <array> #include <cstdint> #include "iomemorymapped.h" template <std::size_t N> class ROM : public IOMemoryMapped { std::array<uint8_t, N>& rom; public: ROM(std::array<uint8_t, N>& rom); ~ROM(); uint8_t read(uint16_t addr); void write(uint16_t addr, uint8_t value); }; // ---------------------------------------------------------------------------------------------- // template <std::size_t N> ROM<N>::ROM(std::array<uint8_t, N>& rom) : rom(rom) { } // ---------------------------------------------------------------------------------------------- // template <std::size_t N> ROM<N>::~ROM() { } // ---------------------------------------------------------------------------------------------- // template <std::size_t N> uint8_t ROM<N>::read(uint16_t addr) { assert(addr < rom.size()); return rom[addr]; } // ---------------------------------------------------------------------------------------------- // template <std::size_t N> void ROM<N>::write(uint16_t addr, uint8_t value) { assert(false); } #endif
/****************************************************************************************/ /* */ /* Pegasus */ /* */ /****************************************************************************************/ //! \file SourceCode.h //! \author Kleber Garcia //! \date 15th March 2015 //! \brief Pegasus core source code class. Represents a source code piece with a graph list of //! parents. Each parent can be thought of a file including this source. #ifndef PEGASUS_SOURCE_CODE_H #define PEGASUS_SOURCE_CODE_H #include "Pegasus/Core/Assertion.h" #include "Pegasus/AssetLib/RuntimeAssetObject.h" #include "Pegasus/Core/Shared/CompilerEvents.h" #include "Pegasus/Core/Shared/ISourceCodeProxy.h" #include "Pegasus/Allocator/IAllocator.h" #include "Pegasus/Core/Io.h" #include "Pegasus/Utils/Vector.h" #include "Pegasus/Graph/GeneratorNode.h" //fwd declarations namespace Pegasus { namespace AssetLib { class AssetLib; class Asset; } } namespace Pegasus { namespace Core { class SourceCode : public Graph::GeneratorNode, public AssetLib::RuntimeAssetObject { PEGASUS_EVENT_DECLARE_DISPATCHER(Pegasus::Core::CompilerEvents::ICompilerEventListener) public: SourceCode(Alloc::IAllocator* allocator, Alloc::IAllocator* nodeDatallocator); virtual ~SourceCode(); //! Set the source //! \param src the actual src string //! \param buffSize precomputed string length virtual void SetSource(const char * src, int srcSize); //! Gets the source //! \param output string constant pointer //! \param output size of string virtual void GetSource (const char ** outSrc, int& outSize) const; //! propagates compilation to all the parents who are including this source virtual void Compile(); //! Register a source parent to this shader void RegisterParent(SourceCode* parent); //! Unregister a source parent to this shader void UnregisterParent(SourceCode* parent); //! Unregisters this source from all its parents void ClearParents(); //! Called when the internal compiled data gets invalidated virtual void InvalidateData() = 0; #if PEGASUS_ENABLE_PROXIES //! Returns the display name of this runtime object //! \return string representing the display name of this object virtual const char* GetDisplayName() const; #endif protected: Io::FileBuffer mFileBuffer; //! buffer structure containing shader source Alloc::IAllocator* mAllocator; Utils::Vector<SourceCode*> mParents; //references to parents virtual bool OnReadAsset(Pegasus::AssetLib::AssetLib* lib, const Pegasus::AssetLib::Asset* asset) override; virtual void OnWriteAsset(Pegasus::AssetLib::AssetLib* lib, Pegasus::AssetLib::Asset* asset) override; private: bool mLockParentArray; }; } } #endif
// // ProductDescriptionCell.h // Mobile Buy SDK // // Created by Shopify. // Copyright (c) 2015 Shopify Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // @import UIKit; /** * Table view cell containing the product description */ @interface ProductDescriptionCell : UITableViewCell /** * The text color of the product's description */ @property (nonatomic) UIColor *descriptionTextColor UI_APPEARANCE_SELECTOR; /** * Converts the product description from HTML to an attributed string * * @param html The product's description */ - (void)setDescriptionHTML:(NSString *)html; @end
// // Unicorn.h // Unicorn // // Created by retriable on 2018/2/1. // Copyright © 2018年 retriable. All rights reserved. // #import <Unicorn/NSObject+Uni.h> //! Project version number for Unicorn. FOUNDATION_EXPORT double UnicornVersionNumber; //! Project version string for Unicorn. FOUNDATION_EXPORT const unsigned char UnicornVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Unicorn/PublicHeader.h>
// // Global.h // Kata.LoanPrediction.C++ // // Created by retroburst [Andrew D] on 3/09/2015. // Copyright (c) 2015 retroburst [Andrew D]. All rights reserved. // #ifndef __Kata_LoanPrediction_C____Global__ #define __Kata_LoanPrediction_C____Global__ #include <stdio.h> #include <time.h> #include <string> using namespace std; typedef struct tm dateTime; // constants static const string* STRING_EMPTY = new string(); static const dateTime* DATETIME_EMPTY = new dateTime(); static const string PROGRAM_NAME = "Kata.LoanPrediction.C++"; static const int EXPECTED_ARGUMENT_COUNT = 9; static const int NUM_DAYS_IN_YEAR = 365; static const string TX_TYPE_MIN_REPAYMENT = "Minimum Repayment"; static const string TX_TYPE_EXTRA_REPAYMENT = "Extra Repayment"; static const string TX_TYPE_INTEREST_CHARGED = "Interest Charged"; static const string TX_FINAL_REPAYMENT = "Final Repayment"; static const char *DATE_FORMAT = "%d/%m/%Y"; static const char *DATE_FORMAT_FOR_FILENAME = "%Y.%m.%d"; // function prototypes int compareDates(dateTime x, dateTime y); int daysInMonth(int month, int year); bool isLeapYear(int year); void addDay(dateTime *target); void minusDay(dateTime *target); #endif /* defined(__Kata_LoanPrediction_C____Global__) */
// // UIView+ACExtensions.h // ACFloatingInput // // Created by Robert Mietelski on 13.12.2016. // Copyright © 2016 mietelski-robert. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (ACExtensions) @property (nonatomic, assign) IBInspectable CGFloat corrnerRadius; @property (nonatomic, assign) IBInspectable CGFloat borderWidth; @property (nonatomic, copy) IBInspectable UIColor *borderColor; @end
#include <stdio.h> #include <stdlib.h> #include "list.h" void bubble_sort(List **head){ if(head == NULL||(*head == NULL)) return ; int num_list = 0; int i = 0; int sub_i; int sub_for_times; int sub_for_Max; List **pre_sub_head = head; List *sub_head; sub_head = *head; for(;sub_head && sub_head->next;){ if(sub_head->value < sub_head->next->value){ sub_head = swap(sub_head,sub_head,sub_head->next); *pre_sub_head = sub_head; } num_list = num_list + 1; pre_sub_head = &((*pre_sub_head)->next); sub_head = sub_head->next; } sub_for_times = num_list - 1; for(*head && (*head)->next;i < sub_for_times;i++){ sub_head = *head; sub_for_Max = num_list - (i+1); pre_sub_head = head; for(sub_i = 0;sub_head && sub_head->next && (sub_i < sub_for_Max);sub_i++){ if(sub_head->value < sub_head->next->value){ sub_head = swap(sub_head,sub_head,sub_head->next); *pre_sub_head = sub_head; } pre_sub_head = &((*pre_sub_head)->next); sub_head = sub_head->next; } } return ; } main(){return 0 ;}
/* * communication.h * * Created on: 11 Mar 2016 * Author: raffael */ #ifndef COMMUNICATION_H_ #define COMMUNICATION_H_ #include <stdint.h> #include "module_control.h" typedef struct _eps_status { //stores the answers to be sent to an eventual i2c request uint16_t v_bat; uint16_t t_bat; uint16_t v_solar; uint16_t current_in; uint16_t current_out; uint16_t analog_ext1; uint16_t analog_ext2; uint16_t analog_ext3; uint16_t analog_ext4; uint8_t v_bat_8; uint8_t t_bat_8; uint8_t v_solar_8; uint8_t current_in_8; uint8_t current_out_8; uint8_t analog_ext1_8; uint8_t analog_ext2_8; uint8_t analog_ext3_8; uint8_t analog_ext4_8; } eps_status_t; extern eps_status_t eps_status; extern uint8_t module_status[N_MODULES]; //stores the answers to be sent to an eventual i2c request void init_timer_A(); void init_timer_B(); void init_i2c(); void execute_i2c_command(); #endif /* COMMUNICATION_H_ */
#pragma once #include "inodehandler.h" namespace Syntax { namespace GraphicsCompiler { class LabelsHandler : public Syntax::Compiler::INodeHandler { public: LabelsHandler(void); virtual ~LabelsHandler(void); virtual std::wstring Handles() {return L"labels";} virtual std::wstring Parent() {return L"data";} virtual void HandleAttribute(const std::wstring &name,const std::wstring& value) {} virtual Syntax::Compiler::INodeCompiler* StartElement(); }; } }
/* * Copyright(c) Sophist Solutions, Inc. 1990-2022. All rights reserved */ #ifndef _Stroika_Foundation_Common_GUID_h_ #define _Stroika_Foundation_Common_GUID_h_ 1 #include "../StroikaPreComp.h" #if defined(__cpp_impl_three_way_comparison) #include <compare> #endif #if qPlatform_Windows #include <guiddef.h> #endif #include "../Characters/ToString.h" #include "../Configuration/Common.h" /** */ namespace Stroika::Foundation::Memory { class BLOB; // Forward declare to avoid mutual include issues } namespace Stroika::Foundation::Common { /** * A very common 16-byte opaque ID structure. * * \note <a href="Coding Conventions.md#Comparisons">Comparisons</a>: * o Standard Stroika Comparison support (operator<=>,operator==, etc); */ struct GUID { /** * \note - when converting from a string, GUID allows the leading/trailing {} to be optionally provided. * - format's supported {61e4d49d-8c26-3480-f5c8-564e155c67a6} * or 61e4d49d-8c26-3480-f5c8-564e155c67a6 * no argument CTOR, creates an all-zero GUID. * * @todo maybe support more input formats, such as https://stackoverflow.com/questions/7775439/is-the-format-of-guid-always-the-same * @todo - should allow input format of raw bytes (though unclear of endian interpretation that would be best * in that case) */ constexpr GUID () = default; #if qPlatform_Windows constexpr GUID (const ::GUID& src); #endif GUID (const string& src); GUID (const Memory::BLOB& src); GUID (const array<uint8_t, 16>& src); GUID (const Characters::String& src); uint32_t Data1{}; uint16_t Data2{}; uint16_t Data3{}; uint8_t Data4[8]{}; public: /** * Allow iterating and modifying in place of the GUID as a sequence of bytes */ nonvirtual std::byte* begin (); nonvirtual const std::byte* begin () const; public: /** * Allow iterating and modifying in place of the GUID as a sequence of bytes */ nonvirtual std::byte* end (); nonvirtual const std::byte* end () const; public: /** */ nonvirtual explicit operator Memory::BLOB () const; public: /** * Like Windows UuidCreate, or CoCreateGuid - create a random GUID (but portably). */ static GUID GenerateNew (); #if __cpp_impl_three_way_comparison >= 201907 && !qCompilerAndStdLib_SpaceshipAutoGenForOpEqualsForCommonGUID_Buggy public: /** */ nonvirtual strong_ordering operator<=> (const GUID&) const = default; #endif public: /** * For now, only supported formats are * o String -- format: {61e4d49d-8c26-3480-f5c8-564e155c67a6} * o string -- '' * o BLOB */ template <typename T> nonvirtual T As () const; public: /** * @see Characters::ToString () */ nonvirtual Characters::String ToString () const; }; static_assert (sizeof (GUID) == 16); #if __cpp_impl_three_way_comparison < 201907 or qCompilerAndStdLib_SpaceshipAutoGenForOpEqualsForCommonGUID_Buggy /** * Basic operator overloads with the obvious meaning, and simply indirect to @GUID::ThreeWayComparer () */ bool operator< (const GUID& lhs, const GUID& rhs); bool operator<= (const GUID& lhs, const GUID& rhs); bool operator== (const GUID& lhs, const GUID& rhs); bool operator!= (const GUID& lhs, const GUID& rhs); bool operator>= (const GUID& lhs, const GUID& rhs); bool operator> (const GUID& lhs, const GUID& rhs); #endif template <> Characters::String GUID::As () const; template <> string GUID::As () const; template <> Memory::BLOB GUID::As () const; } namespace Stroika::Foundation::DataExchange { template <typename T> struct DefaultSerializer; // Forward declare to avoid mutual include issues template <> struct DefaultSerializer<Stroika::Foundation::Common::GUID> { Memory::BLOB operator() (const Stroika::Foundation::Common::GUID& arg) const; }; } /* ******************************************************************************** ***************************** Implementation Details *************************** ******************************************************************************** */ #include "GUID.inl" #endif /*_Stroika_Foundation_Common_GUID_h_*/
// // PlayerStatusIndicator.h // Outlander // // Created by Joseph McBride on 6/13/14. // Copyright (c) 2014 Joe McBride. All rights reserved. // @interface PlayerStatusIndicator : NSObject @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *value; @end
#include "serial.h" #include "ioport.h" #include "defs.h" #include "idt.h" #define COM_PORT 0x3F8 #define COM_IRQ 4 #define CLOCK_FREQ 115200 #define UART_SPEED 9600 #define CLOCK_FDIV (CLOCK_FREQ / UART_SPEED) #define DLB_REG 0 #define DHB_REG 1 #define TX_DATA_REG 0 #define RX_DATA_REG 0 #define IE_REG 1 #define ENABLE_RX_DATA BITU(0) #define ENABLE_TX_DATA BITU(1) #define ENABLE_LINE_STATUS BITU(2) #define ENABLE_MODEM_STATUS BITU(3) #define II_REG 2 #define PENDING_INTERRUPT_MASK BITU(0) #define INTERRUPT_PENDING 0 #define INTERRUPT_TYPE_MASK (BITU(1) | BITU(2)) #define MODEM_STATUS_CHANGED 0 #define TX_INTERRUPT BITU(1) #define RX_INTERRUPT BITU(2) #define LINE_STATUS_CHANGED (BITU(1) | BITU(2)) #define FC_REG 2 #define ENABLE_FIFO BITU(0) #define CLEAR_RX_BUFFER BITU(1) #define CLEAR_TX_BUFFER BITU(2) #define FIFO_BUFFER_1 0 #define FIFO_BUFFER_4 BITU(6) #define FIFO_BUFFER_8 BITU(7) #define FIFO_BUFFER_14 (BITU(6) | BITU(7)) #define LC_REG 3 #define DATA_BITS_5 0 #define DATA_BITS_6 BITU(0) #define DATA_BITS_7 BITU(1) #define DATA_BITS_8 (BITU(0) | BITU(1)) #define STOP_BITS_1 0 #define STOP_BITS_2 BITU(2) #define PARITY_NONE 0 #define PARITY_ODD BITU(3) #define PARITY_EVEN (BITU(3) | BITU(4)) #define DLAB BITU(7) #define LS_REG 5 #define RX_DATA BITU(0) #define TX_READY BITU(5) #define RING_BUFFER_SIZE 4096 struct ring_buffer { char buffer[RING_BUFFER_SIZE]; unsigned begin, end, size; }; static int ring_buffer_empty(const struct ring_buffer *buffer) { return buffer->size == 0; } static int ring_buffer_full(const struct ring_buffer *buffer) { return buffer->size == RING_BUFFER_SIZE; } static unsigned ring_buffer_size(const struct ring_buffer *buffer) { return buffer->size; } static void ring_buffer_putchar(struct ring_buffer *buffer, int data) { buffer->buffer[buffer->end] = data; buffer->end = (buffer->end + 1) % RING_BUFFER_SIZE; buffer->size++; } static int ring_buffer_getchar(struct ring_buffer *buffer) { const int data = buffer->buffer[buffer->begin]; buffer->begin = (buffer->begin + 1) % RING_BUFFER_SIZE; buffer->size--; return data; } static struct ring_buffer rx_buffer; static void serial_irq_handler(int intno) { int status = in8(COM_PORT + LS_REG); while (status & RX_DATA) { const int data = in8(COM_PORT + RX_DATA_REG); if (!ring_buffer_full(&rx_buffer)) ring_buffer_putchar(&rx_buffer, data); status = in8(COM_PORT + LS_REG); }; } size_t serial_read(char *buf, size_t size) { unsigned long flags = irqsave(); unsigned count = ring_buffer_size(&rx_buffer); unsigned i; if (count > size) count = size; for (i = 0; i != count; ++i) *buf++ = ring_buffer_getchar(&rx_buffer); irqrestore(flags); return count; } void serial_setup(void) { rx_buffer.begin = rx_buffer.end = rx_buffer.size = 0; out8(COM_PORT + IE_REG, 0); out8(COM_PORT + LC_REG, DLAB); out8(COM_PORT + DLB_REG, CLOCK_FDIV & 0xFF); out8(COM_PORT + DHB_REG, (CLOCK_FDIV & 0xFF00) >> 8); out8(COM_PORT + LC_REG, DATA_BITS_8 | PARITY_NONE | STOP_BITS_1); out8(COM_PORT + FC_REG, ENABLE_FIFO | FIFO_BUFFER_14); setup_irq_handler(COM_IRQ, serial_irq_handler); irq_unmask(COM_IRQ); out8(COM_PORT + IE_REG, ENABLE_RX_DATA); }
/***************************************************************************************** * * * OpenSpace * * * * Copyright (c) 2014-2022 * * * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * * software and associated documentation files (the "Software"), to deal in the Software * * without restriction, including without limitation the rights to use, copy, modify, * * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * * permit persons to whom the Software is furnished to do so, subject to the following * * conditions: * * * * The above copyright notice and this permission notice shall be included in all copies * * or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ #ifndef __OPENSPACE_MODULE_MULTIRESVOLUME___TSP___H__ #define __OPENSPACE_MODULE_MULTIRESVOLUME___TSP___H__ #include <ghoul/opengl/ghoul_gl.h> #include <fstream> #include <list> #include <string> #include <vector> namespace openspace { class TSP { public: struct Header { unsigned int gridType; unsigned int numOrigTimesteps; unsigned int numTimesteps; unsigned int xBrickDim; unsigned int yBrickDim; unsigned int zBrickDim; unsigned int xNumBricks; unsigned int yNumBricks; unsigned int zNumBricks; }; enum NodeData { BRICK_INDEX = 0, CHILD_INDEX, SPATIAL_ERR, TEMPORAL_ERR, NUM_DATA }; TSP(const std::string& filename); ~TSP(); // load performs readHeader, readCache, writeCache and construct // in the correct sequence bool load(); bool readHeader(); bool readCache(); bool writeCache(); bool construct(); bool initalizeSSO(); const Header& header() const; static long long dataPosition(); std::ifstream& file(); unsigned int numTotalNodes() const; unsigned int numValuesPerNode() const; unsigned int numBSTNodes() const; unsigned int numBSTLevels() const; unsigned int numOTNodes() const; unsigned int numOTLevels() const; unsigned int brickDim() const; unsigned int paddedBrickDim() const; unsigned int numBricksPerAxis() const; GLuint ssbo() const; bool calculateSpatialError(); bool calculateTemporalError(); float spatialError(unsigned int brickIndex) const; float temporalError(unsigned int brickIndex) const; unsigned int firstOctreeChild(unsigned int brickIndex) const; unsigned int bstLeft(unsigned int brickIndex) const; unsigned int bstRight(unsigned int brickIndex) const; bool isBstLeaf(unsigned int brickIndex) const; bool isOctreeLeaf(unsigned int brickIndex) const; private: // Returns a list of the octree leaf nodes that a given input // brick covers. If the input is already a leaf, the list will // only contain that one index. std::list<unsigned int> coveredLeafBricks(unsigned int brickIndex) const; // Returns a list of the BST leaf nodes that a given input brick // covers (at the same spatial subdivision level). std::list<unsigned int> coveredBSTLeafBricks(unsigned int brickIndex) const; // Return a list of eight children brick incices given a brick index std::list<unsigned int> childBricks(unsigned int brickIndex); std::string _filename; std::ifstream _file; std::streampos _dataOffset; // Holds the actual structure std::vector<int> _data; GLuint _dataSSBO = 0; // Data from file Header _header; // Additional metadata unsigned int _paddedBrickDim = 0; unsigned int _numTotalNodes = 0; unsigned int _numBSTLevels = 0; unsigned int _numBSTNodes = 0; unsigned int _numOTLevels = 0; unsigned int _numOTNodes = 0; const unsigned int _paddingWidth = 1; // Error stats float _minSpatialError = 0.f; float _maxSpatialError = 0.f; float _medianSpatialError = 0.f; float _minTemporalError = 0.f; float _maxTemporalError = 0.f; float _medianTemporalError = 0.f; }; } // namespace openspace #endif // __OPENSPACE_MODULE_MULTIRESVOLUME___TSP___H__
#ifndef RSD_H #define RSD_H #include "SolversLS.h" #include "def.h" class RSD : public SolversLS{ public: RSD(const Problem *prob, const Variable *initialx); protected: virtual void GetSearchDir(); }; #endif // end of RSD_H
/* * CheckSyntax.c * * Created on: Sep 24, 2016 * Author: brad rust * Used to ensure rules in Kata exercise are followed * w.r.t I, X, C == MAX(3) * V, L, D == MAX(1) * char array size is not dynamic since * maximum roman numeral is 3999 * ie, strings are always fairly short */ #include "checkSyntax.h" _Bool is_I_X_C(char c) { switch (c) { case 'I' : return 1; case 'X': return 1; case 'C' : return 1; default : return 0; } } _Bool is_V_L_D_M(char c) { switch (c) { case 'V' : return 1; case 'L': return 1; case 'D' : return 1; case 'M' : return 1; default : return 0; } } int maxLetterCount(char numeral) { switch (numeral) { case 'I' : return 3; case 'V' : return 1; case 'X' : return 3; case 'L' : return 1; case 'C' : return 3; case 'D' : return 1; case 'M' : return 3; default : return 0; } } _Bool maxLengthExceeded(char* numeralString) { //longest string for numbers < 3999 = 15 //the maximum possible length is 15 + 1 for null terminator int maxLength = 16; return strlen(numeralString) >= maxLength ? 1 : 0; }
#ifndef SAKI_AI_STUB_H #define SAKI_AI_STUB_H #include "ai.h" namespace saki { class AiStub : public Ai { public: Action think(const TableView &view, Limits &limits) override; }; } // namespace saki #endif // SAKI_AI_STUB_H
// // YOSRefreshConst.h // god // // Created by yangyang on 2016/11/16. // Copyright © 2016年 shoppingm.cn. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, YOSRefreshStatus) { YOSRefreshStatusNormal = 0, // 普通 YOSRefreshStatusPulling = 1, // 下拉 YOSRefreshStatusWillRefreshing = 2, // 即将刷新 YOSRefreshStatusRefreshing = 3, // 正在刷新 }; UIKIT_EXTERN const CGFloat YOSRefreshFastAnimationDuration; UIKIT_EXTERN const CGFloat YOSRefreshTopBottomHeight; UIKIT_EXTERN const CGFloat YOSRefreshLeftRightWidth; UIKIT_EXTERN NSString *const YOSRefreshContentOffset; UIKIT_EXTERN NSString *const YOSRefreshContentSize;
// // STNaviBar.h // STNavigationBarDemo // // Created by bopeng on 2017/9/28. // Copyright © 2017年 Scott. All rights reserved. // #import <UIKit/UIKit.h> @interface STNaviBar : UINavigationBar @end
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2017 The PIVX developers // Copyright (c) 2018-2019 The Ion developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_POW_H #define BITCOIN_POW_H #include <stdint.h> class CBlockHeader; class CBlockIndex; class uint256; class arith_uint256; // Define difficulty retarget algorithms enum DiffMode { DIFF_DEFAULT = 0, // Default to invalid 0 DIFF_BTC = 1, // Retarget every x blocks (Bitcoin style) DIFF_MIDAS = 2, // Retarget using MIDAS algo DIFF_DGW = 3, // Retarget using Dark Gravity Wave v3 }; unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader* pblock); /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ bool CheckProofOfWork(uint256 hash, unsigned int nBits); uint256 GetBlockProof(const CBlockIndex& block); #endif // BITCOIN_POW_H
#ifndef TCPSERVER_GLOBAL_H_ #define TCPSERVER_GLOBAL_H_ #include "../util/logger.h" extern util::Logger *logger; #endif
// // ZHUseFDModel.h // testAutoCalculateCellHeight // // Created by aimoke on 16/8/3. // Copyright © 2016年 zhuo. All rights reserved. // #import <Foundation/Foundation.h> @interface ZHUseFDModel : NSObject @property (nonatomic, strong) NSString *title; @property (nonatomic, strong) NSString *content; @property (nonatomic, strong) NSString *username; @property (nonatomic, strong) NSString *time; @property (nonatomic, strong) NSString *imageName; @property (nonatomic, strong) NSString *identifier; - (instancetype)initWithDictionary:(NSDictionary *)dictionary; @end
// // UIPickerView+IDNPickDate.h // IDNFramework // // Created by photondragon on 15/6/23. // Copyright (c) 2015年 iosdev.net. All rights reserved. // #import <UIKit/UIKit.h> @interface UIPickerView(IDNPickDate) /** 在[[UIApplication sharedApplication].delegate window]里显示UIPickerView,内部只是 简单调用了UIView(IDNPickDate)的功能 @code [UIPickerView pickDateWithChoosedBlock:^(NSDate *date) { NSLog(@"选择的时间为:%@", date); } mode:UIDatePickerModeDate currentDate:nil minDate:nil maxDate:[NSDate date]]; @endcode */ + (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock; + (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock mode:(UIDatePickerMode)mode currentDate:(NSDate*)currentDate minDate:(NSDate*)minDate maxDate:(NSDate*)maxDate; @end @interface UIView(IDNPickDate) /** 在指定view里显示一个UIPickerView,用户可以选择一个时间,点确定按钮,然后dateChoosedBlock 会被调用,参数就是用户选择的时间。 如果用户取消了选择,dateChoosedBlock不会被调用 @code [self.navigationController.view pickDateWithChoosedBlock:^(NSDate *date) { NSLog(@"选择的时间为:%@", date); } mode:UIDatePickerModeDate currentDate:nil minDate:nil maxDate:[NSDate date]]; @endcode */ - (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock; - (void)pickDateWithChoosedBlock:(void (^)(NSDate* date))dateChoosedBlock mode:(UIDatePickerMode)mode currentDate:(NSDate*)currentDate minDate:(NSDate*)minDate maxDate:(NSDate*)maxDate; @end
/* * The MIT License (MIT) * Copyright (c) 2015 Peter Vanusanik <admin@en-circle.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in all copies * or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * random.c * Created on: Dec 23, 2015 * Author: Peter Vanusanik * Contents: random generator based on xorshift */ #include "random.h" /******************************************************************************//** * \brief Creates random generator state. * * Random generator state is seeded with provided seed. ********************************************************************************/ rg_t rg_create_random_generator(uint64_t seed) { rg_t rg; rg.state[0] = (seed & 0xFFFFFFFF00000000) + ((seed << 32) ^ seed); rg.state[1] = (seed & 0x00000000FFFFFFFF) + ((seed >> 32) ^ seed); return rg; } /******************************************************************************//** * \brief Returns next random unsigned int value. * * Int type is ruint_t, which is register sized uint. ********************************************************************************/ ruint_t rg_next_uint(rg_t* rg) { ruint_t x = rg->state[0]; ruint_t const y = rg->state[1]; rg->state[0] = y; x ^= x << 23; // a rg->state[1] = x ^ y ^ (x >> 17) ^ (y >> 26); // b, c return rg->state[1] + y; } /******************************************************************************//** * \brief Returns next random unsigned int from 0 to limit. * * Int type is ruint_t, which is register sized uint. ********************************************************************************/ ruint_t rg_next_uint_l(rg_t* rg, ruint_t limit) { return rg_next_uint(rg) % limit; }
/* Copyright (C) 2011 by Ivan Safrin 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 "PolyGlobals.h" #include <math.h> #include <assert.h> namespace Polycode { /** * 2D Vector (convenience wrapper around Vector3). */ class _PolyExport Vector2 { public: /** * Create from x,y,z coordinates. * @param x X coordinate. * @param y Y coordinate. */ Vector2(Number x,Number y); /** * Default constructor. */ Vector2(); ~Vector2(); /** * Sets the vector from x,y,z coordinates. * @param x X coordinate. * @param y Y coordinate. */ void set(Number x, Number y); inline Vector2 operator - ( const Vector2& v2 ) const { return Vector2(x - v2.x, y - v2.y); } /** * Returns the distance from this vector to another one. * @param vec2 Second vector. * @return Distance to the other vector. */ inline Number distance(const Vector2& vec2) const { return (*this - vec2).length(); } // ---------------------------------------------------------------------------------------------------------------- /** @name Operators * Available vector operators. */ //@{ inline Vector2 operator * (const Number val) const { return Vector2(x * val, y * val); } inline Vector2 operator / (const Number val) const { assert( val != 0.0 ); return operator*(1/val); } inline Vector2& operator = ( const Vector2& v2) { x = v2.x; y = v2.y; return *this; } inline Vector2& operator += ( const Vector2& v2) { x += v2.x; y += v2.y; return *this; } inline Vector2& operator -= ( const Vector2& v2) { x -= v2.x; y -= v2.y; return *this; } inline Vector2 operator + ( const Vector2& v2 ) const { return Vector2(x + v2.x, y + v2.y); } inline bool operator == ( const Vector2& v2) { return (v2.x == x && v2.y == y); } inline bool operator != ( const Vector2& v2) { return (v2.x != x || v2.y != y); } //@} // ---------------------------------------------------------------------------------------------------------------- /** * Returns the vector length. * @return Length of the vector. */ inline Number length () const { return sqrtf( x * x + y * y); } /** * Returns the dot product with another vector. * @return Dor product with the vector. */ inline Number dot(const Vector2 &u) const { return x * u.x + y * u.y; } /** * Returns the cross product with another vector. * @param vec2 Second vector. * @return Cross product with the vector. */ inline Number crossProduct( const Vector2& vec2 ) const { return x * vec2.y - y * vec2.x; } inline Number angle(const Vector2& vec2 ) const { Number dtheta,theta1,theta2; theta1 = atan2(y,x); theta2 = atan2(vec2.y,vec2.x); dtheta = theta2 - theta1; while (dtheta > PI) dtheta -= PI*2.0; while (dtheta < -PI) dtheta += PI*2.0; return(dtheta); } /** * Normalizes the vector. */ void Normalize(); /** * X coordinate. */ Number x; /** * Y coordinate. */ Number y; protected: }; }