text
stringlengths
4
6.14k
// // BaseViewController.h // RouterManager // // Created by 周际航 on 2017/8/14. // Copyright © 2017年 周际航. All rights reserved. // #import <UIKit/UIKit.h> #import "XZRouterManager.h" @interface BaseViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, XZRoutableProtocol> @property (nonatomic, strong, readonly, nullable) UITableView *base_tableView; - (NSString *_Nonnull)overload_cellTextForRowAtIndexPath:(NSIndexPath *_Nonnull)indexPath NS_REQUIRES_SUPER; - (void)overload_cellDidSelectAtIndexPath:(NSIndexPath *_Nonnull)indexPath; @end
// // YYReturnResultModel.h // BikeRental // // Created by yunyuchen on 2017/5/25. // Copyright © 2017年 xinghu. All rights reserved. // #import "YYBaseModel.h" @interface YYReturnResultModel : YYBaseModel @property (nonatomic,assign) CGFloat price; @property (nonatomic,assign) NSInteger keep; @property (nonatomic,assign) CGFloat extPrice; @property (nonatomic,assign) CGFloat longitude; @property (nonatomic,assign) CGFloat latitude; @property (nonatomic,assign) CGFloat first; @end
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h> #define TILE_W 4 #define TILE_H 8 #define NTILES_W 32 #define NTILES_H 32 #define TILESET_SIZE 93 int compare_tile(uint8_t *tile, uint8_t *level, int x, int y) { int row; uint8_t buffer[32]; for(row = 0; row < TILE_H; ++row) { memcpy(buffer + row*4, level + (y*8 + row)*128 + x*4, 4); } /* Check with no mirroring */ for(row = 0; row < TILE_H; ++row) { uint32_t src = *(uint32_t *)(tile + row*4); uint32_t dst = *(uint32_t *)(buffer + row*4); if(src != dst) { return 0; } } return 1; } int main(int argc, char *argv[]) { FILE *flevel, *ftilemap, *foutput; size_t tilemap_size, level_size; uint8_t *tilemap, *level, *output; int x, y, t; char output_name[256]; if(argc < 2) { fprintf(stderr, "error: must supply tilemap...\n"); exit(1); } ftilemap = fopen(argv[1], "rb"); fseek(ftilemap, 0, SEEK_END); tilemap_size = ftell(ftilemap); fseek(ftilemap, 0, SEEK_SET); tilemap = malloc(tilemap_size); fread(tilemap, 1, tilemap_size, ftilemap); fclose(ftilemap); if(tilemap_size < TILE_W * TILE_H * TILESET_SIZE) { //fprintf(stderr, "error: tilemap not big enough... (%d bytes)\n", // tilemap_size); //exit(1); } flevel = fopen(argv[2], "rb"); fseek(flevel, 0, SEEK_END); level_size = ftell(flevel); fseek(flevel, 0, SEEK_SET); level = malloc(level_size); fread(level, 1, level_size, flevel); fclose(flevel); if(level_size < NTILES_W * NTILES_H * TILE_W * TILE_H) { fprintf(stderr, "error: level not big enough...\n"); exit(1); } sprintf(output_name, "%s.map", argv[2]); foutput = fopen(output_name, "wb"); output = malloc(NTILES_W * NTILES_H); for(y = 0; y < NTILES_H; ++y) { for(x = 0; x < NTILES_W; ++x) { //printf("checking tile (%d, %d)\n", x, y); for(t = 0; t < TILESET_SIZE; ++t) { //printf("checking against tilemap[%d]\n", t); if(compare_tile(tilemap + t*TILE_W*TILE_H, level, x, y)) { //printf("match found, tile[%d,%d] = tilemap[%d]\n", x, y, t); //int solid = (t!=3 && t!=15 && t!=16 && t!=17 && t!=18 && // t!=19 && t!=22 && t!=23 && t!=24 && t!=25 && // t!= 26 && t!=27 && t!=28 && t!=30 && t!=11) // << 6; int solid = (t==1||t==2||t==3||t==4||t==5||t==6||t==7||t==8||t==12||t==14||t==15||t==16||t==17||t==35||t==36) << 6; //int end = (t==15 || t==16 || t==18 || t==19) << 7; int end = (t==31||t==32||t==33||t==34) << 7; output[y*NTILES_W + x] = end | solid | t; break; } } if(t == TILESET_SIZE) { fprintf(stderr, "error: no matching tile found at (%d,%d)\n", x, y); return 1; } } } fwrite(output, NTILES_W*NTILES_H, 1, foutput); fclose(foutput); printf("wrote %d bytes to %s\n", NTILES_W*NTILES_H, output_name); return 0; }
// // TableViewCellTemplate.h // SQTemplate // // Created by 双泉 朱 on 17/5/11. // Copyright © 2017年 Doubles_Z. All rights reserved. // #import <UIKit/UIKit.h> #import "HYBlockOneCellAdapter.h" @interface HYBlockOneCell : UITableViewCell @property (nonatomic,strong) id<HYBlockOneCellAdapter> adapter; + (instancetype)cellWithTableView:(UITableView *)tableView; + (CGFloat)cellHeight; @end
// // KontaktSDK // Version: 3.0.4 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // #import "KTKEddystoneRegion.h" NS_ASSUME_NONNULL_BEGIN #pragma mark - KTKSecureEddystoneRegion (Interface) @interface KTKSecureEddystoneRegion : KTKEddystoneRegion <NSCopying, NSSecureCoding> #pragma mark - Secure Eddystone Region Properties ///-------------------------------------------------------------------- /// @name Secure Eddystone Region Properties ///-------------------------------------------------------------------- /** * Eddystone region secure namespace ID. */ @property (nonatomic, copy, readwrite) NSString * _Nullable secureNamespaceID; #pragma mark - Initialization Methods ///-------------------------------------------------------------------- /// @name Initialization Methods ///-------------------------------------------------------------------- /** * Initializes and returns a region object that targets an eddystone with the specified secure namespace ID. * * @param secureNamespaceID Secure namespace ID string of the eddystone being targeted. * * @return An initialized secure eddystone region object. */ - (instancetype)initWithSecureNamespaceID:(NSString* _Nonnull)secureNamespaceID; /** * Initializes and returns a region object that targets an eddystone with the specified secure namespace ID and instance ID. * * @param secureNamespaceID Secure namespace ID string of the eddystone being targeted. * @param instanceID Instance ID string of the eddystone being targeted. * * @return An initialized secure eddystone region object. */ - (instancetype)initWithSecureNamespaceID:(NSString* _Nonnull)secureNamespaceID instanceID:(NSString* _Nullable)instanceID; #pragma mark - Unavailable Initialization Methods - (instancetype)initWithURL:(NSURL*)URL __attribute__((unavailable("initWithURL: is unavailable in KTKSecureEddystoneRegion"))); - (instancetype)initWithURLDomain:(NSString*)URLDomain __attribute__((unavailable("initWithURLDomain is unavailable in KTKSecureEddystoneRegion"))); @end NS_ASSUME_NONNULL_END
#ifndef PARSER_SIGNATURES_H #define PARSER_SIGNATURES_H #include "parser_state.h" void *ParseAlloc(void *(*allocProc) (size_t)); void Parse(void *, int, const char *, struct parser_state *); void ParseFree(void *, void (*freeProc) (void *)); #endif
#pragma once #include "chash.h" template<class key_t, class unique_t, class hasher_t, class key_equal_t, class allocator_t> struct chash_set_config_t { typedef key_t key_type; typedef key_t mapped_type; typedef key_t value_type; typedef hasher_t hasher; typedef key_equal_t key_equal; typedef allocator_t allocator_type; typedef std::uintptr_t offset_type; typedef typename std::result_of<hasher(key_type)>::type hash_value_type; typedef unique_t unique_type; static float grow_proportion(std::size_t) { return 2; } template<class in_type> static key_type const &get_key(in_type &&value) { return value; } }; template<class key_t, class hasher_t = std::hash<key_t>, class key_equal_t = std::equal_to<key_t>, class allocator_t = std::allocator<key_t>> using chash_set = contiguous_hash<chash_set_config_t<key_t, std::true_type, hasher_t, key_equal_t, allocator_t>>; template<class key_t, class hasher_t = std::hash<key_t>, class key_equal_t = std::equal_to<key_t>, class allocator_t = std::allocator<key_t>> using chash_multiset = contiguous_hash<chash_set_config_t<key_t, std::false_type, hasher_t, key_equal_t, allocator_t>>;
// // WQTest1VC.h // WQRoute // // Created by 青秀斌 on 17/1/21. // Copyright © 2017年 woqugame. All rights reserved. // #import <UIKit/UIKit.h> @interface WQTest1VC : BSViewController @end
/* library based on jeelabs RTClib [original library at https://github.com/jcw/rtclib ] altered to support Microchip MCP7940M RTC, used in Arduino based embedded environments. To use this library, add #include <MCP7940.h> to the top of your program.*/ class DateTime { //DateTime class constructs the variable to store RTC Date and Time, and is a direct copy from the original RTClib. public: DateTime(long t =0); DateTime(uint16_t year, uint8_t month, uint8_t day, uint8_t hour=0, uint8_t min=0, uint8_t sec=0, uint8_t dow=1); DateTime(const char* date, const char* time); uint16_t year() const {return 2000+yOff;} uint8_t month() const {return m;} uint8_t day() const {return d;} uint8_t hour() const {return hh;} uint8_t minute() const {return mm;} uint8_t second() const {return ss;} uint8_t DayOfWeek() const {return dow;} long get() const; // protected: uint8_t yOff, m, d, hh, mm, ss,dow; }; class RTC_MCP7940{ //RTC functions, based off original library. Some functions are designed specifically for use in the public: //3 Channel Data Logger. static void begin(); //initialize Wire library static void adjust(const DateTime& dt); //change date and time static DateTime now(); //get current time and date from RTC registers //static uint8_t isrunning(); //check to make sure clock is ticking static void configure(uint8_t value); //configure alarm enables and MFP output static bool isset(); //check whether clock has been set static void setAlarm(DateTime value); //configure alarm settings register static void clearAlarm(); //clear alarm settings register //static uint8_t ordinalDate(uint8_t toDay, uint8_t toMonth); //convert date and month to ordinal (julian) date //static unsigned long get(){return now().get();} static uint8_t bcd2bin (uint8_t val) { return val - 6 * (val >> 4);} //bcd to bin conv (RTC to MCU) static uint8_t bin2bcd (uint8_t val) { return val + 6 * (val / 10);} //bin to bcd conv (MCU to RTC) };
// // AccessRecordCell.h // SkyNet // // Created by 魏乔森 on 2017/10/16. // Copyright © 2017年 xrg. All rights reserved. // #import <UIKit/UIKit.h> #import "VillageApplyModel.h" @interface AccessRecordCell : UITableViewCell + (instancetype)cellWithTableView:(UITableView *)tableView; @property (nonatomic, strong)VillageApplyModel *model; @property (strong, nonatomic) IBOutlet UILabel *nameLabel; @property (strong, nonatomic) IBOutlet UILabel *addressLabel; @property (strong, nonatomic) IBOutlet UILabel *stateLabel; @end
// // ViewController.h // CulveDisplay // // Created by 王源果 on 14/12/15. // Copyright (c) 2014年 g4idrijs. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
// // WtDemoWebViewController.h // WtCore_Example // // Created by wtfan on 2017/9/1. // Copyright © 2017年 JaonFanwt. All rights reserved. // #import <UIKit/UIKit.h> @interface WtDemoWebViewController : UIViewController @property (nonatomic, assign) BOOL useThunder; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/TSDImageFill.h> @class TSPData, TSUColor; // Not exported @interface TSDMutableImageFill : TSDImageFill { } - (void)setScale:(double)arg1; @property(nonatomic) struct CGSize fillSize; // @dynamic fillSize; @property(retain, nonatomic) TSPData *imageData; // @dynamic imageData; @property(nonatomic) int technique; // @dynamic technique; @property(copy, nonatomic) TSUColor *tintColor; // @dynamic tintColor; - (id)copyWithZone:(struct _NSZone *)arg1; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <HomeSharing/HSRequest.h> @interface HSBulkRemovePlaylistRequest : HSRequest { } + (id)requestWithDatabaseID:(unsigned int)arg1 sessionID:(unsigned int)arg2 containerID:(unsigned int)arg3; - (id)_bodyDataForSessionID:(unsigned int)arg1 containerID:(unsigned int)arg2; - (id)initWithDatabaseID:(unsigned int)arg1 sessionID:(unsigned int)arg2 containerID:(unsigned int)arg3; @end
@import Foundation; @interface DSMessageContext: NSObject<NSCoding> @end
#ifndef __THREADS_H__ #define __THREADS_H__ #include <lpc_types.h> void thread_init(uint32_t quantaUs); void thread_go(); // THIS WILL NEVER RETURN int thread_create(void (*run)(void*), void* userdata); void thread_kill(int thread_id); void thread_self_term(); #endif
/* * getdents64.c * by WN @ Aug. 03, 2010 */ #include "syscall_handler.h" #include <common/debug.h> #ifndef PRE_LIBRARY DEF_HANDLER(getdents64) { TRACE(LOG_SYSCALL, "getdents64\n"); int r = regs->eax; if (r > 0) BUFFER((void*)(regs->ecx), r); return 0; } #endif // vim:ts=4:sw=4
#pragma once #include "mesh/Mesh.h" #include <string> #include <fstream> #include <map> NS_BEGIN_NAMESPACE enum VTKOutputOptions { VOO_ElementDeterminant = 0x1, VOO_ElementMatrix = 0x2, VOO_ElementGradient = 0x4, VOO_VertexBoundaryLabel = 0x8, VOO_VertexImplicitLabel = 0x10, VOO_IsQuadratic = 0x80 }; template<typename T, Dimension K> class VTKExporter { public: template<typename V> static void write(const std::string& path, const Mesh<T,K>& mesh, const std::map<std::string, V*>& pointData, const std::map<std::string, V*>& cellData, int outputOptions = 0); }; NS_END_NAMESPACE #define _NS_VTKEXPORTER_INL # include "VTKExporter.inl" #undef _NS_VTKEXPORTER_INL
#include <stdio.h> #include "list.h" #define N 10 void visit(link); int main(void) { int i; link head, x; // Population head = new_link(0); x = head; for (i = 1; i < N; ++i) { x = insert_after(x, new_link(i)); } // Recursive Traversal traverse(head, visit); return 0; } void visit(link x) { printf("Visited link %i\n", x->item); }
// // ASCenterLayoutSpec.h // Texture // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the /ASDK-Licenses directory of this source tree. An additional // grant of patent rights can be found in the PATENTS file in the same directory. // // Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present, // Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // #import <AsyncDisplayKit/ASRelativeLayoutSpec.h> /** * How the child is centered within the spec. * * The default option will position the child at {0,0} relatively to the layout bound. * Swift: use [] for the default behavior. */ typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecCenteringOptions) { /** The child is positioned in {0,0} relatively to the layout bounds */ ASCenterLayoutSpecCenteringNone = 0, /** The child is centered along the X axis */ ASCenterLayoutSpecCenteringX = 1 << 0, /** The child is centered along the Y axis */ ASCenterLayoutSpecCenteringY = 1 << 1, /** Convenience option to center both along the X and Y axis */ ASCenterLayoutSpecCenteringXY = ASCenterLayoutSpecCenteringX | ASCenterLayoutSpecCenteringY }; /** * How much space the spec will take up. * * The default option will allow the spec to take up the maximum size possible. * Swift: use [] for the default behavior. */ typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecSizingOptions) { /** The spec will take up the maximum size possible */ ASCenterLayoutSpecSizingOptionDefault = ASRelativeLayoutSpecSizingOptionDefault, /** The spec will take up the minimum size possible along the X axis */ ASCenterLayoutSpecSizingOptionMinimumX = ASRelativeLayoutSpecSizingOptionMinimumWidth, /** The spec will take up the minimum size possible along the Y axis */ ASCenterLayoutSpecSizingOptionMinimumY = ASRelativeLayoutSpecSizingOptionMinimumHeight, /** Convenience option to take up the minimum size along both the X and Y axis */ ASCenterLayoutSpecSizingOptionMinimumXY = ASRelativeLayoutSpecSizingOptionMinimumSize }; NS_ASSUME_NONNULL_BEGIN /** Lays out a single layoutElement child and position it so that it is centered into the layout bounds. * NOTE: ASRelativeLayoutSpec offers all of the capabilities of Center, and more. * Check it out if you would like to be able to position the child at any corner or the middle of an edge. */ @interface ASCenterLayoutSpec : ASRelativeLayoutSpec @property (nonatomic) ASCenterLayoutSpecCenteringOptions centeringOptions; @property (nonatomic) ASCenterLayoutSpecSizingOptions sizingOptions; /** * Initializer. * * @param centeringOptions How the child is centered. * @param sizingOptions How much space will be taken up. * @param child The child to center. */ + (instancetype)centerLayoutSpecWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions child:(id<ASLayoutElement>)child NS_RETURNS_RETAINED AS_WARN_UNUSED_RESULT; @end NS_ASSUME_NONNULL_END
// // WYJForecastView.h // Jingjingweather // // Created by 王亚静 on 2017/5/5. // Copyright © 2017年 Wong. All rights reserved. // #import <UIKit/UIKit.h> @interface WYJForecastView : UIView @property (nonatomic, copy) NSArray *forecasts; @end
#pragma once #include <boost/noncopyable.hpp> #include "../OpenGLInclude.h" class LightFactory: boost::noncopyable { public: LightFactory() : m_currentLight(GL_LIGHT0) { } GLenum getNextLight() { m_currentLight++; return m_currentLight; } void returnLight(GLenum light) { // todo } private: int m_currentLight; };
// // WBLeaderBoardFavoriteDataSource.h // WestBlueGolf // // Created by Mike Harlow on 3/6/14. // Copyright (c) 2014 Mike Harlow. All rights reserved. // #import "WBLeaderBoardDataSource.h" @interface WBLeaderBoardFavoriteDataSource : WBLeaderBoardDataSource @end
//===--------------------------------------------------------------------------------*- C++ -*-===// // _____ _ // / ____| (_) // | (___ ___ __ _ _ _ ___ _ __ _ // \___ \ / _ \/ _` | | | |/ _ \| |/ _` | // ____) | __/ (_| | |_| | (_) | | (_| | // |_____/ \___|\__, |\__,_|\___/|_|\__,_| - Game Engine (2016-2017) // | | // |_| // // This file is distributed under the MIT License (MIT). // See LICENSE.txt for details. // //===------------------------------------------------------------------------------------------===// #ifndef SEQUOIA_ENGINE_RENDER_RENDERRESSOURCE_H #define SEQUOIA_ENGINE_RENDER_RENDERRESSOURCE_H #include "sequoia-engine/Core/Export.h" #include "sequoia-engine/Core/Mutex.h" #include "sequoia-engine/Core/NonCopyable.h" #include "sequoia-engine/Render/RenderSystemObject.h" #include <atomic> #include <exception> namespace sequoia { namespace render { /// @brief Ressource used by the RenderSystem such as Textures, Shaders and Programs /// /// @note All render ressources have a single invariant: *Once a Ressource is made valid, it remains /// valid throughout the lifetime of any object which references it*. /// /// @ingroup render class SEQUOIA_API RenderRessource : public RenderSystemObject, public NonCopyable { /// Is the ressource is valid? - Once a ressource has been declared valid, it remains valid /// throughout the lifetime of the object std::atomic<bool> valid_; /// Mutex used to modify the state of the object Mutex mutex_; /// Caught exception (if any) during the construction of the object std::exception_ptr exception_; public: RenderRessource(RenderSystemKind renderSystemKind) : RenderSystemObject(renderSystemKind), valid_(false), exception_(nullptr) {} virtual ~RenderRessource() {} /// @brief Check if the ressource is valid /// /// Once a ressource has been declared valid, it remains valid throughout the lifetime of /// the object. It is safe to call this function from any thread. /// /// @remark Thread-safe inline bool isValid() const noexcept { return valid_.load(); } /// @brief Make the ressource valid /// /// This converts the ressource into a valid state s.t `isValid() == true`. Any exceptions caught /// during the execution are stored and can be rethrown via `rethrowException()`. /// /// @remark Thread-safe void makeValid(); /// @brief Rethrow any stored exception /// /// It no exception was captured, this function does nothing. /// /// @remark Thread-safe void rethrowException(); /// @brief Check if an exception was captured inline bool hasException() const { return exception_ != nullptr; } protected: /// @brief Make the ressource ready virtual void makeValidImpl() = 0; }; } // namespace render } // namespace sequoia #endif
#include <stdio.h> #include "minunit.h" #include "FIZZBUZZ.h" #define KNRM "\x1B[0m" #define KRED "\x1B[31m" #define KGRN "\x1B[32m" #define KYEL "\x1B[33m" #define KBLU "\x1B[34m" #define KMAG "\x1B[35m" #define KCYN "\x1B[36m" #define KWHT "\x1B[37m" #define RESET "\033[0m" int testsRun = 0; static char * testUnit() { muAssert("error, testUnit 1 != 1", 1 == 1); return 0; } static char * allTests() { muRunTest(testUnit); return 0; } int main(int argc, char **argv) { char *result = allTests(); if (result != 0) { printf("-_-_-_-_-_-_-_,------, o \n"); printf("_-_-_-_-_-_-_-| /\\_/\\ \n"); printf("-_-_-_-_-_-_-~|__( X .X) + + \n"); printf("_-_-_-_-_-_-_- \"\" \"\" \n"); printf(KRED "✗ %s \n" RESET, result); } else { printf("-_-_-_-_-_-_-_,------, o \n"); printf("_-_-_-_-_-_-_-| /\\_/\\ \n"); printf("-_-_-_-_-_-_-~|__( ^ .^) + + \n"); printf("_-_-_-_-_-_-_- \"\" \"\" \n"); printf(KGRN " ✓ ALL TESTS PASSED \n" RESET); } printf("Tests run: %d\n", testsRun); return result != 0; }
// // PicView.h // BirdFight // // Created by 聚米 on 16/11/7. // Copyright © 2016年 聚米. All rights reserved. // #import <UIKit/UIKit.h> typedef void (^TapBlcok)(NSInteger index,NSArray *dataSource,NSIndexPath *indexpath); @interface PicView : UIView @property (nonatomic, copy)TapBlcok tapBlock; @property (nonatomic, copy)NSIndexPath *indexpath; /** * 九宫格显示的数据源,dataSource中可以放UIImage对象和NSString(http://sjfjfd.cjf.jpg),还有NSURL也可以 */ @property (nonatomic, retain)NSArray * dataSource; /** * Description 九宫格 * * @param frame frame * @param dataSource 数据源 * @return JGGView对象 */ - (instancetype)initWithFrame:(CGRect)frame dataSource:(NSArray *)dataSource completeBlock:(TapBlcok )tapBlock; /** * Description 九宫格 * * @param dataSource 数据源 */ -(void)PicView:(PicView *)picView DataSource:(NSArray *)dataSource completeBlock:(TapBlcok)tapBlock; /** * 配置图片的宽(正方形,宽高一样) * * @return 宽 */ +(CGFloat)imageWidth; /** * 配置图片的高(正方形,宽高一样) * * @return 高 */ +(CGFloat)imageHeight; @end
/* * Open Surge Engine * loop.h - loop system * Copyright (C) 2011 Alexandre Martins <alemartf(at)gmail(dot)com> * http://opensnc.sourceforge.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _LOOP_H #define _LOOP_H #include "../item.h" /* public methods */ item_t* loopgreen_create(); item_t* loopyellow_create(); #endif
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "UIView.h" #import "MPVolumeControllerDelegate-Protocol.h" @class MPVolumeController, NSTimer, UISlider; @interface MPUMediaControlsVolumeView : UIView <MPVolumeControllerDelegate> { UIView *_warningView; _Bool _warningIndicatorBlinking; NSTimer *_warningBlinkTimer; NSTimer *_volumeCommitTimer; long long _style; UISlider *_slider; MPVolumeController *_volumeController; } @property(readonly, nonatomic) MPVolumeController *volumeController; // @synthesize volumeController=_volumeController; @property(readonly, nonatomic) UISlider *slider; // @synthesize slider=_slider; @property(readonly, nonatomic) long long style; // @synthesize style=_style; - (void).cxx_destruct; - (void)_stopBlinkingWarningView; - (void)_layoutVolumeWarningView; - (void)_blinkWarningView; - (void)_beginBlinkingWarningView; - (id)_warningTrackImage; - (id)_createVolumeSliderView; - (void)_commitCurrentVolumeValue; - (void)_stopVolumeCommitTimer; - (void)_beginVolumeCommitTimer; - (void)_volumeSliderStoppedChanging:(id)arg1; - (void)_volumeSliderValueChanged:(id)arg1; - (void)_volumeSliderBeganChanging:(id)arg1; - (_Bool)_shouldStartBlinkingVolumeWarningIndicator; - (void)volumeController:(id)arg1 volumeWarningStateDidChange:(long long)arg2; - (void)volumeController:(id)arg1 EUVolumeLimitEnforcedDidChange:(_Bool)arg2; - (void)volumeController:(id)arg1 EUVolumeLimitDidChange:(float)arg2; - (void)volumeController:(id)arg1 volumeValueDidChange:(float)arg2; - (struct CGSize)sizeThatFits:(struct CGSize)arg1; - (void)layoutSubviews; - (void)updateSystemVolumeLevel; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1; - (id)initWithStyle:(long long)arg1; @end
/* * Generated by class-dump 3.3.3 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard. */ #import "Assistant.h" @class ActivityMonitor, NSButton, NSProgressIndicator, NSTextField, NSTimer, NSView; @interface LibraryImportAssistant : Assistant { NSView *_introView; NSView *_patienceView; NSView *_doneView; NSView *_errorView; NSView *_recoveryIntroView; NSTextField *_mailboxStatusField; NSTextField *_messageStatusField; NSTextField *_timeRemainingField; NSProgressIndicator *_progressBar; NSButton *_showNewFeaturesButton; NSTextField *_newFeaturesTextField; ActivityMonitor *_activityMonitor; NSTimer *_updateTimer; long long _state; BOOL _importWasSuccessful; BOOL _accountsAreNewlyCreated; } - (id)initWithAssistentManager:(id)arg1; - (void)dealloc; - (void)setAccountsAreNewlyCreated:(BOOL)arg1; - (void)start; - (void)stop; - (void)_permissionErrorSheetDone:(id)arg1 returnCode:(long long)arg2 contextInfo:(void *)arg3; - (BOOL)_checkAccountDirectoryPermissions; - (void)goForward; - (id)windowTitle; - (void)updateProgress:(id)arg1; - (double)runningAverageWithNewValue:(double)arg1; - (id)formattedTimeForSeconds:(double)arg1; - (void)synchronouslyDoTheImport; - (void)showNewFeatures:(id)arg1; @end
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include "omahaodds.h" int main( int argc, char *argv[] ) { card *hand = malloc(sizeof(card) * 5); get_hand_rank(hand); return 0; }
/* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors * Copyright (C) 2006-2013 Kim Woelders * * 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 of the Software, its documentation and marketing & publicity * materials, and acknowledgment shall be given in the documentation, materials * and software packages that this Software was used. * * 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" #include "eobj.h" #include "iclass.h" #include "progress.h" #include "tclass.h" #include "xwin.h" struct _progressbar { EObj *win; EObj *n_win; EObj *p_win; int w, h; int value; ImageClass *ic; TextClass *tc, *tnc; }; static int pnum = 0; static Progressbar **plist = NULL; Progressbar * ProgressbarCreate(const char *name, int w, int h) { Progressbar *p; int x, y, tw, th; EImageBorder *pad; p = ECALLOC(Progressbar, 1); pnum++; plist = EREALLOC(Progressbar *, plist, pnum); plist[pnum - 1] = p; p->ic = ImageclassAlloc("PROGRESS_BAR", 1); p->tc = TextclassAlloc("PROGRESS_TEXT", 1); p->tnc = TextclassAlloc("PROGRESS_TEXT_NUMBER", 1); pad = ImageclassGetPadding(p->ic); TextSize(p->tc, 0, 0, 0, name, &tw, &th, 0); if (h < th + pad->top + pad->bottom) h = th + pad->top + pad->bottom; p->w = w; p->h = h; p->value = 0; x = (WinGetW(VROOT) - w) / 2; y = 32 + (pnum * h * 2); p->win = EobjWindowCreate(EOBJ_TYPE_MISC, x, y, w - (h * 5), h, 1, name); p->n_win = EobjWindowCreate(EOBJ_TYPE_MISC, x + w - (h * 5), y, (h * 5), h, 1, "pn"); p->p_win = EobjWindowCreate(EOBJ_TYPE_MISC, x, y + h, 1, h, 1, "pp"); if (!p->win || !p->n_win || !p->p_win) { ProgressbarDestroy(p); return NULL; } p->win->shadow = 1; p->n_win->shadow = 1; p->p_win->shadow = 1; return p; } void ProgressbarDestroy(Progressbar * p) { int i, j, dy; dy = 2 * p->h; EobjWindowDestroy(p->win); EobjWindowDestroy(p->n_win); EobjWindowDestroy(p->p_win); for (i = 0; i < pnum; i++) { if (plist[i] != p) continue; for (j = i; j < pnum - 1; j++) { Progressbar *pp; pp = plist[j + 1]; plist[j] = pp; EobjMove(pp->win, EobjGetX(pp->win), EobjGetY(pp->win) - dy); EobjMove(pp->n_win, EobjGetX(pp->n_win), EobjGetY(pp->n_win) - dy); EobjMove(pp->p_win, EobjGetX(pp->p_win), EobjGetY(pp->p_win) - dy); } break; } ImageclassFree(p->ic); TextclassFree(p->tc); TextclassFree(p->tnc); Efree(p); pnum--; if (pnum <= 0) { pnum = 0; _EFREE(plist); } else { plist = EREALLOC(Progressbar *, plist, pnum); } } void ProgressbarSet(Progressbar * p, int progress) { int w; char s[64]; EImageBorder *pad; if (progress == p->value) return; p->value = progress; w = (p->value * p->w) / 100; if (w < 1) w = 1; if (w > p->w) w = p->w; Esnprintf(s, sizeof(s), "%i%%", p->value); EobjResize(p->p_win, w, p->h); ImageclassApply(p->ic, EobjGetWin(p->p_win), 1, 0, STATE_NORMAL, ST_SOLID); EobjShapeUpdate(p->p_win, 0); pad = ImageclassGetPadding(p->ic); EClearWindow(EobjGetWin(p->n_win)); TextDraw(p->tnc, EobjGetWin(p->n_win), NoXID, 0, 0, STATE_CLICKED, s, pad->left, pad->top, p->h * 5 - (pad->left + pad->right), p->h - (pad->top + pad->bottom), p->h - (pad->top + pad->bottom), TextclassGetJustification(p->tnc)); /* Hack - We may not be running in the event loop here */ EobjDamage(p->n_win); } void ProgressbarShow(Progressbar * p) { EImageBorder *pad; ImageclassApply(p->ic, EobjGetWin(p->win), 0, 0, STATE_NORMAL, ST_SOLID); ImageclassApply(p->ic, EobjGetWin(p->n_win), 0, 0, STATE_CLICKED, ST_SOLID); ImageclassApply(p->ic, EobjGetWin(p->p_win), 1, 0, STATE_NORMAL, ST_SOLID); EobjMap(p->win, 0); EobjMap(p->n_win, 0); EobjMap(p->p_win, 0); pad = ImageclassGetPadding(p->ic); TextDraw(p->tc, EobjGetWin(p->win), NoXID, 0, 0, STATE_NORMAL, EobjGetName(p->win), pad->left, pad->top, p->w - (p->h * 5) - (pad->left + pad->right), p->h - (pad->top + pad->bottom), p->h - (pad->top + pad->bottom), TextclassGetJustification(p->tnc)); }
/* ** A stack implemented with a dynamically allocated array. ** The array size is given when create is called, which must ** happen before any other stack operations are attempted. */ #include "stack.h" #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <assert.h> /* ** The array that holds the values on the stack, and a pointer ** to the topmost value on the stack. */ static STACK_TYPE *stack; static size_t stack_size; static int top_element = -1; /* ** create_stack */ void create_stack( size_t size ) { assert( stack_size == 0 ); stack_size = size; stack = malloc( stack_size * sizeof( STACK_TYPE ) ); assert( stack != NULL ); } /* ** destroy_stack */ void destroy_stack( void ) { assert( stack_size > 0 ); stack_size = 0; free( stack ); stack = NULL; } /* ** push */ void push( STACK_TYPE value ) { assert( !is_full() ); top_element += 1; stack[ top_element ] = value; } /* ** pop */ void pop( void ) { assert( !is_empty() ); top_element -= 1; } /* ** top */ STACK_TYPE top( void ) { assert( !is_empty() ); return stack[ top_element ]; } /* ** is_empty */ int is_empty( void ) { assert( stack_size > 0 ); return top_element == -1; } /* ** is_full */ int is_full( void ) { assert( stack_size > 0 ); return top_element == stack_size - 1; }
// // ElementView.h // MobileFramework // // Created by Think on 14-5-27. // Copyright (c) 2014年 wt. All rights reserved. // #import <UIKit/UIKit.h> #import "NodeVO.h" @protocol elementDelegate <NSObject> -(void)selectButton:(NodeVO *)vo; @end @interface ElementView : UIView<UIGestureRecognizerDelegate> @property (nonatomic, strong) NodeVO *data; @property (nonatomic, strong) UIView *mainView; @property (nonatomic, strong) UIButton *image; @property (nonatomic, strong) UILabel *label; @property (nonatomic,retain)id<elementDelegate>delegate; - (id)initWithFrame:(CGRect)frame name:(NodeVO *)gridData; - (void)setupFrame; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "SBIcon.h" @interface SBIcon (SBFolderIcon) - (_Bool)hasFolderIconView; - (id)folder; - (_Bool)isFolderIcon; @end
#ifndef __EEPROM_H #define __EEPROM_H #include "ConfigApp.h" #include "GenericTypeDefs.h" #include "Compiler.h" #define SPI_WRT_STATUS 0x01 #define SPI_WRITE 0x02 #define SPI_READ 0x03 #define SPI_DIS_WRT 0x04 #define SPI_RD_STATUS 0x05 #define SPI_EN_WRT 0x06 #define EEPROM_MAC_ADDR 0xFA void EEPROMRead(BYTE *dest, BYTE addr, BYTE count); #endif
/* Fontname: -FreeType-PC Senior-Medium-R-Normal--8-80-72-72-P-48-ISO10646-1 Copyright: TrueType conversion © 2001 codeman38. Glyphs: 18/260 BBX Build Mode: 3 */ const uint8_t u8g2_font_pcsenior_8n[237] U8X8_FONT_SECTION("u8g2_font_pcsenior_8n") = "\22\3\3\3\4\4\1\2\5\10\7\0\376\6\376\6\377\0\0\0\0\0\324 \7\210\301\307\277\0*\15" "\210\301\7\251\221\16!\232H\216\6+\14\210\301\207\211\205F\261\34\31\0,\11\210\301\307\7\261T\12" "-\11\210\301\307f\307\31\0.\11\210\301\307\7\261\34\12/\11\210\301\325\347\70\12\0\60\20\210\301)" "\311$\242\211\204E\62\22\325a\0\61\12\210\301\222\216u\264\303\0\62\16\210\301\241\211\304\302\241T$" "\262\303\0\63\16\210\301\241\211\304\302\71@\244F\7\2\64\15\210\301\33\322$\42\245\253\224\16\2\65\15" "\210\301\60\211\353\0\261H\215\16\4\66\15\210\301\32J\305\65\221\66:\20\0\67\13\210\301\60)K\225" "\325\241\0\70\15\210\301\241\211\264\321D\332\350@\0\71\15\210\301\241\211\264\225\245\302\71\24\0:\14\210" "\301\207\211\345X\304r(\0\0\0\0";
#ifndef __CF_TIMER_H_ #define __CF_TIMER_H_ #include <stdint.h> #include <stdlib.h> #include "cf_object_pool.h" #include "cf_list.h" typedef void(*time_cb_f)(void* param, uint32_t timer_id); typedef void(*free_param_f)(void* param); typedef struct { uint32_t id; uint64_t ts; /*³¬Ê±Ê±¼ä*/ void* param; time_cb_f cb; free_param_f free_cb; uint32_t magic; }timer_node_t; typedef struct { size_t size; /*IDÊý×éµÄ³¤¶È*/ uint32_t pos; uint32_t number; /*ÓÐЧµÄtime node¸öÊý*/ ob_pool_t* pool; /*timer node pool*/ timer_node_t** array; /*time IDÓëtimer_nodeµÄ¶ÔÓ¦¹ØÏµ*/ }timer_node_pool_t; #define RING_SIZE 1024 typedef struct { timer_node_pool_t* node_pool; uint64_t prev_ts; /*ÉÏÒ»´ÎÂÖתµÄʱ¼ä´Á*/ int first_pos; int second_pos; uint32_t* first_ring[RING_SIZE]; uint32_t* second_ring[RING_SIZE]; }cf_timer_t; cf_timer_t* create_timer(); void destroy_timer(cf_timer_t* timer); uint32_t add_timer(cf_timer_t* timer, void* param, time_cb_f cb, uint32_t delay); void cancel_timer(cf_timer_t* timer, uint32_t id); uint32_t reset_timer(cf_timer_t* timer, uint32_t id, uint32_t delay); void expire_timer(cf_timer_t* timer); #endif
#pragma once #include "PoolAllocatorTest.h" #include "StackAllocatorTest.h" #include "GeneralPurposeAllocatorTest.h" #include "DefragmentationAllocatorTest.h" #include "StringTest.h" #include "DataStructures/ListTest.h" #include "DataStructures/HashMapTest.h" #include "DataStructures/StackTest.h" #include "DataStructures/ArrayTest.h" #include "DataStructures/DynamicArrayTest.h" #include "BBE/UtilTest.h" #include "UniquePointerTest.h" #include "Matrix4Test.h" #include "MathTest.h" #include "Vector2Test.h" #include "Vector3Test.h" #include "LinearCongruentialGeneratorTest.h" #include "ImageTest.h" namespace bbe { namespace test { void runAllTests() { std::cout << "Starting Tests!" << std::endl; Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing PoolAllocator" << std::endl; bbe::test::testPoolAllocator(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing StackAllocator" << std::endl; bbe::test::testStackAllocator(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing GeneralPurposeAllocator" << std::endl; bbe::test::testGeneralPurposeAllocator(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing DefragmentationAllocaotr" << std::endl; bbe::test::testDefragmentationAllocator(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing String" << std::endl; bbe::test::testString(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing List" << std::endl; bbe::test::testList(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing HashMap" << std::endl; bbe::test::testHashMap(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing Stack" << std::endl; bbe::test::testStack(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing UniquePointer" << std::endl; bbe::test::testUniquePointer(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing Array" << std::endl; bbe::test::testArray(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing DynamicArray" << std::endl; bbe::test::testDynamicArray(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing testMatrix4" << std::endl; bbe::test::testMatrix4(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing testMath" << std::endl; bbe::test::testMath(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing Vector2" << std::endl; bbe::test::testVector2(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing Vector3" << std::endl; bbe::test::testVector3(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing LinearCongruentialGenerator" << std::endl; bbe::test::testLinearCongruentailGenerators(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "Testing Image" << std::endl; bbe::test::testImage(); Person::checkIfAllPersonsWereDestroyed(); std::cout << "All Tests complete!" << std::endl; } } }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <DTGraphKit/DTGraph.h> @interface DTBarGraph : DTGraph { BOOL _hasWidthOrSpacingAttribute; long long _maxX; long long _minX; long long _maxY; long long _calculatedYAxisLabelHeight; long long _lastMaximumYValue; } + (id)sortEntries:(id)arg1 keyPath:(id)arg2; @property long long lastMaximumYValue; // @synthesize lastMaximumYValue=_lastMaximumYValue; - (BOOL)validateModel:(id)arg1; - (id)_divisionsForContentMagnitude:(double)arg1 start:(double)arg2 min:(long long)arg3 max:(long long)arg4 spacing:(double)arg5 keypath:(id)arg6 onlyStartAndEnd:(BOOL)arg7; - (id)_entries:(id)arg1 fittingIntoRect:(struct CGRect)arg2; - (id)sortedEntries:(id)arg1 fittingIntoRect:(struct CGRect)arg2; - (id)visibleEntries:(id)arg1; - (unsigned long long)numberOfBars; - (unsigned long long)numberOfEntriesThatFitRect:(struct CGRect)arg1; - (long long)maximumYValue; - (long long)_maximumValueOfSeries:(id)arg1; - (long long)minimumXValue; - (long long)maximumXValue; - (BOOL)hasBarSpacing; @property(readonly) double barSpacing; @property(readonly) double barWidth; - (struct CGRect)contentFrame; - (void)clearCache; - (id)initWithFrame:(struct CGRect)arg1; - (id)textAttributesForAxisLabels; - (double)widthToFill:(struct CGRect)arg1 numberOfEntries:(unsigned long long)arg2; - (id)divisionPositionsYAxis; - (id)divisionPositionsXAxis; @property(readonly) double yAxisSpacing; @property(readonly) double xAxisSpacing; - (void)getXAxisRect:(struct CGRect *)arg1 yAxisRect:(struct CGRect *)arg2; - (double)calculateVerticalBorderBuffer; - (double)calculateHorizontalBorderBuffer; - (struct CGRect)calculateXAxisBoundsWithinBounds:(struct CGRect)arg1; - (struct CGRect)calculateYAxisBoundsWithinBounds:(struct CGRect)arg1; - (void)drawXAxis:(struct CGRect)arg1; - (void)drawYAxis:(struct CGRect)arg1; - (void)drawBorder:(struct CGRect)arg1; - (BOOL)canDrawBeyondContentRect; - (void)drawContent:(struct CGRect)arg1; - (void)drawBackground:(struct CGRect)arg1; - (void)drawRect:(struct CGRect)arg1; @end
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ #pragma once #include "PredictionContext.h" namespace antlr4 { namespace atn { class ANTLR4CPP_PUBLIC SingletonPredictionContext : public PredictionContext { public: // Usually a parent is linked via a weak ptr. Not so here as we have kinda reverse reference chain. // There are no child contexts stored here and often the parent context is left dangling when it's // owning ATNState is released. In order to avoid having this context released as well (leaving all other contexts // which got this one as parent with a null reference) we use a shared_ptr here instead, to keep those left alone // parent contexts alive. const Ref<PredictionContext> parent; const size_t returnState; SingletonPredictionContext(Ref<PredictionContext> const& parent, size_t returnState); virtual ~SingletonPredictionContext() {}; static Ref<SingletonPredictionContext> create(Ref<PredictionContext> const& parent, size_t returnState); virtual size_t size() const override; virtual Ref<PredictionContext> getParent(size_t index) const override; virtual size_t getReturnState(size_t index) const override; virtual bool operator == (const PredictionContext &o) const override; virtual std::string toString() const override; }; } // namespace atn } // namespace antlr4
// // UIColor+SZGradient.h // SZCategories // // Created by 陈圣治 on 16/6/21. // Copyright © 2016年 陈圣治. All rights reserved. // #import <UIKit/UIKit.h> @interface UIColor (SZGradient) //渐变 + (UIColor *)sz_gradientFromColor:(UIColor *)fromColor toColor:(UIColor *)toColor withHeight:(int)height; @end
#ifndef GL_HELPER_H #define GL_HELPER_H #include <OpenGL/OpenGL.h> #include <GLUT/GLUT.h> #include "SOIL.h" #include <map> #include <string> #include <iostream> using namespace std; class gl_helper { private: /**************************************************************** public ****************************************************************/ public: gl_helper() { } ~gl_helper() { } // Draws a texture onto a simple square by using 2 triangles. // Inputs: // texture: Given texture. // tx: Translation in x. // ty: Translation in y. // x: // y: // xw: // yh: static void draw_texture(GLuint texture, double tx, double ty, int x, int y, int xw, int yh) { glPushMatrix(); glTranslatef(tx,ty,0.f); glBindTexture(GL_TEXTURE_2D,texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); glBegin(GL_TRIANGLES); glTexCoord2f(0.0f, 0.0f); glVertex2i(x,y); glTexCoord2f(1.0f, 0.0f); glVertex2i(xw,y); glTexCoord2f(1.0f, 1.0f); glVertex2i(xw,yh); glTexCoord2f(0.0f, 0.0f); glVertex2i(x,y); glTexCoord2f(0.0f, 1.0f); glVertex2i(x,yh); glTexCoord2f(1.0f, 1.0f); glVertex2i(xw,yh); glEnd(); glPopMatrix(); } // Draws a quad. // Inputs: // tx: Translation in x. // ty: Translation in y. // x: // y: // xw: // yh: // color: Static array of 3 specifying the color. static void draw_quad(double tx, double ty, int x, int y, int xw, int yh, float color[3]) { glPushMatrix(); glBindTexture(GL_TEXTURE_2D,0); glTranslatef(tx,ty,0.f); glLineWidth(1.f); glColor3f(color[0],color[1],color[2]); glBegin(GL_QUADS); glVertex2i(xw,yh); glVertex2i(xw,y); glVertex2i(x,y); glVertex2i(x,yh); glEnd(); glPopMatrix(); } }; #endif /* GL_HELPER_H */
/* * SeriouslyConstants.h * Seriously * * Created by Corey Johnson on 7/6/10. * Copyright 2010 Probably Interactive. All rights reserved. * */ @class SeriouslyOperation; @class SeriouslyOAuthOperation; typedef void(^SeriouslyHandler)(id data, NSHTTPURLResponse *response, NSError *error); typedef void(^SeriouslyProgressHandler)(float progress, double downloadSpeed, NSTimeInterval secondsRemaining, NSData *data); extern const NSString *kSeriouslyMethod; extern const NSString *kSeriouslyTimeout; extern const NSString *kSeriouslyHeaders; extern const NSString *kSeriouslyBody; extern const NSString *kSeriouslyProgressHandler; extern const NSString *kSeriouslyCachePolicy; extern const NSString *kSeriouslyPostDictionary;
#ifndef MERCURY_INI_H #define MERCURY_INI_H #include <map> #include <vector> #include "MercuryString.h" #if defined(WIN32) #define PROPERRETURN "\r\n" #else #define PROPERRETURN "\n" #endif ///Framework for INI files class MercuryINI { public: MercuryINI( ) { m_bSaveOnExit = false; } MercuryINI( const MString &sFileName, bool bSaveOnExit ); ~MercuryINI( ); ///Open a INI from a file; bAddIncludes specifies whether or not to look at [AdditionalFiles], bClearToStart states whether or not all data should be erased when starting bool Open( const MString &sFileName, bool bAddIncludes = true, bool bClearToStart = false ); ///Load an INI from a given c-style string bool Load( const char * sIniText, long slen ); ///Load an INI from a given string bool Load( const MString &sIniText ) { return Load( sIniText.c_str(), sIniText.length() ); } ///Save the INI file bool Save( const MString sFileName = "" ); ///Dump the file into the incoming MString void Dump( MString & data ); ///Dump the file into then c-style string, this will also allocate ram. long Dump( char * & toDump ); ///Enumerate all keys in this ini file into keys void EnumerateKeys( std::vector< MString > &keys ); ///Enumerate all values in the given key to values. void EnumerateValues( const MString &key, std::vector< MString > &values ); ///Enumerate all values in the given key to a map. void EnumerateValues( const MString &key, std::map< MString, MString > & values ) { values = m_mDatas[key]; } ///Return string value, blank if non-existant MString GetValueS( const MString &key, const MString &value, MString sDefaultValue="", bool bMakeValIfNoExist=false ); ///Return long value, 0 if non-existant long GetValueI( const MString &key, const MString &value, long iDefaultValue=0, bool bMakeValIfNoExist=false ); ///Return float value, 0 if non-existant float GetValueF( const MString &key, const MString &value, float fDefaultValue=0, bool bMakeValIfNoExist=false ); ///Return bool value, 0 if non-existant bool GetValueB( const MString &key, const MString &value, bool bDefaultValue=0, bool bMakeValIfNoExist=false ); ///Return value through data, false if non-existant bool GetValue( const MString &key, const MString &value, MString &data ); ///Set a value void SetValue( const MString &key, const MString &value, const MString &data ); ///Remove a value bool RemoveValue( const MString &key, const MString &value ); ///Get the last error. MString GetLastError() { return m_sLastError; } private: ///[internal] save all of the values when this ini file is destroyed bool m_bSaveOnExit; MString m_sLastError; MString m_sFileName; std::map< MString, std::map< MString, MString > > m_mDatas; std::map< MString, bool > m_mLoaded; }; ///Instantiation of mercury.ini extern MercuryINI * PREFSMAN; ///Check to see if Prefsman was set up. /** If you are using PREFSMAN in a static time initiation, you should execute this function first. */ inline void CheckPREFSMANSetup() { if ( PREFSMAN == NULL ) PREFSMAN = new MercuryINI( "Mercury.ini", true ); } ///Dump data into the file filename. bytes specifies the length of data. Returns true if successful, false else. bool DumpToFile( const MString & filename, const char * data, long bytes ); ///Dump data from a file into a char * and return the size of data. If -1 then there was an error opening the file. long DumpFromFile( const MString & filename, char * & data ); ///Bytes until desired terminal long BytesUntil( const char* strin, const char * termin, long start, long slen, long termlen ); ///Bytes until something other than a terminal long BytesNUntil( const char* strin, const char * termin, long start, long slen, long termlen ); ///Convert string containing binary characters to C-style formatted string. MString ConvertToCFormat( const MString & ncf ); #endif /* * Copyright (c) 2005-2006, Charles Lohr * All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * - Neither the name of the Mercury Engine nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
// // EXTRuntimeExtensions.h // extobjc // // Created by Justin Spahr-Summers on 2011-03-05. // Copyright (C) 2012 Justin Spahr-Summers. // Released under the MIT license. // #import <objc/runtime.h> /** * Describes the memory management policy of a property. */ typedef enum { /** * The value is assigned. */ wt_propertyMemoryManagementPolicyAssign = 0, /** * The value is retained. */ wt_propertyMemoryManagementPolicyRetain, /** * The value is copied. */ wt_propertyMemoryManagementPolicyCopy } wt_propertyMemoryManagementPolicy; /** * Describes the attributes and type information of a property. */ typedef struct { /** * Whether this property was declared with the \c readonly attribute. */ BOOL readonly; /** * Whether this property was declared with the \c nonatomic attribute. */ BOOL nonatomic; /** * Whether the property is a weak reference. */ BOOL weak; /** * Whether the property is eligible for garbage collection. */ BOOL canBeCollected; /** * Whether this property is defined with \c \@dynamic. */ BOOL dynamic; /** * The memory management policy for this property. This will always be * #wt_propertyMemoryManagementPolicyAssign if #readonly is \c YES. */ wt_propertyMemoryManagementPolicy memoryManagementPolicy; /** * The selector for the getter of this property. This will reflect any * custom \c getter= attribute provided in the property declaration, or the * inferred getter name otherwise. */ SEL getter; /** * The selector for the setter of this property. This will reflect any * custom \c setter= attribute provided in the property declaration, or the * inferred setter name otherwise. * * @note If #readonly is \c YES, this value will represent what the setter * \e would be, if the property were writable. */ SEL setter; /** * The backing instance variable for this property, or \c NULL if \c * \c @synthesize was not used, and therefore no instance variable exists. This * would also be the case if the property is implemented dynamically. */ const char *ivar; /** * If this property is defined as being an instance of a specific class, * this will be the class object representing it. * * This will be \c nil if the property was defined as type \c id, if the * property is not of an object type, or if the class could not be found at * runtime. */ Class objectClass; /** * The type encoding for the value of this property. This is the type as it * would be returned by the \c \@encode() directive. */ char type[]; } wt_propertyAttributes; /** * Returns a pointer to a structure containing information about \a property. * You must \c free() the returned pointer. Returns \c NULL if there is an error * obtaining information from \a property. */ wt_propertyAttributes *wt_copyPropertyAttributes(objc_property_t property);
#ifndef NEWCONNECTIONDIALOG_H #define NEWCONNECTIONDIALOG_H #include <QDialog> #include <QCanBusDeviceInfo> #include <QSerialPortInfo> #include <QDebug> #include <QUdpSocket> #include "canconnectionmodel.h" #include "connections/canconnection.h" namespace Ui { class NewConnectionDialog; } class NewConnectionDialog : public QDialog { Q_OBJECT public: explicit NewConnectionDialog(QVector<QString>* gvretips, QVector<QString>* kayakips, QWidget *parent = nullptr); ~NewConnectionDialog(); CANCon::type getConnectionType(); QString getPortName(); QString getDriverName(); public slots: void handleConnTypeChanged(); void handleDeviceTypeChanged(); void handleCreateButton(); private: Ui::NewConnectionDialog *ui; QList<QSerialPortInfo> ports; QList<QCanBusDeviceInfo> canDevices; QVector<QString>* remoteDeviceIPGVRET; QVector<QString>* remoteBusKayak; void selectSerial(); void selectKvaser(); void selectSocketCan(); void selectRemote(); void selectKayak(); void selectMQTT(); bool isSerialBusAvailable(); void setPortName(CANCon::type pType, QString pPortName, QString pDriver); }; #endif // NEWCONNECTIONDIALOG_H
// // Created by agondek on 12/01/16. // #ifndef GUT_MONTE_CARLO_TREE_SEARCH_WITHUCTSORTROOTPARALLELIZATION_H #define GUT_MONTE_CARLO_TREE_SEARCH_WITHUCTSORTROOTPARALLELIZATION_H #include "../MctsCommon.h" #include "../games/IGameState.h" #include "../tree/Node.h" #include "../utils/OmpHelpers.h" namespace Mcts { namespace Playouts { std::string getBestMoveUsingUctSortRootParallelization( Mcts::GameStates::IGameState* rootState, int maximumIterations); } } #endif //GUT_MONTE_CARLO_TREE_SEARCH_WITHUCTSORTROOTPARALLELIZATION_H
#ifndef FSL_CACHE_H #define FSL_CACHE_H #define FSL_IO_CACHE_ENTS 512 /* 16KB */ //#define FSL_IO_CACHE_ENTS (4097) #define FSL_IO_CACHE_BYTES 32 #define FSL_IO_CACHE_BITS (FSL_IO_CACHE_BYTES*8) #define byte_to_line(x) ((x)/FSL_IO_CACHE_BYTES) #define bit_to_line(x) ((x)/FSL_IO_CACHE_BITS) #define byte_to_cache_addr(x) byte_to_line(x)*FSL_IO_CACHE_BITS struct fsl_io_cache_ent { uint64_t ce_addr; /* line address */ uint64_t ce_misses; uint64_t ce_hits; uint8_t ce_data[FSL_IO_CACHE_BYTES]; }; struct fsl_io_cache { uint64_t ioc_misses; uint64_t ioc_hits; struct fsl_io_cache_ent ioc_ents[FSL_IO_CACHE_ENTS]; }; void fsl_io_cache_uninit(struct fsl_io_cache* ioc); void fsl_io_cache_init(struct fsl_io_cache* ioc); uint64_t fsl_io_cache_get(struct fsl_rt_io* io, uint64_t bit_off, int num_bits); void fsl_io_cache_drop_bytes( struct fsl_rt_io* io, uint64_t byte_off, uint64_t num_bytes); #endif
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <SAObjects/SASettingGetBool.h> @interface SASettingGetDoNotDisturb : SASettingGetBool { } + (id)getDoNotDisturbWithDictionary:(id)arg1 context:(id)arg2; + (id)getDoNotDisturb; - (_Bool)requiresResponse; - (id)encodedClassName; - (id)groupIdentifier; @end
// Generated by xsd compiler for ios/objective-c // DO NOT CHANGE! #import <Foundation/Foundation.h> #import "PicoClassSchema.h" #import "PicoPropertySchema.h" #import "PicoConstants.h" #import "PicoBindable.h" #import "Finding_BaseFindingServiceRequest.h" @class Finding_ProductId; @class Finding_ItemFilter; /** Returns items based on a product base on ISBN, UPC, EAN, or ePID (eBay Product Reference ID). @ingroup FindingServicePortType */ @interface Finding_FindItemsByProductRequest : Finding_BaseFindingServiceRequest { @private Finding_ProductId *_productId; NSMutableArray *_itemFilter; NSMutableArray *_outputSelector; } /** Input ISBN, UPC, EAN, or ReferenceID (ePID) to specify the type of product for which you want to search. <br><br> For example, to search using an ISBN, specify productID.type=ISBN and set productID.value to an ISBN value. To search using an eBay Product Reference ID, set <b class="con">productId.type</b> to "ReferenceID" and set <b class="con">productId.value</b> to an ePID value (also known as an Bay Product Reference ID). If you do not know the ePID value for a product, use <b class="con">FindProducts</b> in the eBay Shopping API to retrieve the desired ePID. type : class Finding_ProductId */ @property (nonatomic, strong) Finding_ProductId *productId; /** Reduce the number of items returned by a find request using item filters. Use <b class="con">itemFilter</b> to specify name/value pairs. You can include multiple item filters in a single request. entry type : class Finding_ItemFilter */ @property (nonatomic, strong) NSMutableArray *itemFilter; /** Defines what data to return, in addition to the default set of data, in a response. <br><br> If you don't specify this field, eBay returns a default set of item fields. Use outputSelector to include more information in the response. The additional data is grouped into discrete nodes. You can specify multiple nodes by including this field multiple times, as needed, in the request. <br><br> If you specify this field, the additional fields returned can affect the call's response time (performance), including in the case with feedback data. entry type : string constant in Finding_OutputSelectorType.h */ @property (nonatomic, strong) NSMutableArray *outputSelector; @end
// // ARNLiveBlurView.h // ARNLiveBlurView // // Created by Airin on 2014/05/22. // Copyright (c) 2014 Airin. All rights reserved. // #import <UIKit/UIKit.h> @class ARNLiveBlurView; typedef void (^ARNObservingScrollViewBlock) (ARNLiveBlurView *blurredView, UIScrollView *observingView); @interface ARNLiveBlurView : UIView @property (nonatomic, assign) CGFloat blurRadius; @property (nonatomic, assign) CGFloat saturationDelta; @property (nonatomic, copy) UIColor *tintColor; @property (nonatomic, weak) UIView *viewToBlur; - (void)updateBlur; - (void)setObservingScrollView:(UIScrollView *)observingScrollView observingBlock:(ARNObservingScrollViewBlock)observingBlock; @end
// // Created by Neo on 16/9/13. // #ifndef RAYTRACING_CL_GRADIENT_H #define RAYTRACING_CL_GRADIENT_H #include <string> #include "cl_utils/context.h" #include "cl_utils/kernel.h" #include "volume_data.h" class CLGradient { public: CLGradient(std::string kernel_path, std::string kernel_name, cl_utils::Context *cl_context); ~CLGradient(); void Init(VolumeData &volume_data); void Compute(); unsigned char* volume_gradient; private: size_t global_work_size[3]; cl_utils::Context *context_; cl_kernel kernel_; cl_mem volume_raw_; cl_mem volume_gradient_; }; #endif //RAYTRACING_CL_GRADIENT_H
#pragma once class Resources { public: Resources(int mineralPatches = 9, int gasGeysers = 1, char race = 't'); void addExpansion(int mineralPatches = 7, int gasGeysers = 1); int getMinerals() const { return mMinerals; } int getGas() const { return mGas; } int getSupply() const { return mSupply; } int getAvailableSupply() const { return mSupplyMax - mSupply; } int getSupplyMax() const { return mSupplyMax; } int getFrame() const { return mFrame; } int getMineralPatches() const { return mMineralPatches; } int getGasGeysers() const { return mGasGeysers; } int getBaseMineRate() const; char getRace() const { return mRace; } void clear() { mMinerals = 0; mGas = 0; mSupply = 0; mSupplyMax = 0; mFrame = 0; } void reset(int mineralPatches = 9, int gasGeysers = 1); // increment minerals, gas, supply, frame void addMinerals(int minerals = 8) { mMinerals += minerals; } void addGas(int gas = 8) { mGas += gas; } void addSupplyMax(int supply = 8) { mSupplyMax += supply; } void nextFrame(int frame = 1) { mFrame += frame; } void setRace(char race = 't') { mRace = race; } void useMinerals(int minerals) { mMinerals -= minerals; } void useGas(int gas) { mGas -= gas; } void useSupply(int supply) { mSupply += supply; } private: int mMinerals, mGas, mSupply, mSupplyMax, mFrame; int mMineralPatches, mGasGeysers; char mRace; };
// // SCAboutNode.h // Scnr // // Created by Steve Dekorte . // Copyright (c) Steve Dekorte. All rights reserved. // #import <Cocoa/Cocoa.h> #import <NavKit/NavKit.h> #import "SCArtists.h" #import "SCUnpurchased.h" @interface SCRootNode : NavInfoNode + (SCRootNode *)sharedSCRootNode; @property (strong, nonatomic) SCArtists *artists; @property (strong, nonatomic) SCUnpurchased *unpurchased; @end
/* * Copyright (c) 2006-2007 Christopher J. W. Lloyd * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #import <Foundation/NSCharacterSet.h> #import <Foundation/characterset/bitmapRepresentation.h> @interface NSMutableCharacterSet_bitmap : NSMutableCharacterSet { uint8_t _bitmap[NSBitmapCharacterSetSize]; } -initWithCharacterSet:(NSCharacterSet *)set; -initWithData:(NSData *)data; -initWithString:(NSString *)string; -initWithRange:(NSRange)range; @end
extern zend_class_entry *zendframework_view_exception_invalidhelperexception_ce; ZEPHIR_INIT_CLASS(ZendFramework_View_Exception_InvalidHelperException);
#ifndef CARD_H #define CARD_H #include <string> #include <vector> using namespace std; /* Represents a single chance or community chest card */ class Card { public: // Basic card, no actions Card(const string& name, const string& type); // Card that can advance to a specific space (or negative if relative) Card(const string& name, const string& type, int advanceTo); // Card that can advance to a range of spaces (i.e. nearest railroad) Card(const string& name, const string& type, int advanceTo[], int advanceToSize); // Card that sends you to jail Card(const string& name, const string& type, int advanceTo, bool goToJail); // Represents a get out of jail free card Card(const string& name, const string& type, bool getOutOfJailCard); virtual ~Card(); string getName(); string getType(); bool isGoToJail() const; bool isOutOfJailFree() const; bool isAdvanceToCard() const; vector<int> getAdvanceToSpace() const; int getNumAdvanceToSpaces() const; private: string name; string type; bool advance; vector<int> advanceToSpaces; bool goToJail; bool outOfJail; }; #endif
#ifndef _ROS_SERVICE_AssignTask_h #define _ROS_SERVICE_AssignTask_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace auto_warehousing { static const char ASSIGNTASK[] = "auto_warehousing/AssignTask"; class AssignTaskRequest : public ros::Msg { public: typedef uint32_t _task_id_type; _task_id_type task_id; AssignTaskRequest(): task_id(0) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; *(outbuffer + offset + 0) = (this->task_id >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->task_id >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->task_id >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->task_id >> (8 * 3)) & 0xFF; offset += sizeof(this->task_id); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; this->task_id = ((uint32_t) (*(inbuffer + offset))); this->task_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); this->task_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); this->task_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->task_id); return offset; } const char * getType(){ return ASSIGNTASK; }; const char * getMD5(){ return "01f8cf8853582efbb17391a60263fd03"; }; }; class AssignTaskResponse : public ros::Msg { public: typedef bool _success_type; _success_type success; AssignTaskResponse(): success(0) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; union { bool real; uint8_t base; } u_success; u_success.real = this->success; *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; offset += sizeof(this->success); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; union { bool real; uint8_t base; } u_success; u_success.base = 0; u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); this->success = u_success.real; offset += sizeof(this->success); return offset; } const char * getType(){ return ASSIGNTASK; }; const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; }; class AssignTask { public: typedef AssignTaskRequest Request; typedef AssignTaskResponse Response; }; } #endif
/** * @file * @brief Contains the TPZConsLawTest class for test. Material as conservation law */ #ifndef CONSLAWTESTHPP #define CONSLAWTESTHPP #include <iostream> #include "pzmaterial.h" #include "pzfmatrix.h" #include "pzvec.h" #include "pzconslaw.h" /** * @brief Only to test a material as conservation law. It was used for testing purposes * @ingroup material */ class TPZConsLawTest : public TPZConservationLaw { TPZFMatrix<REAL> fXf;//fonte TPZVec<REAL> fB; int fArtificialDiffusion; /// Integer for integration degree of the initial solution int fTest; REAL fDelta; public : TPZConsLawTest(int nummat, TPZVec<REAL> B,int artdiff,REAL delta_t,int dim,REAL delta,int test=0); virtual ~TPZConsLawTest(); void SetMaterial(TPZFMatrix<REAL> &xfin) { fXf = xfin; } REAL DeltaOtimo(); REAL CFL(int degree); REAL B(int i,TPZVec<REAL> &x); REAL Delta(); REAL T(int jn,TPZVec<REAL> &x); int NStateVariables(); virtual void Print(std::ostream & out); virtual std::string Name() { return "TPZConsLawTest"; } virtual void Contribute(TPZMaterialData &data,REAL weight, TPZFMatrix<REAL> &ek,TPZFMatrix<REAL> &ef); virtual void Contribute(TPZMaterialData &data,REAL weight, TPZFMatrix<REAL> &ef) { TPZConservationLaw::Contribute(data,weight,ef); } virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix<REAL> &ek, TPZFMatrix<REAL> &ef); virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<REAL> &ek, TPZFMatrix<REAL> &ef, TPZBndCond &bc); virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<REAL> &ef, TPZBndCond &bc) { TPZConservationLaw::ContributeBC(data,weight,ef,bc); } virtual int VariableIndex(const std::string &name); virtual int NSolutionVariables(int var); virtual int NFluxes(){ return 1;} protected: virtual void Solution(TPZVec<REAL> &Sol,TPZFMatrix<REAL> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<REAL> &Solout); public: virtual void Solution(TPZMaterialData &data,int var,TPZVec<REAL> &Solout) { int numbersol = data.sol.size(); if (numbersol != 1) { DebugStop(); } Solution(data.sol[0],data.dsol[0],data.axes,var,Solout); } /** @brief Compute the value of the flux function to be used by ZZ error estimator */ virtual void Flux(TPZVec<REAL> &x, TPZVec<REAL> &Sol, TPZFMatrix<REAL> &DSol, TPZFMatrix<REAL> &axes, TPZVec<REAL> &flux); void Errors(TPZVec<REAL> &x,TPZVec<REAL> &u, TPZFMatrix<REAL> &dudx, TPZFMatrix<REAL> &axes, TPZVec<REAL> &flux, TPZVec<REAL> &u_exact,TPZFMatrix<REAL> &du_exact,TPZVec<REAL> &values); void ComputeSolRight(TPZVec<REAL> &solr,TPZVec<REAL> &soll,TPZVec<REAL> &normal,TPZBndCond *bcright); void ComputeSolLeft(TPZVec<REAL> &solr,TPZVec<REAL> &soll,TPZVec<REAL> &normal,TPZBndCond *bcleft); }; #endif
/* * Copyright (C) 2013 by Glenn Hickey (hickey@soe.ucsc.edu) * Copyright (C) 2012-2019 by UCSC Computational Genomics Lab * * Released under the MIT license, see LICENSE.txt */ #ifndef _HALPHYLOPBED_H #define _HALPHYLOPBED_H #include "halBedScanner.h" #include "halPhyloP.h" #include <iostream> #include <set> #include <string> #include <vector> namespace hal { /** Use the halBedScanner to parse a bed file, running halPhyloP on each * line */ class PhyloPBed : public BedScanner { public: PhyloPBed(AlignmentConstPtr alignment, const Genome *refGenome, const Sequence *refSequence, hal_index_t start, hal_size_t length, hal_size_t step, PhyloP &phyloP, std::ostream &outStream); virtual ~PhyloPBed(); void run(std::istream *bedStream); protected: virtual void visitLine(); protected: AlignmentConstPtr _alignment; const Genome *_refGenome; const Sequence *_refSequence; hal_index_t _refStart; hal_index_t _refLength; hal_size_t _step; PhyloP &_phyloP; std::ostream &_outStream; }; } #endif // Local Variables: // mode: c++ // End:
#pragma once #include <memory> namespace fas { /** * @brief Holds a shared inner executor, which can be copied */ template <class Executor> class ExecutorPtr { public: ExecutorPtr(std::shared_ptr<Executor> innerExecutor) : _innerExecutor(std::move(innerExecutor)) {} template <class Fn> void spawn(Fn&& fn) { _innerExecutor->spawn(std::forward<Fn>(fn)); } private: std::shared_ptr<Executor> _innerExecutor; }; } // namespace fass
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2015 Scientific Computing and Imaging Institute, University of Utah. 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 Graphics_Graphics_Widgets_Widget_H #define Graphics_Graphics_Widgets_Widget_H #include <Graphics/Datatypes/GeometryImpl.h> #include <Core/GeometryPrimitives/Point.h> #include <Graphics/Widgets/share.h> namespace SCIRun { namespace Graphics { namespace Datatypes { class SCISHARE WidgetBase : public GeometryObjectSpire { public: WidgetBase(const Core::GeometryIDGenerator& idGenerator, const std::string& tag, bool isClippable); }; using WidgetHandle = SharedPointer<WidgetBase>; struct SCISHARE BoxPosition { Core::Geometry::Point center_, right_, down_, in_; void setPosition(const Core::Geometry::Point& center, const Core::Geometry::Point& right, const Core::Geometry::Point& down, const Core::Geometry::Point& in); void getPosition(Core::Geometry::Point& center, Core::Geometry::Point& right, Core::Geometry::Point& down, Core::Geometry::Point& in) const; }; class SCISHARE CompositeWidget : public WidgetBase { public: template <typename WidgetIter> CompositeWidget(const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end) : WidgetBase(idGenerator, tag, true), widgets_(begin, end) {} ~CompositeWidget(); void addToList(Core::Datatypes::GeometryBaseHandle handle, Core::Datatypes::GeomList& list) override; private: std::vector<WidgetHandle> widgets_; }; class SCISHARE WidgetFactory { public: static WidgetHandle createBox(const Core::GeometryIDGenerator& idGenerator, double scale, const BoxPosition& pos, const Core::Geometry::BBox& bbox); static WidgetHandle createSphere(const Core::GeometryIDGenerator& idGenerator, const std::string& name, double radius, const std::string& defaultColor, const Core::Geometry::Point& point, const Core::Geometry::BBox& bbox); template <typename WidgetIter> static WidgetHandle createComposite(const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end) { return boost::make_shared<CompositeWidget>(idGenerator, tag, begin, end); } }; } } } #endif
#ifndef EXP_H #define EXP_H template<typename R> struct Exp : StaticInterface<Exp<R> >, UnaryOperation<R> { using UnaryOperation<R>::Right; using UnaryOperation<R>::Operation::Value; INLINE_MODE Exp(const R& right) : UnaryOperation<R> (right, exp(right.Value)) {} template<unsigned GradLevel, typename T>INLINE_MODE void Gradient(real gradData[], unsigned index, const unsigned baseCount, const T& gradient) const { Right. template Gradient<GradLevel> (gradData, index, baseCount, gradient * (*this)); } INLINE_MODE void Gradient(real gradData[], unsigned index, const unsigned baseCount, const real& gradient) const { Right.Gradient(gradData, index, baseCount, gradient * Value); } }; template<typename R>INLINE_MODE const Exp<R> exp(const StaticInterface<R>& right) { return Exp<R> (right.Self()); } #endif // EXP_H
// // DropboxDownloadTaskDelegate.h // Pods // // Created by Михаил Мотыженков on 13.05.16. // // #import <Foundation/Foundation.h> @protocol DropboxDownloadTaskDelegate <NSObject> - (void)downloadTaskDidResumeWithOldTask:(NSURLSessionDownloadTask *)oldTask newTask:(NSURLSessionDownloadTask *)newTask session:(NSURLSession *)session; @end
#include "nv_core.h" #include "nv_ml.h" #include "nv_num.h" // k-means++ // Selecting class with minimum distance static int nv_kmeans_bmc(const nv_matrix_t *mat, int mk, const nv_matrix_t *vec, int vm) { int k; int min_k = -1; float min_dist = FLT_MAX; for (k = 0; k < mk; ++k) { float dist = nv_euclidean2(mat, k, vec, vm); if (dist < min_dist) { min_dist = dist; min_k = k; } } return min_k; } // Initial value selection of K-Means++ static void nv_kmeans_init(nv_matrix_t *means, int k, const nv_matrix_t *data) { int m, c; nv_matrix_t *min_dists = nv_matrix_alloc(1, data->m); int rnd = (int)((data->m - 1) * nv_rand()); float potential = 0.0f; int local_tries = 2 + (int)log(data->m); // First nv_vector_copy(means, 0, data, rnd); for (m = 0; m < data->m; ++m) { float dist = nv_euclidean2(means, 0, data, m); NV_MAT_V(min_dists, m, 0) = dist; potential += dist; } for (c = 1; c < k; ++c) { float min_potential = FLT_MAX; int best_index = -1; int i; for (i = 0; i < local_tries; ++i) { float new_potential; float rand_val = potential * nv_rand(); for (m = 0; m < data->m - 1; ++m) { if (rand_val <= NV_MAT_V(min_dists, m, 0)) { break; } else { rand_val -= NV_MAT_V(min_dists, m, 0); } } new_potential = 0.0f; for (i = 0; i < data->m; ++i) { new_potential += min( nv_euclidean2(data, m, data, i), NV_MAT_V(min_dists, i, 0) ); } if (new_potential < min_potential) { min_potential = new_potential; best_index = m; } } nv_vector_copy(means, c, data, best_index); for (m = 0; m < data->m; ++m) { NV_MAT_V(min_dists, m, 0) = min( nv_euclidean2(data, m, data, best_index), NV_MAT_V(min_dists, m, 0) ); } potential = min_potential; } nv_matrix_free(&min_dists); } // Initial value selection in the longest distance static void nv_kmeans_init_max(nv_matrix_t *means, int k, const nv_matrix_t *data) { int m, c; nv_matrix_t *min_dists = nv_matrix_alloc(1, data->m); int rnd = (int)((data->m - 1) * nv_rand()); // 1つ目 nv_vector_copy(means, 0, data, rnd); for (m = 0; m < data->m; ++m) { NV_MAT_V(min_dists, m, 0) = nv_euclidean2(means, 0, data, m); } // 最短距離クラスから一番遠い要素を選択 for (c = 1; c < k; ++c) { float max_dist = -FLT_MAX; int max_index = -1; for (m = 0; m < data->m; ++m) { float dist = min(nv_euclidean2(means, c - 1, data, m), NV_MAT_V(min_dists, m, 0)); if (dist > max_dist) { max_dist = dist; max_index = m; } NV_MAT_V(min_dists, m, 0) = dist; } nv_vector_copy(means, c, data, max_index); } nv_matrix_free(&min_dists); } // ランダム初期値選択 static void nv_kmeans_init_rand(nv_matrix_t *means, int k, const nv_matrix_t *data) { int c; for (c = 0; c < k; ++c) { int rnd = (int)((data->m - 1) * nv_rand()); nv_vector_copy(means, c, data, rnd); } } int nv_kmeans(nv_matrix_t *means, // k nv_matrix_t *count, // k nv_matrix_t *labels, // data->m const nv_matrix_t *data, const int k, const int max_epoch) { int m, n, c; int processing = 1; int converge, epoch; nv_matrix_t *old_labels = nv_matrix_alloc(1, data->m); nv_matrix_t *sum = nv_matrix_alloc(data->n, k); assert(means->n == data->n); assert(means->m >= k); assert(labels->m >= data->m); // 初期値選択 nv_kmeans_init(means, k, data); for (m = 0; m < old_labels->m; ++m) { NV_MAT_V(old_labels, m, 0) = -1.0f; } epoch = 0; do { nv_matrix_zero(count); nv_matrix_zero(sum); for (m = 0; m < data->m; ++m) { int label = nv_kmeans_bmc(means, k, data, m); // Label decision NV_MAT_V(labels, m, 0) = (float)label; // Count NV_MAT_V(count, label, 0) += 1.0f; // Vector sum for (n = 0; n < means->n; ++n) { NV_MAT_V(sum, label, n) += NV_MAT_V(data, m, n); } } ++epoch; // Termination determination converge = 1; for (m = 0; m < data->m; ++m) { if (NV_MAT_V(labels, m, 0) != NV_MAT_V(old_labels, m, 0)) { converge = 0; break; } } if (converge) { // Terminate processing = 0; } else { // Update labels nv_matrix_copy(old_labels, 0, labels, 0, old_labels->m); // Median calculation for (c = 0; c < k; ++c) { if (NV_MAT_V(count, c, 0) != 0.0f) { float factor = 1.0f / NV_MAT_V(count, c, 0); for (n = 0; n < means->n; ++n) { NV_MAT_V(means, c, n) = NV_MAT_V(sum, c, n) * factor; } } } // Check maximal trials if (max_epoch != 0 && epoch >= max_epoch) { // Terminate processing = 0; } } } while (processing); nv_matrix_free(&old_labels); nv_matrix_free(&sum); return k; }
/* * Copyright (c) 2016, 2017, 2020 Konstantin Tcholokachvili * All rights reserved. * Use of this source code is governed by a MIT license that can be * found in the LICENSE file. */ #pragma once #include <io/console.h> #define FORTH_DICTIONARY 0 #define MACRO_DICTIONARY 1 typedef int32_t cell_t; typedef struct colorforth_word { cell_t name; void *code_address; } word_t; struct editor_args { struct console *cons; uint32_t initrd_start; uint32_t initrd_end; }; void editor(void *args); cell_t pack(const char *word_name); char *unpack(cell_t word); void run_block(const cell_t nb_block); void dot_s(void); void dispatch_word(cell_t word); word_t lookup_word(cell_t name, const bool_t force_dictionary); void colorforth_initialize(void); void erase_stack(void);
/*! ************************************************************************************* * \file sei.h * * \brief * Prototypes for sei.c ************************************************************************************* */ #ifndef SEI_H #define SEI_H typedef enum { SEI_BUFFERING_PERIOD = 0, SEI_PIC_TIMING, SEI_PAN_SCAN_RECT, SEI_FILLER_PAYLOAD, SEI_USER_DATA_REGISTERED_ITU_T_T35, SEI_USER_DATA_UNREGISTERED, SEI_RECOVERY_POINT, SEI_DEC_REF_PIC_MARKING_REPETITION, SEI_SPARE_PIC, SEI_SCENE_INFO, SEI_SUB_SEQ_INFO, SEI_SUB_SEQ_LAYER_CHARACTERISTICS, SEI_SUB_SEQ_CHARACTERISTICS, SEI_FULL_FRAME_FREEZE, SEI_FULL_FRAME_FREEZE_RELEASE, SEI_FULL_FRAME_SNAPSHOT, SEI_PROGRESSIVE_REFINEMENT_SEGMENT_START, SEI_PROGRESSIVE_REFINEMENT_SEGMENT_END, SEI_MOTION_CONSTRAINED_SLICE_GROUP_SET, SEI_FILM_GRAIN_CHARACTERISTICS, SEI_DEBLOCKING_FILTER_DISPLAY_PREFERENCE, SEI_STEREO_VIDEO_INFO, SEI_POST_FILTER_HINT, SEI_TONE_MAPPING_INFO, SEI_SCALABILITY_INFO, SEI_SUB_PIC_SCALABLE_LAYER, SEI_NON_REQUIRED_LAYER_REP, SEI_PRIORITY_LAYER_INFO, SEI_LAYERS_NO_PRESENT, SEI_LAYER_DEPENDENCY_CHANGE, SEI_SCALABLE_NESTING, SEI_BASE_LAYER_TEMPORAL_HRD, SEI_QUALITY_LAYER_INTEGRITY_CHECK, SEI_REDUNDANT_PIC_PROPERTY, SEI_TL0_DEP_REP_INDEX, SEI_TL_SWITCHING_POINT, SEI_PARALLEL_DECODING_INFO, SEI_MVC_SCALABLE_NESTING, SEI_VIEW_SCALABILITY_INFO, SEI_MULTIVIEW_SCENE_INFO, SEI_MULTIVIEW_ACQUISITION_INFO, SEI_NON_REQUIRED_VIEW_COMPONENT, SEI_VIEW_DEPENDENCY_CHANGE, SEI_OPERATION_POINTS_NOT_PRESENT, SEI_BASE_VIEW_TEMPORAL_HRD, SEI_MAX_ELEMENTS //!< number of maximum syntax elements } SEI_type; #define MAX_FN 256 CREL_RETURN InterpretSEIMessage PARGS2(byte* msg, int size); void interpret_spare_pic PARGS2( byte* payload, int size); void interpret_subsequence_info PARGS2( byte* payload, int size); void interpret_subsequence_layer_characteristics_info PARGS2( byte* payload, int size); void interpret_subsequence_characteristics_info PARGS2( byte* payload, int size); void interpret_scene_information PARGS2( byte* payload, int size); // JVT-D099 void interpret_user_data_registered_itu_t_t35_info( byte* payload, int size); void interpret_user_data_unregistered_info PARGS2( byte* payload, int size); void interpret_pan_scan_rect_info PARGS2( byte* payload, int size); void interpret_recovery_point_info PARGS2( byte* payload, int size); void interpret_filler_payload_info( byte* payload, int size); void interpret_dec_ref_pic_marking_repetition_info PARGS3( byte* payload, int size, unsigned int view_index); void interpret_full_frame_freeze_info( byte* payload, int size); void interpret_full_frame_freeze_release_info( byte* payload, int size); void interpret_full_frame_snapshot_info PARGS2( byte* payload, int size); void interpret_progressive_refinement_start_info( byte* payload, int size); void interpret_progressive_refinement_end_info PARGS2( byte* payload, int size); void interpret_motion_constrained_slice_group_set_info PARGS2( byte* payload, int size); void interpret_reserved_info( byte* payload, int size); CREL_RETURN interpret_buffering_period_info PARGS3( byte* payload, int size, unsigned int view_index); void interpret_picture_timing_info PARGS3( byte* payload, int size, unsigned int view_index); void interpret_mvc_scalable_nesting PARGS4( byte* payload, int *size, int *num_views, int* view_indexs); void interpret_offset_metadata PARGS2(byte* payload, int size); #endif
#ifndef SFUI_APPWINDOW_H #define SFUI_APPWINDOW_H //////////////////////////////////////////////////////////// // // MIT License // // Copyright(c) 2017 Kurt Slagle - kurt_slagle@yahoo.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. // // The origin of this software must not be misrepresented; you must not claim // that you wrote the original software.If you use this software in a product, // an acknowledgment of the software used is required. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // Internal Headers //////////////////////////////////////////////////////////// #include <SFUI/Include/Common.h> #include <SFUI/Include/Application/Concurrent.h> #include <SFUI/Include/UI/UI.h> #include <SFUI/Include/UI/Theme.h> //////////////////////////////////////////////////////////// // Dependency Headers //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // Standard Library Headers //////////////////////////////////////////////////////////// namespace sfui { class AppWindow; class AppWindowHandle { public: AppWindowHandle(AppWindow *win); ~AppWindowHandle(); void Open(); void Close(); void Hide(); void Show(); private: AppWindow *m_Handle = nullptr; }; class AppWindow { public: AppWindow(Vec2i Size, const std::string &Title, sf::Uint32 style); virtual ~AppWindow(); friend class AppMainWindow; virtual void Launch(); bool IsOpen(); bool IsModal(); bool IsDone(); virtual void Close(); virtual void Hide(); virtual void Show(); virtual void AddWidget(Widget::shared_ptr widget); protected: virtual void PostLaunch(); virtual void MainLoop(); virtual void Update(); virtual void Render(); virtual void QueryQueues(); Vec2i m_WindowSize = { 0, 0 }; std::string m_WindowTitle = "Popup"; sf::Uint32 m_WindowStyle = sf::Style::Default; std::atomic<bool> m_IsModal = false; std::atomic<bool> m_IsVisible = false; std::atomic<bool> m_MarkForClose = false; std::atomic<bool> m_MarkForCleanup = false; std::atomic<bool> m_MarkForHide = false; std::thread m_Thread; concurrency::concurrent_queue<Widget::shared_ptr> m_widgetQueue; std::shared_ptr<sf::RenderWindow> m_Window; std::shared_ptr<WidgetWindow> m_Widgets; }; } #endif // SFUI_APPWINDOW_H
#ifndef UTILS_H #define UTILS_H #include <algorithm> #include <functional> #include <cctype> #include <locale> namespace renderlib{ // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #define BUFFER_OFFSET(i) ((void*)(i)) // trim from start static inline std::string &ltrim(std::string &s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); return s; } // trim from end static inline std::string &rtrim(std::string &s) { s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); return s; } // trim from both ends static inline std::string &trim(std::string &s) { return ltrim(rtrim(s)); } } //namespace renderlib #endif // UTILS_H
/** * 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-Structs.h" #import <UIKit/UIView.h> @interface UITabBarButtonBadge : UIView { UIView* _value; UIView* _background; UIView* _alternate; } -(id)initWithValue:(id)value blinks:(BOOL)blinks; -(void)dealloc; -(CGSize)sizeThatFits:(CGSize)fits; -(void)setValue:(id)value; -(void)layoutSubviews; -(void)setBlinks:(BOOL)blinks; @end
// // GameManager.h // spaceViking_1_0_1 // // Created by Mac Owner on 1/27/13. // // #import <Foundation/Foundation.h> #import "Constants.h" #import "SimpleAudioEngine.h" @interface GameManager : NSObject { BOOL isMusicON; BOOL isSoundEffectsON; BOOL hasPlayerDied; SceneTypes currentScene; NSUInteger counterKill; // Added for audio BOOL hasAudioBeenInitialized; GameManagerSoundState managerSoundState; SimpleAudioEngine *soundEngine; NSMutableDictionary *listOfSoundEffectFiles; NSMutableDictionary *soundEffectsState; } @property (readwrite) GameManagerSoundState managerSoundState; @property (nonatomic, retain) NSMutableDictionary *listOfSoundEffectFiles; @property (nonatomic, retain) NSMutableDictionary *soundEffectsState; @property (readwrite,assign) NSUInteger counterKill; @property (readwrite) BOOL isMusicON; @property (readwrite) BOOL isSoundEffectsON; @property (readwrite) BOOL hasPlayerDied; +(GameManager*)sharedGameManager; // 1 -(void)runSceneWithID:(SceneTypes)sceneID; // 2 -(void)openSiteWithLinkType:(LinkTypes)linkTypeToOpen ; -(void)setupAudioEngine; -(ALuint)playSoundEffect:(NSString*)soundEffectKey; -(void)stopSoundEffect:(ALuint)soundEffectID; -(void)playBackgroundTrack:(NSString*)trackFileName; -(CGSize)getDimensionsOfCurrentScene; @end
//*********************** Lab 1 ************************** // Program written by: // - Steven Prickett EID: srp2389 // - Kelvin Le EID: kl24956 // Date Created: 1/22/2015 // Date Modified: 1/25/2015 // // Lab number: 1 // // Brief description of the program: // - // // Hardware connections: // - Outputs: // - PA2 Screen SSI SCK (SSI0Clk) // - PA3 Screen SSI CS (SSI0Fss) // - PA5 Screen SSI TX (SSI0Tx) // - PA6 Screen Data/Command Pin (GPIO) // - PA7 Screen RESET Pin (GPIO) // - Inputs: // - // // Peripherals used: // - TIMER0 ADC0 trigger //********************************************************* #include <stdint.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "tm4c123gh6pm.h" #include "debug.h" #include "pll.h" #include "st7735.h" #include "usb_uart.h" #include "systick.h" #include "pwm.h" #include "adc.h" #include "timer0.h" #include "interpreter.h" #include "debug.h" #define LCD_WIDTH 128 #define LCD_HEIGHT 160 #define OUTPUT_UART_ENABLED (true) #define OUTPUT_SCREEN_ENABLED (false) // prototypes for functions defined in startup.s void DisableInterrupts(void); // Disable interrupts void EnableInterrupts(void); // Enable interrupts long StartCritical (void); // previous I bit, disable interrupts void EndCritical(long sr); // restore I bit to previous value void WaitForInterrupt(void); // low power mode // global variables uint32_t msElapsed = 0; char stringBuffer[16]; bool updateScreen = false; uint32_t dd=0; uint32_t loopcount=0; int main(void){ DisableInterrupts(); //////////////////////// perhipheral initialization //////////////////////// // init PLL to 80Mhz PLL_Init(); // init screen, use white as text color Output_Init(); Output_Color(ST7735_WHITE); //Output_Clear(); // init usb uart, generate interrupts when data received via usb USB_UART_Init(); USB_UART_Enable_Interrupt(); // init systick to generate an interrupt every 1ms (every 80000 cycles) //SysTick_Init(80000); // init and enable PWM // PWM0A_Init(40000, 20000); // PWM0A_Enable(); // init debug LEDs DEBUG_Init(); // global enable interrupts EnableInterrupts(); //////////////////////// main loop //////////////////////// while(1){ WaitForInterrupt(); /* if (updateScreen){ updateScreen = false; // screen stuff here } */ if (USB_BufferReady){ USB_BufferReady = false; //INTER_HandleBuffer(); loopcount++; dd++; // experimental test comment } } } // this is used for printf to output to both the screen and the usb uart int fputc(int ch, FILE *f){ if (OUTPUT_SCREEN_ENABLED) ST7735_OutChar(ch); // output to screen if (OUTPUT_UART_ENABLED) USB_UART_PrintChar(ch); // output via usb uart return 1; }
// // AppDelegate.h // CleverRoad // // Created by Admin on 1/25/15. // Copyright (c) 2015 leonidkokhnovych. All rights reserved. // #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; - (void)saveContext; - (NSURL *)applicationDocumentsDirectory; @end
// // HMNavigateController.h // HMMeiTuanHD19 // // Created by heima on 16/9/14. // Copyright © 2016年 heima. All rights reserved. // #import <UIKit/UIKit.h> @interface HMNavigateController : UINavigationController @end
/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { ARTICLE = 258, VERB = 259, NOUN = 260, ADJECTIVE = 261, ADVERB = 262, PREPOSITION = 263, END = 264 }; #endif /* Tokens. */ #define ARTICLE 258 #define VERB 259 #define NOUN 260 #define ADJECTIVE 261 #define ADVERB 262 #define PREPOSITION 263 #define END 264 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval;
#include <stdio.h> #include <stdlib.h> #include <string.h> #define TRUE 1 #define FALSE 0 #define REI 'A' #define HAKUSYU 'B' int main(int argc, char const *argv[]) { char input[63], *data, output; int n, isREI = TRUE; scanf("%[^\n]", input); // 1 2 3 data = strtok(input, " "); while (data != NULL) { output = isREI ? REI : HAKUSYU; for (int i = 0; i < atoi(data); i++) printf("%c", output); isREI = isREI ? FALSE : TRUE; data = strtok(NULL, " "); } puts(""); // output: ABBAAA return 0; }
// // AppDelegate.h // multiplicationTable // // Created by Olivier Delecueillerie on 19/12/2014. // Copyright (c) 2014 lagspoon. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#import <SpriteKit/SpriteKit.h> @interface FFGameOverScene : SKScene @end
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double Pods_SBrick_iOS_ExampleVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_SBrick_iOS_ExampleVersionString[];
\n static inline void mapping_set_error(struct address_space *mapping, int error) static inline void mapping_set_unevictable(struct address_space *mapping) static inline void mapping_clear_unevictable(struct address_space *mapping) static inline int mapping_unevictable(struct address_space *mapping) static inline void mapping_set_exiting(struct address_space *mapping) static inline int mapping_exiting(struct address_space *mapping) static inline void mapping_set_no_writeback_tags(struct address_space *mapping) static inline int mapping_use_writeback_tags(struct address_space *mapping) static inline gfp_t mapping_gfp_mask(struct address_space * mapping) static inline gfp_t mapping_gfp_constraint(struct address_space *mapping, gfp_t gfp_mask) static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) static inline int page_cache_get_speculative(struct page *page) static inline int page_cache_add_speculative(struct page *page, int count) extern struct page *__page_cache_alloc(gfp_t gfp) ; static inline struct page *__page_cache_alloc(gfp_t gfp) static inline struct page *page_cache_alloc(struct address_space *x) static inline gfp_t readahead_gfp_mask(struct address_space *x) static inline struct page *find_get_page(struct address_space *mapping, pgoff_t offset) static inline struct page *find_get_page_flags(struct address_space *mapping, pgoff_t offset, int fgp_flags) static inline struct page *find_lock_page(struct address_space *mapping, pgoff_t offset) static inline struct page *find_or_create_page(struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) static inline struct page *grab_cache_page_nowait(struct address_space *mapping, pgoff_t index) struct page *find_get_entry(struct address_space *mapping, pgoff_t offset) ; struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset) ; unsigned find_get_entries(struct address_space *mapping, pgoff_t start, unsigned int nr_entries, struct page **entries, pgoff_t *indices) ; unsigned find_get_pages_range(struct address_space *mapping, pgoff_t *start, pgoff_t end, unsigned int nr_pages, struct page **pages) ; static inline unsigned find_get_pages(struct address_space *mapping, pgoff_t *start, unsigned int nr_pages, struct page **pages) struct page *find_get_entry(struct address_space *mapping, pgoff_t offset) ; struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset) ; unsigned find_get_entries(struct address_space *mapping, pgoff_t start, unsigned int nr_entries, struct page **entries, pgoff_t *indices) ; unsigned find_get_pages_range(struct address_space *mapping, pgoff_t *start, pgoff_t end, unsigned int nr_pages, struct page **pages) ; static inline unsigned find_get_pages(struct address_space *mapping, pgoff_t *start, unsigned int nr_pages, struct page **pages) return find_get_pages_range(mapping, start, (pgoff_t) -1, nr_pages, pages) ; } unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, unsigned int nr_pages, struct page **pages) ; unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index, pgoff_t end, xa_mark_t tag, unsigned int nr_pages, struct page **pages) ; static inline unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, xa_mark_t tag, unsigned int nr_pages, struct page **pages) static inline struct page *grab_cache_page(struct address_space *mapping, pgoff_t index) static inline struct page *read_mapping_page(struct address_space *mapping, pgoff_t index, void *data) static inline pgoff_t page_to_index(struct page *page) static inline pgoff_t page_to_pgoff(struct page *page) static inline loff_t page_offset(struct page *page) static inline loff_t page_file_offset(struct page *page) static inline pgoff_t linear_page_index(struct vm_area_struct *vma, unsigned long address) static inline int trylock_page(struct page *page) static inline void lock_page(struct page *page) static inline int lock_page_killable(struct page *page) static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, unsigned int flags) static inline void wait_on_page_locked(struct page *page) static inline int wait_on_page_locked_killable(struct page *page) static inline void wait_on_page_writeback(struct page *page) static inline int fault_in_pages_writeable(char __user *uaddr, int size) static inline int fault_in_pages_readable(const char __user *uaddr, int size) static inline int add_to_page_cache(struct page *page, struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) static inline unsigned long dir_pages(struct inode *inode) \n 30 struct address_space *mapping 14 struct page *page 9 pgoff_t offset 7 unsigned int nr_pages 7 struct page **pages 4 pgoff_t *start 3 pgoff_t start 3 pgoff_t index 3 pgoff_t end 3 gfp_t gfp_mask 2 xa_mark_t tag 2 unsigned int nr_entries 2 struct page **entries 2 struct address_space *x 2 pgoff_t *indices 2 pgoff_t *index 2 int size 2 gfp_t gfp 1 void *data 1 unsigned long address 1 unsigned int flags 1 struct vm_area_struct *vma 1 struct mm_struct *mm 1 struct inode *inode 1 struct address_space * mapping 1 struct address_space *m 1 start 1 pgoff_t 1 mapping 1 int fgp_flags 1 int error 1 int count 1 gfp_t mask 1 const char __user *uaddr 1 char __user *uaddr
/* * Copyright (c) 2020 Pedro Falcato * This file is part of Onyx, and is released under the terms of the MIT License * check LICENSE at the root directory for more information */ #ifndef _ONYX_CRED_H #define _ONYX_CRED_H #include <string.h> #include <sys/types.h> #include <onyx/groups.h> #include <onyx/rwlock.h> struct creds { struct rwlock lock; uid_t ruid; uid_t euid; gid_t rgid; gid_t egid; uid_t suid; uid_t sgid; // Type erasure because of C... Pain, all my homies know is pain. void *groups; }; struct process; struct creds *creds_get(void); struct creds *__creds_get(struct process *p); struct creds *creds_get_write(void); struct creds *__creds_get_write(struct process *p); void creds_put(struct creds *c); void creds_put_write(struct creds *c); static inline bool is_root_user(void) { struct creds *c = creds_get(); bool is = c->euid == 0; creds_put(c); return is; } int process_inherit_creds(struct process *new_child, struct process *parent); static inline void creds_init(struct creds *c) { /* Hacky, but works for both C and C++ */ memset(&c->ruid, 0, sizeof(*c) - offsetof(struct creds, ruid)); rwlock_init(&c->lock); } bool cred_is_in_group(struct creds *c, gid_t gid); #ifdef __cplusplus #include <onyx/utility.hpp> enum class CGType { Write = 0, Read }; template <CGType type = CGType::Read> class creds_guard { constexpr bool IsWrite() const { return type == CGType::Write; } creds *c; public: constexpr creds_guard(creds *c) : c{c} { } creds_guard() { if (IsWrite()) c = creds_get_write(); else c = creds_get(); } creds_guard(creds_guard &&g) : c{g.c} { g.c = nullptr; } creds_guard &operator=(creds_guard &&g) { c = g.c; g.c = nullptr; return *this; } CLASS_DISALLOW_COPY(creds_guard); ~creds_guard() { if (c) { if (IsWrite()) creds_put_write(c); else creds_put(c); } } creds *get() const { return c; } }; #endif #endif
/**HEADER******************************************************************** * * Copyright (c) 2008, 2013 Freescale Semiconductor; * All Rights Reserved * * *************************************************************************** * * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED 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 FREESCALE OR ITS 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. * ************************************************************************** * * $FileName: usb_opt.h$ * $Version : * $Date : * * Comments: * * * *END************************************************************************/ #ifndef __usb_opt_h__ #define __usb_opt_h__ 1 #ifndef ENDIANNESS #error ENDIANNESS should be defined, and then rebulid the project. #endif #define SWAP2BYTE_CONST(n) ((((n) & 0x00FF) << 8) | (((n) & 0xFF00) >> 8)) #define SWAP4BYTE_CONST(n) ((((n) & 0x000000FF) << 24) | (((n) & 0x0000FF00) << 8) | (((n) & 0x00FF0000) >> 8) | (((n) & 0xFF000000) >> 24)) #if (ENDIANNESS == BIG_ENDIAN) #define USB_HOST_TO_BE_SHORT(n) (n) #define USB_HOST_TO_BE_SHORT_CONST(n) (n) #define USB_HOST_TO_LE_SHORT(n) SWAP2BYTE_CONST(n) #define USB_HOST_TO_LE_SHORT_CONST(n) SWAP2BYTE_CONST(n) #define USB_SHORT_BE_TO_HOST(n) (n) #define USB_SHORT_BE_TO_HOST_CONST(n) (n) #define USB_SHORT_LE_TO_HOST(n) SWAP2BYTE_CONST(n) #define USB_SHORT_LE_TO_HOST_CONST(n) SWAP2BYTE_CONST(n) #define USB_SHORT_UNALIGNED_LE_TO_HOST(n) ((n[1]<<8)|n[0]) #define USB_HOST_TO_BE_LONG(n) (n) #define USB_HOST_TO_BE_LONG_CONST(n) (n) #define USB_HOST_TO_BE_UNALIGNED_LONG(n, m) \ { \ m[0]=((n>>24) & 0xFF); \ m[1]=((n>>16) & 0xFF); \ m[2]=((n>>8) & 0xFF); \ m[3]=(n & 0xFF); \ } #define USB_HOST_TO_LE_LONG(n) SWAP4BYTE_CONST(n) #define USB_HOST_TO_LE_LONG_CONST(n) SWAP4BYTE_CONST(n) #define USB_HOST_TO_LE_UNALIGNED_LONG(n, m) \ { \ m[0]=(n & 0xFF); \ m[1]=((n>>8) & 0xFF); \ m[2]=((n>>16) & 0xFF); \ m[3]=((n>>24) & 0xFF); \ } #define USB_LONG_BE_TO_HOST(n) (n) #define USB_LONG_BE_TO_HOST_CONST(n) (n) #define USB_LONG_LE_TO_HOST(n) SWAP4BYTE_CONST(n) #define USB_LONG_LE_TO_HOST_CONST(n) SWAP4BYTE_CONST(n) #define USB_LONG_UNALIGNED_LE_TO_HOST(n) ((n[3]<<24)|(n[2]<<16)|(n[1]<<8)|n[0]) #else /* (PSP_ENDIAN == MQX_BIG_ENDIAN) */ #define USB_HOST_TO_BE_SHORT(n) SWAP2BYTE_CONST(n) #define USB_HOST_TO_BE_SHORT_CONST(n) SWAP2BYTE_CONST(n) #define USB_HOST_TO_LE_SHORT(n) (n) #define USB_HOST_TO_LE_SHORT_CONST(n) (n) #define USB_SHORT_BE_TO_HOST(n) SWAP2BYTE_CONST(n) #define USB_SHORT_BE_TO_HOST_CONST(n) SWAP2BYTE_CONST(n) #define USB_SHORT_LE_TO_HOST(n) (n) #define USB_SHORT_LE_TO_HOST_CONST(n) (n) #define USB_SHORT_UNALIGNED_LE_TO_HOST(n) ((uint16_t)((uint16_t)n[1]<<8)|n[0]) #define USB_HOST_TO_BE_LONG(n) SWAP4BYTE_CONST(n) #define USB_HOST_TO_BE_LONG_CONST(n) SWAP4BYTE_CONST(n) #define USB_HOST_TO_BE_UNALIGNED_LONG(n, m) \ { \ m[0]=((n>>24) & 0xFF); \ m[1]=((n>>16) & 0xFF); \ m[2]=((n>>8) & 0xFF); \ m[3]=(n & 0xFF); \ } #define USB_HOST_TO_LE_LONG(n) (n) #define USB_HOST_TO_LE_LONG_CONST(n) (n) #define USB_HOST_TO_LE_UNALIGNED_LONG(n, m) \ { \ m[0]=(n & 0xFF); \ m[1]=((n>>8) & 0xFF); \ m[2]=((n>>16) & 0xFF); \ m[3]=((n>>24) & 0xFF); \ } #define USB_LONG_BE_TO_HOST(n) SWAP4BYTE_CONST(n) #define USB_LONG_BE_TO_HOST_CONST(n) SWAP4BYTE_CONST(n) #define USB_LONG_LE_TO_HOST(n) (n) #define USB_LONG_LE_TO_HOST_CONST(n) (n) #define USB_LONG_UNALIGNED_LE_TO_HOST(n) (((uint32_t)n[3]<<24) | ((uint32_t)n[2]<<16) | ((uint32_t)n[1]<<8) | (uint32_t)n[0]) #endif /* (PSP_ENDIAN == MQX_BIG_ENDIAN) */ #endif
// // PathController_Private.h // DropboxLib // // Created by Jesse Grosjean on 3/7/11. // Copyright 2011 Hog Bay Software. All rights reserved. // #import "PathController.h" @interface PathController (Private) - (NSString *)serverPathToLocal:(NSString *)serverPath; - (NSString *)localPathToServer:(NSString *)localPath; - (NSString *)localPathToNormalized:(NSString *)localPath; - (BOOL)saveState; - (void)setPathActivity:(PathActivity)aPathActivity forPath:(NSString *)aLocalPath; - (PathMetadata *)pathMetadataForLocalPath:(NSString *)localPath createNewLocalIfNeeded:(BOOL)createIfNeeded; - (void)deletePathMetadataForLocalPath:(NSString *)localPath; - (void)initManagedObjectContext; - (void)postQueuedPathChangedNotifications; @end
// // TwitterDetailedViewController.h // BBCSherlock // // Created by B.H.Liu appublisher on 11-12-20. // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> #import "OHAttributedLabel.h" #import "NSAttributedString+Attributes.h" #import "AsyncImageView.h" @interface TwitterDetailedViewController : UIViewController @property (nonatomic, retain) OHAttributedLabel* textLabel; @property (nonatomic, retain) AsyncImageView *avatarImage; @property (nonatomic, retain) NSDictionary *tweetDict; - (id)initWithDict:(NSDictionary *)dict; @end
// // UIScrollView+YXDExtension.h // YXDExtensionDemo // // Copyright (c) 2015年 YangXudong. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, YXDLoadStatus) { YXDLoadStatusLoading = 1, YXDLoadStatusSuccess = 2, YXDLoadStatusEmpty = 3, YXDLoadStatusFailed = 4, }; @interface UIScrollView (YXDExtension) - (void)triggerLoading; - (void)setStatusSuccess; - (void)setStatusFail; - (void)setStatusEmpty; - (void)noticeFooterNoMoreData; //无 pullLoadingBlock 时 此方法无效 - (void)addLoadStatusViewWithPullLoadingBlock:(dispatch_block_t)pullLoadingBlock footerLoadingBlock:(dispatch_block_t)footerLoadingBlock; //仅 YXDLoadStatusEmpty 和 YXDLoadStatusFailed 有效 - (void)setTitle:(NSString *)title imageName:(NSString *)imageName forStatus:(YXDLoadStatus)status; @end
////////////////////////////////////////////////////////////////////////////// // // Copyright 2012 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // ////////////////////////////////////////////////////////////////////////////// // // Name: AcEdSteeringWheel.h // // Description: // /////////////////////////////////////////////////////////////////////////////// #pragma once #include "acgs.h" #include "dbNavSettings.h" class AcEdSteeringWheelReactor; class AcEdSteeringWheel; AcEdSteeringWheel* acedCreateSteeringWheel (); void acedDestroySteeringWheel(AcEdSteeringWheel* pWheel); /////////////////////////////////////////////////////////////////////////////// // // Interface AcEdSteeringWheel // class AcEdSteeringWheel { public: enum WheelType { kExterior = 0, ///< View Object Wheel. kInterior, ///< Tour Buiding Wheel. kFull, ///< Full Navigation Wheel. k2D, ///< 2D Steering Wheel. kMini, ///< Mini View Object Wheel. kMiniOther, ///< Mini Tour Building Wheel. kMiniEight, ///< Mini Full Navigation Wheel. kTotalCount, ///< Total number of SteeringWheel types. kWheelNone ///< Marks a disabled SteeringWheel. }; enum MenuType { // Steering Wheel Menus kMenuNone = 0, kMenuInterior, kMenuExterior, kMenuFull, kMenu2D }; // Message handlers virtual void onKeyDown (UINT nChar, UINT nRepCount, UINT nFlags) = 0; virtual void onKeyUp (UINT nChar, UINT nRepCount, UINT nFlags) = 0; virtual bool onMouseWheel (UINT nFlags, short zDelta, POINT pt) = 0; virtual void onMouseMove (UINT nFlags, POINT pt) = 0; virtual void onLButtonUp (UINT nFlags, POINT pt) = 0; virtual void onLButtonDown (UINT nFlags, POINT pt) = 0; virtual void onRButtonUp (UINT nFlags, POINT pt) = 0; virtual void onRButtonDown (UINT nFlags, POINT pt) = 0; virtual void onMButtonDown (UINT nFlags, POINT pt) = 0; virtual void onMButtonUp (UINT nFlags, POINT pt) = 0; virtual void setHomeCamera (const AcDbHomeView& home) = 0; virtual bool setLargeWheelOpacity (int nOpacity) = 0; virtual int getLargeWheelOpacity () = 0; virtual bool setMiniWheelOpacity (int nOpacity) = 0; virtual int getMiniWheelOpacity () = 0; virtual bool setWalkSpeed(double speed) = 0; virtual double getWalkSpeed() = 0; virtual bool setActiveWheel(WheelType type) = 0; virtual WheelType getActiveWheel() = 0; virtual void enableWheel (bool enable) = 0; virtual bool isWheelEnabled() = 0; virtual AcGsModel * getModel() = 0; virtual AcGsView * getView() = 0; virtual HWND getDeviceHandle() = 0; virtual bool attachView (HWND hDevice, AcGsView* pGsView) = 0; virtual void detachView () = 0; virtual void addReactor (AcEdSteeringWheelReactor* pReactor) = 0; virtual void removeReactor(AcEdSteeringWheelReactor* pReactor) = 0; }; /////////////////////////////////////////////////////////////////////////////// // // Interface AcEdSteeringWheelReactor // class AcEdSteeringWheelReactor { public: virtual void modifyContextMenu(HMENU hMenu) = 0; virtual void onSetCursor(HCURSOR hCursor) = 0; virtual void onBeginOperation() = 0; virtual void onEndOperation() = 0; virtual void onBeginShot() = 0; virtual void onEndShot() = 0; virtual void onClose() = 0; };
/* * Copyright 2013 MongoDB, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MONGOC_CURSOR_H #define MONGOC_CURSOR_H #if !defined (MONGOC_INSIDE) && !defined (MONGOC_COMPILATION) //#error "Only <mongoc.h> can be included directly." #endif #include <bson.h> #include "mongoc-host-list.h" BSON_BEGIN_DECLS typedef struct _mongoc_cursor_t mongoc_cursor_t; mongoc_cursor_t *mongoc_cursor_clone (const mongoc_cursor_t *cursor) BSON_GNUC_WARN_UNUSED_RESULT; void mongoc_cursor_destroy (mongoc_cursor_t *cursor); bool mongoc_cursor_more (mongoc_cursor_t *cursor); bool mongoc_cursor_next (mongoc_cursor_t *cursor, const bson_t **bson); bool mongoc_cursor_error (mongoc_cursor_t *cursor, bson_error_t *error); void mongoc_cursor_get_host (mongoc_cursor_t *cursor, mongoc_host_list_t *host); bool mongoc_cursor_is_alive (const mongoc_cursor_t *cursor); const bson_t *mongoc_cursor_current (const mongoc_cursor_t *cursor); void mongoc_cursor_set_batch_size (mongoc_cursor_t *cursor, uint32_t batch_size); uint32_t mongoc_cursor_get_batch_size (const mongoc_cursor_t *cursor); uint32_t mongoc_cursor_get_hint (const mongoc_cursor_t *cursor); int64_t mongoc_cursor_get_id (const mongoc_cursor_t *cursor); void mongoc_cursor_set_max_await_time_ms (mongoc_cursor_t *cursor, uint32_t max_await_time_ms); uint32_t mongoc_cursor_get_max_await_time_ms (const mongoc_cursor_t *cursor); BSON_END_DECLS #endif /* MONGOC_CURSOR_H */
#ifndef BUFFER_H #define BUFFER_H #include <algorithm> #include <cstdint> #include <iosfwd> #include <string> class Buffer { public: const std::size_t size; char *const data; Buffer() : Buffer(0) {} Buffer(const std::size_t size) : size(size), data(new char[size]) {} Buffer(const Buffer &other) : Buffer(other.size) { std::copy(other.data, other.data + other.size, data); } ~Buffer() { if (data) { delete[] data; } } std::string describe() const; template <typename T> auto &index(const int linidx) { return *(reinterpret_cast<T *>(data) + linidx); } }; inline std::ostream &operator<<(std::ostream &out, const Buffer &buf) { out << buf.describe(); return out; } #endif
#include <stdio.h> main() { char current_char = EOF; while ((current_char = getchar()) != EOF) { if (current_char == '\t') { printf("\\t"); } else if (current_char == '\b') { printf("\\b"); } else if (current_char == '\\') { printf("\\\\"); } else { printf("%c", current_char); } } }
/* ** ** File: mission8.h ** ** Author: Adam Davison ** ** Description: ** Header file for the training library "Mission Nan" interface. ** ** History: */ #ifndef _MISSION_NAN_H_ #define _MISSION_NAN_H_ #ifndef _TRAINING_MISSION_H_ #include "TrainingMission.h" #endif #ifndef _GOAL_H_ #include "Goal.h" #endif namespace Training { class Mission8 : public TrainingMission { public: virtual /* void */ ~Mission8 (void); virtual int GetMissionID (void); virtual SectorID GetStartSectorID (void); //virtual bool RestoreShip (void); protected: virtual void CreateUniverse (void); virtual Condition* CreateMission (void); Goal* CreateGoal01 (void); Goal* CreateGoal02 (void); Goal* CreateGoal03 (void); Goal* CreateGoal04 (void); Goal* CreateGoal05 (void); Goal* CreateGoal06 (void); Goal* CreateGoal07 (void); Goal* CreateGoal08 (void); Goal* CreateGoal09 (void); ImodelIGC* pShip; ImissionIGC* pMission; ImodelIGC* pStation; }; } #endif
#ifndef _EASYPSEUDO3D_H_ #define _EASYPSEUDO3D_H_ #include "libpseudo3d/config.h" #include "libpseudo3d/StageCanvas3D.h" #include "libpseudo3d/StageCanvas2D.h" #include "libpseudo3d/Proj2DEditOP.h" #endif // _EASYPSEUDO3D_H_
/* * print_chart.h * Kevin Coltin * * Contains functions for printing a chart of blackjack strategy to Latex. */ #ifndef PRINT_CHART_H #define PRINT_CHART_H #include <stdio.h> #include "bj_sims.h" #include "bj_strat.h" void printChart (Strategy **chart, const char *filename, int showWinPct, int MAKE_SIMPLE_CHART); void printHand (int i, Strategy **chart, int showWinPct, FILE *file); char * actionSymbol (int); void printSimsChart (HandSim **simsChart, Strategy **chart, const char *filename, int nsims); void printHandSims (int i, HandSim **simsChart, Strategy **chart, FILE *file, int nsims); #endif
/** * Copyright (c) 2015 Alexandre Vaillancourt. See full MIT license at the root of the repository. */ #pragma once #include <stdint.h> class DirtMap { public: DirtMap( float aWorldWidth, float aWorldHeight, int aCanvasWidth, int aCanvasHeight, float aDirtRate); ~DirtMap(); void simulateOneStep(); void patrol( float aX, float aY, float aRadius ); const float* getDirtMap() const { return mDirtMap; } const uint8_t* getDirtMapPix() const { return mIntMap; } uint8_t getDirtLevelScaled( float aX, float aY ); private: float mWorldWidth; float mWorldHeight; float mDirtRate; float* mDirtMap; uint8_t* mIntMap; float mDirtRatePerFrame; const float mSizeToGridScale; int mCanvasWidth; int mCanvasHeight; int mGridTileCount; float getDirtLevel( float aX, float aY ); };
#ifndef _KERNEL_VESA_H_ #define _KERNEL_VESA_H_ #include <Kernel/Kernel.h> struct VbeInfo { char Signature[4]; struct { u8 Minor; u8 Major; } Version; u16 Oem[2]; u8 Capabilities[4]; u16 VideoModes[2]; u16 TotalMemory; }; struct VbeModeInfo { u16 Attributes; u8 WindowA, WindowB; u16 Granularity; u16 WindowSize; u16 SegmentA, SegmentB; u16 WindowFunction[2]; u16 Pitch; u16 Width, Height; u8 CharacterWidth, CharacterHeight, Planes; u8 Bpp; u8 Banks; u8 PixelFormat, BankSize, ImagePages; u8 _Reserved0; u8 RedMask, RedShift; u8 GreenMask, GreenShift; u8 BlueMask, BlueShift; u8 _ReservedMask, _ReservedShift; u8 ColorAttributes; u32 Address; u32 _Reserved1; u16 _Reserved2; }; bool VESA_Call(u8 function, u16 b = 0, u16 c = 0, u16 d = 0, u16 destination = 0); VbeInfo VESA_GetInformations(); VbeModeInfo VESA_GetModeInformations(u16 mode); void VESA_SetMode(u16 mode); #endif
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Compiler\ShaderGenerator\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_UNO_COMPILER_SHADER_GENERATOR_SHADER_STAGE_INLINE_ATTRIBUTE_H__ #define __APP_UNO_COMPILER_SHADER_GENERATOR_SHADER_STAGE_INLINE_ATTRIBUTE_H__ #include <app/Uno.Attribute.h> #include <Uno.h> namespace app { namespace Uno { namespace Compiler { namespace ShaderGenerator { struct ShaderStageInlineAttribute; struct ShaderStageInlineAttribute__uType : ::app::Uno::Attribute__uType { }; ShaderStageInlineAttribute__uType* ShaderStageInlineAttribute__typeof(); void ShaderStageInlineAttribute___ObjInit_1(ShaderStageInlineAttribute* __this); ShaderStageInlineAttribute* ShaderStageInlineAttribute__New_1(::uStatic* __this); struct ShaderStageInlineAttribute : ::app::Uno::Attribute { void _ObjInit_1() { ShaderStageInlineAttribute___ObjInit_1(this); } }; }}}} #endif
#include <stdio.h> #include <stdlib.h> void next_generation(int *current, int *next, int length); int main() { int i, j, sum; int n,current[20], next[20]; do{ scanf("%d", &n); }while(n < 0 && n > 20); for(i=0;i<n;i++) scanf(" %d", &current[i]); next[0]=0; next[n-1]=0; for(i = 0;i < 1000; i++) { sum = 0; for(j = 0;j < n; j++) { if(current[j] == 0) sum++; } next_generation(current, next, n); if(sum == n) { break; } } return 0; } void next_generation(int *current, int *next, int length) { int i; for(i = 0; i < length; i++) { if(current[i] == 1) printf("*"); else printf("."); } for(i = 1; i < length - 1; i++) { if(current[i-1] == 1 && current[i+1] == 0) next[i] = 1; else if(current[i-1] == 0 && current[i+1] == 1) next[i] = 1; else next[i] = 0; } for(i=0;i<length;i++) { current[i]=next[i]; } printf("\n"); }
// // PhotoCardViewController.h // Whetstone-iOS // // Created by Philip James on 11/24/13. // Copyright (c) 2013 Philip James. All rights reserved. // #import <UIKit/UIKit.h> @interface PhotoCardViewController : UIViewController @property (nonatomic) float duration; @end
/* * protos.h * by WN @ May. 27, 2010 */ #ifndef PROTOS_H #define PROTOS_H #ifndef ATTR_HIDDEN # define ATTR_HIDDEN __attribute__((visibility ("hidden"))) #endif #include <xasm/unistd_32.h> #include "syscall_table.h" /* provide prototypes of system call handlers */ extern int trivial_pre_handler(struct pusha_regs * regs); extern int trivial_post_handler(struct pusha_regs * regs); extern int trivial_replay_handler(struct pusha_regs * regs); #define __def_handler(name, pre, post, replay) \ extern int pre(struct pusha_regs * regs) ATTR_HIDDEN; \ extern int post(struct pusha_regs * regs) ATTR_HIDDEN; \ extern int replay(struct pusha_regs * regs) ATTR_HIDDEN; #define def_trivial_handler(name) #define def_handler(name) \ extern int post_##name(struct pusha_regs * regs) ATTR_HIDDEN; \ extern int replay_##name(struct pusha_regs * regs) ATTR_HIDDEN; #define def_complex_handler(name) \ __def_handler(name, pre_##name, post_##name, replay_##name) #include "handlers.h" #undef def_complex_handler #undef def_handler #undef def_trivial_handler #undef __def_handler #endif
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import <GPUImage.h> #import <GPUImage/GPUImageFASTCornerDetectionFilter.h>
// // DDPVolumeView.h // DanDanPlayForiOS // // Created by JimHuang on 2017/10/2. // Copyright © 2017年 JimHuang. All rights reserved. // #import <MediaPlayer/MediaPlayer.h> @interface DDPVolumeView : MPVolumeView @property (assign, nonatomic) CGFloat ddp_volume; @end