text
stringlengths
4
6.14k
// // SplitShowScreen.h // SplitShow // // Created by Moritz Pflanzer on 21/02/2016. // Copyright © 2016 Moritz Pflanzer. All rights reserved. // #import <Cocoa/Cocoa.h> @class PDFDocument; typedef enum : NSUInteger { SplitShowScreenModePreview, SplitShowScreenModeWindow, SplitShowScreenModeFullscreen, } SplitShowScreenMode; @interface SplitShowScreen : NSObject<NSCoding> @property (readonly) NSString *name; @property (readonly) CGDirectDisplayID displayID; @property (readonly) NSScreen *screen; @property PDFDocument *document; @property SplitShowScreenMode mode; @property BOOL showTimer; + (instancetype)previewScreen; + (instancetype)windowScreen; + (instancetype)screenWithScreen:(SplitShowScreen*)screen; - (instancetype)initWithDisplayID:(CGDirectDisplayID)displayID; - (instancetype)initWithScreen:(NSScreen*)screen; - (BOOL)isPseudoScreen; - (BOOL)isAvailable; - (BOOL)isEqualToSplitShowScreen:(SplitShowScreen*)screen; @end
// // MKPolygon.h // MapKit // // Created by Rick Fillion on 7/15/10. // Copyright 2010 Centrix.ca. All rights reserved. // #import <Foundation/Foundation.h> #import <MapKit/MKMultiPoint.h> #import <MapKit/MKOverlay.h> @interface MKPolygon : MKMultiPoint <MKOverlay> { NSArray *interiorPolygons; } @property (readonly) NSArray *interiorPolygons; + (MKPolygon *)polygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count; + (MKPolygon *)polygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons; @end
// // ViewController.h // SXJOrientationLockDetector // // Created by Xinjiang Shao on 11/30/15. // Copyright © 2015 Xinjiang Shao. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
//Copyright (c) 2016 Artem A. Mavrin and other contributors #pragma once #include "IPropertyTypeCustomization.h" #include "Runtime/Engine/Classes/Matinee/MatineeActor.h" #include "Runtime/LevelSequence/Public/LevelSequenceActor.h" #include "IDetailChildrenBuilder.h" class IPropertyHandle; class FTextPhrasesCustomization : public IPropertyTypeCustomization { public: static TSharedRef<IPropertyTypeCustomization> MakeInstance(); /** IPropertyTypeCustomization interface */ virtual void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; virtual void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; FText GetTimeToolTip() const; private: /** Property handles of the properties we're editing */ TSharedPtr<IPropertyHandle> Phrase; TSharedPtr<IPropertyHandle> SoundToPlay; TSharedPtr<IPropertyHandle> ShowingTime; }; class FTextOptionsCustomization : public IPropertyTypeCustomization { public: static TSharedRef<IPropertyTypeCustomization> MakeInstance(); /** IPropertyTypeCustomization interface */ virtual void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; virtual void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; EVisibility GetDelayVisibility() const; private: /** Property handles of the properties we're editing */ TSharedPtr<IPropertyHandle> bShowTextPhrases; TSharedPtr<IPropertyHandle> bHideLastPhrase; TSharedPtr<IPropertyHandle> GeneralShowingTime; TSharedPtr<IPropertyHandle> UseGeneralTime; TSharedPtr<IPropertyHandle> bShowRandomPhrase; TSharedPtr<IPropertyHandle> DialoguePhraseSlotName; TSharedPtr<IPropertyHandle> DialogueQuestionsSlotName; TSharedPtr<IPropertyHandle> Phrases; TSharedPtr<IPropertyHandle> TextEffect; TSharedPtr<IPropertyHandle> Delay; }; class FCinematicOptionsCustomization : public IPropertyTypeCustomization { public: static TSharedRef<IPropertyTypeCustomization> MakeInstance(); /** IPropertyTypeCustomization interface */ virtual void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; virtual void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; void OnSettingMatineeChange(FString NewValue); TSharedRef<SWidget> OnGetMatineeList() const; FText GetCurrentMatineeName() const; void OnSettingSequenceChange(FString NewValue); TSharedRef<SWidget> OnGetSequenceList() const; FText GetCurrentSequenceName() const; private: TSharedPtr<IPropertyHandle> bPlayMatinee; TSharedPtr<IPropertyHandle> Matinee; /** Property handles of the properties we're editing */ TSharedPtr<IPropertyHandle> bPlaySeq; TSharedPtr<IPropertyHandle> bLoop; TSharedPtr<IPropertyHandle> bAutoPlay; TSharedPtr<IPropertyHandle> bDialogueCamType; TSharedPtr<IPropertyHandle> bUseCam; TSharedPtr<IPropertyHandle> Sequence; };
// // Copyright (c) 2015, Microsoft Corporation // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // #pragma once #include "IAdapter.h" namespace Bridge { class ControlPanel; // To handle a device's change of value signal, a class must be registered with the Adapter. class WidgetSignalHandler final : public IAdapterSignalListener { public: // Signal Handler Called by Signal Dispatcher. void AdapterSignalHandler(_In_ std::shared_ptr<IAdapter> sender, _In_ std::shared_ptr<IAdapterSignal> Signal, _In_opt_ intptr_t Context) override; //internal: // Constructor WidgetSignalHandler(ControlPanel* pControlPanel); // Control Panel to forward Signal Change to ControlPanel* m_pControlPanel; }; }
/* * Nama File : Tombol.h * Deskripsi : Library untuk setting tombol dan membaca state dari tombol. */ #ifndef _TOMBOL_h #define _TOMBOL_h #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif #define DEBOUNCING_TIME 50 class Tombol { private: uint8_t pinTombol; unsigned long debounceTerakhir; boolean stateTerakhir; public: Tombol(const uint8_t _pinTombol); void bacaState(boolean &stateIn, boolean &stateOut); }; #endif
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #include <unistd.h> #include "constants.c" #include "jkiss.c" #include "util.c" #include "bitboard.c" #include "scoring.c" #include "state.c" #include "deal.c" #include "eval.c" #include "multiplayer.c" #include "tree.c" #include "template.c" #include "template_gen.c" #include "todo.c" #include "harassment.c" #include "complex_policy.c" #include "demo.c" #include "test.c" #include "benchmark.c" #include "info.c" void init_all() { jkiss_init(); init_tetrominoes(); } int main(int argc, char *argv[]) { init_all(); test_all(); for (int i = 0; i < 100; ++i) { printf("\n"); } game *g = new_game(2, 3); for (int i = 0; i < 10000; ++i) { content_t choices[2] = { gcn_game_policy(g, 0), gcnk_game_policy(g, 1), }; step_game(g, choices); print_player(g->players); print_deals(g->deals + g->players[0].deal_index, g->num_deals); print_player(g->players + 1); print_deals(g->deals + g->players[1].deal_index, g->num_deals); //usleep(50000); } return 0; }
// Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SYSCOIN_RPC_REGISTER_H #define SYSCOIN_RPC_REGISTER_H /** These are in one header file to avoid creating tons of single-function * headers for everything under src/rpc/ */ class CRPCTable; /** Register block chain RPC commands */ void RegisterBlockchainRPCCommands(CRPCTable &tableRPC); /** Register P2P networking RPC commands */ void RegisterNetRPCCommands(CRPCTable &tableRPC); /** Register miscellaneous RPC commands */ void RegisterMiscRPCCommands(CRPCTable &tableRPC); /** Register mining RPC commands */ void RegisterMiningRPCCommands(CRPCTable &tableRPC); /** Register raw transaction RPC commands */ void RegisterRawTransactionRPCCommands(CRPCTable &tableRPC); // SYSCOIN /** Register Syscoin Asset RPC commands */ void RegisterAssetRPCCommands(CRPCTable &tableRPC); /** Register masternode RPC commands */ void RegisterMasternodeRPCCommands(CRPCTable &tableRPC); /** Register governance RPC commands */ void RegisterGovernanceRPCCommands(CRPCTable &tableRPC); /** Register Evo RPC commands */ void RegisterEvoRPCCommands(CRPCTable &tableRPC); /** Register Quorums RPC commands */ void RegisterQuorumsRPCCommands(CRPCTable &tableRPC); /** Register raw transaction RPC commands */ void RegisterSignerRPCCommands(CRPCTable &tableRPC); static inline void RegisterAllCoreRPCCommands(CRPCTable &t) { RegisterBlockchainRPCCommands(t); RegisterNetRPCCommands(t); RegisterMiscRPCCommands(t); RegisterMiningRPCCommands(t); RegisterRawTransactionRPCCommands(t); // SYSCOIN RegisterAssetRPCCommands(t); RegisterMasternodeRPCCommands(t); RegisterGovernanceRPCCommands(t); RegisterEvoRPCCommands(t); RegisterQuorumsRPCCommands(t); #ifdef ENABLE_EXTERNAL_SIGNER RegisterSignerRPCCommands(t); #endif // ENABLE_EXTERNAL_SIGNER } #endif // SYSCOIN_RPC_REGISTER_H
/* * memops - try to combine memory ops. * * Copyright (C) 2004 Linus Torvalds */ #include <string.h> #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #include <stddef.h> #include <assert.h> #include "parse.h" #include "expression.h" #include "linearize.h" #include "flow.h" static int find_dominating_parents_memops(pseudo_t pseudo, struct instruction *insn, struct basic_block *bb, unsigned long generation, struct pseudo_list **dominators, int local, int loads) { struct basic_block *parent; if (bb_list_size(bb->parents) > 1) loads = 0; FOR_EACH_PTR(bb->parents, parent) { struct instruction *one; struct instruction *br; pseudo_t phi; FOR_EACH_PTR_REVERSE(parent->insns, one) { int dominance; if (one == insn) goto no_dominance; dominance = dominates(pseudo, insn, one, local); if (dominance < 0) { if (one->opcode == OP_LOAD) continue; return 0; } if (!dominance) continue; if (one->opcode == OP_LOAD && !loads) continue; goto found_dominator; } END_FOR_EACH_PTR_REVERSE(one); no_dominance: if (parent->generation == generation) continue; parent->generation = generation; if (!find_dominating_parents_memops(pseudo, insn, parent, generation, dominators, local, loads)) return 0; continue; found_dominator: br = delete_last_instruction(&parent->insns); phi = alloc_phi(parent, one->target, one->size); phi->ident = phi->ident ? : one->target->ident; add_instruction(&parent->insns, br); use_pseudo(insn, phi, add_pseudo(dominators, phi)); } END_FOR_EACH_PTR(parent); return 1; } static int address_taken(pseudo_t pseudo) { struct pseudo_user *pu; FOR_EACH_PTR(pseudo->users, pu) { struct instruction *insn = pu->insn; if (insn->bb && (insn->opcode != OP_LOAD && insn->opcode != OP_STORE)) return 1; } END_FOR_EACH_PTR(pu); return 0; } static int local_pseudo(pseudo_t pseudo) { return pseudo->type == PSEUDO_SYM && !(pseudo->sym->ctype.modifiers & (MOD_STATIC | MOD_NONLOCAL)) && !address_taken(pseudo); } static void simplify_loads(struct basic_block *bb) { struct instruction *insn; FOR_EACH_PTR_REVERSE(bb->insns, insn) { if (!insn->bb) continue; if (insn->opcode == OP_LOAD) { struct instruction *dom; pseudo_t pseudo = insn->src; int local = local_pseudo(pseudo); struct pseudo_list *dominators; unsigned long generation; /* Check for illegal offsets.. */ check_access(insn); RECURSE_PTR_REVERSE(insn, dom) { int dominance; if (!dom->bb) continue; dominance = dominates(pseudo, insn, dom, local); if (dominance) { /* possible partial dominance? */ if (dominance < 0) { if (dom->opcode == OP_LOAD) continue; goto next_load; } /* Yeehaa! Found one! */ convert_load_instruction(insn, dom->target); goto next_load; } } END_FOR_EACH_PTR_REVERSE(dom); /* OK, go find the parents */ generation = ++bb_generation; bb->generation = generation; dominators = NULL; if (find_dominating_parents_memops(pseudo, insn, bb, generation, &dominators, local, 1)) { /* This happens with initial assignments to structures etc.. */ if (!dominators) { if (local) { assert(pseudo->type != PSEUDO_ARG); convert_load_instruction(insn, value_pseudo(0)); } goto next_load; } rewrite_load_instruction(insn, dominators); } } next_load: /* Do the next one */; } END_FOR_EACH_PTR_REVERSE(insn); } static void kill_store_memops(struct instruction *insn) { if (insn) { insn->bb = NULL; insn->opcode = OP_SNOP; kill_use(&insn->target); } } static void kill_dominated_stores_memops(struct basic_block *bb) { struct instruction *insn; FOR_EACH_PTR_REVERSE(bb->insns, insn) { if (!insn->bb) continue; if (insn->opcode == OP_STORE) { struct instruction *dom; pseudo_t pseudo = insn->src; int local = local_pseudo(pseudo); RECURSE_PTR_REVERSE(insn, dom) { int dominance; if (!dom->bb) continue; dominance = dominates(pseudo, insn, dom, local); if (dominance) { /* possible partial dominance? */ if (dominance < 0) goto next_store; if (dom->opcode == OP_LOAD) goto next_store; /* Yeehaa! Found one! */ kill_store_memops(dom); } } END_FOR_EACH_PTR_REVERSE(dom); /* OK, we should check the parents now */ } next_store: /* Do the next one */; } END_FOR_EACH_PTR_REVERSE(insn); } void simplify_memops(struct entrypoint *ep) { struct basic_block *bb; FOR_EACH_PTR_REVERSE(ep->bbs, bb) { simplify_loads(bb); } END_FOR_EACH_PTR_REVERSE(bb); FOR_EACH_PTR_REVERSE(ep->bbs, bb) { kill_dominated_stores_memops(bb); } END_FOR_EACH_PTR_REVERSE(bb); }
#include <string.h> #include "hawkc.h" #include "common.h" #include "test.h" static struct HawkcContext ctx; static HawkcError e; static char scheme_buf[1024]; static char buf[1024]; static HawkcError scheme_handler(HawkcContext ctx,HawkcString scheme,void *data) { memset(scheme_buf,0,sizeof(scheme_buf)); memset(buf,0,sizeof(buf)); memcpy(scheme_buf,scheme.data,scheme.len); return HAWKC_OK; } static HawkcError param_handler(HawkcContext ctx,HawkcString key, HawkcString value,void *data) { strcat(buf,"<"); strncat(buf,(char*)key.data,key.len); strcat(buf,":"); strncat(buf,(char*)value.data,value.len); strcat(buf,">"); return HAWKC_OK; } int test_scheme_only() { e = hawkc_parse_auth_header(&ctx,(unsigned char*)"",0,scheme_handler, param_handler,NULL); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Foo",3,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Foo",scheme_buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Foo ",4,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Foo",scheme_buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Foo ",5,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Foo",scheme_buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Foo\t ",6,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Foo",scheme_buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=b",8,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk\ta=b",8,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a = b ",16,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk \t a = b",15,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=b,c=d",12,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=b, c=d",13,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=b, c=d, ",15,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=b, c=, ",14,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_PARSE_ERROR,e,&ctx); return 0; } int test_quoted_string() { e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\"",10,scheme_handler, param_handler,NULL); if(e != HAWKC_OK) { printf("e:%s\n" , hawkc_get_error(&ctx)); } EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\",c=\"d\"",16,scheme_handler, param_handler,NULL); if(e != HAWKC_OK) { printf("e:%s\n" , hawkc_get_error(&ctx)); } /* printf("e:%s\n" , hawkc_get_error(&ctx)); */ EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\",c=\"d\\\"d\"",19,scheme_handler, param_handler,NULL); if(e != HAWKC_OK) { printf("e:%s\n" , hawkc_get_error(&ctx)); } EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d\\\"d>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\",c=\"d\\\"\"",18,scheme_handler, param_handler,NULL); if(e != HAWKC_OK) { printf("e:%s\n" , hawkc_get_error(&ctx)); } EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d\\\">",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\",c=\"d\\\nd\"",19,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d\\\nd>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\",c=\"d\\\td\"",19,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d\\\td>",buf); e = hawkc_parse_auth_header(&ctx,(unsigned char*)"Hawk a=\"b\",c=d",14,scheme_handler, param_handler,NULL); EXPECT_RETVAL(HAWKC_OK,e,&ctx); EXPECT_STR_EQUAL("Hawk",scheme_buf); EXPECT_STR_EQUAL("<a:b><c:d>",buf); return 0; } int main(int argc, char **argv) { hawkc_context_init(&ctx); RUNTEST(argv[0],test_scheme_only); RUNTEST(argv[0],test_quoted_string); return 0; }
#ifndef _LASTNAME_ORDER_SUM_QUERY_H_ #define _LASTNAME_ORDER_SUM_QUERY_H_ #include <tuple> #include "../src/tpcc.h" void lastnameOrderSumQuery(Tpcc*); #endif
#include <stdio.h> #include "utils.h" int solution(){ int x, y, v, largest_number; for(x = 100; x < 999; x++){ for(y = 100; y < 999; y++){ v = x * y; if(v > largest_number && is_palindrome(v) == 0){ largest_number = v; } } } return largest_number; } int main(int argc, char *argv[]){ return int_time_it(solution); }
// // UIView+Animation.h // Sherlock // // Created by Soheil Rashidi on 4/3/13. // Copyright (c) 2013 Softtool. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (Animation) - (void)shake; @end
//Chris Wells 2015 //956335 //October 29, 2014 //switchoddeven.c //Purpose: To allo9w the user to enter an unkown amount of integers and use a switch statement to determine whether they are odd or even. #include <stdio.h> //Begin main function void main() { int num; //Declare variable to store entered integer int i = 1; //Initialize counter variable //Request integers from user and determine whether they are even or odd while( i == 1 ) { //Request integer from user printf("Please enter an integer: "); scanf("%d", &num); //Determine whether the entered number is even or odd switch( ( num % 2 ) ) { //Number is even case 0: printf("%d is even.\n", num); break; //Number is odd and positive case 1: printf("%d is odd.\n", num); break; //Number is odd and negative case -1: printf("%d is odd.\n", num); break; } //Request whether the user wants to enter another integer or not printf("Would you like to enter another integer? (1 = yes, 0 = no): "); scanf("%d", &i); } }
// // TWViewController.h // TWiOSReverseAuthExample // // Copyright (c) 2013 Sean Cook // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // #import <UIKit/UIKit.h> #import "TwitterSignInManager.h" @interface TWViewController : UIViewController <TwitterSignManagerDelegate> @end
#ifndef __PROJECT_EULER_PROBLEM079_H__ #define __PROJECT_EULER_PROBLEM079_H__ /* * ProjectEuler/include/c/ProjectEuler/Problem079.h * * Passcode derivation * =================== * Published on Friday, 17th September 2004, 06:00 pm * * A common security method used for online banking is to ask the user for three * random characters from a passcode. For example, if the passcode was 531278, * they may ask for the 2nd, 3rd, and 5th characters; the expected reply would * be: 317. The text file, keylog.txt, contains fifty successful login attempts. * Given that the three characters are always asked for in order, analyse the * file so as to determine the shortest possible secret passcode of unknown * length. */ # ifdef __cplusplus extern "C" { # endif # ifdef __cplusplus } # endif #endif /* __PROJECT_EULER_PROBLEM079_H__ */
#include "tev.h" #include "tev_port.h" static int tev__timer_compare(const struct heap_node *a, const struct heap_node *b) { tev_timer_t *timer_a = (tev_timer_t *)((size_t)a - offsetof(tev_timer_t, heap_node)); tev_timer_t *timer_b = (tev_timer_t *)((size_t)b - offsetof(tev_timer_t, heap_node)); return timer_a->time < timer_b->time ? 1 : 0; } int tev_timer_init(tev_loop_t *loop, tev_timer_t *handle) { tev__handle_init(loop, (tev_handle_t *)handle); handle->cb = NULL; handle->handle_type = TEV_HANDLE_TYPE_TIMER; return 0; } int tev_timer_start(tev_timer_t *handle, tev_timer_cb cb, uint64_t time, uint64_t repeat) { handle->time = handle->loop->time + time; handle->repeat = repeat; handle->cb = cb; heap_insert(&handle->loop->timer_heap, &handle->heap_node, tev__timer_compare); return 0; } int tev__timer_stop(tev_timer_t *handle) { heap_remove(&handle->loop->timer_heap, &handle->heap_node, tev__timer_compare); return 0; }
// // VDKSketchMSNormalInspectorProtocol.h // KeysForSketch // // Created by Vyacheslav Dubovitsky on 17/09/2017. // Copyright © 2017 Vyacheslav Dubovitsky. All rights reserved. // @protocol VDKSketchMSStandardInspectorViewControllersProtocol; @protocol VDKSketchMSNormalInspectorProtocol @property(nonnull, readonly, nonatomic) NSObject<VDKSketchMSStandardInspectorViewControllersProtocol> *standardInspectors; @end
// // WaitForPayViewController.h // MaShangTong-Driver // // Created by NY on 15/11/25. // Copyright © 2015年 jeaner. All rights reserved. // #import <UIKit/UIKit.h> #import "PassengerModel.h" @interface WaitForPayViewController : UIViewController @property (nonatomic,strong) DataModel *model; @property (nonatomic,strong) NSString *price; @end
/* * Alphabet.h * * Created on: Mar 28, 2014 * Author: yuanz */ #ifndef ALPHABET_H_ #define ALPHABET_H_ #include <string> #include <vector> #include <unordered_map> namespace segparser { using namespace std; class Alphabet { public: Alphabet(); Alphabet(int capacity); virtual ~Alphabet(); int lookupIndex (const string& entry, bool addIfNotPresent); int lookupIndex (const string& entry); void toArray(vector<string>& key); int size(); void stopGrowth(); void writeObject (FILE* fs); void readObject (FILE* fs); private: unordered_map<string, int> map; int numEntries; bool growthStopped; }; } /* namespace segparser */ #endif /* ALPHABET_H_ */
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <memory> #include <vector> #include "ConcurrentContainers.h" #include "DexClass.h" #include "IRInstruction.h" #include "MethodOverrideGraph.h" #include "MethodUtil.h" namespace init_classes { using InitClasses = std::vector<const DexClass*>; /** * For a given scope, this class provides information about which static * initializer with side effects get triggered when some class is initialized. */ class InitClassesWithSideEffects { private: ConcurrentMap<const DexType*, std::shared_ptr<InitClasses>> m_init_classes; std::atomic<size_t> m_trivial_init_classes{0}; InitClasses m_empty_init_classes; bool m_create_init_class_insns; const InitClasses* compute( const DexClass* cls, const method::ClInitHasNoSideEffectsPredicate& clinit_has_no_side_effects, const std::unordered_set<DexMethod*>* non_true_virtuals); public: InitClassesWithSideEffects( const Scope& scope, bool create_init_class_insns, const method_override_graph::Graph* method_override_graph = nullptr); // Determine list of classes with static initializers with side effects that // would get triggered when the given type is initialized. The list is ordered // such that base types come later. const InitClasses* get(const DexType* type) const; // Given a type to be initialized, determine the most derived class with a // static initializer with side effects that would get triggered, if any. const DexType* refine(const DexType* type) const; // Given a type to be initialized, create an init-class instruction with the // most derived class static initializer with side effects that would get // triggered. If there is no such class, returns nullptr. IRInstruction* create_init_class_insn(const DexType* type) const; }; } // namespace init_classes
// // EOConfiguration.h // Digitaleo // // Created by Clément Roulland on 09/06/2015. // Copyright (c) 2015 Digitaleo. All rights reserved. // #import <Foundation/Foundation.h> #import "EOConfigurationSettings.h" @interface EOConfiguration : NSObject ///-------------------------------------- #pragma mark - Properties ///-------------------------------------- /// Url of Mobile Digitaleo API @property NSString *mobileUrl; /// Url of OAuth Digitaleo API @property NSString *oAuthUrl; /// Url of CustomerMaster Digitaleo API @property NSString *customerMasterUrl; /// Url of Loyalty Digitaleo API @property NSString *loyaltyUrl; /// Settings to use (clientId, clientSecret) @property EOConfigurationSettings *settings; ///-------------------------------------- #pragma mark - Static gets/sets ///-------------------------------------- /** Return default configuration */ + (EOConfiguration *)defaultConfiguration; /** Set static default configuration */ + (void)setDefaultConfiguration:(EOConfiguration *)configuration; @end
#pragma once class CMiniDump { public: static BOOL Begin(); static BOOL End(); };
#ifndef CONFIGFILE_H #define CONFIGFILE_H #include "QSettings" typedef QList< QMap<QString, QVariant> > LISTMAPINFO; class ConfigFile { public: ConfigFile(const QString &path); ~ConfigFile(); public: void initMainConfig(); /////////////////////////////////////////////////////////////////// //»ñÈ¡·¢Éù·½·¨ QString getSpeakMethod() { return cfg->value("SpeakTTS/SpeakMethod", "eSpeakTTS").toString(); } void setSpeakMethod(const QString &speakMethod) { cfg->setValue("SpeakTTS/SpeakMethod", speakMethod); } /////////////////////////////////////////////////////////////////// //»ñÈ¡µÚÈý·½·¢ÒôÒýÇæ·½ QString getQtSpeakTTS() { return cfg->value("SpeakTTS/QtSpeakTTS", "").toString(); } void setQtSpeakTTS(const QString &QtSpeakTTS) { cfg->setValue("SpeakTTS/QtSpeakTTS", QtSpeakTTS); } /////////////////////////////////////////////////////////////////// //SpeakTTS /////////////////////// //ÓïËÙµ÷½Ú¼Ç¼ QString getSpeakSpeed() { return cfg->value("SpeakTTS/SpeackRate", "0").toString(); } void setSpeakSpeed(const QString &speakSpeed) { cfg->setValue("SpeakTTS/SpeackRate", speakSpeed); } private: LISTMAPINFO getLMI(const QString & prefix); void setLMI(const QString & prefix, LISTMAPINFO &lmi); private: QSettings *cfg; }; #endif // CONFIGFILE_H
/* * Copyright (c) 2008 - 2010 NVIDIA Corporation. All rights reserved. * * NVIDIA Corporation and its licensors retain all intellectual property and proprietary * rights in and to this software, related documentation and any modifications thereto. * Any use, reproduction, disclosure or distribution of this software and related * documentation without an express license agreement from NVIDIA Corporation is strictly * prohibited. * * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF * SUCH DAMAGES */ #ifndef __optixu_optixpp_h__ #define __optixu_optixpp_h__ /* optixpp.h used to include optix_math.h, so we include it here for backward compatibility. Please include optixpp_namespace.h and optixu_math_namespace.h separately in the future. This needs to be included first in order to make sure the CUDA vector types are defined in the global namespace necessary to maintain backward compatibility. */ #include "optixu_math.h" #include "optixpp_namespace.h" /* * optixpp's classes origninally were in the optixu namespace but have subsequently been * moved to the optix namespace. For backward compatibility we provide the optixu * namespace here. */ namespace optixu { using optix::AccelerationObj; using optix::BufferObj; using optix::ContextObj; using optix::GeometryObj; using optix::GeometryGroupObj; using optix::GeometryInstanceObj; using optix::GroupObj; using optix::MaterialObj; using optix::ProgramObj; using optix::SelectorObj; using optix::TextureSamplerObj; using optix::TransformObj; using optix::VariableObj; using optix::APIObj; using optix::DestroyableObj; using optix::ScopedObj; using optix::Handle; using optix::Acceleration; using optix::Buffer; using optix::Context; using optix::Geometry; using optix::GeometryGroup; using optix::GeometryInstance; using optix::Group; using optix::Material; using optix::Program; using optix::Selector; using optix::TextureSampler; using optix::Transform; using optix::Variable; using optix::Exception; } /* end namespace optixu */ #endif /* __optixu_optixpp_h__ */
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "CCActionJumpBy.h" #import "NSCopying.h" @interface CCActionJumpTo : CCActionJumpBy <NSCopying> { } - (void)startWithTarget:(id)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 "NSObject.h" @class NSHashTable, NSRecursiveLock; @interface AVObjectRegistry : NSObject { NSHashTable *_registeredObjects; NSRecursiveLock *_lock; } + (id)defaultObjectRegistry; - (void)safePostDelayedNotificationFromThread:(id)arg1 target:(id)arg2 name:(id)arg3 userInfo:(id)arg4; - (void)safePostNotificationFromThread:(id)arg1 target:(id)arg2 name:(id)arg3 userInfo:(id)arg4; - (void)safePerformOnThread:(id)arg1 target:(id)arg2 selector:(SEL)arg3 object:(id)arg4; - (void)safePostNotificationFromMainThreadTarget:(id)arg1 name:(id)arg2 userInfo:(id)arg3; - (void)safePostDelayedNotificationFromMainThreadTarget:(id)arg1 name:(id)arg2 userInfo:(id)arg3; - (void)safePerformOnMainThreadTarget:(id)arg1 selector:(SEL)arg2 object:(id)arg3; - (void)safePerformOnMainThreadTarget:(id)arg1 selector:(SEL)arg2 object:(id)arg3 delay:(double)arg4; - (void)safePerformTarget:(id)arg1 selector:(SEL)arg2 object:(id)arg3 delay:(double)arg4; - (void)safeInvokeWithDescriptionDelayed:(id)arg1; - (void)safeInvokeWithDescription:(id)arg1; - (void)unregisterObject:(id)arg1; - (void)registerObject:(id)arg1; - (_Bool)safeRetainObject:(id)arg1; - (void)registerObjectForSafeRetain:(id)arg1; - (void)dealloc; - (id)init; @end
#pragma once #include <tuple> namespace mtt { inline namespace v1 { template <std::size_t N, class... Ts> using NthType = typename std::tuple_element_t<N, std::tuple<Ts...>>; } }
/* The MIT License (MIT) Copyright (c) [2016] [BTC.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. */ #ifndef SHARELOGGER_ETH_H_ #define SHARELOGGER_ETH_H_ #include "ShareLogger.h" #include "StratumEth.h" ////////////////////////////// Alias /////////////////////////////// using ShareLogWriterEth = ShareLogWriterT<ShareEth>; #endif // SHARELOGGER_ETH_H_
////////////////////////////////////////////////////////////////////////////// // // Copyright 2013 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. // ////////////////////////////////////////////////////////////////////////////// // // DESCRIPTION: // // This file contains the class AcGePlanarEnt. It is an abstract class // representing an oriented plane in 3-space. #ifndef AC_GEPLANAR_H #define AC_GEPLANAR_H #include "gesurf.h" #include "gevec3d.h" #pragma pack (push, 8) class AcGeLineSeg3d; class AcGeLinearEnt3d; class AcGeCircArc3d; class GE_DLLEXPIMPORT AcGePlanarEnt : public AcGeSurface { public: // Intersection // Adesk::Boolean intersectWith (const AcGeLinearEnt3d& linEnt, AcGePoint3d& pnt, const AcGeTol& tol = AcGeContext::gTol) const; // Closest point // AcGePoint3d closestPointToLinearEnt (const AcGeLinearEnt3d& line, AcGePoint3d& pointOnLine, const AcGeTol& tol = AcGeContext::gTol) const; AcGePoint3d closestPointToPlanarEnt (const AcGePlanarEnt& otherPln, AcGePoint3d& pointOnOtherPln, const AcGeTol& tol = AcGeContext::gTol) const; // Direction tests. // Adesk::Boolean isParallelTo (const AcGeLinearEnt3d& linEnt, const AcGeTol& tol = AcGeContext::gTol) const; Adesk::Boolean isParallelTo (const AcGePlanarEnt& otherPlnEnt, const AcGeTol& tol = AcGeContext::gTol) const; Adesk::Boolean isPerpendicularTo (const AcGeLinearEnt3d& linEnt, const AcGeTol& tol = AcGeContext::gTol) const; Adesk::Boolean isPerpendicularTo (const AcGePlanarEnt& linEnt, const AcGeTol& tol = AcGeContext::gTol) const; // Point set equality. // Adesk::Boolean isCoplanarTo (const AcGePlanarEnt& otherPlnEnt, const AcGeTol& tol = AcGeContext::gTol) const; // Get methods. // void get (AcGePoint3d&, AcGeVector3d& uVec, AcGeVector3d& vVec) const; void get (AcGePoint3d&, AcGePoint3d& origin, AcGePoint3d&) const; // Geometric properties. // AcGePoint3d pointOnPlane () const; AcGeVector3d normal () const; void getCoefficients(double& a, double& b, double& c, double& d) const; void getCoordSystem(AcGePoint3d& origin, AcGeVector3d& axis1, AcGeVector3d& axis2) const; // Assignment operator. // AcGePlanarEnt& operator = (const AcGePlanarEnt& src); protected: AcGePlanarEnt (); AcGePlanarEnt (const AcGePlanarEnt&); }; #pragma pack (pop) #endif
/* Copyright (c) 2014, Artak Khnkoyan <artak.khnkoyan@gmail.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. */ #ifndef API_MISC_H_INCLUDED #define API_MISC_H_INCLUDED int api_close(int fd); #endif // API_MISC_H_INCLUDED
#ifndef __CALAYOUT_H__ #define __CALAYOUT_H__ #include "basics/CAObject.h" #include <math.h> #include <float.h> NS_CC_BEGIN class CC_DLL DHorizontalLayout { public: enum class Type { L_R = 0, L_W, R_W, W_C, NW_C = 4 }; public: float left; float right; float width; float center; float normalizedWidth; public: DHorizontalLayout(); DHorizontalLayout(const DHorizontalLayout& other); DHorizontalLayout(float var1, float var2, DHorizontalLayout::Type type); DHorizontalLayout& operator= (const DHorizontalLayout& other); bool equals(const DHorizontalLayout& target) const; }; /** * @js NA */ class CC_DLL DVerticalLayout { public: enum class Type { T_B = 0, T_H, B_H, H_C, NH_C = 4 }; public: float top; float bottom; float height; float center; float normalizedHeight; public: DVerticalLayout(); DVerticalLayout(const DVerticalLayout& other); DVerticalLayout(float var1, float var2, DVerticalLayout::Type type); DVerticalLayout& operator= (const DVerticalLayout& other); bool equals(const DVerticalLayout& target) const; }; /** * @js NA */ class CC_DLL DLayout { public: DHorizontalLayout horizontal; DVerticalLayout vertical; public: DLayout(); DLayout(const DLayout& other); DLayout(const DHorizontalLayout& horizontal, const DVerticalLayout& vertical); DLayout& operator= (const DLayout& other); bool equals(const DLayout& target) const; }; static inline DHorizontalLayout DHorizontalLayout_L_R(float left, float right) { return DHorizontalLayout(left, right, DHorizontalLayout::Type::L_R); } static inline DHorizontalLayout DHorizontalLayout_L_W(float left, float width) { return DHorizontalLayout(left, width, DHorizontalLayout::Type::L_W); } static inline DHorizontalLayout DHorizontalLayout_R_W(float right, float width) { return DHorizontalLayout(right, width, DHorizontalLayout::Type::R_W); } static inline DHorizontalLayout DHorizontalLayout_W_C(float width, float center) { return DHorizontalLayout(width, center, DHorizontalLayout::Type::W_C); } static inline DHorizontalLayout DHorizontalLayout_NW_C(float normalizedWidth, float center) { return DHorizontalLayout(normalizedWidth, center, DHorizontalLayout::Type::NW_C); } static inline DVerticalLayout DVerticalLayout_T_B(float top, float bottom) { return DVerticalLayout(top, bottom, DVerticalLayout::Type::T_B); } static inline DVerticalLayout DVerticalLayout_T_H(float top, float height) { return DVerticalLayout(top, height, DVerticalLayout::Type::T_H); } static inline DVerticalLayout DVerticalLayout_B_H(float bottom, float height) { return DVerticalLayout(bottom, height, DVerticalLayout::Type::B_H); } static inline DVerticalLayout DVerticalLayout_H_C(float height, float center) { return DVerticalLayout(height, center, DVerticalLayout::Type::H_C); } static inline DVerticalLayout DVerticalLayout_NH_C(float normalizedHeight, float center) { return DVerticalLayout(normalizedHeight, center, DVerticalLayout::Type::NH_C); } const DHorizontalLayout DHorizontalLayoutZero = DHorizontalLayout(); const DVerticalLayout DVerticalLayoutZero = DVerticalLayout(); const DLayout DLayoutZero = DLayout(); const DHorizontalLayout DHorizontalLayoutFill = DHorizontalLayout_L_R(0, 0); const DVerticalLayout DVerticalLayoutFill = DVerticalLayout_T_B(0, 0); const DLayout DLayoutFill = DLayout(DHorizontalLayoutFill, DVerticalLayoutFill); NS_CC_END #endif // __CALAYOUT_H__
#pragma once #ifndef ENGINE_COMMON_UTILITY_WINDOWSTERMINALCOLORS_H_ #define ENGINE_COMMON_UTILITY_WINDOWSTERMINALCOLORS_H_ #include <limits> #include "common\datatypes\color_types.h" #include "common\patterns\enum_class_iterator.h" namespace engine { // Human-readable names for all the Windows terminal colors. enum class WindowsTerminalColor { BLACK = 0, BLUE = 1, GREEN = 2, CYAN = 3, RED = 4, MAGENTA = 5, YELLOW = 6, GRAY = 7, DARKGRAY = 8, LIGHT_BLUE = 9, LIGHT_GREEN = 10, LIGHT_CYAN = 11, LIGHT_RED = 12, LIGHT_MAGENTA = 13, LIGHT_YELLOW = 14, WHITE = 15, First = BLACK, Last = WHITE }; // Utility functions to convert from and to Windows terminal colors. namespace WindowsTerminalColorUtility { static cRGBi GetColor(WindowsTerminalColor color_name) { switch (color_name) { case WindowsTerminalColor::BLACK: return cRGBi(0, 0, 0); case WindowsTerminalColor::BLUE: return cRGBi(0, 0, 128); case WindowsTerminalColor::GREEN: return cRGBi(0, 128, 0); case WindowsTerminalColor::CYAN: return cRGBi(0, 128, 128); case WindowsTerminalColor::RED: return cRGBi(128, 0, 0); case WindowsTerminalColor::MAGENTA: return cRGBi(128, 0, 128); case WindowsTerminalColor::YELLOW: return cRGBi(128, 128, 0); case WindowsTerminalColor::GRAY: return cRGBi(192, 192, 192); case WindowsTerminalColor::DARKGRAY: return cRGBi(128, 128, 128); case WindowsTerminalColor::LIGHT_BLUE: return cRGBi(0, 0, 255); case WindowsTerminalColor::LIGHT_GREEN: return cRGBi(0, 255, 0); case WindowsTerminalColor::LIGHT_CYAN: return cRGBi(0, 255, 255); case WindowsTerminalColor::LIGHT_RED: return cRGBi(255, 0, 0); case WindowsTerminalColor::LIGHT_MAGENTA: return cRGBi(255, 0, 255); case WindowsTerminalColor::LIGHT_YELLOW: return cRGBi(255, 255, 0); case WindowsTerminalColor::WHITE: return cRGBi(255, 255, 255); default: return cRGBi(0, 0, 0); } } static WindowsTerminalColor GetClosestWindowsTerminalColor(cRGBi color) { WindowsTerminalColor closest_color{ WindowsTerminalColor::BLACK }; float closest_distance = std::numeric_limits<float>::infinity(); for (auto c : Enum<WindowsTerminalColor>()) { float distance = color.distance(GetColor(c)); if (distance < closest_distance) { closest_color = c; closest_distance = distance; } } return closest_color; } static cRGBi GetClosestColor(cRGBi color) { return GetColor(GetClosestWindowsTerminalColor(color)); } }; } // namespace #endif // ENGINE_COMMON_UTILITY_WINDOWSTERMINALCOLORS_H_
// // font_loader.h // Copyright (c) 2015 Adam Ransom // #ifndef BE_FONT_LOADER_H #define BE_FONT_LOADER_H #include <memory> #include "free_type/font_generator_fwd.h" #include "resource_loader.h" namespace BarelyEngine { class Font; class FontLoader; template <> struct LoaderOptions<FontLoader> { /// Size, in pixels, of the font to load int size; }; /** * @class FontLoader * @brief Handles loading fonts from the file system, using FreeType2. Most font * formats should work including TTF, OTF, PCF, DFONT etc. */ class FontLoader : public ResourceLoader<Font, FontLoader> { public: /** * @brief Construct a new FontLoader */ FontLoader(); ~FontLoader(); /** * @brief Loads a font from the file system. Assumes the files are located * in `resources/fonts/` * * @param filename the filename of the resource to load * @param options the options used to load the font * * @return a unique_ptr to the resource */ std::unique_ptr<Font> load(const std::string& name, const LoaderOptions<FontLoader>& options) override; private: // Generates fonts using FreeType2 std::unique_ptr<FreeType::FontGenerator> font_generator_; }; } // end of namespace BarelyEngine #endif // defined(BE_FONT_LOADER_H)
// // MHProfileInfoAlbumCell.h // WeChat // // Created by senba on 2018/1/29. // Copyright © 2018年 CoderMikeHe. All rights reserved. // #import <UIKit/UIKit.h> #import "MHReactiveView.h" @interface MHProfileInfoAlbumCell : UITableViewCell<MHReactiveView> + (instancetype)cellWithTableView:(UITableView *)tableView; @end
// // iBChanllengeViewController.h // iB-Ball // // Created by Snowmanzzz on 13-5-27. // Copyright (c) 2013年 Snowmanzzz. All rights reserved. // #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface iBChanllengeViewController : UIViewController <AVAudioPlayerDelegate> @property (nonatomic, strong) NSTimer *timer; @property (nonatomic, strong) AVAudioPlayer *player; - (IBAction)startTiming:(id)sender; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" #import "IDEKeyDrivenNavigableItemRepresentedObject.h" @class DVTDocumentLocation, DVTFileDataType, DVTFilePath, IDEFileReference, NSImage, NSString; @interface IDERefactoringNewFile : NSObject <IDEKeyDrivenNavigableItemRepresentedObject> { id <IDERefactoringResult> _result; NSImage *_image; DVTFileDataType *_documentType; DVTDocumentLocation *_contentDocumentLocation; DVTFilePath *_filePath; NSString *_name; } @property(readonly) DVTFileDataType *navigableItem_documentType; // @synthesize navigableItem_documentType=_documentType; @property(readonly) DVTDocumentLocation *navigableItem_contentDocumentLocation; // @synthesize navigableItem_contentDocumentLocation=_contentDocumentLocation; @property(readonly) NSImage *navigableItem_image; // @synthesize navigableItem_image=_image; @property(readonly) NSString *navigableItem_name; // @synthesize navigableItem_name=_name; @property(readonly) DVTFilePath *filePath; // @synthesize filePath=_filePath; @property(readonly) id <IDERefactoringResult> result; // @synthesize result=_result; - (void).cxx_destruct; @property(readonly, copy) NSString *description; - (id)initWithRefactoringResult:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly) unsigned long long hash; @property(readonly) IDEFileReference *navigableItem_fileReference; @property(readonly) NSString *navigableItem_groupIdentifier; @property(readonly) BOOL navigableItem_isLeaf; @property(readonly) BOOL navigableItem_isMajorGroup; @property(readonly) NSString *navigableItem_toolTip; @property(readonly) Class superclass; @end
/* -*- mode: C; tab-width: 2; indent-tabs-mode: nil; -*- */ /* * This code has been contributed by the DARPA HPCS program. Contact * David Koester <dkoester@mitre.org> or Bob Lucas <rflucas@isi.edu> * if you have questions. * * GUPS (Giga UPdates per Second) is a measurement that profiles the memory * architecture of a system and is a measure of performance similar to MFLOPS. * The HPCS HPCchallenge RandomAccess benchmark is intended to exercise the * GUPS capability of a system, much like the LINPACK benchmark is intended to * exercise the MFLOPS capability of a computer. In each case, we would * expect these benchmarks to achieve close to the "peak" capability of the * memory system. The extent of the similarities between RandomAccess and * LINPACK are limited to both benchmarks attempting to calculate a peak system * capability. * * GUPS is calculated by identifying the number of memory locations that can be * randomly updated in one second, divided by 1 billion (1e9). The term "randomly" * means that there is little relationship between one address to be updated and * the next, except that they occur in the space of one half the total system * memory. An update is a read-modify-write operation on a table of 64-bit words. * An address is generated, the value at that address read from memory, modified * by an integer operation (add, and, or, xor) with a literal value, and that * new value is written back to memory. * * We are interested in knowing the GUPS performance of both entire systems and * system subcomponents --- e.g., the GUPS rating of a distributed memory * multiprocessor the GUPS rating of an SMP node, and the GUPS rating of a * single processor. While there is typically a scaling of FLOPS with processor * count, a similar phenomenon may not always occur for GUPS. * * For additional information on the GUPS metric, the HPCchallenge RandomAccess * Benchmark,and the rules to run RandomAccess or modify it to optimize * performance -- see http://icl.cs.utk.edu/hpcc/ * */ /* * This file contains the computational core of the single cpu version * of GUPS. The inner loop should easily be vectorized by compilers * with such support. * * This core is used by both the single_cpu and star_single_cpu tests. */ //#include <hpcc.h> #include <stdlib.h> #include <stdint.h> //#include "RandomAccess.h" #define POLY 0x0000000000000007ULL #define PERIOD 1317624576693539401LL typedef uint64_t u64Int; typedef int64_t s64Int; u64Int HPCC_starts(s64Int n) { int i, j; u64Int m2[64]; u64Int temp, ran; while (n < 0) n += PERIOD; while (n > PERIOD) n -= PERIOD; if (n == 0) return 0x1; temp = 0x1; for (i=0; i<64; i++) { m2[i] = temp; temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); } for (i=62; i>=0; i--) if ((n >> i) & 1) break; ran = 0x2; while (i > 0) { temp = 0; for (j=0; j<64; j++) if ((ran >> j) & 1) temp ^= m2[j]; ran = temp; i -= 1; if ((n >> i) & 1) ran = (ran << 1) ^ ((s64Int) ran < 0 ? POLY : 0); } return ran; } /* Number of updates to table (suggested: 4x number of table entries) */ #define NUPDATE (4*TableSize) static void RandomAccessUpdate(u64Int TableSize, u64Int *Table) { u64Int i; u64Int ran[128]; /* Current random numbers */ int j; /* Perform updates to main table. The scalar equivalent is: * * u64Int ran; * ran = 1; * for (i=0; i<NUPDATE; i++) { * ran = (ran << 1) ^ (((s64Int) ran < 0) ? POLY : 0); * table[ran & (TableSize-1)] ^= ran; * } */ for (j=0; j<128; j++) ran[j] = HPCC_starts ((NUPDATE/128) * j); for (i=0; i<NUPDATE/128; i++) { for (j=0; j<128; j++) { ran[j] = (ran[j] << 1) ^ ((s64Int) ran[j] < 0 ? POLY : 0); Table[ran[j] & (TableSize-1)] ^= ran[j]; } } } int //HPCC_RandomAccess(HPCC_Params *params, int doIO, double *GUPs, int *failure) { main(int argc, char* argv[]) { u64Int i; u64Int temp; double totalMem; u64Int *Table; u64Int logTableSize, TableSize; /* calculate local memory per node for the update table */ totalMem = atoi(argv[1]); totalMem /= sizeof(u64Int); /* calculate the size of update array (must be a power of 2) */ for (totalMem *= 0.5, logTableSize = 0, TableSize = 1; totalMem >= 1.0; totalMem *= 0.5, logTableSize++, TableSize <<= 1) ; /* EMPTY */ Table = malloc(TableSize*sizeof(u64Int) ); if (! Table) { return 1; } //params->RandomAccess_N = (s64Int)TableSize; /* Initialize main table */ for (i=0; i<TableSize; i++) Table[i] = i; /* Begin timing here */ //cputime = -CPUSEC(); //realtime = -RTSEC(); RandomAccessUpdate( TableSize, Table ); /* End timed section */ //cputime += CPUSEC(); //realtime += RTSEC(); /* make sure no division by zero */ //*GUPs = (realtime > 0.0 ? 1.0 / realtime : -1.0); //*GUPs *= 1e-9*NUPDATE; /* Print timing results */ /*if (doIO) { fprintf( outFile, "CPU time used = %.6f seconds\n", cputime); fprintf( outFile, "Real time used = %.6f seconds\n", realtime); fprintf( outFile, "%.9f Billion(10^9) Updates per second [GUP/s]\n", *GUPs ); }*/ /* Verification of results (in serial or "safe" mode; optional) */ /*temp = 0x1; for (i=0; i<NUPDATE; i++) { temp = (temp << 1) ^ (((s64Int) temp < 0) ? POLY : 0); Table[temp & (TableSize-1)] ^= temp; } temp = 0; for (i=0; i<TableSize; i++) if (Table[i] != i) temp++; if (doIO) { fprintf( outFile, "Found " FSTR64 " errors in " FSTR64 " locations (%s).\n", temp, TableSize, (temp <= 0.01*TableSize) ? "passed" : "failed"); } if (temp <= 0.01*TableSize) *failure = 0; else *failure = 1; */ free( Table ); return 0; }
#ifndef __RT_DELAYED_TEXT_LABEL_H #define __RT_DELAYED_TEXT_LABEL_H #include <string> #include <memory> #include <glm/glm.hpp> #include "ui_widget.h" #include "ui_draw_list.h" namespace rt { class Font; class Geometry; class DelayedTextLabel : public UIWidget { public: using UIWidget::UIWidget; Color getColor() const { return color; } void setColor(Color value) { color = value; } const std::string& getText() const { return text; } void setText(const std::string& value); const std::shared_ptr<Font> getFont() const { return font; } void setFont(const std::shared_ptr<Font>& value) { font = value; } float getMinUpdateInterval() const { return minUpdateInterval; } void setMinUpdateInterval(float value) { minUpdateInterval = value; } float getFontSize() const { return fontSize; } void setFontSize(float value) { fontSize = value; } protected: void onUpdate(float deltaTime) override; void onDraw(UIRenderer& renderer) override; private: UIDrawList drawList; Color color = Color::white(); std::string text; std::string displayedText; float minUpdateInterval = 0.5f; float timeToUpdate = 0; std::shared_ptr<Font> font; float fontSize; }; } #endif
/* * Copyright (c) 2006-2010 Secure Endpoints Inc. * * 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. */ /* $Id$ */ #include "credprov.h" #include <assert.h> /* Dialog procedures and support functions for handling configuration dialogs for general plug-in configuration. */ /* Structure for holding dialog data for the configuration window. */ typedef struct tag_config_main_dlg_data { khui_config_node cnode; /* TODO: add fields as needed */ } config_main_dlg_data; INT_PTR CALLBACK config_dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { config_main_dlg_data * d; switch (uMsg) { case WM_INITDIALOG: d = malloc(sizeof(*d)); assert(d); ZeroMemory(d, sizeof(*d)); /* for configuration panels that are not subpanels, lParam is a held handle to the configuration node. The handle will be held for the lifetime of the window. */ d->cnode = (khui_config_node) lParam; /* TODO: perform any other required initialization stuff here */ #pragma warning(push) #pragma warning(disable: 4244) SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) d); #pragma warning(pop) break; case KHUI_WM_CFG_NOTIFY: { d = (config_main_dlg_data *) GetWindowLongPtr(hwnd, DWLP_USER); if (d == NULL) break; /* WMCFG_APPLY is the only notification we care about */ if (HIWORD(wParam) == WMCFG_APPLY) { /* TODO: Apply changes and update the state */ return TRUE; } } break; case WM_DESTROY: d = (config_main_dlg_data *) GetWindowLongPtr(hwnd, DWLP_USER); /* TODO: perform any other required uninitialization here */ if (d) { free(d); SetWindowLongPtr(hwnd, DWLP_USER, 0); } break; } return FALSE; }
// // StuffRememberer.h // BlocExercises // // Created by Aaron on 6/12/14. // // #import <Foundation/Foundation.h> @interface StuffRememberer : NSObject @property (nonatomic, strong) NSMutableArray *arrayToRemember; @property (nonatomic, copy) NSMutableArray *arrayToCopy; @property (nonatomic, assign) CGFloat floatToRemember; /* In this class, there are three pairs of methods. In the first, an argument is provided. In your implementation you should store this in the appropriate kind of @property. In the second method, you should provide the appropriate response: 1. In `arrayYouShouldRemember`, return the array provided in `rememberThisArrayForLater:`. 2. In `arrayYouShouldCopy`, return a copy of the array provided in `copyThisArrayForLater:`. 3. In `floatYouShouldRemember`, return the float value provided in `rememberThisFloatForLater:`. */ /** Indicates a mutable array to remember for later. @param arrayToRemember A mutable array. */ - (void) rememberThisArrayForLater:(NSMutableArray *)arrayToRemember; /** Provides the remembered mutable array. @return The remembered mutable array, or @c nil if none was provided. */ - (NSMutableArray *) arrayYouShouldRemember; // -------------------------------------------------------------------- /** Indicates a mutable array to copy for later. @param arrayToCopy A mutable array. */ - (void) copyThisArrayForLater:(NSMutableArray *)arrayToCopy; /** Provides a copy of the initially provided mutable array. @return The copied mutable array, or @c nil if none was provided. */ - (NSMutableArray *) arrayYouShouldCopy; // -------------------------------------------------------------------- /** Indicates a float to remember for later. @param floatToRemember A float. */ - (void) rememberThisFloatForLater:(CGFloat)floatToRemember; /** Provides the remembered float. @return The remembered float, or @c NSNotFound if none was provided. */ - (CGFloat) floatYouShouldRemember; @end
#ifndef SHANGHAI_WEB_ECHOPAGE_H #define SHANGHAI_WEB_ECHOPAGE_H #include "../system/httpserver.h" namespace shanghai { namespace web { using namespace system::http; class EchoPage : public WebPage { public: EchoPage() = default; virtual ~EchoPage() = default; HttpResponse Do( const std::string &method, const std::string &url_match, const KeyValueSet &header, const KeyValueSet &query, const PostKeyValueSet &post) override; }; } // namespace web } // namespace shanghai #endif // SHANGHAI_WEB_ECHOPAGE_H
#pragma once #include "todcore/platform.h" //cross-platform //lib export #define TODEXPORT //directives #define OVERRIDE virtual #define IN #define OUT #define INOUT //helpers #define SAFE_DELETE(p) if (p) { delete p; p = 0; } #define SAFE_RELEASE(p) if (p) { p->release(); p = 0; } #define TOD_TRACE() do { } while (0) //STL helpers #ifdef TODENGINE_PLATFORM_WIN32 #define TOD_ERASE_LIST_ELEM(v, iterator) do { iterator = v.erase(iterator); } while (0) #else #define TOD_ERASE_LIST_ELEM(v, iterator) v.erase(iterator++) #endif #ifdef TODENGINE_PLATFORM_WIN32 #ifdef TOD_USING_UNICODE #define TOD_STRLEN wcslen #define TOD_STRCMP wcscmp #define TOD_SNPRINTF _snwprintf_s #define TOD_VSNPRINTF _vsnwprintf_s #else #define TOD_STRLEN strlen #define TOD_STRCMP strcmp #define TOD_SNPRINTF(buf, len, format, ...) _snprintf_s(buf, len, len, format, __VA_ARGS__) #define TOD_VSNPRINTF _vsnprintf_s #endif #else #ifdef TOD_USING_UNICODE #else #define TOD_STRLEN strlen #define TOD_STRCMP strcmp #define TOD_SNPRINTF snprintf #define TOD_VSNPRINTF vsnprintf #endif #endif
// // Ind.h // Ind // // Created by ryan on 13/04/2017. // Copyright © 2017 ryan. All rights reserved. // #import <Foundation/Foundation.h> #import "IIndCalculator.h" @protocol IIndCandleStick; @protocol IIndCalculator; @class IndDataSet; @interface IndCalculator: NSObject <IIndCalculator> + (instancetype)calculatorWithIndName:(NSString *)name; @property (nonatomic, strong) NSArray<NSNumber *> *params; @property (nonatomic, readonly) NSString *indName; - (NSArray<IndDataSet *> *)calc:(NSArray<IIndCandleStick> *)items; @end
#pragma once #include <stdint.h> typedef struct TitleWindow TitleWindow; struct TitleWindow { int32_t unknown[0]; };
/***************************************************************************** * Copyright (c) 2019 FrontISTR Commons * This software is released under the MIT License, see LICENSE.txt *****************************************************************************/ #ifndef INC_HECMW_UCD_PRINT #define INC_HECMW_UCD_PRINT #include "hecmw_struct.h" #include "hecmw_result.h" extern int HECMW_ucd_print(const struct hecmwST_local_mesh *mesh, const struct hecmwST_result_data *result, const char *ofname); extern int HECMW_ucd_legacy_print(const struct hecmwST_local_mesh *mesh, const struct hecmwST_result_data *result, const char *ofname); #endif
#ifndef WEB_APP_H_ #define WEB_APP_H_ #include <memory> #include <string> #include <unordered_set> #include <vector> #include "foscam.h" struct MHD_Daemon; struct MHD_Connection; namespace foscam_hd { class WebAppException : public std::exception { public: explicit WebAppException(const std::string & what); const char* what() const noexcept override; private: std::string what_; }; class WebApp { public: explicit WebApp(std::shared_ptr<Foscam> cam); ~WebApp(); private: int HandleConnection(struct MHD_Connection * connection, const char * url, const char * method, const char * version); int HandleGetBuffer(struct MHD_Connection * connection, const std::vector<uint8_t> & buffer, const std::string & mime_type); int HandleGetVideoStream(struct MHD_Connection * connection); friend int HandleConnectionCallback( void * callback_object, MHD_Connection * connection, const char * url, const char * method, const char * version, const char *, size_t *, void **); std::shared_ptr<Foscam> cam_; struct MHD_Daemon * http_server_; std::vector<uint8_t> favicon_; std::vector<uint8_t> video_player_; WebApp(const WebApp &) = delete; WebApp(WebApp &&) = delete; WebApp & operator=(const WebApp &) = delete; WebApp & operator=(WebApp &&) = delete; }; } // namespace foscam_hd #endif // WEB_APP_H_
#ifndef CHARACTER_H #define CHARACTER_H #include <SFML/Graphics.hpp> #endif
// // FlowCollectionView.h // FlowViewDemo // // Created by 史庆帅 on 16/9/2. // Copyright © 2016年 xhoogee. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, FlowDirection){ FlowDirectionLeft, FlowDirectionRight }; @interface FlowCollectionView : UICollectionView + (instancetype)flowCollectionViewWithFrame:(CGRect)frame layout:(UICollectionViewLayout *)layout; @property (nonatomic) NSArray *images; //翻页的长度 @property (nonatomic) CGFloat pageLength; @end
// // SXNavController.h // SXNews // // Created by 董 尚先 on 15/2/6. // Copyright (c) 2015年 ShangxianDante. All rights reserved. // #import <UIKit/UIKit.h> @interface SXNavController : UINavigationController @end
/** * Literal Tests * Copyright 2017 MPI-CBG/MPI-PKS Peter Schwede */ #include <criterion/criterion.h> #include <stdio.h> #include "EmissionTable.h" #include "HMM.h" #include "Literal.h" Test(literal, from_char) { cr_assert_eq(Literal__from_char('A'), LITERAL_A); cr_assert_eq(Literal__from_char('C'), LITERAL_C); cr_assert_eq(Literal__from_char('G'), LITERAL_G); cr_assert_eq(Literal__from_char('T'), LITERAL_T); } Test(literal, _char) { cr_assert_eq(Literal__char(LITERAL_A), 'A'); cr_assert_eq(Literal__char(LITERAL_C), 'C'); cr_assert_eq(Literal__char(LITERAL_G), 'G'); cr_assert_eq(Literal__char(LITERAL_T), 'T'); } Test(literal, str) { Literal codon[3] = { LITERAL_A, LITERAL_C, LITERAL_G }; char buffer[4] = "\0"; Literal__str(3, codon, buffer); cr_assert_eq(buffer[0], 'A'); cr_assert_eq(buffer[1], 'C'); cr_assert_eq(buffer[2], 'G'); cr_assert_str_eq(buffer, "ACG\0"); } Test(literal, _uint) { Literal sequence[3] = { LITERAL_A, LITERAL_C, LITERAL_G }; cr_assert_eq(Literal__uint(3, sequence), 0x06); cr_assert_eq(Literal__uint(2, sequence), 0x01); cr_assert_eq(Literal__uint(1, sequence), 0x00); cr_assert_eq(Literal__uint(2, &sequence[1]), 0x06); cr_assert_eq(Literal__uint(1, &sequence[2]), 0x02); cr_assert_eq(Literal__uint(0, &sequence[3]), 0x00); }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "MMObject.h" #import "PBMessageObserverDelegate.h" @class NSString; @interface WCPayFaceHBCgi : MMObject <PBMessageObserverDelegate> { id <WCPayFaceHBCgiDelegate> m_delegate; NSString *m_key; int _cgiNumber; unsigned int _m_uiRetryCount; } @property(nonatomic) unsigned int m_uiRetryCount; // @synthesize m_uiRetryCount=_m_uiRetryCount; @property(nonatomic) int cgiNumber; // @synthesize cgiNumber=_cgiNumber; - (void).cxx_destruct; - (void)MessageReturn:(id)arg1 Event:(unsigned int)arg2; - (void)startRequest:(id)arg1; - (void)dealloc; - (id)initWithDelegate:(id)arg1 Key:(id)arg2; @end
// // FXDanmaku.m // FXDanmakuDemo // // Github: https://github.com/ShawnFoo/FXDanmaku.git // Version: 1.0.6 // Last Modified: 8/25/2018 // Created by ShawnFoo on 12/4/2015. // Copyright © 2015 ShawnFoo. All rights reserved. // #import <UIKit/UIKit.h> #import "FXDanmakuItemData.h" #import "FXDanmakuItem.h" #import "FXDanmakuConfiguration.h" @class FXDanmaku; NS_ASSUME_NONNULL_BEGIN @protocol FXDanmakuDelegate <NSObject> @optional /** Tells the delegate the which item has been clicked @param danmaku The FXDanmaku object informing the delegate of this impending event. @param item The item that has been clicked. @param data The data of item. */ - (void)danmaku:(FXDanmaku *)danmaku didClickItem:(FXDanmakuItem *)item withData:(FXDanmakuItemData *)data; /** Tells the delegate the danmaku is about to display item. @param danmaku The FXDanmaku object informing the delegate of this impending event. @param item The item that is going to be displayed. @param data The data of item. */ - (void)danmaku:(FXDanmaku *)danmaku willDisplayItem:(FXDanmakuItem *)item withData:(FXDanmakuItemData *)data; /** Tells the delegate the danmaku is about to display item. @param danmaku The FXDanmaku object informing the delegate of this impending event. @param item The item that has ended displaying. @param data The data of item. */ - (void)danmaku:(FXDanmaku *)danmaku didEndDisplayingItem:(FXDanmakuItem *)item withData:(FXDanmakuItemData *)data; /** Tells the delegate if this data should be added into queue when data queue is full. Note: This method will be called asynchronously! @param data The FXDanmakuItemData object that should be added into queue although data queue is full or should be discarded. You should only access but not modify any properties of the data in this method. @return True if this data should be added into queue; otherwise, this data will be discarded. */ - (BOOL)shouldAddDanmakuItemDataWhenQueueIsFull:(FXDanmakuItemData *)data; @end @interface FXDanmaku : UIView @property (nonatomic, weak, nullable) id<FXDanmakuDelegate> delegate; @property (nonatomic, readonly) BOOL isRunning; /** When you access this property, you can only get a copy configuration. So it won't work if you changing FXDanmakuConfiguration's property directly. Note: if you set configuration when danmuku is running, it will clean screen first, and then restart running according to new config. */ @property (nonatomic, copy, nullable) FXDanmakuConfiguration *configuration; /** Actual vertical space between two row. viewHeight = numOfRows*rowHeight + (numOfRows-1)*rowSpace */ @property (nonatomic, readonly) CGFloat rowSpace; /** Default: true. Should danmaku remove all displaying danmakuItems when pasued. */ @property (nonatomic, assign) BOOL cleanScreenWhenPaused; /** Default: false. Should empty data queue when danmaku is paused. Note: If set this true, adding data won't enqueue when danmaku is paused! */ @property (nonatomic, assign) BOOL emptyDataWhenPaused; /** Default: true. Should enqueue data when danmaku is paused. */ @property (nonatomic, assign) BOOL acceptDataWhenPaused; /** Registers a nib object containing a reusable danmakuItem with a specified identifier. @param nib nib object that specifies the nib file used to create the object. @param identifier The reuse identifier for the danmakuItem. This parameter must not be nil and must not be an empty string. */ - (void)registerNib:(nullable UINib *)nib forItemReuseIdentifier:(NSString *)identifier; /** Registers a class for use in creating new danmakuItems. @param itemClass The class of an item that you want to use on danmaku. @param identifier The reuse identifier for the item. This parameter must not be nil and must not be an empty string. */ - (void)registerClass:(nullable Class)itemClass forItemReuseIdentifier:(NSString *)identifier; /** Add FXDanmakuItemData object. Thread-Safe. */ - (void)addData:(FXDanmakuItemData *)data; /** Add an array with FXDanmakuItemData objects. Thread-Safe. */ - (void)addDatas:(NSArray<FXDanmakuItemData *> *)datas; /** Empty data queue. Thread-Safe. */ - (void)emptyData; /** Start or resume displaying data. Thread-Safe. */ - (void)start; /** Pause displaying data. You can resume danmaku by calling 'start' method. Thread-Safe. */ - (void)pause; /** Stop displaying data. Thread-Safe. */ - (void)stop; /** Remove all displaying items on danmaku. Thread-Safe. */ - (void)cleanScreen; @end NS_ASSUME_NONNULL_END
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class NSMutableArray, NSMutableDictionary, NSString; // Not exported @interface GQNumberFormatter : NSObject { struct __CFLocale *mLocale; struct __CFArray *mDecimalFormatters; struct __CFArray *mCurrencyFormatters; struct __CFArray *mPercentageFormatters; struct __CFArray *mScientificFormatters; struct __CFNumberFormatter *mFractionFormatter; NSMutableDictionary *mCurrencyCodeToSymbolMap; NSMutableDictionary *mCurrencyCodeToHalfWidthSymbolMap; NSString *mCurrencyString; NSString *mPercentageString; NSString *mScientificString; NSString *mDecimalString; NSString *mPercentSymbol; NSMutableArray *mTransformedDecimalStrings; NSMutableArray *mTransformedCurrencyStrings; NSMutableArray *mTransformedPercentageStrings; NSMutableArray *mTransformedScientificStrings; struct __CFString *mAdditionalCurrencyCode; struct __CFArray *mAdditionalCurrencyCodeFormatters; } + (id)userVisibleCurrencyCodes; + (id)localizedPercentSymbol; + (id)defaultFormatStringForValueType:(int)arg1; + (id)defaultFormatStringForValueType:(int)arg1 negativeStyle:(int)arg2; + (id)numberFormatStringSpecialSymbols; + (id)currentLocaleCurrencyCode; + (unsigned short)defaultDecimalPlacesForCurrencyCode:(id)arg1; + (id)currencySymbolForCurrencyCode:(id)arg1; + (id)displayNameForCurrencyCode:(id)arg1; + (id)availableCurrencyCodes; + (void)formatString:(id)arg1 replaceOccurencesOfUnescapedString:(id)arg2 withString:(id)arg3; + (id)formatString:(id)arg1 transformedForNegativeStyle:(int)arg2; + (int)positionOfMinusSignInNumberFormatSubpattern:(id)arg1; + (int)positionOfCurrencySymbolInNumberFormatSubpattern:(id)arg1; + (int)positionOfSymbol:(id)arg1 inNumberFormatSubpattern:(id)arg2; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class NSMutableArray, WDTable, WDTableRowProperties; // Not exported @interface WDTableRow : NSObject { unsigned long long mIndex; WDTable *mTable; WDTableRowProperties *mProperties; NSMutableArray *mCells; } - (id)newCellIterator; - (id)cellIterator; - (id)addCellWithIndex:(unsigned long long)arg1; - (id)addCell; - (id)cellAt:(unsigned long long)arg1; - (unsigned long long)cellCount; - (id)properties; - (id)table; - (unsigned long long)index; - (void)dealloc; - (id)initWithTable:(id)arg1 at:(unsigned long long)arg2; @end
#pragma once #include "BF/Graphics/API/Framebuffer.h" #include "BF/Common.h" namespace BF { namespace Graphics { namespace API { class BFE_API RenderTarget { private: Framebuffer framebuffer; Texture2D texture2D; public: RenderTarget(); ~RenderTarget(); void Create(int width, int height, int bitsPerPixel, Texture::Format format, Texture::Wrap wrap, Texture::Filter filter); void Bind() const; void Unbind() const; inline const Texture2D& GetTexture2D() const { return texture2D; } }; } } }
// 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 "Shopping_AbstractResponseType.h" @class Shopping_SimpleItemType; /** Returns status information for all items in a list. Some of the Item information is returned in an SimpleItemArrayType object, that can include zero, one, or multiple ItemType objects. @ingroup ShoppingInterface */ @interface Shopping_GetItemStatusResponseType : Shopping_AbstractResponseType { @private NSMutableArray *_item; } /** Collection of Item status objects in an SimpleItemArrayType object, that can include zero, one, or multiple ItemType objects. entry type : class Shopping_SimpleItemType */ @property (nonatomic, retain) NSMutableArray *item; @end
/* The MIT License (MIT) * * Copyright (c) 2015 Giovanni Ortolani, Taneli Mikkonen, Pingjiang Li, Tommi Puolamaa, Mitra Vahida * * 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 COMMON_H #define COMMON_H #include <Ogre.h> Ogre::Vector3 convertSphericalToCartesian (Ogre::Real latitude, Ogre::Real longitude); Ogre::Vector2 convertCartesianToPlateCarree(Ogre::Vector3 position); Ogre::Real heightNoise(std::vector<float> &amplitude, std::vector<float> &frequency, Ogre::Vector3 Point); Ogre::ColourValue generatePixel(Ogre::Real height, Ogre::Real seaHeight, Ogre::Real minimumHeight, Ogre::Real maximumHeight, Ogre::ColourValue water1st, Ogre::ColourValue water2nd, Ogre::ColourValue terrain1st, Ogre::ColourValue terrain2nd, Ogre::ColourValue mountain1st, Ogre::ColourValue mountain2nd); /* 2d-array allocator. Because of templating, the whole definition must be in a header */ template <typename T> T **allocate2DArray(unsigned short sizeY, unsigned short sizeX) { int y; T *memArea, **ptrArea; // memArea is destination for all the values, ptrArea are pointers to areas of memArea. memArea = new T [sizeX*sizeY]; ptrArea = new T*[sizeY]; // Populate pointers for individual scanlines of x for(y=0; y < sizeY; y++) { ptrArea[y] = &memArea[y*sizeX]; } return ptrArea; } template <typename T> void free2DArray(T *ptr) { delete[] ptr[0]; delete[] ptr; } #endif
// // ECAppDelegate.h // ECExtension // // Created by Eleven Chen on 07/31/2015. // Copyright (c) 2015 Eleven Chen. All rights reserved. // @import UIKit; @interface ECAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // // Developed by Minigraph // // Author: James Stanard // #pragma once #include "pch.h" #include "EngineTuning.h" namespace PostEffects { extern BoolVar EnableHDR; // Turn on tone mapping features // Tone mapping parameters extern ExpVar Exposure; // Brightness scaler when adapative exposure is disabled extern BoolVar EnableAdaptation; // Automatically adjust brightness based on perceived luminance extern BoolVar bToneMapOnlyLuma; // Keep color saturation from being lost. extern NumVar g_ToeStrength; // Adapation parameters extern ExpVar MinExposure; extern ExpVar MaxExposure; extern NumVar TargetLuminance; extern NumVar AdaptationRate; // Bloom parameters extern BoolVar BloomEnable; extern NumVar BloomThreshold; extern NumVar BloomStrength; extern BoolVar EnableFXAA; void Initialize( void ); void Shutdown( void ); void Render( void ); };
// // AppDelegate.h // NSOperationDemo // // Created by 王老师 on 2016/12/13. // Copyright © 2016年 wyl. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* ** UnixGameClock.h for RType in /home/teisse_a//Documents/Tek3/RType/R-Type/Server/Clock/timer/src ** ** Made by alexandre teisseire ** Login <teisse_a@epitech.net> ** ** Started on Fri Jan 18 16:00:13 2013 alexandre teisseire ** Last update Fri Jan 18 16:59:37 2013 alexandre teisseire */ #ifndef _UNIXGAMECLOCK_H_ #define _UNIXGAMECLOCK_H_ #include <time.h> #include <sys/time.h> #include "IClock.h" class GameClock : public IClock { private: struct timeval _startMark; public: GameClock(); virtual ~GameClock(); virtual void reset(); virtual float getElapsedTime() const; }; #endif
/* File: SampleCommon.c Contains: Sample-specific code common to the app and the tool. Written by: DTS Copyright: Copyright (c) 2007 Apple Inc. All Rights Reserved. Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple, Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple, Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "SampleCommon.h" /* IMPORTANT --------- This array must be exactly parallel to the kSampleCommandProcs array in "SampleTool.c". */ const BASCommandSpec kLCSHelperCommandSet[] = { { kLCSHelperInstallRotavaultJobCommand, // commandName kLCSHelperManageRotavaultLaunchdJobRightName, // rightName NULL // userData }, { kLCSHelperRemoveRotavaultJobCommand, // commandName kLCSHelperManageRotavaultLaunchdJobRightName, // rightName NULL // userData }, { kLCSHelperInfoForRotavaultJobCommand, // commandName kLCSHelperMonitorRotavaultLaunchdJobRightName, // rightName NULL // userData }, { NULL, // the array is null terminated NULL, NULL } };
#pragma once #include <chrono> #include <glm/glm.hpp> class Window; class WindowEvent { public: enum class Type { KeyPress , KeyRelease , KeyTyped , MousePress , MouseRelease , MouseMove , MouseEnter , MouseLeave , Scroll , Resize , FrameBufferResize , Move , Close , Focus , Iconify , Paint , Timer }; virtual ~WindowEvent(); Type type() const; bool isAccepted() const; bool isIgnored() const; void setAccepted(bool accepted); void accept(); void ignore(); Window * window() const; void setWindow(Window * window); protected: WindowEvent(Type type); protected: Type m_type; bool m_accepted; Window * m_window; }; class KeyEvent : public WindowEvent { public: KeyEvent(int key, int scanCode, int action, int modifiers); explicit KeyEvent(unsigned int character); int key() const; int scanCode() const; int action() const; int modifiers() const; unsigned int character() const; protected: int m_key; int m_scanCode; int m_action; int m_modifiers; unsigned int m_character; }; class MouseEvent : public WindowEvent { public: MouseEvent(const glm::ivec2 & pos); MouseEvent(const glm::ivec2 & pos, int button, int action, int modifiers); int button() const; int action() const; int modifiers() const; const glm::ivec2 & pos() const; int x() const; int y() const; protected: int m_button; int m_action; int m_modifiers; glm::ivec2 m_pos; }; class MouseEnterEvent : public WindowEvent { public: MouseEnterEvent(); }; class MouseLeaveEvent : public WindowEvent { public: MouseLeaveEvent(); }; class ScrollEvent : public WindowEvent { public: ScrollEvent(const glm::vec2 & offset, const glm::ivec2 & pos); const glm::vec2 & offset() const; const glm::ivec2 & pos() const; protected: glm::vec2 m_offset; glm::ivec2 m_pos; }; class MoveEvent : public WindowEvent { public: MoveEvent(const glm::ivec2 & pos); const glm::ivec2 & pos() const; int x() const; int y() const; protected: glm::ivec2 m_pos; }; class ResizeEvent : public WindowEvent { public: ResizeEvent(const glm::ivec2 & size, bool framebuffer = false); const glm::ivec2 & size() const; int width() const; int height() const; protected: glm::ivec2 m_size; }; class PaintEvent : public WindowEvent { public: PaintEvent(); }; class CloseEvent : public WindowEvent { public: CloseEvent(); }; class FocusEvent : public WindowEvent { public: FocusEvent(bool hasFocus); bool hasFocus() const; protected: bool m_hasFocus; }; class IconifyEvent : public WindowEvent { public: IconifyEvent(bool isIconified); bool isIconified() const; protected: bool m_isIconified; }; class TimerEvent : public WindowEvent { public: using Duration = std::chrono::duration<double, std::milli>; TimerEvent(int id, const Duration & elapsed); int id() const; const Duration & elapsed() const; protected: int m_id; Duration m_elapsed; };
/* * CocosBuilder: http://www.CocosBuilder.com * * Copyright (c) 2012 Zynga Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #import <Foundation/Foundation.h> #import "HTTPServer.h" #define kCCBDefaultPort 54321 @class HTTPServer; @class ProjectSettings; @interface CCBHTTPServer : NSObject { HTTPServer* httpServer; IBOutlet NSMenuItem* menuItemSafari; IBOutlet NSMenuItem* menuItemChrome; IBOutlet NSMenuItem* menuItemFirefox; } @property (nonatomic, readonly) HTTPServer* httpServer; + (CCBHTTPServer *) sharedHTTPServer; - (void) start:(NSString*)docRoot; - (void) stop; - (void) restart:(NSString*)docRoot; - (UInt16) listeningPort; - (void) openBrowser:(NSString *)browser; @end
//---------------------------------------------------------------------- // Gorka Suárez García - Ing. Tec. Inf. de Gestión 2º B. // Práctica 02 - Grupo 03. //---------------------------------------------------------------------- #ifndef DelincuenteH #define DelincuenteH #include <iostream> #include <fstream> #include <string> using namespace std; #include "Cara.h" /** * Clase para almacenar los datos referentes a un delincuente. */ class Delincuente { protected: string nombre; string delitos; Cara cara; public: /** * Constructor que crea un delincuente ya inicializado. */ Delincuente () : cara() { this->nombre = ""; this->delitos = ""; } /** * Constructor que crea un delincuente ya inicializado. * @param nombre Nombre del delincuente. * @param delitos Delitos del delincuente. * @param cara Cara del delincuente. */ Delincuente (const string & nombre, const string & delitos, const Cara & cara) { this->nombre = nombre; this->delitos = delitos; this->cara = cara; } /** * Función para obtener el nombre del delincuente indicado. * @return Devuelve el nombre del delincuente indicado. * @see getDelitos(), getCara() */ string getNombre (void) const { return this->nombre; } /** * Función para obtener los delitos del delincuente indicado. * @return Devuelve los delitos del delincuente indicado. * @see getNombre(), getCara() */ string getDelitos (void) const { return this->delitos; } /** * Función para obtener la cara del delincuente indicado. * @return Devuelve la cara del delincuente indicado. * @see getNombre(), getDelitos() */ Cara getCara (void) const { return this->cara; } /** * Función para establecer el nombre del delincuente indicado. * @param nombre Nombre del delincuente. * @see setDelitos(), setCara() */ void setNombre (const string & nombre) { this->nombre = nombre; } /** * Función para establecer los delitos del delincuente indicado. * @param delitos Delitos del delincuente. * @see setNombre(), setCara() */ void setDelitos (const string & delitos) { this->delitos = delitos; } /** * Función para establecer la cara del delincuente indicado. * @param cara Cara del delincuente. * @see setNombre(), setDelitos() */ void setCara (const Cara & cara) { this->cara = cara; } /** * Sobrecarga del operador == para Delincuente. */ bool operator == (const Delincuente & delincuente) const { return this->nombre == delincuente.nombre; } /** * Sobrecarga del operador == para Delincuente. */ bool operator <= (const Delincuente & delincuente) const { return (this->nombre == delincuente.nombre) || (this->nombre < delincuente.nombre) ; } /** * Función que indica si un delincuente es parecido a otro. * @param delincuente Delincuente del que vamos a obtener los datos. * @param cara Cara con la que queremos comparar el delincuente. * @return Devuelve si tiene la cara igual o no. */ bool parecido (const Cara & cara) const { return (this->cara == cara); } /** * Salva el delincuente en un fichero de texto. * @param salida Flujo de salida al fichero. * @return Devuelve true si todo ha ido bien. */ bool salvaTXT (ofstream & salida) const; /** * Carga el delincuente de un fichero de texto. * @param entrada Flujo de entrada al fichero. * @return Devuelve true si todo ha ido bien. */ bool cargaTXT (ifstream & entrada); }; #endif
#pragma once class RoadInterface { private: const unsigned int mMaxX; const unsigned int mMaxY; public: enum class Cell : unsigned int { Free, Blocked, Car }; RoadInterface(unsigned int maxY, unsigned int maxX) : mMaxX(maxX), mMaxY(maxY) {} virtual ~RoadInterface() {} virtual Cell readCell(unsigned int y, unsigned int x) const =0; virtual void writeCell(unsigned int y, unsigned int x, Cell cell)=0; virtual bool isFree(unsigned int y, unsigned x) const = 0; virtual bool isBlocked(unsigned int y, unsigned x) const = 0; virtual bool isCar(unsigned int y, unsigned x) const = 0; unsigned int maxX() const { return mMaxX; } unsigned int maxY() const { return mMaxY; } };
#pragma once #include "GL_AreaGraph.h" class GL_RiemannHistogram : public GL_AreaGraph { public: GL_RiemannHistogram(Graph &graph) : GL_AreaGraph(graph){ } virtual bool has_unit_normals() const{ return true; } virtual bool wants_backface_culling() const{ return true; } virtual void update(int n_threads, double quality); };
#ifndef UVECTOR_H__ #define UVECTOR_H__ #include "generic.h" #define VECTOR_INITIAL_CAPACITY 16 typedef struct uvector_opaq uvector_t; uvector_t *uvector_create(void); uvector_t *uvector_create_with_size(size_t size, ugeneric_t value); uvector_t *uvector_create_from_array(void *array, size_t array_len, size_t array_element_size, ugeneric_type_e uvector_element_type); void uvector_clear(uvector_t *v); void uvector_destroy(uvector_t *v); uvector_t *uvector_copy(const uvector_t *v); uvector_t *uvector_deep_copy(const uvector_t *v); int uvector_compare(const uvector_t *v1, const uvector_t *v2); void uvector_append(uvector_t *v, ugeneric_t e); void uvector_insert_at(uvector_t *v, size_t i, ugeneric_t e); void uvector_remove_at(uvector_t *v, size_t i); void uvector_remove_back(uvector_t *v); ugeneric_t uvector_pop_at(uvector_t *v, size_t i); ugeneric_t uvector_pop_back(uvector_t *v); ugeneric_t uvector_get_at(const uvector_t *v, size_t i); ugeneric_t uvector_get_back(const uvector_t *v); ugeneric_t uvector_get_front(const uvector_t *v); ugeneric_t uvector_get_at_random(const uvector_t *v); void uvector_set_at(uvector_t *v, size_t i, ugeneric_t e); ugeneric_t *uvector_get_cells(const uvector_t *v); bool uvector_contains(const uvector_t *v, ugeneric_t e); ugeneric_t *uvector_find(uvector_t *v, ugeneric_t e); bool uvector_is_empty(const uvector_t *v); size_t uvector_get_size(const uvector_t *v); void uvector_resize(uvector_t *v, size_t new_size, ugeneric_t value); void uvector_shrink_to_size(uvector_t *v); void uvector_reserve_capacity(uvector_t *v, size_t new_capacity); size_t uvector_get_capacity(const uvector_t *v); uvector_t *uvector_get_slice(const uvector_t *v, size_t begin, size_t end, size_t stride); void uvector_swap(uvector_t *v, size_t l, size_t r); void uvector_reverse(uvector_t *v); void uvector_reverse_range(uvector_t *v, size_t l, size_t r); void uvector_sort(uvector_t *v); bool uvector_is_sorted(const uvector_t *v); size_t uvector_bsearch(const uvector_t *v, ugeneric_t e); bool uvector_next_permutation(uvector_t *v); static void uvector_take_data_ownership(uvector_t *v); static void uvector_drop_data_ownership(uvector_t *v); static bool uvector_is_data_owner(uvector_t *v); char *uvector_as_str(const uvector_t *v); void uvector_serialize(const uvector_t *v, ubuffer_t *buf); int uvector_fprint(const uvector_t *v, FILE *out); static inline int uvector_print(const uvector_t *v) {return uvector_fprint(v, stdout);} typedef struct { char *title; char *xlabel; char *ylabel; char *data_label; } gnuplot_attrs_t; void uvector_dump_to_gnuplot(const uvector_t *v, gnuplot_attrs_t *attrs, FILE *out); ugeneric_base_t *uvector_get_base(uvector_t *v); DEFINE_BASE_FUNCS(uvector, v) #endif
// // TWTSampleViewController.h // Toast // // Created by Josh Johnson on 1/12/14. // Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <UIKit/UIKit.h> @interface TWTSampleViewController : UITableViewController @end
/* Universidade Estadual do Ceara Introducao a Computacao 2016.2 - Prof. Gildacio Jessica Cristina Cacau Patricio (1388627) Exercicio 712 */ #include<stdio.h> #include<stdlib.h> #include<strings.h> #include<math.h> /* Funcao recursiva do somatorio */ double som (double a) { if (a>0) /* Para maiores de zero, o resultado eh o proprio valor mais o somatorio do seu antecessor */ return a+som(a-1); else /* Para zero, seu somatorio eh ele mesmo */ return 0; } /* Funcao recursiva do fatorial */ double fat (double a) { if (a>0) /* Para maiores de zero, o resultado eh a multiplicacao do proprio valor pelo fatorial do seu antecessor */ return a*fat(a-1); else /* Fatorial de 0 eh igual a 1 */ return 1; } /* Funcao principal */ void main () { printf("Este programa foi escrito por Jessica Cristina Cacau Patricio.\n\n"); /* Declaracao das variaveis */ double num, total = 0.0; long long int i; printf("Digite um inteiro positivo: "); scanf("%lf", &num); for (i=1; i<=num; i++) { if (i%2==0) /* Se for par, vai subtrair a divisão do valor total */ total -= som(i)/fat(i); else /* Se for impar, vai somar */ total += som(i)/fat(i); } printf("\nTotal = %.15lf\n", total); }
/* Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. */ #pragma once #include <ddCommon.h> #include <ddEventServer.h> namespace Event { class EventServer; class EventProvider; /// Define DDEventServer as an alias for EventServer DD_DEFINE_HANDLE(DDEventServer, EventServer*); /// Define DDEventProvider as an alias for EventProvider DD_DEFINE_HANDLE(DDEventProvider, EventProvider*); } // namespace Event
#ifndef _APP_STATE_H #define _APP_STATE_H #include "digital.h" enum appStates { STATE_INITIALIZING = 0x00, STATE_DISARMED = 0x02, STATE_ARMED = 0x04, //STATE_FLYING = 0x08, //STATE_RADIO_LOSS1 = 0x10, //STATE_RADIO_LOSS2 = 0x20, //STATE_LOW_BATTERY1 = 0x40, //STATE_LOW_BATTERY2 = 0x80 }; typedef struct { digitalPin *debugOut; digitalPin *greenLed; digitalPin *blueLed; digitalPin *busRelay; uint8_t state; } appState_t; extern appState_t appState; void controlInit(void); #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif #import "UIView+SGPagingView.h" #import "SGPageContentScrollView.h" #import "SGPageContentView.h" #import "SGPageTitleView.h" #import "SGPageTitleViewConfigure.h" #import "SGPagingView.h" FOUNDATION_EXPORT double SGPagingViewVersionNumber; FOUNDATION_EXPORT const unsigned char SGPagingViewVersionString[];
#pragma once #include "data/tileData.h" #include "util/json.h" #include "util/types.h" #include <functional> #include <memory> namespace Tangram { class TileTask; namespace GeoJson { using Transform = std::function<Point(LngLat _lngLat)>; bool isFeatureCollection(const JsonValue& _in); Point getPoint(const JsonValue& _in, const Transform& _proj); Line getLine(const JsonValue& _in, const Transform& _proj); Polygon getPolygon(const JsonValue& _in, const Transform& _proj); Properties getProperties(const JsonValue& _in, int32_t _sourceId); Feature getFeature(const JsonValue& _in, const Transform& _proj, int32_t _sourceId); Layer getLayer(const JsonValue& _in, const Transform& _proj, int32_t _sourceId); std::shared_ptr<TileData> parseTile(const TileTask& _task, int32_t _sourceId); } // namespace GeoJson } // namespace Tangram
// log.h /* * Запись данных в лог. */ #ifndef LOG_H #define LOG_H void prLog(char* msg); void crash(); #endif
#ifndef SHADER_RSM_H #define SHADER_RSM_H #include "RendererGIIS\ShaderBase.h" namespace giis { class ShaderRSM : public ShaderBase { public: ShaderRSM(); ~ShaderRSM(); void initialise() override; inline GLuint getMatrixMVP() const { return m_uniform_matrix_MVP; } inline GLuint getHasDiffuseTexture() const { return m_has_diffuse_texture; } inline GLuint getDiffuseTextureSampler() const { return m_uniform_diffuse_sampler; } inline GLuint getDiffuseMaterial() const { return m_uniform_diffuse_material; } inline GLuint getLightPosition() const { return m_uniform_lightPos; } inline GLuint getMapCentreDirection() const { return m_uniform_map_centre_dir; } inline GLuint getLightIntensity() const { return m_uniform_intensity; } inline GLuint getMapSize() const { return m_uniform_mapSize; } inline GLuint getSolidAnglePreCalc() const { return m_solid_angle_precalculated_part; } inline GLuint getNearDistance() const { return m_uniform_rsm_near; } private: GLuint m_uniform_lightPos; GLuint m_uniform_map_centre_dir; GLuint m_uniform_intensity; GLuint m_uniform_mapSize; GLuint m_solid_angle_precalculated_part; GLuint m_uniform_rsm_near; GLuint m_uniform_matrix_MVP; GLuint m_uniform_diffuse_material; GLuint m_uniform_diffuse_sampler; GLuint m_has_diffuse_texture; }; } #endif // SHADER_RSM_H
/* Graphics.h - Class with basic trigonometry utility Created by Ivan Seidel Gomes, May, 2013. Releasedlongo the public domain. */ #ifndef Graphics_h #define Graphics_h #include "math.h" /* Point Contains information about x and y values */ class Point { public: long x, y; Point(){ x=0; y=0; } Point(long _x,long _y){ x = _x; y = _y; } bool operator==(Point other){ return other.x == x && other.y == y; } void operator=(Point other){ x = other.x; y = other.y; } Point operator+(Point other){ x += other.x; y += other.y; return *this; } }; /* TwoPoint Base class to use with Rectangles, Elipses... */ class TwoPoint{ public: Point p1, p2; TwoPoint(long x1 = 0, long y1 = 0, long x2 = 0, long y2 = 0){ p1 = Point(x1, y1); p2 = Point(x2, y2); } TwoPoint(Point _p1, Point _p2){ p1 = _p1; p2 = _p2; } long getWidth(){ return (p1.x > p2.x? p1.x - p2.x: p2.x - p1.x); } long getHeight(){ return (p1.y > p2.y? p1.y - p2.y: p2.y - p1.y); } }; /* Line */ class Line: public TwoPoint { public: explicit Line(): TwoPoint(){}; explicit Line(Point p1, Point p2): TwoPoint(p1, p2){}; explicit Line(long x1,long y1,long x2,long y2): TwoPoint(x1,y1,x2,y2){}; void set(long x1,long y1,long x2,long y2){ p1.x = x1; p1.y = y1; p2.x = x2; p2.y = y2; } bool operator==(Line other){ return other.p1 == p1 && other.p2 == p2; } Line operator+(Point other){ p1 = p1 + other; p2 = p2 + other; return *this; } void operator=(Line other){ p1 = other.p1; p2 = other.p2; } double getLength(){ return sqrt(pow(p1.x-p2.x, 2) + pow(p1.y-p2.y, 2)); } double getAngle(){ return atan2(p1.y - p2.y, p2.x - p1.x); } }; /* Rectangle */ class Rectangle: public TwoPoint { public: explicit Rectangle(): TwoPoint(){}; explicit Rectangle(Point p1, Point p2): TwoPoint(p1, p2){}; explicit Rectangle(long x1,long y1,long x2,long y2): TwoPoint(x1,y1,x2,y2){}; double getArea(){ return (p1.x-p2.x)*(p1.x-p2.x) * (p1.y-p2.y)*(p1.y-p2.y); } }; #endif
#ifndef __BANKSTATE_H #define __BANKSTATE_H #include <vector> #include "common.h" namespace dramsim3 { class BankState { public: BankState(); enum class State { OPEN, CLOSED, SREF, PD, SIZE }; Command GetReadyCommand(const Command& cmd, uint64_t clk) const; // Update the state of the bank resulting after the execution of the command void UpdateState(const Command& cmd); // Update the existing timing constraints for the command void UpdateTiming(const CommandType cmd_type, uint64_t time); bool IsRowOpen() const { return state_ == State::OPEN; } int OpenRow() const { return open_row_; } int RowHitCount() const { return row_hit_count_; } private: // Current state of the Bank // Apriori or instantaneously transitions on a command. State state_; // Earliest time when the particular Command can be executed in this bank std::vector<uint64_t> cmd_timing_; // Currently open row int open_row_; // consecutive accesses to one row int row_hit_count_; }; } // namespace dramsim3 #endif
/************************************************************************************** Copyright (c) Hilscher Gesellschaft fuer Systemautomation mbH. All Rights Reserved. *************************************************************************************** $Id: EplCn_If_Results.h 3176 2017-07-05 15:26:30Z Ricky $: Description: Powerlink Controlled Node result codes definitions for IF Task **************************************************************************************/ #ifndef __EPLCN_IF_RESULTS_H #define __EPLCN_IF_RESULTS_H #include<stdint.h> ///////////////////////////////////////////////////////////////////////////////////// // POWERLINK Controlled Node result codes for IF Task ///////////////////////////////////////////////////////////////////////////////////// // // MessageId: ERR_EPLCN_IF_LEGACY_PARAMETER_NOT_SUPPORTED // // MessageText: // // Parameter of the current legacy service is not supported any more. // #define ERR_EPLCN_IF_LEGACY_PARAMETER_NOT_SUPPORTED ((uint32_t)0xC0E30001L) #endif /* __EPLCN_IF_RESULTS_H */
// This software is part of OpenMono, see http://developer.openmono.com // and is available under the MIT license, see LICENSE.txt #ifndef mn_string_h #define mn_string_h #include <stdint.h> #include <stdarg.h> namespace mono { /** * The mono framework has it own string class, that either reside on the HEAP * or inside the read-only data segment (`.rodata`). * * We use this string class to pass string data to async routines like the * @ref View 's @ref scheduleRepaint method. Because views might be repainted * at any point in time, we cannot have view data reside on the stack. This * string class hold its data on the HEAP, but behaves as it would reside on * the stack. * * This string class takes care of all alloc and dealloc of memory. It is a * referenced based string class. You should not pass pointers of C++ references * to this class, but instead normal assignment or pass the full class to * functions. The efficient copy / assignment operator methods on the class * ensure only data references are passed, behind the scenes. * * For example: * @code * String str = String::Format("Hello World, number: %i", 1); * String str2 = str; * String str3 = str2; * @endcode * * In the code only 1 copy of the string data is present in memory. And only * references are passed to the objects `str2` and `str3`. Only as the last * object is deallocated is the data disposed from the HEAP. * * These features makes the class very lightweight and safe to pass around * functions and objects. * * @brief High level string class */ class String { public: uint32_t *refCount; bool malloced; char *stringData; void preAllocbytes(uint32_t count); public: /** * @brief C lib. style format string * * Construct a mono string using the *string format* syntax. * * @param format The formatted string with placeholders * @return String The resulting string, interpolated with provided parameters */ static String Format(const char *format, ...); /** * @brief Construct an empty invalid string */ String(); /** * @brief Construct an empty string with a pre-allocated size * * Use this constructor to created a buffer-like string object. * @param preAllocBytes The number of bytes to allocate in the string object */ String(uint32_t preAllocBytes); /** * @brief Construct a string from an existing C string, with a fixed length * * The string data is copied to the mono string, such that @ref String * has it own copy of the string data. * * @param str Pointer to the original C string * @param length The length of the provided string, without NULL terminator */ String(char *str, uint32_t length); /** * @brief Construct a mono String from an existing NULL terminated C string * * The length of the source string is determined by the Clib function * `strlen`. * * @param str A pointer to the C style string */ String(char *str); /** * @brief Construct a mono String from an existing NULL terminated C string * * The length of the source string is determined by the Clib function * `strlen`. * * @param str A pointer to the C style string */ String(const char *str); /** * @brief Construct a mono String from an existing mono string * * The length of the source string is determined by the Clib function * `strlen`. * * @param str A reference to the mono string */ String(const String &str); /** * @brief Return the length of the string * * The length of the actual string is returned, not counting the NULL * terminator. * * This method uses `strlen` which does not support variable byte-length * character encoding. (That means UTF8, 16 and alike.) */ uint32_t Length() const; String& operator=(const char *str); String& operator=(const String &str); bool operator==(String const &other) const; bool operator!=(String const &other) const; bool operator==(const char *other) const; bool operator!=(const char *other) const; /** * @brief Access each character (or byte) of the string in an array like fashion */ char operator[](uint32_t pos) const; /** * @brief Short-hand for @ref CString * * @see CString */ char* operator()() const; /** * @brief Get a pointer to the raw C style string * * Use this method if need to print a string using `printf` or alike. * * To obtain a pointer to the raw string data. */ char* CString() const; ~String(); private: void CopyFromCString(const char * cstring); }; } #endif /* mn_string_h */
#ifndef LinkedList_H #define LinkedList_H #include <list> #include <PObject.h> template<class T> class LinkedList : public PObject { public: class Iterator { private: LinkedList *list_; typename std::list<T>::iterator c_; // current typename std::list<T>::iterator n_; // next typename std::list<T>::iterator e_; // end public: Iterator(LinkedList *list) : list_(list) { n_ = list_->list_.begin(); e_ = list_->list_.end (); c_ = e_; } Iterator(const Iterator &it) : list_(it.list_), c_(it.c_), n_(it.n_), e_(it.e_) { } Iterator &operator=(const Iterator &it) { list_ = it.list_; c_ = it.c_; n_ = it.n_; e_ = it.e_; return *this; } bool hasNext() { return (n_ != e_); } T next() { assert(n_ != e_); c_ = n_++; return *c_; } int nextIndex() { return std::distance(list_->list_.begin(), n_); } void add(T data) { list_->add(data); //TODO: adjust iterator ? } void remove() { assert(c_ != e_); n_ = list_->list_.erase(c_); e_ = list_->list_.end (); c_ = (n_ != e_ ? n_++ : e_); } }; class ConstIterator { private: const LinkedList *list_; typename std::list<T>::const_iterator c_; typename std::list<T>::const_iterator n_; typename std::list<T>::const_iterator e_; public: ConstIterator(const LinkedList *list) : list_(list) { n_ = list_->list_.begin(); e_ = list_->list_.end (); c_ = e_; } ConstIterator(const ConstIterator &it) : list_(it.list_), c_(it.c_), n_(it.n_), e_(it.e_) { } bool hasNext() { return (n_ != e_); } T next() { assert(n_ != e_); c_ = n_++; return *c_; } void remove() { assert(c_ != e_); n_ = list_->list_.erase(c_); e_ = list_->list_.end (); c_ = (n_ != e_ ? n_++ : e_); } }; LinkedList() { } Iterator iterator() { return Iterator(this); } Iterator listIterator() { return Iterator(this); } Iterator listIterator(int i) { Iterator it(this); while (i > 0) { it.next(); --i; } return it; } ConstIterator const_iterator() const { return ConstIterator(this); } void add(T data) { list_.push_back(data); } void addLast(T data) { list_.push_back(data); } T removeFirst() { T t = list_.front(); list_.pop_front(); return t; } uint size() const { return list_.size(); } void clear() { list_.clear(); } bool isEmpty() { return list_.empty(); } private: std::list<T> list_; }; typedef LinkedList<IRefPtr<PObject> > GenLinkedList; typedef IRefPtr<GenLinkedList> GenLinkedListP; #endif
#pragma once #include "torch/csrc/jit/ir.h" #include "torch/csrc/onnx/onnx.h" namespace torch { namespace jit { TORCH_API std::shared_ptr<Graph> ToONNX(std::shared_ptr<Graph>& state, ::torch::onnx::OperatorExportTypes operator_export_type); TORCH_API void BlockToONNX(Block* old_block, Block* new_block, ::torch::onnx::OperatorExportTypes operator_export_type, std::unordered_map<Value*, Value*> env); }}
#include <string.h> #include <stdio.h> #include <stdlib.h> int main() { char cmd[256]; int r; //test enc/dec self undo strcpy(cmd, "./enc -i tst/msg0.txt -o tst/msg0.crypto -p fish"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./dec -i tst/msg0.crypto -o tst/msg0.plain -p fish"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg0.txt tst/msg0.plain"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); strcpy(cmd, "./enc -i tst/msg1.txt -o tst/msg1.crypto -p fish"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./dec -i tst/msg1.crypto -o tst/msg1.plain -p fish"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg1.txt tst/msg1.plain"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); strcpy(cmd, "./enc -i tst/msg2.txt -o tst/msg2.crypto -p fish"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./dec -i tst/msg2.crypto -o tst/msg2.plain -p fish"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg2.txt tst/msg2.plain"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); //test emb/ext self undo strcpy(cmd, "./emb -c covers/logo.ppm -m tst/msg0.txt -s tst/msg0.ppm"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./ext -s tst/msg0.ppm -m tst/msg0.plain2"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg0.txt tst/msg0.plain2"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); strcpy(cmd, "./emb -c covers/logo.ppm -m tst/msg1.txt -s tst/msg1.ppm"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./ext -s tst/msg1.ppm -m tst/msg1.plain2"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg1.txt tst/msg1.plain2"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); strcpy(cmd, "./emb -c covers/logo.ppm -m tst/msg2.txt -s tst/msg2.ppm"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./ext -s tst/msg2.ppm -m tst/msg2.plain2"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg2.txt tst/msg2.plain2"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); //test encemb/extdec self undo strcpy(cmd, "./encemb -c covers/logo.ppm -m tst/msg0.txt -s tst/msg0.ppm -p fish"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./extdec -s tst/msg0.ppm -m tst/msg0.plain3 -p fish"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg0.txt tst/msg0.plain3"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); strcpy(cmd, "./encemb -c covers/logo.ppm -m tst/msg1.txt -s tst/msg1.ppm -p fish"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./extdec -s tst/msg1.ppm -m tst/msg1.plain3 -p fish"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg1.txt tst/msg1.plain3"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); strcpy(cmd, "./encemb -c covers/logo.ppm -m tst/msg2.txt -s tst/msg2.ppm -p fish"); printf("%s\n", cmd); system(cmd); strcpy(cmd, "./extdec -s tst/msg2.ppm -m tst/msg2.plain3 -p fish"); printf("%s\n", cmd); system(cmd); r = system("diff tst/msg2.txt tst/msg2.plain3"); (!r) ? printf("pass\n\n") : printf("fail\n\n"); return 0; }
// // KZ_VideoPlayerStatus.h // KZ_VideoPlayer // // Created by Kieron Zhang on 2016/12/25. // Copyright © 2016年 Kieron Zhang. All rights reserved. // typedef NS_ENUM(NSInteger, KZ_VideoPlayerViewPlayStatus) { KZ_VideoPlayerViewPlayStatus_Stop, KZ_VideoPlayerViewPlayStatus_Pause, KZ_VideoPlayerViewPlayStatus_Play, KZ_VideoPlayerViewPlayStatus_Failed, }; typedef NS_OPTIONS(NSInteger, KZ_VideoPlayerControlGestureType) { KZ_VideoPlayerControlGestureType_None = 0, KZ_VideoPlayerControlGestureType_SingleTap = 1 << 0, KZ_VideoPlayerControlGestureType_DoubleTap = 1 << 1, KZ_VideoPlayerControlGestureType_PanGesture = 1 << 2, KZ_VideoPlayerControlGestureType_TapGesture = (KZ_VideoPlayerControlGestureType_SingleTap | KZ_VideoPlayerControlGestureType_DoubleTap), KZ_VideoPlayerControlGestureType_All = (KZ_VideoPlayerControlGestureType_SingleTap | KZ_VideoPlayerControlGestureType_DoubleTap | KZ_VideoPlayerControlGestureType_PanGesture) };
/* * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * * 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 ARM_COMPUTE_CL_GEMMLOWP_MATRIXMULTIPLY_NATIVE_KERNEL_H #define ARM_COMPUTE_CL_GEMMLOWP_MATRIXMULTIPLY_NATIVE_KERNEL_H #include "arm_compute/core/KernelDescriptors.h" #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" namespace arm_compute { namespace opencl { namespace kernels { /** OpenCL kernel to multiply matrices with QASYMM8/QASYMM8_SIGNED data type */ class ClGemmLowpMatrixMultiplyNativeKernel : public IClKernel { public: ClGemmLowpMatrixMultiplyNativeKernel(); ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE(ClGemmLowpMatrixMultiplyNativeKernel); /** Initialise the kernel's input and dst. * * @param[in] compile_context The compile context to be used. * @param[in] src0 Source tensor containing the LHS matrix. Data type supported: QASYMM8/QASYMM8_SIGNED * @param[in] src1 Source tensor containing the RHS matrix. Data type supported: same as @p src0 * @param[out] dst Destination tensor to store the result of matrix multiplication. Data type supported: S32 * @param[in] lhs_info LHS matrix information used to retrieve the number of rows to be processed by each thread * lhs_info.m0: 2,3,4,5,6,7,8 * lhs_info.k0: 2,3,4,8,16 * @param[in] rhs_info RHS matrix information used to retrieve the number of columns to be processed by each thread * rhs_info.n0: 2,3,4,8,16 * rhs_info.k0: same as lhs_info.k0 * @param[in] gemm_info GEMM information used to retrieve the original dimensions of the input matrices */ void configure(const CLCompileContext &compile_context, const ITensorInfo *src0, ITensorInfo *src1, ITensorInfo *dst, const GEMMLHSMatrixInfo &lhs_info, const GEMMRHSMatrixInfo &rhs_info, const GEMMReshapeInfo &gemm_info); /** Static function to check if given info will lead to a valid configuration * * Similar to @ref ClGemmLowpMatrixMultiplyNativeKernel::configure() * * @return a status */ static Status validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst, const GEMMLHSMatrixInfo &lhs_info, const GEMMRHSMatrixInfo &rhs_info, const GEMMReshapeInfo &gemm_info); // Inherited methods overridden: void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; private: bool _slide_matrix_b{ true }; bool _reinterpret_input_as_3d{ false }; bool _reinterpret_output_as_3d{ false }; bool _use_dummy_work_items{ false }; }; } // namespace kernels } // namespace opencl } // namespace arm_compute #endif /* ARM_COMPUTE_CL_GEMMLOWP_MATRIXMULTIPLY_NATIVE_KERNEL_H */
/** ****************************************************************************** * @file EXTI/main.c * @author MCD Application Team * @version V1.0.0 * @date 23-March-2012 * @brief Main program body ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f0xx.h" #include "stm32f0_discovery.h" /** @addtogroup STM32F0_Discovery_Peripheral_Examples * @{ */ /** @addtogroup EXTI_Example * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ void EXTI0_Config(void); /* Private functions ---------------------------------------------------------*/ /** * @brief Main program. * @param None * @retval None */ int main(void) { /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f0xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f0xx.c file */ /* Initialize LEDs mounted on STM32F0-Discovery kit */ STM_EVAL_LEDInit(LED3); STM_EVAL_LEDInit(LED4); /* Configure PA0 in interrupt mode */ EXTI0_Config(); /* Generate software interrupt: simulate a falling edge applied on EXTI0 line */ EXTI_GenerateSWInterrupt(EXTI_Line0); /* Infinite loop */ while (1) { } } /** * @brief Configure PA0 in interrupt mode * @param None * @retval None */ void EXTI0_Config(void) { EXTI_InitTypeDef EXTI_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; /* Enable GPIOA clock */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); /* Configure PA0 pin as input floating */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOA, &GPIO_InitStructure); /* Enable SYSCFG clock */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); /* Connect EXTI0 Line to PA0 pin */ SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0); /* Configure EXTI0 line */ EXTI_InitStructure.EXTI_Line = EXTI_Line0; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); /* Enable and set EXTI0 Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = EXTI0_1_IRQn; NVIC_InitStructure.NVIC_IRQChannelPriority = 0x00; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t* file, uint32_t line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* Infinite loop */ while (1) { } } #endif /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// // UIColor+Random.h // FlickrMania // // Created by Michał Zaborowski on 30.11.2013. // Copyright (c) 2013 Michał Zaborowski. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <UIKit/UIKit.h> @interface UIColor (Random) + (UIColor *)randomFlatColor; @end
/** * @file * @author 单宝华 * @date 2015-10-19 */ #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> #import "Model.h" /** * @class DeviceAnnotation * @brief 设备地图信息 * @author 单宝华 * @date 2015-10-19 */ @interface DeviceAnnotation : NSObject <MKAnnotation> //@property (nonatomic, readonly) CLLocationCoordinate2D coordinate; // //@property (nonatomic, readonly, copy) NSString *title; //@property (nonatomic, readonly, copy) NSString *subtitle; // //- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate; - (instancetype)initWithDevice:(DeviceModel *)device; @end
// // NUIVerticalCellLayout+NUILoading.h // NUIKit // // Created by Ivan Masalov on 24/12/13. // Copyright (c) 2013 Noveo Group. All rights reserved. // #import "NUIVerticalCellLayout.h" @class NUIStatement; @class NUILoader; @class NUIError; /*! A category to support loading of properties of \b NUIGridLayout from NUI that can't be loaded * automatically. */ @interface NUIVerticalCellLayout (NUILoading) /*! Allows to load cells from a string containing values that can be used to initialize * \b NUIGridLength (i.e., auto, 44, 56*) */ - (BOOL)loadNUICellsFromRValue:(NUIStatement *)value loader:(NUILoader *)loader error:(NUIError **)error; @end
/*!The Treasure Box Library * * TBox is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * TBox is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with TBox; * If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a> * * Copyright (C) 2009 - 2015, ruki All rights reserved. * * @author ruki * @file fixed16_arm.h * */ #ifndef TB_MATH_OPT_FIXED16_ARM_H #define TB_MATH_OPT_FIXED16_ARM_H /* ////////////////////////////////////////////////////////////////////////////////////// * includes */ #include "prefix.h" /* ////////////////////////////////////////////////////////////////////////////////////// * macros */ #ifdef TB_ASSEMBLER_IS_GAS #if 0 # define tb_fixed16_mul(x, y) tb_fixed16_mul_asm(x, y) #endif #endif /* TB_ASSEMBLER_IS_GAS */ /* ////////////////////////////////////////////////////////////////////////////////////// * interfaces */ #if defined(TB_ASSEMBLER_IS_GAS) && !defined(TB_ARCH_ARM64) static __tb_inline__ tb_fixed16_t tb_fixed16_mul_asm(tb_fixed16_t x, tb_fixed16_t y) { __tb_register__ tb_fixed16_t t; __tb_asm__ __tb_volatile__ ( "smull %0, %2, %1, %3 \n" // r64 = (l, h) = x * y "mov %0, %0, lsr #16 \n" // to fixed16: r64 >>= 16 "orr %0, %0, %2, lsl #16 \n" // x = l = (h << (32 - 16)) | (l >> 16); : "=r"(x), "=&r"(y), "=r"(t) : "r"(x), "1"(y) ); return x; } #endif #endif
// Copyright (c) 2011-2014 The PlanBcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_COINCONTROLTREEWIDGET_H #define BITCOIN_QT_COINCONTROLTREEWIDGET_H #include <QKeyEvent> #include <QTreeWidget> class CoinControlTreeWidget : public QTreeWidget { Q_OBJECT public: explicit CoinControlTreeWidget(QWidget *parent = 0); protected: virtual void keyPressEvent(QKeyEvent *event); }; #endif // BITCOIN_QT_COINCONTROLTREEWIDGET_H
// // Displayable.h // show // // Created by Chris Mullany on 17/09/2015. // // #pragma once #include "ofMain.h" #include "DisplayManager.h" // // Inherit from this if you'll only ever be drawing to a single display // only really used by LED Display // class Displayable { public: Displayable() { display = NULL; } ofRectangle getDisplayRect() { ofRectangle rect; if (display != NULL) { rect.set(0, 0, display->in.getWidth(), display->in.getHeight()); } return rect; } void setDisplay(DisplayManager::Display * display) { this->display = display; } protected: DisplayManager::Display * display; private: };
// // begin license header // // This file is part of Pixy CMUcam5 or "Pixy" for short // // All Pixy source code is provided under the terms of the // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html). // Those wishing to use Pixy source code, software and/or // technologies under different licensing terms should contact us at // cmucam@cs.cmu.edu. Such licensing terms are available for // all portions of the Pixy codebase presented here. // // end license header // #include <debug.h> #include <chirp.h> #include <cycletimer.h> #include <pixyvals.h> #include "exec_m0.h" #include "frame_m0.h" #include "rls_m0.h" volatile uint8_t g_loop = 1; int main(void) { //CTIMER_DECLARE(); #if 0 uint32_t memory = SRAM1_LOC; uint32_t lut = SRAM1_LOC; //while(1); memset((void *)QQ_LOC, 0x01, 0x3000); g_qqueue->writeIndex = 0; g_qqueue->produced = 0; g_qqueue->consumed = 0; while(1) getRLSFrame(&memory, &lut); #endif //printf("M0 start\n"); int i = 0; _DBG("M0 start\n"); chirpOpen(); exec_init(); frame_init(); rls_init(); #if 0 vsync(); #endif #if 0 //while(g_loop); uint8_t type = CAM_GRAB_M1R2; uint32_t memory = SRAM1_LOC; uint16_t offset = 0; uint16_t width = 320; uint16_t height = 200; while(1) { getFrame(&type, &memory, &offset, &offset, &width, &height); i++; if (i%50==0) { _DBD32(i), _CR(); } } #endif //printf("M0 ready\n"); exec_loop(); #if 0 while(1) { CTIMER_START(); syncM1((uint32_t *)&LPC_GPIO_PORT->PIN[1], 0x2000); CTIMER_STOP(); printf("%d\n", CTIMER_GET()); } #endif #if 0 { uint32_t i; uint8_t *lut = (uint8_t *)SRAM1_LOC + 0x10000; uint32_t memory = SRAM1_LOC; uint32_t size = SRAM1_SIZE/2; for (i=0; i<0x10000; i++) lut[i] = 0; lut[0xb400] = 0; lut[0xb401] = 1; lut[0xb402] = 1; lut[0xb403] = 1; lut[0xb404] = 0; lut[0xb405] = 1; lut[0xb406] = 1; lut[0xb407] = 0; lut[0xb408] = 0; lut[0xb409] = 0; while(1) getRLSFrame(&memory, &size, (uint32_t *)&lut); } #endif return 0; }
// // NSObject+QExtension.h // QExtension // // Created by JHQ0228 on 2017/1/21. // Copyright © 2017年 QianQian-Studio. All rights reserved. // #ifndef NSObject_QExtension_h #define NSObject_QExtension_h #import "QRSAEncryptor.h" #import "QJSONValidator.h" #import "NSObject+JSONValidator.h" #endif /* NSObject_QExtension_h */
// // ByBXML.h // ByBXML // // Created by Boolky Bear on 24/6/15. // Copyright (c) 2015 ByBDesigns. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for ByBXML. FOUNDATION_EXPORT double ByBXMLVersionNumber; //! Project version string for ByBXML. FOUNDATION_EXPORT const unsigned char ByBXMLVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <ByBXML/PublicHeader.h> #import <ByBXML/ByBInPlaceXMLParserDelegate.h>
/* * Copyright (c) 2014-2016 IBM Corporation. * All rights reserved. * * Copyright (c) 2017 MCCI Corporation * 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 <organization> 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _lorabase_as923_h_ #define _lorabase_as923_h_ #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ # include "lmic_config_preconditions.h" #endif /****************************************************************************\ | | Basic definitions for AS923 (always in scope) | \****************************************************************************/ enum _dr_as923_t { AS923_DR_SF12 = 0, AS923_DR_SF11, AS923_DR_SF10, AS923_DR_SF9, AS923_DR_SF8, AS923_DR_SF7, AS923_DR_SF7B, AS923_DR_FSK, AS923_DR_NONE }; // Bands: // g1 : 1% 16dBm // freq band datarates enum { AS923_F1 = 923200000, // g1 SF7-12 AS923_F2 = 923400000, // g1 SF7-12 AS923_FDOWN = 923200000, // (RX2 freq, DR2) AS923_FBCN = 923400000, // default BCN, DR3 AS923_FPING = 923400000, // default ping, DR3 }; enum { AS923_FREQ_MIN = 915000000, AS923_FREQ_MAX = 928000000 }; enum { AS923_JP_TX_EIRP_MAX_DBM = 13, // 13 dBm = 19.95mW < 20mW AS923_TX_EIRP_MAX_DBM = 16 // 16 dBm }; enum { DR_PAGE_AS923 = 0x10 * (LMIC_REGION_as923 - 1) }; enum { AS923_LMIC_REGION_EIRP = 1 }; // region uses EIRP enum { AS923JP_LBT_US = 5000 }; // microseconds of LBT time -- 5000 ==> // 5 ms. We use us rather than ms for // future 128us support, and just for // backward compatibility -- there // is code that uses the _US constant, // and it's awkward to break it. enum { AS923JP_LBT_DB_MAX = -80 }; // maximum channel strength in dB; if TX // we measure more than this, we don't tx. // AS923 v1.1, all channels face a 1% duty cycle. So this will have to change // in the future via a config. But this code base needs major changes for // v1.1 in any case. enum { AS923_V102_TX_CAP = 100 }; // v1.0.2 allows 100% #ifndef AS923_TX_CAP # define AS923_TX_CAP AS923_V102_TX_CAP #endif // TxParam defaults enum { // initial value of UplinkDwellTime before TxParamSetupReq received. AS923_INITIAL_TxParam_UplinkDwellTime = 1, // initial value of DownlinkDwellTime before TxParamSetupReq received. AS923_INITIAL_TxParam_DownlinkDwellTime = 1, AS923_UPLINK_DWELL_TIME_osticks = sec2osticks(20), }; #endif /* _lorabase_as923_h_ */
// // NSString+ObjectiveSugar.h // SampleProject // // Created by Neil on 05/12/2012. // Copyright (c) 2012 @supermarin | supermar.in. All rights reserved. // #import <Foundation/Foundation.h> NSString *NSStringWithFormat(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2); @interface NSString (ObjectiveSugar) /** Returns an array containing substrings from the receiver that have been divided by a whitespace delimiter @return An array containing substrings that have been divided by a whitespace delimiter */ - (NSArray *)split; /** Returns an array containing substrings from the receiver that have been divided by a given delimiter @param delimiter The delimiter string @return An array containing substrings that have been divided by delimiter */ - (NSArray *)split:(NSString *)delimiter; /** Returns a new string made by converting a snake_case_string to CamelCaseString @return A string made by converting a snake_case_string to CamelCaseString */ - (NSString *)camelCase; /** Returns a new string made by converting a snake_case_string to lowerCamelCaseString @return A string made by converting a snake_case_string to CamelCaseString */ - (NSString *)lowerCamelCase; /** Returns a Boolean value that indicates whether a given string is a substring of the receiver @return YES if 'string' is a substring of the receiver, otherwise NO */ - (BOOL)containsString:(NSString *)string; /** Returns a new string made by removing whitespaces and newlines from both ends of the receiver @return A string without trailing or leading whitespaces and newlines */ - (NSString *)strip; /** Returns a new string that matches the passed in pattern @return A String matching the regex or nil if no match is found */ - (NSString *)match:(NSString *)pattern; @end
static const char* EPD_PIECE_CHARS = "<PNBRQK>pnbrqk"; static char* epd_bestmove = 0; bool epd_char_to_piece_type(char ch, int *player, PieceType *type) { assert(type); assert(player); char* pt = strchr(EPD_PIECE_CHARS, ch); if (!pt) return false; *type = pt-EPD_PIECE_CHARS; *player = 0; if (*type >= NUM_PIECE_TYPES) { *type -= NUM_PIECE_TYPES; *player = 1; } return true; } void verify_move(const GameState* oldstate, const GameState* newstate) { char ourmove[16] = {}; char* p = ourmove; I2XY(move_src, x1, y1); I2XY(move_dest, x2, y2); //DEBUG("%d,%d -> %d,%d\n", x1, y1, x2, y2); PieceDef src = oldstate->board[y1][x1]; PieceDef dest = newstate->board[y2][x2]; bool ambig_row = false; bool ambig_col = false; if (src.type != Pawn) { *p++ = EPD_PIECE_CHARS[src.type]; } for (int y=0; y<BOARDY; y++) { for (int x=0; x<BOARDX; x++) { if (x==x1 && y==y1) continue; PieceDef p = oldstate->board[y][x]; if (p.player == src.player && p.type == src.type) { if (y==y1) ambig_row = true; if (x==x1) ambig_col = true; } } } if ((ambig_row && y1==y2) || (src.type==Pawn && x1!=x2)) *p++ = 'a' + x1; if (ambig_col && x1==x2) *p++ = '1' + y1; // capture move? if (oldstate->board[y2][x2].type && oldstate->board[y2][x2].player != dest.player) *p++ = 'x'; //if (x1 != x2) *p++ = 'a' + x2; //if (y1 != y2) *p++ = '1' + y2; if (newstate->incheck[src.player^1]) *p++ = '+'; printf("Move: %s vs %s match = %d\n", ourmove, epd_bestmove, strstr(epd_bestmove, ourmove) != 0); } bool parse_epd(GameState* state, char* str) { #define EPDERR(str) { fprintf(stderr, "***EPDERROR: %s\n", str); return false; } DEBUG("EPD: Parsing line %s\n", str); char* pieces = strsep(&str, " "); char* side2move = strsep(&str, " "); char* castling = strsep(&str, " "); char* enpass = strsep(&str, " "); char* operations = strsep(&str, "\n"); if (!pieces || !side2move || !castling || !enpass) EPDERR("Bad EPD string"); // parse castling flags int castling_flags[2] = {0,0}; { int p; PieceType t; char ch; while ((ch = *castling++) != 0) { if (epd_char_to_piece_type(ch, &p, &t)) { castling_flags[p] |= 1 << t; } } DEBUG("EPD: Castling flags %x,%x\n", castling_flags[0], castling_flags[1]); } // piece placement for (int y=7; y>=0; y--) { char* ranki = strsep(&pieces, "/"); if (!ranki) EPDERR("Not enough ranks"); DEBUG("EPD: rank %d %s\n", y+1, ranki); char ch; int x = 0; while ((ch = *ranki++) != 0) { if (x >= BOARDX) EPDERR("X coord out of bounds"); switch (ch) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': x += (ch-'0'); break; default: { PieceType type; int player; if (epd_char_to_piece_type(ch, &player, &type)) { PieceDef piece = MAKEPIECE(player,type); if (piece.type == King && y==player*7 && x==4) { piece.moved = (castling_flags[player] & ((1<<King)|(1<<Queen))) == 0; } if (piece.type == Rook && y==player*7 && (x==0||x==7)) { piece.moved = (castling_flags[player] & ((1<<(x==0?Queen:King)))) == 0; } else piece.moved = true; // just need it for kings and rooks set_piece(state, x, y, piece); x++; } else EPDERR("Invalid piece character"); break; } } } if (x != BOARDX) EPDERR("Did not finish filling rank"); } // side to move if (!strcmp("w", side2move)) ai_set_current_player(WHITE); else if (!strcmp("b", side2move)) ai_set_current_player(BLACK); else EPDERR("Side to move invalid"); if (strcmp("-", enpass)) { DEBUG("ENPASS [%s]\n", enpass); if (strlen(enpass)!=2) EPDERR("Bad en passant string"); int x = enpass[0] - 'a'; int y = enpass[1] - '1'; state->enpassant[ai_current_player()^1] = BI(x,y); } // TODO: operations epd_bestmove = operations; return true; } bool parse_epd_file(const char* filename) { printf("EPD: Opening '%s'\n", filename); FILE* f = fopen(filename, "r"); if (!f) EPDERR("Could not read file"); char buf[256]; int line=0; while (fgets(buf, sizeof(buf), f)) { line++; GameState state; memset(&state, 0, sizeof(state)); if (!parse_epd(&state, buf)) return false; GameState oldstate = state; printf("EPD: Board Initial (%s:%d)\n", filename, line); print_board(&state); play_turn(&state); printf("EPD: Board Best (%s:%d)\n", filename, line); print_board(&state); verify_move(&oldstate, &state); ai_print_endgame_results(&state); if (!verbose) fprintf(stderr, "\n"); } return true; }
// // KMMViewController.h // GhostPostClient // // Created by Kerr Marin Miller on 07/02/2015. // Copyright (c) 2014 Kerr Marin Miller. All rights reserved. // @import UIKit; @interface KMMViewController : UIViewController @end