text
stringlengths 4
6.14k
|
|---|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int over,chislo,temp,i=0,counter,chisloto_org;
char hex[20];
scanf("%d",&chislo);
chisloto_org=chislo;
do{
chislo=chisloto_org;
i=0;
while(chislo!=0){
temp=chislo%16;
switch(temp){
case 0:
hex[i]='0';
break;
case 1:
hex[i]='1';
break;
case 2:
hex[i]='2';
break;
case 3:
hex[i]='3';
break;
case 4:
hex[i]='4';
break;
case 5:
hex[i]='5';
break;
case 6:
hex[i]='6';
break;
case 7:
hex[i]='7';
break;
case 8:
hex[i]='8';
break;
case 9:
hex[i]='9';
break;
case 10:
hex[i]='A';
break;
case 11:
hex[i]='B';
break;
case 12:
hex[i]='C';
break;
case 13:
hex[i]='D';
break;
case 14:
hex[i]='E';
break;
case 15:
hex[i]='F';
break;
}
chislo/=16;
i++;}
counter=i-1;
for(temp=0;temp<i;temp++){
if(temp>(i/2))
break;
else if(hex[temp]==hex[counter])
counter--;
else break;}
if(counter<=temp)
over=1;
else chisloto_org++;
}while(over==0);
i=i-1;
while(i>=0)
{printf("%c",hex[i]);
i--;
}
}
|
#ifndef OPERADOR_H
#define OPERADOR_H
#include <string>
#include <iostream>
#include "excepciones\EMalformedBlockError.h"
// Operandos
#include "Operando.h"
#include "operandos\OpEntero.h"
#include "operandos\OpFlotante.h"
#include "operandos\OpCadena.h"
#include "operandos\OpBooleano.h"
/// Clase base para los operadores soportados
class Operador
{
public:
/// plantilla para la función que ejecuta la operación correspondiente al operador.
/// @param opA Puntero a @see Operando
/// @param opB Puntero a @see Operando
/// @return Cadena con el resultado de la operación.
virtual std::string ejecuta(Operando* opA, Operando* opB)=0;
/// función que devuelve el símbolo que identifica el operador.
/// @return string con el símbolo.
virtual std::string getSimbolo()=0;
};
#endif // OPERADOR_H
|
#ifndef SCENENODEQUEUE_H
#define SCENENODEQUEUE_H
#include "../../SDK/SceneGraph/SceneNodeBase.h"
#include "../../SDK/Platform.h"
#include <vector>
#include <set>
namespace Scene
{
class SceneNodeQueue
{
public:
/// <summary>Конструктор класса.</summary>
SceneNodeQueue(void);
/// <summary>Деструктор класса.</summary>
virtual ~SceneNodeQueue(void) {}
virtual void CascadeUpdate(void);
private:
typedef std::set<ISceneNodeBase*> ChildUpdateSet;
mutable ChildUpdateSet childrenToUpdate;
typedef std::vector<ISceneNodeBase*> QueuedUpdates;
static QueuedUpdates queuedUpdates;
};
}
#endif // SCENENODEQUEUE_H
|
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "cocos2d.h"
//#import "gameEnd.h"
#import "labelSelection.h"
#import "menuPage.h"
#import "HelloWorldScene.h"
#import "HUDsound.h"
#import "labelSelection.h"
#import "about.h"
#import "tutorial.h"
#import "insPage.h"
//#import "SimpleAudioEngine.h"
@interface otherGames : CCLayer <UIWebViewDelegate>
{
//CCMenuItem *_plusItem;
//CCMenuItem *_minusItem;
UIScrollView *scrollView1;
CCMenuItemImage * _plusItem, * _minusItem;
CCMenuItemImage * _plusItem1, * _minusItem1;
UIWebView *vw_img1;
//UIButton *btnimgvAlShow;
}
-(void) startOfGame;
- (void)viewWillDisappear;
-(void)otherGamesCase;
-(void)buttonPressed;
-(void)levelSelectionPage;
-(void)needToStart2;
@end
|
/*
* Physical memory allocation
* Copyright (c) 2001,2003,2004 David H. Hovemeyer <daveho@cs.umd.edu>
* Copyright (c) 2003, Jeffrey K. Hollingsworth <hollings@cs.umd.edu>
* $Revision: 1.36 $
*
* This is free software. You are permitted to use,
* redistribute, and modify it as specified in the file "COPYING".
*/
#ifndef GEEKOS_MEM_H
#define GEEKOS_MEM_H
#include <geekos/ktypes.h>
#include <geekos/defs.h>
#include <geekos/list.h>
#include <geekos/paging.h>
struct Boot_Info;
/*
* Page flags
*/
#define PAGE_AVAIL 0x0000 /* page is on the freelist */
#define PAGE_KERN 0x0001 /* page used by kernel code or data */
#define PAGE_HW 0x0002 /* page used by hardware (e.g., ISA hole) */
#define PAGE_ALLOCATED 0x0004 /* page is allocated */
#define PAGE_UNUSED 0x0008 /* page is unused */
#define PAGE_HEAP 0x0010 /* page is in kernel heap */
#define PAGE_PAGEABLE 0x0020 /* page can be paged out */
#define PAGE_LOCKED 0x0040 /* page is taken should not be freed */
/*
* PC memory map
*/
#define ISA_HOLE_START 0x0A0000
#define ISA_HOLE_END 0x100000
/*
* We reserve the two pages just after the ISA hole for the initial
* kernel thread's context object and stack.
*/
#define HIGHMEM_START (ISA_HOLE_END + 8192)
#define REST_OF_MEM_START HIGHMEM_START + KERNEL_HEAP_SIZE
/*
* Make the kernel heap this size
*/
#define KERNEL_HEAP_SIZE (1024*1024)
struct Page;
/*
* List datatype for doubly-linked list of Pages.
*/
DEFINE_LIST(Page_List, Page);
/*
* Each page of physical memory has one of these structures
* associated with it, to do allocation and bookkeeping.
*/
struct Page {
unsigned flags; /* Flags indicating state of page */
DEFINE_LINK(Page_List, Page); /* Link fields for Page_List */
int clock;
ulong_t vaddr; /* User virtual address where page is mapped */
pte_t *entry; /* Page table entry referring to the page */
};
IMPLEMENT_LIST(Page_List, Page);
void Init_Mem(struct Boot_Info* bootInfo);
void Init_BSS(void);
void* Alloc_Page(void);
void* Alloc_Pageable_Page(pte_t *entry, ulong_t vaddr);
void Free_Page(void* pageAddr);
/*
* Determine if given address is a multiple of the page size.
*/
static __inline__ bool Is_Page_Multiple(ulong_t addr)
{
return addr == (addr & ~(PAGE_MASK));
}
/*
* Round given address up to a multiple of the page size
*/
static __inline__ ulong_t Round_Up_To_Page(ulong_t addr)
{
if ((addr & PAGE_MASK) != 0) {
addr &= ~(PAGE_MASK);
addr += PAGE_SIZE;
}
return addr;
}
/*
* Round given address down to a multiple of the page size
*/
static __inline__ ulong_t Round_Down_To_Page(ulong_t addr)
{
return addr & (~PAGE_MASK);
}
/*
* Get the index of the page in memory.
*/
static __inline__ int Page_Index(ulong_t addr)
{
return (int) (addr >> PAGE_POWER);
}
/*
* Get the Page struct associated with given address.
*/
static __inline__ struct Page *Get_Page(ulong_t addr)
{
extern struct Page* g_pageList;
return &g_pageList[Page_Index(addr)];
}
/*
* Get the physical address of the memory represented by given Page object.
*/
static __inline__ ulong_t Get_Page_Address(struct Page *page)
{
extern struct Page* g_pageList;
ulong_t index = page - g_pageList;
return index << PAGE_POWER;
}
#endif /* GEEKOS_MEM_H */
|
#pragma once
#include "Hero.h"
class Monk : public Hero
{
public:
Monk() = default;
Monk(int idx);
~Monk() override = default;
};
|
/*
Video Core
Copyright (c) 2014 James G. Hurley
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.
*/
/*!
* A simple Objective-C Session API that will create an RTMP session using the
* device's camera(s) and microphone.
*
*/
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
@class VCSimpleSession;
typedef NS_ENUM(NSInteger, VCSessionState)
{
VCSessionStateNone,
VCSessionStatePreviewStarted,
VCSessionStateStarting,
VCSessionStateStarted,
VCSessionStateEnded,
VCSessionStateError
};
typedef NS_ENUM(NSInteger, VCCameraState)
{
VCCameraStateFront,
VCCameraStateBack
};
typedef NS_ENUM(NSInteger, VCAspectMode)
{
VCAspectModeFit,
VCAscpectModeFill
};
typedef NS_ENUM(NSInteger, VCPacketizerProfileLevel)
{
VCPacketizerProfileLevelBaseline,
VCPacketizerProfileLevelMain,
VCPacketizerProfileLevelHigh
};
@protocol VCSessionDelegate <NSObject>
@required
- (void) connectionStatusChanged: (VCSessionState) sessionState;
@optional
- (void) didAddCameraSource:(VCSimpleSession*)session;
- (void) detectedThroughput: (NSInteger) throughputInBytesPerSecond;
//- (void) changeExposure;
@end
@interface VCSimpleSession : NSObject
@property (nonatomic, readonly) VCSessionState rtmpSessionState;
@property (nonatomic, strong, readonly) UIView* previewView;
/*! Setters / Getters for session properties */
@property (nonatomic, assign) CGSize videoSize; // Change will not take place until the next RTMP Session
@property (nonatomic, assign) int bitrate; // Change will not take place until the next RTMP Session
@property (nonatomic, assign) int fps; // Change will not take place until the next RTMP Session
@property (nonatomic, assign) VCPacketizerProfileLevel packetizerProfileLevel; // Change will not take place until the next RTMP Session
@property (nonatomic, assign, readonly) BOOL useInterfaceOrientation;
@property (nonatomic, assign) VCCameraState cameraState;
@property (nonatomic, assign) BOOL orientationLocked;
@property (nonatomic, assign) BOOL torch;
@property (nonatomic, assign) float videoZoomFactor;
@property (nonatomic, assign) int audioChannelCount;
@property (nonatomic, assign) float audioSampleRate;
@property (nonatomic, assign) float micGain; // [0..1]
@property (nonatomic, assign) CGPoint focusPointOfInterest; // (0,0) is top-left, (1,1) is bottom-right
@property (nonatomic, assign) CGPoint exposurePointOfInterest;
@property (nonatomic, assign) BOOL continuousAutofocus;
@property (nonatomic, assign) BOOL continuousExposure;
@property (nonatomic, assign) BOOL useAdaptiveBitrate; /* Default is off */
@property (nonatomic, readonly) int estimatedThroughput; /* Bytes Per Second. */
@property (nonatomic, assign) VCAspectMode aspectMode;
@property (nonatomic, assign) float exposureBias;
@property (nonatomic, assign) id<VCSessionDelegate> delegate;
// -----------------------------------------------------------------------------
- (instancetype) initWithVideoSize:(CGSize)videoSize
frameRate:(int)fps
bitrate:(int)bps;
// -----------------------------------------------------------------------------
- (instancetype) initWithVideoSize:(CGSize)videoSize
frameRate:(int)fps
bitrate:(int)bps
useInterfaceOrientation:(BOOL)useInterfaceOrientation;
// -----------------------------------------------------------------------------
- (instancetype) initWithVideoSize:(CGSize)videoSize
frameRate:(int)fps
bitrate:(int)bps
useInterfaceOrientation:(BOOL)useInterfaceOrientation
cameraState:(VCCameraState) cameraState;
// -----------------------------------------------------------------------------
- (instancetype) initWithVideoSize:(CGSize)videoSize
frameRate:(int)fps
bitrate:(int)bps
useInterfaceOrientation:(BOOL)useInterfaceOrientation
cameraState:(VCCameraState) cameraState
aspectMode:(VCAspectMode) aspectMode;
// -----------------------------------------------------------------------------
- (void) startRtmpSessionWithURL:(NSString*) rtmpUrl
andStreamKey:(NSString*) streamKey;
- (void) endRtmpSession;
- (void) getCameraPreviewLayer: (AVCaptureVideoPreviewLayer**) previewLayer;
/*!
* Note that the rect you provide should be based on your video dimensions. The origin
* of the image will be the center of the image (so if you put 0,0 as its position, it will
* basically end up with the bottom-right quadrant of the image hanging out at the top-left corner of
* your video)
*/
- (void) addPixelBufferSource: (UIImage*) image
withRect: (CGRect) rect;
@end
|
#define printable(a) (((a) >= 32 && (a) <= 126) || (a) == '\t' || (a) == '\n')
#define MAX_PROCESSES 100
#define MAX_BURSTS 1000
#define MAX_TOKEN_LENGTH 30
#define MAX_LINE_LENGTH (1<<16)
#define NUMBER_OF_PROCESSORS 4
#define NUMBER_OF_LEVELS 3
#define COMMENT_CHAR '#'
#define COMMENT_LINE -1
typedef struct burst{
int length;
int step;
} Burst;
typedef struct process{
int pid;
int arrivalTime;
int startTime;
int endTime;
int waitingTime;
int currentBurst;
int numOfBursts;
struct burst bursts[MAX_BURSTS];
int priority;
int quantumRemaining;
int currentQueue;
} Process;
typedef struct process_node{
struct process *data;
struct process_node *next;
} Process_node;
typedef struct process_queue{
int size;
struct process_node *front;
struct process_node *back;
} Process_queue;
/* Error management functions */
void error(char *);
void error_malformed_input_line(char *);
void error_too_many_bursts(int);
void error_duplicate_pid(int pid);
void error_bad_quantum(void);
void error_invalid_number_of_processes(int numberOfProcesses);
/* Scheduling functions */
double averageWaitTime(int theWait);
double averageTurnaroundTime(int theTurnaround);
double averageUtilizationTime(int theUtilization);
Process *nextScheduledProcess(void);
int compareArrivalTime(const void *a, const void *b);
int runningProcesses(void);
void addNewIncomingProcess(void);
int totalIncomingProcesses(void);
void waitingToReady(void);
void readyToRunning(void);
void runningToWaiting(void);
void displayResults(float awt, float atat, int sim, float aut, int cs, int pid);
void resetVariables(void);
void updateStates(void);
/* Queue management functions */
Process_node *createProcessNode(Process *);
void initializeProcessQueue(Process_queue *);
void enqueueProcess(Process_queue *, Process *);
void dequeueProcess(Process_queue *);
/* Input/Output functions */
char *readLine(void);
char *readLineHelper(char *, int);
int readInt(char **);
int readBracedInt(char **);
int empty(char *);
int readProcess(Process *);
|
//
// R9HTTPRequest.h
// R9HTTPRequest
//
// Created by taisuke fujita on 2017/10/03.
// Copyright © 2017年 Revolution9. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for R9HTTPRequest.
FOUNDATION_EXPORT double R9HTTPRequestVersionNumber;
//! Project version string for R9HTTPRequest.
FOUNDATION_EXPORT const unsigned char R9HTTPRequestVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <R9HTTPRequest/PublicHeader.h>
|
//
// DoneItemGroup.h
// EasyTodo
//
// Created by pwnlc on 16/9/18.
// Copyright © 2016年 xyz.pwnlc. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
已完成 item group 类。
*/
@interface DoneItemGroup : NSObject
/**
items 完成的日期。
*/
@property (nonatomic, copy) NSString *finishTime;
/**
日期内完成的 items 数组。
*/
@property (nonatomic, strong) NSMutableArray *doneItemsArr;
@end
|
//
// WKInterfaceObject+IRLSize.h
// IRLSize
//
// Created by Jeff Kelley on 6/29/2016.
// Copyright © 2019 Detroit Labs. All rights reserved.
//
#import <WatchKit/WatchKit.h>
#import "IRLSize.h"
NS_ASSUME_NONNULL_BEGIN
@interface WKInterfaceObject (IRLSize)
/**
Sets the physical width of the interface object on screen.
@param width The physical width to set on the interface object.
*/
- (void)irl_setPhysicalWidth:(NSMeasurement<NSUnitLength *> *)width NS_SWIFT_NAME(setPhysicalWidth(_:)) IRL_WATCHOS_AVAILABLE(3.0);
/**
Sets the physical height of the interface object on screen.
@param height The physical height to set on the interface object.
*/
- (void)irl_setPhysicalHeight:(NSMeasurement<NSUnitLength *> *)height NS_SWIFT_NAME(setPhysicalHeight(_:)) IRL_WATCHOS_AVAILABLE(3.0);
/**
Sets the physical width of the interface object on screen.
@param width The physical width to set on the interface object as a raw value.
*/
- (void)irl_setRawPhysicalWidth:(IRLRawMillimeters)width NS_SWIFT_NAME(setRawPhysicalWidth(_:));
/**
Sets the physical height of the interface object on screen.
@param height The physical height to set on the interface object as a raw value.
*/
- (void)irl_setRawPhysicalHeight:(IRLRawMillimeters)height NS_SWIFT_NAME(setRawPhysicalHeight(_:));
@end
NS_ASSUME_NONNULL_END
|
/**
* \file
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef _SAM3S_WDT_COMPONENT_
#define _SAM3S_WDT_COMPONENT_
/* ============================================================================= */
/** SOFTWARE API DEFINITION FOR Watchdog Timer */
/* ============================================================================= */
/** \addtogroup SAM3S_WDT Watchdog Timer */
/*@{*/
#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
/** \brief Wdt hardware registers */
typedef struct {
WoReg WDT_CR; /**< \brief (Wdt Offset: 0x00) Control Register */
RwReg WDT_MR; /**< \brief (Wdt Offset: 0x04) Mode Register */
RoReg WDT_SR; /**< \brief (Wdt Offset: 0x08) Status Register */
} Wdt;
#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/* -------- WDT_CR : (WDT Offset: 0x00) Control Register -------- */
#define WDT_CR_WDRSTT (0x1u << 0) /**< \brief (WDT_CR) Watchdog Restart */
#define WDT_CR_KEY_Pos 24
#define WDT_CR_KEY_Msk (0xffu << WDT_CR_KEY_Pos) /**< \brief (WDT_CR) Password */
#define WDT_CR_KEY(value) ((WDT_CR_KEY_Msk & ((value) << WDT_CR_KEY_Pos)))
/* -------- WDT_MR : (WDT Offset: 0x04) Mode Register -------- */
#define WDT_MR_WDV_Pos 0
#define WDT_MR_WDV_Msk (0xfffu << WDT_MR_WDV_Pos) /**< \brief (WDT_MR) Watchdog Counter Value */
#define WDT_MR_WDV(value) ((WDT_MR_WDV_Msk & ((value) << WDT_MR_WDV_Pos)))
#define WDT_MR_WDFIEN (0x1u << 12) /**< \brief (WDT_MR) Watchdog Fault Interrupt Enable */
#define WDT_MR_WDRSTEN (0x1u << 13) /**< \brief (WDT_MR) Watchdog Reset Enable */
#define WDT_MR_WDRPROC (0x1u << 14) /**< \brief (WDT_MR) Watchdog Reset Processor */
#define WDT_MR_WDDIS (0x1u << 15) /**< \brief (WDT_MR) Watchdog Disable */
#define WDT_MR_WDD_Pos 16
#define WDT_MR_WDD_Msk (0xfffu << WDT_MR_WDD_Pos) /**< \brief (WDT_MR) Watchdog Delta Value */
#define WDT_MR_WDD(value) ((WDT_MR_WDD_Msk & ((value) << WDT_MR_WDD_Pos)))
#define WDT_MR_WDDBGHLT (0x1u << 28) /**< \brief (WDT_MR) Watchdog Debug Halt */
#define WDT_MR_WDIDLEHLT (0x1u << 29) /**< \brief (WDT_MR) Watchdog Idle Halt */
/* -------- WDT_SR : (WDT Offset: 0x08) Status Register -------- */
#define WDT_SR_WDUNF (0x1u << 0) /**< \brief (WDT_SR) Watchdog Underflow */
#define WDT_SR_WDERR (0x1u << 1) /**< \brief (WDT_SR) Watchdog Error */
/*@}*/
#endif /* _SAM3S_WDT_COMPONENT_ */
|
#ifndef OBJECT_MANAGER_H_
#define OBJECT_MANAGER_H_
#include <string>
#include <vector>
#include "game.h"
// TODO: Refactor/rename Object, ObjectManager, Background, Tile, Item, LevelObject, ...
class ObjectManager
{
public:
ObjectManager()
: backgrounds_(),
tiles_(),
items_()
{
}
bool load(const std::string& filename);
const Background& get_background(int id) const { return backgrounds_[id]; }
const Tile& get_tile(int id) const { return tiles_[id]; }
const Item& get_item(int id) const { return items_[id]; }
private:
std::vector<Background> backgrounds_;
std::vector<Tile> tiles_;
std::vector<Item> items_;
};
#endif // OBJECT_MANAGER_H_
|
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.0.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QWidget *centralWidget;
QMenuBar *menuBar;
QMenu *menuGuiCV;
QToolBar *mainToolBar;
QStatusBar *statusBar;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QStringLiteral("MainWindow"));
MainWindow->resize(400, 300);
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QStringLiteral("menuBar"));
menuBar->setGeometry(QRect(0, 0, 400, 25));
menuGuiCV = new QMenu(menuBar);
menuGuiCV->setObjectName(QStringLiteral("menuGuiCV"));
MainWindow->setMenuBar(menuBar);
mainToolBar = new QToolBar(MainWindow);
mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
statusBar = new QStatusBar(MainWindow);
statusBar->setObjectName(QStringLiteral("statusBar"));
MainWindow->setStatusBar(statusBar);
menuBar->addAction(menuGuiCV->menuAction());
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "GuiCV", 0));
menuGuiCV->setTitle(QApplication::translate("MainWindow", "GuiCV", 0));
} // retranslateUi
};
namespace Ui {
class MainWindow: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int grand(int min,int max) {
int n;
n = rand();
n = n % max;
n = n + min;
return n;
}
int main(int argc,char** argv) {
int i,j,number_jobs,min_lim,max_lim,n;
if(argc != 4) {
printf("Command pattern: command \"NUMBER_OF_JOBS\" \"MIN_LIMIT\" \"MAX_LIMIT\"\n");
return 0;
}
srand((unsigned) time(NULL));
number_jobs = atoi(argv[1]);
min_lim = atoi(argv[2]);
max_lim = atoi(argv[3]) + 1;
for(i=0;i<number_jobs;i++) {
for(j=0;j<2;j++) {
n = grand(min_lim,max_lim);
printf("%d ",n);
}
n = grand(min_lim,max_lim);
printf("%d\n",n);
}
return 0;
}
|
//
// UIImage+Addition.h
// WGKitDemo
//
// Created by dfhb@rdd on 16/11/25.
// Copyright © 2016年 guojunwei. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Addition)
/** 返回一张自由拉伸的图片(以中心点延伸) */
+ (UIImage *)wg_resizedImageWithName:(NSString *)name;
/** 返回一张自由拉伸的图片(以中心点延伸) */
- (UIImage *)wg_resizedImage;
- (UIImage *)wg_resizedImageWithCapInsets:(UIEdgeInsets)capInsets;
/** 返回指定size的图片 */
- (UIImage *)wg_resizedImageWithNewSize:(CGSize)newSize;
@end
@interface UIImage (Color)
/** 根据颜色返回一张图片(默认size为(1,1)) */
+ (UIImage *)wg_imageWithColor:(UIColor *)color;
/** 根据颜色返回一张图片 */
+ (UIImage *)wg_imageWithColor:(UIColor *)color size:(CGSize)size;
/** 返回一张圆图片 */
- (UIImage *)wg_circleImage;
/** 返回一个带圆角的图片 */
- (UIImage *)wg_imageWithCornerRadius:(CGFloat)cornerRadius;
/** 返回一个带圆角,边框的图片 */
- (UIImage *)wg_imageWithCornerRadius:(CGFloat)cornerRadius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;
@end
|
C $Header$
C
C /==========================================================\
C | SIZE.h Declare size of underlying computational grid. |
C |==========================================================|
C | The design here support a three-dimensional model grid |
C | with indices I,J and K. The three-dimensional domain |
C | is comprised of nPx*nSx blocks of size sNx along one axis|
C | nPy*nSy blocks of size sNy along another axis and one |
C | block of size Nz along the final axis. |
C | Blocks have overlap regions of size OLx and OLy along the|
C | dimensions that are subdivided. |
C \==========================================================/
C Voodoo numbers controlling data layout.
C sNx - No. X points in sub-grid.
C sNy - No. Y points in sub-grid.
C OLx - Overlap extent in X.
C OLy - Overlat extent in Y.
C nSx - No. sub-grids in X.
C nSy - No. sub-grids in Y.
C nPx - No. of processes to use in X.
C nPy - No. of processes to use in Y.
C Nx - No. points in X for the total domain.
C Ny - No. points in Y for the total domain.
C Nr - No. points in Z for full process domain.
INTEGER sNx
INTEGER sNy
INTEGER OLx
INTEGER OLy
INTEGER nSx
INTEGER nSy
INTEGER nPx
INTEGER nPy
INTEGER Nx
INTEGER Ny
INTEGER Nr
PARAMETER (
& sNx = 8,
& sNy = 4,
& OLx = 2,
& OLy = 2,
& nSx = 176,
& nSy = 1,
& nPx = 1,
& nPy = 1,
& Nx = sNx*nSx*nPx,
& Ny = sNy*nSy*nPy,
& Nr = 15)
C MAX_OLX - Set to the maximum overlap region size of any array
C MAX_OLY that will be exchanged. Controls the sizing of exch
C routine buufers.
INTEGER MAX_OLX
INTEGER MAX_OLY
PARAMETER ( MAX_OLX = OLx,
& MAX_OLY = OLy )
|
//
// 2017-05-08, jjuiddong
// shader macro define
//
#pragma once
#define SHADER_SETFLOAT_MACRO(funcname, key, handle)\
D3DXHANDLE handle=NULL;\
void funcname(const float &val)\
{\
RET(!m_effect);\
if (!handle)\
handle = m_effect->GetParameterByName(NULL, key);\
if (FAILED(m_effect->SetFloat(handle, val)))\
{\
assert(0);\
MessageBoxA(NULL, \
format("cShader::"#funcname" [%s] Error", key).c_str(), "ERROR", MB_OK);\
}\
}
#define SHADER_SETVECTOR_MACRO(funcname, key, handle)\
D3DXHANDLE handle=NULL;\
void funcname(const Vector3 &vec)\
{\
RET(!m_effect);\
if (!handle)\
handle = m_effect->GetParameterByName(NULL, key);\
if (FAILED(m_effect->SetVector(handle, &D3DXVECTOR4(vec.x, vec.y, vec.z, 1))))\
{\
assert(0);\
MessageBoxA(NULL, \
format("cShader::"#funcname" [%s] Error", key).c_str(), "ERROR", MB_OK);\
}\
}
#define SHADER_SETMATRIX_MACRO(funcname, key, handle)\
D3DXHANDLE handle=NULL;\
void funcname(const Matrix44 &mat)\
{\
RET(!m_effect);\
if (!handle)\
handle = m_effect->GetParameterByName(NULL, key);\
if (FAILED(m_effect->SetMatrix(handle, (D3DXMATRIX*)&mat)))\
{\
assert(0);\
MessageBoxA(NULL, \
format("cShader::"#funcname" [%s] Error", key).c_str(), "ERROR", MB_OK);\
}\
}
|
#import <MapKit/MapKit.h>
#pragma mark -
@interface MKMapView (Zoom)
@property (assign, nonatomic) NSUInteger zoomLevel;
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
zoomLevel:(NSUInteger)zoomLevel
animated:(BOOL)animated;
@end
|
#ifndef INVENTORY_H
#define INVENTORY_H
#include <stdbool.h>
#include "item.h"
#include "list.h"
struct inventory {
unsigned int size;
unsigned int capacity;
struct list contents;
};
void inventory_init(struct inventory *inventory);
bool inventory_add(struct inventory *inventory, struct item *item);
struct item *inventory_remove(struct inventory *inventory, const char *name);
struct item *inventory_get(struct inventory *inventory, const char *name);
void inventory_free(struct inventory *inventory);
void inventory_contents_print(struct inventory *inventory);
#endif
|
#include <stdlib.h>
#include "tick.h"
#include "hw_config.h"
#include "typedef.h"
static volatile U32 internalTicks;
#define TICK__DisableInt() NVIC_Config(SysTick_IRQn, TICK_PRIORITY, DISABLE);
#define TICK__EnableInt() NVIC_Config(SysTick_IRQn, TICK_PRIORITY, ENABLE);
typedef struct _TICK{
struct _TICK* next;
void (*pCallback)(U64 currentTimerValue); // function to be called
U64 interval; // callback interval
U64 currCnt; // current count value
}TICK;
U64 vtimerValue = 0;
TICK* vtimerHead = 0;
TICK* vtimerTail = 0;
void TICK_Init(void)
{
SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);
SysTick_Config(SystemCoreClock/1000); //Tick every 1ms
internalTicks = 0;
vtimerHead = 0;
vtimerTail = 0;
NVIC_Config(SysTick_IRQn, TICK_PRIORITY, ENABLE);
NVIC_SetPriority(SysTick_IRQn, TICK_PRIORITY);
}
/**
* Create a Virtual timer object
* @param vtimerCallback this function will be call when the timer expired
* @param interval callback interval, base on the rate of VTIMER resolution. Set interval = 0 to disable
* @return handle to the newly created VTIMER
*/
TICK_HANDLE TICK_Create(void (*vtimerCallback)(U64 currentTimerValue), U64 interval)
{
TICK* newNode = 0;
if (vtimerCallback){
newNode = malloc(sizeof(TICK));
if(newNode){
newNode->pCallback = vtimerCallback;
newNode->interval = newNode->currCnt = interval;
newNode->next = 0;
TICK__DisableInt();
if(vtimerTail == 0){
vtimerHead = vtimerTail = newNode;
}else{
vtimerTail->next = newNode;
vtimerTail = newNode;
}
TICK__EnableInt();
}
}
return (TICK_HANDLE) newNode;
}
/*******************************************************************************
* Function Name : SysTick_Handler
* Description : This function handles SysTick Handler.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
/**
* Delete a VTIMER object and release all allocated memory
* @param vtimerHandle handle to a VTIMER object
* @return 0 if OK
*/
I8 TICK_Delete(TICK_HANDLE vtimerHandle)
{
TICK *pTmr, *prev;
if (vtimerHandle == 0)
return -1;
if (vtimerHead == 0)
return -1;
TICK__DisableInt();
if((pTmr = vtimerHead) == (TICK*) vtimerHandle){ // remove head
if (vtimerHead == vtimerTail){
vtimerHead = vtimerTail = 0;
}else{
vtimerHead = pTmr->next;
}
}else
for (prev = vtimerHead, pTmr = vtimerHead->next; pTmr != 0; prev = pTmr, pTmr = pTmr->next){ // search within the list
if (pTmr == (TICK*) vtimerHandle){ // found it
prev->next = pTmr->next;
if (vtimerTail == pTmr){ // adjust tail
vtimerTail = prev;
}
break;
}
}
TICK__EnableInt();
if(pTmr){
free(pTmr);
}
return pTmr != 0;
}
void SysTick_Handler()
{
TICK *pTmr;
vtimerValue++;
for(pTmr = vtimerHead; pTmr != 0; pTmr = pTmr->next){
if(pTmr->interval != 0){
if (--pTmr->currCnt == 0){
pTmr->currCnt = pTmr->interval;
(*pTmr->pCallback)(vtimerValue);
}
}
}
}
|
#ifndef TOOLPASS_SERVER_h
#define TOOLPASS_SERVER_h
#include "ESP8266_Simple.h"
#include <SoftwareSerial.h>
class ToolpassServer {
public:
ToolpassServer(short rxPin, short txPin, const char *SSID, const char *Password, Print *debugPrinter, int tool_id);
~ToolpassServer();
void Test();
bool ToolOn(char *user_id);
void ToolOff();
void Log(float seconds, float temperature);
private:
ESP8266_Simple *wifi;
Print *debugPrinter;
char *user_id;
int tool_id;
};
#endif
|
//
// ATBlueoothTool.h
// ATBluetooth
//
// Created by 敖然 on 15/12/23.
// Copyright © 2015年 AT. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
@interface ATBlueoothTool : NSObject
+ (NSString *)properties:(CBCharacteristicProperties)properties separator:(NSString *)separator;
@end
|
//
// YTKBatchRequest.h
//
// Copyright (c) 2012-2014 YTKNetwork https://github.com/yuantiku
//
// 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 "YTKRequest.h"
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class YTKBatchRequest;
/// 批量请求完成回调block
typedef void (^YTKBatchRequestCompletionBlock)(
__kindof YTKBatchRequest *request);
@protocol YTKBatchRequestDelegate <NSObject>
@optional
/// 批量请求完成回调方法
- (void)batchRequestFinished:(YTKBatchRequest *)batchRequest;
/// 批量请求失败回调方法
- (void)batchRequestFailed:(YTKBatchRequest *)batchRequest;
@end
@interface YTKBatchRequest : NSObject
/// 请求的唯一标识
@property(nonatomic) NSInteger tag;
/// 请求集合
@property(nonatomic, strong, readonly, nullable) NSArray *requestArray;
/// 批量请求委托对象
@property(nonatomic, weak, nullable) id<YTKBatchRequestDelegate> delegate;
/// 请求成功回调block
@property(nonatomic, copy, nullable)
YTKBatchRequestCompletionBlock successCompletionBlock;
/// 请求失败回调block
@property(nonatomic, copy, nullable)
YTKBatchRequestCompletionBlock failureCompletionBlock;
/// 实现`YTKRequestAccessory`协议的对象集合
@property(nonatomic, strong, nullable) NSMutableArray *requestAccessories;
/// 批量请求构造器
- (id)initWithRequestArray:(NSArray *)requestArray;
/// 将请求添加到请求队列
- (void)start;
/// 将请求从请求队列移出
- (void)stop;
/// 将请求添加到请求队列, 并以block方式回调
- (void)
startWithCompletionBlockWithSuccess:
(nullable YTKBatchRequestCompletionBlock)success
failure:(nullable YTKBatchRequestCompletionBlock)
failure;
/// 设置请求的block回调
- (void)
setCompletionBlockWithSuccess:(nullable YTKBatchRequestCompletionBlock)success
failure:(nullable YTKBatchRequestCompletionBlock)failure;
/// 清空block以打破循环引用
- (void)clearCompletionBlock;
/// 添加实现`YTKRequestAccessory`协议的对象, 用于hook请求的`start`和`stop`
- (void)addAccessory:(id<YTKRequestAccessory>)accessory;
/// 数据是否从缓存中获得
- (BOOL)isDataFromCache;
@end
NS_ASSUME_NONNULL_END
|
#include <stdbool.h>
#include <stdio.h>
#include "validator.h"
bool validateRange(Validator* pThis, int val) {
RangeValidator* p = (RangeValidator*)pThis;
return p->min <= val && val <= p->max;
}
bool validatePrevious(Validator* pThis, int val) {
PreviousValueValidator* p = (PreviousValueValidator*)pThis;
if (val < p->previousValue) return false;
p->previousValue = val;
return true;
}
void viewRange(Validator* pThis, char* pBuf, size_t size) {
RangeValidator* p = (RangeValidator*)pThis;
snprintf(pBuf, size, "Range(%d-%d)", p->min, p->max);
}
void viewPrevious(Validator* pThis, char* pBuf, size_t size) {
PreviousValueValidator* p = (PreviousValueValidator*)pThis;
snprintf(pBuf, size, "Previous(%d)", p->previousValue);
}
|
/*
// whatis.h
//
// Author: Pale Purple
// Created: 2016. 02. 18.
// Copyright (c) 2016 Pale Purple. All rights reserved.
//
// Get short description by using `whatis` shell command for default desc when
// adding new command.
*/
#ifndef _WHATIS_H
#define _WHATIS_H
#define WHATIS_SHELL_COMMAND "command -v whatis >> /dev/null"
#define WHATIS_FORMAT "whatis %s >/dev/null 2>/dev/null"
/* 30 -> |______ ______________________| */
#define WHATIS_FORMAT_LEN 30
#define WHATIS_SED_FORMAT "whatis %s |head -1 |sed -r -e 's/.* - //'"
/* 39 -> |______ _______________________________| */
#define WHATIS_SED_FORMAT_LEN 39
/**
* int whatis_is_installed() - check whatis command installed or not installed
*
* - return value
* 0 for not installed, 1 or non-zero value for installed
*/
int whatis_is_installed();
/**
* char* whatis_get(const char*)
*
* - description
* get command string as a parameter, then return the pointer to the description
* string. the string is dynamic allocated char pointer so you should free
* manually when end of life.
* - return value
* pointer to null-terminated string for success. null ptr returned if failed.
*/
char* whatis_get(const char *cmd);
#endif /* _WHATIS_H */
|
static const bool kDefaultEnabled = 1;
static const int kDefaultNumPRIs = 15;
static const int kDefaultNumGates = 9;
static const double kDefaultThreshold = 0.7;
|
struct file {
enum { FD_NONE, FD_PIPE, FD_INODE } type;
int ref; // reference count
char readable;
char writable;
struct pipe *pipe;
struct inode *ip;
uint off;
};
// in-memory copy of an inode
struct inode {
uint dev; // Device number
uint inum; // Inode number
int ref; // Reference count
int flags; // I_BUSY, I_VALID
short type; // copy of disk inode
short major;
short minor;
short nlink;
uint size;
uint addrs[NDIRECT+1];
// add by hgp
short child1;
short child2;
uint checksum;
};
#define I_BUSY 0x1
#define I_VALID 0x2
// table mapping major device number to
// device functions
struct devsw {
int (*read) (struct inode*, char*, int);
int (*write)(struct inode*, char*, int);
};
extern struct devsw devsw[];
#define CONSOLE 1
|
// Copyright (C) 2009-2013 Mischa Sandberg <mischasan@gmail.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License Version 2 as
// published by the Free Software Foundation. You may not use, modify or
// distribute this program under any other version of the GNU General
// Public License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// IF YOU ARE UNABLE TO WORK WITH GPL2, CONTACT ME.
//-------------------------------------------------------------------
//#define TAP
#include "msutil.h" // slurp ...
#include <sys/resource.h>
#ifdef TAP
#include "tap.h"
#endif
#include "rsort.h"
static int rsreccmp(RSREC **a, RSREC **b);
int
main(int argc, char **argv)
{
if (argc < 2 || argc > 3) {
fputs("usage: rsort_x <inputfile> [outfile | -]\n", stderr);
return 0;
}
MEMBUF inp = chomp(slurp(argv[1]));
if (nilbuf(inp)) die(": cannot read %s\n", argv[1]);
#ifdef TAP
plan_tests(1);
#endif
struct rusage ru;
getrusage(0, &ru);
long rss = ru.ru_maxrss;
int nrecs;
MEMREF *inpv = refsplit(inp.ptr, '\n', &nrecs);
RSREC **actv = malloc(nrecs * sizeof(*actv));
RSREC **expv = malloc(nrecs * sizeof(*expv));
uint8_t *data = malloc(inp.len + nrecs * sizeof(RSREC));
uint8_t *dp = data;
int i;
for (i = 0; i < nrecs; ++i) {
actv[i] = (RSREC*) dp;
actv[i]->leng = inpv[i].len;
memcpy(actv[i]->data, inpv[i].ptr, inpv[i].len);
dp = &actv[i]->data[inpv[i].len];
}
memcpy(expv, actv, nrecs * sizeof(*expv));
double t0 = tick();
rsort(actv, nrecs);
double t_rsort = tick() - t0;
getrusage(0, &ru);
rss = ru.ru_maxrss - rss;
t0 = tick();
qsort(expv, nrecs, sizeof(*expv), (qsort_cmp)rsreccmp);
double t_qsort = tick() - t0;
if (argc > 2) {
FILE *fp = strcmp(argv[2], "-") ? fopen(argv[2], "w") : stdout;
char buf[16384];
setvbuf(fp, buf, _IOFBF, 16384);
for (i = 0; i < nrecs; ++i)
fprintf(fp, "%.*s\n", actv[i]->leng, actv[i]->data);
if (fp != stdout)
fclose(fp);
}
int unstable = 0;
for (i = 1; i < nrecs; ++i) {
int rc = rsreccmp(&actv[i-1], &actv[i]);
if (rc > 0)
break;
if (rc == 0 && actv[i-1] > actv[i]) {
++unstable;
fprintf(stderr, "unstable at %d: %.*s\n", i, actv[i]->leng, actv[i]->data);
}
}
#ifdef TAP
ok(i == nrecs, "%d recs (%"FSIZE"d bytes) sorted correctly (%sstably) in %.2f/%.2f secs; rsort.rss=%ldKB",
nrecs, inp.len, unstable ? "un" : "", t_rsort, t_qsort, rss);
#else
fprintf(stderr, "%d recs (%"FSIZE"d bytes) sorted %scorrectly (%sstably) in %.2f/%.2f secs; rsort.rss=%ldKB\n",
nrecs, inp.len, i == nrecs ? "" : "in", unstable ? "un" : "", t_rsort, t_qsort, rss);
if (i < nrecs) {
fprintf(stderr, "[%d] %.*s\n", i-1, actv[i-1]->leng, actv[i-1]->data);
fprintf(stderr, "[%d] %.*s\n", i, actv[i]->leng, actv[i]->data);
}
#endif
buffree(inp);
free(actv);
free(data);
free(expv);
free(inpv);
#ifdef TAP
return exit_status();
#else
return 0;
#endif
}
static inline int imin(int a, int b) { return a < b ? a : b; }
static int rsreccmp(RSREC **a, RSREC **b)
{
int len = imin((*a)->leng, (*b)->leng);
int rc = memcmp((*a)->data, (*b)->data, len);
return rc ? rc : (*a)->leng - (*b)->leng;
}
|
//*==---------------------------* Obj-C *--------------------------------===//
//
// THIS FILE IS GENERATED BY INVAR. DO NOT EDIT !!!
//
//===----------------------------------------------------------------------==*//
#ifndef TESTDBMEMBERENTRY_H_
#define TESTDBMEMBERENTRY_H_
#import <Foundation/NSDictionary.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import "InvarProtoc.h"
/* 名字冲突的类型 */
@interface MemberEntry : NSObject <NSCopying, InvarEncode, InvarDecode, InvarEncodeJSON>
- (uint32_t ) id ; /* 主键,自增长 */
- (NSString *) phone ; /* 手机号码 */
- (NSString *) nickName ; /* 会员昵称 */
- (int64_t ) createTime; /* 创建时间 */
- (int64_t ) updateTime; /* 创建时间 */
- (NSMutableDictionary *) hotfix ; /* [AutoAdd] Hotfix */
- (MemberEntry *) setId : (uint32_t ) value; /* 0 uint32 */
- (MemberEntry *) setPhone : (NSString *) value; /* 1 string */
- (MemberEntry *) setNickName : (NSString *) value; /* 2 string */
- (MemberEntry *) setCreateTime: (int64_t ) value; /* 3 int64 */
- (MemberEntry *) setUpdateTime: (int64_t ) value; /* 4 int64 */
- (MemberEntry *) setHotfix : (NSMutableDictionary *) value; /* 5 map<string,string> */
@end /* @interface MemberEntry */
#endif /* TESTDBMEMBERENTRY_H_ */
|
/*****************************************************************************
The MIT License(MIT)
Copyright(c) 2016 Amr Essam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
********************************************************************************/
#pragma once
// OS Detection
#ifdef _WIN32
//define something for Windows (32-bit and 64-bit, this part is common)
#define OS_WINDOWS
#ifdef _WIN64 //(64-bit only)
#define SYS_64BITS
#else //(32-bit only)
#define SYS_32BITS
//
#endif
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_IPHONE_SIMULATOR
#define OS_IOS
// iOS Simulator
#elif TARGET_OS_IPHONE
#define OS_IOS
// iOS device
#elif TARGET_OS_MAC
#define OS_MACOSX
// Other kinds of Mac OS
#else
# error "Unknown Apple platform"
#endif
#elif __linux__
// linux
#elif __unix__ // all unices not caught above
// Unix
#elif defined(_POSIX_VERSION)
// POSIX
#else
# error "Unknown OS"
#endif
// Compiler detection
#if defined(__clang__)
/* Clang/LLVM. ---------------------------------------------- */
#define ALIGN_(x) __attribute__ ((align_value(x))) // Alignment
#elif defined(__ICC) || defined(__INTEL_COMPILER)
/* Intel ICC/ICPC. ------------------------------------------ */
#elif defined(__GNUC__) || defined(__GNUG__)
/* GNU GCC/G++. --------------------------------------------- */
#define ALIGN_(x) __attribute__ ((aligned(x))) // Alignment
#elif defined(__HP_cc) || defined(__HP_aCC)
/* Hewlett-Packard C/aC++. ---------------------------------- */
#elif defined(__IBMC__) || defined(__IBMCPP__)
/* IBM XL C/C++. -------------------------------------------- */
#elif defined(_MSC_VER)
/* Microsoft Visual Studio. --------------------------------- */
#define ALIGN_(x) __declspec(align(x)) // Alignment
#elif defined(__PGI)
/* Portland Group PGCC/PGCPP. ------------------------------- */
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
/* Oracle Solaris Studio. ----------------------------------- */
#endif
// Defines
// Deprecated keyword for items no longer used
#define _DEPRECATED_
// ID used to define UINTs that refere to an dataset id
#define _ID_
// DEFINE THIS ONLY IF WE ARE USING ENGINE
// this flag is important to use debuging tools
//
// TODO: CONTROL THIS FLAG WHEN RELEASE
// TODO: we might put this flag in the project debug configuration
#define _ENGINE_USAGE_
// Specific modifier for engine functions
#define _engine_fun_
// function member output modifer
#ifndef _out_ref_
#define _out_ref_
#endif
#define _INLINE inline
#define _EVEREST Everest:: // Everst namespace shortcut
#define INDEX_NONE -1
#define DEFAULT_CONTAINER_CAPACITY 16
#define BAD_HANDLE -1 // No pointer handle
#define _CONST_VAR constexpr
#define _CONST_FUNC constexpr
// Primative Types
typedef unsigned char ubyte;
typedef unsigned char uint8;
typedef char int8;
typedef unsigned short uint16;
typedef short int16;
typedef unsigned int uint32;
typedef int int32;
typedef unsigned long long uint64;
typedef long long int64;
typedef void* Pvoid;
template <typename U32BITS, typename U64BITS, uint8 size> // generic pointer int meta template
struct PtrIntType
{
typedef U32BITS INTPRT;
};
template <typename U32BITS, typename U64BITS> // 32-bit meta template
struct PtrIntType<U32BITS, U64BITS, 4>
{
typedef U32BITS Int;
};
template <typename U32BITS, typename U64BITS> // 64-bit meta template
struct PtrIntType<U32BITS, U64BITS, 8>
{
typedef U64BITS Int;
};
// size_t based on system pointer size
typedef PtrIntType<uint32, uint64, sizeof(void*)>::Int SIZE_T;
// singed size_t based on system pointer size
typedef PtrIntType<int32, int64, sizeof(void*)>::Int SSIZE_T;
// Define the pointer int type
typedef PtrIntType<uint32, uint64, sizeof(void*)>::Int UINTPTR;
typedef PtrIntType<int32, int64, sizeof(void*)>::Int SINTPTR;
// Pointer handle type to reference a Pointer<Type> from the pointer table
typedef int32 HPTR;
// Alignment values
enum { ALINGMENT_ZERO = 0, ALIGNMENT_DEFAULT = 8, ALIGNMENT_OPTIMAL = 16 };
// Macros
|
#pragma once
#include <string>
class Console
{
public:
Console();
~Console();
void init();
//IInputReceiver
//bool onInput(SDL_Event* e);
static Console* console;
bool visible;
bool showCursor;
std::string cmd;
std::string buff;
};
|
// Copyright (c) 2014 The VeriCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_SCICON_H
#define BITCOIN_QT_SCICON_H
#include <QtCore>
QT_BEGIN_NAMESPACE
class QColor;
class QIcon;
class QString;
QT_END_NAMESPACE
QImage SingleColorImage(const QString& filename, const QColor&);
QIcon SingleColorIcon(const QIcon&, const QColor&);
QIcon SingleColorIcon(const QString& filename, const QColor&);
QColor SingleColor();
QIcon SingleColorIcon(const QString& filename);
QIcon TextColorIcon(const QIcon&);
QIcon TextColorIcon(const QString& filename);
#endif // BITCOIN_QT_SCICON_H
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
int main (int argc, const char* argv []) {
// char * my_string = "Hello\0 World";
char my_string[4];
my_string[0] = 'H';
my_string[1] = 'E';
my_string[2] = 'L';
my_string[3] = 'O';
// printf("%d\n", my_string[11]);
printf("%s\n", my_string);
}
|
//
// AppDelegate.h
// CAGradientLayer
//
// Created by ShenYj on 2017/2/13.
// Copyright © 2017年 ShenYj. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#ifndef _DEFFERED_H_
#define _DEFFERED_H_
#include "tiny_obj_loader.h"
#include "Application.h"
#include "FlyCam.h"
#include <vector>
#include <string>
struct OpenGLInfo
{
unsigned int m_VAO;
unsigned int m_VBO;
unsigned int m_IBO;
unsigned int m_IndexCount;
};
class Deffered : public Application
{
public:
virtual bool Init();
virtual bool Update();
virtual void ShutDown();
virtual void Draw();
void SetUpGpass();
void BuildLightBuffer();
void BuildMesh();
void BuildQuad();
void BuildCube();
//Light Functions
void DrawDirLight(const vec3& a_Colour, const vec3& a_Dir);
void DrawPointLight(const vec3& a_Pos, const vec3& a_Colour, float a_Radius);
private:
FlyCam cam;
OpenGLInfo m_Bunny;
OpenGLInfo m_Quad;
OpenGLInfo m_Cube;
uint m_Gpass;
uint m_GpassDepth;
uint m_colourTexture; //Albedo Texture
uint m_posTexture;
uint m_normalTexture;
uint m_LightFbo;
uint m_LightTexture;
uint m_GPassProgram;
uint m_DirLightProgram;
uint m_PointLightProgram;
uint m_SpotLightProgram;
uint m_CompProgram;
};
#endif
|
//
// AAColorView.h
// ArtStuff
//
// Created by Kyle Oba on 10/4/13.
// Copyright (c) 2013 Kyle Oba. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AAColorView : UIView
@end
|
/*
* nodered.c
*
* Created on: 2 déc. 2019
* Author: bdosd
*/
//http://homecontrol:1880/mqtt?topic=
#define MQTT_BROKER "http://emonpi:1880/"
int nodered_publish(char* topic, char* value)
{
char cmdline[1024];
sprintf(cmdline, "wget -q -O temp.mqtt \"%smqtt?topic=%s&payload=%s\"",MQTT_BROKER, topic, value);
system(cmdline);
}
|
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface DeviceIconView : UIView
#pragma mark Methods
@property(nonatomic, strong) CALayer *backgroundLayer;
- (void)initView;
- (void)createSublayers;
- (void)recreateSublayers;
- (void)removeSublayers;
- (void)createSubviews;
- (void)resizeSubviews;
- (void)addShadowWithColor:(UIColor *)shadowColor offset:(CGSize)shadowOffset opacity:(CGFloat)shadowOpacity radius:(CGFloat)shadowRadius
toLayer:(CALayer *)layer;
- (void)addCircleLayerWithRect:(CGRect)rect fillColor:(UIColor *)fillColor strokeColor:(UIColor *)strokeColor lineWidth:(CGFloat)lineWidth;
- (void)addCircleLayerWithRect:(CGRect)rect fillColor:(UIColor *)fillColor;
- (void)addGradientCircleLayerWithRect:(CGRect)rect colors:(NSArray *)colors;
- (UIBezierPath *)circlePathWithRect:(CGRect)rect;
- (CAShapeLayer *)circleLayerWithRect:(CGRect)rect;
- (CAShapeLayer *)circleLayerWithRect:(CGRect)rect fillColor:(UIColor *)fillColor;
- (CAShapeLayer *)circleLayerWithRect:(CGRect)rect fillColor:(UIColor *)fillColor strokeColor:(UIColor *)strokeColor lineWidth:(CGFloat)lineWidth;
- (CAGradientLayer *)gradientCircleLayerWithRect:(CGRect)rect colors:(NSArray *)colors;
- (void)addLayer:(CALayer *)layer;
- (NSArray *)cgColorsArrayWithColorsArray:(NSArray *)colorsArray;
- (CGRect)rectWithInset:(CGFloat)inset;
- (CGFloat)baseInset;
- (CGRect)baseRect;
@end
|
#include "gui.h"
#include "graphics.h"
#include "heap.h"
#include "kstdio.h"
window_t g_window_list;
void gui_init()
{
LIST_INIT(g_window_list.list);
}
void gui_background_render()
{
//fillrect(0,0,screen_width,screen_height,rgb(255,255,255));
}
void gui_print()
{
}
void gui_update()
{
window_t* win;
LIST_FOR_EACH(win,g_window_list.list,list)
{
window_update(win);
}
}
void gui_render()
{
gui_background_render();
window_t* win;
LIST_FOR_EACH(win,g_window_list.list,list)
{
window_render(win);
}
}
window_t* window_create(window_t* parent,int x,int y,int w, int h)
{
window_t* win = (window_t*)kmalloc(sizeof(window_t));
win->x = x;
win->y = y;
win->w = w;
win->h = h;
win->parent = parent;
win->surface = surface_create(w,h);
win->subwindow_list = (window_t*)kmalloc(sizeof(window_t));
LIST_INIT(win->subwindow_list->list);
LIST_PUSH(g_window_list.list,win->list);
return win;
}
void window_update(window_t* win)
{
if(win->win_func.update)
{
win->win_func.update(win);
}
}
void window_render(window_t* win)
{
if(win->win_func.render)
{
win->win_func.render(win);
}
if(!win->parent)
{
surface_blit(win->surface,0,
g_screen,&win->rect);
} else {
surface_blit(win->surface,0,
win->parent->surface,&win->rect);
}
}
|
#ifndef CGnuPlotSamples_H
#define CGnuPlotSamples_H
class CGnuPlotSamples {
public:
CGnuPlotSamples() { }
void get(int &s1, int &s2) const { s1 = samples1_; s2 = samples2_; }
void set(int s1, int s2) { samples1_ = s1; samples2_ = s2; }
void unset() { set(100, 100); }
void save(std::ostream &os) const {
os << "set samples " << samples1_ << ", " << samples2_ << std::endl;
}
void show(std::ostream &os) {
os << "sampling rate is " << samples1_ << ", " << samples2_ << std::endl;
}
private:
int samples1_ { 100 };
int samples2_ { 100 };
};
#endif
|
/*******************************************************************************
*
* This file is part of the AEON Framework.
*
* -----------------------------------------------------------------------------
* Copyright (C) 2012- The Aeon Development Team.
*
* See LICENSE.txt for licensing details.
*
******************************************************************************/
#ifndef SAXParser_h__
#define SAXParser_h__
#include <string>
#include <Aeon/Platform/Platform.h>
#include <Aeon/XML/AeonXMLFwd.h>
#include <Aeon/XML/AeonXMLConf.h>
#include <Aeon/XML/Export.h>
namespace Aeon {
namespace XML {
#ifdef AEON_WINDOWS
typedef int ssize_t; // Do this here since other libraries may also define ssize_t.
#endif
typedef char XML_Char;
class Parser;
/**
* Quick exception class.
*
* @note I'm not using the Framework's Exception class to enable stand-alone usage of the XML Parser wrapper.
*/
class AEON_XML_EXPORT SAXParserException : public std::exception
{
public:
/**
* Constructor which accepts own error descriptions.
*/
explicit SAXParserException(const std::string& desc):
description(desc)
{
}
/**
* Destructor.
*/
virtual ~SAXParserException() throw()
{
}
/**
* Overriding the std::exception what.
*/
const char* what() const throw() override
{
return description.c_str();
}
private:
/**
* A description of the exception.
*/
std::string description;
};
/**
* The actual SAX parser implementation.
*/
class AEON_XML_EXPORT SAXParser
{
public:
/**
* Creates a new Parser, sets up all required Handlers via bootstrapping the System with a user-defined chunk size; the chunk
* size is the buffer used while stream-reading the file.
*
* @param handler The SAX Event Handler class, must implement the SAXHandlerInterface or any Adapter.
* @param chunkSize Buffer size to use while reading parsing the filestream.
*/
SAXParser(Aeon::XML::SAXHandlerInterface* handler, size_t chunkSize = EXPAT_CHUNK_SIZE);
/**
* Destructor.
*/
virtual ~SAXParser();
public:
/**
* Get the current expat error code, XML_ERROR. Refer to the expat manual for interpretation of the specific codes.
*
* @return The error code.
*/
virtual unsigned int XmlError();
/**
* The parser's current status, should be XML_STATUS_OK while parsing, XML_STATUS_ERROR means there is something quite wrong.
*
* @return The parser's current status.
*/
virtual unsigned int XmlStatus();
/**
* Check whether the parser is ready to start parsing, useful for checking if there was anything going wrong during initialization.
*
* @return whether the parser is ready to start parsing.
*/
virtual bool IsReady();
/**
* Returns the Last error which occurred with the accompanying description taken from the expat library.
*
* @return description of the last error.
*/
virtual std::string GetXmlErrorString();
public:
/**
* Parses the given file. Throws SAXParserException if anything crucial goes wrong, so should surround the statement with try catch.
*
* @return false if anything goes wrong, true if the end of the file was reached without any errors.
*/
virtual bool Parse(const std::string& filename);
virtual void ParseString(const std::string& str);
private:
/**
* Used to initalized the parser.
*/
void Bootstrap();
/**
* Reads a block from _file.
*/
ssize_t Readblock();
private:
/**
* XML elements and attributes.
*/
static void HandleElementStart(void* userData, const XML_Char* name, const XML_Char** atts);
static void HandleElementEnd(void* userData, const XML_Char* name);
/**
* Character data.
*/
static void HandleCharacterData(void* userData, const XML_Char* s, int len);
/**
* Processing instructions
*/
static void HandleProcessingInstruction(void* userData, const XML_Char* target, const XML_Char* data);
/**
* Comments.
*/
static void HandleComments(void* userData, const XML_Char* data);
/**
* Default handler.
*/
static void HandleDefault(void* userData, const XML_Char* s, int len);
/**
* CDATA
*/
static void HandleCDATAStart(void* userData);
static void HandleCDATAEnd(void* userData);
/**
* DOCTYPE
*/
static void HandleDoctypeDeclStart(void* userData, const XML_Char* doctypeName, const XML_Char* systemId, const XML_Char* publicId, int hasInternalSubset);
static void HandleDoctypeDeclEnd(void* userData);
/**
* Notations.
*/
static void HandleNotationDecl(void* userData, const XML_Char* notationName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
/**
* Namespaces.
*/
static void HandleStartNamespaceDecl(void* userData, const XML_Char* prefix, const XML_Char* uri);
static void HandleEndNamespaceDecl(void* userData, const XML_Char* prefix);
/**
* Entity handlers.
*/
static void HandleEntityDecl(void* userData, const XML_Char* entityName, int isParamEntity, const XML_Char* value, int valueLength, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId, const XML_Char* notationName);
static void HandleSkippedEntity(void* userData, const XML_Char* entityName, int isParameterEntity);
static void HandleUnparsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId, const XML_Char* notationName);
private:
/**
* A pointer to the sax handler used.
*/
SAXHandlerInterface* handler;
Parser* parser;
/**
* Just a plain old buffer used during reading.
*/
XML_Char* buffer;
/**
* Keeps track of buffer sizes.
*/
size_t bufsize;
/**
* Indicates if the parser is ready.
*/
bool ready;
/**
* Keeps track of any failures during initalization.
*/
bool failure;
/**
* File used during read operations.
*/
FILE* file;
/**
* The file to read.
*/
std::string fname;
};
}}
#endif // SAXParser_h__
|
/**
* parent.h 2014-05-03 15:06:28
* anonymouse(anonymouse@email)
*
* Copyright (C) 2000-2014 All Right Reserved
*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
* PARTICULAR PURPOSE.
*
* Auto generate for Design Patterns in C
*/
#ifndef __PARENT_H__
#define __PARENT_H__
#include <mycommon.h>
struct parent_ops;
struct parent {
struct parent_ops *ops;
int pub_data1;
int pri_data2;
};
struct parent_ops {
void (*_destructor)(struct parent *); /** called by free(): put resources, forward to super. */
void (*free)(struct parent *); /** free memory after call destructor(). */
void (*pub_v_func1)(struct parent *);
void (*pub_v_func2)(struct parent *);
void (*pri_v_func3)(struct parent *);
void (*pri_v_func4)(struct parent *);
struct parent_ops *__super;
int static_pub_data3;
int static_pri_data4;
};
void parent_init(struct parent *);
void parent_pub_m_func1(struct parent *);
void parent_static_pub_m_func2(void);
/** called by free(): put resources, forward to super. */
static inline void parent__destructor(struct parent *parent)
{
parent->ops->_destructor(parent);
}
/** free memory after call destructor(). */
static inline void parent_free(struct parent *parent)
{
parent->ops->free(parent);
}
static inline void parent_pub_v_func1(struct parent *parent)
{
parent->ops->pub_v_func1(parent);
}
static inline void parent_pub_v_func2(struct parent *parent)
{
parent->ops->pub_v_func2(parent);
}
static inline void parent_pri_v_func3(struct parent *parent)
{
parent->ops->pri_v_func3(parent);
}
static inline void parent_pri_v_func4(struct parent *parent)
{
parent->ops->pri_v_func4(parent);
}
#endif /* __PARENT_H__ */
|
#include "MonoProcess.h"
using namespace System;
using namespace System::Diagnostics;
using namespace System::Runtime::InteropServices;
namespace MInject {
public ref class MonoProcess
{
public:
//Domain
IntPtr GetRootDomain();
//Assembly
IntPtr AssemblyLoadFromFull(IntPtr p_ImageAddress);
IntPtr AssemblyGetImage(IntPtr p_AssemblyAddress);
//Images
IntPtr ImageOpenFromDataFull(array<System::Byte>^ p_AssemblyBytes);
//Threads
IntPtr ThreadAttach(IntPtr p_DomainAddress);
int ThreadDetach(IntPtr p_DomainAddress);
//SecurityManager
void SecuritySetMode(int p_Mode);
//Class
IntPtr ClassFromName(IntPtr p_ImageAddress, String^ p_Namespace, String^ p_ClassName);
IntPtr ClassGetMethodFromName(IntPtr p_ImageAddress, String^ p_MethodName);
//Utilities
IntPtr RuntimeInvoke(IntPtr p_MethodAddress);
bool DisableAssemblyLoadCallback();
bool EnableAssemblyLoadCallback();
bool HideLastAssembly(IntPtr p_DomainAddress);
static bool Attach(Process^ p_Process, [OutAttribute] MonoProcess^% p_MonoProcess);
protected:
!MonoProcess() {
delete m_Impl;
}
private:
MInjectNative::MonoProcess* m_Impl;
MonoProcess(int p_ProcessId) : m_Impl(new MInjectNative::MonoProcess(p_ProcessId)) {}
~MonoProcess() {
delete m_Impl;
}
};
}
|
//
// PayPalFuturePaymentViewController.h
//
// Version 2.6.1
//
// Copyright (c) 2014, PayPal
// All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PayPalConfiguration.h"
@class PayPalFuturePaymentViewController;
typedef void (^PayPalFuturePaymentDelegateCompletionBlock)(void);
#pragma mark - PayPalFuturePaymentDelegate
/// Exactly one of these two required delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these required delegate methods.
@protocol PayPalFuturePaymentDelegate <NSObject>
@required
/// User canceled the future payment process.
/// Your code MUST dismiss the PayPalFuturePaymentViewController.
/// @param futurePaymentViewController The PayPalFuturePaymentViewController that the user canceled without agreement.
- (void)payPalFuturePaymentDidCancel:(PayPalFuturePaymentViewController *)futurePaymentViewController;
/// User successfully completed the future payment authorization.
/// The PayPalFuturePaymentViewController's activity indicator has been dismissed.
/// Your code MAY deal with the futurePaymentAuthorization, if it did not already do so within your optional
/// payPalFuturePaymentViewController:willAuthorizeFuturePayment:completionBlock: method.
/// Your code MUST dismiss the PayPalFuturePaymentViewController.
/// @param futurePaymentViewController The PayPalFuturePaymentViewController where the user successfullly authorized.
/// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment.
- (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController
didAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization;
@optional
/// User successfully completed the future payment authorization.
/// The PayPalFuturePaymentViewController's activity indicator is still visible.
/// Your code MAY deal with the futurePaymentAuthorization; e.g., send it to your server and await confirmation.
/// Your code MUST finish by calling the completionBlock.
/// Your code must NOT dismiss the PayPalFuturePaymentViewController.
/// @param futurePaymentViewController The PayPalFuturePaymentViewController where the user successfullly authorized.
/// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment.
/// @param completionBlock Block to execute when your processing is done.
- (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController
willAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization
completionBlock:(PayPalFuturePaymentDelegateCompletionBlock)completionBlock;
@end
#pragma mark - PayPalFuturePaymentViewController
@interface PayPalFuturePaymentViewController : UINavigationController
/// The designated initalizer. A new view controller MUST be initialized for each use.
/// @param configuration The configuration to be used for the lifetime of the controller.
/// The configuration properties merchantName, merchantPrivacyPolicyURL, and merchantUserAgreementURL must be provided.
/// @param delegate The delegate you want to receive updates about the future payment authorization.
- (instancetype)initWithConfiguration:(PayPalConfiguration *)configuration
delegate:(id<PayPalFuturePaymentDelegate>)delegate;
/// Delegate access
@property (nonatomic, weak, readonly) id<PayPalFuturePaymentDelegate> futurePaymentDelegate;
@end
|
#ifndef CBrowserVideo_H
#define CBrowserVideo_H
#include <CBrowserObject.h>
#include <CBrowserData.h>
class CBrowserVideo : public CBrowserObject {
public:
explicit CBrowserVideo(CBrowserWindow *window);
void setNameValue(const std::string &name, const std::string &value) override;
};
#endif
|
#ifndef ONCE_MODEL_H
#define ONCE_MODEL_H
class Model {
private:
int rank;
int mpi_size;
public:
Model(int rank, int size);
int result();
};
#endif // ONCE_MODEL_H
|
#pragma once
#include "Cpp/Warnings.h"
#include "Cpp/Fundamental.h"
INTRA_PUSH_DISABLE_REDUNDANT_WARNINGS
namespace Intra { namespace Audio {
struct MusicNote
{
enum Type: byte {C, CSharp, D, DSharp, E, F, FSharp, G, GSharp, A, ASharp, B};
//Таблица соответствия нот субконтроктавы частотам
static const float BasicFrequencies[12];
forceinline MusicNote(byte octave, Type note): NoteOctave(byte((octave << 4) | byte(note))) {}
forceinline MusicNote(null_t=null): NoteOctave(255) {}
forceinline Type Note() const {return Type(NoteOctave & 15);}
forceinline byte Octave() const {return byte(NoteOctave >> 4);}
forceinline bool operator==(const MusicNote& rhs) const {return NoteOctave == rhs.NoteOctave;}
forceinline bool operator!=(const MusicNote& rhs) const {return !operator==(rhs);}
forceinline bool operator==(null_t) const noexcept {return NoteOctave == 255;}
forceinline bool operator!=(null_t) const noexcept {return !operator==(null);}
forceinline float Frequency() const {return BasicFrequencies[byte(Note())]*float(1 << Octave());}
//! Запакованные в один байт нота и октава.
//! Младшие 4 бита - нота, старшие биты - октава, начиная с субконтроктавы.
byte NoteOctave;
};
}}
INTRA_WARNING_POP
|
// Copyright (c) 2015 fjz13. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
#pragma once
#include "MedusaCorePreDeclares.h"
#include "Core/Coder/ICoder.h"
MEDUSA_BEGIN;
class Base64Encoder :public ICoder
{
public:
Base64Encoder() = default;
Base64Encoder(const IEventArg& e);
~Base64Encoder() {}
using ICoder::Code;
virtual CoderType Type()const override { return CoderType::Encoder_Base64; }
virtual size_t GuessResultSize(const IStream& input)const override;
virtual CoderFlags Flags()const override { return CoderFlags::Block; }
protected:
virtual size_t OnCode(const MemoryData& input, MemoryData& output)const override;
private:
const static char mChars[64];
};
MEDUSA_END;
|
//
// Base64Util.h
// ThuInfo
//
// Created by WenHao on 12-10-30.
// Copyright (c) 2012年 WenHao. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GTMBase64.h"
@interface Base64Util : NSObject
+ (NSString*)encodeBase64:(NSString*)input;
+ (NSString*)decodeBase64:(NSString*)input;
@end
|
#pragma once
#include <QVector>
#include "BufferInterface.h"
#include "Maze.h"
#include "MazeGraphic.h"
#include "TriangleGraphic.h"
#include "TriangleTexture.h"
namespace mms {
class MazeView {
public:
MazeView(const Maze* maze, bool isTruthView);
MazeGraphic* getMazeGraphic();
void initTileGraphicText(int numRows, int numCols);
const QVector<TriangleGraphic>* getGraphicCpuBuffer() const;
const QVector<TriangleTexture>* getTextureCpuBuffer() const;
private:
// These vectors contain the triangles that will actually be drawn
QVector<TriangleGraphic> m_graphicCpuBuffer;
QVector<TriangleTexture> m_textureCpuBuffer;
// The buffer interface provides abstractions which the MazeGraphic
// uses to populate the vector of TriangleGraphic objects
BufferInterface m_bufferInterface;
// The MazeGraphic is essentially a "handle" into the above vectors;
// it provides a high-level API for modifying their contents
MazeGraphic m_mazeGraphic;
// Helper method for initializing TileGraphic text
void initText(int numRows, int numCols);
};
}
|
//
// FlickrAccount.h
// OnlineImagePicker
//
// Created by David Gileadi on 10/6/14.
// Copyright (c) 2014 David Gileadi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "OnlineImageAccount.h"
/**
* Supports user authentication for Flickr.
*/
@interface FlickrAccount : NSObject<OnlineImageAccount>
/** The single shared instance of this class. */
+(FlickrAccount *) sharedInstance;
/** Register this application with FlickrKit. In most cases this will be called automatically but it doesn't hurt to call it yourself. */
-(void) registerWithFlickrKit;
@end
|
#ifndef __CA__RECTANGLE_H__
#define __CA__RECTANGLE_H__
#include "BasicDeclaration.h"
BEGIN_NAMESPACE_CA_DRAWING
template <typename T>
class RectangleT
{
public:
RectangleT();
RectangleT(const T& x, const T& y,
const T& width, const T& height);
RectangleT(const PointT<T>& location,
const SizeT<T>& size);
virtual ~RectangleT();
public:
T x, y, width, height;
public:
void setLocation(const T& x, const T& y);
void move(const T& deltaX, const T& deltaY);
void setSize(const T& width, const T& height);
void addSize(const T& deltaWidth, const T& deltaHeight);
public:
virtual bool containsPoint(const T& x, const T& y) const;
virtual bool containsPoint(const PointT<T>& point) const;
};
using Rectangle = RectangleT<i32>;
using RectangleF = RectangleT<f32>;
END_NAMESPACE_CA_DRAWING
#include "Rectangle.inl"
#endif
|
/***************************************************************
* Name: Core.h
* Purpose: Defines Node-CEF Core Class
* Author: Joshua GPBeta (studiocghibli@gmail.com)
* Created: 2016-05-24
* Copyright: Studio GPBeta (www.gpbeta.com)
* License:
**************************************************************/
#ifndef NCJS_CORE_H
#define NCJS_CORE_H
class CefV8Handler;
class CefCommandLine;
template <class T>
class CefRefPtr;
/// ----------------------------------------------------------------------------
/// Headers
/// ----------------------------------------------------------------------------
namespace ncjs {
/// ----------------------------------------------------------------------------
/// \class Core
/// ----------------------------------------------------------------------------
class Core {
friend class RenderProcessHandler;
public:
/// Static Functions
/// --------------------------------------------------------------
static bool IsInitialized() { return s_instance != 0; }
private:
static bool RegisterExtension();
bool Initialize(const CefRefPtr<CefCommandLine>& cmd);
/// Constructors & Destructor
/// --------------------------------------------------------------
Core();
~Core();
/// Declarations
/// -----------------
static Core* s_instance;
};
} // ncjs
#endif // NCJS_CORE_H
|
//
// JSZVCRPlayerDelegate.h
// Pods
//
// Created by Jordan Zucker on 1/11/16.
//
//
#ifndef JSZVCRPlayerDelegate_h
#define JSZVCRPlayerDelegate_h
/**
* This is for relaying testing state during a run
*/
@protocol JSZVCRPlayerDelegate <NSObject>
#if JSZTESTING
/**
* This provides an update if a testCase encounters an unmatched request
*
* @param testCase currently executing test case
* @param request request that just failed to be matched
* @param shouldFail if YES then test should be failed (in line with JSZVCRMatchingStrictnessFailWhenNoMatch)
*/
- (void)testCase:(XCTestCase *)testCase withUnmatchedRequest:(NSURLRequest *)request shouldFail:(BOOL)shouldFail;
#else
/**
* This is provided when there is no XCTestCase as a framework for recording and replaying
*
* @param request
* @param request request that just failed to be matched
* @param shouldFail if YES then test should be failed (in line with JSZVCRMatchingStrictnessFailWhenNoMatch)
*/
- (void)unmatchedRequest:(NSURLRequest *)request shouldFail:(BOOL)shouldFail;
/**
* Network responses used to match against recorded network calls.
*
* @return array of network responses to parse for matcher
*/
- (NSArray *)networkResponses;
#endif
@end
#endif /* JSZVCRPlayerDelegate_h */
|
/**
* B1 Computer Emulator
* (c) 2014-2015 Michał Siejak
*/
#ifndef CPU_H
#define CPU_H
#include "common.h"
#include "mcc.h"
#include "vpu.h"
#include "spu.h"
#include "keyboard.h"
// Memory reference
struct Ref
{
U16 A;
U8 V;
operator U8() const { return V; }
Ref& operator=(const U8 InV) { V=InV; return *this; }
};
// Central Processing Unit
class CPU
{
public:
// Registers
U8 A, X, Y, SP;
// Program counter
U16 PC;
// Cycle counter
U32 Cycles;
// Approximate clock freq in kHz
U32 Frequency;
// Video signal refresh rate in Hz
U16 VideoHz;
// Memory control chip
MCC RAM;
// Video processing unit
VPU Video;
// Sound processing unit
SPU Sound;
// Keyboard controller;
Keyboard Kbd;
struct {
U8 C:1; // Carry
U8 Z:1; // Zero
U8 I:1; // IRQ disable
U8 D:1; // Decimal mode
U8 B:1; // BRK
U8 R:1; // Reserved
U8 V:1; // Overflow
U8 S:1; // Sign
} Flags;
enum InterruptType {
INT_None = 0,
INT_Reset,
INT_NMI,
INT_IRQ,
INT_BRK,
} Interrupt;
enum {
SF_None = 0x00,
SF_C = 0x01,
SF_NC = 0x02,
SF_Z = 0x04,
SF_S = 0x08,
};
CPU(const U32 InFreq, const U16 InHz, const char* Program, U16 Offset, size_t Size);
void Tick();
void Step();
void ServiceInterrupt();
void SignalInterrupt(InterruptType IntType);
private:
S32 CyclesPerJiffy;
S32 CyclesSinceSleep;
U32 LastTimestamp;
private:
inline U8 ReadImmediate();
inline U16 ReadImmediate16();
inline U16 ReadZeroPage16(U8 Index=0);
inline U16 ReadAbsolute16(U8 Index=0);
inline Ref RefZeroPage(U8 Index=0);
inline Ref RefAbsolute(U8 Index=0);
inline Ref RefIndexedX();
inline Ref RefIndexedY();
inline void Write(const Ref& Mem);
inline U8 ToBinary(U8 Value) const;
inline U8 ToDecimal(U8 Value) const;
inline U8 Op(U16 Value, unsigned int SetFlags=SF_None);
inline U8 OpADC(U8 OpA, U8 OpB);
inline U8 OpSBC(U8 OpA, U8 OpB);
inline void Branch(bool Condition);
inline void StackPush(U8 Value);
inline void StackPush16(U16 Value);
inline U8 StackPop();
inline U16 StackPop16();
inline U8 ROL(U8 Value);
inline U8 ROR(U8 Value);
inline bool Flag(U16 Value) const
{
return Value != 0;
}
inline U8& FlagRegister()
{
return *(U8*)&Flags;
}
};
#endif // CPU_H
|
#ifndef __SUPPORT_CCPROFILING_H__
#define __SUPPORT_CCPROFILING_H__
/// @cond DO_NOT_SHOW
#include <string>
#include <chrono>
#include "ccConfig.h"
#include "basics/CAObject.h"
#include "platform/platform.h"
#include "basics/CASTLContainer.h"
NS_CC_BEGIN
/**
* @addtogroup global
* @{
*/
class CAProfilingTimer;
/** CAProfiler
cross builtin CAProfiler.
To use it, enable set the CC_ENABLE_CAProfilerS=1 in the ccConfig.h file
*/
class CC_DLL CAProfiler : public CAObject
{
public:
/**
* @js NA
* @lua NA
*/
~CAProfiler(void);
/** display the timers
* @js NA
* @lua NA
*/
void displayTimers(void);
/**
* @js NA
* @lua NA
*/
bool init(void);
public:
/** returns the singleton
* @js NA
* @lua NA
*/
static CAProfiler* getInstance(void);
/** Creates and adds a new timer
* @js NA
* @lua NA
*/
CAProfilingTimer* createAndAddTimerWithName(const char* timerName);
/** releases a timer
* @js NA
* @lua NA
*/
void releaseTimer(const char* timerName);
/** releases all timers
* @js NA
* @lua NA
*/
void releaseAllTimers();
CAMap<std::string, CAProfilingTimer*> _activeTimers;
};
class CAProfilingTimer : public CAObject
{
public:
/**
* @js NA
* @lua NA
*/
CAProfilingTimer();
/**
* @js NA
* @lua NA
*/
~CAProfilingTimer(void);
/**
* @js NA
* @lua NA
*/
bool initWithName(const char* timerName);
/**
* @js NA
* @lua NA
*/
virtual std::string getDescription() const;
/**
* @js NA
* @lua NA
*/
inline const std::chrono::high_resolution_clock::time_point& getStartTime(void) { return _startTime; };
/** resets the timer properties
* @js NA
* @lua NA
*/
void reset();
std::string _nameStr;
std::chrono::high_resolution_clock::time_point _startTime;
long _averageTime1;
long _averageTime2;
long minTime;
long maxTime;
long totalTime;
long numberOfCalls;
};
extern void CC_DLL ProfilingBeginTimingBlock(const char *timerName);
extern void CC_DLL ProfilingEndTimingBlock(const char *timerName);
extern void CC_DLL ProfilingResetTimingBlock(const char *timerName);
/*
* cross profiling categories
* used to enable / disable CAProfilers with granularity
*/
extern bool kCAProfilerCategorySprite;
extern bool kCAProfilerCategoryBatchSprite;
extern bool kCAProfilerCategoryParticles;
// end of global group
/// @}
NS_CC_END
/// @endcond
#endif // __SUPPORT_CCPROFILING_H__
|
//
// ViewController.h
// TagManager
//
// Created by johnny on 15/11/27.
// Copyright © 2015年 ftxbird. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#ifndef MISSILEGENERIC_H_
#define MISSILEGENERIC_H_
#include "unit_generic.h"
class MissileEffect
{
Vector pos;
float damage;
float phasedamage;
float radius;
float radialmultiplier;
void *ownerDoNotDereference;
public:
void ApplyDamage( Unit* );
MissileEffect( const Vector &pos, float dam, float pdam, float radius, float radmult, void *owner ) : pos( pos )
{
damage = dam;
phasedamage = pdam;
this->radius = radius;
radialmultiplier = radmult;
this->ownerDoNotDereference = owner;
}
float GetRadius() const
{
return radius;
}
const Vector& GetCenter() const
{
return pos;
}
};
class Missile : public Unit
{
public:
protected: Missile( std::vector< Mesh* >m, bool b, int i ) : Unit( m, b, i ) {}
virtual float ExplosionRadius();
float time;
float damage;
float phasedamage;
float radial_effect;
float radial_multiplier;
float detonation_radius;
bool discharged;
bool had_target;
signed char retarget;
public:
void Discharge();
virtual enum clsptr isUnit() const
{
return MISSILEPTR;
}
protected:
/// constructor only to be called by UnitFactory
Missile( const char *filename,
int faction,
const string &modifications,
const float damage,
float phasedamage,
float time,
float radialeffect,
float radmult,
float detonation_radius ) :
Unit( filename, false, faction, modifications )
, time( time )
, damage( damage )
, phasedamage( phasedamage )
, radial_effect( radialeffect )
, radial_multiplier( radmult )
, detonation_radius( detonation_radius )
, discharged( false )
, retarget( -1 )
{
maxhull *= 10;
had_target = false;
}
void InitMissile( float ptime,
const float pdamage,
float pphasedamage,
float pradial_effect,
float pradial_multiplier,
float pdetonation_radius,
bool pdischarged,
signed char pretarget )
{
time = ptime;
damage = pdamage;
phasedamage = pphasedamage;
radial_effect = pradial_effect;
radial_multiplier = pradial_multiplier;
detonation_radius = pdetonation_radius;
discharged = pdischarged;
retarget = pretarget;
had_target = false;
}
friend class UnitFactory;
public:
virtual void Kill( bool eraseFromSave = true );
virtual void reactToCollision( Unit *smaller,
const QVector &biglocation,
const Vector &bignormal,
const QVector &smalllocation,
const Vector &smallnormal,
float dist );
virtual void UpdatePhysics2( const Transformation &trans,
const Transformation &old_physical_state,
const Vector &accel,
float difficulty,
const Matrix &transmat,
const Vector &CumulativeVelocity,
bool ResolveLast,
UnitCollection *uc = NULL );
protected:
/// default constructor forbidden
Missile() {}
/// copy constructor forbidden
//Missile( const Missile& );
/// assignment operator forbidden
//Missile& operator=( const Missile& );
};
#endif
|
// This code is part of the Super Play Library (http://www.superplay.info),
// and may only be used under the terms contained in the LICENSE file,
// included with the Super Play Library.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
#pragma once
// If set to 1, the display will be scaled by the hardware, rather than using a render buffer.
#define SCALED_DISPLAY 1
// Sound frequency
static const int gsc_iSoundFrequency = 22050;
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "HaloObjC.h"
FOUNDATION_EXPORT double HaloObjCVersionNumber;
FOUNDATION_EXPORT const unsigned char HaloObjCVersionString[];
|
/*
* file StringUtils.h
*
* author luoxw
* date 2017/09/15
*
*
*/
#pragma once
FORCEINLINE wstring UTF8ToWide(const string &utf8)
{
if (utf8.length() == 0) {
return wstring();
}
// compute the length of the buffer we'll need
int count = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, NULL, 0);
if (count == 0) {
return wstring();
}
// convert
wchar_t* buf = new wchar_t[count];
MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, buf, count);
wstring result(buf);
delete[] buf;
return result;
}
FORCEINLINE string WideToUTF8(const wstring &wide) {
if (wide.length() == 0) {
return string();
}
// compute the length of the buffer we'll need
int count = WideCharToMultiByte(CP_UTF8, 0, wide.c_str(), -1,
NULL, 0, NULL, NULL);
if (count == 0) {
return string();
}
// convert
char *buf = new char[count];
WideCharToMultiByte(CP_UTF8, 0, wide.c_str(), -1, buf, count,
NULL, NULL);
string result(buf);
delete[] buf;
return result;
}
|
/*
Copyright (c) 2014 Stephen Stair (sgstair@akkit.org)
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 WINUSBSERIAL_H
#define WINUSBSERIAL_H
// Public USB routines
void usb_init();
int usb_IsActive();
// Serial port related routines
int Serial_CanRecvByte();
int Serial_RecvByte(); // Returns -1 on failure
int Serial_PeekByte(); // Returns -1 on failure
int Serial_CanSendByte();
int Serial_SendByte(int b); // returns 0 on failure
int Serial_BytesToRecv();
int Serial_BytesCanSend();
void Serial_HintMoreData(); // Suggest to USB chipset it should try exchanging data again. Should only call this if you have something worth sending or need it sent quickly (may lower bandwidth otherwise)
// Debug functions
void usb_trace(char tracedata);
void usb_drawtrace();
#endif
|
//
// FacialGestureAggregator.h
// Pods
//
// Created by Tran Le on 02/03/15.
//
//
#import <Foundation/Foundation.h>
#import "FCFacialGesture.h"
@protocol FCFacialGestureAggregatorDelegate <NSObject>
-(void)didUpdateProgress:(FCFacialGesture *)gesture;
@end
@interface FCFacialGestureAggregator : NSObject
@property (nonatomic, readwrite) float samplesPerSecond;
@property (nonatomic, weak) id<FCFacialGestureAggregatorDelegate> delegate;
-(void)addGesture:(FCGestureType)gestureType;
-(FCGestureType)checkIfRegisteredGesturesAndUpdateProgress;
@end
|
//
// STPPaymentConfiguration.h
// Stripe
//
// Created by Jack Flintermann on 5/18/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "STPBackendAPIAdapter.h"
#import "STPPaymentMethod.h"
#import "STPTheme.h"
NS_ASSUME_NONNULL_BEGIN
@interface STPPaymentConfiguration : NSObject<NSCopying>
+ (instancetype)sharedConfiguration;
/**
* Your Stripe publishable key. You can get this from https://dashboard.stripe.com/account/apikeys .
*/
@property(nonatomic, copy)NSString *publishableKey;
/**
* An enum value representing which payment methods you will accept from your user in addition to credit cards. Unless you have a very specific reason not to, you should leave this at the default, `STPPaymentMethodTypeAll`.
*/
@property(nonatomic)STPPaymentMethodType additionalPaymentMethods;
/**
* The billing address fields the user must fill out when prompted for their payment details. These fields will all be present on the returned token from Stripe. See https://stripe.com/docs/api#create_card_token for more information.
*/
@property(nonatomic)STPBillingAddressFields requiredBillingAddressFields;
/**
* The name of your company, for displaying to the user during payment flows. For example, when using Apple Pay, the payment sheet's final line item will read "PAY {companyName}". This defaults to the name of your iOS application.
*/
@property(nonatomic, copy)NSString *companyName;
/**
* The Apple Merchant Identifier to use during Apple Pay transactions. To create one of these, see our guide at https://stripe.com/docs/mobile/applepay . You must set this to a valid identifier in order to automatically enable Apple Pay.
*/
@property(nonatomic, nullable, copy)NSString *appleMerchantIdentifier;
/**
* When entering their payment information, users who have a saved card with Stripe will be prompted to autofill it by entering an SMS code. Set this property to `YES` to disable this feature. The user won't receive an SMS code even if they have their payment information stored with Stripe, and won't be prompted to save it if they don't.
*/
@property(nonatomic)BOOL smsAutofillDisabled;
@end
NS_ASSUME_NONNULL_END
|
// Temporary shim to keep a couple dependencies working in Chromium.
#ifndef SkOrderedReadBuffer_DEFINED
# define SkOrderedReadBuffer_DEFINED
# include "src/core/SkReadBuffer.h"
typedef SkReadBuffer SkOrderedReadBuffer;
#endif
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63a.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-63a.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: file Read input from a file
* GoodSource: Fixed string
* Sinks: w32_spawnvp
* BadSink : execute command with wspawnvp
* Flow Variant: 63 Data flow: pointer to data passed from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"ls"
#define COMMAND_ARG2 L"-la"
#define COMMAND_ARG3 data
#endif
#ifdef _WIN32
#define FILENAME "C:\\temp\\file.txt"
#else
#define FILENAME "/tmp/file.txt"
#endif
#include <process.h>
#ifndef OMITBAD
/* bad function declaration */
void CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63b_badSink(wchar_t * * dataPtr);
void CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63_bad()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
/* Read input from a file */
size_t dataLen = wcslen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgetws(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
fclose(pFile);
}
}
}
CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63b_badSink(&data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63b_goodG2BSink(wchar_t * * data);
static void goodG2B()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63b_goodG2BSink(&data);
}
void CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63_good()
{
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE78_OS_Command_Injection__wchar_t_file_w32_spawnvp_63_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
//
// XibView.h
// IHakulaShare
//
// Created by Wayde Sun on 1/31/15.
// Copyright (c) 2015 IHakula. All rights reserved.
#import <UIKit/UIKit.h>
@interface XibViewUtils : NSObject
+ (id)loadViewFromXibNamed:(NSString*)xibName withFileOwner:(id)fileOwner;
// the view must not have any connecting to the file owner
+ (id)loadViewFromXibNamed:(NSString*)xibName;
@end
|
/* Algorithm by Donald Knuth. */
#include <stdio.h>
#include <stdlib.h>
void main( void)
{
int i, j=1, k, n, *c, x;
printf( "Enter n,k: ");
scanf( "%d,%d", &n, &k);
c = malloc( (k+3) * sizeof(int));
for (i=1; i <= k; i++) c[i] = i;
c[k+1] = n+1;
c[k+2] = 0;
j = k;
visit:
for (i=k; i >= 1; i--) printf( "%3d", c[i]);
printf( "\n");
if (j > 0) {x = j+1; goto incr;}
if (c[1] + 1 < c[2])
{
c[1] += 1;
goto visit;
}
j = 2;
do_more:
c[j-1] = j-1;
x = c[j] + 1;
if (x == c[j+1]) {j++; goto do_more;}
if (j > k) exit(0);
incr:
c[j] = x;
j--;
goto visit;
}
|
//
// MyRelativeLayout.h
// MyLayout
//
// Created by oybq on 15/7/1.
// Copyright (c) 2015年 YoungSoft. All rights reserved.
//
#import "MyBaseLayout.h"
/**
*相对布局是一种里面的子视图通过相互之间的约束和依赖来进行布局和定位的布局视图。
*相对布局里面的子视图的布局位置和添加的顺序无关,而是通过设置子视图的相对依赖关系来进行定位和布局的。
*相对布局提供了和AutoLayout相似的能力。
*/
@interface MyRelativeLayout : MyBaseLayout
/**
*子视图调用widthDime.equalTo(NSArray<MyLayoutSize*>均分宽度时当有子视图隐藏时是否参与宽度计算,这个属性只有在参与均分视图的子视图隐藏时才有效,默认是NO
*/
@property(nonatomic, assign) BOOL flexOtherViewWidthWhenSubviewHidden;
/**
*子视图调用heightDime.equalTo(NSArray<MyLayoutSize*>均分高度时当有子视图隐藏时是否参与高度计算,这个属性只有在参与均分视图的子视图隐藏时才有效,默认是NO
*/
@property(nonatomic, assign) BOOL flexOtherViewHeightWhenSubviewHidden;
@end
|
/*
* romanError.h
*
* Created on: Oct 1, 2016
* Author: brad
*/
#ifndef ROMANERROR_H_
#define ROMANERROR_H_
void showBadCharMessage(char value);
void showBadNumeralPairMessage(char a, char b);
void showBadNumeralStringMessage(char* value);
void showTermExceedsMaximumValueMessage(char* value);//single term
void showTermNullMessage(char term);
void showNonValidSubtractionResultMessage();
void showSumExceedsMaximumValueMessage();//total of both terms
void showViolatesModernConventionMessage(char *value);
void showLastConvertedValueLessThanCurrentValue();
#endif /* ROMANERROR_H_ */
|
//
// LoginInViewController.h
// RongChatRoomDemo
//
// Created by 弘鼎 on 2017/8/8.
// Copyright © 2017年 rongcloud. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void(^RegistBlock)();
@interface LoginInViewController : UIViewController
@property (nonatomic,copy) RegistBlock myRegistblock;
@end
|
#include <stdio.h>
#include <stdlib.h>
#define MIN_ALLOC_SIZE 24
#define MAX_ALLOC_SIZE 1024 * 100
#define CHANCE_OF_FREE 95
#define CHANCE_OF_REALLOC 50
#define TOTAL_ALLOCS 400000
int main()
{
malloc(1);
int i;
void *realloc_ptr = NULL;
void **dictionary = malloc(TOTAL_ALLOCS * sizeof(void *));
int *dictionary_elem_size = malloc(TOTAL_ALLOCS * sizeof(int));
int dictionary_ct = 0;
int data_written = 0;
for (i = 0; i < TOTAL_ALLOCS; i++)
{
int size = (rand() % (MAX_ALLOC_SIZE - MIN_ALLOC_SIZE + 1)) + MIN_ALLOC_SIZE;
void *ptr;
if (realloc_ptr == NULL)
{
ptr = malloc(size);
data_written = 0;
}
else
{
ptr = realloc(realloc_ptr, size);
realloc_ptr = NULL;
}
if (ptr == NULL)
{
printf("Memory failed to allocate!\n");
return 1;
}
if (rand() % 100 < CHANCE_OF_FREE) {
//printf("hey we want to free!\n");
free(ptr);
}
else
{
if (!data_written)
{
*((void **)ptr) = &dictionary[dictionary_ct];
data_written = 1;
}
if (rand() % 100 < CHANCE_OF_REALLOC)
realloc_ptr = ptr;
else
{
*((void **)(ptr + size - sizeof(void *))) = &dictionary[dictionary_ct];
dictionary[dictionary_ct] = ptr;
dictionary_elem_size[dictionary_ct] = size;
dictionary_ct++;
}
}
}
for (i = dictionary_ct - 1; i >= 0; i--)
{
if ( *((void **)dictionary[i]) != &dictionary[i] )
{
printf("Memory failed to contain correct data after many allocations (beginning of segment)!\n");
return 100;
}
if ( *((void **)(dictionary[i] + dictionary_elem_size[i] - sizeof(void *))) != &dictionary[i] )
{
printf("Memory failed to contain correct data after many allocations (end of segment)!\n");
return 101;
}
//printf("free dictionary %p\n", dictionary[i]);
free(dictionary[i]);
}
printf("Memory was allocated and freed!\n");
return 0;
}
|
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef HTMLLIElement_h
#define HTMLLIElement_h
#include "core/html/HTMLElement.h"
namespace WebCore {
class HTMLLIElement FINAL : public HTMLElement {
public:
static PassRefPtr<HTMLLIElement> create(Document&);
private:
explicit HTMLLIElement(Document&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE;
virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
void parseValue(const AtomicString&);
};
} //namespace
#endif
|
#ifndef SPRITENODE_H
#define SPRITENODE_H
#include <SFML/Graphics.hpp>
#include <SFGE/Core/ResourceManager.h>
#include <SFGE/Core/Node.h>
namespace sfge
{
class SpriteNode : public Node, public sf::Sprite
{
public:
SpriteNode(const std::string& name = "Sprite");
SpriteNode(const std::string& name, const std::string& file);
virtual ~SpriteNode();
void loadFile(const std::string& name);
void setCenterAsOrigin();
protected:
virtual void onDraw();
};
}
#endif // SPRITENODE_H
|
//
// DDDDChatUtilityViewController.h
// Emoji
//
// Created by YiLiFILM on 14/12/13.
// Copyright (c) 2014年 YiLiFILM. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AQGridView.h"
@protocol ChatUtilityViewControllerDelegate <NSObject>
@end
@interface ChatUtilityViewController : UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate,AQGridViewDataSource,AQGridViewDelegate>
@property(nonatomic,strong) UIImagePickerController *imagePicker;
@property(nonatomic,strong) AQGridView *gridView;
@property(nonatomic,assign) id<ChatUtilityViewControllerDelegate>delegate;
@end
|
//
// AYAMidiToMarkovCalc.h
// MarkovChain
//
// Created by Andrew Ayers on 4/25/14.
// Copyright (c) 2014 AyersAudio. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AYAMidiParser.h"
@interface AYAMidiToMarkovCalc : NSObject
+(NSMutableDictionary *)calcProbabilityForFile:(NSString *)filename;
@end
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__char_file_w32_spawnv_65b.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-65b.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: file Read input from a file
* GoodSource: Fixed string
* Sinks: w32_spawnv
* BadSink : execute command with spawnv
* Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a different source file called via a function pointer
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH "%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT "cmd.exe"
#define COMMAND_ARG1 "/c"
#define COMMAND_ARG2 "dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH "/bin/sh"
#define COMMAND_INT "sh"
#define COMMAND_ARG1 "ls"
#define COMMAND_ARG2 "-la"
#define COMMAND_ARG3 data
#endif
#ifdef _WIN32
#define FILENAME "C:\\temp\\file.txt"
#else
#define FILENAME "/tmp/file.txt"
#endif
#include <process.h>
#ifndef OMITBAD
void CWE78_OS_Command_Injection__char_file_w32_spawnv_65b_badSink(char * data)
{
{
char *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* spawnv - specify the path where the command is located */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
_spawnv(_P_WAIT, COMMAND_INT_PATH, args);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE78_OS_Command_Injection__char_file_w32_spawnv_65b_goodG2BSink(char * data)
{
{
char *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* spawnv - specify the path where the command is located */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
_spawnv(_P_WAIT, COMMAND_INT_PATH, args);
}
}
#endif /* OMITGOOD */
|
//
// PRSummary.h
// PlacesAndRouting
//
// Created by Sascha Müllner on 19.03.16.
// Copyright © 2016 smuellner. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PRSummary : NSObject
@property NSInteger distance;
@property NSInteger trafficTime;
@property NSInteger baseTime;
@property NSArray *flags;
@property NSString *text;
@property NSInteger travelTime;
@property NSString *type;
@end
|
//
// JSCBasePlugin.h
// JSCoreBridgeDemo
//
// Created by iPhuan on 2017/2/14.
// Copyright © 2017年 iPhuan. All rights reserved.
//
#import "JSCPlugin.h"
typedef NS_ENUM(NSUInteger, JSCParamsErrorType) {
JSCParamsErrorTypeNone = 0,
JSCParamsErrorTypeNoParameters,
JSCParamsErrorTypeInvalidFormat,
JSCParamsErrorTypeRequiredParameterMissing
};
@interface JSCBasePlugin : JSCPlugin
- (void)setKeepCallbackAsBool:(BOOL)isKeepCallback forcallbackId:(NSString*)callbackId;
- (JSCParamsErrorType)checkRequiredStringParameter:(NSString *)parameterkey inArguments:(NSArray *)arguments;
- (JSCParamsErrorType)checkRequiredStringParameters:(NSArray *)parameterkeys inArguments:(NSArray *)arguments;
- (void)sendSuccessResultWithMessage:(NSDictionary *)message callbackId:(NSString*)callbackId;
- (void)sendSuccessResultWithResCode:(NSString *)resCode resMsg:(NSString *)resMsg callBackId:(NSString *)callbackId;
- (void)sendFailedResultWithErrorType:(JSCParamsErrorType)errorType callBackId:(NSString *)callbackId;
- (void)sendFailedResultWithResCode:(NSString *)resCode resMsg:(NSString *)resMsg callBackId:(NSString *)callbackId;
- (void)sendPluginResultWithStatus:(JSCCommandStatus)commandStatus message:(NSDictionary *)message callbackId:(NSString*)callbackId;
- (void)popupAlertViewWithTitle:(NSString *)title message:(NSString *)message;
@end
|
//
// Created by greystone on 15-11-5.
//
#ifndef DB_DB_GLOBAL_H
#define DB_DB_GLOBAL_H
#include "db/db_buffer.h"
namespace db {
extern db::Buffer BufferDelegate;
} // namespace db
#endif // DB_DB_GLOBAL_H
|
/*
* Author: doe300
*
* See the file "LICENSE" for the full license governing this code.
*/
#ifndef VC4C_CACHE_ENTRY_H
#define VC4C_CACHE_ENTRY_H
#include "../Optional.h"
#include "../Types.h"
#include "../tools/SmallSet.h"
#include <string>
namespace vc4c
{
namespace intermediate
{
struct MemoryAccessInstruction;
struct RAMAccessInstruction;
struct CacheAccessInstruction;
} // namespace intermediate
namespace periphery
{
/**
* Represents an entry within a cache.
*
* For e.g. VPM, this represents the (dynamic/static) address in rows/columns/sub-words within the VPM as well
* as the dynamic/static number of rows/columns covered by this entry. For TMU, this is an abstract concept,
* since the actual location within the TMU cache cannot be controlled and is of no consequence (except for
* cache collisions).
*/
struct CacheEntry
{
virtual ~CacheEntry() noexcept;
virtual std::string to_string() const = 0;
virtual bool isReadOnly() const = 0;
tools::SmallSortedPointerSet<intermediate::RAMAccessInstruction*> getMemoryAccesses();
tools::SmallSortedPointerSet<const intermediate::RAMAccessInstruction*> getMemoryAccesses() const;
tools::SmallSortedPointerSet<intermediate::CacheAccessInstruction*> getQPUAccesses();
tools::SmallSortedPointerSet<const intermediate::CacheAccessInstruction*> getQPUAccesses() const;
tools::SmallSortedPointerSet<intermediate::MemoryAccessInstruction*> accesses;
};
} // namespace periphery
} // namespace vc4c
#endif /* VC4C_CACHE_ENTRY_H */
|
//
// Copyright (c) 2016 Vinodh Kumar M. <GreenHex@gmail.com>
//
#pragma once
// int rand_digit_order[ NUM_DIGITS ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
void randomize ( int arr[], int n );
|
/*
* Phusion Passenger - https://www.phusionpassenger.com/
* Copyright (c) 2011-2015 Phusion Holding B.V.
*
* "Passenger", "Phusion Passenger" and "Union Station" are registered
* trademarks of Phusion Holding B.V.
*
* 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 _BACKGROUND_EVENT_LOOP_H_
#define _BACKGROUND_EVENT_LOOP_H_
#include <boost/shared_ptr.hpp>
#include <string>
#include <pthread.h>
extern "C" {
struct ev_loop;
struct uv_loop_s;
}
namespace Passenger {
using namespace std;
using namespace boost;
class SafeLibev;
struct BackgroundEventLoopPrivate;
/**
* Implements a libev event loop that runs in a background thread.
*/
struct BackgroundEventLoop {
struct ev_loop *libev_loop;
struct uv_loop_s *libuv_loop;
boost::shared_ptr<SafeLibev> safe;
BackgroundEventLoopPrivate *priv;
BackgroundEventLoop(bool scalable = false, bool usesLibuv = true);
~BackgroundEventLoop();
void start(const string &threadName = "", unsigned int stackSize = 1024 * 1024);
void stop();
bool isStarted() const;
pthread_t getNativeHandle() const;
};
}
#endif /* _BACKGROUND_EVENT_LOOP_H_ */
|
// This file is part of byfly-wifi-auth. For the copyright and license information, please view the LICENSE file that was distributed with this source code.
#include <curl/curl.h>
int main ()
{
curl_global_init ( CURL_GLOBAL_DEFAULT );
CURL * curl = curl_easy_init ();
if ( curl == NULL ) {
curl_easy_cleanup ( curl );
return 1;
}
struct curl_slist * list = curl_slist_append ( NULL, "123" );
if ( list == NULL ) {
curl_easy_cleanup ( curl );
curl_global_cleanup ();
return 2;
}
list = curl_slist_append ( list, "456" );
if ( list == NULL ) {
curl_easy_cleanup ( curl );
curl_global_cleanup ();
return 3;
}
if (
curl_easy_setopt ( curl, CURLOPT_TIMEOUT, 5 ) != CURLE_OK ||
curl_easy_setopt ( curl, CURLOPT_RESOLVE, list ) != CURLE_OK
) {
curl_slist_free_all ( list );
curl_easy_cleanup ( curl );
curl_global_cleanup ();
return 4;
}
curl_slist_free_all ( list );
curl_easy_cleanup ( curl );
curl_global_cleanup ();
return 0;
}
|
#pragma once
/**
Utils for driving a WS2812 (WS2812B) RGB LED strips.
It's implemented as macros to avoid overhead when passing values, and to
enable driving multiple strips at once.
To avoid bloating your code, try to reduce the number of invocations -
compute color and then send it.
[IMPORTANT]
Some seemingly random influences can ruin the communication.
If you have enough memory, consider preparing the colors in array,
and sending this array using one of the "ws_send_XXX_array" macros.
*/
#include <avr/io.h>
#include "pins.h"
#include "nsdelay.h"
#include "colors.h"
/* Driver code for WS2812B */
// --- timing constraints (NS) ---
#ifndef WS_T_1H
# define WS_T_1H 700
#endif
#ifndef WS_T_1L
# define WS_T_1L 150
#endif
#ifndef WS_T_0H
# define WS_T_0H 150
#endif
#ifndef WS_T_0L
# define WS_T_0L 700
#endif
#ifndef WS_T_LATCH
# define WS_T_LATCH 7000
#endif
/** Wait long enough for the colors to show */
#define ws_show() do {delay_ns_c(WS_T_LATCH, 0); } while(0)
/** Send one byte to the RGB strip */
#define ws_send_byte(io, bb) do { \
for (volatile int8_t __ws_tmp = 7; __ws_tmp >= 0; --__ws_tmp) { \
if ((bb) & (1 << __ws_tmp)) { \
pin_high(io_pack(io)); delay_ns_c(WS_T_1H, -2); \
pin_low(io_pack(io)); delay_ns_c(WS_T_1L, -10); \
} else { \
pin_high(io_pack(io)); delay_ns_c(WS_T_0H, -2); \
pin_low(io_pack(io)); delay_ns_c(WS_T_0L, -10); \
} \
} \
} while(0)
/** Send R,G,B color to the strip */
#define ws_send_rgb(io, r, g, b) do { \
ws_send_byte(io_pack(io), g); \
ws_send_byte(io_pack(io), r); \
ws_send_byte(io_pack(io), b); \
} while(0)
/** Send a RGB struct */
#define ws_send_xrgb(io, xrgb) ws_send_rgb(io_pack(io), (xrgb).r, (xrgb).g, (xrgb).b)
/** Send color hex */
#define ws_send_rgb24(io, rgb) ws_send_rgb(io_pack(io), rgb24_r(rgb), rgb24_g(rgb), rgb24_b(rgb))
#define ws_send_rgb15(io, rgb) ws_send_rgb(io_pack(io), rgb15_r(rgb), rgb15_g(rgb), rgb15_b(rgb))
#define ws_send_rgb12(io, rgb) ws_send_rgb(io_pack(io), rgb12_r(rgb), rgb12_g(rgb), rgb12_b(rgb))
#define ws_send_rgb6(io, rgb) ws_send_rgb(io_pack(io), rgb6_r(rgb), rgb6_g(rgb), rgb6_b(rgb))
/** Send array of colors */
#define ws_send_xrgb_array(io, rgbs, length) __ws_send_array_proto(io_pack(io), (rgbs), (length), xrgb)
#define ws_send_rgb24_array(io, rgbs, length) __ws_send_array_proto(io_pack(io), (rgbs), (length), rgb24)
#define ws_send_rgb15_array(io, rgbs, length) __ws_send_array_proto(io_pack(io), (rgbs), (length), rgb15)
#define ws_send_rgb12_array(io, rgbs, length) __ws_send_array_proto(io_pack(io), (rgbs), (length), rgb12)
#define ws_send_rgb6_array(io, rgbs, length) __ws_send_array_proto(io_pack(io), (rgbs), (length), rgb6)
// prototype for sending array. it's ugly, sorry.
#define __ws_send_array_proto(io, rgbs, length, style) do { \
for (uint8_t __ws_tmp_sap_i = 0; __ws_tmp_sap_i < length; __ws_tmp_sap_i++) { \
style ## _t __ws_tmp_sap2 = (rgbs)[__ws_tmp_sap_i]; \
ws_send_ ## style(io_pack(io), __ws_tmp_sap2); \
} \
} while(0)
|
/*
* gui.h
*
* Created on: Aug 25, 2015
* Author: jasonr
*/
#pragma once
#ifndef SRC_TESTS_APITEST_COMMON_GUI_H_
#define SRC_TESTS_APITEST_COMMON_GUI_H_
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <memory>
#include <vector>
#include <SDL.h>
#include "context.h"
#include "renderThreadBase.h"
class MainWindow
{
public:
MainWindow();
~MainWindow();
void render();
void resize(unsigned int width, unsigned int height);
void setRenderThread(std::unique_ptr<RenderThreadBase> renderThread);
private:
void initialize();
bool m_initialized = false;
bool m_valid = true;
SDL_Window * m_window = nullptr;
std::unique_ptr<Context> m_masterContext;
std::unique_ptr<RenderThreadBase> m_renderThread;
};
#endif // SRC_TESTS_APITEST_COMMON_GUI_H_
|
//
// TBTableViewController.h
// Pods
//
// Created by Tanner on 2/11/16.
//
//
#import <UIKit/UIKit.h>
typedef void(^VoidBlock)();
NS_ASSUME_NONNULL_BEGIN
/// This class functions as its table view's delegate and data source. Changing either of those will
/// defeat the purpose of this class and render most of the interface useless.
@interface TBTableViewController : UITableViewController
/** The title for each row.
@discussion For example, the title for the fifth row in the second section would be at rowTitles[1][4].
This property is used to determine the number of rows and number of sections. For a row to appear,
you must provide a title for every row, even if it is just an empty string. */
@property (nonatomic) NSArray<NSArray<NSString*>*> *rowTitles;
/// The titles for each section header. These are entirely optional. Provide empty strings to skip sections.
@property (nonatomic) NSArray<NSString*> *sectionTitles;
@property (nonatomic) NSArray<NSString*> *sectionHeaderTitles;
@property (nonatomic) NSArray<NSString*> *sectionFooterTitles;
/// The "swipe actions" for each row.
@property (nonatomic) NSDictionary<NSIndexPath*, NSArray<UITableViewRowAction*>*> *editActionsForRow;
/// Whether the view controller will automatically delselect each row after it has been selected. Defaults to `YES`.
@property (nonatomic) BOOL automaticallyDeselectsRows;
/// Whether or not the table view will default to allow selection of rows. Defaults to `NO`.
@property (nonatomic) BOOL defaultCanSelectRow;
/// The state of each value determines whether to allow selection at that particular index path. Defaults to `defaultCanSelectRow`.
@property (nonatomic) NSDictionary<NSIndexPath*, NSNumber*> *canSelectRow;
/// A block/closure to be executed when the given row is selected.
@property (nonatomic) NSDictionary<NSIndexPath*, VoidBlock> *selectionActionForRow;
/// The default cell class to be used for the table view. Defaults to `UITableViewCell`.
@property (nonatomic) Class cellClass;
/// The reuse identifier used for rows without a specified reuse identifier.
@property (nonatomic, readonly) NSString *defaultCellReuseIdentifier;
/// A pairing of each reuse identifier to a specific class. Missing rows will use the class `cellClass`.
@property (nonatomic) NSDictionary<NSString *, Class> *classesForReuseIdentifiers;
/// A pairing of reuse identifier to a row or a group of rows. Missing rows will use `defaultCellReuseIdentifier`.
@property (nonatomic) NSDictionary<NSString *, NSArray<NSIndexPath*>*> *indexPathsForReuseIdentifiers;
/// An optional block used to add additional customization to each cell before it is given back to the table view.
@property (nonatomic, copy) void (^configureCellBlock)(UITableViewCell *cell, NSString *rowTitle, NSIndexPath *indexPath);
@end
NS_ASSUME_NONNULL_END
|
// Created by «FULLUSERNAME» on «DATE».
// 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 "SHK.h"
#import "SHKOAuthSharer.h"
@interface «FILEBASENAMEASIDENTIFIER» : SHKOAuthSharer
@end
|
//
// NSTimer+PPDBLHelper.h
// Pods
//
// Created by wanyakun on 2017/3/27.
//
//
#import <Foundation/Foundation.h>
@interface NSTimer (PPDBLHelper)
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval
block:(void(^)())block
repeats:(BOOL)repeats;
@end
|
//
// RootViewController.h
// tapat
//
// Created by 吴 wuziqi on 10-11-15.
// Copyright 2010 同济大学. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <GameKit/GameKit.h>
#import "GameConfig.h"
#import "GameCenterManager.h"
@interface RootViewController : UIViewController<GameCenterManagerDelegate> {
}
@end
|
// MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License
#pragma once
#include "mx/core/ForwardDeclare.h"
#include "mx/core/AttributesInterface.h"
#include "mx/core/CommaSeparatedText.h"
#include "mx/core/Decimals.h"
#include "mx/core/Enums.h"
#include "mx/core/FontSize.h"
#include <iosfwd>
#include <memory>
#include <vector>
namespace mx
{
namespace core
{
MX_FORWARD_DECLARE_ATTRIBUTES( OtherArticulationAttributes )
struct OtherArticulationAttributes : public AttributesInterface
{
public:
OtherArticulationAttributes();
virtual bool hasValues() const;
virtual std::ostream& toStream( std::ostream& os ) const;
TenthsValue defaultX;
TenthsValue defaultY;
TenthsValue relativeX;
TenthsValue relativeY;
CommaSeparatedText fontFamily;
FontStyle fontStyle;
FontSize fontSize;
FontWeight fontWeight;
AboveBelow placement;
bool hasDefaultX;
bool hasDefaultY;
bool hasRelativeX;
bool hasRelativeY;
bool hasFontFamily;
bool hasFontStyle;
bool hasFontSize;
bool hasFontWeight;
bool hasPlacement;
private:
virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement );
};
}
}
|
#pragma once
#include <atomic> // for std::atomic, atomic_thread_fence
#include <stddef.h>
#include "global_gc.h"
#include "gc_class_base.h"
#include "local_config.h" // for local_config
struct participant {
participant *next;
std::atomic<size_t> active;
local_config conf;
inline void enter(GCClassBase *p);
inline void exit();
};
void participant::enter(GCClassBase *p) {
size_t cur = active.load(std::memory_order_relaxed);
active.store(cur + 1, std::memory_order_relaxed);
std::atomic_signal_fence(std::memory_order_seq_cst);
if (cur == 0 && p->needs_fence()) {
std::atomic_thread_fence(std::memory_order_seq_cst);
}
}
void participant::exit() {
size_t cur = active.load(std::memory_order_relaxed);
active.store(cur - 1, std::memory_order_release);
}
participant *get_active_participants();
void add_active_participant(participant *p);
inline participant *get_current_participant() {
thread_local participant *p = nullptr;
if (p == nullptr) {
p = new participant;
add_active_participant(p);
}
return p;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXIMUM_WORD_SIZE 64
#define MAXIMUM_LINE_SIZE 128
int main(int argc, char* argv[])
{
if (argc != 3)
{
printf("cmt: No file names given\n");
exit(EXIT_FAILURE);
}
FILE *inputfile;
if ((inputfile = fopen(argv[1], "r")) == NULL)
{
printf("cmt: %s: No such file or directory.\n", argv[1]);
exit(EXIT_FAILURE);
}
FILE *outputfile;
if ((outputfile = fopen(argv[2], "w")) == NULL)
{
printf("cmt: %s: No such file or directory.\n", argv[2]);
exit(EXIT_FAILURE);
}
char line[MAXIMUM_LINE_SIZE];
const char s[2] = " ";
char* token; char* first; char* second;
char* previous_word = calloc(MAXIMUM_WORD_SIZE, sizeof(char));
while (fgets(line, sizeof line, inputfile) != NULL)
{
line[strlen(line) - 1] = '\0';
token = strtok(line, s);
first = token;
token = strtok(NULL, s);
second = token;
if (strcmp(first, previous_word) != 0)
fprintf(outputfile, "%s %s\n", first, second);
strcpy(previous_word, first);
}
free(previous_word);
fclose(inputfile);
fclose(outputfile);
return 0;
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__char_console_w32_execvp_12.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-12.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: console Read input from the console
* GoodSource: Fixed string
* Sink: w32_execvp
* BadSink : execute command with execvp
* Flow Variant: 12 Control flow: if(globalReturnsTrueOrFalse())
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH "%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT "cmd.exe"
#define COMMAND_ARG1 "/c"
#define COMMAND_ARG2 "dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH "/bin/sh"
#define COMMAND_INT "sh"
#define COMMAND_ARG1 "ls"
#define COMMAND_ARG2 "-la"
#define COMMAND_ARG3 data
#endif
#include <process.h>
#define EXECVP _execvp
#ifndef OMITBAD
void CWE78_OS_Command_Injection__char_console_w32_execvp_12_bad()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
if(globalReturnsTrueOrFalse())
{
{
/* Read input from the console */
size_t dataLen = strlen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
}
else
{
/* FIX: Append a fixed string to data (not user / external input) */
strcat(data, "*.*");
}
{
char *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* execvp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECVP(COMMAND_INT, args);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() - use goodsource and badsink by changing the "if" so that
* both branches use the GoodSource */
static void goodG2B()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
if(globalReturnsTrueOrFalse())
{
/* FIX: Append a fixed string to data (not user / external input) */
strcat(data, "*.*");
}
else
{
/* FIX: Append a fixed string to data (not user / external input) */
strcat(data, "*.*");
}
{
char *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* execvp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECVP(COMMAND_INT, args);
}
}
void CWE78_OS_Command_Injection__char_console_w32_execvp_12_good()
{
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__char_console_w32_execvp_12_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE78_OS_Command_Injection__char_console_w32_execvp_12_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22a.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-22a.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: environment Read input from an environment variable
* GoodSource: Fixed string
* Sink: w32_execvp
* BadSink : execute command with wexecvp
* Flow Variant: 22 Control flow: Flow controlled by value of a global variable. Sink functions are in a separate file from sources.
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"ls"
#define COMMAND_ARG2 L"-la"
#define COMMAND_ARG3 data
#endif
#include <process.h>
#define EXECVP _wexecvp
#ifndef OMITBAD
/* The global variable below is used to drive control flow in the source function */
int CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_badGlobal = 0;
wchar_t * CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_badSource(wchar_t * data);
void CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_bad()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_badGlobal = 1; /* true */
data = CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_badSource(data);
{
wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* wexecvp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECVP(COMMAND_INT, args);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* The global variables below are used to drive control flow in the source functions. */
int CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B1Global = 0;
int CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B2Global = 0;
/* goodG2B1() - use goodsource and badsink by setting the static variable to false instead of true */
wchar_t * CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B1Source(wchar_t * data);
static void goodG2B1()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B1Global = 0; /* false */
data = CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B1Source(data);
{
wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* wexecvp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECVP(COMMAND_INT, args);
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if in the source function */
wchar_t * CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B2Source(wchar_t * data);
static void goodG2B2()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B2Global = 1; /* true */
data = CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_goodG2B2Source(data);
{
wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
/* wexecvp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECVP(COMMAND_INT, args);
}
}
void CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_good()
{
goodG2B1();
goodG2B2();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE78_OS_Command_Injection__wchar_t_environment_w32_execvp_22_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
#pragma once
#include "PyObject.h"
#include <string>
namespace PyExt::Remote {
/// Represents an object of type NoneType. The most boring of the Python types.
class PYEXT_PUBLIC PyNoneObject : public PyObject
{
public: // Construction/Destruction.
explicit PyNoneObject(Offset objectAddress);
public: // Members.
auto repr(bool pretty = true) const -> std::string override;
};
}
|
//
// PDFRCTableViewController.h
// PDStrategy
//
// Created by Pavel Deminov on 22/10/2017.
//
#import "PDTableViewController.h"
@import CoreData;
@interface PDFRCTableViewController : PDTableViewController <NSFetchedResultsControllerDelegate>
@property (nonatomic, strong) NSFetchedResultsController *frc;
- (void)setupFRC;
@end
|
#ifndef CLIENTS_H_
#define CLIENTS_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "globals.h"
/* Inicialitza el stock inicial de la botiga
* Utilitceu aquest funció per carregar els exemples
**/
void inicialitzaClientsExemple(int exemple, client clients[C]);
/* Inicialitza els clients de la botiga a partir d'un fitxer.
* Llegeix un fitxer que està identificat per filename i carrega les dades a la variable proveïdors
* El fitxer conté un total de C línies on cada línia conté un enter i una direcció d'email vàlida
* separats per el carácter ;
*
* Exemple d'una línia del fitxer de clients:
* 1;botiga@c.com
**/
void inicialitzaClientsArxiu(char* filename, client clients[C]);
/***
* Retorna el email del client identificat per idClient dintre de la variable clients
**/
char* emailClient(int idClient, client clients[P]);
#endif
|
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <pthread.h> //include library to handle threads
void *Print(){
pthread_t t1 = pthread_self();
printf("Thread: %u\n", (unsigned int) t1);
pthread_exit(NULL);
}
int main(){
pthread_t thread1;
pthread_create(&thread1,NULL,Print,NULL);
pthread_join(thread1,NULL);
pthread_exit(NULL);
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.