text
stringlengths
4
6.14k
/* CrossNet - Copyright (c) 2007 Olivier Nallet 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 __SYSTEM_ICOMPARABLE__G1_H__ #define __SYSTEM_ICOMPARABLE__G1_H__ // The user cannot override this type #include "CrossNetRuntime/Internal/IInterface.h" namespace System { template <typename T> class IComparable__G1 : public CrossNetRuntime::IInterface { public: CN_MULTIPLE_DYNAMIC_INTERFACE_ID0() virtual System::Int32 CompareTo(void * __instance__, T other) = 0; }; } #endif
/* * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org * Copyright (c) 2013 Google, 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. */ #ifndef B2_POLYGON_SHAPE_H #define B2_POLYGON_SHAPE_H #include <Box2D/Collision/Shapes/b2Shape.h> /// A convex polygon. It is assumed that the interior of the polygon is to /// the left of each edge. /// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. /// In most cases you should not need many vertices for a convex polygon. class b2PolygonShape : public b2Shape { public: b2PolygonShape(); /// Implement b2Shape. b2Shape* Clone(b2BlockAllocator* allocator) const; /// @see b2Shape::GetChildCount int32 GetChildCount() const; /// Create a convex hull from the given array of local points. /// The count must be in the range [3, b2_maxPolygonVertices]. /// @warning the points may be re-ordered, even if they form a convex polygon /// @warning collinear points are handled but not removed. Collinear points /// may lead to poor stacking behavior. void Set(const b2Vec2* points, int32 count); /// Build vertices to represent an axis-aligned box centered on the local origin. /// @param hx the half-width. /// @param hy the half-height. void SetAsBox(float32 hx, float32 hy); /// Build vertices to represent an oriented box. /// @param hx the half-width. /// @param hy the half-height. /// @param center the center of the box in local coordinates. /// @param angle the rotation of the box in local coordinates. void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); /// @see b2Shape::TestPoint bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; // @see b2Shape::ComputeDistance void ComputeDistance(const b2Transform& xf, const b2Vec2& p, float32* distance, b2Vec2* normal, int32 childIndex) const; /// Implement b2Shape. bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, const b2Transform& transform, int32 childIndex) const; /// @see b2Shape::ComputeAABB void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; /// @see b2Shape::ComputeMass void ComputeMass(b2MassData* massData, float32 density) const; /// Get the vertex count. int32 GetVertexCount() const { return m_count; } /// Get a vertex by index. const b2Vec2& GetVertex(int32 index) const; /// Validate convexity. This is a very time consuming operation. /// @returns true if valid bool Validate() const; b2Vec2 m_centroid; b2Vec2 m_vertices[b2_maxPolygonVertices]; b2Vec2 m_normals[b2_maxPolygonVertices]; int32 m_count; }; inline b2PolygonShape::b2PolygonShape() { m_type = e_polygon; m_radius = b2_polygonRadius; m_count = 0; m_centroid.SetZero(); } inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const { b2Assert(0 <= index && index < m_count); return m_vertices[index]; } #endif
bool isSameTree(struct TreeNode* p, struct TreeNode* q) { if (p == NULL && q == NULL) { return true; } else if ((p && !q) || (q && !p)) { return false; } else if ((p->left == NULL && q->left != NULL) || (q->left == NULL && p->left != NULL)) { return false; } else if ((p->right == NULL && q->right != NULL) || (q->right == NULL && p->right != NULL)) { return false; } else if (p->val != q->val) { return false; } else { if (!isSameTree(p->left, q->left)) { return false; } else if (!isSameTree(p->right, q->right)) { return false; } return true; } }
/******************************************************************************** ** Form generated from reading UI file 'askpassphrasedialog.ui' ** ** Created: Sun Feb 16 07:26:55 2014 ** by: Qt User Interface Compiler version 4.8.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_ASKPASSPHRASEDIALOG_H #define UI_ASKPASSPHRASEDIALOG_H #include <QtCore/QVariant> #include <QtGui/QAction> #include <QtGui/QApplication> #include <QtGui/QButtonGroup> #include <QtGui/QDialog> #include <QtGui/QDialogButtonBox> #include <QtGui/QFormLayout> #include <QtGui/QHeaderView> #include <QtGui/QLabel> #include <QtGui/QLineEdit> #include <QtGui/QVBoxLayout> QT_BEGIN_NAMESPACE class Ui_AskPassphraseDialog { public: QVBoxLayout *verticalLayout; QLabel *warningLabel; QFormLayout *formLayout; QLabel *passLabel1; QLineEdit *passEdit1; QLabel *passLabel2; QLineEdit *passEdit2; QLabel *passLabel3; QLineEdit *passEdit3; QLabel *capsLabel; QDialogButtonBox *buttonBox; void setupUi(QDialog *AskPassphraseDialog) { if (AskPassphraseDialog->objectName().isEmpty()) AskPassphraseDialog->setObjectName(QString::fromUtf8("AskPassphraseDialog")); AskPassphraseDialog->resize(598, 198); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(AskPassphraseDialog->sizePolicy().hasHeightForWidth()); AskPassphraseDialog->setSizePolicy(sizePolicy); AskPassphraseDialog->setMinimumSize(QSize(550, 0)); verticalLayout = new QVBoxLayout(AskPassphraseDialog); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); warningLabel = new QLabel(AskPassphraseDialog); warningLabel->setObjectName(QString::fromUtf8("warningLabel")); warningLabel->setTextFormat(Qt::RichText); warningLabel->setWordWrap(true); verticalLayout->addWidget(warningLabel); formLayout = new QFormLayout(); formLayout->setObjectName(QString::fromUtf8("formLayout")); formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); passLabel1 = new QLabel(AskPassphraseDialog); passLabel1->setObjectName(QString::fromUtf8("passLabel1")); formLayout->setWidget(0, QFormLayout::LabelRole, passLabel1); passEdit1 = new QLineEdit(AskPassphraseDialog); passEdit1->setObjectName(QString::fromUtf8("passEdit1")); passEdit1->setEchoMode(QLineEdit::Password); formLayout->setWidget(0, QFormLayout::FieldRole, passEdit1); passLabel2 = new QLabel(AskPassphraseDialog); passLabel2->setObjectName(QString::fromUtf8("passLabel2")); formLayout->setWidget(1, QFormLayout::LabelRole, passLabel2); passEdit2 = new QLineEdit(AskPassphraseDialog); passEdit2->setObjectName(QString::fromUtf8("passEdit2")); passEdit2->setEchoMode(QLineEdit::Password); formLayout->setWidget(1, QFormLayout::FieldRole, passEdit2); passLabel3 = new QLabel(AskPassphraseDialog); passLabel3->setObjectName(QString::fromUtf8("passLabel3")); formLayout->setWidget(2, QFormLayout::LabelRole, passLabel3); passEdit3 = new QLineEdit(AskPassphraseDialog); passEdit3->setObjectName(QString::fromUtf8("passEdit3")); passEdit3->setEchoMode(QLineEdit::Password); formLayout->setWidget(2, QFormLayout::FieldRole, passEdit3); capsLabel = new QLabel(AskPassphraseDialog); capsLabel->setObjectName(QString::fromUtf8("capsLabel")); QFont font; font.setBold(true); font.setWeight(75); capsLabel->setFont(font); capsLabel->setAlignment(Qt::AlignCenter); formLayout->setWidget(3, QFormLayout::FieldRole, capsLabel); verticalLayout->addLayout(formLayout); buttonBox = new QDialogButtonBox(AskPassphraseDialog); buttonBox->setObjectName(QString::fromUtf8("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); verticalLayout->addWidget(buttonBox); retranslateUi(AskPassphraseDialog); QObject::connect(buttonBox, SIGNAL(accepted()), AskPassphraseDialog, SLOT(accept())); QObject::connect(buttonBox, SIGNAL(rejected()), AskPassphraseDialog, SLOT(reject())); QMetaObject::connectSlotsByName(AskPassphraseDialog); } // setupUi void retranslateUi(QDialog *AskPassphraseDialog) { AskPassphraseDialog->setWindowTitle(QApplication::translate("AskPassphraseDialog", "Passphrase Dialog", 0, QApplication::UnicodeUTF8)); passLabel1->setText(QApplication::translate("AskPassphraseDialog", "Enter passphrase", 0, QApplication::UnicodeUTF8)); passLabel2->setText(QApplication::translate("AskPassphraseDialog", "New passphrase", 0, QApplication::UnicodeUTF8)); passLabel3->setText(QApplication::translate("AskPassphraseDialog", "Repeat new passphrase", 0, QApplication::UnicodeUTF8)); capsLabel->setText(QString()); } // retranslateUi }; namespace Ui { class AskPassphraseDialog: public Ui_AskPassphraseDialog {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_ASKPASSPHRASEDIALOG_H
#include "pQueue.h" #include <stdlib.h> #include <stdio.h> void initPQueue(pQueue **queue) { //We allocate memory for the priority queue type //and we initialize the values of the fields (*queue) = (pQueue *) malloc(sizeof(pQueue)); (*queue)->first = NULL; (*queue)->size = 0; return; } void addPQueue(pQueue **queue, htNode * val, unsigned int priority) { //If the queue is full we don't have to add the specified value. //We output an error message to the console and return. if((*queue)->size == MAX_SZ) { printf("\nQueue is full.\n"); return; } pQueueNode *aux = (pQueueNode *)malloc(sizeof(pQueueNode)); aux->priority = priority; aux->val = val; //If the queue is empty we add the first value. //We validate twice in case the structure was modified abnormally at runtime (rarely happens). if((*queue)->size == 0 || (*queue)->first == NULL) { aux->next = NULL; (*queue)->first = aux; (*queue)->size = 1; return; } else { //If there are already elements in the queue and the priority of the element //that we want to add is greater than the priority of the first element, //we'll add it in front of the first element. //Be careful, here we need the priorities to be in descending order if(priority<=(*queue)->first->priority) { aux->next = (*queue)->first; (*queue)->first = aux; (*queue)->size++; return; } else { //We're looking for a place to fit the element depending on it's priority pQueueNode * iterator = (*queue)->first; while(iterator->next!=NULL) { //Same as before, descending, we place the element at the begining of the //sequence with the same priority for efficiency even if //it defeats the idea of a queue. if(priority<=iterator->next->priority) { aux->next = iterator->next; iterator->next = aux; (*queue)->size++; return; } iterator = iterator->next; } //If we reached the end and we haven't added the element, //we'll add it at the end of the queue. if(iterator->next == NULL) { aux->next = NULL; iterator->next = aux; (*queue)->size++; return; } } } } void addPQueue_LI(pQueue **queue, htNode * val, int direction, int parental_node)//add node without sorting - for simple LIFO queue { //If the queue is full we don't have to add the specified value. //We output an error message to the console and return. if((*queue)->size == MAX_SZ) { printf("\nQueue is full.\n"); return; } pQueueNode *aux = (pQueueNode *)malloc(sizeof(pQueueNode)); aux->val = val; aux->val->direction = direction; aux ->val ->parental_node = parental_node; //If the queue is empty we add the first value. //We validate twice in case the structure was modified abnormally at runtime (rarely happens). if((*queue)->size == 0 || (*queue)->first == NULL) { aux->next = NULL; (*queue)->first = aux; (*queue)->size = 1; return; } else { //we make aux last node in queue pQueueNode * iterator = (*queue)->first; while (iterator->next != NULL) iterator = iterator->next; iterator->next = aux; aux->next = NULL; (*queue)->size++; return; } } htNode * getPQueue_FO(pQueue **queue)//FO implementation { htNode * returnValue = NULL; //We get elements from the queue as long as it isn't empty if((*queue)->size>0) { returnValue = (*queue)->first->val; (*queue)->first = (*queue)->first->next; (*queue)->size--; } else { //If the queue is empty we show an error message. //The function will return whatever is in the memory at that time as returnValue. //Or you can define an error value depeding on what you choose to store in the queue. printf("\nQueue is empty.\n"); } return returnValue; }
#include "injected.h" #include <mach-o/dyld_images.h> #include <mach-o/loader.h> #include <mach-o/nlist.h> #include <string.h> #include <dlfcn.h> /* These values are overwritten on a per-injection basis by the injector. */ /* Must not be defined as consts, or the compiler will optimize them. */ struct dyld_all_image_infos *dyld_info = (typeof(dyld_info)) DYLD_MAGIC_32; char argument[ARGUMENT_MAX_LENGTH] = ARGUMENT_MAGIC_STR; /* The interrupt calling convention does not save the flags register, so we use these ASM functions to save and restore it outselves. They must be called as early and as late as possible, respectively, so instructions that modify flags won't destory the state. */ uint32_t get_flags(void); /* Use fastcall for set_flags, parameters on registers are easier to work with. */ __attribute__((fastcall)) void set_flags(uint32_t); __asm__ ( "_get_flags: \n" " pushfd \n" " pop %eax \n" " ret \n" "_set_flags: \n" " push %ecx \n" " popfd \n" " ret \n" ); static const struct mach_header *get_header_by_path(const char *name) { for (unsigned i = 0; i < dyld_info->infoArrayCount; i++) { if (strcmp(dyld_info->infoArray[i].imageFilePath, name) == 0) { return (const struct mach_header *) dyld_info->infoArray[i].imageLoadAddress; } } return NULL; } static const void *get_symbol_from_header(const struct mach_header *header, const char *symbol) { if (!header) { return NULL; } /* Get the required commands */ const struct symtab_command *symtab = NULL; const struct segment_command *first = NULL; const struct segment_command *linkedit = NULL; const struct load_command *cmd = (typeof(cmd))(header + 1); for (unsigned i = 0; i < header->ncmds; i++, cmd = (typeof(cmd)) ((char*) cmd + cmd->cmdsize)) { if (cmd->cmd == LC_SEGMENT) { if (!first && ((typeof(first))cmd)->filesize ) { first = (typeof(first)) cmd; } if (strcmp(((typeof(linkedit)) cmd)->segname, "__LINKEDIT") == 0) { linkedit = (typeof(linkedit)) cmd; } } else if (cmd->cmd == LC_SYMTAB) { symtab = (typeof (symtab)) cmd; } if (symtab && linkedit) break; } if (!symtab || !linkedit) return NULL; const char *string_table = ((const char *) header + symtab->stroff - linkedit->fileoff + linkedit->vmaddr - first->vmaddr); const struct nlist *symbols = (typeof (symbols)) ((const char *) header + symtab->symoff - linkedit->fileoff + linkedit->vmaddr - first->vmaddr); for (unsigned i = 0; i < symtab->nsyms; i++) { if (strcmp(string_table + symbols[i].n_un.n_strx, symbol) == 0) { return (char *)header + symbols[i].n_value - first->vmaddr; } } return NULL; } void _entry() { uint32_t flags = get_flags(); typeof(dlopen) *$dlopen = NULL; /* We can't call dyld`dlopen when dyld3 is being used, so we must find libdyld`dlopen and call that instead */ $dlopen = get_symbol_from_header(get_header_by_path("/usr/lib/system/libdyld.dylib"), "_dlopen"); if ($dlopen) { $dlopen(argument, RTLD_NOW); } set_flags(flags); } /* Clang on x86-32 does not support the preserve_all convention. Instead, we use * the interrupt attribute. The Makefile takes care of replacing iret with ret. Additionally, Clang sometimes stores xmm7 on an unaligned address and crashes, and since LLVM's bug tracker has been down for ages, the Makefile fixes that as well. -_- */ void __attribute__((interrupt)) entry(void * __attribute__((unused)) unused) { _entry(); } /* Taken from Apple's libc */ int strcmp(s1, s2) const char *s1, *s2; { while (*s1 == *s2++) if (*s1++ == 0) return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); }
#ifndef POINT_H #define POINT_H #include <string> using namespace std; class Point { public: Point(string line); Point(double x, double y); void setX(double x); void setY(double y); double getX(); double getY(); private: double x; double y; }; #endif
// // NAGatedVC.h // NAParentalGateAlertDemo // // Created by Nathan Rowe on 9/30/13. // Copyright (c) 2013 Natrosoft LLC. All rights reserved. // #import <UIKit/UIKit.h> @interface NAGatedVC : UIViewController @end
#ifndef CONFFILE_H #define CONFFILE_H #include "netstream.h" void endpt_config_init(struct endpt_cfg * config); int io_config_init(struct io_cfg * config, int nitems); int endpt_config_set_item(struct endpt_cfg * config, char * key, char * value); int parse_config_file(struct io_cfg * config, char * filename); void print_config(struct io_cfg * cfg); int check_config(struct io_cfg * config); #endif
/** * acx.h * System configuration for a basic cooperative executive * Kernel. * @designer Edwin Frank Barry * @author Christopher Waldon */ /* * Define some hard-ware specific constants */ #define led12 PB6 #define led11 PB5 /* * Define some hardware manipulation macros */ #define output_low(port, pin) (port &= ~(1 << pin)) #define output_hi(port, pin) (port |= (1 << pin)) #define set_input(portdir, pin) (portdir &= ~(1 << pin)) #define set_output(portdir, pin) (portdir |= (1 << pin)) /* * Define system constants */ #define x_getTID() (x_thread_id) #define MAX_THREADS 8 #define NUM_THREADS 8 /* * Define a thread ID for each thread */ #define TID0 0 #define TID1 1 #define TID2 2 #define TID3 3 #define TID4 4 #define TID5 5 #define TID6 6 #define TID7 7 /* * Define the starting size of the stacks */ #define DEFAULT_SIZE 128 #define TH0_SIZE DEFAULT_SIZE #define TH1_SIZE DEFAULT_SIZE #define TH2_SIZE DEFAULT_SIZE #define TH3_SIZE DEFAULT_SIZE #define TH4_SIZE DEFAULT_SIZE #define TH5_SIZE DEFAULT_SIZE #define TH6_SIZE DEFAULT_SIZE #define TH7_SIZE DEFAULT_SIZE /* * Define the starting locations of the stacks */ #define STACK_START 0x21FF #define INIT_SPACE 0x80 #define TH0_START ((byte *)STACK_START-INIT_SPACE) #define TH1_START ((byte *)TH0_START-TH0_SIZE) #define TH2_START ((byte *)TH1_START-TH1_SIZE) #define TH3_START ((byte *)TH2_START-TH2_SIZE) #define TH4_START ((byte *)TH3_START-TH3_SIZE) #define TH5_START ((byte *)TH4_START-TH4_SIZE) #define TH6_START ((byte *)TH5_START-TH5_SIZE) #define TH7_START ((byte *)TH6_START-TH6_SIZE) /* * Define the positions of each canary */ #define TH0_CANARY (TH1_START+1) #define TH1_CANARY (TH2_START+1) #define TH2_CANARY (TH3_START+1) #define TH3_CANARY (TH4_START+1) #define TH4_CANARY (TH5_START+1) #define TH5_CANARY (TH6_START+1) #define TH6_CANARY (TH7_START+1) #define TH7_CANARY (TH7_START-TH7_SIZE+1) /* * Define the value of the canaries */ #define CANARY_VALUE 0xAA #ifndef __ASSEMBLER__ typedef uint8_t byte; typedef uint8_t bool; typedef void (*PTHREAD)(void); /* * Define ACX function prototypes */ void x_init(); void x_new(byte tid, PTHREAD pthread, byte isEnabled); void x_yield(); void x_schedule(); void x_delay(int ticks); void x_suspend(int tid); void x_resume(int tid); void x_disable(int tid); void x_enable(int tid); byte x_getID(); long gtime(); /*********************************************************| * Define stack control structures ***********************| */ /** * Stack stores the base address of a given stack, as well as * a pointer to the current head address of that stack. */ typedef struct { byte * pHead; byte * pBase; } Stack; /** * StackDelay represents a delay length for a single thread */ typedef uint16_t Delay; #endif
/** * linux terminal progress bar (no thread safe). * @package progress.h */ #ifndef progress_h #define progress_h #include <stdio.h> typedef struct { char chr; /*tip char*/ char *title; /*tip string*/ int style; /*progress style*/ int max; /*maximum value*/ float offset; char *pro; } progress_t; #define PROGRESS_NUM_STYLE 0 #define PROGRESS_CHR_STYLE 1 #define PROGRESS_BGC_STYLE 2 extern void progress_init(progress_t *, char *, int, int); extern void progress_show(progress_t *, float); extern void progress_destroy(progress_t *); #endif /*ifndef*/
// // MHYouKuAnthologyHeaderView.h // MHDevelopExample // // Created by CoderMikeHe on 17/2/17. // Copyright © 2017年 CoderMikeHe. All rights reserved. // #import <UIKit/UIKit.h> @class MHYouKuAnthologyHeaderView,MHYouKuAnthologyItem; @protocol MHYouKuAnthologyHeaderViewDelegate <NSObject> @optional /** 更多按钮被点击 */ - (void)anthologyHeaderViewForMoreButtonAction:(MHYouKuAnthologyHeaderView *)anthologyHeaderView; /** 视频选中哪一集 */ - (void)anthologyHeaderView:(MHYouKuAnthologyHeaderView *)anthologyHeaderView mediaBaseId:(NSString *)mediaBaseId; @end @interface MHYouKuAnthologyHeaderView : UITableViewHeaderFooterView + (instancetype)anthologyHeaderView; /** head */ + (instancetype)headerViewWithTableView:(UITableView *)tableView; /** 代理 */ @property (nonatomic , weak) id <MHYouKuAnthologyHeaderViewDelegate> delegate; /** 容器 */ @property (nonatomic , strong) MHYouKuAnthologyItem *anthologyItem; @end
// // GONMarkupFont.h // GONMarkupParserSample // // Created by Nicolas Goutaland on 25/06/14. // Copyright (c) 2014 Nicolas Goutaland All rights reserved. // // Define a generic markup to configure font // "size" is used to define font size // If missing, current font size will be used. If not found is set, default system font size will be used // "name" define a registered font name or full font name // - Markup will first try to find a registeredFont with given name. // - If no font found, markup will try to load a font using given name // If "name" isn't set, current defined font will be used with new defined size. If no font is currently used, default system one will be used // // If no attribute is set, current defined font will be removed (NSFontAttributeName), and default system one will be used instead // // Examples // // <font size="18">This text will use current font, set to 18</> // <font name="Helvetica">This text will use Helvetica as font, using current font size</> // <font name="Helvetica" size="18">This text will use Helvetica, set to 18</> #import "GONMarkup.h" // Tag #define GONMarkupFont_TAG @"font" // Attributes #define GONMarkupFont_TAG_size_ATT @"size" // Font size. If missing, will use default font size, or one previously set on stack #define GONMarkupFont_TAG_color_ATT @"color" // Text color #define GONMarkupFont_TAG_name_ATT @"name" // Full font name, including style @interface GONMarkupFont : GONMarkup /* Default markup to add font support */ + (instancetype)fontMarkup; @end
// // UINavigationMenuManager.h // Pods // // Created by Ilter Cengiz on 25/02/15. // // #import <Foundation/Foundation.h> #import "UINavigationMenuController.h" @interface UINavigationMenuManager : NSObject /** Returns a view controller for the given index that will be presented by the navigation menu controller. @param navigationMenuController Navigation menu controller object that asks for the view controller @param index Index of the view controller in question @return A view controller to be presented @warning Subclasses must override this method, otherwise an assertion will throw an exception */ - (UIViewController *)navigationMenuController:(UINavigationMenuController *)navigationMenuController viewControllerForMenuItemAtIndex:(NSInteger)index; /** Returns a title for the menu item for the given index that will be shown in the appropriate entry in the menu. @param navigationMenuController Navigation menu controller object that asks for the title @param index Index of the menu item whom title is asked for @return A title for the menu item @warning Subclasses must override this method, otherwise an assertion will throw an exception */ - (NSString *)navigationMenuController:(UINavigationMenuController *)navigationMenuController titleForMenuItemAtIndex:(NSInteger)index; /** Returns the number of menu items that will be available in the menu. @param navigationMenuController Navigation menu controller object that asks how many items should be available in the menu @return Number of menu items @warning Subclasses must override this method, otherwise an assertion will throw an exception */ - (NSInteger)numberOfMenuItemsInNavigationMenuController:(UINavigationMenuController *)navigationMenuController; @end
// // ContrastChannelView.h // contrast // // Created by Johan Halin on 6.7.2015. // Copyright © 2015 Aero Deko. All rights reserved. // #import <UIKit/UIKit.h> #define CONTRAST_COLOR_OUTLINE [UIColor colorWithRed:(253.0 / 255.0) green:(225.0 / 255.0) blue:(209.0 / 255.0) alpha:1.0] #define CONTRAST_COLOR_FULL [UIColor colorWithRed:(253.0 / 255.0) green:(225.0 / 255.0) blue:(209.0 / 255.0) alpha:0.75] #define CONTRAST_COLOR_SILENT [UIColor colorWithRed:(253.0 / 255.0) green:(225.0 / 255.0) blue:(209.0 / 255.0) alpha:0.25] #define CONTRAST_COLOR_CYAN [UIColor colorWithRed:(0 / 255.0) green:(158.0 / 255.0) blue:(226.0 / 255.0) alpha:1.0] #define CONTRAST_COLOR_MAGENTA [UIColor colorWithRed:(229.0 / 255.0) green:(0 / 255.0) blue:(126.0 / 255.0) alpha:0.75] @protocol ContrastChannelViewDelegate; @interface ContrastChannelView : UIView @property (nonatomic) BOOL silent; - (instancetype)initWithCenter:(CGPoint)center delegate:(id<ContrastChannelViewDelegate>)delegate; @end @protocol ContrastChannelViewDelegate <NSObject> @required - (void)channelView:(ContrastChannelView *)channelView updatedWithPosition:(CGPoint)position scale:(CGFloat)scale rotation:(CGFloat)rotation; - (void)channelViewReceivedTap:(ContrastChannelView *)channelView; - (void)channelViewReceivedDoubleTap:(ContrastChannelView *)channelView; @end
#include <windows.h> #include <stdio.h> #include <psapi.h> #include <string.h> #include <time.h> #include <math.h> #define WINDOWNAME "Counter-Strike: Global Offensive" #define PLRSZ 0x18 #define SERVERDLL "server.dll" #define CLIENTDLL "client.dll" const DWORD plr_num_offset = 0x93DCF8; const DWORD plr_list_offset = 0x89A48C; const DWORD hp_offset = 0x214; const DWORD coords_offset = 0x1D0; const DWORD v_matrix_offset = 0x4A087D4; DWORD server_dll_base; DWORD client_dll_base; HANDLE hProcess; float view_matrix[4][4]; int world_to_screen(float* from, float* to); RECT rect; HWND hWnd; float my_coords[3]; HDC hDC; void get_process_handle(); int read_bytes(PCVOID addr, int num, void* buf); void esp(); void read_my_coords(); void get_view_matrix(); void draw_health(float x, float y, int health); int main(int argc, char** argv) { get_process_handle(); esp(); CloseHandle(hProcess); return 0; } void read_my_coords(DWORD addr) { DWORD plr_addr; read_bytes((PCVOID)(addr), 4, &plr_addr); read_bytes((PCVOID)(plr_addr + coords_offset), 12, &my_coords); } void esp() { int players_on_map, i, hp; float coords[3]; DWORD plr_addr; DWORD addr = server_dll_base + plr_list_offset; read_bytes((PCVOID)addr, 4, &plr_addr); SetTextAlign(hDC, TA_CENTER|TA_NOUPDATECP); SetBkColor(hDC, RGB(0,0,0)); SetBkMode(hDC, TRANSPARENT); SetTextColor(hDC, RGB(0, 255, 0)); for (;;Sleep(1)) { system("cls"); GetWindowRect(hWnd, &rect); read_bytes((PCVOID)(server_dll_base + plr_num_offset), 4, &players_on_map); printf("players on the map: %d\n", players_on_map); if (players_on_map == 0) continue; printf("players on the screeen:\n"); read_my_coords(addr); for (i = 1; i < players_on_map; i++) { read_bytes((PCVOID)(addr + i*PLRSZ), 4, &plr_addr); read_bytes((PCVOID)(plr_addr + hp_offset), 4, &hp); if (hp == 0) continue; read_bytes((PCVOID)(plr_addr + coords_offset), 12, &coords); get_view_matrix(); float tempCoords[3]; if (world_to_screen(coords, tempCoords) == 1) { printf("player %d health: %d (%g:%g:%g)\n", i, hp, coords[0], coords[1], coords[2]); draw_health(tempCoords[0] - rect.left, tempCoords[1] - rect.top-20, hp); } } } } void draw_health(float x, float y, int health) { char buf[sizeof(int)*3+2]; snprintf(buf, sizeof buf, "%d", health); TextOutA(hDC, x, y, buf, strlen(buf)); } void get_view_matrix() { read_bytes((PCVOID)(client_dll_base+v_matrix_offset), 64, &view_matrix); } int world_to_screen(float* from, float* to) { float w = 0.0f; to[0] = view_matrix[0][0] * from[0] + view_matrix[0][1] * from[1] + view_matrix[0][2] * from[2] + view_matrix[0][3]; to[1] = view_matrix[1][0] * from[0] + view_matrix[1][1] * from[1] + view_matrix[1][2] * from[2] + view_matrix[1][3]; w = view_matrix[3][0] * from[0] + view_matrix[3][1] * from[1] + view_matrix[3][2] * from[2] + view_matrix[3][3]; if (w < 0.01f) return 0; float invw = 1.0f / w; to[0] *= invw; to[1] *= invw; int width = (int)(rect.right - rect.left); int height = (int)(rect.bottom - rect.top); float x = width/2; float y = height/2; x += 0.5 * to[0] * width + 0.5; y -= 0.5 * to[1] * height + 0.5; to[0] = x + rect.left; to[1] = y + rect.top; return 1; } void get_process_handle() { DWORD pid = 0; hWnd = FindWindow(0, WINDOWNAME); if (hWnd == 0) { printf("FindWindow failed, %08X\n", GetLastError()); return; } GetWindowThreadProcessId(hWnd, &pid); hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, pid); if (hProcess == 0) { printf("OpenProcess failed, %08X\n", GetLastError()); return; } hDC = GetDC(hWnd); HMODULE hMods[1024]; int i; if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &pid) == 0) { printf("enumprocessmodules failed, %08X\n", GetLastError()); } else { for (i = 0; i < (pid / sizeof(HMODULE)); i++) { TCHAR szModName[MAX_PATH]; if (GetModuleFileNameEx(hProcess, hMods[i], szModName, sizeof(szModName)/sizeof(TCHAR))) { if (strstr(szModName, SERVERDLL) != 0) { printf("server.dll base: %08X\n", hMods[i]); server_dll_base = (DWORD)hMods[i]; } if (strstr(szModName, CLIENTDLL) != 0) { printf("client.dll base: %08X\n", hMods[i]); client_dll_base = (DWORD)hMods[i]; } } } } } int read_bytes(PCVOID addr, int num, void* buf) { SIZE_T sz = 0; int r = ReadProcessMemory(hProcess, addr, buf, num, &sz); if (r == 0 || sz == 0) { printf("RPM error, %08X\n", GetLastError()); return 0; } return 1; }
#ifndef GRADIENT_H #define GRADIENT_H #include "qm_t.h" #include "mol.h" typedef struct{ double f; double g; } fgpair_t; void gradient(double * Da, double * Db, double * H, double * pmmm, double * g, int * alo, int * alv, basis * bo, basis * bv, mol * m, qmdata * qmd); void gradient_r(double * D, double * H, double * pmmm, double * g, int * alo, int * alv, basis * bo, basis * bv, mol * m, qmdata * qmd); void gradient_test(int Na, int Nb, double * Da, double * Db, double * Hmp, double * pmmm, int * alo, int * alv, basis * bo, basis * bv, mol * m, qmdata * qmd); void E0_eq2_grad(double * g, mol * m, qmdata * qmd); void E0_ext_grad(double field[3], double * g, double * Da, double * Db, int * alo, mol * m, qmdata * qmd); void f_eq25_mm_grad(double * g, double * Da, double * Db, int * alo, basis * bo, mol * m, qmdata * qmd); void f_eq25_mm_grad_r(double * g, double * D, int * alo, basis * bo, mol * m, qmdata * qmd); void R_mmmm_grad(double * g, double * Da, double * Db, int * alo, basis * bo, mol * m, qmdata * qmd); void R_mmmm_grad_r(double * g, double * D, int * alo, basis * bo, mol * m, qmdata * qmd); void mmmm6_grad(double * g, double * Da, double * Db, int * alo, basis * bo, mol * m, qmdata * qmd); void mmmm6_grad_r(double * g, double * D, int * alo, basis * bo, mol * m, qmdata * qmd); void E2_grad(double * g, double * Da, double * Db, double * Fa, double * Fb, double * Xa, double * Xb, double * sa, double * sb, double * ja, double * jb, int * alo, int * alv, basis * bo , basis * bv, mol * m, qmdata * qmd); void E2_grad_r(double * g, double * D, double * F, double * X, double * s, double * j, int * alo, int * alv, basis * bo , basis * bv, mol * m, qmdata * qmd); fgpair_t F_eq47_grad(int fbi, int lu, int lv, int qu, int qv, double r, qmdata * qmd); fgpair_t F_eq48_grad(int f1bi, int la, int lv, int qa, int qv, double r, qmdata * qmd); fgpair_t V_eq49_mm_grad(int ubi, int lu, int lv, int qu, int qk, double r, qmdata * qmd); fgpair_t V_eq49_mp_grad(int u1bi, int lu, int lv, int qu, int qk, double r, qmdata * qmd); fgpair_t S_eq50_grad(int foi, int lu, int ld, int qu, int qd, double r, qmdata * qmd); double V_eq51_grad(int lu, int lu1, int qu, int qk, double r, qmdata * qmd); fgpair_t G_eq52_mmmm_grad(int m, int l, int l1, int lu, int lv, int lu1, int lv1, int qu, int qu1, double r, qmdata * qmd); fgpair_t G_eq52_mmmp_grad(int m, int l, int l1, int lu, int lv, int lu1, int lv1, int qu, int qu1, double q1, double q2, double r, qmdata * qmd); double G6_eq53_grad(int lu, int lu1, int qu, int qu1, double r, qmdata * qmd); #endif
#ifndef _3DUTILITIES_H #define _3DUTILITIES_H #pragma once #include "../ext/Quaternion.h" /* These functions should probably be folded into 3dbasics at some point. But they're here for now. */ Quaternion RotateTowards(const Quaternion& from, const Quaternion& to, float maxDegreesDelta); #endif
#include <stdio.h> int findbig(const int*,int); int main(int argc, char const *argv[]) { int lines; char s[1010]={'\0'},*pstr=s; scanf("%d",&lines); getchar(); while(lines--){ int count[26]={0}; gets(s); pstr=s; while(*pstr) count[*pstr++-'a']++; printf("%c\n",findbig(count,26)+'a'); } return 0; } int findbig(const int* p,int n) { int big=0,index=-1; for(int i=0;i<n;i++) if(*(p+i)>big){ big=*(p+i); index=i; } return index; }
// // HCPInstallationWorker.h // // InfinitusHotCodePush // // Created by M on 16/8/30. // #import <Foundation/Foundation.h> #import "HCPWorker.h" #import "HCPFilesStructure.h" /** * 安装类 * * @see HCPWorker */ @interface HCPInstallationWorker : NSObject<HCPWorker> /** * 初始化 * * @param newVersion 需要安装的新版本 * @param currentVersion 现在的版本 * * @return 实例 */ - (instancetype)initWithNewVersion:(NSString *)newVersion currentVersion:(NSString *)currentVersion; @end
/* * (c) 2010 Koninklijke Philips Electronics N.V., All rights reserved * * This source code and any compilation or derivative thereof is the * proprietary information of Koninklijke Philips Electronics N.V. and is * confidential in nature. * Under no circumstances is this software to be exposed to or placed under an * Open Source License of any type without the expressed written permission of * Koninklijke Philips Electronics N.V. */ #if !defined(_PLFAPICONN_TYPES_H_) #define _PLFAPICONN_TYPES_H_ /* * The following types are needed by the prototypes * Bool * FResult * Int8 * MediaDetect_Format_t * Nat16 * Nat32 * Nat64 * Nat8 * tmCmDmx_Buffer_t * tmCmDmx_BufferType_t * tmCmDmx_PlatformStreamType_t * tmCmDmx_StreamType_t * tmCmDmx_SuppPlatformStreamTypes_t * tmDigAdec_Error_t * tmDigVdec_CompressionStandard_t * tmDigVdec_Error_t * tmDigVdec_Level_t * tmDigVdec_Profile_t * tmImageDec_Buffer_t * tmImageDec2_ImageArea_t * tmImageDec2_ImageFormat_t * tmImageDec2_ImageFormats_t * tmImageDec2_Orientation_t * tmImageDec2_RotationMode_t * tmImageDec2_RotationModes_t * tmImageDec2_Status_t * tmPixFmtCls_t * tmPixFmtClsSet_t * tmPixFmtType_t * tmPixFmtTypeSet_t * tmUrlSrc_BufferingState_t * tmUrlSrc_NotAccessibleCause_t * tmUrlSrc_Rounding_t * tmUrlSrc_Schemes_t * tmUrlSrc_SeekMode_t * tmUrlSrc_StepModes_t */ #include "./type/infraglobals.dd" #include "./type/DPlfApiCmDmx.dd" #include "./type/DPlfApiImageDec.dd" #include "./type/DPlfApiUrlSrc.dd" #include "./type/DPlfApiAudioClip.dd" #include "./type/DPlfApiVideoClip.dd" #include "./type/DPlfApiMediaDetect.dd" #endif /* _PLFAPICONN_TYPES_H_ */
//MIT License // //Copyright (c) 2019 Mindaugas Vinkelis // //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 BITSERY_EXT_STD_VARIANT_H #define BITSERY_EXT_STD_VARIANT_H #include "utils/composite_type_overloads.h" #include "../traits/core/traits.h" #include <variant> namespace bitsery { namespace ext { template<typename ...Overloads> class StdVariant : public details::CompositeTypeOverloadsUtils<std::variant, Overloads...> { public: template<typename Ser, typename Fnc, typename ...Ts> void serialize(Ser& ser, const std::variant<Ts...>& obj, Fnc&&) const { auto index = obj.index(); assert(index != std::variant_npos); details::writeSize(ser.adapter(), index); this->execIndex(index, const_cast<std::variant<Ts...>&>(obj), [this, &ser](auto& data, auto index) { constexpr size_t Index = decltype(index)::value; this->serializeType(ser, std::get<Index>(data)); }); } template<typename Des, typename Fnc, typename ...Ts> void deserialize(Des& des, std::variant<Ts...>& obj, Fnc&&) const { size_t index{}; details::readSize(des.adapter(), index, sizeof...(Ts), std::integral_constant<bool, Des::TConfig::CheckDataErrors>{}); this->execIndex(index, obj, [this, &des](auto& data, auto index) { constexpr size_t Index = decltype(index)::value; using TElem = typename std::variant_alternative<Index, std::variant<Ts...>>::type; // Reinitializing nontrivial types may be expensive especially when they // reference heap data, so if `data` is already holding the requested // variant then we'll deserialize into the existing object if constexpr (!std::is_trivial_v<TElem>) { if (auto item = std::get_if<Index>(&data)) { this->serializeType(des, *item); return; } } TElem item = ::bitsery::Access::create<TElem>(); this->serializeType(des, item); data = std::variant<Ts...>(std::in_place_index_t<Index>{}, std::move(item)); }); } }; // deduction guide template<typename ...Overloads> StdVariant(Overloads...) -> StdVariant<Overloads...>; } //defines empty fuction, that handles monostate template <typename S> void serialize(S& , std::monostate&) {} namespace traits { template<typename Variant, typename ... Overloads> struct ExtensionTraits<ext::StdVariant<Overloads...>, Variant> { static_assert(bitsery::details::IsSpecializationOf<Variant, std::variant>::value, "StdVariant only works with std::variant"); using TValue = void; static constexpr bool SupportValueOverload = false; static constexpr bool SupportObjectOverload = true; static constexpr bool SupportLambdaOverload = false; }; } } #endif //BITSERY_EXT_STD_VARIANT_H
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "CDStructures.h" #import <IDEFoundation/IDEArchivedContent.h> @class DVTFilePath; @interface IDEArchivedInAppContent : IDEArchivedContent { } + (id)keyPathsForValuesAffectingInAppContentPath; + (id)archivedContentPathPlistKey; + (id)archivedContentPropertiesPlistKey; + (BOOL)fillInfoDictionary:(id)arg1 forContentAtPath:(id)arg2 inArchiveProductsDirectory:(id)arg3; + (id)soleArchivedContentRelativePathInDirectory:(id)arg1; - (long long)autodetectedFormatForPackaging; - (BOOL)supportsPackagingAsFormat:(long long)arg1; - (id)packager; - (id)teamIdentifier; @property(readonly) DVTFilePath *inAppContentPath; @end
/* ** functions.c for functions.c in /home/kiwi/CPool_evalexpr ** ** Made by Lyes Kaïdi ** Login <kiwi@epitech.net> ** ** Started on Fri Oct 28 17:44:44 2016 Lyes Kaïdi ** Last update Fri Oct 28 17:47:02 2016 Lyes Kaïdi */ #include "./include/calc.h" #include "./include/my_functs.h" int next_token_index = 0; int term_helper(int factor_1, char **tokens, int factor_2, char *next_token) { int term; term = factor_1; while (next_token != NULL && (*next_token == '*' || *next_token == '/' || *next_token == '%')) { next_token_index = next_token_index + 1; factor_2 = factor(tokens); if (*next_token == '*') term = factor_1 * factor_2; else if (*next_token == '/') term = factor_1 / factor_2; else term = factor_1 % factor_2; factor_1 = term; next_token = tokens[next_token_index]; } return term; } char *ope_finder(char *token, int i, char c, char *str) { if (*str == '\0') token[i] = '\0'; else { while (*str == ' ') (str)++; if (*str == '+' || *str == '-' || *str == '*' || *str == '/' || *str == '%' || *str == '(' || *str == ')') { token[i] = *str; token[i + 1] = '\0'; } else { c = *str; while (c >= '0' && c <= '9') { token[i++] = c; (str)++; c = *str; } token[i] = '\0'; } } return (token); } int eval_expr(char *str) { int value; char **tokens = all_tokens(str); value = expr(tokens); while (*tokens != NULL) { free(*tokens); tokens++; } return value; } int expr(char **tokens) { int term_1; int value; int term_2; char *next_token; term_1 = term(tokens); value = term_1; next_token = tokens[next_token_index]; while (next_token != NULL && (*next_token == '+' || *next_token == '-')) { next_token_index = next_token_index + 1; term_2 = term(tokens); if (*next_token == '+') { value = term_1 + term_2; term_1 = value; } else { value = term_1 - term_2; term_1 = value; } next_token = tokens[next_token_index]; } return value; }
#pragma once #ifdef SWIGJAVA class IsrCallback { public: virtual ~IsrCallback() { } virtual void run() { /* empty, overloaded in Java*/ } private: }; static void generic_callback_isr (void* data) { IsrCallback* callback = (IsrCallback*) data; callback->run(); } #endif
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2012 Torus Knot Software Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- */ #ifndef __D3D9MULTIRENDERTARGET_H__ #define __D3D9MULTIRENDERTARGET_H__ #include "OgreD3D9Prerequisites.h" #include "OgreTexture.h" #include "OgreRenderTexture.h" #include "OgreImage.h" #include "OgreException.h" #include "OgreD3D9HardwarePixelBuffer.h" namespace Ogre { class _OgreD3D9Export D3D9MultiRenderTarget : public MultiRenderTarget { public: D3D9MultiRenderTarget(const String &name); ~D3D9MultiRenderTarget(); virtual void update(bool swapBuffers); virtual void getCustomAttribute( const String& name, void *pData ); bool requiresTextureFlipping() const { return false; } private: D3D9HardwarePixelBuffer *mRenderTargets[OGRE_MAX_MULTIPLE_RENDER_TARGETS]; virtual void bindSurfaceImpl(size_t attachment, RenderTexture *target); virtual void unbindSurfaceImpl(size_t attachment); /** Check surfaces and update RenderTarget extent */ void checkAndUpdate(); }; }; #endif
// // SamplePanelView.h // SampleApp // // Created by honcheng on 11/27/10. // Copyright 2010 honcheng. All rights reserved. // #import <UIKit/UIKit.h> #import "PanelView.h" @interface SamplePanelView : PanelView @end
#ifndef CPU_H #define CPU_H #include "Type.h" #include "memory.h" #include "stages.h" class cpu_core { public: cpu_core(); ~cpu_core(); void run(); word PC = 0; memory mem; word reg[32]; IFS ifs; IDS ids; EXS exs; MYS mys; WBS wbs; }; #endif /* CPU_H */
// Copyright 2017 jem@seethis.link // Licensed under the MIT license (http://opensource.org/licenses/MIT) #include "key_handlers/key_normal.h" #include "core/matrix_interpret.h" #include "hid_reports/keyboard_report.h" /* TODO: fn keycode */ bit_t is_layer_keycode(keycode_t keycode) { return ( keycode >= KC_L0 && keycode <= KC_STICKY_RGUI ); } void handle_layer_keycode(keycode_t keycode, key_event_t event) REENT { /* TODO: change how layer changing is handled */ if (keycode <= KC_L15) { // KC_LXX if (event == EVENT_PRESSED) { layer_queue_add(keycode - KC_L0); } else if (event == EVENT_RELEASED) { layer_queue_del(keycode - KC_L0); } } else if (keycode <= KC_SET_L15) { if (event == EVENT_PRESSED) { layer_queue_set(keycode - KC_SET_L0); } else { // do nothing } } else if (keycode <= KC_TOGGLE_L15) { if (event == EVENT_PRESSED) { layer_queue_toggle(keycode - KC_TOGGLE_L0); } else { // do nothing } } else if (keycode <= KC_STICKY_L15) { if (event == EVENT_PRESSED) { layer_queue_add(keycode - KC_STICKY_L0); layer_queue_sticky(keycode - KC_STICKY_L0); } else if (event == EVENT_RELEASED) { layer_queue_del(keycode - KC_STICKY_L0); } } else if (keycode <= KC_STICKY_RGUI) { if (event == EVENT_PRESSED) { uint8_t mod_mask = (1 << (keycode - KC_STICKY_LCTRL)); add_pure_mods(mod_mask); add_sticky_mods(mod_mask); } else if (event == EVENT_RELEASED) { uint8_t mod_mask = (1 << (keycode - KC_STICKY_LCTRL)); del_pure_mods(mod_mask); } } } XRAM keycode_callbacks_t layer_keycodes = { .checker = is_layer_keycode, .handler = handle_layer_keycode, .active_when_disabled = true, .preserves_sticky_keys = true, }; bit_t is_modkey_keycode(keycode_t keycode) { return IS_MODKEY(keycode); } void handle_modkey_keycode(keycode_t keycode, key_event_t event) REENT { const uint8_t kc = ((uint8_t*)&keycode)[0]; const uint8_t mod_tag = ((uint8_t*)&keycode)[1]; const uint8_t mods = MODKEY_TAG_TO_MASK(mod_tag); // const uint8_t is_forced = MODKEY_TAG_IS_FORCED(mod_tag); if (event == EVENT_PRESSED) { // TODO: decide about how to handle modkeys, how they are now seems // to be okay for the majority of cases // option 1: forced doesn't overide sticky mods // if (is_forced && !has_pure_mods() && !get_sticky_mods()) { // option 2: forced overides sticky mods // if (is_forced && !has_pure_mods()) { if (kc == 0) { add_pure_mods(mods); } else { if ( get_mods() != mods && !has_pure_mods() && !get_sticky_mods() // && !is_forced ) { // The modkey is adding or deleting mods and it's trying to // trigger a kc as well. We delete any modifiers that other // modkeys may have pressed, and release the keycode if // it is already done, and repress it. // // For example, if the user tries to type the sequence `(0)` // the user will need to press these modkeys: // // * shift-9 // * 0 // * shift-0 // // So if the user pressed this modkey sequence without // releasing the keys, then the output would be `()`, // so we reset the "fake modifiers" for modkeys on each // press, and retrigger the keycode incase the code is // already done. reset_mods(); add_fake_mods(mods); retrigger_keycode(kc); return; } add_fake_mods(mods); add_keycode(kc); } } else if (event == EVENT_RELEASED) { if (kc == 0) { del_pure_mods(mods); } else { del_fake_mods(mods); del_keycode(kc); } } } XRAM keycode_callbacks_t modkey_keycodes = { .checker = is_modkey_keycode, .handler = handle_modkey_keycode, };
#include <Python.h> #include <stdio.h> #include <complex.h> #include "julia.c" static PyObject *_julia_Julia(PyObject *self, PyObject *args){ double min_r, max_r, min_i, max_i, resolution; Py_complex z; double complex Z; if(!PyArg_ParseTuple(args, "ddddDd", &min_r, &max_r, &min_i, &max_i, &z, &resolution)){ return NULL; } Z = z.real + z.imag * I; double complex *grid; int number_of_elements_in_grid; int *divergence_scores; number_of_elements_in_grid = ( max_r - min_r + resolution) * ( max_i - min_i + resolution) / ( resolution * resolution ); grid = initialize_grid(min_r, max_r, min_i, max_i, resolution, number_of_elements_in_grid); divergence_scores = score_grid(grid, number_of_elements_in_grid, Z); PyObject* result; result = PyDict_New(); for (int i=0; i<number_of_elements_in_grid; i++){ Py_complex element; element.real = creal(grid[i]); element.imag = cimag(grid[i]); PyObject* ELEMENT; ELEMENT = PyComplex_FromCComplex(element); PyObject* SCORE; SCORE = PyInt_FromLong(divergence_scores[i]); PyDict_SetItem(result, ELEMENT, SCORE); } return result; } static PyMethodDef _julia_methods[] = { { "Julia", (PyCFunction)_julia_Julia, METH_NOARGS, NULL }, { "Julia", _julia_Julia, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; PyMODINIT_FUNC init_julia(void){ Py_InitModule3("_julia", _julia_methods, "C extension for Julia Set generation utility"); }
#ifndef DEF_DOMAIN #define DEF_DOMAIN #include <iostream> #include <list> #include <set> using namespace std; class Domain { public: Domain(); Domain(int newn); void afficher(); bool isEmpty(); int smallestDom(); list<int> * getLDomain(); void setLDomain(list<int> s, int i); list<int> *LDomain; private: int n; }; #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double Pods_VIPER_ExampleTestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_VIPER_ExampleTestsVersionString[];
// // DZResponse.h // DZNetworking // // Created by Nikhil Nigade on 7/28/15. // Copyright (c) 2015 Dezine Zync Studios LLP. All rights reserved. // #import <Foundation/Foundation.h> @interface DZResponse : NSObject @property (nonatomic, copy, readonly) id responseObject; @property (nonatomic, copy, readonly) NSHTTPURLResponse *response; @property (nonatomic, copy, readonly) NSURLSessionTask *task; - (instancetype)initWithData:(id)responseObject :(NSHTTPURLResponse *)response :(NSURLSessionTask *)task; @end
// // TLConversationCell.h // TLChat // // Created by 李伯坤 on 16/1/23. // Copyright © 2016年 李伯坤. All rights reserved. #import <UIKit/UIKit.h> #import "TLConversation.h" #define HEIGHT_CONVERSATION_CELL 64.0f typedef NS_ENUM(NSInteger, TLConversationCellSeperatorStyle) { TLConversationCellSeperatorStyleDefault, TLConversationCellSeperatorStyleFill, }; @interface TLConversationCell : UITableViewCell <ZZFlexibleLayoutViewProtocol> /// 会话Model @property (nonatomic, strong) TLConversation *conversation; @property (nonatomic, assign) TLConversationCellSeperatorStyle bottomSeperatorStyle; /** * 标记为未读 */ - (void)markAsUnread; /** * 标记为已读 */ - (void)markAsRead; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/TSCH3DSceneRenderSetup.h> // Not exported @interface TSCH3DSceneRenderCameraSetup : TSCH3DSceneRenderSetup { } + (id)allocWithZone:(struct _NSZone *)arg1; + (id)setup; + (id)_singletonAlloc; - (void)setupPipeline:(id)arg1 fromCamera:(id)arg2; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)autorelease; - (oneway void)release; - (unsigned long long)retainCount; - (id)retain; @end
// // PriceFormatter.h // eBayDemoApp // // Created by bulldog on 13-3-24. // Copyright (c) 2013 Leansoft. All rights reserved. // @interface PriceUtil : NSObject /// Converts given convertedCurrentPrice attributes to a string + (NSString *)stringFromConvertedCurrentPrice:(NSNumber *)value currency:(NSString *)currencyID; /// Converts given attributes to a string + (NSString *)stringFromValue:(NSNumber *)value currency:(NSString *)currencyID; @end
// // DTAccount.h // DefenseOfTheAncients // // Created by Mr.Yao on 16/3/16. // Copyright © 2016年 Mr.Yao. All rights reserved. // #import <Foundation/Foundation.h> @interface DTAccount : NSObject @property (nonatomic, strong) NSNumber *uid; @property (nonatomic, strong) NSString *token; + (instancetype)sharedAccount; + (BOOL)isLogined; - (BOOL)isLogined; - (void)logout; @end
/* CDVAdMobAdsAdListener.h Copyright 2015 AppFeel. All rights reserved. http://www.appfeel.com AdMobAds Cordova Plugin (cordova-admob) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <Foundation/Foundation.h> #import "CDVAdMobAds.h" #import <GoogleMobileAds/GADBannerViewDelegate.h> #import <GoogleMobileAds/GADInterstitialDelegate.h> #import <GoogleMobileAds/GADExtras.h> @class CDVAdMobAds; @interface CDVAdMobAdsAdListener : NSObject <GADBannerViewDelegate, GADInterstitialDelegate> { } @property (nonatomic, retain) CDVAdMobAds *adMobAds; - (instancetype)initWithAdMobAds: (CDVAdMobAds *)originalAdMobAds ; - (void)adViewDidFailedToShow:(GADBannerView *)view; - (void)interstitialDidFailedToShow:(GADInterstitial *) interstitial; @end
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12). // // Copyright (C) 1997-2019 Steve Nygard. // #import <IDEFoundation/IDEContainer.h> #import <IDEKit/IDEKeyDrivenNavigableItemRepresentedObject-Protocol.h> @class DVTDocumentLocation, DVTFileDataType, DVTSymbol, IDEContainerItem, IDEFileReference, NSArray, NSImage, NSNull, NSString, NSURL; @interface IDEContainer (PasteboardSupport) <IDEKeyDrivenNavigableItemRepresentedObject> - (id)containerItemFromPlistRepresentation:(id)arg1; - (id)containerItemFromNameAndIndexPath:(id)arg1 rootGroup:(id)arg2; - (id)plistRepresentationForContainerItem:(id)arg1; - (id)pathToContainerItem:(id)arg1; @property(readonly, nonatomic) NSString *navigableItem_name; @property(readonly) BOOL ide_shouldSupressNavigation; - (id)ide_defaultNewFileTemplate; - (id)ide_defaultNewFileTemplateForPath:(id)arg1; - (id)ide_templateForName:(id)arg1 andCategory:(id)arg2; @property(readonly) NSString *ideInspectedReferencedRelativeLocationContainingFolderPlaceholder; @property(readonly) NSString *ideInspectedReferencedRelativeLocationPlaceholder; @property(readonly) NSString *ideInspectedReferenceMessageForChoosingRelativeLocation; @property(readonly) BOOL ideInspectedReferenceRelativeLocationShouldChooseFile; @property(readonly) BOOL ideInspectedReferenceShowsFileTypePopUp; @property(readonly) BOOL ideInspectedIsReferenceNameEditable; @property(readonly) IDEContainerItem *explorableItemForNavigation; @property(readonly) NSString *explorableName; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly, nonatomic) NSString *navigableItem_accessibilityIdentifier; @property(readonly, nonatomic) NSString *navigableItem_accessibleImageDescription; @property(readonly, nonatomic) NSArray *navigableItem_additionalFilterMatchingText; @property(readonly, nonatomic) NSArray *navigableItem_childRepresentedObjects; @property(readonly, nonatomic) DVTDocumentLocation *navigableItem_contentDocumentLocation; @property(readonly, nonatomic) DVTFileDataType *navigableItem_documentType; @property(readonly, nonatomic) IDEFileReference *navigableItem_fileReference; @property(readonly, nonatomic) NSNull *navigableItem_filtered; @property(readonly, nonatomic) NSString *navigableItem_groupIdentifier; @property(readonly, nonatomic) NSImage *navigableItem_image; @property(readonly, nonatomic) BOOL navigableItem_isEnabled; @property(readonly, nonatomic) BOOL navigableItem_isLeaf; @property(readonly, nonatomic) BOOL navigableItem_isMajorGroup; @property(readonly, nonatomic) BOOL navigableItem_isVisible; @property(readonly, nonatomic) BOOL navigableItem_missingReferencedContentIsImportant; @property(readonly, nonatomic) id navigableItem_parentRepresentedObject; @property(readonly, nonatomic) BOOL navigableItem_referencedContentExists; @property(readonly, nonatomic) DVTSymbol *navigableItem_representedSymbol; @property(readonly, nonatomic) NSURL *navigableItem_representedURL; @property(readonly, nonatomic) NSString *navigableItem_subtitle; @property(readonly, nonatomic) NSString *navigableItem_toolTip; @property(readonly) Class superclass; @end
//===========source description ================================= //http://we.easyelectronics.ru/STM32/stm32---bit-banding.html //=============================================================== #ifndef BITBANDING_H #define BITBANDING_H #define MASK_TO_BIT31(A) (A==0x80000000)? 31 : 0 #define MASK_TO_BIT30(A) (A==0x40000000)? 30 : MASK_TO_BIT31(A) #define MASK_TO_BIT29(A) (A==0x20000000)? 29 : MASK_TO_BIT30(A) #define MASK_TO_BIT28(A) (A==0x10000000)? 28 : MASK_TO_BIT29(A) #define MASK_TO_BIT27(A) (A==0x08000000)? 27 : MASK_TO_BIT28(A) #define MASK_TO_BIT26(A) (A==0x04000000)? 26 : MASK_TO_BIT27(A) #define MASK_TO_BIT25(A) (A==0x02000000)? 25 : MASK_TO_BIT26(A) #define MASK_TO_BIT24(A) (A==0x01000000)? 24 : MASK_TO_BIT25(A) #define MASK_TO_BIT23(A) (A==0x00800000)? 23 : MASK_TO_BIT24(A) #define MASK_TO_BIT22(A) (A==0x00400000)? 22 : MASK_TO_BIT23(A) #define MASK_TO_BIT21(A) (A==0x00200000)? 21 : MASK_TO_BIT22(A) #define MASK_TO_BIT20(A) (A==0x00100000)? 20 : MASK_TO_BIT21(A) #define MASK_TO_BIT19(A) (A==0x00080000)? 19 : MASK_TO_BIT20(A) #define MASK_TO_BIT18(A) (A==0x00040000)? 18 : MASK_TO_BIT19(A) #define MASK_TO_BIT17(A) (A==0x00020000)? 17 : MASK_TO_BIT18(A) #define MASK_TO_BIT16(A) (A==0x00010000)? 16 : MASK_TO_BIT17(A) #define MASK_TO_BIT15(A) (A==0x00008000)? 15 : MASK_TO_BIT16(A) #define MASK_TO_BIT14(A) (A==0x00004000)? 14 : MASK_TO_BIT15(A) #define MASK_TO_BIT13(A) (A==0x00002000)? 13 : MASK_TO_BIT14(A) #define MASK_TO_BIT12(A) (A==0x00001000)? 12 : MASK_TO_BIT13(A) #define MASK_TO_BIT11(A) (A==0x00000800)? 11 : MASK_TO_BIT12(A) #define MASK_TO_BIT10(A) (A==0x00000400)? 10 : MASK_TO_BIT11(A) #define MASK_TO_BIT09(A) (A==0x00000200)? 9 : MASK_TO_BIT10(A) #define MASK_TO_BIT08(A) (A==0x00000100)? 8 : MASK_TO_BIT09(A) #define MASK_TO_BIT07(A) (A==0x00000080)? 7 : MASK_TO_BIT08(A) #define MASK_TO_BIT06(A) (A==0x00000040)? 6 : MASK_TO_BIT07(A) #define MASK_TO_BIT05(A) (A==0x00000020)? 5 : MASK_TO_BIT06(A) #define MASK_TO_BIT04(A) (A==0x00000010)? 4 : MASK_TO_BIT05(A) #define MASK_TO_BIT03(A) (A==0x00000008)? 3 : MASK_TO_BIT04(A) #define MASK_TO_BIT02(A) (A==0x00000004)? 2 : MASK_TO_BIT03(A) #define MASK_TO_BIT01(A) (A==0x00000002)? 1 : MASK_TO_BIT02(A) #define MASK_TO_BIT(A) (A==0x00000001)? 0 : MASK_TO_BIT01(A) #ifndef SET #define SET 1 #define RESET 0 #endif #define BIT_BAND_PER(REG,BIT_MASK) (*(volatile uint32_t*)(PERIPH_BB_BASE+32*((uint32_t)(&(REG))-PERIPH_BASE)+4*((uint32_t)(MASK_TO_BIT(BIT_MASK))))) #define BIT_BAND_SRAM(RAM,BIT) (*(volatile uint32_t*)(SRAM_BB_BASE+32*((uint32_t)((void*)(RAM))-SRAM_BASE)+4*((uint32_t)(BIT)))) //Example: BIT_BAND_PER(TIM1->SR, TIM_SR_UIF) = 0; //сбросить бит TIM_SR_UIF в TIM1->SR //Example2: BIT_BAND_SRAM(&a, 13) = 1; //установить 13-й бит в переменной "a" //Example3: BIT_BAND_SRAM(&a, 13) ^= 1; //инвертировать 13-й бит в "a", не задевая другие биты переменной (псевдо-атомарность) #endif
// // PDFKitten.h // PDFKitten // // Created by Nickolay Tarbayev on 17.04.14. // Copyright (c) 2014 Chalmers Göteborg. All rights reserved. // #import <PDFKitten/PDFKPageScanner.h> #import <PDFKitten/PDFKSelection.h>
/* * zipl - zSeries Initial Program Loader tool * * Mini libc implementation * * Copyright IBM Corp. 2013, 2017 * * s390-tools is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See LICENSE for details. */ #ifndef LIBC_H #define LIBC_H #include <stdint.h> #include <stddef.h> #include "lib/zt_common.h" #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #define ENOTBLK 15 /* Block device required */ #define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* File table overflow */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Not a typewriter */ #define MIB (1024ULL * 1024) #define LINE_LENGTH 80 /* max line length printed by printf */ void printf(const char *, ...); void snprintf(char *buf, unsigned long size, const char *fmt, ...); void *memcpy(void *, const void *, unsigned long); void *memmove(void *, const void *, unsigned long); void *memset(void *, int c, unsigned long); char *strcat(char *, const char *); int strncmp(const char *, const char *, unsigned long); int strlen(const char *); char *strcpy(char *, const char *); unsigned long get_zeroed_page(void); void free_page(unsigned long); void initialize(void); void libc_stop(unsigned long) __noreturn; void start(void); void pgm_check_handler(void); void pgm_check_handler_fn(void); void panic_notify(unsigned long reason); #define panic(reason, ...) \ do { \ printf(__VA_ARGS__); \ panic_notify(reason); \ libc_stop(reason); \ } while (0) static inline int isdigit(int c) { return (c >= '0') && (c <= '9'); } static inline int isspace(char c) { return (c == 32) || (c >= 9 && c <= 13); } #endif /* LIBC_H */
/* This file is part of TableGUI. Copyright (c) 2014 Felipe Ferreira da Silva TableGUI is licensed under MIT license. See the file "LICENSE" for license details. */ TGUIWidget *GUI_Alloc_Label(TGUIWindow *AWindow, TGUIWidget *AWidget);
/* * Copyright (C) 2015-2018 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup boards_stk3600 * @{ * * @file * @brief Configuration of CPU peripherals for the STK3600 starter kit * * @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @author Bas Stottelaar <basstottelaar@gmail.com> */ #ifndef PERIPH_CONF_H #define PERIPH_CONF_H #include "cpu.h" #include "periph_cpu.h" #include "em_cmu.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Internal macro to calculate *_NUMOF based on config. */ #define PERIPH_NUMOF(config) (sizeof(config) / sizeof(config[0])) /** * @name Clock configuration * @{ */ #ifndef CLOCK_HF #define CLOCK_HF cmuSelect_HFXO #endif #ifndef CLOCK_CORE_DIV #define CLOCK_CORE_DIV cmuClkDiv_1 #endif #ifndef CLOCK_LFA #define CLOCK_LFA cmuSelect_LFXO #endif #ifndef CLOCK_LFB #define CLOCK_LFB cmuSelect_LFXO #endif /** @} */ /** * @name ADC configuration * @{ */ static const adc_conf_t adc_config[] = { { .dev = ADC0, .cmu = cmuClock_ADC0, } }; static const adc_chan_conf_t adc_channel_config[] = { { .dev = 0, .input = adcSingleInputTemp, .reference = adcRef1V25, .acq_time = adcAcqTime8 }, { .dev = 0, .input = adcSingleInputVDDDiv3, .reference = adcRef1V25, .acq_time = adcAcqTime8 } }; #define ADC_DEV_NUMOF PERIPH_NUMOF(adc_config) #define ADC_NUMOF PERIPH_NUMOF(adc_channel_config) /** @} */ /** * @name DAC configuration * @{ */ static const dac_conf_t dac_config[] = { { .dev = DAC0, .cmu = cmuClock_DAC0, } }; static const dac_chan_conf_t dac_channel_config[] = { { .dev = 0, .index = 1, .ref = dacRefVDD, } }; #define DAC_DEV_NUMOF PERIPH_NUMOF(dac_config) #define DAC_NUMOF PERIPH_NUMOF(dac_channel_config) /** @} */ /** * @name I2C configuration * @{ */ static const i2c_conf_t i2c_config[] = { { .dev = I2C0, .sda_pin = GPIO_PIN(PD, 6), .scl_pin = GPIO_PIN(PD, 7), .loc = I2C_ROUTE_LOCATION_LOC1, .cmu = cmuClock_I2C0, .irq = I2C0_IRQn }, { .dev = I2C1, .sda_pin = GPIO_PIN(PC, 4), .scl_pin = GPIO_PIN(PC, 5), .loc = I2C_ROUTE_LOCATION_LOC0, .cmu = cmuClock_I2C1, .irq = I2C1_IRQn } }; #define I2C_NUMOF PERIPH_NUMOF(i2c_config) #define I2C_0_ISR isr_i2c0 #define I2C_1_ISR isr_i2c1 /** @} */ /** * @name PWM configuration * @{ */ static const pwm_chan_conf_t pwm_channel_config[] = { { .index = 2, .pin = GPIO_PIN(PE, 2), .loc = TIMER_ROUTE_LOCATION_LOC1 } }; static const pwm_conf_t pwm_config[] = { { .dev = TIMER3, .cmu = cmuClock_TIMER3, .irq = TIMER3_IRQn, .channels = 1, .channel = pwm_channel_config } }; #define PWM_DEV_NUMOF PERIPH_NUMOF(pwm_config) #define PWM_NUMOF PERIPH_NUMOF(pwm_channel_config) /** @} */ /** * @brief RTC configuration */ #define RTC_NUMOF (1U) /** * @name RTT configuration * @{ */ #define RTT_NUMOF (1U) #define RTT_MAX_VALUE (0xFFFFFF) #define RTT_FREQUENCY (1U) /** @} */ /** * @name SPI configuration * @{ */ static const spi_dev_t spi_config[] = { { .dev = USART1, .mosi_pin = GPIO_PIN(PD, 0), .miso_pin = GPIO_PIN(PD, 1), .clk_pin = GPIO_PIN(PD, 2), .loc = USART_ROUTE_LOCATION_LOC1, .cmu = cmuClock_USART1, .irq = USART1_RX_IRQn }, { .dev = USART2, .mosi_pin = GPIO_UNDEF, .miso_pin = GPIO_PIN(PC, 3), .clk_pin = GPIO_PIN(PC, 4), .loc = USART_ROUTE_LOCATION_LOC0, .cmu = cmuClock_USART2, .irq = USART2_RX_IRQn } }; #define SPI_NUMOF PERIPH_NUMOF(spi_config) /** @} */ /** * @name Timer configuration * * The implementation uses two timers in cascade mode. * @{ */ static const timer_conf_t timer_config[] = { { { .dev = TIMER0, .cmu = cmuClock_TIMER0 }, { .dev = TIMER1, .cmu = cmuClock_TIMER1 }, .irq = TIMER1_IRQn } }; #define TIMER_NUMOF PERIPH_NUMOF(timer_config) #define TIMER_0_ISR isr_timer1 /** @} */ /** * @name UART configuration * @{ */ static const uart_conf_t uart_config[] = { { .dev = UART0, .rx_pin = GPIO_PIN(PE, 1), .tx_pin = GPIO_PIN(PE, 0), .loc = UART_ROUTE_LOCATION_LOC1, .cmu = cmuClock_UART0, .irq = UART0_RX_IRQn }, { .dev = USART1, .rx_pin = GPIO_PIN(PD, 1), .tx_pin = GPIO_PIN(PD, 0), .loc = USART_ROUTE_LOCATION_LOC1, .cmu = cmuClock_USART1, .irq = USART1_RX_IRQn }, { .dev = LEUART0, .rx_pin = GPIO_PIN(PD, 5), .tx_pin = GPIO_PIN(PD, 4), .loc = LEUART_ROUTE_LOCATION_LOC0, .cmu = cmuClock_LEUART0, .irq = LEUART0_IRQn } }; #define UART_NUMOF PERIPH_NUMOF(uart_config) #define UART_0_ISR_RX isr_uart0_rx #define UART_1_ISR_RX isr_usart1_rx #define UART_2_ISR_RX isr_leuart0 /** @} */ #ifdef __cplusplus } #endif #endif /* PERIPH_CONF_H */ /** @} */
// // ViewController.h // DRImagePlacerholerHelperExample // // Created by Albert on 11.08.13. // Copyright (c) 2013 Albert Schulz. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController { IBOutlet UIImageView *imageView1; IBOutlet UIImageView *imageView2; IBOutlet UIImageView *imageView3; IBOutlet UIImageView *imageView4; } @end
#ifndef _SPACEWAR_H #define _SPACEWAR_H #define WIN32_LEAN_AND_MEAN #include "game.h" class Spacewar : public Game { private: public: // Constructor Spacewar(); //Destructor virtual ~Spacewar(); // Initialize the game void initialize(HWND hwnd); void update(); // Pure virtual functions from Game must be overwritten void ai(); // " void collisions(); // " void render(); // " void releaseAll(); void resetAll(); }; #endif
/* ** my_isneg.c for my_isneg in /home/soto_a/rendu/Piscine_C_J03 ** ** Made by adam kaso ** Login <soto_a@epitech.net> ** ** Started on Wed Oct 1 13:22:15 2014 adam kaso ** Last update Fri Dec 5 14:48:05 2014 Kaso Soto */ #include "my.h" int my_isneg(int n) { if (n >= 0) { my_putchar('P'); } else { my_putchar('N'); } return (0); }
/* * Copyright (c) 2017 Jason Waataja * * 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 DEPENDENCY_EDITOR_H #define DEPENDENCY_EDITOR_H #include "config.h" #include <gtkmm.h> #include "dependencyaction.h" namespace dfm { class DependencyEditor : public Gtk::Dialog { public: DependencyEditor(Gtk::Window& parent, DependencyAction* action); private: DependencyAction* action; Gtk::Label dependenciesLabel; Gtk::ScrolledWindow scrolledWindow; Gtk::TextView dependenciesView; Glib::RefPtr<Gtk::TextBuffer> dependenciesBuffer; void onResponse(int responseId); }; } /* namespace dfm */ #endif /* DEPENDENCY_EDITOR_H */
#include "../../src/scene_graph/pnodefactory.h"
/* * * 20150315-4.c * * * Created by Sam Niemoeller on 3/28/15. * * Chapter 4, Problem 30 * * Write a program that generates a random number * from the following set: 1, 4, 7, 10, 13, 16 * The seed for the series is the computer's time. * */ #include <stdio.h> #include <stdlib.h> #include <time.h> int main () { // Local Definitions int rand1; // Statements printf ("\nBeginning Random Number generation from the set 1, 4, 7, 10, 13, 16....\n\n"); srand (time(NULL)); rand1 = rand (); rand1 = ((rand1 % 6) * 3) + 1; printf ("Random Number is: %d\n\n", rand1); return 0; }
/* main.c */ #define F_CPU 8000000 #include <stdio.h> #include <string.h> #include <util/delay.h> #include <avr/interrupt.h> #include <avr/io.h> #include "../lib/ring_buffer.h" #include "../lib/serial.h" /* Basic test of interrupt based serial functionality */ int main(void) { uart_init(); sei(); char buff[64]; // Test that push string, and tx_wait work sprintf(buff, "Testing push_string with uart_tx_wait\n\r"); rb_push_string(uart_tx_buffer, buff); uart_tx_wait(); memset(buff, 0, 64); // Test that push string stops at \0 sprintf(buff, "Testing push_string, Validate: Test == Test?123"); buff[43] = 0; rb_push_string(uart_tx_buffer, buff); uart_tx_wait(); memset(buff, 0, 64); // Test push array sprintf(buff, "\n\rTesting push_array, Validate: Test == Test\n\r"); rb_push_array(uart_tx_buffer, buff, 47); uart_tx_wait(); memset(buff, 0, 64); // Test that push string, and tx_wait work sprintf(buff, "Testing interrupt based uart_tx\n\r"); rb_push_string(uart_tx_buffer, buff); uart_tx(); _delay_ms(1000); return 0; }
/** * @file msg_io.h * @brief The header file for msg_io.c. * @author Yiwei Chiao (ywchiao@gmail.com) * @date 06/01/2017 created. * @date 06/15/2017 last modified. * @version 0.1.0 * @copyright MIT, (C) 2017 Yiwei Chiao * @details * * The header file for msg_io.c. */ #ifndef __MSG_IO_H__ #define __MSG_IO_H__ #include "msg.h" int msg_input(int, struct msg *); int msg_output(int); void msg_push(struct msg *); #endif // msg_io.h
/* * 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 NSString; @interface AXEventListenerContainer : NSObject { id handler; NSString *identifier; } @property(retain, nonatomic) NSString *identifier; // @synthesize identifier; @property(copy, nonatomic) id handler; // @synthesize handler; @end
// // KPHRequest.h // KeePassHttp-ObjC // // Created by James Hurst on 2014-09-21. // Copyright (c) 2014 James Hurst. All rights reserved. // #import <Foundation/Foundation.h> #import "JSONModel.h" static NSString *const kKPHRequestGetLogins = @"get-logins"; static NSString *const kKPHRequestGetLoginsCount = @"get-logins-count"; static NSString *const kKPHRequestGetAllLogins = @"get-all-logins"; static NSString *const kKPHRequestSetLogin = @"set-login"; static NSString *const kKPHRequestAssociate = @"associate"; static NSString *const kKPHRequestTestAssociate = @"test-associate"; static NSString *const kKPHRequestGeneratePassword = @"generate-password"; @interface KPHRequest : JSONModel @property (nonatomic, strong) NSString *RequestType; /// Sort selection by best URL matching for given hosts @property (nonatomic, assign) BOOL SortSelection; /// Trigger unlock of database even if feature is disabled in KPH (because of user interaction to fill-in) @property (nonatomic, strong) NSString<Optional> *TriggerUnlock; /// Always encrypted, used with set-login, uuid is set /// if modifying an existing login @property (nonatomic, strong) NSString<Optional> *Login; @property (nonatomic, strong) NSString<Optional> *Password; @property (nonatomic, strong) NSString<Optional> *Uuid; /// Always encrypted, used with get and set-login @property (nonatomic, strong) NSString<Optional> *Url; /// Always encrypted, used with get-login @property (nonatomic, strong) NSString<Optional> *SubmitUrl; /// Send the AES key ID with the 'associate' request @property (nonatomic, strong) NSString<Optional> *Key; /// Always required, an identifier given by the KeePass user @property (nonatomic, strong) NSString<Optional> *Id; /// A value used to ensure that the correct key has been chosen, /// it is always the value of Nonce encrypted with Key @property (nonatomic, strong) NSString<Optional> *Verifier; /// Nonce value used in conjunction with all encrypted fields, /// randomly generated for each request @property (nonatomic, strong) NSString<Optional> *Nonce; /// Realm value used for filtering results. Always encrypted. @property (nonatomic, strong) NSString<Optional> *Realm; @end
/******************************************************************************* USART Peripheral Library Template Implementation File Name: usart_Receiver9Bits_Default.h Summary: USART PLIB Template Implementation Description: This header file contains template implementations For Feature : Receiver9Bits and its Variant : Default For following APIs : PLIB_USART_ExistsReceiver9Bits PLIB_USART_Receiver9BitsReceive *******************************************************************************/ //DOM-IGNORE-BEGIN /******************************************************************************* Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved. Microchip licenses to you the right to use, modify, copy and distribute Software only when embedded on a Microchip microcontroller or digital signal controller that is integrated into your product or third party product (pursuant to the sublicense terms in the accompanying license agreement). You should refer to the license agreement accompanying this Software for additional information regarding your rights and obligations. SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. *******************************************************************************/ //DOM-IGNORE-END #ifndef _USART_RECEIVER9BITS_DEFAULT_H #define _USART_RECEIVER9BITS_DEFAULT_H #include "usart_registers.h" //****************************************************************************** /* Function : USART_ExistsReceiver9Bits_Default Summary: Implements Default variant of PLIB_USART_ExistsReceiver9Bits Description: This template implements the Default variant of the PLIB_USART_ExistsReceiver9Bits function. */ #define PLIB_USART_ExistsReceiver9Bits PLIB_USART_ExistsReceiver9Bits PLIB_TEMPLATE bool USART_ExistsReceiver9Bits_Default( USART_MODULE_ID index ) { return true; } //****************************************************************************** /* Function : USART_Receiver9BitsReceive_Default Summary: Implements Default variant of PLIB_USART_Receiver9BitsReceive Description: This template implements the Default variant of the PLIB_USART_Receiver9BitsReceive function. */ PLIB_TEMPLATE int16_t USART_Receiver9BitsReceive_Default( USART_MODULE_ID index ) { usart_registers_t volatile * usart = ((usart_registers_t *)(index)); return (int16_t)usart->UxRXREG; } #endif /*_USART_RECEIVER9BITS_DEFAULT_H*/ /****************************************************************************** End of File */
//-*-c++-*- #pragma once namespace meson { // Header to ignore CORS. extern const char kCORSHeader[]; // Strings describing Chrome security policy for DevTools security panel. extern const char kSHA1Certificate[]; extern const char kSHA1MajorDescription[]; extern const char kSHA1MinorDescription[]; extern const char kCertificateError[]; extern const char kValidCertificate[]; extern const char kValidCertificateDescription[]; extern const char kSecureProtocol[]; extern const char kSecureProtocolDescription[]; }
#pragma once // Qt. #include <QWidget> #include <QSize> // Forward declarations. class QVBoxLayout; class QAbstractButton; // Multi purpose view container to help with maximization, focus management, and titlebar support. class rgViewContainer : public QWidget { Q_OBJECT public: rgViewContainer(QWidget* pParent = nullptr); virtual ~rgViewContainer() = default; // Set if the container is able to be maximized within the parent splitter. void SetIsMaximizable(bool isEnabled); // Set main widget. void SetMainWidget(QWidget* pWidget); // Set title bar widget. void SetTitlebarWidget(QWidget* pWidget); // Get the title bar widget. QWidget* GetTitleBar(); // Set maximization state of the view. void SetMaximizedState(bool isMaximized); // Set hidden state of the view. void SetHiddenState(bool isHidden); // Returns true if this container is now in hidden state. bool IsInHiddenState() const; // Set focused state of the view. void SetFocusedState(bool isFocused); // Returns true if this container is now in maximized state. bool IsInMaximizedState() const; // Returns true if the container can be maximized within the parent splitter. bool IsMaximizable() const; // Returns the main widget inside the container. QWidget* GetMainWidget() const; // A handler to switch the size of the container. void SwitchContainerSize(); protected: void resizeEvent(QResizeEvent* pEvent) override; virtual QSize sizeHint() const override; virtual QSize minimumSizeHint() const override; virtual void enterEvent(QEvent* pEvent) override; virtual void leaveEvent(QEvent* pEvent) override; virtual void mouseDoubleClickEvent(QMouseEvent* pEvent) override; virtual void mousePressEvent(QMouseEvent* pEvent) override; private: // Refresh geometry of child widgets. void RefreshGeometry(); // Extract the titlebar from the main widget. void ExtractTitlebar(); // Extract the maximize button, either from the main widget or the titlebar. void ExtractMaximizeButton(); // Main widget. QWidget* m_pMainWidget = nullptr; // Titlebar widget. QWidget* m_pTitleBarWidget = nullptr; // Maximization button. QAbstractButton* m_pMaximizeButton = nullptr; // Whether the titlebar is embedded in the main widget. bool m_isEmbeddedTitlebar; // A flag to track whether this container is in maximized state or not. bool m_isInMaximizedState = false; // A flag used to determine if the container can be maximized. bool m_isMaximizable = true; // A flag used to determine if the container is hidden. bool m_isInHiddenState = false; // Action to handle Ctrl+R to switch the container size. QAction* m_pSwitchContainerSize = nullptr; signals: // Signal emitted when the maximize/minimize button is clicked. void MaximizeButtonClicked(); // Signal emitted when the user clicks on this view container. void ViewContainerMouseClickEventSignal(); };
// // Copyright (C) 2016, Vinodh Kumar M. <GreenHex@gmail.com> // // Weather icons from Forecast Font <http://forecastfont.iconvau.lt>. // #pragma once #include <pebble.h> #include "global.h" #include "pbl_64_hex_colours.h" #ifdef INCLUDE_WEATHER typedef struct { char glyph; uint32_t colour; } GLYPH; typedef struct { int num_glyphs; GLYPH *glyphs; } WEATHER_ICON; static const GLYPH g_mist = { 'I', PBL_IF_COLOR_ELSE( LightGray, White ) }; static const GLYPH g_sun = { 'T', PBL_IF_COLOR_ELSE( ChromeYellow, White ) }; static const GLYPH g_moon = { 'N', PBL_IF_COLOR_ELSE( White, White ) }; static const GLYPH g_wind = { 'V', PBL_IF_COLOR_ELSE( BabyBlueEyes, White ) }; static const GLYPH g_cloud = { 'G', PBL_IF_COLOR_ELSE( LightGray, White ) }; static const GLYPH g_lightning = { 'U', PBL_IF_COLOR_ELSE( Yellow, White ) }; static const GLYPH g_cloud_open = { 'F', PBL_IF_COLOR_ELSE( LightGray, White ) }; static const GLYPH g_moon_peek = { 'A', PBL_IF_COLOR_ELSE( White, White ) }; static const GLYPH g_sun_peek = { 'B', PBL_IF_COLOR_ELSE( ChromeYellow, White ) }; static const GLYPH g_cloud_windy_snow = { 'J', PBL_IF_COLOR_ELSE( LightGray, White ) }; static const GLYPH g_cloud_windy_rain = { 'R', PBL_IF_COLOR_ELSE( LightGray, White ) }; static const GLYPH g_snow_small = { 'D', PBL_IF_COLOR_ELSE( VividCerulean, White ) }; static const GLYPH g_snow = { 'L', PBL_IF_COLOR_ELSE( VividCerulean, White ) }; static const GLYPH g_frost = { 'C', PBL_IF_COLOR_ELSE( VividCerulean, White ) }; static const GLYPH g_sleet = { 'M', PBL_IF_COLOR_ELSE( VividCerulean, White ) }; static const GLYPH g_hail = { 'P', PBL_IF_COLOR_ELSE( VividCerulean, White ) }; static const GLYPH g_raining_small = { 'O', PBL_IF_COLOR_ELSE( Blue, White ) }; static const GLYPH g_drizzle = { 'K', PBL_IF_COLOR_ELSE( Blue, White ) }; static const GLYPH g_rain = { 'H', PBL_IF_COLOR_ELSE( Blue, White ) }; static const GLYPH g_shower = { 'E', PBL_IF_COLOR_ELSE( Blue, White ) }; static const GLYPH g_cloud_closed = { 'W', PBL_IF_COLOR_ELSE( LightGray, White ) }; static const GLYPH g_dust = { 'X', PBL_IF_COLOR_ELSE( ArmyGreen, White ) }; void draw_icon( GContext *ctx, GRect bounds, int32_t icon_id, bool is_day_not_night ); void weather_icons_init( void ); void weather_icons_deinit( void ); #endif
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "GameFramework/PlayerController.h" #include "TankPlayerController.generated.h" class UTankAimingComponent; /** * */ UCLASS() class BATTLETANK_API ATankPlayerController : public APlayerController { GENERATED_BODY() protected: UFUNCTION(BlueprintImplementableEvent, Category = "Setup") void FoundAimingComponent(UTankAimingComponent *aimingCompRef); UFUNCTION() void OnPossedTankDeath(); private: virtual void BeginPlay() override; virtual void Tick(float DeltaTime) override; virtual void SetPawn(APawn* inPawn) override; //Start the tank moving the barrel so that a shot would it where //The crosshair intersects the world. void AimTowardsCrosshair(); bool GetSightRayHitLocation(FVector& HitLocation) const; UPROPERTY(EditDefaultsOnly) float crossHairXLocation = 0.5f; UPROPERTY(EditDefaultsOnly) float crossHairYLocation = 0.33333f; UPROPERTY(EditDefaultsOnly) float lineTraceRange = 1000000; bool GetLookDirection(FVector2D screenLocation, FVector& lookDirection) const; bool GetLookVectorHitLocation(FVector lookDirection, FVector& hitLocation) const; };
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by AzDailyWorkspace.rc // #define IDS_APP_TITLE 103 #define IDR_MAINFRAME 128 #define IDD_AZDAILYWORKSPACE_DIALOG 102 #define IDD_ABOUTBOX 103 #define IDM_ABOUT 104 #define IDM_EXIT 105 #define IDI_AZDAILYWORKSPACE 107 #define IDI_SMALL 108 #define IDC_AZDAILYWORKSPACE 109 #define IDC_MYICON 2 #ifndef IDC_STATIC #define IDC_STATIC -1 #endif // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 130 #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 110 #endif #endif
#define _POSIX_SOURCE #define _POSIX_C_SOURCE 200112L #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <stdlib.h> int main(int argc, char**argv){ if ((argc != 2) || (0 == strcmp(argv[1], "-h"))){ printf("usage: %s path\n", argv[0]); return 1; } int retval = 0; /* pathconf is weird. The xlc library reference says: If unsuccessful, pathconf() returns -1. If a particular variable has no limit, such as PATH_MAX, pathconf() returns -1 but does not change errno. Hence, all this stop fiddling around. */ errno = 0; long PATH_MAX = pathconf(argv[1], _PC_PATH_MAX); if (PATH_MAX < 0){ if (errno != 0){ int error = 0; fprintf(stderr, "pathconf(%s, _PC_PATH_MAX) returned %d with error %d (%s)\n", argv[1], (int) PATH_MAX, error, strerror(error)); } else{ fprintf(stderr, "pathconf(%s, _PC_PATH_MAX) returned %d without changing errno; " "PATH_MAX is unlimited.\n", argv[1], (int) PATH_MAX); } PATH_MAX = 10000; /* arbitrary */ } char* buf = (char*) malloc((size_t) (PATH_MAX+1)); memset(buf, 0, (size_t) (PATH_MAX+1)); ssize_t status = readlink(argv[1], buf, (size_t) (PATH_MAX+1)); if (0 > status){ int error = errno; fprintf(stderr, "readlink(%s) failed: %d (%s)\n", argv[1], error, strerror(error)); retval = 1; } else{ printf("%s\n", buf); } free(buf); return retval; }
// Copyright (c) 2016-2017 The Doriancoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef DORIANCOIN_WALLET_RPCWALLET_H #define DORIANCOIN_WALLET_RPCWALLET_H #include <string> class CRPCTable; class CWallet; class JSONRPCRequest; void RegisterWalletRPCCommands(CRPCTable &t); /** * Figures out what wallet, if any, to use for a JSONRPCRequest. * * @param[in] request JSONRPCRequest that wishes to access a wallet * @return nullptr if no wallet should be used, or a pointer to the CWallet */ CWallet *GetWalletForJSONRPCRequest(const JSONRPCRequest& request); std::string HelpRequiringPassphrase(CWallet *); void EnsureWalletIsUnlocked(CWallet *); bool EnsureWalletIsAvailable(CWallet *, bool avoidException); #endif //DORIANCOIN_WALLET_RPCWALLET_H
/* * Copyright (C) 2018, STMicroelectronics - All Rights Reserved * * Configuration settings for the STM32MP15x CPU * * SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause */ #ifndef __CONFIG_H #define __CONFIG_H #include <linux/sizes.h> #include <asm/arch/stm32.h> #define CONFIG_PREBOOT /* * Number of clock ticks in 1 sec */ #define CONFIG_SYS_HZ 1000 #define CONFIG_SYS_ARCH_TIMER #define CONFIG_SYS_HZ_CLOCK 64000000 /* * malloc() pool size */ #define CONFIG_SYS_MALLOC_LEN SZ_32M /* * Configuration of the external SRAM memory used by U-Boot */ #define CONFIG_SYS_SDRAM_BASE STM32_DDR_BASE #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE #define CONFIG_NR_DRAM_BANKS 1 /* * Console I/O buffer size */ #define CONFIG_SYS_CBSIZE SZ_1K /* * Needed by "loadb" */ #define CONFIG_SYS_LOAD_ADDR STM32_DDR_BASE /* * Env parameters */ #define CONFIG_ENV_SIZE SZ_4K /* ATAGs */ #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG /* SPL support */ #ifdef CONFIG_SPL /* BOOTROM load address */ #define CONFIG_SPL_TEXT_BASE 0x2FFC2500 /* SPL use DDR */ #define CONFIG_SPL_BSS_START_ADDR 0xC0200000 #define CONFIG_SPL_BSS_MAX_SIZE 0x00100000 #define CONFIG_SYS_SPL_MALLOC_START 0xC0300000 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000 /* limit SYSRAM usage to first 128 KB */ #define CONFIG_SPL_MAX_SIZE 0x00020000 #define CONFIG_SPL_STACK (STM32_SYSRAM_BASE + \ STM32_SYSRAM_SIZE) #endif /* #ifdef CONFIG_SPL */ /*MMC SD*/ #define CONFIG_SYS_MMC_MAX_DEVICE 3 #if !defined(CONFIG_SPL) || !defined(CONFIG_SPL_BUILD) #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 0) \ func(MMC, mmc, 2) #include <config_distro_bootcmd.h> #define CONFIG_EXTRA_ENV_SETTINGS \ "scriptaddr=0xC0000000\0" \ "pxefile_addr_r=0xC0000000\0" \ "kernel_addr_r=0xC1000000\0" \ "fdt_addr_r=0xC4000000\0" \ "ramdisk_addr_r=0xC4100000\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ BOOTENV #endif /* ifndef CONFIG_SPL_BUILD */ #endif /* __CONFIG_H */
/* The MIT License Copyright (c) 2008 Dennis Møllegaard Pedersen <dennis@moellegaard.dk> 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 __mainframe_impl__ #define __mainframe_impl__ #include <wx/timer.h> #include <wx/imaglist.h> #include <wx/arrstr.h> #include "gui.h" #include "ping.h" #include "view.h" #include "query.h" class Label; /// Main Window - presenting the servers online. /// This is the implementation of MainFrame (which is generated) /// this allows us to change how MainFrame is implemented without /// needing to reimplement everything the MainFrame class is updated. class MainFrameImpl : public MainFrame { private: wxArrayString favoriteServers; wxArrayString recentServers; void SetupColumns(ServerListView*); wxRect DetermineFrameSize() const; void UpdateServer(ServerListView*, int idx, Server*); wxTimer initialLoadTimer; wxTimer dataSourceTimer; PingTrackerTimer pingTimer; bool filterEnabled; viewlist_t viewList; ServerListView* activeView; void SetupViews(); void AddView(ServerListView*); void AddViewAsTab(ServerListView*); void RemoveView(ServerListView*); void ViewConnect(ServerListView*); void ViewDisconnect(ServerListView*); void SwitchView(ServerListView*); bool CanCloseView(ServerListView*); std::vector<Label*> GetViewableLabels(); void UpdateListRow(const wxString&); protected: wxImageList* imageList; int imgFavIdx; void EventActivated(wxListEvent&); void EventColClick(wxListEvent&); void EventFavoriteToggle(wxCommandEvent&); void EventLaunch(wxCommandEvent&); //void EventPingChanged(wxCommandEvent&); void EventPingServer(wxCommandEvent&); void EventQuit(wxCommandEvent&); void EventRefresh(wxCommandEvent&); void EventRightClick(wxListEvent&); void EventSearch(wxCommandEvent&); void EventSearchText(wxCommandEvent&); void EventSelectServer(wxListEvent&); void EventShowAbout(wxCommandEvent&); void EventTimer(wxTimerEvent&); void EventViewChanged(wxAuiNotebookEvent&); void EventViewClose(wxAuiNotebookEvent&); void EventToolbarToggle(wxCommandEvent&); void EventCloseView(wxCommandEvent&); void RefreshActiveView(); public: MainFrameImpl(wxWindow*); ~MainFrameImpl(); void SetStatusText(const wxString&); void ShowDetails(); void AddAsRecentServer(const wxString&); }; #endif
#ifndef HALIDE_PYTHON_BINDINGS_PYBOUNDARYCONDITIONS_H #define HALIDE_PYTHON_BINDINGS_PYBOUNDARYCONDITIONS_H void define_boundary_conditions(); #endif // HALIDE_PYTHON_BINDINGS_PYBOUNDARYCONDITIONS_H
/* hourly.h -*- C++ -*- ** Include file for Hourly class ** ** COPYRIGHT (C) 1994 Bradley M. Kuhn ** ** Written : Bradley M. Kuhn Loyola College ** By ** ** Written : David W. Binkley Loyola College ** For ** ** Acknowledgements: ** This code is based on code that appears in: ** C++ How to Program by H. M. Deitel and P. J. Deitel ** Prentice Hall, New Jersey, p. 536 ** ** RCS : ** ** $Source$ ** $Revision: 16678 $ ** $Date: 2004-10-04 20:37:32 -0400 (Mon, 04 Oct 2004) $ ** ** $Log$ ** Revision 1.2 2004/10/05 00:37:32 lattner ** Stop using deprecated headers ** ** Revision 1.1 2004/10/04 20:01:13 lattner ** Initial checkin of all of the source ** ** Revision 0.2 1994/12/31 01:22:16 bkuhn ** -- version were getting data from ** ** Revision 0.1 1994/12/24 01:43:50 bkuhn ** # initial version ** ** */ #ifndef _HOURLY_H #define _HOURLY_H #include "wage.h" #define HOURLY_ID 5 #include <iostream> #include <stdlib.h> using namespace std; /* An hourly worker gets paid for every hour worked */ class HourlyWorker : public WageWorker { private: float thisWeekHours; // hours worked this week protected: float ThisWeekHours() { return thisWeekHours; }; void SetThisWeekHours(float); public: HourlyWorker(const char *, const char * , float = 0.0); virtual void Print(); virtual void NewWeek(); virtual void Raise(int); // pure virtual function virtual float Earnings() = 0; }; /*****************************************************************************/ HourlyWorker::HourlyWorker(const char *first, const char *last, float startWage) : WageWorker(first, last, startWage) // this will call Wage's constructor { dollarsToRaise = 0.5; thisWeekHours = 0.0; } /*****************************************************************************/ void HourlyWorker::SetThisWeekHours(float hours) { thisWeekHours = hours; } /*****************************************************************************/ void HourlyWorker::Print() { cout << " Hourly Worker: " << FirstName() << ' ' << LastName(); } /*****************************************************************************/ void HourlyWorker::Raise(int units) { if (units > 0) SetWage(Wage() + (units * dollarsToRaise)); } /*****************************************************************************/ void HourlyWorker::NewWeek() { float hours; hours = 44; // ( float(rand()) / float(RAND_MAX) ) * 80.0; SetThisWeekHours(hours); } #endif
#pragma once #ifndef _TERRAINCLASS_H_ #define _TERRAINCLASS_H_ #include <d3d11.h> #include <DirectXMath.h> #include <stdio.h> #include <math.h> #include "textureclass.h" const int TEXTURE_REPEAT = 16; class TerrainClass { private: struct VertexType { DirectX::XMFLOAT3 position; DirectX::XMFLOAT2 texture; DirectX::XMFLOAT3 normal; }; struct HeightMapType { float x, y, z; float tu, tv; float nx, ny, nz; }; struct VectorType { float x, y, z; }; public: TerrainClass(void); ~TerrainClass(void); bool Initialize(ID3D11Device*, char*,WCHAR* textureFilename); void Shutdown(); void Render(ID3D11DeviceContext*); int GetIndexCount(); ID3D11ShaderResourceView* GetTexture(); private: bool LoadHeightMap(char*); void NormalizeHeightMap(); bool CalculateNormals(); void ShutdownHeightMap(); void CalculateTextureCoordinates(); bool LoadTexture(ID3D11Device*, WCHAR*); void ReleaseTexture(); bool InitializeBuffers(ID3D11Device*); void ShutdownBuffers(); void RenderBuffers(ID3D11DeviceContext*); private: int m_terrainWidth, m_terrainHeight; int m_vertexCount, m_indexCount; ID3D11Buffer *m_vertexBuffer, *m_indexBuffer; HeightMapType* m_heightMap; TextureClass* m_Texture; }; #endif
// DBMWriter.h: interface for the CDBMWriter class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_DBMWRITER_H__C1FF6E3E_45BA_478C_88E2_D2CB3C061575__INCLUDED_) #define AFX_DBMWRITER_H__C1FF6E3E_45BA_478C_88E2_D2CB3C061575__INCLUDED_ #include "windows.h" #include "Str.h" class CDBMWriter { public: CDBMWriter(); virtual ~CDBMWriter(); bool OutputDBM(const char *pDBMStr, size_t length); bool OutputDBM(CStr* pDBMStr); DWORD EatCarriageReturn(void); bool CheckAndExpandDBMMemory(DWORD dwLengthOfNewAddData); bool WriteProgramAsEXEOrDEBUG(LPSTR lpEXEFilename, bool bParsingMainProgram); void SetNewCodeFlag(bool bFlag) { m_bNewCodeToParse=bFlag; } bool GetNewCodeFlag(void) { return m_bNewCodeToParse; } public: void SetDBMDataPointer(LPSTR pData) { m_pDBMDataPointer=pData; } LPSTR GetDBMDataPointer(void) { return m_pDBMDataPointer; } private: LPSTR m_pDBMData; LPSTR m_pDBMDataPointer; DWORD m_dwDBMDataSize; bool m_bNewCodeToParse; }; #endif // !defined(AFX_DBMWRITER_H__C1FF6E3E_45BA_478C_88E2_D2CB3C061575__INCLUDED_)
// Copyright (c) 2009-2019 Satoshi Nakamoto // Copyright (c) 2009-2019 The Bitcoin Developers // Copyright (c) 2016-2019 Duality Blockchain Solutions Developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SEQUENCE_QT_SEQUENCEUNITS_H #define SEQUENCE_QT_SEQUENCEUNITS_H #include "amount.h" #include <QAbstractListModel> #include <QString> // U+2009 THIN SPACE = UTF-8 E2 80 89 #define REAL_THIN_SP_CP 0x2009 #define REAL_THIN_SP_UTF8 "\xE2\x80\x89" #define REAL_THIN_SP_HTML "&thinsp;" // U+200A HAIR SPACE = UTF-8 E2 80 8A #define HAIR_SP_CP 0x200A #define HAIR_SP_UTF8 "\xE2\x80\x8A" #define HAIR_SP_HTML "&#8202;" // U+2006 SIX-PER-EM SPACE = UTF-8 E2 80 86 #define SIXPEREM_SP_CP 0x2006 #define SIXPEREM_SP_UTF8 "\xE2\x80\x86" #define SIXPEREM_SP_HTML "&#8198;" // U+2007 FIGURE SPACE = UTF-8 E2 80 87 #define FIGURE_SP_CP 0x2007 #define FIGURE_SP_UTF8 "\xE2\x80\x87" #define FIGURE_SP_HTML "&#8199;" // QMessageBox seems to have a bug whereby it doesn't display thin/hair spaces // correctly. Workaround is to display a space in a small font. If you // change this, please test that it doesn't cause the parent span to start // wrapping. #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>" // Define THIN_SP_* variables to be our preferred type of thin space #define THIN_SP_CP REAL_THIN_SP_CP #define THIN_SP_UTF8 REAL_THIN_SP_UTF8 #define THIN_SP_HTML HTML_HACK_SP /** sequence unit definitions. Encapsulates parsing and formatting and serves as list model for drop-down selection boxes. */ class SequenceUnits: public QAbstractListModel { Q_OBJECT public: explicit SequenceUnits(QObject *parent); /** Sequence units. @note Source: https://en.sequence.it/wiki/Units . Please add only sensible ones */ enum Unit { SEQ, mSEQ, uSEQ }; enum SeparatorStyle { separatorNever, separatorStandard, separatorAlways }; //! @name Static API //! Unit conversion and formatting ///@{ //! Get list of units, for drop-down box static QList<Unit> availableUnits(); //! Is unit ID valid? static bool valid(int unit); //! Identifier, e.g. for image names static QString id(int unit); //! Short name static QString name(int unit); //! Longer description static QString description(int unit); //! Number of Satoshis (1e-8) per unit static qint64 factor(int unit); //! Number of decimals left static int decimals(int unit); //! Format as string static QString format(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); static QString simpleFormat(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Format as string (with unit) static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Format as HTML string (with unit) static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Format as string (with unit) but floor value up to "digits" settings static QString floorWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); static QString floorHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Parse string to coin amount static bool parse(int unit, const QString &value, CAmount *val_out); //! Gets title for amount column including current display unit if optionsModel reference available */ static QString getAmountColumnTitle(int unit); ///@} //! @name AbstractListModel implementation //! List model for unit drop-down selection box. ///@{ enum RoleIndex { /** Unit identifier */ UnitRole = Qt::UserRole }; int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; ///@} static QString removeSpaces(QString text) { text.remove(' '); text.remove(QChar(THIN_SP_CP)); #if (THIN_SP_CP != REAL_THIN_SP_CP) text.remove(QChar(REAL_THIN_SP_CP)); #endif return text; } //! Return maximum number of base units (Satoshis) static CAmount maxMoney(); private: QList<SequenceUnits::Unit> unitlist; }; typedef SequenceUnits::Unit SequenceUnit; #endif // SEQUENCE_QT_SEQUENCEUNITS_H
// Copyright (c) 2014 The Caroline authors. All rights reserved. // Use of this source file is governed by a MIT license that can be found in the // LICENSE file. /// @author Mlodik Mikhail <mlodik_m@mail.ru> #ifndef CORE_JSON_MATRIX_HELPERS_H_ #define CORE_JSON_MATRIX_HELPERS_H_ #include "json/value.h" #include "opencv2/core/core.hpp" namespace core { /// Read values from json and fill matrix. /// @param [in] json_matrix Json value to read. /// @param [out] mat Matrix object to fill. /// @returs true on success bool JsonToMat(const Json::Value& json_matrix, cv::Mat* mat); /// Read values from json and fill matrix m x n with double. /// @param [in] json_matrix Json value to read. /// @param [out] mat Matrix object to fill. /// @returs true on success template <int m, int n> bool JsonToMatx(const Json::Value& json_matrix, cv::Matx<double, m, n>* mat) { cv::Mat temp_mat; if (!JsonToMat(json_matrix, &temp_mat) || temp_mat.size().width != n || temp_mat.size().height != m) return false; *mat = temp_mat; return true; } /// Convert matrix into json representation. /// @param [in] mat Matrix to convert. /// @returns Corespound json value. Json::Value MatToJson(const cv::Mat& mat); /// Convert matrix m x n of double into json representation. /// @param [in] mat Matrix to convert. /// @returns Corespound json value. template <int m, int n> Json::Value MatxToJson(const cv::Matx<double, m, n>& mat) { return MatToJson(cv::Mat(mat)); } } // namespace core #endif // CORE_JSON_MATRIX_HELPERS_H_
#ifndef _EASYEDITOR_ONE_FLOAT_VALUE_H_ #define _EASYEDITOR_ONE_FLOAT_VALUE_H_ namespace ee { class OneFloatValue { public: virtual ~OneFloatValue() {} virtual float GetValue() const = 0; }; // OneFloatValue } #endif // _EASYEDITOR_ONE_FLOAT_VALUE_H_
#ifndef WARSPRITES #define WARSPRITES #include <avr/pgmspace.h> extern const unsigned char warsprite_grass1[]; extern const unsigned char warsprite_grass2[]; extern const unsigned char warsprite_trees[]; extern const unsigned char warsprite_dirt[]; extern const unsigned char warsprite_mountain[]; extern const unsigned char warsprite_hill[]; extern const unsigned char warsprite_house[]; extern const unsigned char warsprite_bighouse[]; extern const unsigned char warsprite_infantry1[]; extern const unsigned char warsprite_infantry2[]; extern const unsigned char warsprite_tank1[]; extern const unsigned char warsprite_tank2[]; extern const unsigned char warsprite_car1[]; extern const unsigned char warsprite_car2[]; extern const unsigned char warsprite_plane1[]; extern const unsigned char warsprite_plane2[]; #endif //WARSPRITES
// Copyright (c) 2017 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef SHELL_BROWSER_UI_WEBUI_PDF_VIEWER_UI_H_ #define SHELL_BROWSER_UI_WEBUI_PDF_VIEWER_UI_H_ #include <memory> #include <string> #include "base/macros.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_ui_controller.h" #include "ipc/ipc_message.h" namespace content { class BrowserContext; struct StreamInfo; } // namespace content namespace electron { class PdfViewerHandler; class PdfViewerUI : public content::WebUIController, public content::WebContentsObserver { public: PdfViewerUI(content::BrowserContext* browser_context, content::WebUI* web_ui, const std::string& src); ~PdfViewerUI() override; // content::WebContentsObserver: bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) override; void RenderFrameCreated(content::RenderFrameHost* rfh) override; private: using StreamResponseCallback = base::OnceCallback<void(std::unique_ptr<content::StreamInfo>)>; class ResourceRequester; void OnPdfStreamCreated(std::unique_ptr<content::StreamInfo> stream_info); void OnSaveURLAs(const GURL& url, const content::Referrer& referrer); // Source URL from where the PDF originates. std::string src_; PdfViewerHandler* pdf_handler_; scoped_refptr<ResourceRequester> resource_requester_; // Pdf Resource stream. std::unique_ptr<content::StreamInfo> stream_; DISALLOW_COPY_AND_ASSIGN(PdfViewerUI); }; } // namespace electron #endif // SHELL_BROWSER_UI_WEBUI_PDF_VIEWER_UI_H_
/* * The MIT License (MIT) * * Copyright (c) 2016 Nels D. "Chip" Pearson (aka CmdrZin) * * 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. * * io_led_button.h * * Created: 7/24/2016 10:11:43 AM * Author: Chip * revised: 9/15/2017 0.02 ndp improve interface */ #ifndef IO_LED_BUTTON_H_ #define IO_LED_BUTTON_H_ #include <avr/io.h> #include <stdbool.h> #define MOD_IO_LED_BUTTON_ID 5 #define IO_GREEN_BUTTON 0x01 #define IO_RED_BUTTON 0x02 #define IO_YELLOW_BUTTON 0x04 typedef enum {IO_TEST, IO_SCAN} MOD_IO_STATE; void mod_io_init(); void mod_io_service(); uint8_t mod_io_getButtons(); void mod_io_setGreenLed( uint8_t val ); void mod_io_setRedLed( uint8_t val ); void mod_io_setYellowLed( uint8_t val ); void ilb_scanButtons(); void ilb_setGreenLed( bool state ); void ilb_setRedLed( bool state ); void ilb_setYellowLed( bool state ); #endif /* IO_LED_BUTTON_H_ */
/** * @file KeyboardButtonTest.h * @brief Contains KeyboardButtonTest fixture * @author Khalin Yevhen * @version 0.0.1 * @date 28.09.17 */ #pragma once #include <gtest\gtest.h> #include "..\khalin04\KeyboardButton.h" #include "..\khalin04\KeyboardButton.cpp" /** * @brief Test fixture for using the same data * @author Khalin Yevhen */ class KeyboardButtonTest : public ::testing::Test { protected: virtual void SetUp() { btnForm = ButtonForm::RECTANGULAR; btnName = "ABC"; btnCode = 123; static KeyboardButton src(btnForm, btnCode, btnName); btn = &src; } ButtonForm btnForm; string btnName; int btnCode; KeyboardButton *btn; };
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "UIButton.h" @interface SBNotificationVibrantButton : UIButton { UIButton *_vibrantButton; UIButton *_overlayButton; } - (id)_buttonImageForColor:(id)arg1 selected:(_Bool)arg2; - (id)_buttonFont; - (void)_buttonStateChanged:(id)arg1; - (void)_buttonPushed:(id)arg1; - (id)_newButtonWithBackgroundImage:(id)arg1 selectedImage:(id)arg2 titleColor:(id)arg3 selectedTitleColor:(id)arg4; - (void)layoutSubviews; - (void)_configureButton:(id *)arg1 withSettings:(id)arg2; - (void)_configureOverlayViewWithSettings:(id)arg1; - (void)_configureVibrantViewWithSettings:(id)arg1; - (void)setHighlighted:(_Bool)arg1; - (void)setTitle:(id)arg1 forState:(unsigned long long)arg2; - (id)titleLabel; - (struct CGSize)sizeThatFits:(struct CGSize)arg1; - (void)updateForContenteCategorySizeChange; - (void)dealloc; - (id)initWithColorSettings:(id)arg1; @end
/* Some parameters for the placement of the runtime stack in the buffer lab */ #define STACK_SIZE 0x100000 #ifdef STACK #define START_ADDR (void *) STACK #else #define START_ADDR (void *) 0x55586000 #endif
#pragma once #include <QAbstractItemModel> #include <memory> class ProfFile; class ProfTreeItem; class ProfTreeModel : public QAbstractItemModel { public: ProfTreeModel(const std::shared_ptr<ProfFile>& ctx); virtual ~ProfTreeModel(); QVariant data(const QModelIndex& index, int role) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex& index) const override; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& parent = QModelIndex()) const override; const QVector<std::shared_ptr<ProfTreeItem>>& roots() const { return mFiles; } private: void setupData(); QVector<std::shared_ptr<ProfTreeItem>> mFiles; std::shared_ptr<ProfFile> mContext; };
/*=================================================== LIST MASTER HEADERS ===================================================*/ //Multiple definition prevention #ifndef BBInterface_ListMaster_h #define BBInterface_ListMaster_h //Includes //Pre-defined structures struct list; struct listnode; //Define these structures struct listnode { wchar_t key[96]; void * value; listnode *next; listnode *prev; listnode *hash_next; // if more nodes share the same hash value, this points to the next one }; struct list { listnode *first; listnode *last; listnode *last_found; listnode *hash_table[256]; // all the possible 1-byte hash values }; //Define these functions internally int list_startup(); int list_shutdown(); list *list_create(); int list_destroy(list *l); int list_add(list *l, const wchar_t *key, void *value, void** old_value); int list_remove(list *l, const wchar_t *key); void *list_lookup(list *l, const wchar_t *key); int list_rename(list *l, const wchar_t *key, const wchar_t *newkey); #define dolist(_ln, _plist) for (_ln = _plist->first; _ln; _ln = _ln->next) #endif /*=================================================*/
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */ #pragma once #include <vector> #include <map> #include <sstream> #include <string> #include "ifcpp/model/GlobalDefines.h" #include "ifcpp/model/BasicTypes.h" #include "ifcpp/model/BuildingObject.h" #include "IfcCartesianTransformationOperator.h" class IFCQUERY_EXPORT IfcDirection; //ENTITY class IFCQUERY_EXPORT IfcCartesianTransformationOperator3D : public IfcCartesianTransformationOperator { public: IfcCartesianTransformationOperator3D() = default; IfcCartesianTransformationOperator3D( int id ); ~IfcCartesianTransformationOperator3D() = default; virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options ); virtual void getStepLine( std::stringstream& stream ) const; virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const; virtual void readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map ); virtual void setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self ); virtual size_t getNumAttributes() { return 5; } virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const; virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const; virtual void unlinkFromInverseCounterparts(); virtual const char* className() const { return "IfcCartesianTransformationOperator3D"; } virtual const std::wstring toString() const; // IfcRepresentationItem ----------------------------------------------------------- // inverse attributes: // std::vector<weak_ptr<IfcPresentationLayerAssignment> > m_LayerAssignment_inverse; // std::vector<weak_ptr<IfcStyledItem> > m_StyledByItem_inverse; // IfcGeometricRepresentationItem ----------------------------------------------------------- // IfcCartesianTransformationOperator ----------------------------------------------------------- // attributes: // shared_ptr<IfcDirection> m_Axis1; //optional // shared_ptr<IfcDirection> m_Axis2; //optional // shared_ptr<IfcCartesianPoint> m_LocalOrigin; // shared_ptr<IfcReal> m_Scale; //optional // IfcCartesianTransformationOperator3D ----------------------------------------------------------- // attributes: shared_ptr<IfcDirection> m_Axis3; //optional };
// // LevelManager.h // SoA // // Created by John Doe on 2/2/16. // Copyright © 2016 John Doe. All rights reserved. // #ifndef LevelManager_h #define LevelManager_h #import <UIKit/UIKit.h> @interface LevelManager : NSObject - (void) Load; - (void) Unload; @end #endif /* LevelManager_h */
//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by EasySRT.rc // #define IDD_EASYSRT_DIALOG 102 #define IDR_MAINFRAME 128 #define IDD_LYRICS 130 #define IDC_EDIT1 1001 #define IDC_BUTTON2 1002 #define IDC_EDIT2 1003 #define IDC_BUTTON3 1003 #define IDC_OCX1 1005 #define IDC_LIST1 1006 #define IDC_BUTTON1 1007 #define IDC_BUTTON4 1008 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 131 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1009 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
#ifndef Input_H #define Input_H //! Storage struct for touch inputs. struct Input { Input(int Id, float x, float y) : Id(Id), x(x), y(y) {} int Id; float x, y; }; #endif
#ifndef ICAL_PARAMETERS_altrep_H #define ICAL_PARAMETERS_altrep_H #include <ostream> #include "core/genericpropertyparameter.h" #include "parserexception.h" namespace ical { namespace parameters { class AltRep { private: std::string value; public: static const std::string NAME; const std::string &getValue() const noexcept { return value; } AltRep() {} void print(std::ostream &out) const; static AltRep parse(const core::WithPos<core::GenericPropertyParameter> &generic); }; } // namespace parameters } // namespace ical #endif // ICAL_PARAMETERS_altrep_H
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_DragToDismissViewController_TestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_DragToDismissViewController_TestsVersionString[];
#ifndef __P_BUFFER_H__ #define __P_BUFFER_H__ void P_bufferinit(); void P_bufferclose(); #endif
#ifndef _TCompare_H_ #define _TCompare_H_ ////////////////////////////////////////////////////////////////////////////// // // Compare Object // ////////////////////////////////////////////////////////////////////////////// class DefaultEquals { public: template<class TEqualsValue> bool operator () (const TEqualsValue& value1, const TEqualsValue& value2) { return value1 == value2; } }; class DefaultCompare { public: template<class TEqualsValue> bool operator () (const TEqualsValue& value1, const TEqualsValue& value2) { return value1 > value2; } }; class DefaultNoEquals { public: template<class TEqualsValue> bool operator () (const TEqualsValue& value1, const TEqualsValue& value2) { ZError("DefaultNoEquals(...) called"); return false; } }; class DefaultNoCompare { public: template<class TEqualsValue> bool operator () (const TEqualsValue& value1, const TEqualsValue& value2) { ZError("DefaultNoCompare(...) called"); return false; } }; #endif
/***************************************************************** * Copyright (c) 2005 Tim de Jong, Brent Miszalski * * * * All rights reserved. * * Distributed under the terms of the MIT License. * *****************************************************************/ #ifndef COLOUR_VIEW_H #define COLOUR_VIEW_H #include <be/interface/Rect.h> #include <be/interface/View.h> #include <be/interface/Bitmap.h> /** About this class: This class is a simple subclassed BView, that uses a view to draw into a Bitmap, so it's drawing is rendered flicker-free. */ class ColourView : public BView { public: ColourView(BRect frame); virtual ~ColourView(); virtual void Draw(BRect drawRect); void Render(); void SetColor(rgb_color colour); protected: BBitmap* m_bitmap; BView* m_bitmapView; rgb_color m_colour; }; #endif
int myAtoi(char* str) { while(1){ if(NULL == str){ return 0; } char v = *str; if(v == ' ' || v == '\t' || v == '\n' || v == '\r'){ str++; }else{ break; } } int positive = 1; char* start=NULL; if((*str) == '+' || (*str) == '-'){ if((*str) == '-'){ positive = 0; } start = ++str; }else{ start = str; } if(NULL == start){ return 0; } while(1){ char v = *str; if(v >= '0' && v <= '9'){ str++; }else{ break; } } if(start == str){ return 0; } int count = str - start; int array[count]; int i = 0; while(start < str){ array[i++] = (*start) - '0'; start++; } int k = count - 1; int result = 0; int j = 1; if(count > 10){ return (positive == 1) ? 2147483647 : -2147483648; } while(k>=0){ if((positive == 1 && result > 147483647 && array[k] >= 2) || (positive == 0 && result > 147483648 && array[k] >= 2) ){ return (positive == 1) ? 2147483647 : -2147483648; } result += array[k]*j; j *= 10; k--; } if(positive == 0){ result = -result; } return result; }
/* * Copyright (c) 2008-2018 SLIBIO <https://github.com/SLIBIO> * * 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 CHECKHEADER_SLIB_UI_MENU #define CHECKHEADER_SLIB_UI_MENU #include "definition.h" #include "../core/object.h" #include "../core/string.h" #include "../core/function.h" #include "../graphics/bitmap.h" #include "event.h" namespace slib { class Menu; class MenuItem : public Object { SLIB_DECLARE_OBJECT protected: MenuItem(); ~MenuItem(); public: Ref<Menu> getParent() const; String getText() const; virtual void setText(const String& text); const KeycodeAndModifiers& getShortcutKey() const; virtual void setShortcutKey(const KeycodeAndModifiers& km); const KeycodeAndModifiers& getSecondShortcutKey() const; virtual void setSecondShortcutKey(const KeycodeAndModifiers& km); sl_bool isEnabled() const; virtual void setEnabled(sl_bool flag); sl_bool isChecked() const; virtual void setChecked(sl_bool flag); Ref<Drawable> getIcon() const; virtual void setIcon(const Ref<Drawable>& icon); Ref<Drawable> getCheckedIcon() const; virtual void setCheckedIcon(const Ref<Drawable>& icon); Ref<Menu> getSubmenu() const; virtual void setSubmenu(const Ref<Menu>& menu); virtual sl_bool isSeparator() const; static Ref<MenuItem> createSeparator(); sl_bool processShortcutKey(const KeycodeAndModifiers& km); public: SLIB_PROPERTY_FUNCTION(void(), Action) protected: WeakRef<Menu> m_parent; AtomicString m_text; KeycodeAndModifiers m_shortcutKey; KeycodeAndModifiers m_secondShortcutKey; sl_bool m_flagEnabled; sl_bool m_flagChecked; AtomicRef<Drawable> m_icon; AtomicRef<Drawable> m_checkedIcon; AtomicRef<Menu> m_submenu; }; class MenuItemParam { public: String text; KeycodeAndModifiers shortcutKey; KeycodeAndModifiers secondShortcutKey; sl_bool flagEnabled; sl_bool flagChecked; Ref<Drawable> icon; Ref<Drawable> checkedIcon; Ref<Menu> submenu; Function<void()> action; public: MenuItemParam(); SLIB_DECLARE_CLASS_DEFAULT_MEMBERS(MenuItemParam) }; class Menu : public Object { SLIB_DECLARE_OBJECT protected: Menu(); ~Menu(); public: static Ref<Menu> create(sl_bool flagPopup = sl_false); static Ref<Menu> createPopup(); sl_uint32 getMenuItemsCount() const; Ref<MenuItem> getMenuItem(sl_uint32 index) const; virtual Ref<MenuItem> addMenuItem(const MenuItemParam& param) = 0; virtual Ref<MenuItem> insertMenuItem(sl_uint32 index, const MenuItemParam& param) = 0; virtual Ref<MenuItem> addSeparator() = 0; virtual Ref<MenuItem> insertSeparator(sl_uint32 index) = 0; virtual void removeMenuItem(sl_uint32 index) = 0; virtual void removeMenuItem(const Ref<MenuItem>& item) = 0; virtual void show(sl_ui_pos x, sl_ui_pos y) = 0; void show(const UIPoint& pt); Ref<MenuItem> addMenuItem(const String& title); Ref<MenuItem> addMenuItem(const String& title, const Ref<Drawable>& icon); Ref<MenuItem> addMenuItem(const String& title, const Ref<Drawable>& icon, const Ref<Drawable>& checkedIcon); Ref<MenuItem> addMenuItem(const String& title, const KeycodeAndModifiers& shortcutKey); Ref<MenuItem> addMenuItem(const String& title, const KeycodeAndModifiers& shortcutKey, const Ref<Drawable>& icon); Ref<MenuItem> addMenuItem(const String& title, const KeycodeAndModifiers& shortcutKey, const Ref<Drawable>& icon, const Ref<Drawable>& checkedIcon); Ref<MenuItem> addSubmenu(Ref<Menu>& submenu, const String& title); Ref<MenuItem> addSubmenu(Ref<Menu>& submenu, const String& title, const Ref<Drawable>& icon); Ref<MenuItem> addSubmenu(Ref<Menu>& submenu, const String& title, const Ref<Drawable>& icon, const Ref<Drawable>& checkedIcon); sl_bool processShortcutKey(const KeycodeAndModifiers& km); protected: CList< Ref<MenuItem> > m_items; }; } #endif
/*************************************************************************************** * This header file is an implementation for search_anagram * Author: huhao * Date: 2017.07.22 * Modification record: * ***************************************************************************************/ #include <string.h> #include "search_anagram.h" /**************************************************************** * Description: get status of certain bit of number * Parameters: * num: the number need to be checked * which_bit: which bit need to be checked * Return: 1-bit enabled, 0-bit disabled ****************************************************************/ static inline uint8_t GET_BIT(uint8_t num, uint8_t which_bit) { if (which_bit < 8) { return (num & (1 << which_bit)); } else { return 0; } } /****************************************************************** * Description: set certain bit to enabled * Parameters: * num: the number need to be set bit * which_bit: which bit need to be set enabled * Return: the number after setting bit *******************************************************************/ static inline uint8_t SET_BIT(uint8_t num, uint8_t which_bit) { if (which_bit < 8) { // only applied to uint8_t type return (num | (1 << which_bit)); } else { // invalid to left shift more than 7 bit return (num); } } /************************************************************************************** * Description: summary how many time each alphabet appear * Parameters: * psrc: pointer to input string * alphabet_map[]: array to store alphabet_map * len: lenght of alphabet_map, generally 26. For there are 26 letters in English * Return: 0 if normal, -n if abnormal **************************************************************************************/ static int generate_alphabet_map(char *psrc, uint8_t alphabet_map[], uint8_t len) { char tmp; uint8_t index; if (psrc == NULL) { return -5; } do { // if empty string, can exit abnormal tmp = *psrc; if (tmp >= 'A' && tmp <= 'Z') { /* lowercase all the letters first */ tmp += 32; } else if (tmp >= 'a' && tmp <= 'z') { // do nothing } else { // not valid letter return -5; } index = tmp - 'a'; alphabet_map[index] += 1; psrc += 1; // move pointer to next } while (*psrc != '\0'); return 0; } /* interface function, refer to .h file to use it */ int search_anagram(char *dict[], uint32_t len) { uint32_t i, j, index; uint8_t k, offset, anagram_flag; uint8_t alphabet_map1[MAX_LETTER_NUM]; uint8_t alphabet_map2[MAX_LETTER_NUM]; uint8_t bitmap_ignore[MAX_WORD_NUM / 8]; if (len > MAX_WORD_NUM) { LOG("Error, no more than %lu words in Oxford Dictionary\n", MAX_WORD_NUM); return -5; } else { LOG("There are %lu words in the dictionary\n", len); } memset(bitmap_ignore, 0, sizeof(bitmap_ignore)); LOG("Anagrams list below:\n"); for (i = 0; i < len - 1; i += 1) { /* check whether this element has been recorded as anagram */ index = i / 8; offset = (uint8_t) (i % 8); if (GET_BIT(bitmap_ignore[index], offset)) { break; } else { anagram_flag = 0; memset(alphabet_map1, 0, MAX_LETTER_NUM); } if (generate_alphabet_map(dict[i], alphabet_map1, MAX_LETTER_NUM) < 0) { /* non-alphabet found, invalid string */ break; } else { // currently we do nothing here } for (j = i + 1; j < len; j += 1) { /* check whether this element has been recorded as anagram */ index = j / 8; offset = (uint8_t) (j % 8); if (GET_BIT(bitmap_ignore[index], offset)) { continue; } else { memset(alphabet_map2, 0, MAX_LETTER_NUM); } if (generate_alphabet_map(dict[j], alphabet_map2, MAX_LETTER_NUM) < 0) { /* non-alphabet found, invalid string */ continue; } else { for (k = 0; k < MAX_LETTER_NUM; k += 1) { if (alphabet_map1[k] == alphabet_map2[k]) { // same letter // current do nothing here } else { // different letter break; } } if (k == MAX_LETTER_NUM) { // find anagram if (anagram_flag) { // not the first time LOG(" %s", dict[j]); } else { // first anagram found LOG("\n %s %s", dict[i], dict[j]); anagram_flag = 1; /* if anagram found, set flag to ignore check for another time */ index = i / 8; offset = (uint8_t) (i % 8); bitmap_ignore[index] = SET_BIT(bitmap_ignore[index], offset); } /* if anagram found, set flag to ignore check for another time */ index = j / 8; offset = (uint8_t) (j % 8); bitmap_ignore[index] = SET_BIT(bitmap_ignore[index], offset); } } } } LOG("\n\n"); return 0; }
// // SCCatWaitingHUD.h // SCCatWaitingHUD // // Created by Yh c on 15/11/13. // Copyright © 2015年 Animatious. All rights reserved. // #import <UIKit/UIKit.h> #import "UIViewExt.h" #define ScreenWidth [[UIScreen mainScreen] bounds].size.width #define ScreenHeight [[UIScreen mainScreen] bounds].size.height #define SCCatWaiting_catPurple [UIColor colorWithRed:75.0f/255.0f green:52.0f/255.0f blue:97.0f/255.0f alpha:0.7f] #define SCCatWaiting_leftFaceGray [UIColor colorWithRed:200.0f/255.0f green:198.0f/255.0f blue:200.0f/255.0f alpha:1.0f] #define SCCatWaiting_rightFaceGray [UIColor colorWithRed:213.0f/255.0f green:212.0f/255.0f blue:213.0f/255.0f alpha:1.0f] #define SCCatWaiting_animationSize 50.0f @interface SCCatWaitingHUD : UIView @property (nonatomic, strong) UIWindow *backgroundWindow; @property (nonatomic, strong) UIVisualEffectView *blurView; @property (nonatomic, strong) UIView *indicatorView; @property (nonatomic, strong) UIImageView *faceView; @property (nonatomic, strong) UIImageView *mouseView; @property (nonatomic, strong) UILabel *contentLabel; /** * Status of animation. */ @property (nonatomic) BOOL isAnimating; /** * Title of your HUD. Display in contentLabel. Default is 'Loading...' */ @property (nonatomic, strong) NSString *title; + (SCCatWaitingHUD *) sharedInstance; - (void)animate; /** * 动画的时候是否允许和原始的View进行交互 * Whether you can interact with the original view while animating * * @param enabled YES代表能响应原生View事件,NO代表block当前所有的手势操作 */ - (void)animateWithInteractionEnabled:(BOOL)enabled; /** * You can attach your HUD title to the view using this animation method. Default title is 'Loading...'. * * @param enabled YES代表能响应原生View事件,NO代表block当前所有的手势操作 * @param title HUD title */ - (void)animateWithInteractionEnabled:(BOOL)enabled title:(NSString *)title; /** * You can also customize duration for each loop (also can be represented as speed) using this animation method. Default duration is 4.0 seconds each loop. * * @param enabled YES代表能响应原生View事件,NO代表block当前所有的手势操作 * @param title HUD title * @param duration time for each loop */ - (void)animateWithInteractionEnabled:(BOOL)enabled title:(NSString *)title duration:(CGFloat)duration; - (void)stop; @end
/** * @file CompilerVersion.h * @ingroup Utils * @brief Get the version of the C++ compiler used. * * Copyright (c) 2017 Sebastien Rombauts (sebastien.rombauts@gmail.com) */ #pragma once #include <string> namespace Utils { /** * @brief Get the version of the C++ compiler used. * @ingroup Utils * * Works for the 3 main compilers GCC, Clang and Microsoft Visual Studio */ class CompilerVersion { //////////////////////////////////////////////////////////////////////////////// // Méthodes Publiques //////////////////////////////////////////////////////////////////////////////// public: /// Extract informations for the main compilers CompilerVersion() : #ifdef _MSC_VER // _WIN32 mbIsValid (true), mName ("MSVC"), mVersion (std::to_string(_MSC_VER)), mVersionFull (std::to_string(_MSC_FULL_VER)), mVersionInt (_MSC_VER) #else #ifdef __GNUC__ mbIsValid (true), #ifdef __clang__ mName ("clang"), mVersion (Formatter() << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__), mVersionFull (__clang_version__), mVersionInt (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #else mName ("GCC"), mVersion (Formatter() << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__), mVersionFull (mVersion), mVersionInt (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #endif #else mbIsValid (false), mVersionInt (0) #endif #endif {} /// True if using a known compiler inline bool isValid() const { return mbIsValid; } /// Compiler's name (GCC, Clang or MSVC) inline const std::string& getName() const { return mName; } /// Short version string (for instance "3.8.0" or "1900") inline const std::string& getVersion() const { return mVersion; } /// Full version string (for instance "3.8.0 (tags/RELEASE_380/final)" or "150020706") inline const std::string& getVersionFull() const { return mVersionFull; } /// Integer version (for instance 30800 or 1900) inline int getVersionInt() const { return mVersionInt; } /// Compose description with compiler's name and full version string inline std::string formatDescription() const { return Formatter() << mName << " " << mVersionFull; } //////////////////////////////////////////////////////////////////////////////// // Variables Membres Privées //////////////////////////////////////////////////////////////////////////////// private: bool mbIsValid; ///< Validity flag std::string mName; ///< Compiler's name (GCC, Clang or MSVC) std::string mVersion; ///< Short version string (for instance "3.8.0" or "1900") std::string mVersionFull; ///< Full version string (for instance "3.8.0 (tags/RELEASE_380/final)" or "150020706") unsigned int mVersionInt; ///< Integer version (for instance 30800 or 1900) }; } // namespace Utils
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2014 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #import "TiViewProxy.h" @interface ComGuidolimTiclusteredmapkitViewProxy : TiViewProxy { } @end
/* CsvToJson.exe [“ü—ÍCSVƒtƒ@ƒCƒ‹ o—ÍJSONƒtƒ@ƒCƒ‹] */ #include "C:\Factory\Common\all.h" #include "C:\Factory\Common\Options\csv.h" static void CsvToJson(char *rFile, char *wFile) { autoList_t *csv = readCSVFileTR(rFile); autoList_t *head; uint rowidx; FILE *wfp; head = getList(csv, 0); // HACK: o—̓tƒH[ƒ}ƒbƒg“K“–.. wfp = fileOpen(wFile, "wt"); writeLine(wfp, "["); for(rowidx = 1; rowidx < getCount(csv); rowidx++) { autoList_t *row = getList(csv, rowidx); char *cell; uint colidx; writeLine(wfp, "\t{"); foreach(row, cell, colidx) { writeLine_x(wfp, xcout("\t\t\"%s\": \"%s\",", getLine(head, colidx), getLine(row, colidx))); } writeLine(wfp, "\t},"); } writeLine(wfp, "]"); fileClose(wfp); } int main(int argc, char **argv) { if(hasArgs(2)) { CsvToJson(getArg(0), getArg(1)); return; } CsvToJson(c_dropFile(), c_getOutFile("output.json")); openOutDir(); }
// Copyright 2016 Jonathan Buchanan. // This file is part of Sunglasses, which is licensed under the MIT License. // See LICENSE.md for details. #ifndef TEXTURERESOURCE_H #define TEXTURERESOURCE_H #include <sunglasses/Extern/Resource.h> #include <string> #include <GL/glew.h> namespace sunglasses { class TextureResource : public Resource { public: /// Constructs the texture resource with a path to the texture. /** * This constructor initializes the file member with the parameter. * @param _file The path to the texture */ TextureResource(std::string _file); /// Loads the texture from the file. void init(); /// Gets the texture GLuint getTexture() { return texture; } private: /// The path to the texture std::string file; /// The OpenGL texture object GLuint texture; }; } // namespace #endif
// // CLJIChunk.h // PersistentStructure // // Created by Robert Widmann on 3/26/14. // Copyright (c) 2014 CodaFi. All rights reserved. // Released under the MIT license. // #import "CLJIIndexed.h" #include "CLJTypes.h" /// The CLJIChunk protocol declares the two methods necessary for an object to call itself a /// 'Chunk'. Chunks are windows into the values of a collection that permit only reduction @protocol CLJIChunk <CLJIIndexed> /// Returns a new chunk with the same objects as the reciever except the first. - (id<CLJIChunk>)tail; /// Applies a reducer function to all the elements of the chunk in sequence. - (id)reduce:(CLJIReduceBlock)f start:(id)start; @end
#pragma once #include "vec3.h" namespace solar { class mat33 { public: static const int FORWARD_ROW_INDEX; static const int UP_ROW_INDEX; static const int CROSS_ROW_INDEX; private: #pragma warning(push) #pragma warning(disable:4201) //warning C4201: nonstandard extension used: nameless struct/union union { float _values[3][3]; struct { float _v00, _v01, _v02; float _v10, _v11, _v12; float _v20, _v21, _v22; }; }; #pragma warning(pop) public: mat33(); mat33( float v00, float v01, float v02, float v10, float v11, float v12, float v20, float v21, float v22); float& at(int row, int column); float at(int row, int column) const; const vec3& get_row(int row) const; vec3& get_row(int row); const vec3& get_forward() const; const vec3& get_up() const; const vec3& get_cross() const; public: friend vec2 operator*(const vec2& vec, const mat33& mat); friend vec3 operator*(const vec3& vec, const mat33& mat); public: friend mat33 make_mat33_identity(); friend mat33 make_mat33_rotation_on_x(float radians); friend mat33 make_mat33_rotation_on_y(float radians); friend mat33 make_mat33_rotation_on_z(float radians); friend mat33 make_mat33_rotation_with_forward(const vec3& forward, const vec3& up); }; inline float& mat33::at(int row, int column) { return _values[row][column]; } inline float mat33::at(int row, int column) const { return _values[row][column]; } inline const vec3& mat33::get_row(int row) const { return reinterpret_cast<const vec3&>(_values[row][0]); } inline vec3& mat33::get_row(int row) { return reinterpret_cast<vec3&>(_values[row][0]); } inline const vec3& mat33::get_forward() const { return get_row(FORWARD_ROW_INDEX); } inline const vec3& mat33::get_up() const { return get_row(UP_ROW_INDEX); } inline const vec3& mat33::get_cross() const { return get_row(CROSS_ROW_INDEX); } }
// Copyright 2014 Yu Jing<yujing5b5d@gmail.com> #ifndef INCLUDE_ARGCV_UTIL_UTIL_H_ #define INCLUDE_ARGCV_UTIL_UTIL_H_ #include <cmath> #include <ctime> #include <cstdint> // uint64_t #include <sstream> #include <string> #include <vector> #include <map> namespace argcv { namespace util { // c style hash key generator // void crypt_init(); // for hash key generator // uint64_t hash(const char * k, uint64_t offset); // uint64_t hash(const std::string & k, uint64_t offset); // c++ style hash key genertator class BlzKeygen { public : static BlzKeygen & instance() { static BlzKeygen hk; return hk; } virtual ~BlzKeygen(); // k : string , offset should not too much , 0~3 in suggestion uint64_t hash(const std::string & k, uint16_t offset); private : BlzKeygen(); // Private constructor BlzKeygen(const BlzKeygen &); // Prevent copy-construction BlzKeygen &operator=(const BlzKeygen &); // Prevent assignment uint64_t crypt[0x500]; // Seed }; // tf-idf // assume : k in document D // stid : size of term k in D // atsid : all term size in D // ads : all document size // dscct : document size contains current term inline double tf_idf(size_t stid, size_t atsid, size_t ads, size_t dscct) { // #define MATH_LG_10 2.302585 // tf * idf if (ads == 0 || atsid == 0 || dscct == 0) return 0; return (static_cast<double>(stid) / atsid) * log(static_cast<double>(ads) / (dscct))/2.302585; } inline static std::string random_str(const int len) { static const char alphanum[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; std::stringstream ss; for (int i = 0; i < len; ++i) { ss << alphanum[rand() % (sizeof(alphanum) - 1)]; } return ss.str(); } std::vector<std::string> &split(const std::string &s, const std::string &delim, std::vector<std::string> *_elems); std::vector<std::string> split(const std::string &s, const std::string &delim); bool parse_utf8(const std::string &s,std::vector<std::string> *_elems); } // namespace util } // namespace argcv #endif // INCLUDE_ARGCV_UTIL_UTIL_H_
// Copyright (c) 2015 The Truthcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef TRUTHCOIN_QT_BALLOTSEALEDVOTEFILTERPROXYMODEL_H #define TRUTHCOIN_QT_BALLOTSEALEDVOTEFILTERPROXYMODEL_H #include <QModelIndex> #include <QObject> #include <QSortFilterProxyModel> #include <QString> class BallotSealedVoteFilterProxyModel : public QSortFilterProxyModel { Q_OBJECT public: explicit BallotSealedVoteFilterProxyModel(QObject *parent=0) : QSortFilterProxyModel(parent) { } protected: private: }; #endif // TRUTHCOIN_QT_BALLOTSEALEDVOTEFILTERPROXYMODEL_H