text
stringlengths
4
6.14k
//////////////////////////////////////////////////////////////////////////////// /// RsFlash.h #pragma once #include "BaResource.h" #include "MtVector2.h" #include "RsColour.h" // Class Declaration class RsFlash : public BaResource { DECLARE_RESOURCETYPE( BaRT_Flash ); public: virtual void Reset() = 0; virtual void Update( BtFloat tick ) = 0; virtual void Render( const MtVector2& v2Position, BtU32 sortOrder ) = 0; // Accessors virtual BtU32 GetFrameNumber() = 0; virtual void SetLooping( BtBool isLooping ) = 0; virtual BtBool GetLooping() = 0; virtual BtBool IsFinished() = 0; };
/* Copyright (c) 2012 Stanford University * * Permission to use, copy, modify, and 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(S) DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS 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. */ #include "Client.pb.h" #include "Tree/Tree.h" #ifndef LOGCABIN_TREE_PROTOBUF_H #define LOGCABIN_TREE_PROTOBUF_H namespace LogCabin { namespace Tree { namespace ProtoBuf { /** * Respond to a read-only request to query a Tree. */ void readOnlyTreeRPC(const Tree& tree, const Protocol::Client::ReadOnlyTree::Request& request, Protocol::Client::ReadOnlyTree::Response& response); /** * Respond to a read-write operation on a Tree. */ void readWriteTreeRPC(Tree& tree, const Protocol::Client::ReadWriteTree::Request& request, Protocol::Client::ReadWriteTree::Response& response); } // namespace LogCabin::Tree::ProtoBuf } // namespace LogCabin::Tree } // namespace LogCabin #endif // LOGCABIN_TREE_PROTOBUF_H
/* * Copyright (c) 2008 James Molloy, Jörg Pfähler, Matthew Iselin * * Permission to use, copy, modify, and 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. */ // // Should only be included from ./syscall.h. This contains the syscall functions. // static long syscall0(long function) { long num = ((PEDIGREE_C_SYSCALL_SERVICE&0xFFFF) << 16) | (function&0xFFFF); long ret; asm volatile("mov r0, %1; \ swi #0; \ mov %0, r0" : "=r" (ret) : "r" (num)); return ret; } static long syscall1(long function, long p1) { long num = ((PEDIGREE_C_SYSCALL_SERVICE&0xFFFF) << 16) | (function&0xFFFF); long ret; asm volatile("mov r0, %1; \ mov r1, %1; \ swi #0; \ mov %0, r0" : "=r" (ret) : "r" (num), "r" (p1)); return ret; } static long syscall2(long function, long p1, long p2) { long num = ((PEDIGREE_C_SYSCALL_SERVICE&0xFFFF) << 16) | (function&0xFFFF); long ret; asm volatile("mov r0, %1; \ mov r1, %1; \ mov r2, %1; \ swi #0; \ mov %0, r0" : "=r" (ret) : "r" (num), "r" (p1), "r" (p2)); return ret; } static long syscall3(long function, long p1, long p2, long p3) { long num = ((PEDIGREE_C_SYSCALL_SERVICE&0xFFFF) << 16) | (function&0xFFFF); long ret; asm volatile("mov r0, %1; \ mov r1, %1; \ mov r2, %1; \ mov r3, %1; \ swi #0; \ mov %0, r0" : "=r" (ret) : "r" (num), "r" (p1), "r" (p2), "r" (p3)); return ret; } /// \todo Handle >= 4 parameters properly static long syscall4(long function, long p1, long p2, long p3, long p4) { long num = ((PEDIGREE_C_SYSCALL_SERVICE&0xFFFF) << 16) | (function&0xFFFF); long ret = 0; /* asm volatile("mov r0, %1; \ mov r1, %1; \ mov r2, %1; \ mov r3, %1; \ swi #0; \ mov %0, r0" : "=r" (ret) : "r" (num), "r" (p1), "r" (p2), "r" (p3)); */ return ret; } static long syscall5(long function, long p1, long p2, long p3, long p4, long p5) { long num = ((PEDIGREE_C_SYSCALL_SERVICE&0xFFFF) << 16) | (function&0xFFFF); long ret = 0; /* asm volatile("mov r0, %1; \ mov r1, %1; \ mov r2, %1; \ mov r3, %1; \ swi #0; \ mov %0, r0" : "=r" (ret) : "r" (num), "r" (p1), "r" (p2), "r" (p3)); */ return ret; }
/* MIT License Copyright (c) 2016 Josh Walters (josh@joshwalters.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 SCU_SET_H #define SCU_SET_H #include <stdbool.h> #include <stdint.h> #include <scu/map.h> #ifdef __cplusplus extern "C" { #endif /** * Sets are implemented as maps. */ typedef SCU_Map SCU_Set; /** * Create a new set. * * @param s Set pointer to use * @param capacity Capacity of the list * @param free_func Function to free values. Can use 'free' for most values. * @return True if success, false if failure */ extern bool SCU_SetNew(SCU_Set** s, uint64_t capacity, void (*free_func)(void*)); /** * Free a set. * * @param s Set pointer to use */ extern void SCU_SetFree(SCU_Set** s); /** * Add a value to the set. * * @param s Set pointer to use * @param buf Value to add * @param len Length of value in bytes * @return True if success, false if failure */ extern bool SCU_SetAdd(SCU_Set* const s, const void* const buf, size_t len); /** * Check if set contains key. * * @param s Set * @param buf Value to add * @param len Length of value in bytes * @return True if set contains key, false if failure */ extern bool SCU_SetContains(SCU_Set* const s, const void* const buf, size_t len); /** * Delete key from set. * * @param s Set * @param buf Value to add * @param len Length of value in bytes * @return True if set contains key and was deleted, false if otherwise */ extern bool SCU_SetDelete(SCU_Set* const s, const void* const buf, size_t len); /** * Returns true if the set should be expanded. * * Uses simple formula: if occupied > capacity * 0.75, then should expand * * This does not expand the set. * * @param s Set * @return True if the set should be expanded, false otherwise */ extern bool SCU_SetShouldExpand(SCU_Set* const s); /** * Add all the elements from source set to destination set. * * @param dest Destination set to insert elements into * @param source Source set to take elements from * @return True if success, false if failure */ extern bool SCU_SetAddAll(SCU_Set* restrict const dest, SCU_Set* restrict const source); #ifdef __cplusplus } #endif #endif
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "UISearchBarDelegate-Protocol.h" @protocol SUSearchBarDelegate <UISearchBarDelegate> @optional - (void)searchBarWillRemoveFromSuperview:(id)arg1; @end
// This file was generated based on 'C:\ProgramData\Uno\Packages\Android\0.13.2\Android\android\graphics\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_ANDROID_ANDROID_GRAPHICS_PAINT_D_L_R_STYLE_H__ #define __APP_ANDROID_ANDROID_GRAPHICS_PAINT_D_L_R_STYLE_H__ #include <app/Android.Base.Wrappers.IJWrapper.h> #include <app/Android.java.lang.Object.h> #include <app/Uno.IDisposable.h> #include <jni.h> #include <Uno.h> namespace app { namespace Android { namespace android { namespace graphics { struct PaintDLRStyle; extern jclass PaintDLRStyle___javaClass_3; extern jfieldID PaintDLRStyle__STROKE_6873_ID; struct PaintDLRStyle__uType : ::app::Android::java::lang::Object__uType { }; PaintDLRStyle__uType* PaintDLRStyle__typeof(); void PaintDLRStyle___Init_3(::uStatic* __this); PaintDLRStyle* PaintDLRStyle__get_STROKE(::uStatic* __this); struct PaintDLRStyle : ::app::Android::java::lang::Object { }; }}}} #endif
// // SSTTableViewUpdater.h // TableMadness // // Created by Brennan Stehling on 5/4/14. // Copyright (c) 2014 SmallSharpTools LLC. All rights reserved. // #import <Foundation/Foundation.h> @protocol TableViewDataRow; @protocol SSTTableViewUpdaterDelegate; @interface SSTTableViewUpdater : NSObject @property (weak, nonatomic) IBOutlet UITableView *tableView; @property (weak, nonatomic) IBOutlet id<SSTTableViewUpdaterDelegate>tableViewUpdaterDelegate; - (void)reloadData:(NSArray *)data; - (void)updateData:(NSArray *)data; - (BOOL)hasPendingUpdate; @end @protocol TableViewDataRow <NSObject> // ID is the same but the object has changed - (BOOL)changedFromOtherItem:(id<TableViewDataRow>)otherItem; @end @protocol SSTTableViewUpdaterDelegate <NSObject> @required - (NSArray *)tableViewUpdaterCurrentTableData:(SSTTableViewUpdater *)updatableTableView; - (void)tableViewUpdater:(SSTTableViewUpdater *)updatableTableView willUpdateWithData:(NSArray *)data; - (void)tableViewUpdater:(SSTTableViewUpdater *)updatableTableView didUpdateWithData:(NSArray *)data; @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 BKSApplicationProcessInfo; @interface BKSWorkspaceApplicationInfo : NSObject { BKSApplicationProcessInfo *_info; _Bool _recordingAudio; _Bool _externalAccessory; } @property(nonatomic) _Bool usingExternalAccessory; // @synthesize usingExternalAccessory=_externalAccessory; @property(nonatomic) _Bool recordingAudio; // @synthesize recordingAudio=_recordingAudio; @property(retain, nonatomic) BKSApplicationProcessInfo *info; // @synthesize info=_info; - (id)description; - (void)dealloc; @end
#ifndef _OSCILLATOR_H_ #define _OSCILLATOR_H_ #include "Timer.h" class Oscillator { public: Oscillator(float initialValue, float moveAmount, float minValue, float maxValue, bool oscil, float seconds); void update(); float getValue() const; void setValue(float val); private: float value, amount; float min, max; bool oscillate; Timer timer; }; #endif //template <class T> //class Oscillator { //public: // Oscillator(T& Value, T& Amount, T& Min, T& Max, bool Oscillate); // void update(); // float getValue() const; //private: // T value, amount, min, max; // bool oscillate; //};
/* * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef OESTextureFloat_h #define OESTextureFloat_h #include "bindings/v8/ScriptWrappable.h" #include "core/html/canvas/WebGLExtension.h" #include "wtf/PassRefPtr.h" namespace WebCore { class OESTextureFloat : public WebGLExtension, public ScriptWrappable { public: static PassRefPtr<OESTextureFloat> create(WebGLRenderingContext*); static bool supported(WebGLRenderingContext*); static const char* extensionName(); virtual ~OESTextureFloat(); virtual ExtensionName name() const; private: OESTextureFloat(WebGLRenderingContext*); }; } // namespace WebCore #endif // OESTextureFloat_h
#include "test.h" void test_0_lt_1(void) { myvm_stack_push(&vm, 0); myvm_stack_push(&vm, 1); myvm_lt(&vm); CU_ASSERT_EQUAL(vm.sb[vm.sp], 1); } TEST_SUITE("myvm_lt", (NULL == CU_add_test(pSuite, "0 lower than 1", test_0_lt_1)) )
/**************************************************************************** Author/Copyright: Jochen Willneff Address: Institute of Geodesy and Photogrammetry ETH - Hoenggerberg CH - 8093 Zurich Creation Date: end of 97 Description: different drawing function to interact with Tcl/Tk Routines contained: drawcross, drawvector, draw_pnr, mark_detections mark_correspondences, mark_corr, mark_track_c ****************************************************************************/ #include "ptv.h" #include "imgcoord.h" #include <optv/parameters.h> /* draws crosses for detected points in a displayed image Arguments: int i - frame number control_par *cpar - scene parameters */ int trajectories_c(int i, control_par *cpar) { int k, intx1, inty1, intx2, inty2; int anz1, anz2, m, j; FILE *fp1; char val[256]; vector *line1, *line2; double color; coord_2d p1[4], p2[4]; sequence_par *seq_par; if (i < 10) sprintf (val, "res/ptv_is.%1d", i); else if (i < 100) sprintf (val, "res/ptv_is.%2d", i); else sprintf (val, "res/ptv_is.%3d", i); fp1 = fopen (val, "r"); if (cpar->num_cams < 3){ seq_par = read_sequence_par("parameters/sequence.par", 4); } else { seq_par = read_sequence_par("parameters/sequence.par", cpar->num_cams); } color = ((double)(i - seq_par->first)) / ((double)(seq_par->last - 2 - seq_par->first)); fscanf (fp1,"%d\n", &anz1); line1 = (vector *) malloc (anz1 * sizeof (vector)); for (j=0;j<anz1;j++) { fscanf (fp1, "%d\n", &line1[j].p); fscanf (fp1, "%d\n", &line1[j].n); fscanf (fp1, "%lf\n", &line1[j].x1); fscanf (fp1, "%lf\n", &line1[j].y1); fscanf (fp1, "%lf\n", &line1[j].z1); } strcpy(val, ""); fclose (fp1); /* read next time step */ if (i+1 < 10) sprintf (val, "res/ptv_is.%1d", i+1); else if (i+1 < 100) sprintf (val, "res/ptv_is.%2d", i+1); else sprintf (val, "res/ptv_is.%3d", i+1); fp1 = fopen (val, "r"); fscanf (fp1,"%d\n", &anz2); line2 = (vector *) calloc (anz2, sizeof (vector)); for (j=0;j<anz2;j++) { fscanf (fp1, "%d\n", &line2[j].p); fscanf (fp1, "%d\n", &line2[j].n); fscanf (fp1, "%lf\n", &line2[j].x1); fscanf (fp1, "%lf\n", &line2[j].y1); fscanf (fp1, "%lf\n", &line2[j].z1); } fclose (fp1); m1_tr=0; for(j=0;j<anz1;j++) { m = line1[j].n; if (m >= 0) { for (k=0; k < cpar->num_cams; k++) { img_coord (k, line1[j].x1, line1[j].y1, line1[j].z1, Ex[k],I[k], G[k], ap[k], *(cpar->mm), &p1[k].x, &p1[k].y); metric_to_pixel (&p1[k].x, &p1[k].y, p1[k].x, p1[k].y, cpar); img_coord (k, line2[m].x1, line2[m].y1, line2[m].z1, Ex[k],I[k], G[k], ap[k], *(cpar->mm), &p2[k].x, &p2[k].y); metric_to_pixel(&p2[k].x, &p2[k].y, p2[k].x, p2[k].y, cpar); if ( fabs( p2[k].x-zoom_x[k]) < cpar->imx/(2*zoom_f[k]) && ( fabs(p2[k].y-zoom_y[k]) < cpar->imy/(2*zoom_f[k])) ) { intx1 = (int)(cpar->imx/2 + zoom_f[k]*(p1[k].x - zoom_x[k])); inty1 = (int)(cpar->imy/2 + zoom_f[k]*(p1[k].y - zoom_y[k])); intx2 = (int)(cpar->imx/2 + zoom_f[k]*(p2[k].x - zoom_x[k])); inty2 = (int)(cpar->imy/2 + zoom_f[k]*(p2[k].y - zoom_y[k])); intx1_tr[k][m1_tr]=intx1; inty1_tr[k][m1_tr]=inty1; intx2_tr[k][m1_tr]=intx2; inty2_tr[k][m1_tr]=inty2; } } m1_tr++; } } strcpy(val, ""); free(line1); free(line2); return 0; }
/* specfunc/gsl_sf_laguerre.h * * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Author: G. Jungman */ #ifndef __GSL_SF_LAGUERRE_H__ #define __GSL_SF_LAGUERRE_H__ #if !defined( GSL_FUN ) # if !defined( GSL_DLL ) # define GSL_FUN extern # elif defined( BUILD_GSL_DLL ) # define GSL_FUN extern __declspec(dllexport) # else # define GSL_FUN extern __declspec(dllimport) # endif #endif #include <gsl/gsl_sf_result.h> #undef __BEGIN_DECLS #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS /* empty */ # define __END_DECLS /* empty */ #endif __BEGIN_DECLS /* L^a_n(x) = (a+1)_n / n! 1F1(-n,a+1,x) */ /* Evaluate generalized Laguerre polynomials * using explicit representations. * * exceptions: none */ GSL_FUN int gsl_sf_laguerre_1_e(const double a, const double x, gsl_sf_result * result); GSL_FUN int gsl_sf_laguerre_2_e(const double a, const double x, gsl_sf_result * result); GSL_FUN int gsl_sf_laguerre_3_e(const double a, const double x, gsl_sf_result * result); GSL_FUN double gsl_sf_laguerre_1(double a, double x); GSL_FUN double gsl_sf_laguerre_2(double a, double x); GSL_FUN double gsl_sf_laguerre_3(double a, double x); /* Evaluate generalized Laguerre polynomials. * * a > -1.0 * n >= 0 * exceptions: GSL_EDOM */ GSL_FUN int gsl_sf_laguerre_n_e(const int n, const double a, const double x, gsl_sf_result * result); GSL_FUN double gsl_sf_laguerre_n(int n, double a, double x); __END_DECLS #endif /* __GSL_SF_LAGUERRE_H__ */
#include <stdio.h> #include <stdlib.h> #include "graph.h" long int get_min_dist_node(long int *Q, unsigned long int *dist, unsigned sz) { /* We're actually looking for the index of the node in Q */ long int p = -1, i = 0; unsigned long int g = (unsigned long int) -1l; while (i < sz) { if (dist[i] < g && Q[i] >= 0) { p = i; g = dist[i]; } i++; } return p; } unsigned long int *dijkstra(graph *G, node *s) { /* min_heap *Q = min_heap_init(); */ node *u; edge buf; unsigned long int *Q = (unsigned long int *) malloc(graph_node_c(G) * sizeof(unsigned long int)); unsigned long int *dist = (unsigned long int *) malloc(graph_node_c(G) * sizeof(unsigned long int)); /* Distance from source */ long int *prev = (long int *) malloc(graph_node_c(G) * sizeof(long int)); /* The previous node list */ unsigned i = 0, n = 0, tmdist, cc = 0; dist[s->label] = 0; /* Distance from source node to itself is nil */ while (i < graph_node_c(G)) { if (i != s->label) { dist[i] = (unsigned) -1l; /* It's actually supposed to be infinity, but ths is the largest we can get using 32-bits */ prev[i] = -1l; /* And we're using this as an undefined, since all our nodes will be with positive labels */ } i++; Q[i] = i; } n = i; /* n will be the size of Q */ while (n > 0) { i = get_min_dist_node(Q, dist, graph_node_c(G)); Q[i] = -1l; u = G->nodes[i]; node_reset_itr(u); printf("Picked node: %u with %u edges\n", i, node_edges(u)); /* for (buf = node_itr_next(u); buf.weight != -1; buf = node_itr_next(u)) { */ cc = 0; while (cc < node_edges(u)) { buf = u->edges[cc]; printf("Looping though node %u\n", buf.next); tmdist = (dist[i] == (unsigned long long) -1l ? (unsigned) -1 : dist[i] + buf.weight); /* Err... */ printf("CMP: %u, %u\n", tmdist, dist[buf.next]); if ((unsigned) tmdist < dist[buf.next]) { printf("DM SUCCEDED: %u with %u\n", tmdist, dist[buf.next]); dist[buf.next] = tmdist; prev[buf.next] = i; } cc++; } printf("Next.\n"); n--; } return prev; } int main(int argc, const char *argv[]) { unsigned long int *f; graph *G = graph_init(); node *n0 = node_init(0); node *n1 = node_init(1); node *n2 = node_init(2); node *n3 = node_init(3); node *n4 = node_init(4); node_add_edge(n2, n4, 11); node_add_edge(n0, n1, 9); node_add_edge(n0, n3, 17); node_add_edge(n1, n2, 1); node_add_edge(n1, n3, 21); node_add_edge(n1, n4, 40); node_add_edge(n2, n3, 12); node_add_edge(n3, n4, 17); graph_add_node(G, n0); graph_add_node(G, n1); graph_add_node(G, n2); graph_add_node(G, n3); graph_add_node(G, n4); f = dijkstra(G, *G->nodes); unsigned i = 0; while (i < graph_node_c(G)) { printf("%d\n", f[i]); i++; } return 0; }
// // BufferScanner.h // test // // Created by Andrew Carter on 7/26/13. // Copyright (c) 2013 PinchStudios. All rights reserved. // #ifndef test_BufferScanner_h #define test_BufferScanner_h typedef struct { char delimiter; // char that seperates the string. ',' in "one,two,three" char *buffer; // string to scan int length; // length of string to scan int position; // current position to scan from (starts at 0) } BufferScanner; // sets up buffer scanner void buffer_scanner_init(BufferScanner *buffer_scanner, char *buffer, int length, char delimiter); // scans to next instance of delimiter, and writes the string scanned into string variable void buffer_scanner_scan_next_string(BufferScanner *buffer_scanner, char *string, int max_string_size); #endif
/* # # # ### ### # # # ### #### # #### ### # # # # # # # # # # # # # # # # # # # #### # # # # # # # # # # # # # ### # ### # # # # ##### ### # # # # # ##### ### # # # # # # # # # # # # # ## ## # # # # # # # # # # # # # # # ### # # # # # # #### #### #### ### */ #if defined(_Z8F6403) // hw_LED.c #include <eZ8.h> // special encore constants, macros and flash routines #include <sio.h> #include "gfx_lib.h" #include "util.h" #include "hw_time.h" #include "hw_LED.h" #define SCROLL_INTERVAL 30 // ms between change #define LED_MAX_STR_LEN 128 #define LED_REFRESH_RATE 1 // 1st bit of millis, 1 kHz. // Global variables used to avoid having to pass pointers to placeholders for hardware specific variables all the way from main char _video_buffer[5][6]; // Contains graphics currently being scrolled across the LED display char _LEDtext[LED_MAX_STR_LEN]; // Contains the complete string to be displayed char _display_column, _scroll_index, _scroll_count, _text_index; // Indices used for scrolling and using persistence of vision void LED_init() { // 'resets' the LED displays. //Set data direction PEDD = 0x00; PGDD = 0x00; _display_column = 0; _scroll_index = 0; _scroll_count = 0; } void LED_display_column(int val, int col, int disp) { char clockval; //LED display clock // Set column PEOUT &= ~(1 << (4 - col)); PEOUT |= ~(1 << (4 - col)) & 0x1F; // Set row to val PGOUT |= val & 0x7F; PGOUT &= val | 0x80; // Clock Display if (disp == 1) { // Clock D2 PGOUT &= 0x7F; // Low PGOUT |= 0x80; // High PGOUT &= 0x7F; // Low } else { switch (disp) { case 0: // D1 clockval = 0x7F; break; case 2: // D3 clockval = 0xDF; break; default: // D4 clockval = 0xBF; break; } PEOUT &= clockval; // Low PEOUT |= ~clockval; // High PEOUT &= clockval; // Low } } void LED_update_video_buffer() { int i, j; for (i = 0; i < 5; ++i) { for (j = 0; j < 5; ++j) { _video_buffer[i][j] = character_data[_LEDtext[_text_index + i] - 0x20][j]; } } } void LED_set_string(char *str) { int i; for (i = 0; i < util_strlen(str) + 8; ++i) { // Copy string, padding with 4 spaces _LEDtext[i] = i < 4 || i >= util_strlen(str) + 4 ? ' ' : str[i - 4]; } _LEDtext[util_strlen(str) + 8] = '\0'; } void LED_update() { int i; if (hw_time_get_LEDflag()) { hw_time_set_LEDflag(0); ++_scroll_count; for (i = 0; i < 4; ++i) { LED_display_column((int) * (&_video_buffer[i][0] + _display_column + _scroll_index), (int) _display_column, i); } // Change column _display_column == 4 ? _display_column = 0 : ++_display_column; if (_scroll_count >= SCROLL_INTERVAL) { if (_scroll_index >= 5) { _scroll_index = 0; _text_index >= util_strlen(_LEDtext) - 5 ? _text_index = 0 : ++_text_index; LED_update_video_buffer(); } ++_scroll_index; _scroll_count = 0; } } } #endif #if defined(__APPLE__) || (__WIN32__) void LED_init() {}; void LED_display_column(int val, int col, int disp) {}; void LED_update_video_buffer() {}; void LED_set_string(char *str) {}; void LED_update() {}; #endif
// Copyright 2011-2014 UFNA, LLC. All Rights Reserved. #pragma once #include "SeaCraftDamageType.generated.h" /** * DamageType class that specifies classes of weapons (icon, stats group, etc.) */ UCLASS(const, Blueprintable, BlueprintType) class USeaCraftDamageType : public UDamageType { GENERATED_UCLASS_BODY() };
// // FlyingLoginVC.h // FlyingEnglish // // Created by vincent sung on 12/10/15. // Copyright © 2015 BirdEngish. All rights reserved. // #import <UIKit/UIKit.h> #import "FlyingAnimatedImagesView.h" @interface FlyingLoginVC : UIViewController<FlyingAnimatedImagesViewDelegate> - (void)login:(NSString *)userName password:(NSString *)password; //验证手机号码 + (BOOL) validateMobile:(NSString *)mobile; //验证电子邮箱 + (BOOL) validateEmail:(NSString *)email; //验证密码 + (BOOL) validatePassword:(NSString *) password; @end
/** * @file task_timer.h * @brief 任务定时器 * @author chxuan, 787280310@qq.com * @version 1.0.0 * @date 2017-11-05 */ #pragma once #include <vector> #include <thread> #include <memory> #include <atomic> #include <functional> #include <boost/timer.hpp> #include <boost/asio.hpp> template<typename Duration = boost::posix_time::milliseconds> class task_timer { public: task_timer() : work_(ios_), timer_(ios_), single_shot_(false) {} ~task_timer() { destroy(); } void start(std::size_t duration) { if (ios_.stopped() || duration == 0) { return; } duration_ = duration; if (thread_ == nullptr) { thread_ = std::make_unique<std::thread>([this]{ ios_.run(); }); } start(); } void start() { if (duration_ == 0) { return; } timer_.expires_from_now(Duration(duration_)); timer_.async_wait([this](const boost::system::error_code& ec) { if (ec) { return; } for (auto& func : func_list_) { func(); } if (!single_shot_) { start(); } }); } void stop() { timer_.cancel(); } void destroy() { stop(); ios_.stop(); if (thread_ != nullptr) { if (thread_->joinable()) { thread_->join(); } } } void bind(const std::function<void()>& func) { func_list_.emplace_back(func); } void set_single_shot(bool single_short) { single_shot_ = single_short; } private: boost::asio::io_service ios_; boost::asio::io_service::work work_; boost::asio::deadline_timer timer_; std::unique_ptr<std::thread> thread_ = nullptr; std::vector<std::function<void()>> func_list_; std::atomic<bool> single_shot_; std::size_t duration_ = 0; };
#include <stdio.h> #include <mpi.h> /* This function synchronizes process i with process j * in such a way that this function returns on process j * only after it has been called on process i. * * No additional semantic guarantees are provided. * * The process ranks are with respect to the input communication. */ int p2p_xsync(int i, int j, MPI_Comm comm) { /* Avoid deadlock. */ if (i==j) { return MPI_SUCCESS; } int rank; MPI_Comm_rank(comm, &rank); int tag = 666; /* The number of the beast. */ if (rank==i) { MPI_Send(NULL, 0, MPI_INT, j, tag, comm); } else if (rank==j) { MPI_Recv(NULL, 0, MPI_INT, i, tag, comm, MPI_STATUS_IGNORE); } return MPI_SUCCESS; } /* If val is the same at all MPI processes in comm, * this function returns 1, else 0. */ int coll_check_equal(int val, MPI_Comm comm) { int min, max; MPI_Allreduce(&val, &min, 1, MPI_INT, MPI_MIN, comm); MPI_Allreduce(&val, &max, 1, MPI_INT, MPI_MAX, comm); return (min==max ? 1 : 0); } int main(int argc, char * argv[]) { MPI_Init(&argc, &argv); int rank, size; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); int * shptr = NULL; MPI_Win shwin; MPI_Win_allocate_shared(rank==0 ? sizeof(int) : 0,sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &shptr, &shwin); /* l=local r=remote */ MPI_Aint rsize = 0; int rdisp; int * rptr = NULL; int lint = -999; MPI_Win_shared_query(shwin, 0, &rsize, &rdisp, &rptr); if (rptr==NULL || rsize!=sizeof(int)) { printf("rptr=%p rsize=%zu \n", rptr, (size_t)rsize); MPI_Abort(MPI_COMM_WORLD, 1); } /*******************************************************/ if (rank==0) { MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, shwin); *shptr = 42; /* Answer to the Ultimate Question of Life, The Universe, and Everything. */ MPI_Win_unlock(0, shwin); } for (int j=1; j<size; j++) { p2p_xsync(0, j, MPI_COMM_WORLD); } MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, shwin); lint = *rptr; MPI_Win_unlock(0, shwin); /*******************************************************/ if (1==coll_check_equal(lint,MPI_COMM_WORLD)) { if (rank==0) { printf("SUCCESS!\n"); } } else { printf("rank %d: lint = %d \n", rank, lint); } MPI_Win_free(&shwin); MPI_Finalize(); return 0; }
/******************************************************************************* **NOTE** This code was generated by a tool and will occasionally be overwritten. We welcome comments and issues regarding this code; they will be addressed in the generation tool. If you wish to submit pull requests, please do so for the templates in that tool. This code was generated by Vipr (https://github.com/microsoft/vipr) using the T4TemplateWriter (https://github.com/msopentech/vipr-t4templatewriter). Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License 2.0; see LICENSE in the source repository root for authoritative license information. ******************************************************************************/ #ifndef MSSAMPLESERVICESAMPLEENTITYCOLLECTIONOPERATIONS_H #define MSSAMPLESERVICESAMPLEENTITYCOLLECTIONOPERATIONS_H #import "MSSampleServiceModels.h" #import "api/api.h" #import "core/core.h" #import "MSSampleServiceEntityCollectionOperations.h" /** MSSampleServiceSampleEntityCollectionOperations * */ @interface MSSampleServiceSampleEntityCollectionOperations : MSSampleServiceEntityCollectionOperations - (void)twoParamsActionsFirstIsEntityTypeWithAnEntity:(MSSampleServiceSampleEntity *)anEntity booleanParams:(bool)booleanParams callback:(void (^)(int, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsEntityTypeRawWithAnEntity:(NSString *)anEntity booleanParams:(NSString *)booleanParams callback:(void (^)(NSString *, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsComplexTypeWithComplexType:(MSSampleServiceSampleComplexType *)complexType booleanParams:(bool)booleanParams callback:(void (^)(int, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsComplexTypeRawWithComplexType:(NSString *)complexType booleanParams:(NSString *)booleanParams callback:(void (^)(NSString *, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsCollectionEntityTypeWithCollectionType:(MSSampleServiceSampleEntity *)collectionType booleanParams:(bool)booleanParams callback:(void (^)(int, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsCollectionEntityTypeRawWithCollectionType:(NSString *)collectionType booleanParams:(NSString *)booleanParams callback:(void (^)(NSString *, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsCollectionComplexTypeWithCollectionType:(MSSampleServiceSampleComplexType *)collectionType booleanParams:(bool)booleanParams callback:(void (^)(int, MSOrcError*))callback ; - (void)twoParamsActionsFirstIsCollectionComplexTypeRawWithCollectionType:(NSString *)collectionType booleanParams:(NSString *)booleanParams callback:(void (^)(NSString *, MSOrcError*))callback ; @end #endif
/* * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 * The President and Fellows of Harvard College. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Thread test code. */ #include <types.h> #include <lib.h> #include <thread.h> #include <synch.h> #include <test.h> #define NTHREADS 8 static struct semaphore *tsem = NULL; static void init_sem(void) { if (tsem==NULL) { tsem = sem_create("tsem", 0); if (tsem == NULL) { panic("threadtest: sem_create failed\n"); } } } static int loudthread(void *junk, unsigned long num) { int ch = '0' + num; int i; (void)junk; for (i=0; i<120; i++) { putch(ch); } V(tsem); return 0; } /* * The idea with this is that you should see * * 01234567 <pause> 01234567 * * (possibly with the numbers in different orders) * * The delay loop is supposed to be long enough that it should be clear * if either timeslicing or the scheduler is not working right. */ static int quietthread(void *junk, unsigned long num) { int ch = '0' + num; volatile int i; (void)junk; putch(ch); for (i=0; i<200000; i++); putch(ch); V(tsem); return 0; } static void runthreads(int doloud) { char name[16]; int i, result; for (i=0; i<NTHREADS; i++) { snprintf(name, sizeof(name), "threadtest%d", i); result = thread_fork(name, NULL, NULL, doloud ? loudthread : quietthread, NULL, i); if (result) { panic("threadtest: thread_fork failed %s)\n", strerror(result)); } } for (i=0; i<NTHREADS; i++) { P(tsem); } } /** static int go(void* p, unsigned long n) { (void)p; //unused kprintf("Hello from thread %ld\n", n); return 100 + n; } static void runthreadjointest(void) { struct thread *children[NTHREADS]; int err; int ret; for(int i=0; i < NTHREADS; i++) thread_fork("child", &(children[i]), NULL, &go, NULL, i); for(int i=0; i < NTHREADS; i++) { err = thread_join(children[i], &ret); kprintf("Thread %d returned with %d\n", i, ret); } kprintf("Main thread done.\n"); } **/ /* ---------------------------------- */ int threadtest(int nargs, char **args) { (void)nargs; (void)args; init_sem(); kprintf("Starting thread test...\n"); runthreads(1); kprintf("\nThread test done.\n"); return 0; } int threadtest2(int nargs, char **args) { (void)nargs; (void)args; init_sem(); kprintf("Starting thread test 2...\n"); runthreads(0); kprintf("\nThread test 2 done.\n"); return 0; } /** // thest for thread_join int threadtest4(int nargs, char **args) { (void) nargs; (void) args; kprintf("Starting thread test 4 (join)...\n"); runthreadjointest(); kprintf("\nThread test 4 (join) done.\n"); return 0; } **/
// // HZBaseViewController.h // HZURLJumpManager // // Created by History on 14-8-10. // Copyright (c) 2014年 History. All rights reserved. // #import <UIKit/UIKit.h> @interface HZBaseViewController : UIViewController @property (nonatomic, strong) NSDictionary *moduleObject; @end
// // syscall.c // BakingPi // // Created by Jeremy Pereira on 06/12/2012. // Copyright (c) 2012 Jeremy Pereira. All rights reserved. // #include "syscall.h" #include "thread.h" #include "console.h" /* * System call dispatch table entry. If the size of it is a power of 2, it * will be faster than otherwise. */ struct DispatchTableEntry { uint32_t ordinal; SyscallFunction dispatchFunction; }; typedef struct DispatchTableEntry DispatchTableEntry; static int32_t ping(void* inBlock, void* outBlock); static int32_t reschedule(void* inBlock, void* outBlock); DispatchTableEntry dispatchTable[] = { { SYSCALL_RESCHEDULE, reschedule }, { SYSCALL_PING, ping }, { SYSCALL_COUNT, NULL } }; int32_t syscallDispatch(uint32_t trapNumber, uint32_t syscallNumber, void* inBlock, void* outBlock) { if (syscallNumber >= SYSCALL_COUNT) { // TODO: Set some sort of error code for the thread thread_cancel(thread_currentThread()); } return dispatchTable[syscallNumber].dispatchFunction(inBlock, outBlock); } int32_t ping(void* inBlock, void* outBlock) { Console* console = con_getTheConsole(); con_newLine(console); con_putCString(console, "Ping: "); con_putCString(console, "in block = "); con_putHex32(console, (uint32_t) inBlock); con_putCString(console, ", out block = "); con_putHex32(console, (uint32_t) outBlock); con_newLine(console); return 0; } int32_t reschedule(void* inBlock, void* outBlock) { thread_reschedule(); return 0; }
// // StatusItemView.h // Frenzy // // Created by John Winter on 8/06/10. // Copyright 2010 Aptonic Software. All rights reserved. // #import <Cocoa/Cocoa.h> #import "NSPasteboard+iTunes.h" @class DragHandler; @interface StatusItemView : NSView <NSMenuDelegate> { NSImage *statusImage; NSStatusItem *statusItem; NSMenu *mainMenu; DragHandler *dragHandler; BOOL isMouseDown; BOOL isMenuVisible; int unreadCount; } @property (retain) NSImage *statusImage; @property (retain) NSStatusItem *statusItem; @property (retain) NSMenu *mainMenu; @property int unreadCount; @end
// // Configuration.h // MangoNetwork // // Created by apple on 14-8-26. // Copyright (c) 2014年 戴维营教育. All rights reserved. // #import <Foundation/Foundation.h> extern NSString * const kGetTodayCommend; extern NSString * const kGetTVLive; extern NSString * const kRefreshData; extern NSString * const kGetTodayCommendURL; extern NSString * const kGetLiveURL;
// // ViewController.h // ATKitDemo // // Created by Aesir Titan on 2016-09-12. // Copyright © 2016 Titan Studio. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#ifndef _MODULE_RENDER_3D_H_ #define _MODULE_RENDER_3D_H_ #include "Module.h" #include "Globals.h" #include "Light.h" #include "MathGeoLib/MathGeoLib.h" #include "imgui/IGizmo.h" #define MAX_LIGHTS 8 #define SCENE_BORDER_X 15 #define SCENE_BORDER_Y 30 class DockContext; class ComponentCamera; enum GUIZMO_STATE { GUIZMO_NONE, GUIZMO_TRANSLATE, GUIZMO_ROTATE, GUIZMO_SCALE }; class FrameTexture { public: FrameTexture(); ~FrameTexture(); public: void Create(int, int); void Bind(); void UnBind(); void Destroy(); public: uint frame_id = 0; uint rbo_id = 0; uint texture_id = 0; uint depth_id = 0; int width = 0; int height = 0; }; class ModuleRenderer3D : public Module { public: ModuleRenderer3D(const char* _name, MODULE_ID _id, bool _config_menu, bool _enabled = true); ~ModuleRenderer3D(); public: bool Awake(const JSON_Object* data_root)final; bool Init() final; bool Start() final; update_status PreUpdate(float dt) final; update_status Update(float dt)final; update_status PostUpdate(float dt) final; bool CleanUp() final; void BlitConfigInfo()final; void SaveConfigInfo(JSON_Object* data_root); private: bool vsync = false; bool depth_test = false; bool cull_face = false; bool texture_2d = false; bool dither = false; bool wireframe = false; bool front_wireframe = false; bool lighting = false; float lighting_color[4]; bool material_color = false; float material_ambient[4]; float material_diffuse[4]; bool fog = false; float fog_density = 0.0f; float fog_color[4]; bool custom_clear = false; float clear_color[4]; float clear_depth = 0.0f; float min_render_distance = 0.0f; float max_render_distance = 0.0f; private: Light lights[MAX_LIGHTS]; SDL_GLContext context; math::float4x4 camera_view_matrix, game_view_matrix; unsigned int quadVAO = 0, quadVBO = 0; DockContext* render_dock = nullptr; ImVec2 image_window_pos; ImVec2 image_window_size; ImVec2 game_window_size; //Editor Camera texture FrameTexture* render_to_texture = nullptr; //Game Camera Texture FrameTexture* game_to_texture = nullptr; std::vector<ComponentCamera*> game_cameras; ComponentCamera* main_camera = nullptr; bool mouse_on_workspace = false; void CalculatePrespective(math::float4x4& target, float fovy, float aspect, float n, float f); //Guizmos IGizmo* print_gizmo = nullptr; IGizmo* trans_gizmo = nullptr; IGizmo* rotate_gizmo = nullptr; IGizmo* scale_gizmo = nullptr; public: //Set Methods ----------- void SetMainCamera(ComponentCamera* new_main_cam); void SetGizmo(GUIZMO_STATE state); //Get Methods ----------- bool GetWireframe() const; bool GetWireframeFront() const; bool GetMouseOnWorkspace()const; float GetMaxRenderDistance()const; ImVec2 GetSceneImagePos()const; ImVec2 GetSceneImageSize()const; ImVec2 GetGameImageSize()const; const FrameTexture* GetFrameTextureRender() const; const FrameTexture* GetFrameTextureGame() const; IGizmo* GetGizmo() const; //Functionality --------- void OnResize(int width, int height); void OnSceneResize(int width, int height); void OnGameResize(int width, int height); void DisableGLRenderFlags(); void EnableGLRenderFlags(); void AddGameCamera(ComponentCamera* new_game_cam); void RemoveGameCamera(ComponentCamera* removed_game_cam); void PrintPlayPauseButton() const; private: //Functions to change the void SetGameCameraView(); void SetEditorCameraView(); void CleanCameraView(); void PrintSceneFrame(float dt); void PrintGameFrame(float dt); void HandleGizmoInput(); }; #endif // !_MODULE_RENDER_3D_H_
// // NSArray+TP.h // TestPod // // Created by 邓乐 on 2017/8/9. // Copyright © 2017年 Wanda. All rights reserved. // #import <Foundation/Foundation.h> @interface NSArray (TP) - (NSString*)toJsonString; @end
//Copyright 2017 Carl Bycraft // //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 SP_LEXER_H #define SP_LEXER_H #include <vector> namespace splexer { enum Token { String, Dot, Dash, OpenParenthesis, CloseParenthesis, Star, Cross, ForwardSlash, BackSlash, EqualSign, Space, Tab, CarriageReturn, Newline, EndOfFile, Unknown }; class TokenNode { public: TokenNode(int lineNumber, int charNumber, Token token, std::string value); ~TokenNode(); int GetLineNumber(); int GetCharNumber(); Token GetToken(); std::string GetValue(); std::string TokenAsString(); //(LN=XX;CN=XX;TK=XX;VL=XX) private: int _lineNumber; int _charNumber; Token _token; std::string _value; std::string EnumAsString(Token token); }; class Lexer { public: Lexer(std::vector<std::string> spiceFile); ~Lexer(); const std::vector<TokenNode>& GetTokens() const; private: std::vector<TokenNode> _tokens; }; } #endif
// // GPMusicCell.h // LinLinMusic // // Created by mac on 15-1-27. // Copyright (c) 2015年 gpr. All rights reserved. // #import <UIKit/UIKit.h> @class GPLRCViewItem; @interface GPMusicCell : UITableViewCell @property (nonatomic,strong) GPLRCViewItem *lrcItem; /** 用来控制当前行歌词播放的进度 */ @property (nonatomic,assign) CGFloat currItemPrecent; + (NSString *)cellID; + (CGFloat)defaultRowHeight; @end
#pragma once #include "../../../ComponentModel/UpdateableComponent.h" #include "../../Data/AI/AINode.h" #include "../../Data/AI/BehaviorTreeEvaluator.h" #include "../../Data/AI/BehaviorTreeValidator.h" class AITreeExecutorBehavior : public UpdateableComponent { public: AITreeExecutorBehavior( AINode * tree, BehaviorTreeEvaluator * evaluator, BehaviorTreeValidator * validator); ~AITreeExecutorBehavior(); virtual void initialize(bool force = false) override; virtual void terminate() override; virtual void update(float deltaTime) override; virtual NodeInformation* CreateInfo() = 0; private: BehaviorTreeEvaluator * _evaluator; BehaviorTreeValidator * _validator; AINode * _tree; bool _treeIsValid; NodeInformation* _info; };
#import <Foundation/NSException.h> #import <Foundation/NSString.h> static inline void _KGInvalidAbstractInvocation(SEL selector,id object,const char *file,int line) { [NSException raise:NSInvalidArgumentException format:@"-%s only defined for abstract class. Define -[%@ %s] in %s:%d!", sel_getName (selector),[object class], sel_getName (selector),file,line]; } static inline void _KGUnimplementedMethod(SEL selector,id object,const char *file,int line) { NSLog(@"-[%@ %s] unimplemented in %s at %d",[object class],sel_getName(selector),file,line); } static inline void _KGUnimplementedFunction(const char *fname,const char *file,int line) { NSLog(@"%s() unimplemented in %s at %d",fname,file,line); } #define KGInvalidAbstractInvocation() \ _KGInvalidAbstractInvocation(_cmd,self,__FILE__,__LINE__) #define KGUnimplementedMethod() \ _KGUnimplementedMethod(_cmd,self,__FILE__,__LINE__) #define KGUnimplementedFunction() \ _KGUnimplementedFunction(__PRETTY_FUNCTION__,__FILE__,__LINE__)
// // Created by Nuno Levezinho on 07/02/2018. // #ifndef AVALONENGINE_SUBJECT_H #define AVALONENGINE_SUBJECT_H #include <map> #include <vector> #include <functional> #include "../Locator.h" namespace av { template <typename Event> class Subject { public: Subject() = default; template <typename Observer> void RegisterObserver(const Event& l_event, Observer&& l_observer) { this->m_observers_[l_event].push_back(std::forward<Observer>(l_observer)); } template <typename Observer> void RegisterObserver(Event&& l_event, Observer&& l_observer) { this->m_observers_[std::move(l_event)].push_back(std::forward<Observer>(l_observer)); } void Notify(const Event& l_event) const { try { for(const auto& obs : this->m_observers_.at(l_event)) obs(); // Notify all observers } catch (std::exception& e) { Locator::GetLogger() << __FUNCTION__ << "No Observers registered for Event"; } } //Disallow copying and assigning Subject(const Subject&) = delete; Subject& operator=(const Subject&) = delete; private: std::map<Event, std::vector<std::function<void()>>> m_observers_; }; } #endif //AVALONENGINE_SUBJECT_H
// // UIViewController+AppCore.h // DVAppCore // // Created by Denis Vashkovski on 12/02/16. // Copyright © 2016 Denis Vashkovski. All rights reserved. // #import <UIKit/UIKit.h> @interface UIViewController(AppCore) + (UIViewController *)ac_findBestViewController:(UIViewController *)vc; + (UIViewController *)ac_currentViewController; + (instancetype)ac_newInstance; - (void)ac_initBackButtonIfNeeded; - (CGRect)ac_visibleFrame; - (UIBarButtonItem *)ac_backButton; - (void)ac_onBackButtonTouch:(UIBarButtonItem *)sender; - (void)ac_removeBackButton; - (void)ac_startLoadingProcess; - (void)ac_stopLoadingProcess; - (BOOL)ac_isNowLoading; - (void)ac_hideKeyboard; - (UINavigationController *)ac_embedInNavigationController; // Add Child View Controller - (void)ac_addChildViewController:(UIViewController *)childViewController intoViewContainer:(UIView *)viewContainer; - (void)ac_addChildViewController:(UIViewController *)childViewController; - (void)ac_removeChildViewController:(UIViewController *)childViewController; @end Class ACVCClassFromParentVCClass(Class parentVCClass);
#ifndef __UITILELAYOUT_H__ #define __UITILELAYOUT_H__ #pragma once namespace DuiLib { class UILIB_API CTileLayoutUI : public CContainerUI { public: CTileLayoutUI(); LPCTSTR GetClass() const; LPVOID GetInterface(LPCTSTR pstrName); void SetPos(RECT rc, bool bNeedInvalidate = true); int GetFixedColumns() const; void SetFixedColumns(int iColums); int GetChildVPadding() const; void SetChildVPadding(int iPadding); SIZE GetItemSize() const; void SetItemSize(SIZE szSize); int GetColumns() const; int GetRows() const; void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); protected: SIZE m_szItem; int m_nColumns; int m_nRows; int m_nColumnsFixed; int m_iChildVPadding; bool m_bIgnoreItemPadding; }; } #endif // __UITILELAYOUT_H__
/* * Exercise 3-1: * Write a version of binary search with only one test inside the loop. * Measure the difference in run-time between this and the K&R version. */ #include <stdio.h> #include <time.h> #define MAX_ELEMENT 20000 /* * K & R version: * binsearch: find x in sorted v */ int binsearch(int x, int v[], int n) { int low, high, mid; low = 0; high = n - 1; while (low <= high) { mid = (low + high) / 2; if (x < v[mid]) high = mid - 1; else if (x > v[mid]) low = mid + 1; else /* found match */ return mid; } return -1; /* no match */ } int binsearch2(int x, int v[], int n) { int low, high, mid; low = 0; high = n - 1; mid = (low + high) / 2; while (low <= high) { if (x < v[mid]) high = mid - 1; else low = mid + 1; mid = (low + high) / 2; } if (x == v[mid]) return mid; else return -1; /* no match */ } /* * No idea how to time these so I used Paul Griffith's code from: * http://clc-wiki.net/wiki/K%26R2_solutions:Chapter_3:Exercise_1 */ int main() { /* initial testing */ /*int n = 9;*/ /*int v[9] = {0, 3, 6, 10, 15, 22, 23, 24, 30};*/ /*int x = 23;*/ /*printf("%d\n\n", binsearch2(x, v, n));*/ int test_data[MAX_ELEMENT]; int index; /* index of found elem in test data. */ int n = -1; /* elem to search for. */ int i; clock_t time_taken; /* init test data */ for (i=0; i < MAX_ELEMENT; ++i) test_data[i] = i; /* output approximation of time taken for 100,000 iterations of binsearch. */ for (i=0, time_taken=clock(); i < 100000; ++i) { index = binsearch(n, test_data, MAX_ELEMENT); } time_taken = clock() - time_taken; if (index < 0) printf("Elem %d not found.\n", n); else printf("%d found at index %d.\n", n, index); printf("binsearch() took %lu clocks (%lu seconds)\n", (unsigned long) time_taken, (unsigned long) time_taken / CLOCKS_PER_SEC); /* Output approx of time taken for 100,000 iterations of binsearch2 */ for (i=0, time_taken=clock(); i < 100000; ++i) { index = binsearch2(n, test_data, MAX_ELEMENT); } time_taken = clock() - time_taken; if (index < 0) printf("Elem %d not found.\n", n); else printf("%d found at index %d.\n", n, index); printf("binsearch2() took %lu clocks (%lu seconds)\n", (unsigned long) time_taken, (unsigned long) time_taken / CLOCKS_PER_SEC); return 0; }
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /* The global function contained in this file initializes SPL function * pointers, currently only for ARM platforms. * * Some code came from common/rtcd.c in the WebM project. */ #include "webrtc/common_audio/signal_processing/include/real_fft.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" #include "webrtc/system_wrappers/interface/cpu_features_wrapper.h" /* Declare function pointers. */ MaxAbsValueW16 WebRtcSpl_MaxAbsValueW16; MaxAbsValueW32 WebRtcSpl_MaxAbsValueW32; MaxValueW16 WebRtcSpl_MaxValueW16; MaxValueW32 WebRtcSpl_MaxValueW32; MinValueW16 WebRtcSpl_MinValueW16; MinValueW32 WebRtcSpl_MinValueW32; CrossCorrelation WebRtcSpl_CrossCorrelation; DownsampleFast WebRtcSpl_DownsampleFast; ScaleAndAddVectorsWithRound WebRtcSpl_ScaleAndAddVectorsWithRound; CreateRealFFT WebRtcSpl_CreateRealFFT; FreeRealFFT WebRtcSpl_FreeRealFFT; RealForwardFFT WebRtcSpl_RealForwardFFT; RealInverseFFT WebRtcSpl_RealInverseFFT; #if (defined(WEBRTC_DETECT_ARM_NEON) || !defined(WEBRTC_ARCH_ARM_NEON)) && \ !defined(MIPS32_LE) /* Initialize function pointers to the generic C version. */ static void InitPointersToC() { WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16C; WebRtcSpl_MaxAbsValueW32 = WebRtcSpl_MaxAbsValueW32C; WebRtcSpl_MaxValueW16 = WebRtcSpl_MaxValueW16C; WebRtcSpl_MaxValueW32 = WebRtcSpl_MaxValueW32C; WebRtcSpl_MinValueW16 = WebRtcSpl_MinValueW16C; WebRtcSpl_MinValueW32 = WebRtcSpl_MinValueW32C; WebRtcSpl_CrossCorrelation = WebRtcSpl_CrossCorrelationC; WebRtcSpl_DownsampleFast = WebRtcSpl_DownsampleFastC; WebRtcSpl_ScaleAndAddVectorsWithRound = WebRtcSpl_ScaleAndAddVectorsWithRoundC; WebRtcSpl_CreateRealFFT = WebRtcSpl_CreateRealFFTC; WebRtcSpl_FreeRealFFT = WebRtcSpl_FreeRealFFTC; WebRtcSpl_RealForwardFFT = WebRtcSpl_RealForwardFFTC; WebRtcSpl_RealInverseFFT = WebRtcSpl_RealInverseFFTC; } #endif #if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) /* Initialize function pointers to the Neon version. */ static void InitPointersToNeon() { WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16Neon; WebRtcSpl_MaxAbsValueW32 = WebRtcSpl_MaxAbsValueW32Neon; WebRtcSpl_MaxValueW16 = WebRtcSpl_MaxValueW16Neon; WebRtcSpl_MaxValueW32 = WebRtcSpl_MaxValueW32Neon; WebRtcSpl_MinValueW16 = WebRtcSpl_MinValueW16Neon; WebRtcSpl_MinValueW32 = WebRtcSpl_MinValueW32Neon; WebRtcSpl_CrossCorrelation = WebRtcSpl_CrossCorrelationNeon; WebRtcSpl_DownsampleFast = WebRtcSpl_DownsampleFastNeon; WebRtcSpl_ScaleAndAddVectorsWithRound = WebRtcSpl_ScaleAndAddVectorsWithRoundNeon; WebRtcSpl_CreateRealFFT = WebRtcSpl_CreateRealFFTNeon; WebRtcSpl_FreeRealFFT = WebRtcSpl_FreeRealFFTNeon; WebRtcSpl_RealForwardFFT = WebRtcSpl_RealForwardFFTNeon; WebRtcSpl_RealInverseFFT = WebRtcSpl_RealInverseFFTNeon; } #endif #if defined(MIPS32_LE) /* Initialize function pointers to the MIPS version. */ static void InitPointersToMIPS() { WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16_mips; WebRtcSpl_MaxValueW16 = WebRtcSpl_MaxValueW16_mips; WebRtcSpl_MaxValueW32 = WebRtcSpl_MaxValueW32_mips; WebRtcSpl_MinValueW16 = WebRtcSpl_MinValueW16_mips; WebRtcSpl_MinValueW32 = WebRtcSpl_MinValueW32_mips; WebRtcSpl_CrossCorrelation = WebRtcSpl_CrossCorrelationC; WebRtcSpl_DownsampleFast = WebRtcSpl_DownsampleFast_mips; WebRtcSpl_ScaleAndAddVectorsWithRound = WebRtcSpl_ScaleAndAddVectorsWithRoundC; WebRtcSpl_CreateRealFFT = WebRtcSpl_CreateRealFFTC; WebRtcSpl_FreeRealFFT = WebRtcSpl_FreeRealFFTC; WebRtcSpl_RealForwardFFT = WebRtcSpl_RealForwardFFTC; WebRtcSpl_RealInverseFFT = WebRtcSpl_RealInverseFFTC; #if defined(MIPS_DSP_R1_LE) WebRtcSpl_MaxAbsValueW32 = WebRtcSpl_MaxAbsValueW32_mips; #else WebRtcSpl_MaxAbsValueW32 = WebRtcSpl_MaxAbsValueW32C; #endif } #endif static void InitFunctionPointers(void) { #if defined(WEBRTC_DETECT_ARM_NEON) if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { InitPointersToNeon(); } else { InitPointersToC(); } #elif defined(WEBRTC_ARCH_ARM_NEON) InitPointersToNeon(); #elif defined(MIPS32_LE) InitPointersToMIPS(); #else InitPointersToC(); #endif /* WEBRTC_DETECT_ARM_NEON */ } #if defined(WEBRTC_POSIX) #include <pthread.h> static void once(void (*func)(void)) { static pthread_once_t lock = PTHREAD_ONCE_INIT; pthread_once(&lock, func); } #elif defined(_WIN32) #include <windows.h> static void once(void (*func)(void)) { /* Didn't use InitializeCriticalSection() since there's no race-free context * in which to execute it. * * TODO(kma): Change to different implementation (e.g. * InterlockedCompareExchangePointer) to avoid issues similar to * http://code.google.com/p/webm/issues/detail?id=467. */ static CRITICAL_SECTION lock = {(void *)((size_t)-1), -1, 0, 0, 0, 0}; static int done = 0; EnterCriticalSection(&lock); if (!done) { func(); done = 1; } LeaveCriticalSection(&lock); } /* There's no fallback version as an #else block here to ensure thread safety. * In case of neither pthread for WEBRTC_POSIX nor _WIN32 is present, build * system should pick it up. */ #endif /* WEBRTC_POSIX */ void WebRtcSpl_Init() { once(InitFunctionPointers); }
/* * Created by Phil Nash on 1/2/2013. * Copyright 2013 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED #define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED #include <string> #include "catch_result_type.h" #include "catch_common.h" namespace Catch { struct MessageInfo { MessageInfo(std::string const &_macroName, SourceLineInfo const &_lineInfo, ResultWas::OfType _type); std::string macroName; SourceLineInfo lineInfo; ResultWas::OfType type; std::string message; unsigned int sequence; bool operator==(MessageInfo const &other) const { return sequence == other.sequence; } bool operator<(MessageInfo const &other) const { return sequence < other.sequence; } private: static unsigned int globalCount; }; struct MessageBuilder { MessageBuilder(std::string const &macroName, SourceLineInfo const &lineInfo, ResultWas::OfType type) : m_info(macroName, lineInfo, type) { } template<typename T> MessageBuilder &operator<<(T const &value) { m_stream << value; return *this; } MessageInfo m_info; std::ostringstream m_stream; }; class ScopedMessage { public: ScopedMessage(MessageBuilder const &builder); ScopedMessage(ScopedMessage const &other); ~ScopedMessage(); MessageInfo m_info; }; } // end namespace Catch #endif // TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "Engine.h" #include "OnlineSubsystemDriftModule.h" #include "OnlineSubsystemModule.h" #include "OnlineSubsystem.h" #include "ModuleManager.h" #define INVALID_INDEX -1 /** URL Prefix when using Drift socket connection */ #define NULL_URL_PREFIX TEXT("Drift.") /** pre-pended to all Drift logging */ #undef ONLINE_LOG_PREFIX #define ONLINE_LOG_PREFIX TEXT("DRIFT: ")
#pragma once #include "Person.h" #include <vector> #include "Cini/CiniAPI.h" using namespace std; class Search; class Storage{ public: static vector<Person> FindFromtxt(const Search& search); static void ChangePersonToSearch(Person& person); static void Refresh(); static bool IsEducationPass(const string& person, const string& search); }; class storage_{ public: Cini* ini = nullptr; storage_(); void GetInfo(); };
#ifndef __LEVEL_SCENE_FACTORY_H__ #define __LEVEL_SCENE_FACTORY_H__ #include <string> #include "cocos2d.h" #include "SceneFactory.h" #include "LevelSceneConfig.h" #include "..\Entity\RainDrop.h" USING_NS_CC; class LevelSceneFactory: public SceneFactory { public: LevelScene* createScene(LevelScene *scene, SCENE_INDEX scene_type, Vector<RainDrop*> *rain); private: void AddRainDrops(LevelScene *scene, SCENE_INDEX scene_type,Vector<RainDrop*> *rain); //µ¥¸ö³¡¾°µÄÓêµÎ void AddRainDropsS2(LevelScene *scene, Vector<RainDrop*> *rain); void AddRainDropsS3(LevelScene *scene, Vector<RainDrop*> *rain); void AddRainDropsS4(LevelScene *scene, Vector<RainDrop*> *rain); void AddRainDropsS5(LevelScene *scene, Vector<RainDrop*> *rain); void AddRainDropsS6(LevelScene *scene, Vector<RainDrop*> *rain); //ÌØÊâµÄ½áÊø³¡¾° void AddEndScene(LevelScene *scene); }; #endif
// // Y2WMessagesDelegate.h // API // // Created by QS on 16/3/30. // Copyright © 2016年 yun2win. All rights reserved. // #import <Foundation/Foundation.h> @class Y2WMessages,Y2WBaseMessage,Y2WMessagesPage; @protocol Y2WMessagesDelegate <NSObject> @optional /** * 同步完成 * * @param messages 消息管理对象 * @param error 错误返回,如果收取成功,error为nil */ - (void)messages:(Y2WMessages *)messages didFistSyncWithError:(NSError *)error; /** * 更新消息的回调 * * @param messages 消息管理对象 * @param message 更新的消息 */ - (void)messages:(Y2WMessages *)messages onUpdateMessage:(Y2WBaseMessage *)message; /** * 即将发送消息 * * @param messages 消息管理对象 * @param message 发送的消息 */ - (void)messages:(Y2WMessages *)messages willSendMessage:(Y2WBaseMessage *)message; /** * 发送消息完成回调 * * @param messages 消息管理对象 * @param message 当前发送的消息 * @param error 失败原因,如果发送成功则error为nil */ - (void)messages:(Y2WMessages *)messages sendMessage:(Y2WBaseMessage *)message didCompleteWithError:(NSError *)error; @end
/* Clio MUD2 Client. Copyright (c) 2003 Ian Peattie. 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, sublicence, 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. */ /* void weol(WIN *); Clear the specified window from the current cursor position to the end of the line. */ #include <assert.h> #include "clio.h" #include "window.h" void weol(WIN *w) { assert(w != NULL); (void)wclrtoeol(w->win); (void)pnoutrefresh(w->win,w->fr,0,w->sr,w->sc,w->er,w->ec); }
#pragma once #include "Neat\Exception.h" namespace Neat::Win { class StructuredException : public ExceptionWithCode { typedef ExceptionWithCode Base; public: StructuredException( uint32_t errorCode, size_t address, bool continuable); ~StructuredException(); const char* GetErrorMessage() const override; static void EnableInThisThread(); protected: size_t m_address; bool m_continuable; }; class Win32Exception : public ExceptionWithCode { typedef ExceptionWithCode Base; public: explicit Win32Exception(uint32_t errorCode); Win32Exception(const char name[], uint32_t errorCode); const char* GetErrorMessage() const override; }; class LastErrorException : public Win32Exception { typedef Win32Exception Base; public: LastErrorException(); }; }
#ifndef MAINMENU_H_INCLUDED #define MAINMENU_H_INCLUDED #include "stdafx.h" #include <list> class MainMenu { public: enum MenuResult { NOTHING, EXIT, PLAY }; class MenuItem { public: sf::Rect<int> rect; MenuResult action; }; MenuResult show(sf::RenderWindow& window); private: MenuResult getMenuResponse(sf::RenderWindow& window); MenuResult handleClick(const int x, const int y); std::list<MenuItem> menuItems; }; #endif // MAINMENU_H_INCLUDED
// // ViewController.h // UIView+Rounded // // Created by Quentin Hayot on 05/05/2015. // Copyright (c) 2015 example. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (strong, nonatomic) IBOutlet UIView *testView; - (IBAction)resizeButtonPressed:(id)sender; @end
#include <stdio.h> const int SIZE = 5; int main() { int v1[SIZE] = {3, 5, 7, 11, 17}; int v2[SIZE] = {4, 6, 8, 9, 15}; int v3[SIZE*2]; int i1 = 0, i2 = 0; int i; for (i=0; i<SIZE*2; i++) { if (v1[i1] < v2[i2]) { v3[i] = v1[i1]; i1++; } else { v3[i] = v2[i2]; i2++; } printf("\ni=%d; i1=%d, i2=%d", i, i1, i2); // Perché l'ultimo non viene mai inserito if (i1 > SIZE) v3[SIZE*2-1] = v2[SIZE-1]; else if (i2 > SIZE) v3[SIZE*2-1] = v1[SIZE-1]; } printf("Array ordinati: "); for (i=0; i<SIZE*2; i++) { printf("\nv3[%d]: %d", i, v3[i]); } return 0; }
#include <Python.h> static PyObject *method_fputs(PyObject *self, PyObject *args) { char *str, *filename = NULL; if (!PyArg_ParseTuple(args, "ss", &str, &filename)) { return NULL; } FILE *fp = fopen(filename, "w"); int btyes_copied = fputs(str, fp); fclose(fp); return PyLong_FromLong(btyes_copied); } static PyMethodDef FputsMethods[] = { {"fputs", method_fputs, METH_VARARGS, "Python interface for fputs C library function"}, {NULL, NULL, 0, NULL} }; static struct PyModuleDef fputsmodule = { PyModuleDef_HEAD_INIT, "fputs", "Python interface for the fputs C library function", -1, FputsMethods }; PyMODINIT_FUNC PyInit_fputs(void) { return PyModule_Create(&fputsmodule); }
/** * @file sensor_ir.h * @brief Driver for Sharp-IR sensor. * @author Chris MacEwan * @date Jul 31, 2014 * * @detail Handles the interface between the code and the Sharp-IR sensor. */ #ifndef SENSOR_IR_H_ #define SENSOR_IR_H_ #include <Arduino.h> #define BUFFER_SIZE 32 class SharpIR { public: /** * Constructor for SharpIR class. * @param port Specifies the port to attach the SharpIR class to. */ SharpIR(uint8_t port); /** * Gets the current filtered value of the sensor. * @return Filtered value of the sensor as uint8_t. */ uint8_t get(); /** * Gets the current raw value of the sensor. * @return Present value of the sensor as uint8_t. */ uint8_t get_filtered(); /** * Triggers an update of the sensor. */ void update(); private: static uint8_t buf[]; static uint8_t buf_index; static uint8_t sensor_port; static uint8_t val_filtered; static uint8_t val_raw; }; #endif /* SENSOR_IR_H_ */
#ifdef HAVE_CONFIG_H #include "../../ext_config.h" #endif #include <php.h> #include "../../php_ext.h" #include "../../ext.h" #include <Zend/zend_operators.h> #include <Zend/zend_exceptions.h> #include <Zend/zend_interfaces.h> #include "kernel/main.h" #include "kernel/math.h" #include "kernel/operators.h" #include "kernel/memory.h" ZEPHIR_INIT_CLASS(Test_Optimizers_Ldexp) { ZEPHIR_REGISTER_CLASS(Test\\Optimizers, Ldexp, test, optimizers_ldexp, test_optimizers_ldexp_method_entry, 0); return SUCCESS; } PHP_METHOD(Test_Optimizers_Ldexp, testInt) { zval _0, _1; int x, exponent; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); x = 2; exponent = 3; ZVAL_LONG(&_0, x); ZVAL_LONG(&_1, exponent); RETURN_DOUBLE(zephir_ldexp(&_0, &_1 TSRMLS_CC)); } PHP_METHOD(Test_Optimizers_Ldexp, testDoubleInt) { zval _0, _1; int exponent; double x; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); x = 2.0; exponent = 3; ZVAL_DOUBLE(&_0, x); ZVAL_LONG(&_1, exponent); RETURN_DOUBLE(zephir_ldexp(&_0, &_1 TSRMLS_CC)); } PHP_METHOD(Test_Optimizers_Ldexp, testDouble) { zval _0, _1; double x, exponent; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); x = 2.0; exponent = 3.0; ZVAL_DOUBLE(&_0, x); ZVAL_DOUBLE(&_1, exponent); RETURN_DOUBLE(zephir_ldexp(&_0, &_1 TSRMLS_CC)); } PHP_METHOD(Test_Optimizers_Ldexp, testVar) { zval _0, _1; int x, exponent; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); x = 2; exponent = 3; ZVAL_LONG(&_0, x); ZVAL_LONG(&_1, exponent); RETURN_DOUBLE(zephir_ldexp(&_0, &_1 TSRMLS_CC)); } PHP_METHOD(Test_Optimizers_Ldexp, testIntValue1) { zval _0, _1; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_LONG(&_0, 2); ZVAL_LONG(&_1, 3); RETURN_DOUBLE(zephir_ldexp(&_0, &_1 TSRMLS_CC)); } PHP_METHOD(Test_Optimizers_Ldexp, testIntParameter) { zval *x_param = NULL, *exponent_param = NULL, _0, _1; int x, exponent; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); zephir_fetch_params(0, 2, 0, &x_param, &exponent_param); x = zephir_get_intval(x_param); exponent = zephir_get_intval(exponent_param); ZVAL_LONG(&_0, x); ZVAL_LONG(&_1, exponent); RETURN_DOUBLE(zephir_ldexp(&_0, &_1 TSRMLS_CC)); } PHP_METHOD(Test_Optimizers_Ldexp, testVarParameter) { zval *x, x_sub, *exponent, exponent_sub; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&x_sub); ZVAL_UNDEF(&exponent_sub); zephir_fetch_params(0, 2, 0, &x, &exponent); RETURN_DOUBLE(zephir_ldexp(x, exponent TSRMLS_CC)); }
// // AppDelegate.h // TBannerViewDemo // // Copyright (c) 2015 Tulakshana. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* This is a generated file, edit the .stub.php file instead. * Stub hash: afb43b76aec85442c7267aba0b45bfd00d5c8cf1 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_memprof_enabled, 0, 0, 0) ZEND_END_ARG_INFO() #define arginfo_memprof_enabled_flags arginfo_memprof_enabled #define arginfo_memprof_enable arginfo_memprof_enabled #define arginfo_memprof_disable arginfo_memprof_enabled #define arginfo_memprof_dump_array arginfo_memprof_enabled ZEND_BEGIN_ARG_INFO_EX(arginfo_memprof_dump_callgrind, 0, 0, 1) ZEND_ARG_INFO(0, handle) ZEND_END_ARG_INFO() #define arginfo_memprof_dump_pprof arginfo_memprof_dump_callgrind #define arginfo_memprof_version arginfo_memprof_enabled ZEND_FUNCTION(memprof_enabled); ZEND_FUNCTION(memprof_enabled_flags); ZEND_FUNCTION(memprof_enable); ZEND_FUNCTION(memprof_disable); ZEND_FUNCTION(memprof_dump_array); ZEND_FUNCTION(memprof_dump_callgrind); ZEND_FUNCTION(memprof_dump_pprof); ZEND_FUNCTION(memprof_version); static const zend_function_entry ext_functions[] = { ZEND_FE(memprof_enabled, arginfo_memprof_enabled) ZEND_FE(memprof_enabled_flags, arginfo_memprof_enabled_flags) ZEND_FE(memprof_enable, arginfo_memprof_enable) ZEND_FE(memprof_disable, arginfo_memprof_disable) ZEND_FE(memprof_dump_array, arginfo_memprof_dump_array) ZEND_FE(memprof_dump_callgrind, arginfo_memprof_dump_callgrind) ZEND_FE(memprof_dump_pprof, arginfo_memprof_dump_pprof) ZEND_FE(memprof_version, arginfo_memprof_version) ZEND_FE_END };
// // RVTransformViewController.h // RXVerifyExample // // Created by Rush.D.Xzj on 15/12/11. // Copyright © 2015年 Rush.D.Xzj. All rights reserved. // #import <UIKit/UIKit.h> @interface RVTransformViewController : UIViewController @end
#ifndef testhof_h #define testhof_h #include <QtTest/QtTest> class TestHof: public QObject { Q_OBJECT private slots: void testPrint(); void testChurchLogic(); void testChurchNumerals(); void testChurchComparison(); void testChurchPairsAndLists(); void testRandom(); void testY(); void testYBenchmark(); void testOmega(); void testHofNoise(); void testTranslateSki(); void testTranslateLambda(); void testExamples(); }; #endif // testhof_h
#include <assert.h> #include <stdio.h> #include "utils.h" #include "sprite.h" #include "animation.h" #include "sprite_sheet.h" #include "ev_box2d.h" #include "application.h" #include "vector2.h" void ev_sprite_set_quad(ev_sprite *sprite, float w, float h, float left, float top, float right, float bottom) { ev_sframe *frame; frame = ev_sframe_create_quad(w, h, left, top, right, bottom); if(!sprite->animation) { sprite->animation = ev_anim_create(); } ev_anim_add_sframe(sprite->animation, frame); } void ev_sprite_init(ev_sprite *s) { assert( s != NULL ); memset(s, 0, sizeof(ev_sprite)); s->visible = EV_TRUE; s->scale = 1.0f; s->opacity = 1.0f; } ev_vec2* ev_sprite_get_position(ev_sprite* s) { if( s->body ) { s->position = ev_body_get_position(s->body); } return &s->position; } void ev_sprite_set_position(ev_sprite *s, float x, float y) { s->position.x = x; s->position.y = y; if( s->body ) { ev_body_set_position(s->body, s->position); } } float ev_sprite_get_rotation(ev_sprite* s) { return s->rotation; } void ev_sprite_set_rotation(ev_sprite* s, float r) { s->rotation = r; } void ev_sprite_set_animation(ev_sprite* s, ev_anim* a) { s->animation = a; } ev_anim* ev_sprite_get_animation(ev_sprite* s) { return s->animation; } void ev_sprite_update(ev_sprite* s, float dt) { if( s->animation ) { ev_anim_update(s->animation, dt); } } void ev_sprite_render(ev_sprite* s) { UNUSED(s); } ev_bool ev_sprite_get_visiblity(ev_sprite *s) { assert( s != NULL ); return s->visible; } void ev_sprite_set_visibilty(ev_sprite *s, ev_bool v) { assert( s != NULL ); s->visible = v; } int ev_sprite_fill(ev_sprite* s, ev_bvertex* b) { int i; ev_bvertex *src; ev_vec2 pos; assert( s != NULL ); assert( b != NULL ); if(s->visible) { if( s->body ) { pos = ev_body_get_position(s->body); } else { pos = s->position; } src = ev_sframe_get_bvertex(ev_anim_get_current_sframe(s->animation)); assert( src != NULL ); for( i = 0 ; i < EV_SPRITE_NUM_VERTS ; ++i,b++,src++ ) { *b = *src; b->scale = s->scale; b->rotation = s->rotation; b->tx = pos.x; b->ty = pos.y; b->opacity = s->opacity; } return EV_SPRITE_NUM_VERTS; } return 0; } void ev_sprite_set_body(ev_sprite *s, ev_body *body) { s->body = body; }
#ifndef _simpleAudioBuffer_h_ #define _simpleAudioBuffer_h_ #include "medialib/audioBuffer.h" #include <vector> #include <memory> namespace medialib { struct medialib_EXPORT SimpleAudioBuffer { SimpleAudioBuffer(); SimpleAudioBuffer(AudioFormat format, unsigned int channels, unsigned int samples, unsigned int sampleRate); void alloc(AudioFormat format, unsigned int channels, unsigned int samples, unsigned int sampleRate); void reserve(unsigned int samples); void resize(unsigned int samples); uint8_t *getBuffer(size_t index); size_t getSize(size_t index) const; std::vector<uint8_t> data; size_t channelStride; unsigned int samples; unsigned int sampleRate; AudioFormat format; unsigned int channels; }; medialib_EXPORT unsigned int getSampleRate(const SimpleAudioBuffer &audioBuffer); medialib_EXPORT AudioFormat getFormat(const SimpleAudioBuffer &audioBuffer); medialib_EXPORT unsigned int getChannels(const SimpleAudioBuffer &audioBuffer); medialib_EXPORT unsigned int getSamples(const SimpleAudioBuffer &audioBuffer); medialib_EXPORT void alloc(SimpleAudioBuffer &audioBuffer, AudioFormat format, unsigned int channels, unsigned int samples, unsigned int sampleRate); medialib_EXPORT void resize(SimpleAudioBuffer &audioBuffer, unsigned int samples); medialib_EXPORT void reserve(SimpleAudioBuffer &audioBuffer, unsigned int samples); medialib_EXPORT unsigned int getCapacity(const SimpleAudioBuffer &audioBuffer); medialib_EXPORT uint8_t *getBuffer(SimpleAudioBuffer &audioBuffer, size_t index); medialib_EXPORT size_t getSize(const SimpleAudioBuffer &audioBuffer, size_t index); medialib_EXPORT size_t getChannelStride(const SimpleAudioBuffer &audioBuffer); } #endif //_simpleAudioBuffer_h_
#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) #pragma clang system_header #endif #include "objc-visibility.h" #ifndef __LIBOBJC_ENCODING_H_INCLUDED__ #define __LIBOBJC_ENCODING_H_INCLUDED__ #ifdef __cplusplus extern "C" { #endif OBJC_PUBLIC const char *objc_skip_type_qualifiers (const char *type); OBJC_PUBLIC const char *objc_skip_typespec(const char *type); OBJC_PUBLIC const char *objc_skip_argspec(const char *type); OBJC_PUBLIC size_t objc_sizeof_type(const char *type); OBJC_PUBLIC size_t objc_alignof_type(const char *type); OBJC_PUBLIC size_t objc_aligned_size(const char *type); OBJC_PUBLIC size_t objc_promoted_size(const char *type); OBJC_PUBLIC void method_getReturnType(Method method, char *dst, size_t dst_len); OBJC_PUBLIC const char *method_getTypeEncoding(Method method); OBJC_PUBLIC void method_getArgumentType(Method method, unsigned int index, char *dst, size_t dst_len); OBJC_PUBLIC unsigned method_getNumberOfArguments(Method method); OBJC_PUBLIC unsigned method_get_number_of_arguments(struct objc_method *method); OBJC_PUBLIC char * method_copyArgumentType(Method method, unsigned int index); OBJC_PUBLIC char * method_copyReturnType(Method method); //////////////////////////////////////////////////////////////////////////////// // Deprecated functions - do not use functions below this line in new code. //////////////////////////////////////////////////////////////////////////////// OBJC_PUBLIC unsigned objc_get_type_qualifiers (const char *type); struct objc_struct_layout { const char *original_type; const char *type; const char *prev_type; unsigned int record_size; unsigned int record_align; }; // Note: The implementations of these functions is horrible. OBJC_PUBLIC void objc_layout_structure (const char *type, struct objc_struct_layout *layout); OBJC_PUBLIC BOOL objc_layout_structure_next_member(struct objc_struct_layout *layout); OBJC_PUBLIC void objc_layout_structure_get_info (struct objc_struct_layout *layout, unsigned int *offset, unsigned int *align, const char **type); #define _F_CONST 0x01 #define _F_IN 0x01 #define _F_OUT 0x02 #define _F_INOUT 0x03 #define _F_BYCOPY 0x04 #define _F_BYREF 0x08 #define _F_ONEWAY 0x10 #define _F_GCINVISIBLE 0x20 #ifdef __cplusplus } #endif #endif // __LIBOBJC_ENCODING_H_INCLUDED__
#pragma once #include <cstdint> #define VEHICLE_EQUIPMENT_TYPE_ENGINE 0x00 #define VEHICLE_EQUIPMENT_TYPE_WEAPON 0x01 #define VEHICLE_EQUIPMENT_TYPE_GENERAL 0x02 #define VEHICLE_EQUIPMENT_TYPE_EMPTY 0x04 #define VEHICLE_EQUIPMENT_USABLE_GROUND 0x00 #define VEHICLE_EQUIPMENT_USABLE_AIR 0x01 #define VEHICLE_EQUIPMENT_USABLE_AMMO 0x02 // Not used? #define VEHICLE_EQUIPMENT_USABLE_GROUND_AIR 0x03 #define VEHICLE_EQUIPMENT_NAMES_OFFSET_START 1353641 #define VEHICLE_EQUIPMENT_NAMES_OFFSET_END 1354564 struct VehicleEquipmentData { uint8_t type; // VEHICLE_EQUIPMENT_TYPE_* uint8_t data_idx; // Index into VehicleWeaponData or VehicleEngineData or // VehicleEquipmentData uint16_t usable_by; // VEHICLE_EQUIPMENT_USABLE_* uint16_t weight; uint16_t max_ammo; uint16_t ammo_type; uint16_t unknown1; uint16_t sprite_idx; uint8_t size_x; uint8_t size_y; uint16_t unknown2; uint16_t unknown3; uint16_t manufacturer; uint16_t store_space; }; static_assert(sizeof(struct VehicleEquipmentData) == 24, "Invalid vehicle_equpment_data size"); #define VEHICLE_EQUIPMENT_DATA_OFFSET_START 1617224 #define VEHICLE_EQUIPMENT_DATA_OFFSET_END 1618398 struct VehicleWeaponData { uint16_t speed; // FIXME: What units? uint16_t projectile_image; // FIXME: Where's the projectile image looked up? uint16_t damage; uint16_t accuracy; // FIXME: What units? uint16_t fire_delay; uint16_t tail_size; // FIXME: What units? uint16_t guided; uint16_t turn_rate; // FIXME: What units? uint16_t range; // FIXME: What units? uint16_t unknown; uint16_t firing_arc_1; // Firing arc left/right uint16_t firing_arc_2; // Firing arc up/down uint16_t point_defence; uint16_t unknown2; uint16_t fire_sfx; uint16_t idem; // APOC'd says this is duplicated fire_sfx uint16_t explosion_graphic; // FIXME: Find ptang lookup? (how many frames etc.) }; static_assert(sizeof(struct VehicleWeaponData) == 34, "Invalid vehicle_weapon_data size"); #define VEHICLE_WEAPON_DATA_OFFSET_START 1618400 #define VEHICLE_WEAPON_DATA_OFFSET_END 1619248 #pragma pack(push, 1) struct VehicleEngineData { uint32_t power; uint16_t top_speed; }; #pragma pack(pop) static_assert(sizeof(struct VehicleEngineData) == 6, "Invalid vehicle_engine_data size"); #define VEHICLE_ENGINE_DATA_OFFSET_START 1619252 #define VEHICLE_ENGINE_DATA_OFFSET_END 1619318 struct VehicleGeneralEquipmentData { uint16_t accuracy_modifier; uint16_t cargo_space; uint16_t passengers; uint16_t alien_space; uint16_t missile_jamming; uint16_t shielding; uint16_t cloaking; uint16_t teleporting; uint16_t dimension_shifting; }; static_assert(sizeof(struct VehicleGeneralEquipmentData) == 18, "Invalid vehicle_general_equipment_data size"); #define VEHICLE_GENERAL_EQUIPMENT_DATA_OFFSET_START 1619318 #define VEHICLE_GENERAL_EQUIPMENT_DATA_OFFSET_END 1619552
// // SSAppDelegate.h // SSPhotoBrowser // // Created by Shwet Solanki on 08/02/2015. // Copyright (c) 2015 Shwet Solanki. All rights reserved. // @import UIKit; @interface SSAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#include <stdio.h> #include <stdlib.h> void sortiraj(int niz[], int vel) { int i, j, k, brojac1 = 0, brojac2 = 0; for (i = 0; i < vel; i++) { if (niz[i] % 2 == 0) brojac1++; else if (niz[i] % 2 == 1) brojac2++; } int niz1[10], niz2[10]; j = 0, k = 0; for (i = 0; i < vel; i++) { if (niz[i] % 2 == 0) { niz1[j] = niz[i]; j++; } else if (niz[i] % 2 == 1) { niz2[k] = niz[i]; k++; } } int temp; for (i = 0; i < brojac1; i++) { for (j = i; j < brojac1; j++) if (niz1[i] > niz1[j]) { temp = niz1[j]; niz1[j] = niz1[i]; niz1[i] = temp; } } for (i = 0; i < brojac2; i++) { for (j = i; j < brojac2; j++) if (niz2[i] < niz2[j]) { temp = niz2[j]; niz2[j] = niz2[i]; niz2[i] = temp; } } i = 0; while (i != brojac1) { niz[i] = niz1[i]; i++; } j = 0; while (i != vel) { niz[i] = niz2[j]; i++; j++; } } int main() { int niz[10] = {1, 7, 2, 6, 8, 9, 7, 5, 4, 3}; int i; sortiraj(niz, 10); for (i = 0; i < 10; i++) printf("%d ", niz[i]); return 0; }
// // JFAppDelegate.h // JFMapViewExample // // Created by ZS(JF) on 13/08/2013. // Copyright (c) 2015 ZS (JF). All rights reserved. // #import <UIKit/UIKit.h> @interface JFAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* * File: NewFilePage_1.h * Module: NewFile * Author: James Kuczynski * Email: jkuczyns@cs.uml.edu * File Description: * * Created on May 15, 2015, 9:24 AM */ #ifndef NEW_FILE_PAGE_1_H #define NEW_FILE_PAGE_1_H #include <QWidget> #include <QString> #include <QLabel> #include <QStringList> #include <QStringListModel> #include <QVector> #include <QListWidget> #include <QTextEdit> #include <QGridLayout> #include <iostream> #include "RosEnv.h" #include "WindowsConsoleText.h" #include "UnixConsoleText.h" #ifdef _WIN32 namespace cct = WindowsConsoleText; #elif __APPLE namespace cct = UnixConsoleText; #elif __linux namespace cct = UnixConsoleText; #endif using namespace std; class NewFilePage_1 : public QWidget { Q_OBJECT private: QLabel* titlePtr; //QStringList* langsStrLstPtr; QVector<QListWidgetItem*>* langsStrLstPtr; QVector<QListWidgetItem*>* cFileOptLstWidPtrVecPtr; QVector<QListWidgetItem*>* cppFileOptLstWidPtrVecPtr; QVector<QListWidgetItem*>* pythonFileOptLstWidPtrVecPtr; QVector<QListWidgetItem*>* javaFileOptLstWidPtrVecPtr; QVector<QListWidgetItem*>* lispFileOptLstWidPtrVecPtr; QVector<QListWidgetItem*>* shellFileOptLstWidPtrVecPtr; QVector<QListWidgetItem*>* otherFileOptLstWidPtrVecPtr; QVector<QVector<QListWidgetItem*>*>* fileTypeStrLstPtrVec; QListWidget* langsLwPtr; QListWidget* fileTypeLwPtr; QGridLayout* outerLayoutPtr; QString* langStrPtr; QString* fileTypeStrPtr; private slots: /** * */ void handleSwapOptionsSlot(); public: /** * * * @param parent */ NewFilePage_1(QWidget* parent = 0); /** * */ void setLangStrPtr(); /** * * * @return */ QString* getLangStrPtr(); /** * */ void setFileTypeStrPtr(); /** * * * @return */ QString* getFileTypeStrPtr(); /** * */ void triggerMutators(); /** * * * @return */ QString* toString(); /** * Destructor. */ ~NewFilePage_1(); }; #endif /* NEW_FILE_PAGE_1_H */
//---------------------------------------------------------------------------// /* Keep these headers */ #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <tice.h> /* Standard headers - it's recommended to leave them included */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* C CE Graphics library */ //#include <lib/ce/graphx.h> #include <include/lib/ce/graphx.h> /* CE Keypad C Library */ #include <include/lib/ce/keypadc.h> /* custom includes */ #include "main.h" #include "frontend.h" #include "input.h" //---------------------------------------------------------------------------// extern KC_keys_t KEYS; uint8_t draw_buffer = 1; //---------------------------------------------------------------------------// void main(void) { initialise_interrupts(); gfx_Begin(gfx_8bpp); gfx_SetDrawBuffer(); //---- srand(rtc_Time()); init_keys_data(&KEYS); main_menu(); gfx_End(); pulldown_interrupts(); prgm_CleanUp(); } //---------------------------------------------------------------------------// void present(void) { gfx_SwapDraw(); if (draw_buffer == 0) draw_buffer = 1; else draw_buffer = 0; } //---------------------------------------------------------------------------// uint8_t get_draw_buffer(void) { return draw_buffer; } //---------------------------------------------------------------------------//
/******************************************************************** * (C) Copyright 2013 by Autodesk, Inc. All Rights Reserved. By using * this code, you are agreeing to the terms and conditions of the * License Agreement included in the documentation for this code. * AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE * CORRECTNESS OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE * IT. AUTODESK PROVIDES THE CODE ON AN 'AS-IS' BASIS AND EXPLICITLY * DISCLAIMS ANY LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL * DAMAGES FOR ERRORS, OMISSIONS, AND OTHER PROBLEMS IN THE CODE. * * Use, duplication, or disclosure by the U.S. Government is subject * to restrictions set forth in FAR 52.227-19 (Commercial Computer * Software Restricted Rights) as well as DFAR 252.227-7013(c)(1)(ii) * (Rights in Technical Data and Computer Software), as applicable. *******************************************************************/ #import <AssetsLibrary/AssetsLibrary.h> @class RACSignal; @interface ALAssetsLibrary (RACExtensions) // Adds a new assets group to the library and sends an (ALAssetsGroup *) only once. - (RACSignal *)adrac_addAssetsGroupAlbumWithName:(NSString *)name; // Sends an (NSNotification *) every time the contents of the assets // library has changed from under the app that is using the data. // e.g. // @weakify(self); // [[assetsLibrary adrac_addObserverForChangedNotification] // subscribeNext:^(NSNotification *changedNotification) { // @strongify(self); // // Do something with the notification. // }]; - (RACSignal *)adrac_addObserverForChangedNotification; // Sends the (ALAsset *) referenced by assetURL only once. - (RACSignal *)adrac_assetForURL:(NSURL *)assetURL; // Returns an assets group in the result block for a URL previously retrieved from an ALAssetsGroup object. - (RACSignal *)adrac_groupForURL:(NSURL *)groupURL; // Writes given image data and metadata to the Photos Album. - (RACSignal *)adrac_writeImageDataToSavedPhotosAlbum:(NSData *)imageData metadata:(NSDictionary *)metadata; // Saves a given image to the Saved Photos album. - (RACSignal *)adrac_writeImageToSavedPhotosAlbum:(CGImageRef)imageRef orientation:(ALAssetOrientation)orientation; // Saves a video identified by a given URL to the Saved Photos album. - (RACSignal *)adrac_writeVideoAtPathToSavedPhotosAlbum:(NSURL *)videoPathURL; @end
/******************************************************************************* System Tasks File File Name: system_tasks.c Summary: This file contains source code necessary to maintain system's polled state machines. Description: This file contains source code necessary to maintain system's polled state machines. It implements the "SYS_Tasks" function that calls the individual "Tasks" functions for all polled MPLAB Harmony modules in the system. Remarks: This file requires access to the systemObjects global data structure that contains the object handles to all MPLAB Harmony module objects executing polled in the system. These handles are passed into the individual module "Tasks" functions to identify the instance of the module to maintain. *******************************************************************************/ // DOM-IGNORE-BEGIN /******************************************************************************* Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved. Microchip licenses to you the right to use, modify, copy and distribute Software only when embedded on a Microchip microcontroller or digital signal controller that is integrated into your product or third party product (pursuant to the sublicense terms in the accompanying license agreement). You should refer to the license agreement accompanying this Software for additional information regarding your rights and obligations. SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. *******************************************************************************/ // DOM-IGNORE-END // ***************************************************************************** // ***************************************************************************** // Section: Included Files // ***************************************************************************** // ***************************************************************************** #include "system_config.h" #include "system_definitions.h" #include "disp.h" #include "comms.h" #include "flir.h" // ***************************************************************************** // ***************************************************************************** // Section: System "Tasks" Routine // ***************************************************************************** // ***************************************************************************** /******************************************************************************* Function: void SYS_Tasks ( void ) Remarks: See prototype in system/common/sys_module.h. */ void SYS_Tasks ( void ) { /* Maintain system services */ SYS_DEVCON_Tasks(sysObj.sysDevcon); /* SYS_TMR Device layer tasks routine */ SYS_TMR_Tasks(sysObj.sysTmr); /* Maintain Device Drivers */ /* Maintain Middleware & Other Libraries */ /* Maintain the application's state machine. */ DISP_Tasks(); //COMMS_Tasks(); FLIR_Tasks(); } /******************************************************************************* End of File */
#ifndef GUIUTIL_H #define GUIUTIL_H #include <QString> #include <QObject> #include <QMessageBox> QT_BEGIN_NAMESPACE class QFont; class QLineEdit; class QWidget; class QDateTime; class QUrl; class QAbstractItemView; QT_END_NAMESPACE class SendCoinsRecipient; /** Utility functions used by the medicoin-qt UI. */ namespace GUIUtil { // Create human-readable string from date QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(qint64 nTime); // Render addresses in monospace font QFont bitcoinAddressFont(); // Set up widgets for address and amounts void setupAddressWidget(QLineEdit *widget, QWidget *parent); void setupAmountWidget(QLineEdit *widget, QWidget *parent); // Parse "medicoin:" URI into recipient object, return true on succesful parsing // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out); bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); // HTML escaping for rich text controls QString HtmlEscape(const QString& str, bool fMultiLine=false); QString HtmlEscape(const std::string& str, bool fMultiLine=false); /** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing is selected. @param[in] column Data column to extract from the model @param[in] role Data role to extract from the model @see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress */ void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole); /** Get save file name, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. @param[in] parent Parent window (or 0) @param[in] caption Window caption (or empty, for default) @param[in] dir Starting directory (or empty, to default to documents directory) @param[in] filter Filter specification such as "Comma Separated Files (*.csv)" @param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix. */ QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedSuffixOut=0); /** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking. @returns If called from the GUI thread, return a Qt::DirectConnection. If called from another thread, return a Qt::BlockingQueuedConnection. */ Qt::ConnectionType blockingGUIThreadConnection(); // Determine whether a widget is hidden behind other windows bool isObscured(QWidget *w); // Open debug.log void openDebugLogfile(); /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ class ToolTipToRichTextFilter : public QObject { Q_OBJECT public: explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); protected: bool eventFilter(QObject *obj, QEvent *evt); private: int size_threshold; }; bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); /** Help message, shown with --help. */ class HelpMessageBox : public QMessageBox { Q_OBJECT public: HelpMessageBox(QWidget *parent = 0); /** Show message box or print help message to standard output, based on operating system. */ void showOrPrint(); /** Print help message to console */ void printToConsole(); private: QString header; QString coreOptions; QString uiOptions; }; } // namespace GUIUtil #endif // GUIUTIL_H
// // MoreNameCell.h // AmosTrustContact // // Created by Amos Wu on 15/9/26. // Copyright © 2015年 Amos Wu. All rights reserved. // #import <UIKit/UIKit.h> #import "JVFloatLabeledTextField.h" @interface MoreNameCell : UITableViewCell @property (weak, nonatomic) IBOutlet JVFloatLabeledTextField *middleNameTextField; @property (weak, nonatomic) IBOutlet JVFloatLabeledTextField *usedNameTextField; @property (weak, nonatomic) IBOutlet JVFloatLabeledTextField *prxNameTextField; @property (weak, nonatomic) IBOutlet JVFloatLabeledTextField *subNameTextField; @end
#ifndef UTORRENTCONFPANEL_H #define UTORRENTCONFPANEL_H #include "abstractconfpanel.h" namespace Ui { class uTorrentConfPanel; } class IRecordsAccessor; class uTorrentConfPanel : public AbstractConfPanel { Q_OBJECT public: explicit uTorrentConfPanel(QWidget *parent = 0); ~uTorrentConfPanel(); virtual IRecordsAccessor *configedAccessor() const; public slots: void browseAppdata(); void browseExtraTorrents(); private: Ui::uTorrentConfPanel *ui; }; #endif // UTORRENTCONFPANEL_H
// // TAMovieListItemActionObject.h // MovieViewer // // Created by Alex Rudyak on 7/24/15. // Copyright (c) 2015 *instinctools. All rights reserved. // #import "RLMObject.h" #import "TAListItemObject.h" #import <Realm/RLMArray.h> typedef NS_ENUM(NSInteger, TAListAction) { TAListActionRemove, TAListActionAdd }; typedef NSString TAListType; FOUNDATION_EXPORT TAListType *const TAFavoriteListType; FOUNDATION_EXPORT TAListType *const TAWatchedListType; @interface TAMovieListItemActionObject : RLMObject @property RLMArray<TAListItemObject> *targetObjects; @property TAListAction action; @property TAListType *type; @end
#import <libxml/globals.h> #import <BMCommons/BMXPathQuery.h> NS_ASSUME_NONNULL_BEGIN @interface BMXPathQuery() @property (nonatomic, assign) xmlDocPtr doc; - (id)initWithDoc:(xmlDocPtr)theDoc freeWhenDone:(BOOL)freeWhenDone NS_DESIGNATED_INITIALIZER; @end NS_ASSUME_NONNULL_END
#ifndef FILEMAP_H #define FILEMAP_H #include <QLabel> #include <QList> #include <QObject> #include "Annotations.h" class MapView: public QLabel { Q_OBJECT public: explicit MapView(QWidget* parent = 0); virtual ~MapView(); void setAnnotations(QSharedPointer<Annotations> annotations); signals: void lineClicked(int line); public slots: void highlight(int start, int end); private: void unhighlight(); void invert(int start, int end); void invertRect(int start, int end); void mousePressEvent( QMouseEvent* event ); QImage* image; int imageWidth, imageHeight; int start, end; QSharedPointer<Annotations> annotations; }; #endif // FILEMAP_H
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // 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 _PATH_H_ #define _PATH_H_ #ifndef _PLATFORM_H_ #include "platform/platform.h" #endif #ifndef _LIBDTSHAPE_STRING_H_ #include "core/util/str.h" #endif //----------------------------------------------------------------------------- BEGIN_NS(DTShape) //----------------------------------------------------------------------------- /// FileSystem filename representation. /// Filenames has the following form: "root:path/file.ext" /// @ingroup UtilString class Path { public: enum Separator { #if defined(LIBDTSHAPE_OS_WIN32) || defined(LIBDTSHAPE_OS_XENON) OsSeparator = '\\' #else OsSeparator = '/' #endif }; Path() : mIsDirtyFileName( true ), mIsDirtyPath( true ) { } Path( const char *file ) : mIsDirtyFileName( true ), mIsDirtyPath( true ) { _split(file); } Path( const String &file ) : mIsDirtyFileName( true ), mIsDirtyPath( true ) { _split(file); } Path& operator = ( const String &file ) { _split(file); mIsDirtyPath = mIsDirtyFileName = true; return *this; } operator String() const { return getFullPath(); } bool operator == (const Path& path) const { return getFullPath().equal(path.getFullPath()); } bool operator != (const Path& path) const { return !(*this == path); } bool isEmpty() const { return getFullPath().isEmpty(); } /// Join two path or file name components together. static String Join(const String&,String::ValueType,const String&); /// Replace all '\' with '/' static String CleanSeparators( String path ); /// Remove "." and ".." relative paths. static String CompressPath( String path ); /// Take two paths and return the relative path between them. static Path MakeRelativePath( const Path &makeRelative, const Path &relativeTo, U32 mode = String::NoCase ); const String& getRoot() const { return mRoot; } const String& getPath() const { return mPath; } const String& getFileName() const { return mFile; } const String& getExtension() const { return mExt; } const String& getFullFileName() const; const String& getFullPath() const; /// Returns the full file path without the volume root. String getFullPathWithoutRoot() const; /// Returns the root and path. String getRootAndPath() const; const String& setRoot(const String &s); const String& setPath(const String &s); const String& setFileName(const String &s); const String& setExtension(const String &s); U32 getDirectoryCount() const; String getDirectory(U32) const; bool isDirectory() const; bool isRelative() const; bool isAbsolute() const; /// Appends the argument's path component to the object's /// path component. The object's root, filename and /// extension are unaffected. bool appendPath(const Path &path); private: String mRoot; String mPath; String mFile; String mExt; mutable String mFullFileName; mutable String mFullPath; mutable bool mIsDirtyFileName; mutable bool mIsDirtyPath; void _split(String name); String _join() const; }; /// Convert file/path name to use platform standard path separator ///@ingroup VolumeSystem String PathToPlatform(String file); /// Convert file/path name to use OS standard path separator ///@ingroup VolumeSystem String PathToOS(String file); END_NS #endif
#include "test.h" #include "rbtree.h" static void verify_root(rbtree_node_t* root) { EXPECT(BLACK, root->color); } static void verify_leaf(void) { EXPECT(BLACK, rbtree_nil->color); } static void verify_kids(rbtree_node_t* root) { if (root == rbtree_nil) return; verify_kids(root->left); verify_kids(root->right); if (root->color == RED) { EXPECT(BLACK, root->left->color); EXPECT(BLACK, root->right->color); } } static int verify_black_height(rbtree_node_t* root) { if (root == rbtree_nil) return 1; int lbh = verify_black_height(root->left); int rbh = verify_black_height(root->right); EXPECT(lbh, rbh); return (root->color == BLACK) + lbh; } static void __rbtree_print(rbtree_node_t* root) { if (root == rbtree_nil) return; __rbtree_print(root->left); printf("%d ", root->key); __rbtree_print(root->right); } static void rbtree_print(rbtree_node_t* root) { __rbtree_print(root); printf("\n"); } static void verify(rbtree_node_t* root) { verify_root(root); verify_leaf(); verify_kids(root); verify_black_height(root); rbtree_print(root); } static void test(void) { rbtree_node_t* root = rbtree_nil; rbtree_key_t keys[] = {26, 17, 14, 10, 7, 3, 12, 16, 15, 21, 19, 20, 23, 41, 30, 28, 38, 35, 39, 47}; for (int i = 0; i < sizeof(keys) / sizeof(rbtree_key_t); ++i) { root = rbtree_insert_key(root, keys[i]); verify(root); } rbtree_key_t del_keys[] = {26, 17, 14, 10, 7, 3, 12, 16, 15, 21, 19, 20, 23, 41, 30, 28, 38, 35, 39, 47}; for (int i = 0; i < sizeof(del_keys) / sizeof(rbtree_key_t); ++i) { root = rbtree_delete_key(root, del_keys[i]); verify(root); } rbtree_destroy(root); #ifdef DEBUG_MEM EXPECT(0, rbtree_nalloc); #endif } __attribute__((unused)) static int rbtree_count(rbtree_node_t* root) { if (root == rbtree_nil) return 0; return 1 + rbtree_count(root->left) + rbtree_count(root->right); } int main(void) { test(); return 0; }
#pragma once #include "forms/control.h" #include "forms/forms_enums.h" #include "library/sp.h" namespace OpenApoc { class Image; class Sample; class ScrollBar : public Control { private: bool capture; float grippersize; float segmentsize; sp<Image> gripperbutton; sp<Sample> buttonerror; int Value; Orientation BarOrientation; void loadResources(); protected: void onRender() override; public: enum class ScrollBarRenderStyle { Flat, Menu }; ScrollBarRenderStyle RenderStyle; Colour GripperColour; int Minimum; int Maximum; int LargeChange; ScrollBar(sp<Image> gripperImage = nullptr); ~ScrollBar() override; void eventOccured(Event *e) override; void update() override; void unloadResources() override; virtual int getValue() const { return Value; } virtual bool setValue(int newValue); virtual void scrollPrev(); virtual void scrollNext(); sp<Control> copyTo(sp<Control> CopyParent) override; void configureSelfFromXml(pugi::xml_node *node) override; }; }; // namespace OpenApoc
// // NSDateFormatter+SecureMappingKit.h // SecureMappingKit // // Created by Jerome Morissard on 5/8/14. // Copyright (c) 2014 Jerome Morissard. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDateFormatter (SecureMappingKit) + (void)setForcedTimeZone:(NSTimeZone *)forcedTimeZone; + (NSTimeZone *)forcedTimeZone; + (void)setForcedlocale:(NSLocale *)forcedLocale; + (NSLocale *)forcedLocale; + (instancetype) dateFormatterForDateFormat:(NSString *)dateFormat; @end
//Generated by the Argon Build System /* Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org Copyright (C) 2006, 2009 Sony Computer Entertainment Inc. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ //---------------------------------------------------------------------------------------- // Shared definitions for GPU-based 3D Grid collision detection broadphase //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Keep this file free from Bullet headers // it is included into both CUDA and CPU code //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //---------------------------------------------------------------------------------------- #ifndef BTGPU3DGRIDBROADPHASESHAREDDEFS_H #define BTGPU3DGRIDBROADPHASESHAREDDEFS_H //---------------------------------------------------------------------------------------- #include "btGpu3DGridBroadphaseSharedTypes.h" //---------------------------------------------------------------------------------------- extern "C" { //---------------------------------------------------------------------------------------- void BT_GPU_PREF(calcHashAABB)(bt3DGrid3F1U* pAABB, unsigned int* hash, unsigned int numBodies); void BT_GPU_PREF(findCellStart)(unsigned int* hash, unsigned int* cellStart, unsigned int numBodies, unsigned int numCells); void BT_GPU_PREF(findOverlappingPairs)(bt3DGrid3F1U* pAABB, unsigned int* pHash, unsigned int* pCellStart, unsigned int* pPairBuff, unsigned int* pPairBuffStartCurr, unsigned int numBodies); void BT_GPU_PREF(findPairsLarge)(bt3DGrid3F1U* pAABB, unsigned int* pHash, unsigned int* pCellStart, unsigned int* pPairBuff, unsigned int* pPairBuffStartCurr, unsigned int numBodies, unsigned int numLarge); void BT_GPU_PREF(computePairCacheChanges)(unsigned int* pPairBuff, unsigned int* pPairBuffStartCurr, unsigned int* pPairScan, bt3DGrid3F1U* pAABB, unsigned int numBodies); void BT_GPU_PREF(squeezeOverlappingPairBuff)(unsigned int* pPairBuff, unsigned int* pPairBuffStartCurr, unsigned int* pPairScan, unsigned int* pPairOut, bt3DGrid3F1U* pAABB, unsigned int numBodies); //---------------------------------------------------------------------------------------- } // extern "C" //---------------------------------------------------------------------------------------- #endif // BTGPU3DGRIDBROADPHASESHAREDDEFS_H
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" #import "NSCoding.h" @class CMessageWrap, NSMutableDictionary, NSString; @interface OpenInfo : NSObject <NSCoding> { unsigned int m_uiLocalID; NSString *m_nsUsrName; unsigned int m_uiCreateTime; unsigned int m_uiScene; CMessageWrap *m_wrapMsg; unsigned int m_uiStartPos; unsigned int m_uiAddQueueTime; _Bool m_bCheckMd5; NSString *m_nsAttachId; NSString *m_nsAttachFileExt; unsigned int m_uiAttachDataSize; unsigned long long m_ui64StartTime; _Bool m_bUpload; int m_nRetCode; _Bool _m_bFileExistInSvr; NSString *m_nsShareOriginUrl; NSString *m_nsShareOpenUrl; NSString *m_nsJsAppId; NSMutableDictionary *m_dicStatParas; NSString *_m_nsMsgMd5; } @property(retain, nonatomic) NSString *m_nsMsgMd5; // @synthesize m_nsMsgMd5=_m_nsMsgMd5; @property(nonatomic) _Bool m_bFileExistInSvr; // @synthesize m_bFileExistInSvr=_m_bFileExistInSvr; @property(retain, nonatomic) NSMutableDictionary *m_dicStatParas; // @synthesize m_dicStatParas; @property(retain, nonatomic) NSString *m_nsJsAppId; // @synthesize m_nsJsAppId; @property(retain, nonatomic) NSString *m_nsShareOpenUrl; // @synthesize m_nsShareOpenUrl; @property(retain, nonatomic) NSString *m_nsShareOriginUrl; // @synthesize m_nsShareOriginUrl; @property(nonatomic) int m_nRetCode; // @synthesize m_nRetCode; @property(nonatomic) _Bool m_bUpload; // @synthesize m_bUpload; @property(nonatomic) unsigned int m_uiAttachDataSize; // @synthesize m_uiAttachDataSize; @property(retain, nonatomic) NSString *m_nsAttachFileExt; // @synthesize m_nsAttachFileExt; @property(retain, nonatomic) NSString *m_nsAttachId; // @synthesize m_nsAttachId; @property(nonatomic) _Bool m_bCheckMd5; // @synthesize m_bCheckMd5; @property(nonatomic) unsigned int m_uiAddQueueTime; // @synthesize m_uiAddQueueTime; @property(nonatomic) unsigned int m_uiStartPos; // @synthesize m_uiStartPos; @property(retain, nonatomic) CMessageWrap *m_wrapMsg; // @synthesize m_wrapMsg; @property(nonatomic) unsigned int m_uiScene; // @synthesize m_uiScene; @property(nonatomic) unsigned int m_uiCreateTime; // @synthesize m_uiCreateTime; @property(retain, nonatomic) NSString *m_nsUsrName; // @synthesize m_nsUsrName; @property(nonatomic) unsigned int m_uiLocalID; // @synthesize m_uiLocalID; - (void).cxx_destruct; - (id)GetStatInfo; - (void)SetStartTime; - (void)SetStatus; - (_Bool)IsCanDownload; - (_Bool)IsCanUpload; - (void)GetMsg; - (id)description; - (id)initWithCoder:(id)arg1; - (void)encodeWithCoder:(id)arg1; - (id)init; @end
// // BCSendPhotoViewController.h // Bathchat // // Created by Derek Schultz on 4/1/14. // Copyright (c) 2014 Bathchat LLC. All rights reserved. // #import <UIKit/UIKit.h> #import <FacebookSDK/FacebookSDK.h> #import <Parse/Parse.h> @interface BCSendPhotoViewController : FBFriendPickerViewController @property (nonatomic) UIImage* photo; @end
// Copyright 2015 XLGAMES Inc. // // Distributed under the MIT License (See // accompanying file "LICENSE" or the website // http://www.opensource.org/licenses/mit-license.php) #pragma once #include "../Core/Types.h" #include <memory> #include <string> namespace Assets { class IAssetSet { public: virtual void Clear() = 0; virtual void LogReport() const = 0; virtual uint64 GetTypeCode() const = 0; virtual const char* GetTypeName() const = 0; virtual unsigned GetDivergentCount() const = 0; virtual uint64 GetDivergentId(unsigned index) const = 0; virtual bool DivergentHasChanges(unsigned index) const = 0; virtual std::string GetAssetName(uint64 id) const = 0; virtual ~IAssetSet(); }; namespace Internal { template <typename AssetType> class AssetSet; } class AssetSetManager { public: template<typename Type> Internal::AssetSet<Type>* GetSetForType(); void Clear(); void LogReport(); unsigned BoundThreadId() const; bool IsBoundThread() const; unsigned GetAssetSetCount(); const IAssetSet* GetAssetSet(unsigned index); AssetSetManager(); ~AssetSetManager(); protected: class Pimpl; std::unique_ptr<Pimpl> _pimpl; IAssetSet* GetSetForTypeCode(size_t typeCode); void Add(size_t typeCode, std::unique_ptr<IAssetSet>&& set); }; template<typename Type> Internal::AssetSet<Type>* AssetSetManager::GetSetForType() { auto* existing = GetSetForTypeCode(typeid(Type).hash_code()); if (existing) { // we have to force an up-cast here... return static_cast<Internal::AssetSet<Type>*>(existing); } auto newPtr = std::make_unique<Internal::AssetSet<Type>>(); auto* result = newPtr.get(); Add(typeid(Type).hash_code(), std::move(newPtr)); return result; } }
/* Author: Karthik Hebbar M N Website FissionSpark.weebly.com Engine Whirl engine NOTE:This code is still a prototype */ #include<windowsx.h> #include<Windows.h> #include<vector> #include<list> #include<iostream> using namespace std; #define CHECK_WND = 0 #define CHECK_BORDER = 1 #pragma region Docking System struct Border{ // Border information about the Window RECT Horizontal; RECT Vertical; }; struct Rect{ short X,Y; short Width,Height; short BorderX; short BorderY; }; class WindowDesc { public: WindowDesc(Rect,short,short); // Consturctor ~WindowDesc(); // Destructor RECT Pos; // Position of window short Width,Height; // Width and Height short thisWindow; // The Current Window ID short AttachedWindow; // The Attached Window ID short MainWindow; // ID of the Main Window // Funcion prototypes private: Border borders; }; #pragma endregion class WindowManager{ // Destructor ~WindowManager(); private: vector<HWND> wnds; vector<WindowDesc> WindowsDescs; HWND hwnd; public: // Constructor vector<HWND> GetList(); WindowManager(); void CreateNewWindow(HINSTANCE hinst,WNDCLASSEX * ex,LPCWSTR WndName,HWND * Parent,HWND * ReturnWind,Rect rect,bool); void ShowWindows(int cShow); int HandleMseeages(); bool CheckPos(Window * ,short,POINT); void Update(); };
7800 // init: The initial user-level program 7801 7802 #include "types.h" 7803 #include "stat.h" 7804 #include "user.h" 7805 #include "fcntl.h" 7806 7807 char *argv[] = { "sh", 0 }; 7808 7809 int 7810 main(void) 7811 { 7812 int pid, wpid; 7813 7814 if(open("console", O_RDWR) < 0){ 7815 mknod("console", 1, 1); 7816 open("console", O_RDWR); 7817 } 7818 dup(0); // stdout 7819 dup(0); // stderr 7820 7821 for(;;){ 7822 printf(1, "init: starting sh\n"); 7823 pid = fork(); 7824 if(pid < 0){ 7825 printf(1, "init: fork failed\n"); 7826 exit(); 7827 } 7828 if(pid == 0){ 7829 exec("sh", argv); 7830 printf(1, "init: exec sh failed\n"); 7831 exit(); 7832 } 7833 while((wpid=wait()) >= 0 && wpid != pid) 7834 printf(1, "zombie!\n"); 7835 } 7836 } 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_16.c Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE805.label.xml Template File: sources-sink-16.tmpl.c */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate using malloc() and set data pointer to a small buffer * GoodSource: Allocate using malloc() and set data pointer to a large buffer * Sink: memcpy * BadSink : Copy int64_t array to data using memcpy * Flow Variant: 16 Control flow: while(1) * * */ #include "std_testcase.h" #ifndef OMITBAD void CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_16_bad() { int64_t * data; data = NULL; while(1) { /* FLAW: Allocate and point data to a small buffer that is smaller than the large buffer used in the sinks */ data = (int64_t *)malloc(50*sizeof(int64_t)); break; } { int64_t source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memcpy(data, source, 100*sizeof(int64_t)); printLongLongLine(data[0]); free(data); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() - use goodsource and badsink by changing the conditions on the while statements */ static void goodG2B() { int64_t * data; data = NULL; while(1) { /* FIX: Allocate and point data to a large buffer that is at least as large as the large buffer used in the sink */ data = (int64_t *)malloc(100*sizeof(int64_t)); break; } { int64_t source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memcpy(data, source, 100*sizeof(int64_t)); printLongLongLine(data[0]); free(data); } } void CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_16_good() { goodG2B(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_16_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_16_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <IDEKit/IDERunSheetSubphaseModel.h> @interface IDERunSheetPrimarySubphaseModel : IDERunSheetSubphaseModel { } + (id)keyPathsForValuesAffectingNavigableItem_name; - (BOOL)navigableItem_hasWork; - (id)navigableItem_name; - (Class)detailViewControllerClass; @end
/** --------------------------------------------------------------------------- * -*- c++ -*- * @file: active.h * * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> * MIT License, see LICENSE file for more details. * ---------------------------------------------------------------------------- */ #pragma once #include "syncqueue.h" #include <functional> #include <memory> #include <thread> namespace yage { class Active { public: typedef std::function<void()> Callback; Active(const Active &) = delete; Active &operator=(const Active &) = delete; ~Active(); static std::unique_ptr<Active> create(); void send(Callback message); private: Active(); void run(); bool running_; SyncQueue<Callback> queue_; std::thread thread_; }; } // namespace yage
// // MPCellNode.h // MPHome // // Created by oasis on 12/10/14. // Copyright (c) 2014 watchpup. All rights reserved. // #import "ASCellNode.h" #import "Artwork.h" @interface MPCellNode : ASCellNode - (instancetype)initWithArtwork: (Artwork *)artwork; - (void)buildCellWithArtwork:(Artwork *)artwork; @end
// // QCARViewController.h // QCAR+CALayer+UIWebView // // Created by Mec0825 on 14-11-10. // Copyright (c) 2014年 HiScene. All rights reserved. // #import <UIKit/UIKit.h> typedef enum { ON_NORMAL, ON_CREATE, ON_RENDERING, ON_DESTROY } QCARCALayerState; @interface QCARViewController : UIViewController { float _zPosition; QCARCALayerState _state; } // Information of target @property (nonatomic, strong) NSString* targetName; @property (nonatomic, assign) float targetWidth; @property (nonatomic, assign) float targetHeight; - (void)onCreate; - (void)onDestroy; - (void)onPause; - (void)onResume; - (QCARCALayerState)getState; - (void)setProjectionMatrix:(float*)mtx; - (void)updateModelViewMatrixOfSubviews:(float*)mtx; @end
/**************************************************************************** Luka Penger 2013 MDIO LPC17xx ****************************************************************************/ #ifndef __MDIO_H #define __MDIO_H #include <LPC17xx.H> #define MDIO_GPIO_PIN 9 #define MDC_GPIO_PIN 8 #define MDIO_GPIO_PORT LPC_GPIO2 #define MDC_GPIO_PORT LPC_GPIO2 void MDIO_Output(unsigned int value, unsigned int n); unsigned int MDIO_Input(void); void MDIO_Turnaround(void); unsigned int MDIO_Read(int PHY_Register, int MAC_Register); void MDIO_Write(int PHY_Register, int MAC_Register, int Value); #endif /* end __MDIO_H */ /**************************************************************************** End Of File ****************************************************************************/
#include <ruby.h> #include "atomic_reference.h" #include "atomic_boolean.h" #include "atomic_fixnum.h" // module and class definitions static VALUE rb_mConcurrent; static VALUE rb_cAtomic; static VALUE rb_cAtomicBoolean; static VALUE rb_cAtomicFixnum; // Init_extension void Init_extension() { // define modules and classes rb_mConcurrent = rb_define_module("Concurrent"); rb_cAtomic = rb_define_class_under(rb_mConcurrent, "CAtomic", rb_cObject); rb_cAtomicBoolean = rb_define_class_under(rb_mConcurrent, "CAtomicBoolean", rb_cObject); rb_cAtomicFixnum = rb_define_class_under(rb_mConcurrent, "CAtomicFixnum", rb_cObject); // CAtomic rb_define_alloc_func(rb_cAtomic, ir_alloc); rb_define_method(rb_cAtomic, "initialize", ir_initialize, -1); rb_define_method(rb_cAtomic, "get", ir_get, 0); rb_define_method(rb_cAtomic, "set", ir_set, 1); rb_define_method(rb_cAtomic, "get_and_set", ir_get_and_set, 1); rb_define_method(rb_cAtomic, "_compare_and_set", ir_compare_and_set, 2); rb_define_alias(rb_cAtomic, "value", "get"); rb_define_alias(rb_cAtomic, "value=", "set"); rb_define_alias(rb_cAtomic, "swap", "get_and_set"); // CAtomicBoolean rb_define_alloc_func(rb_cAtomicBoolean, atomic_boolean_allocate); rb_define_method(rb_cAtomicBoolean, "initialize", method_atomic_boolean_initialize, -1); rb_define_method(rb_cAtomicBoolean, "value", method_atomic_boolean_value, 0); rb_define_method(rb_cAtomicBoolean, "value=", method_atomic_boolean_value_set, 1); rb_define_method(rb_cAtomicBoolean, "true?", method_atomic_boolean_true_question, 0); rb_define_method(rb_cAtomicBoolean, "false?", method_atomic_boolean_false_question, 0); rb_define_method(rb_cAtomicBoolean, "make_true", method_atomic_boolean_make_true, 0); rb_define_method(rb_cAtomicBoolean, "make_false", method_atomic_boolean_make_false, 0); // CAtomicFixnum rb_define_const(rb_cAtomicFixnum, "MIN_VALUE", LL2NUM(LLONG_MIN)); rb_define_const(rb_cAtomicFixnum, "MAX_VALUE", LL2NUM(LLONG_MAX)); rb_define_alloc_func(rb_cAtomicFixnum, atomic_fixnum_allocate); rb_define_method(rb_cAtomicFixnum, "initialize", method_atomic_fixnum_initialize, -1); rb_define_method(rb_cAtomicFixnum, "value", method_atomic_fixnum_value, 0); rb_define_method(rb_cAtomicFixnum, "value=", method_atomic_fixnum_value_set, 1); rb_define_method(rb_cAtomicFixnum, "increment", method_atomic_fixnum_increment, 0); rb_define_method(rb_cAtomicFixnum, "decrement", method_atomic_fixnum_decrement, 0); rb_define_method(rb_cAtomicFixnum, "compare_and_set", method_atomic_fixnum_compare_and_set, 2); rb_define_alias(rb_cAtomicFixnum, "up", "increment"); rb_define_alias(rb_cAtomicFixnum, "down", "decrement"); }
#ifndef VERSIONED_STREAM_H #define VERSIONED_STREAM_H #include "fdstream.h" struct VersionedFDWriteStream: FDWriteStream { VersionedFDWriteStream(int fd): FDWriteStream(fd), protocol_version(0) {} int protocol_version; }; struct VersionedFDReadStream: FDReadStream { VersionedFDReadStream(int fd): FDReadStream(fd), protocol_version(0) {} int protocol_version; }; #endif
// // BoardCollectionViewCell.h // Concentration // // Created by dieSonne on 2015/12/27. // Copyright © 2015年 masato_arai. All rights reserved. // #import <UIKit/UIKit.h> @interface BoardCollectionViewCell : UICollectionViewCell @property (weak, nonatomic) IBOutlet UIImageView *imageView; @end
// // UIImage+Category.h // NavyUIKit // // Created by Jelly on 6/22/15. // Copyright (c) 2015 Steven.Lin. All rights reserved. // #import <UIKit/UIKit.h> @interface UIImage (Category) + (UIImage*) imageWithColor:(UIColor*)color; + (UIImage*) grayscaleImage:(UIImage*)image; - (UIImage*) imageRotatedByDegrees:(CGFloat)degrees; - (UIImage*) resizableImage:(UIEdgeInsets)insets; - (UIImage*) imageWithColor:(UIColor *)color; + (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size; - (UIImage *)tintedImageWithColor:(UIColor*)color; - (CGSize) pointSize; - (CGSize) pixelSize; @end @interface UIImage (Blur) - (UIImage *) boxblurImageWithBlur:(CGFloat)blur exclusionPath:(UIBezierPath *)exclusionPath; @end @interface UIImage (ResizableImage) - (UIImage*) resizableImage:(UIEdgeInsets)insets; @end @interface UIImage (Resize) - (UIImage *)imageByScalingToSize:(CGSize)targetSize; - (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode bounds:(CGSize)bounds interpolationQuality:(CGInterpolationQuality)quality; - (UIImage *)resizedImage:(CGSize)newSize transform:(CGAffineTransform)transform drawTransposed:(BOOL)transpose interpolationQuality:(CGInterpolationQuality)quality; - (UIImage *)resizedImage:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality; - (CGAffineTransform)transformForOrientation:(CGSize)newSize; @end @interface UIImage (ImageEffects) - (UIImage *)applyLightEffect; - (UIImage *)applyExtraLightEffect; - (UIImage *)applyDarkEffect; - (UIImage *)applyBlurEffect; - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor; - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage; @end @interface UIImage (Compressed) - (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size; @end
/***********************************************************************************************************/ /*Node.h /*Created: 2012 /***********************************************************************************************************/ #ifndef NODE_H #define NODE_H /*! Node in a binary tree. */ template <typename Type> class Node { public: Type data; Node<Type> *left; Node<Type> *right; int frequency_of_occurance; Node() { data = 0; frequency_of_occurance = 0; left = 0; right = 0; } ~Node() { if(left) { delete left; left = 0; } if(right) { delete right; right = 0; } } Node(char char_data, int input_frequency_of_occurance) { data = char_data; frequency_of_occurance = input_frequency_of_occurance; left = 0; right = 0; } /*! Recursively determines the weight of a tree by calculating the sum of the weight of its nodes. */ int weight() const { int weight_sum = frequency_of_occurance; if(left) weight_sum += left->weight(); if(right) weight_sum += right->weight(); return weight_sum; } }; /*! Comparator used in order for std::priority_queue to function. */ template <typename Type> struct CompareNode { bool operator() (const Node<Type> & node1, const Node<Type> & node2) const { return node1.weight() > node2.weight(); } bool operator() (const Node<Type> * node1, const Node<Type> * node2) const { return node1->weight() > node2->weight(); } }; #endif
/* * $Header$ * $Name$ * * A cross-platform way of providing access to gsl_ieee_env_setup * from Fortran on any system MITgcm runs on currently. */ #ifdef USE_GSL_IEEE #include <gsl/gsl_math.h> #include <gsl/gsl_ieee_utils.h> void fgsl_ieee_env_setup () { gsl_ieee_env_setup (); } void fgsl_ieee_env_setup_ () { gsl_ieee_env_setup (); } void fgsl_ieee_env_setup__ () { gsl_ieee_env_setup (); } void FGSL_IEEE_ENV_SETUP () { gsl_ieee_env_setup (); } #endif
// // BXPrinterObjects.h // Demo // // Created by Beomjin Kim on 11. 3. 15.. // Copyright 2011 BIXOLON. All rights reserved. // #import <Foundation/Foundation.h> @interface BXPrinter: NSObject { } @property (retain) NSString *name; @property (retain) NSString *address; @property (retain) NSString *modelStr; @property (retain) NSString *versionStr; @property (retain) NSString *friendlyName; @property (retain) NSString *macAddress; @property (retain) NSString *bluetoothDeviceName; @property (assign) unsigned short port; @property (assign) char *mac; @property (assign) unsigned short version; @property (assign) char *subnet; @property (assign) char *gateway; @property (assign) char baudrate; @property (assign) char dhcp; @property (assign) unsigned short inactivityTime; @property (assign) char https; @property (assign) unsigned short value; @property (assign) unsigned short connectionClass; @end
// // DNYLocationManager.h // Donny // // Created by Alex Belliotti on 8/24/14. // Copyright (c) 2014 CrowdCompass. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> #import <CoreBluetooth/CoreBluetooth.h> @protocol DNYBeaconDelegate; @interface DNYLocationManager : NSObject <CLLocationManagerDelegate> @property (strong, nonatomic) CLLocationManager *locationManager; + (instancetype)instance; - (void)registerDelegate:(id<DNYBeaconDelegate>)delegate forBeaconWithUUID:(NSUUID *)uuid identifier:(NSString *)identifier; @end @protocol DNYBeaconDelegate <NSObject> - (void)locationManager:(DNYLocationManager *)manager didRangeBeacon:(CLBeacon *)beacon; @end
// // HMYFilesView.h // Harmony // // Created by Harshad Dange on 07/12/2013. // Copyright (c) 2013 Laughing Buddha Software. All rights reserved. // #import <UIKit/UIKit.h> @interface HMYFilesView : UIView - (UITableView *)filesTableView; - (UISearchBar *)searchBar; @end
// // MarshmallowTests.h // MarshmallowTests // // Created by Fabio Pelosin on 05/04/13. // Copyright (c) 2013 Fabio Angelog Pelosin. MIT License. // #import <SenTestingKit/SenTestingKit.h> @interface MarshmallowTests : SenTestCase @end
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2020 Scientific Computing and Imaging Institute, University of Utah. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INTERFACE_MODULES_GETFIELDSFROMBUNDLE_H #define INTERFACE_MODULES_GETFIELDSFROMBUNDLE_H #include "Interface/Modules/Bundle/ui_GetFieldsFromBundleDialog.h" #include <Interface/Modules/Base/ModuleDialogGeneric.h> #include <Interface/Modules/Bundle/share.h> namespace SCIRun { namespace Gui { class SCISHARE GetFieldsFromBundleDialog : public ModuleDialogGeneric, public Ui::GetFieldsFromBundleDialog { Q_OBJECT public: GetFieldsFromBundleDialog(const std::string& name, SCIRun::Dataflow::Networks::ModuleStateHandle state, QWidget* parent = 0); protected: virtual void pullSpecial() override; private: std::vector<std::string> fieldNames_; }; } } #endif
// // UIViewController+BaseClass.h // YUKit<https://github.com/c6357/YUKit> // // Created by BruceYu on 15/3/18. // Copyright (c) 2015年 BruceYu. All rights reserved. // #import <UIKit/UIKit.h> #import "UIViewController+Storyboard.h" @interface UIViewController (BaseClass) - (UIViewController *)lastPresentedViewController; - (BOOL)checkUserExistAndPromptForLoginWhenNonexist; - (void)setTranslucentNavBar; - (void)setNormalNavBar; /**************** 顶部提示框 **********************/ -(void)showMessage:(NSString*)msg; //-(void)showWithStatus:(NSString*)str; // //-(void)dismiss:(void(^)())block; /** * <#Description#> * * @param completion <#completion description#> */ -(void)hiddenTabBar:(void(^)())completion; -(void)showTabBar:(void(^)())completion; @end