text
stringlengths 4
6.14k
|
|---|
#ifndef INVENTORY_H_INCLUDED
#define INVENTORY_H_INCLUDED
int32_t inv_get_cnt();
void inv_set_cnt(int32_t cnt);
int32_t inv_get_item(int32_t index);
void inv_set_item(int32_t index, int32_t item);
void inv_drop(int item);
void inv_add(int item);
void inv_cycle();
#endif // INVENTORY_H_INCLUDED
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class FBSScene, SBAlert, SBAlertManager, SBAlertWindow, UIScreen;
@protocol SBAlertManagerDelegate <NSObject>
- (double)sceneLevelForAlerts;
- (struct CGRect)sceneFrameForAlerts:(UIScreen *)arg1;
@optional
- (SBAlertWindow *)alertManager:(SBAlertManager *)arg1 newAlertWindowForScene:(FBSScene *)arg2;
- (_Bool)alertManager:(SBAlertManager *)arg1 shouldDeactivateDismissedAlert:(SBAlert *)arg2;
@end
|
#ifndef _TASK_H
#define _TASK_H
#include <stdint.h>
#include "queue.h"
#ifndef F_CPU
#error "Define F_CPU"
#endif
#define MS_PER_TICK 2
#define US_PER_TICK (1000 * MS_PER_TICK)
#define US_PER_COUNT (US_PER_TICK / COUNTS_PER_TICK)
#if F_CPU == 16000000L
// Clock select: prescaler = 1/256
#define _TCCR0B (_BV(CS02))
#define COUNTS_PER_TICK ((F_CPU / 256) / (1000 / MS_PER_TICK))
#elif F_CPU == 8000000L
// Clock select: prescaler = 1/64
#define _TCCR0B (_BV(CS01) | _BV(CS00))
#define COUNTS_PER_TICK ((F_CPU / 64) / (1000 / MS_PER_TICK))
#else
#error "Unsupported F_CPU"
#endif
typedef void (*task_fn)(void *);
typedef struct task_s task_t;
struct task_s {
void *sp; // Stack pointer this task can be resumed from.
uint16_t delay; // Ticks until task can be scheduled again.
QUEUE member;
};
// Initialize internal structures, tick timer, etc.
void task_init(void);
// Creates a task for the specified function.
task_t *task_create(task_fn fn, void *data);
// Starts task execution. Never returns.
void task_start(void);
// Yield control from current task.
void task_yield(void);
// Return pointer to current task.
task_t *task_current(void);
// Suspend task until it is woken up explicitly.
// The task is added to the tail of the queue pointed to by q. If q is NULL,
// it is added to the system wide queue for suspended tasks.
void task_suspend(QUEUE *h);
// Wake up task.
void task_wakeup(task_t *t);
// Sleep current task for specified number of milliseconds.
void task_sleep(uint16_t ms);
// Only count seconds if specified
#if TASK_COUNT_SEC
#ifndef TASK_SEC_T
#define TASK_SEC_T uint16_t
#endif
TASK_SEC_T task_sec(void);
void task_set_sec(TASK_SEC_T);
#endif
// Only count milliseconds if specified
#if TASK_COUNT_MSEC
#ifndef TASK_MSEC_T
#define TASK_MSEC_T uint16_t
#endif
TASK_MSEC_T task_msec(void);
void task_set_msec(TASK_MSEC_T);
#endif
// Only count microseconds if specified
#if TASK_COUNT_USEC
#ifndef TASK_USEC_T
#define TASK_USEC_T uint16_t
#endif
TASK_USEC_T task_usec(void);
void task_set_usec(TASK_USEC_T);
#endif
#endif
|
#ifndef SOUNDEXCEPTION_H
#define SOUNDEXCEPTION_H
#include <stdexcept>
namespace thewizardplusplus {
namespace anna {
namespace sound {
namespace exceptions {
class SoundException : public std::runtime_error {
public:
SoundException(const std::string& message);
};
}
}
}
}
#endif
|
//
// ProvincesAndCitiesTableViewController.h
// MaShangTong-Personal
//
// Created by NY on 15/11/23.
// Copyright © 2015年 jeaner. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger,ProvinceType) {
ProvinceTypeProvince,
ProvinceTypeCity,
};
@interface ProvincesAndCitiesTableViewController : UITableViewController
@property (nonatomic,assign) ProvinceType type;
@property (nonatomic,strong) NSString *province;
@property (nonatomic,strong) void (^transProvince) (NSString *province);
@property (nonatomic,strong) void (^transCity) (NSString *city);
@end
|
#ifndef SRC_COREALGORITHM_H
#define SRC_COREALGORITHM_H
#include <iostream>
#include <vector>
#include <cmath>
#include <bitset>
#include <set>
#include "ClusterEditingSolutions.h"
#include "ClusterEditingReduction.h"
#include "CplexInformer.h"
#include "KClustifier.h"
#include "ILPSolver.h"
#include "YParameterSet.h"
#include "ClusterEditingSolutionLight.h"
#include "InducedCostHeuristicLight.h"
namespace ysk {
class CoreAlgorithm{
public:
CoreAlgorithm(
ClusterEditingInstance* instance,
YParameterSet parameter
)
:_instance(instance)
,_result(new ClusterEditingSolutions)
,_parameter(parameter)
,_informer(nullptr)
,_solver(nullptr)
{};
ClusterEditingSolutions* run();
void registerCplexInformer(yskLib::CplexInformer* informer);
/**
* Attempts a "clean" interrupt of the solving process by stopping CPLEX and setting a kill-flag which is checked throughout the process
*/
void cancel();
private:
ClusterEditingInstance* _instance;
ClusterEditingSolutions* _result;
YParameterSet _parameter;
yskLib::CplexInformer* _informer;
ILPSolver* _solver;
};
//replace reduced cluster by single nodes
void expandSolutions(ClusterEditingInstance& cei,
ClusterEditingSolutions& ces,
std::vector<std::vector<std::vector<int> > >& partitions);
void mergeSolutions(size_t i, size_t& k,
std::vector<std::vector<int> >& partition,
ClusterEditingSolutions& solutions,
std::vector<std::vector<std::vector<std::vector<int> > > >& instances);
}
#endif /* SRC_COREALGORITHM_H */
|
#ifndef _NTNODETEST_H_
#define _NTNODETEST_H_
void ntNodeMatchIdTest();
void ntNodeNameTest();
void ntNodeTriggerPositiveTest();
void ntNodeTriggerNegativeTest();
void ntNodeUntriggerFromCmdTest();
void ntNodeGetVersionStrTest();
void ntNodeGetBoardStrTest();
void ntCrcCalcTest();
#endif
|
//
// DHImageFaceSkinningFilter.h
// DHImageKit
//
// Created by 黄鸿森 on 2017/12/10.
// Copyright © 2017年 Huang Hongsen. All rights reserved.
//
#import "DHImageBaseFilter.h"
@interface DHImageFaceThinningFilter : DHImageBaseFilter {
GLuint radiusUniform, aspectRatioUniform, arraySizeUniform, leftContourPointsUniform, rightContourPointsUniform, deltaArrayUniform;
}
@property (nonatomic) CGFloat radius;
@property (nonatomic) CGFloat aspectRatio;
@property (nonatomic, strong) NSArray *leftContourPoints;
@property (nonatomic, strong) NSArray *rightContourPoints;
@property (nonatomic, strong) NSArray *deltas;
@property (nonatomic) int arraySize;
@end
|
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/
// Copyright 2017 hamcrest.org. See LICENSE.txt
#import <OCHamcrestIOS/HCBaseMatcher.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @abstract Matches values with <code>-compare:</code>.
*/
@interface HCOrderingComparison : HCBaseMatcher
- (instancetype)initComparing:(id)expectedValue
minCompare:(NSComparisonResult)min
maxCompare:(NSComparisonResult)max
comparisonDescription:(NSString *)comparisonDescription NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@end
FOUNDATION_EXPORT id HC_greaterThan(id value);
#ifndef HC_DISABLE_SHORT_SYNTAX
/*!
* @abstract Creates a matcher that matches when the examined object is greater than the specified
* value, as reported by the <code>-compare:</code> method of the <b>examined</b> object.
* @param value The value which, when passed to the <code>-compare:</code> method of the examined
* object, should return NSOrderedAscending.
* @discussion
* <b>Example</b><br />
* <pre>assertThat(\@2, greaterThan(\@1))</pre>
*
* <b>Name Clash</b><br />
* In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym
* HC_greaterThan instead.
*/
static inline id greaterThan(id value)
{
return HC_greaterThan(value);
}
#endif
FOUNDATION_EXPORT id HC_greaterThanOrEqualTo(id value);
#ifndef HC_DISABLE_SHORT_SYNTAX
/*!
* @abstract Creates a matcher that matches when the examined object is greater than or equal to the
* specified value, as reported by the <code>-compare:</code> method of the <b>examined</b> object.
* @param value The value which, when passed to the <code>-compare:</code> method of the examined
* object, should return NSOrderedAscending or NSOrderedSame.
* @discussion
* <b>Example</b><br />
* <pre>assertThat(\@1, greaterThanOrEqualTo(\@1))</pre>
*
* <b>Name Clash</b><br />
* In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym
* HC_greaterThanOrEqualTo instead.
*/
static inline id greaterThanOrEqualTo(id value)
{
return HC_greaterThanOrEqualTo(value);
}
#endif
FOUNDATION_EXPORT id HC_lessThan(id value);
#ifndef HC_DISABLE_SHORT_SYNTAX
/*!
* @abstract Creates a matcher that matches when the examined object is less than the specified
* value, as reported by the <code>-compare:</code> method of the <b>examined</b> object.
* @param value The value which, when passed to the <code>-compare:</code> method of the examined
* object, should return NSOrderedDescending.
* @discussion
* <b>Example</b><br />
* <pre>assertThat(\@1, lessThan(\@2))</pre>
*
* <b>Name Clash</b><br />
* In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym
* HC_lessThan instead.
*/
static inline id lessThan(id value)
{
return HC_lessThan(value);
}
#endif
FOUNDATION_EXPORT id HC_lessThanOrEqualTo(id value);
#ifndef HC_DISABLE_SHORT_SYNTAX
/*!
* @abstract Creates a matcher that matches when the examined object is less than or equal to the
* specified value, as reported by the <code>-compare:</code> method of the <b>examined</b> object.
* @param value The value which, when passed to the <code>-compare:</code> method of the examined
* object, should return NSOrderedDescending or NSOrderedSame.
* @discussion
* <b>Example</b><br />
* <pre>assertThat(\@1, lessThanOrEqualTo(\@1))</pre>
*
* <b>Name Clash</b><br />
* In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym
* HC_lessThanOrEqualTo instead.
*/
static inline id lessThanOrEqualTo(id value)
{
return HC_lessThanOrEqualTo(value);
}
#endif
NS_ASSUME_NONNULL_END
|
/*
* halm/platform/lpc/gpdma_defs.h
* Copyright (C) 2012 xent
* Project is distributed under the terms of the MIT License
*/
#ifndef HALM_PLATFORM_LPC_GPDMA_DEFS_H_
#define HALM_PLATFORM_LPC_GPDMA_DEFS_H_
/*----------------------------------------------------------------------------*/
#include <xcore/bits.h>
/*------------------Configuration register------------------------------------*/
enum
{
DMA_LITTLE_ENDIAN,
DMA_BIG_ENDIAN
};
#define DMA_ENABLE BIT(0)
#define DMA_ENDIANNESS(master, mode) BIT_FIELD((mode), 1 + (master))
/*------------------Channel Control register----------------------------------*/
#define CONTROL_SIZE(size) BIT_FIELD((size), 0)
#define CONTROL_SIZE_MASK BIT_FIELD(MASK(12), 0)
#define CONTROL_SIZE_VALUE(reg) FIELD_VALUE((reg), CONTROL_SIZE_MASK, 0)
#define CONTROL_SRC_BURST(burst) BIT_FIELD((burst), 12)
#define CONTROL_DST_BURST(burst) BIT_FIELD((burst), 15)
#define CONTROL_SRC_WIDTH(width) BIT_FIELD((width), 18)
#define CONTROL_DST_WIDTH(width) BIT_FIELD((width), 21)
#define CONTROL_SRC_MASTER(channel) BIT_FIELD((channel), 24)
#define CONTROL_DST_MASTER(channel) BIT_FIELD((channel), 25)
#define CONTROL_SRC_INC BIT(26) /* Source increment */
#define CONTROL_DST_INC BIT(27) /* Destination increment */
#define CONTROL_INT BIT(31) /* Terminal count interrupt */
/*------------------Channel Configuration register----------------------------*/
#define CONFIG_ENABLE BIT(0)
#define CONFIG_SRC_PERIPH(periph) BIT_FIELD((periph), 1)
#define CONFIG_DST_PERIPH(periph) BIT_FIELD((periph), 6)
/* Transfer type */
#define CONFIG_TYPE(type) BIT_FIELD((type), 11)
#define CONFIG_TYPE_MASK BIT_FIELD(MASK(3), 11)
#define CONFIG_TYPE_VALUE(reg) FIELD_VALUE((reg), CONFIG_TYPE_MASK, 11)
/* Interrupt error mask */
#define CONFIG_IE BIT(14)
/* Terminal count interrupt mask */
#define CONFIG_ITC BIT(15)
/* Enable locked transfer */
#define CONFIG_LOCK BIT(16)
/* Indicates whether FIFO not empty */
#define CONFIG_ACTIVE BIT(17)
#define CONFIG_HALT BIT(18)
/*------------------Synchronization register----------------------------------*/
#define SYNC_MASK BIT_FIELD(MASK(16), 0)
/*----------------------------------------------------------------------------*/
#endif /* HALM_PLATFORM_LPC_GPDMA_DEFS_H_ */
|
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// 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
#include "UIGridLayoutSection.h"
@interface UIGridLayoutRow : NSObject {
@public
idretain _items;
UIGridLayoutSection* _section;
BOOL _fixedItemSize;
NSInteger _index;
BOOL _isValid;
CGSize _rowSize;
CGRect _rowFrame;
BOOL _complete;
NSInteger _itemCount;
}
- (unsigned)index;
- (unsigned)itemCount;
- (BOOL)fixedItemSize;
- (CGRect)rowFrame;
- (CGSize)rowSize;
- (id)init;
- (id)setFixedItemSize:(BOOL)fixed;
- (id)setRowFrame:(CGRect)frame;
- (id)setComplete:(BOOL)complete;
- (id)setSection:(id)section;
- (id)setIndex:(NSInteger)index;
- (id)setItemCount:(NSInteger)count;
- (id)items;
- (id)addItem:(id)item;
- (id)invalidate;
- (id)layoutRow;
- (id)itemRects;
- (id)layoutRowAndGenerateRectArray:(BOOL)generateRectArray;
@end
|
#pragma once
#include "GatherStats.h"
#include "EOBIWrap.h"
#include <iostream>
void msgLengthError(uint64_t bodyLen, uint64_t msgLen);
template<typename Msg, int tid>
struct MsgReader
{
static constexpr int id = tid;
const char* operator()(
const char* buffer,
const MessageHeaderCompT& header,
uint32_t& seqNo) const
{
if(header.BodyLen == sizeof(Msg))
{
const Msg* msg = reinterpret_cast<const Msg*>(buffer);
StatsHolder()(msg);
return buffer + sizeof(Msg);
}
msgLengthError(header.BodyLen, sizeof(Msg));
return nullptr;
}
};
struct NullReader
{
const char* operator()(
const char* buffer,
const MessageHeaderCompT& header,
uint32_t& seqNo) const
{
std::cout << "Unknown" << std::endl;
return buffer;
}
};
|
#ifndef MATUTIL_H
#define MATUTIL_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
/// Generate a random matrix.
//
// Parameters:
// int *mat - pointer to the generated matrix. mat should have been
// allocated before callling this function.
// const int N - number of vertices.
void GenMatrix(int *mat, const size_t N);
/// Compare the content of two integer arrays. Return true if they are
// exactly the same; otherwise return false.
//
// Parameters:
// const int *l, const int *r - the two integer arrays to be compared.
// const int eleNum - the length of the two matrices.
bool CmpArray(const int *l, const int *r, const size_t eleNum);
/// Compute APSP using single thread.
//
// Parameters:
// int *mat - the input matrix storing the distance values between vertices.
// mat should have been allocated before callling this function.
// The result will be directed stored in mat.
// const int N - the number of vertices.
void ST_APSP(int *mat, const size_t N);
#endif
|
//-------------------------------------------------------------------//
// CCustomizeDialog class
//-------------------------------------------------------------------//
//
// NOTE: Derived from code originally posted to CodeGuru.com by
// Nikolay Denisov (acnick@mail.lanck.net).
//
// Copyright © 2005 A better Software.
//-------------------------------------------------------------------//
#ifndef __CUSTOMIZEDIALOG_H__
#define __CUSTOMIZEDIALOG_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////
// ** NOTICE **
/////////////////////////////////////////////////////////////////////////
// The following resources are required by this module (or submodules):
//
#define IDD_CUSTOMIZE 120 // 16899
#define IDC_CB_TEXTOPTIONS 16900
#define IDC_CB_ICONOPTIONS 16901
#define IDS_TO_TEXTLABELS 16902
#define IDS_TO_TEXTONRIGHT 16903
#define IDS_TO_NOTEXTLABELS 16904
#define IDS_IO_SMALLICONS 16905
#define IDS_IO_LARGEICONS 16906
#define IDS_SEPARATOR 16907
#define IDC_LB_AVAILABLE 0x00C9 // determined with Spy++
#define IDC_LB_CURRENT 0x00CB
//
// Ideally, resources would be specified on a class-by-class basis. Unfortunately,
// Visual Studio does not handle that well. Different projects have different resource
// files that contain all of the project's resources in one place. Make sure
// you provide the resources matching the above defines in your resource file.
// You must also include this file in the resource file's "Resource Set Includes"
// ( see "Resource Includes" on the View menu ).
//
// We want to exclude the remainder of the include file when dealing with App Studio.
#ifndef RC_INVOKED
/////////////////////////////////////////////////////////////////////////
// #include "Resource.h"
#include "..\..\FontDlg.h" // Base class, allows custom font.
#include "..\..\GlobalData.h"
/////////////////////////////////////////////////////////////////////////////
// Options
enum ETextOptions
{
toTextLabels = 0,
toTextOnRight = 1,
toNoTextLabels = 2,
toNone = -1,
};
enum EIconOptions
{
ioSmallIcons = 0,
ioLargeIcons = 1,
ioNone = -1,
};
/////////////////////////////////////////////////////////////////////////////
// COptionsDialog dialog
class CCustomizeDialog;
class COptionsDialog : public FontDlg
{
typedef FontDlg inherited;
// Construction
public:
COptionsDialog( ETextOptions eTextOptions,
EIconOptions eIconOptions );
// Dialog Data
//{{AFX_DATA(COptionsDialog)
enum { IDD = IDD_CUSTOMIZE };
CComboBox m_cbTextOptions;
CComboBox m_cbIconOptions;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COptionsDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Operations
public:
bool SelectTextOption( ETextOptions eTextOptions );
bool SelectIconOption( EIconOptions eIconOptions );
// Implementation
protected:
CCustomizeDialog* GetCustomizeDialog() const;
// Implementation data
protected:
ETextOptions m_eTextOptions;
EIconOptions m_eIconOptions;
// Generated message map functions
protected:
//{{AFX_MSG(COptionsDialog)
virtual BOOL OnInitDialog();
afx_msg void OnTextOptions();
afx_msg void OnIconOptions();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDialog dialog
class CToolBarEx;
class CCustomizeDialog : public CWnd
{
DECLARE_DYNAMIC( CCustomizeDialog );
// Construction
public:
CCustomizeDialog( CToolBarEx* pToolBar );
// Operations
public:
void SetTextOptions( ETextOptions eTextOptions, bool bInDialog );
void SetIconOptions( EIconOptions eIconOptions, bool bInDialog );
void AddTextOption( CComboBox& cbTextOptions, ETextOptions eTextOptions, UINT nStringID );
void AddIconOption( CComboBox& cbIconOptions, EIconOptions eIconOptions, UINT nStringID );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCustomizeDialog)
protected:
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
CSize GetButtonSize() const;
// Implementation data
protected:
COptionsDialog m_dlgOptions;
CToolBarEx* m_pToolBar;
// Generated message map functions
protected:
//{{AFX_MSG(CCustomizeDialog)
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
//}}AFX_MSG
LRESULT OnInitDialog( WPARAM wParam, LPARAM lParam );
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif // RC_INVOKED
#endif // !__CUSTOMIZEDIALOG_H__
|
#include "unistd.h"
int main(){
if(lseek(STDIN_FILENO, 0, SEEK_CUR) == -1){
printf("cannot seek\n");
}else{
printf("seek Ok\n");
}
exit(0);
}
|
// Copyright (c) 2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_VERSION_H
#define BITCOIN_VERSION_H
#include "clientversion.h"
#include <string>
//
// client versioning
//
static const int CLIENT_VERSION =
1000000 * CLIENT_VERSION_MAJOR
+ 10000 * CLIENT_VERSION_MINOR
+ 100 * CLIENT_VERSION_REVISION
+ 1 * CLIENT_VERSION_BUILD;
extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
//
// database format versioning
//
static const int DATABASE_VERSION = 70508;
//
// network protocol versioning
//
static const int PROTOCOL_VERSION = 80000;
// earlier versions not supported and are disconnected
static const int MIN_PROTO_VERSION = 80000;
// nTime field added to CAddress, starting with this version;
// if possible, avoid requesting addresses nodes older than this
static const int CADDR_TIME_VERSION = 31402;
// only request blocks from nodes outside this range of versions
static const int NOBLKS_VERSION_START = 60002;
static const int NOBLKS_VERSION_END = 60006;
// BIP 0031, pong message, is enabled for all versions AFTER this one
static const int BIP0031_VERSION = 60000;
// "mempool" command, enhanced "getdata" behavior starts with this version:
static const int MEMPOOL_GD_VERSION = 60002;
#endif
|
// *******************************************************************
// The MIT License (MIT)
//
// Copyright (c) 2014 Ioan "John" Rus
//
// 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.
// -------------------------------------------------------------------
// File: Singleton.h
// Description: See class description.
// Author: Ioan L. Rus
// Date: May 5, 2014
// Revisions:
// -------------------------------------------------------------------
// INI Date Description
// --- ----------- ---------------------------------------------------
//
// *******************************************************************
#ifndef _SINGLETON_H_INCLUDED_
#define _SINGLETON_H_INCLUDED_
#include <mutex>
namespace Ioan
{
namespace Thread
{
// Multithreaded singleton template base class.
// Usage:
// 1. Make the template a public base for your class.
// 2. Use a private constructor for your class.
// 3. Make the template a friend class.
//
// Example:
//
// class MySingletonClass
// : public Ioan::Thread::SingletonRef<MySingletonClass>
// {
// private:
// friend Ioan::Thread::SingletonRef<MySingletonClass>;
// MySingletonClass();
//
// public:
// void DoWork() { ... }
// };
//
// // Use the singleton as:
// MySingletonClass &s=MySingletonClass::GetInstance();
//
// Singleton that returns a ref
template<typename T>
class SingletonRef
{
public:
static T &GetInstance()
{
static std::mutex m;
std::lock_guard<std::mutex> lock(m);
static T s;
return s;
}
};
// Singleton that returns a pointer
template<typename T>
class SingletonPtr
{
public:
static T *GetInstance()
{
static std::mutex m;
std::lock_guard<std::mutex> lock(m);
static T s;
return &s;
}
};
// Singleton that calls static T::Create() and returns a ref.
// T must privately implement Create() with this signature:
//
// static T &Create();
//
template<typename T>
class SingletonRefC
{
public:
static T &GetInstance()
{
static std::mutex m;
std::lock_guard<std::mutex> lock(m);
static T &s=T::Create();
return s;
}
};
}
}
#define STATIC_INSTANCE_FUNCTION(T)\
static T &GetInstance()\
{\
static std::mutex m;\
std::lock_guard<std::mutex> lock(m);\
static T s;\
return s;\
}
#define STATIC_INSTANCE_FUNCTION_ARGS(T,...)\
static T &GetInstance()\
{\
static std::mutex m;\
std::lock_guard<std::mutex> lock(m);\
static T s(__VA_ARGS__);\
return s;\
}
#endif // _SINGLETON_H_INCLUDED_
|
// Copyright (c) 2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_VERSION_H
#define BITCOIN_VERSION_H
#include "clientversion.h"
#include <string>
//
// client versioning
//
static const int CLIENT_VERSION =
1000000 * CLIENT_VERSION_MAJOR
+ 10000 * CLIENT_VERSION_MINOR
+ 100 * CLIENT_VERSION_REVISION
+ 1 * CLIENT_VERSION_BUILD;
extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
//
// database format versioning
//
static const int DATABASE_VERSION = 70508;
//
// network protocol versioning
//
static const int PROTOCOL_VERSION = 80001;
// earlier versions not supported as of Feb 2012, and are disconnected
static const int MIN_PROTO_VERSION = 80001;
// nTime field added to CAddress, starting with this version;
// if possible, avoid requesting addresses nodes older than this
static const int CADDR_TIME_VERSION = 31402;
// only request blocks from nodes outside this range of versions
static const int NOBLKS_VERSION_START = 60002;
static const int NOBLKS_VERSION_END = 60006;
// BIP 0031, pong message, is enabled for all versions AFTER this one
static const int BIP0031_VERSION = 60000;
// "mempool" command, enhanced "getdata" behavior starts with this version:
static const int MEMPOOL_GD_VERSION = 60002;
#endif
|
#include <stdint.h>
typedef int32_t __s32; /* signed 32 b */
typedef uint32_t __u32; /* unsigned 32 b */
typedef uint8_t __u8; /* unsigned 8 b */
typedef int8_t __s8; /* signed 8 b */
typedef uint16_t __u16; /* unsigned 16 b */
typedef int16_t __s16; /* signed 16 b */
typedef __uint8_t sa_family_t;
|
#ifndef _FWPREFERENCES_H_
#define _FWPREFERENCES_H_
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <stdexcept>
class FWPreferences {
public:
FWPreferences() { }
const std::string & getText(const std::string & key) const {
auto it = data.find(key);
if (it != data.end()) return it->second;
else return empty_string;
}
const std::string & getText(const std::string & key, const std::string & defaultValue) const {
auto it = data.find(key);
if (it != data.end()) return it->second;
else return defaultValue;
}
void deleteKey(const std::string & key) {
data.erase(key);
deletedKeys.insert(key);
}
int getInt(const std::string & key, int defaultValue = 0) const {
try {
return std::stoi(getText(key, std::to_string(defaultValue)));
} catch (std::invalid_argument & e) {
return 0;
}
}
long long getLong(const std::string & key, long long defaultValue = 0) const {
try {
return std::stoll(getText(key, std::to_string(defaultValue)));
} catch (std::invalid_argument & e) {
return 0;
}
}
void setText(const std::string & key, const std::string & value) {
deletedKeys.erase(key);
data[key] = value;
changedKeys.insert(key);
}
void setInt(const std::string & key, int value) {
setText(key, std::to_string(value));
}
void setLong(const std::string & key, long long value) {
setText(key, std::to_string(value));
}
bool empty() const { return data.empty(); }
size_t size() const { return data.size(); }
std::unordered_map<std::string, std::string> getChanges() const {
std::unordered_map<std::string, std::string> r;
for (auto & key : changedKeys) {
r[key] = getText(key);
}
return r;
}
const std::unordered_set<std::string> & getDeletedKeys() {
return deletedKeys;
}
void clearChanges() { changedKeys.clear(); deletedKeys.clear(); }
std::vector<std::string> getKeys() const {
std::vector<std::string> r;
for (auto & d : data) {
r.push_back(d.first);
}
return r;
}
private:
std::unordered_map<std::string, std::string> data;
std::string empty_string;
std::unordered_set<std::string> changedKeys;
std::unordered_set<std::string> deletedKeys;
};
#endif
|
// No build information available
#define BUILD_DATE "2014-12-03 02:19:43 -0800"
|
// File for RK-4 Integration
void rk4(body bodies[], int N, double dt)
{
}
|
/*
Copyright (c) 2013 Mathias Kaerlev
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 VOXIE_TYPES_H
#define VOXIE_TYPES_H
#include <vector>
#include <string>
#if defined(_MSC_VER)
// Define _W64 macros to mark types changing their size, like intptr_t.
#ifndef _W64
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
#define _W64 __w64
#else
#define _W64
#endif
#endif
#ifdef _WIN64
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else
typedef _W64 signed int intptr_t;
typedef _W64 unsigned int uintptr_t;
#endif // _WIN64
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#include <unordered_map>
#include <unordered_set>
#define fast_map std::tr1::unordered_map
#define fast_set std::tr1::unordered_set
#else
#include <stdint.h>
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#define fast_map std::tr1::unordered_map
#define fast_set std::tr1::unordered_set
#endif // _MSC_VER
typedef std::vector<std::string> StringList;
#endif // VOXIE_TYPES_H
|
//
// TLCoreTextImage.h
// TLAttributedLabel-Demo
//
// Created by andezhou on 15/7/7.
// Copyright (c) 2015年 andezhou. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "TLAttributeConfig.h"
@interface TLAttributedLabelImage : NSObject
/**
* 用来保存图片名字
*/
@property (strong, nonatomic) NSString *imageName;
/**
* 用来保存图片的size大小
*/
@property (assign, nonatomic) CGSize imageSize;
/**
* 图片是否允许点击
*/
@property (assign, nonatomic) BOOL allowClick;
/**
* 用来保存图片相对于文字的排版样式
*/
@property (assign, nonatomic, readonly) CTImageAlignment imageAlignment;
/**
* 用来保存图片相对于父视图的展示模式
*/
@property (assign, nonatomic, readonly) CTImageShowMode imageMode;
/**
* 用来保存图片的frame,此坐标是 CoreText 的坐标系,而不是UIKit的坐标系
*/
@property (assign, nonatomic) CGRect imagePosition;
#pragma mark 从字符串中找出所有的图片,并把图片和文字分开
+ (NSArray *)detectImagesFromContent:(NSString *)content;
#pragma mark 生成图片空白的占位符
- (NSAttributedString *)parseImageDataFromConfig:(TLAttributeConfig *)config
attributes:(NSDictionary *)attributes;
@end
|
//
// KeyChain.h
// Randomer
//
// Created by 王子轩 on 16/4/9.
// Copyright © 2016年 com.wzx. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface KeyChain : NSObject
//MARK: - Basic
+ (void)save:(NSString *)service data:(id)data;
+ (id)load:(NSString *)service;
+ (void)deleteKey:(NSString *)service;
+ (void)saveAccount:(NSString *)account;
+ (NSString *)account;
+ (void)savePassword:(NSString *)password;
+ (NSString *)password;
@end
|
/*
* File: Bullet.h
* Author: zach
*
* Created on March 5, 2009, 1:22 PM
*/
#ifndef _BULLET_H
#define _BULLET_H
#include <SDL/SDL_mixer.h>
#include "Sprite.h"
class Vector;
class Visitor;
class Bullet:public Sprite {
public:
Bullet(int x, int y, int mouse_x, int mouse_y);
~Bullet();
void update();
void render(SDL_Surface* screen);
void accept(Visitor* v, Sprite* s);
bool destroy(); //returns true if this object should be destroyed
float pos_x,pos_y;
Vector& velocity() const;
bool markedForRemoval();
void markForRemoval();
void playSoundEffect();
float getX();
float getY();
private:
void explode();
SDL_Surface* image;
Vector* v;
int target_x, target_y;
bool needsRemoved;
Mix_Chunk* sound;
};
#endif /* _BULLET_H */
|
//
// UIPopoverController.h
// UIKit
//
// Copyright (c) 2009-2015 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKitDefines.h>
#import <UIKit/UIApplication.h>
#import <UIKit/UIViewController.h>
#import <UIKit/UIAppearance.h>
#import <UIKit/UIGeometry.h>
#import <UIKit/UIPopoverSupport.h>
NS_ASSUME_NONNULL_BEGIN
@class UIBarButtonItem, UIView;
@protocol UIPopoverControllerDelegate;
NS_CLASS_DEPRECATED_IOS(3_2, 9_0, "UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal presentation style of UIModalPresentationPopover and UIPopoverPresentationController.")
@interface UIPopoverController : NSObject <UIAppearanceContainer> {}
/* The view controller provided becomes the content view controller for the UIPopoverController. This is the designated initializer for UIPopoverController.
*/
- (instancetype)initWithContentViewController:(UIViewController *)viewController;
@property (nullable, nonatomic, weak) id <UIPopoverControllerDelegate> delegate;
/* The content view controller is the `UIViewController` instance in charge of the content view of the displayed popover. This property can be changed while the popover is displayed to allow different view controllers in the same popover session.
*/
@property (nonatomic, strong) UIViewController *contentViewController;
- (void)setContentViewController:(UIViewController *)viewController animated:(BOOL)animated;
/* This property allows direction manipulation of the content size of the popover. Changing the property directly is equivalent to animated=YES. The content size is limited to a minimum width of 320 and a maximum width of 600.
*/
@property (nonatomic) CGSize popoverContentSize;
- (void)setPopoverContentSize:(CGSize)size animated:(BOOL)animated;
/* Returns whether the popover is visible (presented) or not.
*/
@property (nonatomic, readonly, getter=isPopoverVisible) BOOL popoverVisible;
/* Returns the direction the arrow is pointing on a presented popover. Before presentation, this returns UIPopoverArrowDirectionUnknown.
*/
@property (nonatomic, readonly) UIPopoverArrowDirection popoverArrowDirection;
/* By default, a popover disallows interaction with any view outside of the popover while the popover is presented. This property allows the specification of an array of UIView instances which the user is allowed to interact with while the popover is up.
*/
@property (nullable, nonatomic, copy) NSArray<__kindof UIView *> *passthroughViews;
/* -presentPopoverFromRect:inView:permittedArrowDirections:animated: allows you to present a popover from a rect in a particular view. `arrowDirections` is a bitfield which specifies what arrow directions are allowed when laying out the popover; for most uses, `UIPopoverArrowDirectionAny` is sufficient.
*/
- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;
/* Like the above, but is a convenience for presentation from a `UIBarButtonItem` instance. arrowDirection limited to UIPopoverArrowDirectionUp/Down
*/
- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;
/* Called to dismiss the popover programmatically. The delegate methods for "should" and "did" dismiss are not called when the popover is dismissed in this way.
*/
- (void)dismissPopoverAnimated:(BOOL)animated;
/* Set popover background color. Set to nil to use default background color. Default is nil.
*/
@property (nullable, nonatomic, copy) UIColor *backgroundColor NS_AVAILABLE_IOS(7_0);
/* Clients may wish to change the available area for popover display. The default implementation of this method always returns insets which define 10 points from the edges of the display, and presentation of popovers always accounts for the status bar. The rectangle being inset is always expressed in terms of the current device orientation; (0, 0) is always in the upper-left of the device. This may require insets to change on device rotation.
*/
@property (nonatomic, readwrite) UIEdgeInsets popoverLayoutMargins NS_AVAILABLE_IOS(5_0);
/* Clients may customize the popover background chrome by providing a class which subclasses `UIPopoverBackgroundView` and which implements the required instance and class methods on that class.
*/
@property (nullable, nonatomic, readwrite, strong) Class popoverBackgroundViewClass NS_AVAILABLE_IOS(5_0);
@end
@protocol UIPopoverControllerDelegate <NSObject>
@optional
/* Called on the delegate when the popover controller will dismiss the popover. Return NO to prevent the dismissal of the view.
*/
- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController NS_DEPRECATED_IOS(3_2, 9_0);
/* Called on the delegate when the user has taken action to dismiss the popover. This is not called when -dismissPopoverAnimated: is called directly.
*/
- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController NS_DEPRECATED_IOS(3_2, 9_0);
/* -popoverController:willRepositionPopoverToRect:inView: is called on your delegate when the popover may require a different view or rectangle
*/
- (void)popoverController:(UIPopoverController *)popoverController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView * __nonnull * __nonnull)view NS_DEPRECATED_IOS(7_0,9_0);
@end
NS_ASSUME_NONNULL_END
|
#pragma once
void rose_js_input_mouse(const v8::FunctionCallbackInfo<v8::Value>& args);
void rose_js_input_btn(const v8::FunctionCallbackInfo<v8::Value>& args);
void rose_js_input_btnp(const v8::FunctionCallbackInfo<v8::Value>& args);
void rose_js_input_wheel(const v8::FunctionCallbackInfo<v8::Value>& args);
void rose_js_input_key(const v8::FunctionCallbackInfo<v8::Value>& args);
void rose_js_input_keyp(const v8::FunctionCallbackInfo<v8::Value>& args);
|
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// AFNetworking
#define COCOAPODS_POD_AVAILABLE_AFNetworking
#define COCOAPODS_VERSION_MAJOR_AFNetworking 2
#define COCOAPODS_VERSION_MINOR_AFNetworking 5
#define COCOAPODS_VERSION_PATCH_AFNetworking 4
// AFNetworking/NSURLConnection
#define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLConnection
#define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLConnection 2
#define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLConnection 5
#define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLConnection 4
// AFNetworking/NSURLSession
#define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLSession
#define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLSession 2
#define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLSession 5
#define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLSession 4
// AFNetworking/Reachability
#define COCOAPODS_POD_AVAILABLE_AFNetworking_Reachability
#define COCOAPODS_VERSION_MAJOR_AFNetworking_Reachability 2
#define COCOAPODS_VERSION_MINOR_AFNetworking_Reachability 5
#define COCOAPODS_VERSION_PATCH_AFNetworking_Reachability 4
// AFNetworking/Security
#define COCOAPODS_POD_AVAILABLE_AFNetworking_Security
#define COCOAPODS_VERSION_MAJOR_AFNetworking_Security 2
#define COCOAPODS_VERSION_MINOR_AFNetworking_Security 5
#define COCOAPODS_VERSION_PATCH_AFNetworking_Security 4
// AFNetworking/Serialization
#define COCOAPODS_POD_AVAILABLE_AFNetworking_Serialization
#define COCOAPODS_VERSION_MAJOR_AFNetworking_Serialization 2
#define COCOAPODS_VERSION_MINOR_AFNetworking_Serialization 5
#define COCOAPODS_VERSION_PATCH_AFNetworking_Serialization 4
// AFNetworking/UIKit
#define COCOAPODS_POD_AVAILABLE_AFNetworking_UIKit
#define COCOAPODS_VERSION_MAJOR_AFNetworking_UIKit 2
#define COCOAPODS_VERSION_MINOR_AFNetworking_UIKit 5
#define COCOAPODS_VERSION_PATCH_AFNetworking_UIKit 4
// AMap2DMap
#define COCOAPODS_POD_AVAILABLE_AMap2DMap
#define COCOAPODS_VERSION_MAJOR_AMap2DMap 2
#define COCOAPODS_VERSION_MINOR_AMap2DMap 5
#define COCOAPODS_VERSION_PATCH_AMap2DMap 0
// AMapSearch
#define COCOAPODS_POD_AVAILABLE_AMapSearch
#define COCOAPODS_VERSION_MAJOR_AMapSearch 2
#define COCOAPODS_VERSION_MINOR_AMapSearch 5
#define COCOAPODS_VERSION_PATCH_AMapSearch 0
// Colours
#define COCOAPODS_POD_AVAILABLE_Colours
#define COCOAPODS_VERSION_MAJOR_Colours 5
#define COCOAPODS_VERSION_MINOR_Colours 6
#define COCOAPODS_VERSION_PATCH_Colours 2
// KeychainItemWrapper
#define COCOAPODS_POD_AVAILABLE_KeychainItemWrapper
#define COCOAPODS_VERSION_MAJOR_KeychainItemWrapper 1
#define COCOAPODS_VERSION_MINOR_KeychainItemWrapper 2
#define COCOAPODS_VERSION_PATCH_KeychainItemWrapper 0
// MBProgressHUD
#define COCOAPODS_POD_AVAILABLE_MBProgressHUD
#define COCOAPODS_VERSION_MAJOR_MBProgressHUD 0
#define COCOAPODS_VERSION_MINOR_MBProgressHUD 9
#define COCOAPODS_VERSION_PATCH_MBProgressHUD 1
// MJRefresh
#define COCOAPODS_POD_AVAILABLE_MJRefresh
#define COCOAPODS_VERSION_MAJOR_MJRefresh 2
#define COCOAPODS_VERSION_MINOR_MJRefresh 0
#define COCOAPODS_VERSION_PATCH_MJRefresh 4
// RESideMenu
#define COCOAPODS_POD_AVAILABLE_RESideMenu
#define COCOAPODS_VERSION_MAJOR_RESideMenu 4
#define COCOAPODS_VERSION_MINOR_RESideMenu 0
#define COCOAPODS_VERSION_PATCH_RESideMenu 7
// SDWebImage
#define COCOAPODS_POD_AVAILABLE_SDWebImage
#define COCOAPODS_VERSION_MAJOR_SDWebImage 3
#define COCOAPODS_VERSION_MINOR_SDWebImage 7
#define COCOAPODS_VERSION_PATCH_SDWebImage 2
// SDWebImage/Core
#define COCOAPODS_POD_AVAILABLE_SDWebImage_Core
#define COCOAPODS_VERSION_MAJOR_SDWebImage_Core 3
#define COCOAPODS_VERSION_MINOR_SDWebImage_Core 7
#define COCOAPODS_VERSION_PATCH_SDWebImage_Core 2
// SSKeychain
#define COCOAPODS_POD_AVAILABLE_SSKeychain
#define COCOAPODS_VERSION_MAJOR_SSKeychain 1
#define COCOAPODS_VERSION_MINOR_SSKeychain 2
#define COCOAPODS_VERSION_PATCH_SSKeychain 3
// UMengAnalytics
#define COCOAPODS_POD_AVAILABLE_UMengAnalytics
#define COCOAPODS_VERSION_MAJOR_UMengAnalytics 3
#define COCOAPODS_VERSION_MINOR_UMengAnalytics 5
#define COCOAPODS_VERSION_PATCH_UMengAnalytics 8
// VENTouchLock
#define COCOAPODS_POD_AVAILABLE_VENTouchLock
#define COCOAPODS_VERSION_MAJOR_VENTouchLock 1
#define COCOAPODS_VERSION_MINOR_VENTouchLock 0
#define COCOAPODS_VERSION_PATCH_VENTouchLock 6
|
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
#pragma once
#include "ATNConfigSet.h"
#include "ATNConfig.h"
namespace antlr4 {
namespace atn {
class ANTLR4CPP_PUBLIC OrderedATNConfigSet : public ATNConfigSet {
protected:
virtual size_t getHash(ATNConfig *c) override;
};
} // namespace atn
} // namespace antlr4
|
//
// ARNDataObject.h
//
// Created by Stefan Arn on 21.04.15.
// Copyright (c) 2015 Edge5. All rights reserved.
//
#import <Foundation/Foundation.h>
// ARNDataObjects are exactly the same as a CoreData object
// with the same interface, BUT not attached to CoreData.
// With those objects we can enforce a clean and thread safe
// architecture. NSManagedObjects should only be used inside
// of data controllers or by fetch requests and guarded by performBlocks
// all other parts of the app should use those thread safe ARNDataObjects
// instead of the NSManagedObjects.
@interface ARNDataObject : NSObject
- (id)initWithAttributesOfManagedObject:(NSManagedObject *)source;
- (id)copyAttributesOfManagedObject:(NSManagedObject *)source;
- (void)setValue:(id)value forUndefinedKey:(NSString *)key;
@end
|
#include <string.h>
#include <strings.h>
#include <wlc/wlc.h>
#include "sway/commands.h"
#include "sway/container.h"
#include "sway/focus.h"
#include "sway/layout.h"
static swayc_t *fetch_view_from_scratchpad() {
if (sp_index >= scratchpad->length) {
sp_index = 0;
}
swayc_t *view = scratchpad->items[sp_index++];
if (wlc_view_get_output(view->handle) != swayc_active_output()->handle) {
wlc_view_set_output(view->handle, swayc_active_output()->handle);
}
if (!view->is_floating) {
view->width = swayc_active_workspace()->width * 0.5;
view->height = swayc_active_workspace()->height * 0.75;
view->x = (swayc_active_workspace()->width - view->width)/2;
view->y = (swayc_active_workspace()->height - view->height)/2;
}
if (swayc_active_workspace()->width < view->x + 20 || view->x + view->width < 20) {
view->x = (swayc_active_workspace()->width - view->width)/2;
}
if (swayc_active_workspace()->height < view->y + 20 || view->y + view->height < 20) {
view->y = (swayc_active_workspace()->height - view->height)/2;
}
add_floating(swayc_active_workspace(), view);
wlc_view_set_mask(view->handle, VISIBLE);
view->visible = true;
arrange_windows(swayc_active_workspace(), -1, -1);
set_focused_container(view);
return view;
}
struct cmd_results *cmd_scratchpad(int argc, char **argv) {
struct cmd_results *error = NULL;
if (config->reading) return cmd_results_new(CMD_FAILURE, "scratchpad", "Can't be used in config file.");
if (!config->active) return cmd_results_new(CMD_FAILURE, "scratchpad", "Can only be used when sway is running.");
if ((error = checkarg(argc, "scratchpad", EXPECTED_EQUAL_TO, 1))) {
return error;
}
if (strcasecmp(argv[0], "show") == 0 && scratchpad->length > 0) {
if (!sp_view) {
sp_view = fetch_view_from_scratchpad();
} else {
if (swayc_active_workspace() != sp_view->parent) {
hide_view_in_scratchpad(sp_view);
if (sp_index == 0) {
sp_index = scratchpad->length;
}
sp_index--;
sp_view = fetch_view_from_scratchpad();
} else {
hide_view_in_scratchpad(sp_view);
sp_view = NULL;
}
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
return cmd_results_new(CMD_FAILURE, "scratchpad", "Expected 'scratchpad show' when scratchpad is not empty.");
}
|
/******************************************************************************************
* Program name : Digital_IN.h
* Description : The declaration for Digital_IN module.
* Author : XU ZAN
* Date : Thu. July 26, 2012
* Copyright(C) 2010 --- 2012 Hella (Shanghai) Electronics Co., Ltd.
* All rights reserved.
*
******************************************************************************************/
#ifndef _DIGITAL_IN_H
#define _DIGITAL_IN_H
#if !defined (FW_SIMULATION_TESTING_BASED_ON_VISUAL_STUDIO)
#include "../macrodriver.h"
#else
#include "../FW_Simulation_Testing/configuration.h"
#endif /* FW_SIMULATION_TESTING_BASED_ON_VISUAL_STUDIO */
typedef enum Digital_IN_CHm
{
DIN_CH0 = 0,
DIN_CH1 = 1,
DIN_CH2 = 2,
DIN_CH3 = 3,
DIN_CH4 = 4,
DIN_CH5 = 5,
DIN_CH6 = 6,
DIN_CH7 = 7,
DIN_CH8 = 8,
DIN_CH9 = 9,
DIN_CH10 = 10,
DIN_CH11 = 11,
DIN_CH12 = 12,
DIN_CH13 = 13,
DIN_CH14 = 14,
DIN_CH15 = 15,
DIN_CH16 = 16,
DIN_CH17 = 17,
DIN_CH18 = 18,
DIN_CH19 = 19,
DIN_CH20 = 20,
DIN_CH21 = 21,
DIN_CH22 = 22,
DIN_CH23 = 23
}
DIGITAL_IN_CHm;
typedef struct Digital_IN_CHm_State
{
DIGITAL_IN_CHm eCHm;
enum LEVEL eCHm_State;
}
DIN_CHm_STATE, *P_DIN_CHm_STATE;
#if !defined(FW_SIMULATION_TESTING_BASED_ON_VISUAL_STUDIO)
void Read_DIN_CHn_State(P_DIN_CHm_STATE pDInCHmState);
void Read_DIN_Multi_CHs_State(P_DIN_CHm_STATE pCHiState, ...);
void Read_DIN_1GroupOfCHs_State(char *sARGOUT_24ChsStates);
int Read_DinBoard_CHn_State(BYTE ucDinBoardID, DIGITAL_IN_CHm eDinChn);
void Read_DinBoard_24Chs_State(BYTE ucDinBoardID, char *sARGOUT_24ChsStates);
#endif /* FW_SIMULATION_TESTING_BASED_ON_VISUAL_STUDIO */
#endif /* _DIGITAL_IN_H */
|
#ifndef __CONFIGURATIONTEST_H__
#define __CONFIGURATIONTEST_H__
#include "../testBasic.h"
USING_NS_CC;
// the class inherit from TestScene
// every Scene each test used must inherit from TestScene,
// make sure the test have the menu item for back to main menu
class ConfigurationTestScene : public TestScene
{
public:
virtual void runThisTest();
};
class ConfigurationBase : public CCLayer
{
protected:
public:
virtual void onEnter();
virtual void onExit();
virtual std::string title();
virtual std::string subtitle();
void restartCallback(CCObject* pSender);
void nextCallback(CCObject* pSender);
void backCallback(CCObject* pSender);
};
class ConfigurationLoadConfig : public ConfigurationBase
{
public:
virtual void onEnter();
virtual std::string subtitle();
};
class ConfigurationQuery : public ConfigurationBase
{
public:
virtual void onEnter();
virtual std::string subtitle();
};
class ConfigurationInvalid : public ConfigurationBase
{
public:
virtual void onEnter();
virtual std::string subtitle();
};
class ConfiguratioScutefault : public ConfigurationBase
{
public:
virtual void onEnter();
virtual std::string subtitle();
};
class ConfigurationSet : public ConfigurationBase
{
public:
virtual void onEnter();
virtual std::string subtitle();
};
#endif // __CONFIGURATIONTEST_H__
|
#ifndef SPIDAISYCHAIN_H_INCLUDED
#define SPIDAISYCHAIN_H_INCLUDED
#include <Arduino.h>
#include "pins_arduino.h"
#include <SPI.h>
class SPIDaisyChain : public SPIClass
{
public:
// chain id = 0 : the farthest motor
// chain id = n : the nearest motor
SPIDaisyChain(const int pinCS = 10, const int nDaisyChains = 1);
~SPIDaisyChain();
byte* transferDaisyChain(byte* chainedValue);
int getDaisyChainNum();
private:
uint8_t _pinCS;
uint8_t _nDaisyChains;
uint8_t _bitOrder;
uint8_t _spiMode;
byte* readBytes;
void (SPIDaisyChain::*fallCS)();
void (SPIDaisyChain::*riseCS)();
inline void fallCSPORTD();
inline void fallCSPORTB();
inline void riseCSPORTD();
inline void riseCSPORTB();
};
#endif
|
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <signal.h>
#include "prussdrv.h"
#include "pruss_intc_mapping.h"
#include "common/mio.h"
#include "../bbb_common/pb_msg.h"
#include "../bbb_common/msg_queue.h"
#define PERROR() printf("[!] %s:%u\n", __FUNCTION__, __LINE__)
/* doc: spruh73c, table 2.2 */
#define CM_WKUP_MIO_ADDR 0x44e00400
#define CM_WKUP_MIO_SIZE 0x1000
/* doc: spruh73c, table 8.28 */
#define CM_WKUP_ADC_TSC_CLKCTRL 0xbc
#define PRU_NUM 0
/* host pru shared memory */
static void zero_words(size_t n)
{
mio_handle_t mio;
size_t i;
if (mio_open(&mio, 0x80001000, 0x1000))
{
printf("unable to zero_words\n");
return ;
}
for (i = 0; i != n; ++i)
mio_write_uint32(&mio, i * sizeof(uint32_t), 0);
mio_close(&mio);
}
static int cm_wkup_enable_adc_tsc(void)
{
mio_handle_t mio;
if (mio_open(&mio, CM_WKUP_MIO_ADDR, CM_WKUP_MIO_SIZE)) return -1;
mio_write_uint32(&mio, CM_WKUP_ADC_TSC_CLKCTRL, 2);
mio_close(&mio);
return 0;
}
#define SHM_OFFSET (0)
static int
read_header( struct header *hp )
{
volatile uint32_t* p;
static const size_t sharedram_offset = SHM_OFFSET / sizeof( *p );
prussdrv_map_prumem(PRUSS0_SHARED_DATARAM, (void**)&p);
memcpy( hp, &p[sharedram_offset], sizeof( struct header ) );
return 0;
}
static int
read_channel_data( struct header *hp, msg *m )
{
static const size_t sharedram_offset = SHM_OFFSET;
size_t data_offset = sizeof( struct header ) + ( ( hp->seqno - 1 ) % 2 ) * MSG_DATA_SIZE;
volatile char *p;
prussdrv_map_prumem( PRUSS0_SHARED_DATARAM, (void**)&p );
m->mtype = MG_TYPE;
memcpy( &m->data, &p[sharedram_offset + data_offset], MSG_DATA_SIZE );
return 0;
}
static volatile unsigned int is_sigint = 0;
static void on_sigint(int x)
{
is_sigint = 1;
}
/* doc: spruh73c, table 2.2 */
#define CM_PER_MIO_ADDR 0x44e00000
#define CM_PER_MIO_SIZE (128 * 1024)
/* doc: spruh73c, table 2.2 */
#define CM_WKUP_MIO_ADDR 0x44e00400
#define CM_WKUP_MIO_SIZE 0x1000
/* doc: spruh73c, table 8.28 */
#define CM_PER_EPWMSS0_CLKCTRL 0xd4
#define CM_PER_EPWMSS1_CLKCTRL 0xcc
#define CM_PER_EPWMSS2_CLKCTRL 0xd8
/* doc: spruh73c, table 8.28 */
#define CM_WKUP_ADC_TSC_CLKCTRL 0xbc
/* doc: spruh73c, table 2.2 */
#define CM_WKUP_MIO_ADDR 0x44e00400
#define CM_WKUP_MIO_SIZE 0x1000
/* doc: spruh73c, table 8-88 */
#define CM_CLKSEL_DPLL_CORE 0x68
#define CM_CLKDCOLDO_DPLL_PER 0x7c
#define CM_DIV_M4_DPLL_CORE 0x80
#define CM_CLKMODE_DPLL_PER 0x8c
#define CM_CLKSEL_DPLL_PERIPH 0x9c
#define CM_DIV_M2_DPLL_MPU 0xa8
/* tsc adc */
/* doc: spruh73c, table 2.2 */
#define ADC_MIO_ADDR 0x44e0d000
#define ADC_MIO_SIZE (8 * 1024)
/* doc: spruh73c, table 12.4 */
#define ADC_REG_SYSCONFIG 0x10
#define ADC_REG_IRQENABLE_SET 0x2c
#define ADC_REG_IRQWAKEUP 0x34
#define ADC_REG_DMAENABLE_SET 0x38
#define ADC_REG_CTRL 0x40
#define ADC_REG_ADC_CLKDIV 0x4c
#define ADC_REG_STEPENABLE 0x54
#define ADC_REG_TS_CHARGE_STEPCONFIG 0x5c
#define ADC_REG_TS_CHARGE_DELAY 0x60
#define ADC_REG_STEP1CONFIG 0x64
#define ADC_REG_STEP2CONFIG 0x6C
#define ADC_REG_STEP3CONFIG 0x74
#define ADC_REG_STEP4CONFIG 0x7C
#define ADC_REG_FIFO0COUNT 0xe4
#define ADC_REG_FIFO0DATA 0x100
static int adc_setup(void)
{
mio_handle_t mio;
/* enable adc_tsc clocking */
if (cm_wkup_enable_adc_tsc())
{
PERROR();
return -1;
}
if (mio_open(&mio, ADC_MIO_ADDR, ADC_MIO_SIZE))
{
PERROR();
return -1;
}
/* disable the module, enable step registers writing */
mio_write_uint32(&mio, ADC_REG_CTRL, 1 << 2);
/* setup adc */
mio_write_uint32(&mio, ADC_REG_SYSCONFIG, 1 << 2);
mio_write_uint32(&mio, ADC_REG_IRQENABLE_SET, 0);
mio_write_uint32(&mio, ADC_REG_IRQWAKEUP, 0);
mio_write_uint32(&mio, ADC_REG_DMAENABLE_SET, 0);
mio_write_uint32(&mio, ADC_REG_ADC_CLKDIV, 0);
mio_write_uint32(&mio, ADC_REG_TS_CHARGE_DELAY, 1);
// sb original was 1 << 19
//mio_write_uint32(&mio, ADC_REG_TS_CHARGE_STEPCONFIG, 1 << 19);
mio_write_uint32(&mio, ADC_REG_TS_CHARGE_STEPCONFIG, (0x100) << 19);
/* enable channel 1 */
mio_write_uint32(&mio, ADC_REG_STEPENABLE,
( 1 << 4 ) | ( 1 << 3 ) | ( 1 << 2 ) |
(1 << 1) | (1 << 0) );
//#define AVG (0x100)
#define AVG (0x000)
/* channel 1, continuous mode, averaging = 2 */
mio_write_uint32(&mio, ADC_REG_STEP1CONFIG, AVG | 1 );
/* channel 2, continuous mode, averaging = 2 */
mio_write_uint32(&mio, ADC_REG_STEP2CONFIG, AVG | 1 | (1 << 19));
mio_write_uint32(&mio, ADC_REG_STEP3CONFIG, AVG | 1 | (0x2 << 19));
mio_write_uint32(&mio, ADC_REG_STEP4CONFIG, AVG | 1 | (0x3 << 19));
/* enable the module */
mio_write_uint32(&mio, ADC_REG_CTRL, 1);
mio_close(&mio);
return 0;
}
/* main */
int
main( int argc, char *argv[] )
{
// Buffer written into
struct header hdr;
#ifdef DEBUG
unsigned long nr_msgs = 0;
#endif
msg m;
int qid;
tpruss_intc_initdata pruss_intc_initdata = PRUSS_INTC_INITDATA;
adc_setup();
prussdrv_init();
qid = mg_open( "/tmp/pb_msgqueue" );
if ( prussdrv_open( PRU_EVTOUT_0 ) ) {
printf( "prussdrv_open open failed\n" );
return -1;
}
prussdrv_pruintc_init( &pruss_intc_initdata );
// zero_words(n);
// Write data and execution code on PRU0
prussdrv_load_datafile( PRU_NUM, "./data.bin" );
prussdrv_exec_program_at( PRU_NUM, "./text.bin", START_ADDR );
signal( SIGINT, on_sigint );
while (is_sigint == 0) {
prussdrv_pru_wait_event( PRU_EVTOUT_0 );
prussdrv_pru_clear_event( PRU_EVTOUT_0, PRU0_ARM_DONE_INTERRUPT );
read_header( &hdr );
printf( "%x\n", hdr.magic );
read_channel_data( &hdr, &m );
mg_send( qid, &m );
#ifdef DEBUG
nr_msgs++;
#endif
#ifdef DEBUG
if ( nr_msgs % 10 == 0 ) {
printf( "%u\n", nr_msgs );
}
#endif
}
// Disable pru and close memory mapping
prussdrv_pru_disable(PRU_NUM);
prussdrv_exit();
// Release message queue
mg_release( qid );
return 0;
}
|
#pragma once
#include <stdlib.h>
static inline void destroy(void* ptr)
{
free(ptr);
ptr = NULL;
}
|
//
// SwiftyWalkthrough.h
// SwiftyWalkthrough
//
// Created by Rui Costa on 28/09/2015.
// Copyright © 2015 Rui Costa. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SwiftyWalkthrough.
FOUNDATION_EXPORT double SwiftyWalkthroughVersionNumber;
//! Project version string for SwiftyWalkthrough.
FOUNDATION_EXPORT const unsigned char SwiftyWalkthroughVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SwiftyWalkthrough/PublicHeader.h>
|
float valor_pagamento(float x,float y);
int div_cont(int x);
|
/* paths.c: Path-related compatibility routines
Copyright (c) 1999-2012 Philip Kendall
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Author contact information:
E-mail: philip-fuse@shadowmagic.org.uk
*/
#include <config.h>
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif /* #ifdef HAVE_LIBGEN_H */
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include "compat.h"
#include "fuse.h"
#include "ui/ui.h"
const char*
compat_get_temp_path( void )
{
const char *dir;
/* Something close to this algorithm specified at
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992%28v=vs.85%29.aspx
*/
dir = getenv( "TMP" ); if( dir ) return dir;
dir = getenv( "TEMP" ); if( dir ) return dir;
return ".";
}
const char*
compat_get_home_path( void )
{
const char *dir;
dir = getenv( "USERPROFILE" ); if( dir ) return dir;
dir = getenv( "WINDIR" ); if( dir ) return dir;
return ".";
}
int
compat_is_absolute_path( const char *path )
{
if( path[0] == '\\' ) return 1;
if( path[0] && path[1] == ':' ) return 1;
return 0;
}
int
compat_get_next_path( path_context *ctx )
{
char buffer[ PATH_MAX ];
const char *path_segment, *path2;
switch( ctx->type ) {
case UTILS_AUXILIARY_LIB: path_segment = "lib"; break;
case UTILS_AUXILIARY_ROM: path_segment = "roms"; break;
case UTILS_AUXILIARY_WIDGET: path_segment = "ui/widget"; break;
case UTILS_AUXILIARY_GTK: path_segment = "ui/gtk"; break;
default:
ui_error( UI_ERROR_ERROR, "unknown auxiliary file type %d", ctx->type );
return 0;
}
switch( (ctx->state)++ ) {
/* First look relative to the Fuse executable */
case 0:
if( compat_is_absolute_path( fuse_progname ) ) {
strncpy( buffer, fuse_progname, PATH_MAX );
buffer[ PATH_MAX - 1 ] = '\0';
} else {
DWORD retval;
retval = GetModuleFileName( NULL, buffer, PATH_MAX );
if( !retval ) return 0;
}
path2 = dirname( buffer );
snprintf( ctx->path, PATH_MAX, "%s" FUSE_DIR_SEP_STR "%s", path2,
path_segment );
return 1;
/* Then relative to %APPDATA%/Fuse directory */
case 1:
path2 = getenv( "APPDATA" );
if( !path2 ) return 0;
snprintf( ctx->path, PATH_MAX, "%s" FUSE_DIR_SEP_STR "Fuse"
FUSE_DIR_SEP_STR "%s", path2, path_segment );
return 1;
/* Then relative to the current directory */
case 2:
snprintf( ctx->path, PATH_MAX, "." FUSE_DIR_SEP_STR "%s",
path_segment );
return 1;
case 3: return 0;
}
ui_error( UI_ERROR_ERROR, "unknown path_context state %d", ctx->state );
fuse_abort();
}
|
//
// NSObject+XDCommonLib.h
// XDCommonLib
//
// Created by suxinde on 16/4/11.
// Copyright © 2016年 su xinde. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* @brief 获取App信息工具类
*/
@interface NSObject (AppInfo)
- (NSString *)xd_appVersion;
- (NSString *)xd_appBuildId;
- (NSString *)xd_bundleIdentifier;
- (NSString *)xd_currentLanguage;
- (NSString *)xd_deviceModel;
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSUserDefaults.h"
@interface NSUserDefaults (NSKeyValueCoding)
- (void)setValue:(id)arg1 forKey:(id)arg2;
- (id)valueForKey:(id)arg1;
@end
|
//
// BAGridView_Version.h
// BAGridView
//
// Created by boai on 2017/12/23.
// Copyright © 2017年 boai. All rights reserved.
//
#ifndef BAGridView_Version_h
#define BAGridView_Version_h
/*!
*********************************************************************************
************************************ 更新说明 ************************************
*********************************************************************************
欢迎使用 BAHome 系列开源代码 !
如有更多需求,请前往:https://github.com/BAHome
项目源码地址:
OC 版 :https://github.com/BAHome/BAGridView
最新更新时间:2018-05-31 【倒叙】<br>
最新Version:【Version:1.1.3】<br>
更新内容:<br>
1.1.3.1、优化部分代码,新增 是否可以滑动属性【scrollEnabled】!详见:demo <br>
最新更新时间:2018-05-29 【倒叙】<br>
最新Version:【Version:1.1.1】<br>
更新内容:<br>
1.1.1.1、优化部分代码,新增背景图片设置!详见:demo <br>
最新更新时间:2018-05-28 【倒叙】<br>
最新Version:【Version:1.1.0】<br>
更新内容:<br>
1.1.0.1、全新版本适配【Version:1.1.0】,适配更加简洁!详见:demo <br>
1.1.0.2、原 配置方法 单独抽成 BAGridView_Config 类,所有的配置都可以单独设置!更加简洁明了!如果代码中有使用老版本的,可以更改适配,也可以选择锁定上一版本【1.0.7】 <br>
最新更新时间:2017-12-23 【倒叙】<br>
最新Version:【Version:1.0.7】<br>
更新内容:<br>
1.0.7.1、新增图文样式下文字 title 内容可以显示最多两行!详见:demo 1<br>
1.0.7.2、新增 BAGridView_Version.h 类,版本更新分离更易读!<br>
最新更新时间:2017-07-07 【倒叙】<br>
最新Version:【Version:1.0.6】<br>
更新内容:<br>
1.0.6.1、新增网络图片、placdholderImage功能(感谢群里 [@武汉-马阿飞](http://www.jianshu.com/u/7f8b1720f857) 同学提出的 需求!)<br>
最新更新时间:2017-06-23 【倒叙】<br>
最新Version:【Version:1.0.5】<br>
更新内容:<br>
1.0.5.1、优化部分宏定义<br>
最新更新时间:2017-06-23 【倒叙】<br>
最新Version:【Version:1.0.4】<br>
更新内容:<br>
1.0.4.1、优化部分宏定义<br>
最新更新时间:2017-06-23 【倒叙】<br>
最新Version:【Version:1.0.3】<br>
更新内容:<br>
1.0.3.1、新增 支持 自定义 item 选中改变颜色后自动还原背景颜色(感谢群里 [@武汉-马阿飞](http://www.jianshu.com/u/7f8b1720f857) 同学提出的 需求!)<br>
最新更新时间:2017-06-21 【倒叙】<br>
最新Version:【Version:1.0.2】<br>
更新内容:<br>
1.0.2.1、新增 支持 自定义 item 背景颜色 和 选中背景颜色(感谢群里 [@武汉-马阿飞](http://www.jianshu.com/u/7f8b1720f857) 同学提出的 需求!)<br>
最新更新时间:2017-06-21 【倒叙】<br>
最新Version:【Version:1.0.1】<br>
更新内容:<br>
1.0.1.1、新增 支持 自定义 图片文字间距功能(感谢群里 [@武汉-马阿飞](http://www.jianshu.com/u/7f8b1720f857) 同学提出的 需求!)<br>
1.0.1.2、新增 自定义 所有文字字体(感谢群里 [@武汉-马阿飞](http://www.jianshu.com/u/7f8b1720f857) 同学提出的 需求!)<br>
最新更新时间:2017-06-20 【倒叙】<br>
最新Version:【Version:1.0.0】<br>
更新内容:<br>
1.0.0.1、支付宝首页 九宫格 布局封装<br>
1.0.0.2、自适应按钮位置和数量<br>
1.0.0.3、自定义文字图片 或者 两行文字样式<br>
1.0.0.4、自定义分割线:显示/隐藏<br>
1.0.0.5、自定义分割线:颜色<br>
*/
#endif /* BAGridView_Version_h */
|
//
// XYZToDoListTableViewController.h
// ThingToDo
//
// Created by Kul on 6/16/2557 BE.
// Copyright (c) 2557 Kul. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XYZToDoItem.h"
@interface XYZToDoListTableViewController : UITableViewController
@property NSMutableArray *toDoItems;
- (IBAction)unwindToList:(UIStoryboardSegue *)segue;
@end
|
//
// GNInstallment.h
// GNApiSdk
//
// Created by Thomaz Feitoza on 5/5/15.
// Copyright (c) 2015 Gerencianet. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface GNInstallment : NSObject
@property (strong, nonatomic, readonly) NSNumber *parcels;
@property (strong, nonatomic, readonly) NSNumber *value;
@property (strong, nonatomic, readonly) NSNumber *hasInterest;
@property (strong, nonatomic, readonly) NSString *currency;
- (instancetype) initWithDictionary:(NSDictionary *)dictionary;
@end
|
#include "Types.h"
#include "UsartPutChar.h"
#include "UsartTransmitBufferStatus.h"
#ifdef SIMULATE
#include <stdio.h>
#endif
void Usart_PutChar(char data)
{
while(!Usart_ReadyToTransmit());
#ifdef SIMULATE
printf("%c", data);
#else
AT91C_BASE_US0->US_THR = data;
#endif
}
|
// 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 below 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.
//
// Vulkan Cookbook
// ISBN: 9781786468154
// © Packt Publishing Limited
//
// Author: Pawel Lapinski
// LinkedIn: https://www.linkedin.com/in/pawel-lapinski-84522329
//
// Chapter: 08 Graphics and Compute Pipelines
// Recipe: 03 Specifying pipeline vertex input state
#ifndef SPECIFYING_PIPELINE_VERTEX_INPUT_STATE
#define SPECIFYING_PIPELINE_VERTEX_INPUT_STATE
#include "Common.h"
namespace VulkanCookbook {
void SpecifyPipelineVertexInputState( std::vector<VkVertexInputBindingDescription> const & binding_descriptions,
std::vector<VkVertexInputAttributeDescription> const & attribute_descriptions,
VkPipelineVertexInputStateCreateInfo & vertex_input_state_create_info );
} // namespace VulkanCookbook
#endif // SPECIFYING_PIPELINE_VERTEX_INPUT_STATE
|
/*
* Copyright (c) 2015 Roman Kuznetsov
*
* 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 (including the next
* paragraph) 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
#include "common/common.h"
#include "framework/framework.h"
class Application
{
public:
Application();
bool Initialize(uint32_t screenWidth, uint32_t screenHeight);
void Uninitialize();
void Update(double timeSinceStart, double elapsedTime);
void Render(double timeSinceStart, double elapsedTime, double fps);
void onKeyButton(int key, int scancode, bool pressed);
void onMouseButton(double xpos, double ypos, int button, bool pressed);
void onMouseMove(double xpos, double ypos);
private:
std::unique_ptr<framework::Mesh> loadMeshWithMaterial(const std::string & filename);
void useDefaultRenderTarget();
void clearDefaultRenderTarget(const vector4 & color, float depth);
uint32_t m_screenWidth;
uint32_t m_screenHeight;
framework::FreeCamera m_camera;
std::unique_ptr<framework::TextureManager> m_textureManager;
std::unique_ptr<framework::EmptyVertexBuffer> m_emptyVertexBuffer;
std::unique_ptr<framework::Mesh> m_mesh;
std::unique_ptr<framework::GpuProgram> m_cookTorranceProgram;
std::unique_ptr<framework::GpuProgram> m_skinnedProgram;
std::unique_ptr<framework::GpuProgram> m_skyboxProgram;
std::vector<matrix44> m_bonesTransforms;
};
|
#include<stdio.h>
int main( void )
{
int n[ 10 ];
int i;
for ( i = 0; i < 10; i++ ) {
n[ i ] = 0;
}
printf( "%s%13s\n", "Element", "Value" );
for ( i = 0; i < 10; i++ ) {
printf( "%7d%13d\n", i, n[ i ] );
}
return 0;
}
|
#ifndef STABLO_H
#define STABLO_H
/* modal tree construction for checking formula validity
* supported logics: K, GL
* half-supported: K4
*/
#include "wff.h"
using namespace std;
struct tree
{
// data
tree* mother = 0;
int modal_depth = 0;
vector<wff*> formulas;
vector<tree*> trees;
// metadata
bool modal_mode = true;
enum modal_logic_type {K, K4, GL} modal_logic = GL;
bool closed_branch = false;
int start_solving_from = 0;
bool k4_marked = false;
// input/output
friend ostream& operator<<(ostream& out, const tree &s);
// tree operations
void push(wff *l, wff *d);
void push(wff *f, bool also_flatten = false);
// helpers
void collect_subtrees(vector<wff*> &cres);
void collect_all_formulas(vector<wff* > &result);
void collect_boxed_formulas(vector<wff* > &result, int lev, bool include_parents = true);
tree* modal_level_up();
bool k4_is_subset_of(tree* superset);
bool k4_check_loop();
// logic things
bool check_contradictions(wff *f, int raz);
bool open_window(wff* mf, vector<wff*> &boxed);
void solve_formula(wff *f);
void solve();
// ctor, dctor
tree() {}
tree(tree* mom) {mother = mom; modal_mode = mom->modal_mode;
modal_logic = mom->modal_logic; modal_depth = mom->modal_depth;}
void build_for(wff *f) {formulas.clear(); push(f, true); solve(); }
~tree() {for (auto mf : formulas) delete mf;
for (auto mf : trees) delete mf;}
// debug
bool check_integrity();
};
#endif // STABLO_H
|
//
// SplashHelper.h
// OneDay
//
// Created by Kimimaro on 13-5-10.
// Copyright (c) 2013年 Kimi Yu. All rights reserved.
//
#import <Foundation/Foundation.h>
@class SplashHelper;
typedef void (^LoadFlipSplashFinishedBlock)(SplashHelper *helper);
@interface SplashHelper : NSObject
@property (nonatomic, readonly) BOOL splashFliped;
@property (nonatomic, readonly) BOOL splashFinished;
+ (SplashHelper *)sharedHelper;
- (void)addFlipedBlock:(LoadFlipSplashFinishedBlock)flipedBlock;
- (void)addFinishedBlock:(LoadFlipSplashFinishedBlock)finishedBlock;
- (void)prepareSplashAnimationView;
- (void)splashFlipAnimation;
@end
|
//
// FoldingCell.h
// FoldingCell
//
// Created by Alex K. on 02/06/16.
// Copyright © 2016 Alex K. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for FoldingCell.
FOUNDATION_EXPORT double FoldingCellVersionNumber;
//! Project version string for FoldingCell.
FOUNDATION_EXPORT const unsigned char FoldingCellVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <FoldingCell/PublicHeader.h>
|
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/GlobalDefines.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingObject.h"
#include "IfcRelConnects.h"
class IFCQUERY_EXPORT IfcSystem;
class IFCQUERY_EXPORT IfcSpatialElement;
//ENTITY
class IFCQUERY_EXPORT IfcRelServicesBuildings : public IfcRelConnects
{
public:
IfcRelServicesBuildings() = default;
IfcRelServicesBuildings( int id );
virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options );
virtual void getStepLine( std::stringstream& stream ) const;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
virtual void readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map );
virtual void setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self );
virtual size_t getNumAttributes() { return 6; }
virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
virtual void unlinkFromInverseCounterparts();
virtual const char* className() const { return "IfcRelServicesBuildings"; }
virtual const std::wstring toString() const;
// IfcRoot -----------------------------------------------------------
// attributes:
// shared_ptr<IfcGloballyUniqueId> m_GlobalId;
// shared_ptr<IfcOwnerHistory> m_OwnerHistory; //optional
// shared_ptr<IfcLabel> m_Name; //optional
// shared_ptr<IfcText> m_Description; //optional
// IfcRelationship -----------------------------------------------------------
// IfcRelConnects -----------------------------------------------------------
// IfcRelServicesBuildings -----------------------------------------------------------
// attributes:
shared_ptr<IfcSystem> m_RelatingSystem;
std::vector<shared_ptr<IfcSpatialElement> > m_RelatedBuildings;
};
|
//
// BMCommand.h
// Scorched
//
// Created by Mark Kim on 12/26/12.
// Copyright (c) 2012 Mark Kim. All rights reserved.
//
#import "BMModel.h"
#import "ASIHTTPRequestDelegate.h"
#import "server_constants.h"
@interface BMCommand : BMModel
@property (nonatomic, assign) id<ASIHTTPRequestDelegate> delegate;
@property (nonatomic, assign) BMAPIMessageType messageType;
@property (nonatomic, retain) NSDictionary *parameters;
@property (nonatomic, assign) SEL didFinishSelector;
@property (nonatomic, assign) SEL didFailSelector;
- (void)send;
+ (id)commandWithDelegate:(id<ASIHTTPRequestDelegate>)delegate;
- (id)initWithDelegate:(id<ASIHTTPRequestDelegate>)delegate;
@end
|
//
// Copyright (c) 2008-2019 the Urho3D project.
//
// 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
#include "Sample.h"
namespace Urho3D
{
class Node;
class Scene;
}
/// Animating 3D scene example with script integration.
/// This sample demonstrates:
/// - Initializing the Lua scripting subsystem
/// - Creating a 3D scene and using a script object to animate the objects
class LuaIntegration : public Sample
{
URHO3D_OBJECT(LuaIntegration, Sample);
public:
/// Construct.
explicit LuaIntegration(Context* context);
/// Setup after engine initialization and before running the main loop.
void Start() override;
private:
/// Construct the scene content.
void CreateScene();
/// Construct an instruction text to the UI.
void CreateInstructions();
/// Set up a viewport for displaying the scene.
void SetupViewport();
/// Subscribe to application-wide logic update events.
void SubscribeToEvents();
/// Read input and moves the camera.
void MoveCamera(float timeStep);
/// Handle the logic update event.
void HandleUpdate(StringHash eventType, VariantMap& eventData);
};
|
/**********************************************************************
The following code is derived, directly or indirectly, from the SystemC
source code Copyright (c) 1996-2008 by all Contributors.
All Rights reserved.
The contents of this file are subject to the restrictions and limitations
set forth in the SystemC Open Source License Version 3.0 (the "License");
You may not use this file except in compliance with such restrictions and
limitations. You may obtain instructions on how to receive a copy of the
License at http://www.systemc.org/. Software distributed by Contributors
under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
*********************************************************************/
//=====================================================================
/// @file lt_synch_target.h
//
/// @brief special target to illustrate dmi access to memory
//
//=====================================================================
// Original Authors:
// Jack Donovan, ESLX
// Charles Wilson, ESLX
//=====================================================================
#ifndef __LT_SYNCH_TARGET_H__
#define __LT_SYNCH_TARGET_H__
#include "tlm.h" // TLM headers
#include "memory.h"
#include "tlm_utils/simple_target_socket.h"
class lt_synch_target
: public sc_core::sc_module /// inherit from SC module base clase
//, virtual public tlm::tlm_fw_transport_if<> /// inherit from TLM "forward interface"
{
// Member Methods =====================================================
public:
//=====================================================================
/// @fn lt_synch_target
///
/// @brief Constructor for Single Phase AT target
///
/// @details
/// Generic Single Phase target used in several examples.
/// Constructor offers several parameters for customization
///
//=====================================================================
lt_synch_target
( sc_core::sc_module_name module_name ///< SC module name
, const unsigned int ID ///< target ID
, const char *memory_socket ///< socket name
, sc_dt::uint64 memory_size ///< memory size (bytes)
, unsigned int memory_width ///< memory width (bytes)
, const sc_core::sc_time accept_delay ///< accept delay (SC_TIME, SC_NS)
, const sc_core::sc_time read_response_delay ///< read response delay (SC_TIME, SC_NS)
, const sc_core::sc_time write_response_delay ///< write response delay (SC_TIME, SC_NS)
);
private:
/// b_transport() - Blocking Transport
void // returns nothing
custom_b_transport
( tlm::tlm_generic_payload &payload // ref to payload
, sc_core::sc_time &delay_time // delay time
);
// Member Variables ===================================================
public:
typedef tlm::tlm_generic_payload *gp_ptr; ///< generic payload pointer
tlm_utils::simple_target_socket<lt_synch_target> m_memory_socket; ///< target socket
private:
const unsigned int m_ID; ///< target ID
sc_dt::uint64 m_memory_size; ///< memory size (bytes)
unsigned int m_memory_width; ///< word size (bytes)
const sc_core::sc_time m_accept_delay; ///< accept delay
const sc_core::sc_time m_read_response_delay; ///< read response delay
const sc_core::sc_time m_write_response_delay; ///< write response delays
bool m_trans_dbg_prev_warning;
memory m_target_memory;
};
#endif /* __LT_SYNCH_TARGET_H__ */
|
//
// GDCViewController.h
// GDChannel
//
// Created by Larry Tin on 03/16/2015.
// Copyright (c) 2014 Larry Tin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GDCViewController : UIViewController
@end
|
//-------------------------------------------------------------------------------
//-- Title : AVALANCHE
//-- File : AVALANCHE.h
//-- Project : aes128avalanchev1.1
//-- Author : C4C Development Team
//-- Organization : King Abdulaziz City for Science and Technology (KACST)
//-- Created : 08.01.2014
//-------------------------------------------------------------------------------
//-- Description : Main header for AVALANCHE
//-------------------------------------------------------------------------------
//-- Copyright (C) KACST-C4C
//-- All rights reserved. Reproduction in whole or part is prohibited
//-- without the written permission of the copyright owner.
//-------------------------------------------------------------------------------
/*************** Headers ********************/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <utmpx.h>
#include "api.h"
#include "crypto_aead.h"
#include "openssl/aes.h"
/*************** Sizes ********************/
#define col 4
#define row 4
#define SIZE 16
#define hSIZE 32
#define kSIZE CRYPTO_KEYBYTES-32
#define bytes 16 //128/8
#define sizeOfN 128
#define chunksOfN sizeOfN/8
#define sizeOfCtr 192-sizeOfN
#define chunksOfCtr (sizeOfCtr)/8
#define BYTE_SIZE 8
#define EOT 0x03
#define pad 0x30 //padding with charachter 0
/************ Bit Selection **************/
#define WORD_LEFT_BIT (1<<(BYTE_SIZE-1))
#define WORD_RIGHT_BIT 1
#define WORD_MID_BIT (1<<(BYTE_SIZE/2))
#define WORD_LHALF_ONE ((1<<BYTE_SIZE/2) - 1)
/***** Results of Compare Functions *****/
#define LT -1
#define EQ 0
#define GT 1
/*************** TYPES ********************/
typedef unsigned short NumCarry;
typedef unsigned char Byte; // 8-bit variable
typedef Byte State[row][col]; // 4-bytes x 4 -bytes matrix
typedef Byte Chunk[SIZE]; // 16-bytes
typedef Byte NumProduct[SIZE * 2];
typedef struct AES_Arguments
{
Byte plainText[SIZE];
Byte cipherText[SIZE];
Byte nonce[kSIZE];
} AESArguments;
/************ Function Declaration**************/
//LargeNumbers.c
void CtrAdd(Byte *a, Byte *b, Byte *result, unsigned short *carryFlag);
int NumCompare(Chunk A, Chunk B);
void InterleavedModularMultiplication(Chunk a, Chunk b, Chunk mod,
Byte * result);
void Reduce(Byte *Result, Chunk n, Chunk result, int length);
//IO.c
void ReadFileForEnc(Byte* input, unsigned long long mLen);
void ReadFileForDec(Byte* input, unsigned long long cLen);
void ReadFileForAD(Byte* input, unsigned long long adlen);
void InitializeForEncryption(unsigned long long *mLen);
void InitializeForDecryption(unsigned long long *cLen);
void InitializeForAD(unsigned long long *length);
void FileSettingForEnc(Byte *cipherText, unsigned long long numOfChunks);
void FileSettingForDec(Byte *plainText, unsigned long long mlen);
//PCMAC.c
void SetupForEnc(AESArguments *input, const unsigned char *m, Chunk r,
unsigned long long mLen, unsigned long long numOfChunks);
void SetupForDec(AESArguments *input, const unsigned char *c,
unsigned long long numOfChunks);
void TagGeneration(const unsigned char *m, Chunk r, Chunk tag,
unsigned long long numOfChunks);
void NumGenerator(Chunk x, int random);
void XORKey(Byte* nCtr, Byte* key, Byte* finalKey);
void ConvertCharToHex(char cipherInHex[], char temp[]);
void ModularAddition(Chunk a, Chunk b);
void Increment(Byte* nCtr);
//RMAC.c
void Sign(Chunk prime, Chunk key, const Byte *m, int length, Chunk Tag);
int Verify(Chunk tag, Chunk tagFromCipher);
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <WebCore/DOMHTMLElement.h>
@class DOMStyleSheet, NSString;
@interface DOMHTMLStyleElement : DOMHTMLElement
{
}
@property(readonly) DOMStyleSheet *sheet;
@property(copy) NSString *type;
@property(copy) NSString *media;
@property _Bool disabled;
@end
|
//
// UserAViewController.h
// iChat
//
// Created by yz on 15/9/13.
// Copyright (c) 2015年 DeviceOne. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UserAViewController : UIViewController
@end
|
/**
* \file
*
* \brief Board configuration.
*
* 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 CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#define CONF_BOARD_UART_CONSOLE
#define CONF_BOARD_CAN0
#define CONF_BOARD_CAN1
#endif /* CONF_BOARD_H_INCLUDED */
|
//
// AutoHideKeyboardControllers.h
// TestAutoHideKeyboardViewController
//
// Created by Zhang Zonghui on 9/7/13.
// Copyright (c) 2013 PhoneSoul. All rights reserved.
//
#ifndef TestAutoHideKeyboardViewController_AutoHideKeyboardControllers_h
#define TestAutoHideKeyboardViewController_AutoHideKeyboardControllers_h
#import "AutoHideKeyboardViewController.h"
#import "AutoHideKeyboardTableViewController.h"
#endif
|
/*
Copyright (C) 2011 by Ivan Safrin
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 <Cocoa/Cocoa.h>
#include "PolyGLHeaders.h"
#include "PolyString.h"
#include "Polycode.h"
#include "PolyCocoaCore.h"
using namespace Polycode;
@interface PolycodeView : NSOpenGLView {
PolyKEY keymap[512];
char mouseMap[128];
char modifierMap[512];
CocoaCore *core;
NSLock *contextLock;
NSCursor *currentCursor;
bool contextReady;
int mouseX;
int mouseY;
int glSizeX;
int glSizeY;
BOOL viewReady;
}
@property BOOL viewReady;
@property int mouseX;
@property int mouseY;
- (void) setCurrentCursor: (NSCursor*) newCursor;
- (id)initWithFrame:(NSRect)frameRect pixelFormat:(NSOpenGLPixelFormat *)format;
- (void) lockContext;
- (void) unlockContext;
- (BOOL) isContextReady;
- (void) setCore: (CocoaCore*) newCore;
- (void) initKeymap;
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class IBDocument;
@protocol IBDocumentArbitrationResponder <NSObject>
- (void)document:(IBDocument *)arg1 willRunArbitrationOfUnits:(id <IBCollection>)arg2;
@end
|
// Copyright (c) 2015-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_HTTPSERVER_H
#define BITCOIN_HTTPSERVER_H
#include <string>
#include <functional>
#include <mutex>
#include <condition_variable>
static const int DEFAULT_HTTP_THREADS=4;
static const int DEFAULT_HTTP_WORKQUEUE=16;
static const int DEFAULT_HTTP_SERVER_TIMEOUT=30;
struct evhttp_request;
struct event_base;
class CService;
class HTTPRequest;
/** Initialize HTTP server.
* Call this before RegisterHTTPHandler or EventBase().
*/
bool InitHTTPServer();
/** Start HTTP server.
* This is separate from InitHTTPServer to give users race-condition-free time
* to register their handlers between InitHTTPServer and StartHTTPServer.
*/
void StartHTTPServer();
/** Interrupt HTTP server threads */
void InterruptHTTPServer();
/** Stop HTTP server */
void StopHTTPServer();
/** Change logging level for libevent. Removes BCLog::LIBEVENT from log categories if
* libevent doesn't support debug logging.*/
bool UpdateHTTPServerLogging(bool enable);
/** Handler for requests to a certain HTTP path */
typedef std::function<bool(HTTPRequest* req, const std::string &)> HTTPRequestHandler;
/** Register handler for prefix.
* If multiple handlers match a prefix, the first-registered one will
* be invoked.
*/
void RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler);
/** Unregister handler for prefix */
void UnregisterHTTPHandler(const std::string &prefix, bool exactMatch);
/** Return evhttp event base. This can be used by submodules to
* queue timers or custom events.
*/
struct event_base* EventBase();
/** In-flight HTTP request.
* Thin C++ wrapper around evhttp_request.
*/
class HTTPRequest
{
private:
struct evhttp_request* req;
bool replySent;
bool startedChunkTransfer;
bool connClosed;
std::mutex cs;
std::condition_variable closeCv;
void startDetectClientClose();
void waitClientClose();
public:
explicit HTTPRequest(struct evhttp_request* req, bool replySent = false);
~HTTPRequest();
enum RequestMethod {
UNKNOWN,
GET,
POST,
HEAD,
PUT
};
void setConnClosed();
bool isConnClosed();
bool isChunkMode();
/** Get requested URI.
*/
std::string GetURI() const;
/** Get CService (address:ip) for the origin of the http request.
*/
CService GetPeer() const;
/** Get request method.
*/
RequestMethod GetRequestMethod() const;
/**
* Get the request header specified by hdr, or an empty string.
* Return a pair (isPresent,string).
*/
std::pair<bool, std::string> GetHeader(const std::string& hdr) const;
/**
* Read request body.
*
* @note As this consumes the underlying buffer, call this only once.
* Repeated calls will return an empty string.
*/
std::string ReadBody();
/**
* Write output header.
*
* @note call this before calling WriteErrorReply or Reply.
*/
void WriteHeader(const std::string& hdr, const std::string& value);
/**
* Write HTTP reply.
* nStatus is the HTTP status code to send.
* strReply is the body of the reply. Keep it empty to send a standard message.
*
* @note Can be called only once. As this will give the request back to the
* main thread, do not call any other HTTPRequest methods after calling this.
*/
void WriteReply(int nStatus, const std::string& strReply = "");
/**
* Start chunk transfer. Assume to be 200.
*/
void Chunk(const std::string& chunk);
/**
* End chunk transfer.
*/
void ChunkEnd();
/**
* Is reply sent?
*/
bool ReplySent();
};
/** Event handler closure.
*/
class HTTPClosure
{
public:
virtual void operator()() = 0;
virtual ~HTTPClosure() {}
};
/** Event class. This can be used either as a cross-thread trigger or as a timer.
*/
class HTTPEvent
{
public:
/** Create a new event.
* deleteWhenTriggered deletes this event object after the event is triggered (and the handler called)
* handler is the handler to call when the event is triggered.
*/
HTTPEvent(struct event_base* base, bool deleteWhenTriggered, struct evbuffer *_databuf, const std::function<void()>& handler);
~HTTPEvent();
/** Trigger the event. If tv is 0, trigger it immediately. Otherwise trigger it after
* the given time has elapsed.
*/
void trigger(struct timeval* tv);
bool deleteWhenTriggered;
std::function<void()> handler;
private:
struct evbuffer *databuf;
struct event* ev;
};
#endif // BITCOIN_HTTPSERVER_H
|
/**
* @class dash::mpd::ISegmentURL
* @brief This interface is needed for accessing the attributes and elements of the <tt><b>SegmentURL</b></tt> element
* as specified in <em>ISO/IEC 23009-1, Part 1, 2012</em>, section 5.3.9.3.2, table 14
* @details Each Segment URL may contain the Media Segment URL and possibly a byte range. The Segment URL element may also contain an Index Segment.
* @see dash::mpd::ISegment dash::mpd::IMPDElement
*
* @author bitmovin Softwareentwicklung OG \n
* Email: libdash-dev@vicky.bitmovin.net
* @version 2.1
* @date 2013
* @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n
* This source code and its use and distribution, is subject to the terms
* and conditions of the applicable license agreement.
*/
#ifndef ISEGMENTURL_H_
#define ISEGMENTURL_H_
#include "config.h"
#include "ISegment.h"
#include "IBaseUrl.h"
#include "IMPDElement.h"
namespace dash
{
namespace mpd
{
class ISegmentURL : public virtual IMPDElement
{
public:
virtual ~ISegmentURL(){}
/**
* Returns a reference to a string that in combination with the \c \@mediaRange attribute specifies the HTTP-URL for the Media Segment.\n
* It shall be formated as an \c <absolute-URI> according to RFC 3986, Clause 4.3, with a fixed scheme of \"http\" or \"https\" or
* as a \c <relative-ref> according to RFC 3986, Clause 4.2.\n
* If not present, then any <tt><b>BaseURL</b></tt> element is mapped to the \c \@media attribute and the range attribute shall be present.
* @return a reference to a string
*/
virtual const std::string& GetMediaURI () const = 0;
/**
* Returns a reference to a string that specifies the byte range within the resource identified by the \c \@media corresponding to the Media Segment.
* The byte range shall be expressed and formatted as a \c byte-range-spec as defined in RFC 2616, Clause 14.35.1.
* It is restricted to a single expression identifying a contiguous range of bytes.\n
* If not present, the Media Segment is the entire resource referenced by the \c \@media attribute.
* @return a reference to a string
*/
virtual const std::string& GetMediaRange () const = 0;
/**
* Returns a reference to a string that in combination with the \c \@indexRange attribute specifies the HTTP-URL for the Index Segment.
* It shall be formated as an \c <absolute-URI> according to RFC 3986, Clause 4.3, with a fixed scheme of \"http\" or \"https\" or
* as a \c <relative-ref> according to RFC 3986, Clause 4.2. \n
* If not present and the \c \@indexRange not present either, then no Index Segment information is provided for this Media Segment.\n
* If not present and the \c \@indexRange present, then the \c \@media attribute is mapped to the \c \@index. If the \c \@media attribute is not present either,
* then any <tt><b>BaseURL</b></tt> element is mapped to the \c \@index attribute and the \c \@indexRange attribute shall be present.
* @return a reference to a string
*/
virtual const std::string& GetIndexURI () const = 0;
/**
* Returns a reference to a string that specifies the byte range within the resource identified by the \c \@index corresponding to the Index Segment.
* If \c \@index is not present, it specifies the byte range of the Segment Index in Media Segment.\n
* The byte range shall be expressed and formatted as a \c byte-range-spec as defined in RFC 2616, Clause 14.35.1. It is restricted to a single
* expression identifying a contiguous range of bytes. \n
* If not present, the Index Segment is the entire resource referenced by the \c \@index attribute.
* @return a reference to a string
*/
virtual const std::string& GetIndexRange () const = 0;
/**
* Returns a pointer to a dash::mpd::ISegment object which represents a media segment that can be downloaded.
* @param baseurls a vector of pointers to dash::mpd::IBaseUrl objects that represent the path to the media segment
* @return a pointer to a dash::mpd::ISegment object
*/
virtual ISegment* ToMediaSegment (const std::vector<IBaseUrl *>& baseurls) const = 0;
/**
* Returns a pointer to a dash::mpd::ISegment object that represents an index segment and can be downloaded.
* @param baseurls a vector of pointers to dash::mpd::IBaseUrl objects that represent the path to the index segment
* @return a pointer to a dash::mpd::ISegment object
*/
virtual ISegment* ToIndexSegment (const std::vector<IBaseUrl *>& baseurls) const = 0;
};
}
}
#endif /* ISEGMENTURL_H_ */
|
//
// GlobalManager.h
// iNvity
//
// Created by Sharon Brizinov on 3/9/14.
// Copyright (c) 2014 Sharon Brizinov. All rights reserved.
//
#import "Globals.h"
@class Conversation;
@interface GlobalManager : NSObject
{
Conversation * conversation;
NSString * strUserName;
}
@property (nonatomic, retain) Conversation * conversation;
@property (nonatomic, retain) NSString * strUserName;
// Shared instance
+ (id)sharedManager;
// Random int
+(int)getRandomNumberBetween:(int)from to:(int)to;
// Checks if the group name is already exists (Addition of "-[\d]+" at the end of group's name)
// Returns nil if didn't find anything
+(NSString*) getOriginalGroupNameFromPossibleDuplicatedGroupName:(NSString*)strGroupNameNew;
// Search and returns how many times 'substring' is found in 'string'
+(NSUInteger) howManyTimesSubtringInString:(NSString*)strString withSubString:(NSString*)strSubString shouldInStringToBeIsolated:(BOOL)isWordIsolated shouldTrimWhitespacesFromBaseString:(BOOL)isTrimWhitespaces;
+(NSString*) stringHelperPrepareSubStringForRegex:(NSString*)strInString shouldInStringToBeIsolated:(BOOL)isWordIsolated;
// Removes conversation's file on disk
+(BOOL)removeConversationFromStorageWithConversation:(Conversation*)conv;
+(BOOL)removeFileFromStorageWithURL:(NSURL*) url;
// Ask the user if he wants to delete conversation, and delete from all resources if so (SQL DB, File on disk, notify everyone)
+(void) askTheUserForDeletingConversation:(Conversation*) convToDelete withReason:(NSInteger) conversationDeleteType;
@end
|
//
// UISwitch+DLSDescribable.h
// Dials
//
// Created by Akiva Leffert on 5/25/15.
// Copyright (c) 2015 Akiva Leffert. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DLSDescribable.h"
@interface UISwitch (DLSDescribable) <DLSDescribable>
@end
|
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_PROCESSING_BEAMFORMER_MATRIX_TEST_HELPERS_H_
#define MODULES_AUDIO_PROCESSING_BEAMFORMER_MATRIX_TEST_HELPERS_H_
#include BOSS_WEBRTC_U_modules__audio_processing__beamformer__complex_matrix_h //original-code:"modules/audio_processing/beamformer/complex_matrix.h"
#include BOSS_WEBRTC_U_modules__audio_processing__beamformer__matrix_h //original-code:"modules/audio_processing/beamformer/matrix.h"
#include BOSS_WEBRTC_U_test__gtest_h //original-code:"test/gtest.h"
namespace {
const float kTolerance = 0.001f;
}
namespace webrtc {
using std::complex;
// Functions used in both matrix_unittest and complex_matrix_unittest.
class MatrixTestHelpers {
public:
template <typename T>
static void ValidateMatrixEquality(const Matrix<T>& expected,
const Matrix<T>& actual) {
EXPECT_EQ(expected.num_rows(), actual.num_rows());
EXPECT_EQ(expected.num_columns(), actual.num_columns());
const T* const* expected_elements = expected.elements();
const T* const* actual_elements = actual.elements();
for (size_t i = 0; i < expected.num_rows(); ++i) {
for (size_t j = 0; j < expected.num_columns(); ++j) {
EXPECT_EQ(expected_elements[i][j], actual_elements[i][j]);
}
}
}
static void ValidateMatrixEqualityFloat(const Matrix<float>& expected,
const Matrix<float>& actual) {
EXPECT_EQ(expected.num_rows(), actual.num_rows());
EXPECT_EQ(expected.num_columns(), actual.num_columns());
const float* const* expected_elements = expected.elements();
const float* const* actual_elements = actual.elements();
for (size_t i = 0; i < expected.num_rows(); ++i) {
for (size_t j = 0; j < expected.num_columns(); ++j) {
EXPECT_NEAR(expected_elements[i][j], actual_elements[i][j], kTolerance);
}
}
}
static void ValidateMatrixEqualityComplexFloat(
const Matrix<complex<float> >& expected,
const Matrix<complex<float> >& actual) {
EXPECT_EQ(expected.num_rows(), actual.num_rows());
EXPECT_EQ(expected.num_columns(), actual.num_columns());
const complex<float>* const* expected_elements = expected.elements();
const complex<float>* const* actual_elements = actual.elements();
for (size_t i = 0; i < expected.num_rows(); ++i) {
for (size_t j = 0; j < expected.num_columns(); ++j) {
EXPECT_NEAR(expected_elements[i][j].real(),
actual_elements[i][j].real(),
kTolerance);
EXPECT_NEAR(expected_elements[i][j].imag(),
actual_elements[i][j].imag(),
kTolerance);
}
}
}
static void ValidateMatrixNearEqualityComplexFloat(
const Matrix<complex<float> >& expected,
const Matrix<complex<float> >& actual,
float tolerance) {
EXPECT_EQ(expected.num_rows(), actual.num_rows());
EXPECT_EQ(expected.num_columns(), actual.num_columns());
const complex<float>* const* expected_elements = expected.elements();
const complex<float>* const* actual_elements = actual.elements();
for (size_t i = 0; i < expected.num_rows(); ++i) {
for (size_t j = 0; j < expected.num_columns(); ++j) {
EXPECT_NEAR(expected_elements[i][j].real(),
actual_elements[i][j].real(),
tolerance);
EXPECT_NEAR(expected_elements[i][j].imag(),
actual_elements[i][j].imag(),
tolerance);
}
}
}
};
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_BEAMFORMER_MATRIX_TEST_HELPERS_H_
|
//
// TypeDefsEnums.h
// Instasite
//
// Created by mike davis on 10/21/15.
// Copyright © 2015 Instasite. All rights reserved.
//
enum GitHubRepoTest {
GitHubRepoExists, GitHubRepoDoesNotExist, GitHubResponsePending, GitHubRepoError
};
typedef enum GitHubRepoTest GitHubRepoTest;
enum GitHubPagesStatus {
GitHubPagesNone, GitHubPagesInProgress, GitHubPagesBuilt, GitHubPagesError
};
typedef enum GitHubPagesStatus GitHubPagesStatus;
enum TemplateFieldType {
FieldTXF, FieldTXV, FieldIMG
};
typedef enum TemplateFieldType TemplateFieldType;
enum FileType {
FileTypeHtml = 1 << 0,
FileTypeJson = 1 << 1,
FileTypeJpeg = 1 << 2,
FileTypeTemplate = 1 << 3,
FileTypeOther = 1 << 4
};
typedef enum FileType FileType;
enum ErrorCode {
ErrorCodeNone = 0,
ErrorCodeNotAuthorized = 101,
ErrorCodeEntityNotFound = 102,
ErrorCodeOperationIncomplete = 103,
ErrorCodeWritingUserData = 201,
ErrorCodeReadingUserData = 202,
ErrorCodeWritingProjectData = 211,
ErrorCodeReadingProjectData = 212,
ErrorCodeUnknownError = 999
};
typedef enum ErrorCode ErrorCode;
typedef NSArray FileInfoArray;
typedef NSMutableArray FileInfoMutableArray;
typedef NSDictionary HtmlTemplateDictionary;
typedef NSMutableDictionary HtmlTemplateMutableDictionary;
typedef NSArray FileJsonRequestArray;
typedef NSMutableArray FileJsonRequestMutableArray;
typedef NSArray FileJsonResponseArray;
typedef NSMutableArray FileJsonResponseMutableArray;
typedef NSArray RepoJsonResponseArray;
typedef NSMutableArray RepoJsonResponseMutableArray;
typedef NSDictionary InputFieldDictionary;
typedef NSMutableDictionary InputFieldMutableDictionary;
typedef NSDictionary InputCategoryDictionary;
typedef NSMutableDictionary InputCategoryMutableDictionary;
typedef NSDictionary InputGroupDictionary;
typedef NSMutableDictionary InputGroupMutableDictionary;
typedef NSDictionary ImagesDictionary;
typedef NSMutableDictionary ImagesMutableDictionary;
|
/* $OpenBSD: s_fmin.c,v 1.4 2008/12/10 01:08:24 martynas Exp $ */
/*-
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <float.h>
#include <math.h>
double
fmin(double x, double y)
{
/* Check for NaNs to avoid raising spurious exceptions. */
if (isnan(x))
return (y);
if (isnan(y))
return (x);
/* Handle comparisons of signed zeroes. */
if (signbit(x) != signbit(y))
if (signbit(y))
return (y);
else
return (x);
return (x < y ? x : y);
}
#if LDBL_MANT_DIG == 53
#ifdef __weak_alias
__weak_alias(fminl, fmin);
#endif /* __weak_alias */
#endif /* LDBL_MANT_DIG == 53 */
|
/*
+------------------------------------------------------------------------+
| Zephir Language |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2015 Zephir Team (http://www.zephir-lang.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to license@zephir-lang.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <andres@zephir-lang.com> |
| Eduar Carvajal <eduar@zephir-lang.com> |
| Vladimir Kolesnikov <vladimir@extrememember.com> |
+------------------------------------------------------------------------+
*/
#ifndef ZEPHIR_KERNEL_HASH_H
#define ZEPHIR_KERNEL_HASH_H
#include <php.h>
#include <Zend/zend.h>
int zephir_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent);
int zephir_hash_exists(const HashTable *ht, const char *arKey, uint nKeyLength);
int zephir_hash_quick_exists(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h);
int zephir_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData);
int zephir_hash_quick_find(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void **pData);
void zephir_get_current_key(zval **key, const HashTable *hash_table, HashPosition *hash_position TSRMLS_DC);
zval zephir_get_current_key_w(const HashTable *hash_table, HashPosition *hash_position);
int zephir_has_numeric_keys(const zval *data);
void zephir_hash_update_or_insert(HashTable *ht, zval *offset, zval *value);
zval** zephir_hash_get(HashTable *ht, zval *key, int type);
int zephir_hash_unset(HashTable *ht, zval *offset);
#define zephir_hash_move_forward_ex(ht, pos) *pos = (*pos ? (*pos)->pListNext : NULL)
static zend_always_inline int zephir_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos)
{
Bucket *p;
p = pos ? (*pos) : ht->pInternalPointer;
if (p) {
*pData = p->pData;
return SUCCESS;
} else {
return FAILURE;
}
}
static zend_always_inline int zephir_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
{
HashPosition *current = pos ? pos : &ht->pInternalPointer;
if (*current) {
*current = (*current)->pListLast;
return SUCCESS;
} else {
return FAILURE;
}
}
#endif
|
//
// ObjCAssembler.h
// MISGenerator
//
// Created by Todd Ditchendorf on 12/6/14.
// Copyright (c) 2014 Todd Ditchendorf. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ObjCAssembler : NSObject
@property (nonatomic, retain) NSMutableArray *classes;
@end
|
/**
* pavelkolodin@gmail.com
*
*/
#ifndef _FIR_STRING_MD5_H_
#define _FIR_STRING_MD5_H_
#include <cstddef>
namespace fir {
namespace str {
/// @brief Calculate MD5 value of the string _in.
/// _out - pre-allocated 16-bytes array.
void md5string(const char* _in, char *_out);
void md5buff(const char* _in, char *_out, size_t _size_in);
class MD5sum
{
public:
bool operator<(const MD5sum &_other) const
{
for (int i = 0; i < 16; ++i)
{
if (m_value[i] == _other.m_value[i])
continue;
if (m_value[i] < _other.m_value[i])
return true;
else
return false;
}
return false;
}
bool operator==(const MD5sum &_other) const
{
for (int i = 0; i < 16; ++i)
{
if (m_value[i] != _other.m_value[i])
return false;
}
return true;
}
unsigned char m_value[16];
};
}
}
#endif
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/tball/tmp/j2objc/jsr305/build_result/java/javax/annotation/WillCloseWhenClosed.java
//
#include "../../J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_JavaxAnnotationWillCloseWhenClosed")
#ifdef RESTRICT_JavaxAnnotationWillCloseWhenClosed
#define INCLUDE_ALL_JavaxAnnotationWillCloseWhenClosed 0
#else
#define INCLUDE_ALL_JavaxAnnotationWillCloseWhenClosed 1
#endif
#undef RESTRICT_JavaxAnnotationWillCloseWhenClosed
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if !defined (JavaxAnnotationWillCloseWhenClosed_) && (INCLUDE_ALL_JavaxAnnotationWillCloseWhenClosed || defined(INCLUDE_JavaxAnnotationWillCloseWhenClosed))
#define JavaxAnnotationWillCloseWhenClosed_
#define RESTRICT_JavaLangAnnotationAnnotation 1
#define INCLUDE_JavaLangAnnotationAnnotation 1
#include "../../java/lang/annotation/Annotation.h"
@class IOSClass;
@class IOSObjectArray;
@protocol JavaxAnnotationWillCloseWhenClosed < JavaLangAnnotationAnnotation >
@end
@interface JavaxAnnotationWillCloseWhenClosed : NSObject < JavaxAnnotationWillCloseWhenClosed >
@end
J2OBJC_EMPTY_STATIC_INIT(JavaxAnnotationWillCloseWhenClosed)
FOUNDATION_EXPORT id<JavaxAnnotationWillCloseWhenClosed> create_JavaxAnnotationWillCloseWhenClosed();
J2OBJC_TYPE_LITERAL_HEADER(JavaxAnnotationWillCloseWhenClosed)
#endif
#pragma clang diagnostic pop
#pragma pop_macro("INCLUDE_ALL_JavaxAnnotationWillCloseWhenClosed")
|
// Copyright 2007-2010 Baptiste Lepilleur
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
#include <stdlib.h>
#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
#if JSON_USE_EXCEPTION
#include <stdexcept>
#define JSON_ASSERT(condition) \
assert(condition); // @todo <= change this into an exception throw
#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message);
#else // JSON_USE_EXCEPTION
#define JSON_ASSERT(condition) assert(condition);
// The call to assert() will show the failure message in debug builds. In
// release bugs we write to invalid memory in order to crash hard, so that a
// debugger or crash reporter gets the chance to take over. We still call exit()
// afterward in order to tell the compiler that this macro doesn't return.
#define JSON_FAIL_MESSAGE(message) \
{ \
assert(false&& message); \
strcpy(reinterpret_cast<char*>(666), message); \
exit(123); \
}
#endif
#define JSON_ASSERT_MESSAGE(condition, message) \
if (!(condition)) { \
JSON_FAIL_MESSAGE(message) \
}
#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
|
//
// PayPalPaymentViewController.h
//
// Version 2.8.5-bt1
//
// Copyright (c) 2014, PayPal
// All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PayPalConfiguration.h"
#import "PayPalPayment.h"
// Important note:
//
// This is a proof of payment system. You MUST verify all transactions
// via a call from your servers (not your app) to PayPal's servers, to
// ensure that the transaction was genuine and successful.
// See https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/
// for details.
#pragma mark - Delegates and notifications
@class PayPalPaymentViewController;
typedef void (^PayPalPaymentDelegateCompletionBlock)(void);
/// 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 PayPalPaymentDelegate <NSObject>
@required
/// User canceled the payment process.
/// Your code MUST dismiss the PayPalPaymentViewController.
/// @param paymentViewController The PayPalPaymentViewController that the user canceled without making a payment.
- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController;
/// User successfully completed the payment.
/// The PayPalPaymentViewController's activity indicator has been dismissed.
/// Your code MAY deal with the completedPayment, if it did not already do so within your optional
/// payPalPaymentViewController:willCompletePayment:completionBlock: method.
/// Your code MUST dismiss the PayPalPaymentViewController.
/// See https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/ for
/// information about payment verification.
/// @param paymentViewController The PayPalPaymentViewController where the user successfullly made a payment.
/// @param completedPayment completedPayment.confirmation contains information your server will need to verify the payment.
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController
didCompletePayment:(PayPalPayment *)completedPayment;
@optional
/// User successfully completed the payment.
/// The PayPalPaymentViewController's activity indicator is still visible.
/// Your code MAY deal with the completedPayment; e.g., send it to your server and await confirmation.
/// Your code MUST finish by calling the completionBlock.
/// Your code must NOT dismiss the PayPalPaymentViewController.
/// See https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/ for
/// information about payment verification.
/// @param paymentViewController The PayPalPaymentViewController where the user successfullly made a payment.
/// @param completedPayment completedPayment.confirmation contains information your server will need to verify the payment.
/// @param completionBlock Block to execute when your processing is done.
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController
willCompletePayment:(PayPalPayment *)completedPayment
completionBlock:(PayPalPaymentDelegateCompletionBlock)completionBlock;
@end
#pragma mark - PayPalPaymentViewController
@interface PayPalPaymentViewController : UINavigationController
/// The designated initalizer. A new view controller MUST be initialized for each use.
/// @param payment The payment to be processed.
/// @param configuration The configuration to be used for the lifetime of the controller
/// (e.g., default email address or hideCreditCard); can be nil.
/// @param delegate The delegate you want to receive updates about the payment.
- (instancetype)initWithPayment:(PayPalPayment *)payment
configuration:(PayPalConfiguration *)configuration
delegate:(id<PayPalPaymentDelegate>)delegate;
/// Delegate access
@property(nonatomic, weak, readonly) id<PayPalPaymentDelegate> paymentDelegate;
/// PayPalPaymentViewControllerState See the state property for context.
typedef NS_ENUM(NSInteger, PayPalPaymentViewControllerState) {
/// The payment has not been sent. You MAY safely dismiss the PayPalPaymentViewController.
PayPalPaymentViewControllerStateUnsent = 0,
/// The payment is in progress. You MUST NOT dismiss the PayPalPaymentViewController.
PayPalPaymentViewControllerStateInProgress = 1,
};
/// Although irrelevant to most apps, if your app needs to know where the user is within
/// the payment flow, you can check this property.
/// (You can use key-value observing to watch for changes.)
///
/// For example, perhaps your app would like to dismiss the PayPalPaymentViewController
/// if the user is taking so long to complete the payment flow that the item they
/// ordered has gone out of stock.
///
/// - The state is initially set to PayPalPaymentViewControllerStateUnsent.
/// - When the user taps the final payment confirmation button, the state changes to
/// PayPalPaymentViewControllerStateInProgress.
/// - If the payment goes through successfully, the state remains at
/// PayPalPaymentViewControllerStateInProgress, and your app's
/// payPalPaymentViewController:didCompletePayment: method is called.
/// - If the payment fails, the state changes back to PayPalPaymentViewControllerStateUnsent.
/// (Also, an appropriate error message is displayed to the user).
@property(nonatomic, assign, readonly) PayPalPaymentViewControllerState state;
@end
|
typedef struct {
} sp_div;
int sp_div_create(sp_div **p);
int sp_div_destroy(sp_div **p);
int sp_div_init(sp_data *sp, sp_div *p);
int sp_div_compute(sp_data *sp, sp_div *p, SPFLOAT *in1, SPFLOAT *in2, SPFLOAT *out);
|
//
// BasicOpenGLController.h
// SpaceExampleOpenGL
//
// Created by Tim Jarratt on 6/17/13.
//
//
#import <OpenGL/OpenGL.h>
#import <Foundation/Foundation.h>
#import "GLGOpenGLView.h"
#import "GLGGalaxySidebar.h"
#import "GLGPlanetSidebar.h"
#import "GLGEasedPoint.h"
#import "GLGEasedValue.h"
#import "GLGNameProperty.h"
#import "GLGRangeProperty.h"
#import "GLGSolarSystem.h"
#import "GLGActor.h"
#import "GLGPlanetActor.h"
#import "GLGGalaxyPickerActor.h"
#import "GLGMainMenuActor.h"
@class GLGSidebarView;
@interface GLGOpenGLController : NSViewController <GLGOpenGLViewDelegate, NSWindowDelegate> {
NSWindow *window;
GLGOpenGLView *scene;
id <GLGActor> gameSceneActor;
}
- (id) initWithWindow: (NSWindow *) window;
- (void) update;
- (void) prepareOpenGL;
- (void) GLGOpenGLView:(GLGOpenGLView *)view drawInRect:(NSRect)rect;
- (void) GLGOpenGLViewDidReshape:(GLGOpenGLView *)view;
- (void) keyWasPressed:(NSEvent *)event;
- (GLGOpenGLView *) openGLView;
# pragma mark - actor delegate methods
- (void) didZoom:(CGFloat) amount;
- (void) didPanByVector:(CGPoint) vector;
- (void) handleMouseUp;
- (void) handleMouseDown:(NSPoint) point;
@end
|
#pragma once
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
class IndexMatrix {
public:
IndexMatrix(int length);
~IndexMatrix(void);
const int &operator() (int i, int j) const;
int &operator() (int i, int j);
void print();
private:
IndexMatrix(void);
boost::numeric::ublas::matrix<int> m;
};
|
//========= Copyright Bernt Andreas Eide, All rights reserved. ============//
//
// Purpose: Torch
//
//=============================================================================//
#ifndef WEAPON_TORCH_H
#define WEAPON_TORCH_H
#include "basebludgeonweapon.h"
#if defined( _WIN32 )
#pragma once
#endif
class CWeaponTorch : public CBaseHLBludgeonWeapon
{
public:
DECLARE_CLASS(CWeaponTorch, CBaseHLBludgeonWeapon);
DECLARE_SERVERCLASS();
DECLARE_ACTTABLE();
DECLARE_DATADESC();
CWeaponTorch();
float GetRange(void) { return tfo_push_range.GetFloat(); }
float GetFireRate(void) { return 0.5f; }
bool HasIronsights() { return false; }
int GetWeaponDamageType(void) { return DMG_BURN; }
void AddViewKick(void);
float GetDamageForActivity(Activity hitActivity);
virtual int WeaponMeleeAttack1Condition(float flDot, float flDist);
virtual void Operator_HandleAnimEvent(animevent_t *pEvent, CBaseCombatCharacter *pOperator);
void ItemPostFrame(void);
private:
void HandleAnimEventMeleeHit(animevent_t *pEvent, CBaseCombatCharacter *pOperator);
float m_flTorchLifeTime;
bool m_bWasActive;
};
#endif // WEAPON_TORCH_H
|
#pragma strict_types
#include "../def.h"
inherit STD_ARMOUR;
void create_object(void)
{
set_short("A leather armour");
set_long("A pretty normal looking leather armour.\n");
set_name("armour");
add_id("leather armour");
set_value(30);
set_weight(2);
set_material("leather");
set_new_ac(6);
set_type("armour");
set_property("poor");
}
|
#include <stdio.h>
#include <stdlib.h>
/*
4 - Desarrollar un programa que cree dinámicamente un arreglo de números reales que contenga
N elementos (N es ingresado por teclado). Ingresar sus elementos y mostrar aquellos que sean
positivos utilizando aritmética de punteros. Al finalizar, liberar la memoria solicitada en tiempo
de ejecución.
*/
int main()
{
int n, i;
int *arr;
printf("Introduzca numero de elementos: ");
scanf("%d", &n);
arr = (int*) malloc(sizeof(int) * n);
for (i = 0; i < n; i++) {
printf("introduzca el elemento con indice %d: ", i);
scanf("%d", &(arr[i]));
}
printf("\n");
printf("Elementos positivos: ");
for (i = 0; i < n; i++) {
if (*(arr + i) > 0) {
if (i != 0)
printf(", ");
printf("%d", *(arr + i));
}
}
free(arr);
return 0;
}
|
/*
The MIT License (MIT)
Copyright (c) 2013 Newton Kim
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 __DRW_TOKEN_OBJ_H__
#define __DRW_TOKEN_OBJ_H__
#include "log.h"
enum drwToken {
DRW_TOKEN_NONE = 0,
DRW_TOKEN_SYMBOL,
DRW_TOKEN_FLOAT,
DRW_TOKEN_INTEGER,
DRW_TOKEN_STRING,
DRW_TOKEN_CODE,
DRW_TOKEN_BOOL,
DRW_TOKEN_SEPARATOR,
DRW_TOKEN_BEGINNING_OF_DICTIONARY,
DRW_TOKEN_END_OF_DICTIONARY,
DRW_TOKEN_BEGINNING_OF_LIST,
DRW_TOKEN_END_OF_LIST,
DRW_TOKEN_BEGINNING_OF_ARGUMENTS,
DRW_TOKEN_END_OF_ARGUMENTS,
DRW_TOKEN_END_OF_FILE,
DRW_TOKEN_MAX
};
class drwTokenValue {
friend class drwScanner;
private:
drwToken m_token;
drwLog& m_log;
string m_string;
double m_float;
int m_int;
bool m_bool;
const char* to_string(void);
public:
drwTokenValue();
drwTokenValue(drwTokenValue& v);
void operator = (drwTokenValue token);
operator const char* (void);
operator drwToken(void);
string& symbol(void);
string& text(void);
string& code(void);
double floating_number(void);
int integer_number(void);
bool boolean(void);
};
#endif //__DRW_TOKEN_OBJ_H__
|
#import <YapDatabase/YapDatabase.h>
#import <YapDataBase/YapDatabaseView.h>
@interface YapDatabase (WMFExtensions)
/**
* Returns the shared DB for the app using the path below.
* This also registers all views by calling wmf_registerViews (See YapDatabase+WMFViews.h)
*/
+ (instancetype)sharedInstance;
+ (instancetype)wmf_databaseWithDefaultConfiguration;
+ (instancetype)wmf_databaseWithDefaultConfigurationAtPath:(NSString *)path;
/**
* The default database path.
* This is used for the sharedInstance
*
* @return A path
*/
+ (NSString *)wmf_databasePath;
+ (NSString *)wmf_appSpecificDatabasePath;
- (YapDatabaseConnection *)wmf_newReadConnection;
- (YapDatabaseConnection *)wmf_newLongLivedReadConnection;
- (YapDatabaseConnection *)wmf_newWriteConnection;
/**
* Convienence method for registerExtension:withName:
*
* @param view The view to register
* @param name The neame of the view
*/
- (void)wmf_registerView:(YapDatabaseView *)view withName:(NSString *)name;
@end
|
/*
File: MotionPrimitives.h
Authors:
Indranil Saha (isaha@cse.iitk.ac.in)
Ankush Desai(ankush@eecs.berkeley.edu)
This file defines data types for storing the robot state, position and motion primitive information.
*/
#include <iostream>
#include <vector>
using namespace std;
struct _RobotState
{
int velocity;
//int configuration;
};
typedef struct _RobotState RobotState;
struct _RobotPosition
{
int x;
int y;
};
typedef struct _RobotPosition RobotPosition;
typedef std::vector<RobotPosition> RobotPosition_Vector;
class MotionPrimitive
{
private:
RobotState q_i;
RobotState q_f;
RobotPosition pos_f;
float cost;
RobotPosition_Vector swath;
RobotPosition pos_min;
RobotPosition pos_max;
public:
MotionPrimitive(RobotState, RobotState, RobotPosition, float, RobotPosition_Vector, RobotPosition, RobotPosition);
RobotState get_q_i();
RobotState get_q_f();
RobotPosition get_pos_f();
float get_cost();
RobotPosition_Vector get_swath();
RobotPosition get_pos_min();
RobotPosition get_pos_max();
~MotionPrimitive();
};
|
#pragma once
#include "common.h"
#include "base_objectBase.h"
#include "image.h"
#include <memory>
class Message : public ObjectBase , public std::enable_shared_from_this<Message>{
private:
MessageType type;
public:
Message(Point pos, MessageType type);
void update() override;
void draw() const override;
void addDraw() override;
void startShowing();
};
class Rank : public ObjectBase, public std::enable_shared_from_this<Rank> {
private:
ScoreRank type;
int time;
double first_expansion, final_expansion;
public:
Rank(Point pos, ScoreRank type);
void update() override;
void draw() const override;
void addDraw() override;
void startShowing(double start_exp, double final_exp, int time);
void changeType(ScoreRank type) { this->type = type; }
};
|
/* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <AsyncDisplayKit/ASLayoutController.h>
#import <AsyncDisplayKit/ASBaseDefines.h>
NS_ASSUME_NONNULL_BEGIN
@interface ASAbstractLayoutController : NSObject <ASLayoutController>
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType;
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType;
@end
NS_ASSUME_NONNULL_END
|
/* Example from Head First C.
Downloaded from https://github.com/twcamper/head-first-c
Modified by Allen Downey.
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <wait.h>
void error(char *msg)
{
fprintf(stderr, "%s: %s\n", msg, strerror(errno));
exit(1);
}
int main(int argc, char *argv[])
{
if (argc < 2) {
fprintf(stderr, "Usage: %s <search phrase>\n", argv[0]);
return 1;
}
const char *PYTHON = "/usr/bin/python2";
const char *SCRIPT = "rssgossip.py";
char *feeds[] = {
"http://www.nytimes.com/services/xml/rss/nyt/Africa.xml",
"http://www.nytimes.com/services/xml/rss/nyt/Americas.xml",
"http://www.nytimes.com/services/xml/rss/nyt/MiddleEast.xml",
"http://www.nytimes.com/services/xml/rss/nyt/Europe.xml",
"http://www.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml"
};
int num_feeds = 5;
char *search_phrase = argv[1];
char var[255];
for (int i=0; i<num_feeds; i++) {
sprintf(var, "RSS_FEED=%s", feeds[i]);
char *vars[] = {var, NULL};
int res = execle(PYTHON, PYTHON, SCRIPT, search_phrase, NULL, vars);
if (res == -1) {
error("Can't run script.");
}
}
return 0;
}
|
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int isRotation(char *str1, char *str2) {
int size = (strlen(str1) * 2) + 1;
char str[size];
strcpy(str, str1);
strcat(str, str1);
str[size-1] = 0;
return strstr(str, str2) == 0 ? 0 : 1;
}
int main() {
// tests
char str1[] = "This is a test string ";
char str2[] = "a test string This is ";
int actual = isRotation(str1, str2);
assert(actual == 1);
char str3[] = "Test";
char str4[] = "estT";
actual = isRotation(str3, str4);
assert(actual == 1);
char str5[] = "Test";
char str6[] = "esz";
actual = isRotation(str5, str6);
assert(actual == 0);
return 0;
}
|
#ifndef ALINOUS_COMPILE_STMT_TRYBLOCK_H_
#define ALINOUS_COMPILE_STMT_TRYBLOCK_H_
namespace alinous{namespace annotation{
class OneSource;
}}
namespace alinous {namespace compile {namespace analyse {
class SourceValidator;}}}
namespace alinous {namespace compile {
class IAlinousElementVisitor;}}
namespace alinous {namespace compile {
class AbstractSrcElement;}}
namespace alinous {namespace compile {namespace analyse {
class SrcAnalyseContext;}}}
namespace alinous {namespace remote {namespace socket {
class NetworkBinaryBuffer;}}}
namespace alinous {namespace compile {namespace stmt {
class AbstractAlinousStatement;}}}
namespace alinous {namespace remote {namespace socket {
class ICommandData;}}}
namespace alinous {namespace runtime {namespace dom {
class VariableException;}}}
namespace alinous {
class ThreadContext;
}
namespace alinous {namespace compile {namespace stmt {
using namespace ::alinous;
using namespace ::java::lang;
using ::java::util::Iterator;
using ::alinous::compile::AbstractSrcElement;
using ::alinous::compile::IAlinousElementVisitor;
using ::alinous::compile::analyse::SourceValidator;
using ::alinous::compile::analyse::SrcAnalyseContext;
using ::alinous::remote::socket::ICommandData;
using ::alinous::remote::socket::NetworkBinaryBuffer;
using ::alinous::runtime::dom::VariableException;
class TryBlock final : public AbstractAlinousStatement {
public:
TryBlock(const TryBlock& base) = default;
public:
TryBlock(ThreadContext* ctx) throw() ;
void __construct_impl(ThreadContext* ctx) throw() ;
virtual ~TryBlock() throw();
virtual void __releaseRegerences(bool prepare, ThreadContext* ctx) throw();
public:
void validate(SourceValidator* validator, ThreadContext* ctx) throw() final;
bool visit(IAlinousElementVisitor* visitor, AbstractSrcElement* parent, ThreadContext* ctx) throw() final;
bool analyse(SrcAnalyseContext* context, bool leftValue, ThreadContext* ctx) throw() final;
IStatement::StatementType getType(ThreadContext* ctx) throw() final;
void readData(NetworkBinaryBuffer* buff, ThreadContext* ctx) final;
void writeData(NetworkBinaryBuffer* buff, ThreadContext* ctx) throw() final;
public:
static bool __init_done;
static bool __init_static_variables();
public:
static void __cleanUp(ThreadContext* ctx);
};
}}}
#endif /* end of ALINOUS_COMPILE_STMT_TRYBLOCK_H_ */
|
//
// RefreshHeader.h
// SGPullToRefresh
//
// Created by ZhengXiankai on 15/5/19.
// Copyright (c) 2015年 ZhengXiankai. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef enum{
PullToRefreshHeaderViewStateNormal,
PullToRefreshHeaderViewStateReady,
PullToRefreshHeaderViewStateRefreshing,
} PullToRefreshHeaderViewState;
@protocol PullToRefreshHeaderViewDelegate <NSObject>
- (void)setState:(PullToRefreshHeaderViewState)state;
- (void)setLastRefeshData:(NSDate *)date;
@end
@interface PullToRefreshHeaderView : UIView <PullToRefreshHeaderViewDelegate>
@end
|
//
// Tomato Media
// 公共头文件
// 作者:SunnyCase
// 创建时间:2015-08-04
//
#pragma once
#define DEFINE_NS_CORE namespace Tomato { namespace Core {
#define END_NS_CORE }}
#define NS_CORE Tomato::Core
#define DEFINE_NS_MEDIA namespace Tomato { namespace Media {
#define END_NS_MEDIA }}
#define NS_MEDIA Tomato::Media
#ifndef DEFINE_NS_ONLY
#ifdef TOMATO_CORE_EXPORTS
#define TOMATO_CORE_API __declspec(dllexport)
#else
#define TOMATO_CORE_API __declspec(dllimport)
#endif
#ifdef TOMATO_MEDIA_EXPORTS
#define TOMATO_MEDIA_API __declspec(dllexport)
#else
#define TOMATO_MEDIA_API __declspec(dllimport)
#endif
#ifdef __cplusplus_winrt
#include "winrt/platform.h"
#else
#include "desktop/platform.h"
#endif
#define DEFINE_PROPERTY_GET(name, type) __declspec(property(get = get_##name)) type name
#define ARGUMENT_NOTNULL_HR(pointer) if(!(pointer)) return E_POINTER
#include <functional>
#include <memory>
#include <type_traits>
///<summary>终结器</summary>
template<typename TCall>
class finalizer final
{
public:
finalizer(TCall&& action)
:action(std::forward<decltype(action)>(action))
{
}
finalizer(finalizer&&) = default;
finalizer& operator=(finalizer&&) = default;
~finalizer()
{
action();
}
private:
TCall action;
};
template<typename TCall>
finalizer<TCall> make_finalizer(TCall&& action)
{
return finalizer<TCall>(std::forward<decltype(action)>(action));
}
#ifdef _WIN32
template<class T>
struct cotaskmem_deleter
{
template<typename = std::enable_if_t<std::is_array<T>::value>>
void operator()(T handle) const noexcept
{
CoTaskMemFree(handle);
}
void operator()(T* handle) const noexcept
{
CoTaskMemFree(handle);
}
};
template<class T>
using unique_cotaskmem = std::unique_ptr<T, cotaskmem_deleter<T>>;
#endif
#include <chrono>
typedef std::ratio<1, 10000000> hn;
typedef std::chrono::duration<long long, hn> hnseconds;
#endif
|
/*
Implementation of POSIX directory browsing functions and types for Win32.
Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com)
History: Created March 1997. Updated June 2003 and July 2012.
Rights: See end of file.
*/
#include <TotemScriptTest/dirent.h>
#ifdef __cplusplus
extern "C"
{
#endif
DIR *opendir(const char *name)
{
DIR *dir = 0;
if (name && name[0])
{
size_t base_length = strlen(name);
const char *all = /* search pattern must end with suitable wildcard */
strchr("/\\", name[base_length - 1]) ? "*" : "/*";
size_t nameLength = base_length + strlen(all) + 1;
if ((dir = (DIR *)malloc(sizeof *dir)) != 0 &&
(dir->name = (char *)malloc(nameLength)) != 0)
{
strcpy_s(dir->name, nameLength, name);
strcat_s(dir->name, nameLength, all);
if ((dir->handle =
(handle_type)_findfirst(dir->name, &dir->info)) != -1)
{
dir->result.d_name = 0;
}
else /* rollback */
{
free(dir->name);
free(dir);
dir = 0;
}
}
else /* rollback */
{
free(dir);
dir = 0;
errno = ENOMEM;
}
}
else
{
errno = EINVAL;
}
return dir;
}
int closedir(DIR *dir)
{
int result = -1;
if (dir)
{
if (dir->handle != -1)
{
result = _findclose(dir->handle);
}
free(dir->name);
free(dir);
}
if (result == -1) /* map all errors to EBADF */
{
errno = EBADF;
}
return result;
}
struct dirent *readdir(DIR *dir)
{
struct dirent *result = 0;
if (dir && dir->handle != -1)
{
if (!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1)
{
result = &dir->result;
result->d_name = dir->info.name;
}
}
else
{
errno = EBADF;
}
return result;
}
void rewinddir(DIR *dir)
{
if (dir && dir->handle != -1)
{
_findclose(dir->handle);
dir->handle = (handle_type)_findfirst(dir->name, &dir->info);
dir->result.d_name = 0;
}
else
{
errno = EBADF;
}
}
#ifdef __cplusplus
}
#endif
/*
Copyright Kevlin Henney, 1997, 2003, 2012. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that this copyright and permissions notice appear in all copies and
derivatives.
This software is supplied "as is" without express or implied warranty.
But that said, if there are any problems please get in touch.
*/
|
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/GlobalDefines.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingObject.h"
#include "IfcResourceLevelRelationship.h"
class IFCQUERY_EXPORT IfcProperty;
class IFCQUERY_EXPORT IfcText;
//ENTITY
class IFCQUERY_EXPORT IfcPropertyDependencyRelationship : public IfcResourceLevelRelationship
{
public:
IfcPropertyDependencyRelationship() = default;
IfcPropertyDependencyRelationship( int id );
virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options );
virtual void getStepLine( std::stringstream& stream ) const;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
virtual void readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map );
virtual void setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self );
virtual size_t getNumAttributes() { return 5; }
virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
virtual void unlinkFromInverseCounterparts();
virtual const char* className() const { return "IfcPropertyDependencyRelationship"; }
virtual const std::wstring toString() const;
// IfcResourceLevelRelationship -----------------------------------------------------------
// attributes:
// shared_ptr<IfcLabel> m_Name; //optional
// shared_ptr<IfcText> m_Description; //optional
// IfcPropertyDependencyRelationship -----------------------------------------------------------
// attributes:
shared_ptr<IfcProperty> m_DependingProperty;
shared_ptr<IfcProperty> m_DependantProperty;
shared_ptr<IfcText> m_Expression; //optional
};
|
//
// MBProgressHUD+MJ.h
//
// Created by mj on 13-4-18.
// Copyright (c) 2013年 itcast. All rights reserved.
//
#import "MBProgressHUD.h"
@interface MBProgressHUD (MJ)
+ (void)showSuccess:(NSString *)success toView:(UIView *)view;
+ (void)showError:(NSString *)error toView:(UIView *)view;
+ (MBProgressHUD *)showMessage:(NSString *)message toView:(UIView *)view;
+ (void)showSuccess:(NSString *)success;
+ (void)showError:(NSString *)error;
//单纯的显示会自动消失的文字
+ (void)showPureMsg:(NSString *)msg;
//单纯的一直转圈圈
+ (MBProgressHUD *)showMessage:(NSString *)message;
+ (void)hideHUDForView:(UIView *)view;
+ (void)hideHUD;
@end
|
//
// Created by Frank Gregor on 18.01.15.
// Copyright (c) 2015 cocoa:naut. All rights reserved.
//
/*
The MIT License (MIT)
Copyright © 2014 Frank Gregor, <phranck@cocoanaut.com>
http://cocoanaut.mit-license.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.
*/
@interface CCNLaunchAtLoginItem : NSObject
/**
Creates and returns an instance of `CCNLaunchAtLoginItem` using the given application bundle.
@param bundle An application bundle to create the LoginItem for.
@return An instance of `CCNLaunchAtLoginItem`.
*/
+ (instancetype)itemForBundle:(NSBundle *)bundle;
/**
Returns a boolean value that indicates whether the given application bundle has an active LoginItem.
@return `YES` if the application bundle has an active LoginItem otherwise `NO`.
*/
- (BOOL)isActive;
/**
Installs a LoginItem for the given application bundle. The application will be launched automatically on login.
*/
- (void)activate;
/**
Removes the LoginItem for the given application bundle. The application will no longer be launched on login.
*/
- (void)deActivate;
@end
|
/*
* PIR LIBRARY FOR SPARK CORE
* =======================================================
* Copy this into a new application at:
* https://www.spark.io/build and go nuts!
* -------------------------------------------------------
* Author: Oliver Martini
* Date: Jul 29th 2014
* =======================================================
* https://github.com/olivermartini/SparkCore-PIR
*/
#ifndef _OM_PIR
#define _OM_PIR
// Make library cross-compatiable
// with Arduino, GNU C++ for tests, and Spark.
//#if defined(ARDUINO) && ARDUINO >= 100
//#include "Arduino.h"
//#elif defined(SPARK)
//#include "application.h"
//#endif
// TEMPORARY UNTIL the stuff that supports the code above is deployed to the build IDE
#include "application.h"
namespace OM
{
class Pir {
private:
int pin;
bool state;
bool pinState;
int calibrateTime;
public:
Pir(int _pin, bool _pirState, int _pinState, int _calibrateTime);
Pir(int _pin);
void setupPinMode();
bool calibrated();
void readTheSensor();
int getPin();
bool getPinState();
bool getState();
bool isHigh();
void setHigh();
void setLow();
};
}
#endif
|
/* -------------------------------------------------------------------------------------- *\
menu_direction.h
Header file for <program>:: Action Bar menu
to select animation direction
Author: Peter Deutsch (engineerbill@stemchest.com)
Date Created: 8/16/13 - implemented for Tempus Fugit
Modified: 9/7/13 - adapated for Nickleodeon app
\* -------------------------------------------------------------------------------------- */
#ifndef TF_MENU_DIRECTION_BUTTONS_H
#define TF_MENU_DIRECTION_BUTTONS_H
#define NUMBER_OF_CHOICES 2
#define BUTTON_DEFAULT 0
#define BUTTON_FORWARD 0
#define BUTTON_REVERSE 1
extern void menu_direction_show_window();
extern void menu_direction_init();
extern void menu_direction_deinit();
#endif
|
#ifndef _PARSECLI_H_
#define _PARSECLI_H_
#include <string>
#include <ostream>
#include <vector>
struct CLI_Input
{
std::string inputFile;
std::string puzzle;
std::ostream* output;
bool singleLine;
bool printBoard;
bool validCheck;
bool inputLegal;
};
struct GEN_Input
{
std::ostream* output;
int count;
int genType;
bool printSolution;
};
void ParseGeneration(std::vector<std::string> args, std::ofstream& file, GEN_Input& input);
CLI_Input ParseCLI(std::vector<std::string> args, std::ofstream& file);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.